Class ClassicWidget.WidgetDimensionManager
java.lang.Object
de.kaffeemitkoffein.tinyweatherforecastgermany.ClassicWidget.WidgetDimensionManager
- Enclosing class:
ClassicWidget
This class provides some methods to determine the approximate current size of a widget in pixels.
-
Constructor Summary
ConstructorsConstructorDescriptionWidgetDimensionManager(Context c, AppWidgetManager awm, int widget_instance, String calledClassName) Public constructor to be called from the widget. -
Method Summary
Modifier and TypeMethodDescriptionfloatgetFontHeightInPixels(float fontsize) Gets the font height in pixels.floatgetFontHeightInSP(float fontsizePixels) floatfloatGets the approximate current widget height in pixels.intGets the approximate current widget height in pixels.floatGets the approximate current widget width in pixels.intGets the approximate current widget width in pixels.floatgetXPixelsFromDpi(float dpi) intgetXPixelsFromDpiInt(int dpi) floatgetYPixelsFromDPI(float dpi) intgetYPixelsFromDPIInt(int dpi)
-
Constructor Details
-
WidgetDimensionManager
public WidgetDimensionManager(Context c, AppWidgetManager awm, int widget_instance, String calledClassName) Public constructor to be called from the widget. It fills all the local variables with values.- Parameters:
c-awm-widget_instance-
-
-
Method Details
-
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:
-
getFontHeightInSP
public float getFontHeightInSP(float fontsizePixels) -
getXPixelsFromDpi
public float getXPixelsFromDpi(float dpi) -
getYPixelsFromDPI
public float getYPixelsFromDPI(float dpi) -
getXPixelsFromDpiInt
public int getXPixelsFromDpiInt(int dpi) -
getYPixelsFromDPIInt
public int getYPixelsFromDPIInt(int dpi)
-