Class ForecastBitmap
- java.lang.Object
-
- de.kaffeemitkoffein.tinyweatherforecastgermany.ForecastBitmap
-
public class ForecastBitmap extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ForecastBitmap.LayoutParams
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clearBitmapCache()
static Bitmap
getCloudCoverChart(Context context, Weather.WeatherInfo weatherInfo, int width, int height)
static Paint
GetDefaultLinePaint(int color, int lineWidth)
static int
getDisplayOrientation(Context context)
Bitmap
getForecastBitmap()
ForecastBitmap.LayoutParams
getLayoutParams(Context context)
static Bitmap
getOverviewChart(Context context, int width, int height, java.util.ArrayList<Weather.WeatherInfo> weatherInfos, java.util.ArrayList<WeatherWarning> warnings)
static float
getPhysicalDisplayRatio(Context context)
Determines the display ratio based on the physical screen size in inches.static float
getPixelDisplayRatio(Context context)
Determines the display ratio of the screen based on the screen resolution in pixels.static Bitmap
getPrecipitationChart(Context context, Weather.WeatherInfo weatherInfo, int width, int height, boolean isLandscape)
static Bitmap
getPrecipitationChartRaw(Context context, Weather.WeatherInfo weatherInfo, int width, int height, int maxValueX, int maxValueY)
-
-
-
Method Detail
-
getLayoutParams
public ForecastBitmap.LayoutParams getLayoutParams(Context context)
-
clearBitmapCache
public static void clearBitmapCache()
-
getForecastBitmap
public Bitmap getForecastBitmap()
-
getPixelDisplayRatio
public static float getPixelDisplayRatio(Context context)
Determines the display ratio of the screen based on the screen resolution in pixels. Pixels may have different denities in the x- and y-axis. Therefore use getPhysicalDisplayRatio to determine the real (physical) screen ratio based on the screen size in inches.- Parameters:
context
- the current context- Returns:
- the screen ratio, or 0 if the display metrics are not available.
-
getPhysicalDisplayRatio
public static float getPhysicalDisplayRatio(Context context)
Determines the display ratio based on the physical screen size in inches. This may give a different result as calculating the display ratio from pixels, since pixel densities may be different for the x- and the y- axis.- Parameters:
context
- the current context- Returns:
- display ratio, or 0 if the display metrics are not available.
-
getDisplayOrientation
public static int getDisplayOrientation(Context context)
-
getPrecipitationChartRaw
public static Bitmap getPrecipitationChartRaw(Context context, Weather.WeatherInfo weatherInfo, int width, int height, int maxValueX, int maxValueY)
-
getPrecipitationChart
public static Bitmap getPrecipitationChart(Context context, Weather.WeatherInfo weatherInfo, int width, int height, boolean isLandscape)
-
getCloudCoverChart
public static Bitmap getCloudCoverChart(Context context, Weather.WeatherInfo weatherInfo, int width, int height)
-
GetDefaultLinePaint
public static Paint GetDefaultLinePaint(int color, int lineWidth)
-
getOverviewChart
public static Bitmap getOverviewChart(Context context, int width, int height, java.util.ArrayList<Weather.WeatherInfo> weatherInfos, java.util.ArrayList<WeatherWarning> warnings)
-
-