Class ClassicWidget.WidgetDimensionManager

java.lang.Object
de.kaffeemitkoffein.tinyweatherforecastgermany.ClassicWidget.WidgetDimensionManager
Enclosing class:
ClassicWidget

public static class ClassicWidget.WidgetDimensionManager extends Object
This class provides some methods to determine the approximate current size of a widget in pixels.
  • 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)