Class 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.
    • Constructor Detail

      • WidgetDimensionManager

        public WidgetDimensionManager​(Context c,
                                      AppWidgetManager awm,
                                      int widget_instance)
        Public constructor to be called from the widget. It fills all the local variables with values.
        Parameters:
        c -
        awm -
        widget_instance -
    • 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: