Class ClassicWidget.WidgetDimensionManager
- java.lang.Object
-
- de.kaffeemitkoffein.tinyweatherforecastgermany.ClassicWidget.WidgetDimensionManager
-
- Enclosing class:
- ClassicWidget
public class ClassicWidget.WidgetDimensionManager extends java.lang.Object
This class provides some methods to determine the approximate current size of a widget in pixels.
-
-
Constructor Summary
Constructors Constructor Description WidgetDimensionManager(Context c, AppWidgetManager awm, int widget_instance)
Public constructor to be called from the widget.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description float
getFontHeightInPixels(float fontsize)
Gets the font height in pixels.float
getScaledDensity()
float
getWidgetHeight()
Gets the approximate current widget height in pixels.int
getWidgetHeightInt()
Gets the approximate current widget height in pixels.float
getWidgetWidth()
Gets the approximate current widget width in pixels.int
getWidgetWidthInt()
Gets the approximate current widget width in pixels.
-
-
-
Method Detail
-
getWidgetWidth
public float getWidgetWidth()
Gets the approximate current widget width in pixels.- Returns:
-
getWidgetHeight
public float getWidgetHeight()
Gets the approximate current widget height in pixels.- Returns:
-
getWidgetWidthInt
public int getWidgetWidthInt()
Gets the approximate current widget width in pixels.- Returns:
-
getWidgetHeightInt
public int getWidgetHeightInt()
Gets the approximate current widget height in pixels.- Returns:
-
getScaledDensity
public float getScaledDensity()
-
getFontHeightInPixels
public float getFontHeightInPixels(float fontsize)
Gets the font height in pixels.- Parameters:
fontsize
- is the fontsize in sp- Returns:
-
-