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 static class
ForecastBitmap.BBox
static class
ForecastBitmap.BBoxBitmap
class
ForecastBitmap.LayoutParams
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
fadeInAnimation(ImageView imageView, long duration)
static void
fadeOutAnimation(ImageView imageView, long duration)
static Bitmap
getCloudCoverChart(Context context, Weather.WeatherInfo weatherInfo, int width, int height)
static Drawable
getColoredBox(Context context, int color)
static Paint
GetDefaultLinePaint(int color, int lineWidth)
static Paint
GetDefaultWindPaint(int color, int lineWidth)
static int
getDisplayOrientation(Context context)
float
getForecastBarHeight()
static float
getForecastBarHeight(DisplayMetrics displayMetrics)
Bitmap
getForecastBitmap()
static Bitmap
getHorizontalBar(Context context, int width, int height, int value, int max, int color, int border)
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
getPollenAreasBitmap(Context context, int pollenType, int timeParam)
static Bitmap
getPollenLegendBox(Context context, int size, int pollenType)
static Bitmap
getPrecipitationChart(Context context, Weather.WeatherInfo weatherInfo, int width, int height, boolean isLandscape)
static Bitmap
getPrecipitationChart2(Context context, Weather.WeatherInfo weatherInfo)
static Bitmap
getPrecipitationChartRaw(Context context, Weather.WeatherInfo weatherInfo, int width, int height, int maxValueX, int maxValueY)
static int
getScreenWidthInPixels(Context context)
static java.lang.String
getWindScaleString(Context context)
-
-
-
Method Detail
-
getForecastBarHeight
public float getForecastBarHeight()
-
getForecastBarHeight
public static float getForecastBarHeight(DisplayMetrics displayMetrics)
-
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.
-
getScreenWidthInPixels
public static int getScreenWidthInPixels(Context context)
-
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)
-
getPrecipitationChart2
public static Bitmap getPrecipitationChart2(Context context, Weather.WeatherInfo weatherInfo)
-
getCloudCoverChart
public static Bitmap getCloudCoverChart(Context context, Weather.WeatherInfo weatherInfo, int width, int height)
-
GetDefaultLinePaint
public static Paint GetDefaultLinePaint(int color, int lineWidth)
-
GetDefaultWindPaint
public static Paint GetDefaultWindPaint(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)
-
getWindScaleString
public static java.lang.String getWindScaleString(Context context)
-
getHorizontalBar
public static Bitmap getHorizontalBar(Context context, int width, int height, int value, int max, int color, int border)
-
getPollenLegendBox
public static Bitmap getPollenLegendBox(Context context, int size, int pollenType)
-
getPollenAreasBitmap
public static Bitmap getPollenAreasBitmap(Context context, int pollenType, int timeParam)
-
getColoredBox
public static Drawable getColoredBox(Context context, int color)
-
fadeOutAnimation
public static void fadeOutAnimation(ImageView imageView, long duration)
-
fadeInAnimation
public static void fadeInAnimation(ImageView imageView, long duration)
-
-