Class ClassicWidget.WidgetDimensionManager
- java.lang.Object
-
- de.kaffeemitkoffein.tinyweatherforecastgermany.ClassicWidget.WidgetDimensionManager
-
- Enclosing class:
- ClassicWidget
public static class ClassicWidget.WidgetDimensionManager extends java.lang.ObjectThis 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, java.lang.String calledClassName)Public constructor to be called from the widget.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetFontHeightInPixels(float fontsize)Gets the font height in pixels.floatgetFontHeightInSP(float fontsizePixels)floatgetScaledDensity()floatgetWidgetHeight()Gets the approximate current widget height in pixels.intgetWidgetHeightInt()Gets the approximate current widget height in pixels.floatgetWidgetWidth()Gets the approximate current widget width in pixels.intgetWidgetWidthInt()Gets the approximate current widget width in pixels.floatgetXPixelsFromDpi(float dpi)intgetXPixelsFromDpiInt(int dpi)floatgetYPixelsFromDPI(float dpi)intgetYPixelsFromDPIInt(int dpi)
-
-
-
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:
-
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)
-
-