Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
955230f233 | ||
|
|
c56a601e5c | ||
|
|
107cff1f86 | ||
|
|
89fbc26dd2 | ||
|
|
58e5c45ef0 |
@@ -89,7 +89,7 @@ android {
|
||||
applicationId "com.mowesta.android.app"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 29
|
||||
versionCode 15
|
||||
versionCode 16
|
||||
versionName "${version}"
|
||||
buildConfigField "long", "BUILD_TIME", System.currentTimeMillis() + "L"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
|
||||
@@ -396,9 +396,9 @@ public class CityViewModel extends AbstractPlaceViewModel {
|
||||
*/
|
||||
private void updateVideos() {
|
||||
if (city.getValue() == null || videos.getValue() == null) {
|
||||
iconEurope.setValue(null);
|
||||
iconGlobal.setValue(null);
|
||||
cosmoEurope.setValue(null);
|
||||
iconEurope.setValue(new ArrayList<>());
|
||||
iconGlobal.setValue(new ArrayList<>());
|
||||
cosmoEurope.setValue(new ArrayList<>());
|
||||
} else {
|
||||
List<VideoViewModel> ieu = new ArrayList<>();
|
||||
List<VideoViewModel> igl = new ArrayList<>();
|
||||
|
||||
@@ -58,7 +58,7 @@ public class ForecastWidgetProvider extends AbstractWidgetProvider {
|
||||
/**
|
||||
* The space to allocate for a single day view.
|
||||
*/
|
||||
private static final int WIDTH_DAY = 80;
|
||||
private static final int WIDTH_DAY = 75;
|
||||
|
||||
/**
|
||||
* The width for borders around the day views.
|
||||
@@ -121,10 +121,12 @@ public class ForecastWidgetProvider extends AbstractWidgetProvider {
|
||||
views.setViewVisibility(R.id.widget_container_text, width < (BREAK_HORIZONTAL_2 * scale) ? View.GONE : View.VISIBLE);
|
||||
views.removeAllViews(R.id.widget_container_days);
|
||||
int count = Math.min(days.size(), (int)((width - WIDTH_BORDER) / (WIDTH_DAY * scale)));
|
||||
if (height > (BREAK_VERTICAL * scale) && count > 1) {
|
||||
if (height > (BREAK_VERTICAL * scale) && count > 0) {
|
||||
views.addView(R.id.widget_container_days, new RemoteViews(context.getPackageName(), R.layout.widget_forecast_spacer));
|
||||
for (int i = 0; i < count; i++) {
|
||||
RemoteViews day = createDayView(context, days.get(i), unit);
|
||||
views.addView(R.id.widget_container_days, day);
|
||||
views.addView(R.id.widget_container_days, new RemoteViews(context.getPackageName(), R.layout.widget_forecast_spacer));
|
||||
}
|
||||
}
|
||||
MowestaSettings settings = new MowestaSettings((Application) context.getApplicationContext());
|
||||
|
||||
@@ -103,13 +103,13 @@ public class WidgetService extends JobIntentService {
|
||||
long time = System.currentTimeMillis();
|
||||
City[] city = new City[] { widget.getData(City.class) };
|
||||
long[] dataTime = new long[] { widget.getDataTime() };
|
||||
if (city[0] == null || dataTime[0] - time > DELAY_DATA) {
|
||||
if (city[0] == null || time - dataTime[0] > DELAY_DATA) {
|
||||
city[0] = api.getCity(widget.getDataId());
|
||||
dataTime[0] = time;
|
||||
}
|
||||
WeatherForecast[] content = new WeatherForecast[] { widget.getContent(WeatherForecast.class) };
|
||||
long[] contentTime = new long[] { widget.getContentTime() };
|
||||
if (content[0] == null || contentTime[0] - time > DELAY_CONTENT) {
|
||||
if (content[0] == null || time - contentTime[0] > DELAY_CONTENT) {
|
||||
content[0] = api.getCityForecast(widget.getDataId());
|
||||
contentTime[0] = time;
|
||||
}
|
||||
@@ -138,13 +138,13 @@ public class WidgetService extends JobIntentService {
|
||||
long time = System.currentTimeMillis();
|
||||
Device[] device = new Device[] { widget.getData(Device.class) };
|
||||
long[] dataTime = new long[] { widget.getDataTime() };
|
||||
if (device[0] == null || dataTime[0] - time > DELAY_DATA) {
|
||||
if (device[0] == null || time - dataTime[0] > DELAY_DATA) {
|
||||
device[0] = api.getDevice(widget.getDataId());
|
||||
dataTime[0] = time;
|
||||
}
|
||||
Measurement[] content = new Measurement[] { widget.getContent(Measurement.class) };
|
||||
long[] contentTime = new long[] { widget.getContentTime() };
|
||||
if (content[0] == null || contentTime[0] - time > DELAY_CONTENT) {
|
||||
if (content[0] == null || time - contentTime[0] > DELAY_CONTENT) {
|
||||
MeasurementPage page = api.getDeviceMeasurements(widget.getDataId(), 0l, time, 0, 1);
|
||||
if (page.getElements().size() > 0) {
|
||||
content[0] = page.getElements().get(0);
|
||||
|
||||
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 37 KiB |
@@ -5,7 +5,7 @@
|
||||
android:id="@+id/widget_forecast"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_vertical"
|
||||
tools:layout_width="260dp"
|
||||
tools:layout_width="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
@@ -14,18 +14,20 @@
|
||||
android:baselineAligned="false"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<include layout="@layout/widget_forecast_spacer"/>
|
||||
<LinearLayout
|
||||
android:id="@+id/widget_container_condition"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/widget_condition_temperature"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="28sp"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:shadowColor="@color/black"
|
||||
android:shadowDx="1"
|
||||
@@ -71,12 +73,13 @@
|
||||
android:id="@+id/widget_container_text"
|
||||
android:visibility="visible"
|
||||
android:orientation="vertical"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:gravity="start"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:id="@+id/widget_location_name"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:textColor="@color/white"
|
||||
android:shadowColor="@color/black"
|
||||
android:textStyle="bold"
|
||||
@@ -91,6 +94,8 @@
|
||||
tools:text="Bergheim (Troisdorf)"/>
|
||||
<TextView
|
||||
android:id="@+id/widget_condition_text"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:shadowColor="@color/black"
|
||||
@@ -104,7 +109,7 @@
|
||||
android:maxLines="1"
|
||||
tools:text="Überwiegend Sonnig"/>
|
||||
</LinearLayout>
|
||||
|
||||
<include layout="@layout/widget_forecast_spacer"/>
|
||||
</LinearLayout>
|
||||
<LinearLayout
|
||||
android:layout_marginTop="8dp"
|
||||
|
||||
@@ -2,13 +2,10 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
tools:layout_width="90dp"
|
||||
tools:layout_height="36dp"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="left"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
@@ -49,6 +46,8 @@
|
||||
android:textColor="@color/white"
|
||||
android:shadowColor="@color/black"
|
||||
android:shadowRadius="3"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:textStyle="bold"
|
||||
android:shadowDx="1"
|
||||
android:shadowDy="1"
|
||||
@@ -61,6 +60,8 @@
|
||||
<TextView
|
||||
android:id="@+id/widget_day_temperature"
|
||||
android:textColor="@color/white"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:textStyle="bold"
|
||||
android:shadowColor="@color/black"
|
||||
android:shadowDx="1"
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:baselineAligned="false"
|
||||
android:orientation="horizontal"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp">
|
||||
</LinearLayout>
|
||||
|
||||
@@ -64,6 +64,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:shadowColor="@color/black"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:textStyle="bold"
|
||||
android:shadowRadius="3"
|
||||
android:shadowDx="1"
|
||||
@@ -79,6 +81,8 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:shadowColor="@color/black"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:textStyle="bold"
|
||||
android:shadowRadius="3"
|
||||
android:shadowDx="1"
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
android:layout_gravity="center_vertical"
|
||||
android:textColor="@color/white"
|
||||
android:shadowColor="@color/black"
|
||||
android:paddingStart="1dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:textStyle="bold"
|
||||
android:shadowRadius="3"
|
||||
android:shadowDx="1"
|
||||
|
||||
@@ -24,7 +24,7 @@ allprojects {
|
||||
|
||||
// set version for our project
|
||||
group = 'com.mowesta'
|
||||
version = '1.0.15'
|
||||
version = '1.0.16'
|
||||
|
||||
// set versions for our libraries
|
||||
ext {
|
||||
|
||||
@@ -73,7 +73,7 @@ public class WeatherSessionBean extends AbstractPrincipalSessionBean {
|
||||
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
|
||||
public WeatherForecast getForecast(Coordinate location) {
|
||||
SearchManager manager = Search.getSearchManager(infinispanSession.getDataCache());
|
||||
List<WeatherForecastContainer> containers = WeatherForecastContainer.findByLocation(manager, location, 10);
|
||||
List<WeatherForecastContainer> containers = WeatherForecastContainer.findByLocation(manager, location, 20);
|
||||
// compute the map of forecasts (distance is considered since list is ordered)
|
||||
Map<WeatherSource, WeatherForecast> forecasts = new HashMap<>();
|
||||
for (int i = containers.size() - 1; i >= 0; i--) {
|
||||
|
||||