diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/Main.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/Main.java
index edc62be..1e0a8e2 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/Main.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/Main.java
@@ -137,16 +137,16 @@ public class Main extends Application {
favsSummaryUpdater.start(100);
- if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
- Logger.debug("[Main][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
- Locale locale = new Locale(AppConfiguration.locale);
- Locale.setDefault(locale);
- Resources resources = this.getResources();
- Configuration config = resources.getConfiguration();
- config.setLocale(locale);
- Logger.debug("[Main][onCreate][locale = " + locale.toLanguageTag() + "]");
- resources.updateConfiguration(config, resources.getDisplayMetrics());
- }
+// if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+// Logger.debug("[Main][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+// Locale locale = new Locale(AppConfiguration.locale);
+// Locale.setDefault(locale);
+// Resources resources = this.getResources();
+// Configuration config = resources.getConfiguration();
+// config.setLocale(locale);
+// Logger.debug("[Main][onCreate][locale = " + locale.toLanguageTag() + "]");
+// resources.updateConfiguration(config, resources.getDisplayMetrics());
+// }
}
private void recreateListOfFavs() {
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/MainActivity.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/MainActivity.java
index afaa71f..2c28f9f 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/MainActivity.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/MainActivity.java
@@ -74,6 +74,7 @@ public class MainActivity extends AppCompatActivity {
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
+ Logger.info("[MainActivity][onDestroy]");
}
/**
@@ -82,16 +83,31 @@ public class MainActivity extends AppCompatActivity {
@Override
protected void onResume() {
super.onResume();
+ Logger.info("[MainActivity][onResume]");
+
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ Logger.info("[MainActivity][onCreate]");
+
main = (Main) getApplication();
baseContext = getApplicationContext();
+ if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+ Logger.debug("[MainActivity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+ Locale locale = new Locale(AppConfiguration.locale);
+ Locale.setDefault(locale);
+ Resources resources = this.getResources();
+ Configuration config = resources.getConfiguration();
+ config.setLocale(locale);
+ Logger.debug("[MainActivity][onCreate][locale = " + locale.toLanguageTag() + "]");
+ resources.updateConfiguration(config, resources.getDisplayMetrics());
+ }
+
// create an event handler fired when a user click 'favourites' button
mainActImageButtonFavouritesClickEvent = new MainActImageButtonFavouritesClickEvent(this);
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/SettingsActivity.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/SettingsActivity.java
index 0bf234c..d30f2c4 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/SettingsActivity.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/SettingsActivity.java
@@ -16,6 +16,8 @@ import android.widget.Spinner;
import android.widget.Switch;
import android.widget.TextView;
+import org.tinylog.Logger;
+
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
import cc.pogoda.mobile.meteosystem.file.ConfigurationFile;
@@ -35,6 +37,9 @@ public class SettingsActivity extends AppCompatActivity {
AppCompatActivity act;
private static String languageNameFromShort(String shortName) {
+
+ Logger.info("[SettingsActivity][languageNameFromShort][shortName = " + shortName +"]");
+
switch (shortName) {
case "en-rUS": return "English";
case "pl": return "Polski";
@@ -65,6 +70,8 @@ public class SettingsActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
+ Logger.info("[SettingsActivity][onCreate]");
+
confFile = new ConfigurationFile(getBaseContext());
act = this;
@@ -141,6 +148,8 @@ public class SettingsActivity extends AppCompatActivity {
public void onItemSelected(AdapterView> adapterView, View view, int i, long l) {
String languageSelected = adapterView.getItemAtPosition(i).toString();
+ Logger.debug("[SettingsActivity][onCreate][AdapterView.OnItemSelectedListener()][languageSelected = " + languageSelected +"]");
+
switch (languageSelected) {
case "English": AppConfiguration.locale = "en-rUS"; break;
case "Polski": AppConfiguration.locale = "pl"; break;
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsActivity.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsActivity.java
index e0ea4af..5cf4033 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsActivity.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsActivity.java
@@ -6,6 +6,8 @@ import androidx.core.text.HtmlCompat;
import android.app.AlertDialog;
import android.content.DialogInterface;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.os.Bundle;
import android.os.Handler;
import android.text.Html;
@@ -19,6 +21,9 @@ import android.widget.ImageView;
import android.widget.TextView;
import org.greenrobot.eventbus.EventBus;
+import org.tinylog.Logger;
+
+import java.util.Locale;
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.activity.handler.StationDetailsActHumidityPlotButtonClickEvent;
@@ -29,6 +34,7 @@ import cc.pogoda.mobile.meteosystem.activity.handler.StationDetailsActWindSpeedP
import cc.pogoda.mobile.meteosystem.activity.handler.StationDetailsActSummaryButtonClickEvent;
import cc.pogoda.mobile.meteosystem.activity.handler.StationDetailsActWindRoseButtonClickEvent;
import cc.pogoda.mobile.meteosystem.activity.updater.StationBackgroundImageUpdater;
+import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
import cc.pogoda.mobile.meteosystem.type.AvailableParameters;
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
import cc.pogoda.mobile.meteosystem.type.WeatherStationListEvent;
@@ -159,11 +165,22 @@ public class StationDetailsActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
act = this;
+ station = (WeatherStation) getIntent().getSerializableExtra("station");
+
+ Logger.info("[StationDetailsActivity][onCreate][station.getSystemName() = " + station.getSystemName() +"]");
+
+ if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+ Logger.debug("[StationDetailsActivity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+ Locale locale = new Locale(AppConfiguration.locale);
+ Locale.setDefault(locale);
+ Resources resources = this.getResources();
+ Configuration config = resources.getConfiguration();
+ config.setLocale(locale);
+ resources.updateConfiguration(config, resources.getDisplayMetrics());
+ }
setContentView(R.layout.activity_station_details);
- station = (WeatherStation) getIntent().getSerializableExtra("station");
-
AvailableParameters parameters = station.getAvailableParameters();
stationName = findViewById(R.id.textViewStationName);
@@ -312,13 +329,28 @@ public class StationDetailsActivity extends AppCompatActivity {
station_lat = station.getLat();
station_lon = station.getLon();
+ stationSponsorUrl.setAutoLinkMask(0);
+ stationSponsorUrl.setMovementMethod(LinkMovementMethod.getInstance());
+ String anchorText;
+ if (station.getSponsorUrl().length() > 32) {
+ anchorText = getString(R.string.www_link);
+ } else {
+ anchorText = station.getSponsorUrl();
+ }
+ stationSponsorUrl.setMovementMethod(LinkMovementMethod.getInstance());
+ stationSponsorUrl.setText(
+ HtmlCompat.fromHtml(
+ "" + anchorText + "\n", HtmlCompat.FROM_HTML_MODE_LEGACY
+ )
+ );
+
// if (station.getSponsorUrl().length() > 32) {
// stationSponsorUrl.setClickable(true);
// stationSponsorUrl.setMovementMethod(LinkMovementMethod.getInstance());
// stationSponsorUrl.setText(Html.fromHtml("" + getString(R.string.www_link) + "\n", HtmlCompat.FROM_HTML_MODE_LEGACY));
// }
// else {
- stationSponsorUrl.setText(station.getSponsorUrl());
+// stationSponsorUrl.setText(station.getSponsorUrl());
// }
stationMoreInfo.setText(station.getMoreInfo());
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsDirection.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsDirection.java
index c9c5fd0..4668024 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsDirection.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsDirection.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.activity;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
@@ -21,11 +23,14 @@ import org.threeten.bp.ZoneId;
import org.threeten.bp.ZoneOffset;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
+import org.tinylog.Logger;
import java.util.ArrayList;
+import java.util.Locale;
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.activity.handler.PlotClickEvent;
+import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
import cc.pogoda.mobile.meteosystem.dao.LastStationDataDao;
import cc.pogoda.mobile.meteosystem.dao.StationDataDao;
import cc.pogoda.mobile.meteosystem.type.StationDetailsPlot;
@@ -125,10 +130,22 @@ public class StationDetailsPlotsDirection extends AppCompatActivity implements S
// get data length for this plot
dataLn = (int)getIntent().getExtras().get("data_ln");
- setContentView(R.layout.activity_station_details_plots);
-
station = (WeatherStation) getIntent().getSerializableExtra("station");
+ Logger.info("[StationDetailsPlotsDirection][onCreate][station.getSystemName() = " + station.getSystemName() +"][dataLn = " + dataLn +"]");
+
+ if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+ Logger.debug("[StationDetailsActivity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+ Locale locale = new Locale(AppConfiguration.locale);
+ Locale.setDefault(locale);
+ Resources resources = this.getResources();
+ Configuration config = resources.getConfiguration();
+ config.setLocale(locale);
+ resources.updateConfiguration(config, resources.getDisplayMetrics());
+ }
+
+ setContentView(R.layout.activity_station_details_plots);
+
// download data from web service
this.downloadDataFromWebservice();
@@ -325,6 +342,8 @@ public class StationDetailsPlotsDirection extends AppCompatActivity implements S
// utc timestamp
long utcTimestamp = utcTime.toEpochSecond();
+ Logger.debug("[StationDetailsPlotsDirection][downloadDataFromWebservice][station.getSystemName() = " + station.getSystemName() +"]");
+
if (this.dataLn < 0 || this.dataLn > 2) {
// last 2000 points of data, regardless the timescale
data = lastStationDataDao.getLastStationData(station.getSystemName());
@@ -345,6 +364,9 @@ public class StationDetailsPlotsDirection extends AppCompatActivity implements S
valuesWindDirection = new ArrayList<>();
if (data != null) {
+
+ Logger.debug("[StationDetailsPlotsDirection][downloadDataFromWebservice][data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
+
for (StationData d : data.list_of_station_data) {
valuesWindDirection.add(new Entry(d.epoch * 1000, d.winddir));
}
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsHumidity.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsHumidity.java
index 46f4636..cd86820 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsHumidity.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsHumidity.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.activity;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
@@ -21,11 +23,14 @@ import org.threeten.bp.ZoneId;
import org.threeten.bp.ZoneOffset;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
+import org.tinylog.Logger;
import java.util.ArrayList;
+import java.util.Locale;
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.activity.handler.PlotClickEvent;
+import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
import cc.pogoda.mobile.meteosystem.dao.LastStationDataDao;
import cc.pogoda.mobile.meteosystem.dao.StationDataDao;
import cc.pogoda.mobile.meteosystem.type.StationDetailsPlot;
@@ -147,6 +152,16 @@ public class StationDetailsPlotsHumidity extends AppCompatActivity implements Se
// get data length for this plot
dataLn = (int)getIntent().getExtras().get("data_ln");
+ if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+ Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+ Locale locale = new Locale(AppConfiguration.locale);
+ Locale.setDefault(locale);
+ Resources resources = this.getResources();
+ Configuration config = resources.getConfiguration();
+ config.setLocale(locale);
+ resources.updateConfiguration(config, resources.getDisplayMetrics());
+ }
+
setContentView(R.layout.activity_station_details_plots);
station = (WeatherStation) getIntent().getSerializableExtra("station");
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsTemperature.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsTemperature.java
index 3d522f2..6189bd2 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsTemperature.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsTemperature.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.activity;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
@@ -21,11 +23,14 @@ import org.threeten.bp.ZoneId;
import org.threeten.bp.ZoneOffset;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
+import org.tinylog.Logger;
import java.util.ArrayList;
+import java.util.Locale;
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.activity.handler.PlotClickEvent;
+import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
import cc.pogoda.mobile.meteosystem.dao.LastStationDataDao;
import cc.pogoda.mobile.meteosystem.dao.StationDataDao;
import cc.pogoda.mobile.meteosystem.type.StationDetailsPlot;
@@ -91,6 +96,8 @@ public class StationDetailsPlotsTemperature extends AppCompatActivity implements
// utc timestamp
long utcTimestamp = utcTime.toEpochSecond();
+ Logger.debug("[StationDetailsPlotsTemperature][downloadDataFromWebservice][station.getSystemName() = " + station.getSystemName() +"]");
+
if (this.dataLn < 0 || this.dataLn > 2) {
// last 2000 points of data, regardless the timescale
data = lastStationDataDao.getLastStationData(station.getSystemName());
@@ -109,6 +116,9 @@ public class StationDetailsPlotsTemperature extends AppCompatActivity implements
}
if (data instanceof ListOfStationData) {
+
+ Logger.debug("[StationDetailsPlotsTemperature][downloadDataFromWebservice][data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
+
for (StationData d : data.list_of_station_data) {
valuesTemperature.add(new Entry(d.epoch * 1000, d.temperature));
}
@@ -241,14 +251,26 @@ public class StationDetailsPlotsTemperature extends AppCompatActivity implements
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- // this activity layout is common for all plots
- setContentView(R.layout.activity_station_details_plots);
-
// get data length for this plot
dataLn = (int)getIntent().getExtras().get("data_ln");
station = (WeatherStation) getIntent().getSerializableExtra("station");
+ Logger.info("[StationDetailsPlotsTemperature][onCreate][station.getSystemName() = " + station.getSystemName() +"][dataLn = " + dataLn +"]");
+
+ if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+ Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+ Locale locale = new Locale(AppConfiguration.locale);
+ Locale.setDefault(locale);
+ Resources resources = this.getResources();
+ Configuration config = resources.getConfiguration();
+ config.setLocale(locale);
+ resources.updateConfiguration(config, resources.getDisplayMetrics());
+ }
+
+ // this activity layout is common for all plots
+ setContentView(R.layout.activity_station_details_plots);
+
// exit from the function if station object hasn't been added to the intent
if (station == null) {
return;
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsWind.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsWind.java
index 6648401..7067691 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsWind.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsPlotsWind.java
@@ -2,6 +2,8 @@ package cc.pogoda.mobile.meteosystem.activity;
import androidx.appcompat.app.AppCompatActivity;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
@@ -22,8 +24,10 @@ import org.threeten.bp.ZoneId;
import org.threeten.bp.ZoneOffset;
import org.threeten.bp.ZonedDateTime;
import org.threeten.bp.format.DateTimeFormatter;
+import org.tinylog.Logger;
import java.util.ArrayList;
+import java.util.Locale;
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.activity.handler.PlotClickEvent;
@@ -95,13 +99,26 @@ public class StationDetailsPlotsWind extends AppCompatActivity implements SeekBa
int lastDataIndex = 0;
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_station_details_plots);
// get data length for this plot
dataLn = (int)getIntent().getExtras().get("data_ln");
station = (WeatherStation) getIntent().getSerializableExtra("station");
+ Logger.info("[StationDetailsPlotsWind][onCreate][station.getSystemName() = " + station.getSystemName() +"][dataLn = " + dataLn +"]");
+
+ if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+ Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+ Locale locale = new Locale(AppConfiguration.locale);
+ Locale.setDefault(locale);
+ Resources resources = this.getResources();
+ Configuration config = resources.getConfiguration();
+ config.setLocale(locale);
+ resources.updateConfiguration(config, resources.getDisplayMetrics());
+ }
+
+ setContentView(R.layout.activity_station_details_plots);
+
// download data from web service
this.downloadDataFromWebservice();
@@ -201,6 +218,8 @@ public class StationDetailsPlotsWind extends AppCompatActivity implements SeekBa
// utc timestamp
long utcTimestamp = utcTime.toEpochSecond();
+ Logger.debug("[StationDetailsPlotsWind][downloadDataFromWebservice][station.getSystemName() = " + station.getSystemName() +"]");
+
if (this.dataLn < 0 || this.dataLn > 2) {
// last 2000 points of data, regardless the timescale
data = lastStationDataDao.getLastStationData(station.getSystemName());
@@ -222,6 +241,9 @@ public class StationDetailsPlotsWind extends AppCompatActivity implements SeekBa
valuesWindGusts = new ArrayList<>();
if (data instanceof ListOfStationData) {
+
+ Logger.debug("[StationDetailsPlotsWind][downloadDataFromWebservice][data.list_of_station_data.length = " + data.list_of_station_data.length +"]");
+
for (StationData d : data.list_of_station_data) {
valuesWindSpeed.add(new Entry(d.epoch * 1000, d.windspeed));
valuesWindGusts.add(new Entry(d.epoch * 1000, d.windgusts));
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsSummaryActivity.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsSummaryActivity.java
index 47aa0ad..ece2848 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsSummaryActivity.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsSummaryActivity.java
@@ -3,15 +3,22 @@ package cc.pogoda.mobile.meteosystem.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.util.TypedValue;
+import org.tinylog.Logger;
+
+import java.util.Locale;
+
import cc.pogoda.mobile.meteosystem.Main;
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityFromSummaryUpdater;
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityUpdater;
+import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
import cc.pogoda.mobile.meteosystem.dao.SummaryDao;
import cc.pogoda.mobile.meteosystem.type.StationSummaryActElements;
import cc.pogoda.mobile.meteosystem.type.WeatherStation;
@@ -44,10 +51,23 @@ public class StationDetailsSummaryActivity extends AppCompatActivity {
SummaryDao summary_dao = new SummaryDao();
super.onCreate(savedInstanceState);
- setContentView(R.layout.activity_station_details_summary);
station = (WeatherStation) getIntent().getSerializableExtra("station");
+ Logger.info("[StationDetailsSummaryActivity][onCreate][station.getSystemName() = " + station.getSystemName() +"]");
+
+ if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+ Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+ Locale locale = new Locale(AppConfiguration.locale);
+ Locale.setDefault(locale);
+ Resources resources = this.getResources();
+ Configuration config = resources.getConfiguration();
+ config.setLocale(locale);
+ resources.updateConfiguration(config, resources.getDisplayMetrics());
+ }
+
+ setContentView(R.layout.activity_station_details_summary);
+
elems.title = findViewById(R.id.textViewStationDetailsSummaryTitle);
elems.title.setText(station.getDisplayedName());
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsWindRoseActivity.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsWindRoseActivity.java
index 2f99012..63970f6 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsWindRoseActivity.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/StationDetailsWindRoseActivity.java
@@ -5,6 +5,8 @@ import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.os.Handler;
+import org.tinylog.Logger;
+
import cc.pogoda.mobile.meteosystem.Main;
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.activity.updater.StationDetailsValuesOnActivityFromSummaryUpdater;
@@ -41,6 +43,8 @@ public class StationDetailsWindRoseActivity extends AppCompatActivity {
station = (WeatherStation) getIntent().getSerializableExtra("station");
+ Logger.info("[StationDetailsWindRoseActivity][onCreate][station.getSystemName() = " + station.getSystemName() +"]");
+
main = (Main)getApplication();
// find all elements in the xml layout file and set the references in a holding object
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/TrendActivity.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/TrendActivity.java
index f2cb3e9..ef7ad34 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/TrendActivity.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/activity/TrendActivity.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.activity;
+import android.content.res.Configuration;
+import android.content.res.Resources;
import android.os.Bundle;
import com.google.android.material.bottomnavigation.BottomNavigationView;
@@ -12,10 +14,15 @@ import androidx.navigation.Navigation;
import androidx.navigation.ui.AppBarConfiguration;
import androidx.navigation.ui.NavigationUI;
+import org.tinylog.Logger;
+
+import java.util.Locale;
+
import cc.pogoda.mobile.meteosystem.R;
import cc.pogoda.mobile.meteosystem.activity.trend.pressure.PressureTrendFragmentDirections;
import cc.pogoda.mobile.meteosystem.activity.trend.temperature.TemperatureTrendFragmentDirections;
import cc.pogoda.mobile.meteosystem.activity.trend.wind.WindTrendFragmentDirections;
+import cc.pogoda.mobile.meteosystem.config.AppConfiguration;
public class TrendActivity extends AppCompatActivity {
@@ -30,6 +37,16 @@ public class TrendActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
String stationName = (String)getIntent().getExtras().get("station");
+ if (AppConfiguration.locale != null && !AppConfiguration.locale.equals("default") ) {
+ Logger.debug("[StationDetailsPlotsHumidity][onCreate][AppConfiguration.locale = " + AppConfiguration.locale + "]");
+ Locale locale = new Locale(AppConfiguration.locale);
+ Locale.setDefault(locale);
+ Resources resources = this.getResources();
+ Configuration config = resources.getConfiguration();
+ config.setLocale(locale);
+ resources.updateConfiguration(config, resources.getDisplayMetrics());
+ }
+
this.station = stationName;
Bundle bundle = new Bundle();
bundle.putString("station", stationName);
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/adapter/WeatherStationRecyclerViewAdapter.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/adapter/WeatherStationRecyclerViewAdapter.java
index 4e20722..b4c0b8b 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/adapter/WeatherStationRecyclerViewAdapter.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/adapter/WeatherStationRecyclerViewAdapter.java
@@ -101,11 +101,12 @@ public class WeatherStationRecyclerViewAdapter extends RecyclerView.Adapter 24) {
- textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16.0f);
- }
- else {
- textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20.0f);
+ if (!reason.equals(ParceableFavsCallReason.Reason.FAVOURITES)) {
+ if (station.getDisplayedName().length() > 22) {
+ textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 18.0f);
+ } else {
+ textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 22.0f);
+ }
}
button.setOnClickListener(new AllStationsActRecyclerViewButtonClickEvent(station, activity, reason));
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/AllStationsDao.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/AllStationsDao.java
index 3d32550..3d01da6 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/AllStationsDao.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/AllStationsDao.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.dao;
+import org.tinylog.Logger;
+
import java.util.LinkedList;
import java.util.List;
@@ -30,6 +32,7 @@ public class AllStationsDao {
try {
resp = consumer.getAllStations().execute();
} catch (Exception e) {
+ Logger.error("[AllStationsDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
e.printStackTrace();
}
}
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/AvailableParametersDao.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/AvailableParametersDao.java
index 35322ab..9eb9cad 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/AvailableParametersDao.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/AvailableParametersDao.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.dao;
+import org.tinylog.Logger;
+
import cc.pogoda.mobile.meteosystem.type.web.AvailableParametersWeb;
import cc.pogoda.mobile.meteosystem.web.AvailableParametersConsumer;
import cc.pogoda.mobile.meteosystem.web.RestClientConfig;
@@ -24,6 +26,8 @@ public class AvailableParametersDao {
try {
response = consumer.getParametersForStation(stationName).execute();
} catch (Exception e) {
+ Logger.error("[AvailableParametersDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
+
e.printStackTrace();
}
}
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/LastStationDataDao.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/LastStationDataDao.java
index 232ea58..00a982e 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/LastStationDataDao.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/LastStationDataDao.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.dao;
+import org.tinylog.Logger;
+
import cc.pogoda.mobile.meteosystem.type.web.ListOfStationData;
import cc.pogoda.mobile.meteosystem.web.LastStationDataConsumer;
import cc.pogoda.mobile.meteosystem.web.RestClientConfig;
@@ -23,6 +25,8 @@ public class LastStationDataDao {
try {
response = consumer.getLastDataForStation(station, true, true).execute();
} catch (Exception e) {
+ Logger.error("[LastStationDataDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
+
e.printStackTrace();
}
}
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/StationDataDao.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/StationDataDao.java
index 7cb43be..3b2064a 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/StationDataDao.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/StationDataDao.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.dao;
+import org.tinylog.Logger;
+
import cc.pogoda.mobile.meteosystem.type.web.ListOfStationData;
import cc.pogoda.mobile.meteosystem.web.RestClientConfig;
import cc.pogoda.mobile.meteosystem.web.StationDataConsumer;
@@ -26,6 +28,8 @@ public class StationDataDao {
try {
response = consumer.getDataForStation(station, from, to).execute();
} catch (Exception e) {
+ Logger.error("[StationDataDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
+
e.printStackTrace();
}
}
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/SummaryDao.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/SummaryDao.java
index 367ca6e..d0c5ac2 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/SummaryDao.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/SummaryDao.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.dao;
+import org.tinylog.Logger;
+
import java.io.IOException;
import cc.pogoda.mobile.meteosystem.type.web.QualityFactor;
@@ -32,6 +34,8 @@ public class SummaryDao {
try {
response = consumer.getSummaryForStation(station).execute();
} catch (IOException e) {
+ Logger.error("[SummaryDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
+
e.printStackTrace();
}
}
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/TrendDao.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/TrendDao.java
index 2dab33e..a8dafb7 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/TrendDao.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/dao/TrendDao.java
@@ -1,5 +1,7 @@
package cc.pogoda.mobile.meteosystem.dao;
+import org.tinylog.Logger;
+
import java.io.IOException;
import cc.pogoda.mobile.meteosystem.type.web.Trend;
@@ -28,6 +30,8 @@ public class TrendDao {
trend = trendConsumer.getTrendForStation(station).execute();
}
catch (IOException e) {
+ Logger.error("[TrendDao][Worker][Exception][e = " + e.getLocalizedMessage() +"]");
+
e.printStackTrace();
}
}
diff --git a/app/src/main/java/cc/pogoda/mobile/meteosystem/type/web/Summary.java b/app/src/main/java/cc/pogoda/mobile/meteosystem/type/web/Summary.java
index edb2ed3..fb1c4f8 100644
--- a/app/src/main/java/cc/pogoda/mobile/meteosystem/type/web/Summary.java
+++ b/app/src/main/java/cc/pogoda/mobile/meteosystem/type/web/Summary.java
@@ -232,7 +232,7 @@ public class Summary {
public String getWindDirStr() {
String out;
- if (direction <= 11 && direction >= 349) {
+ if (direction <= 11 || direction >= 349) {
out = String.format("%5s", "N");
}
else if (direction <= 34 && direction > 11) {
diff --git a/app/src/main/res/layout/activity_all_stations_linear_layout.xml b/app/src/main/res/layout/activity_all_stations_linear_layout.xml
index f4c613d..14317c7 100644
--- a/app/src/main/res/layout/activity_all_stations_linear_layout.xml
+++ b/app/src/main/res/layout/activity_all_stations_linear_layout.xml
@@ -12,7 +12,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:fontFamily="@font/alegreya_sans_sc_medium"
- android:textSize="20sp"
+ android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/station_button"
app:layout_constraintStart_toStartOf="parent"
@@ -25,7 +25,7 @@
android:layout_marginEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
- android:textSize="10sp"
+ android:textSize="14sp"
app:layout_constraintBaseline_toBaselineOf="@+id/station_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/station_name" />
diff --git a/app/src/main/res/layout/activity_favourites_linear_layout_data.xml b/app/src/main/res/layout/activity_favourites_linear_layout_data.xml
index 660177d..9044f5a 100644
--- a/app/src/main/res/layout/activity_favourites_linear_layout_data.xml
+++ b/app/src/main/res/layout/activity_favourites_linear_layout_data.xml
@@ -14,7 +14,7 @@
android:layout_marginTop="8dp"
android:layout_marginBottom="24dp"
android:fontFamily="@font/alegreya_sans_sc_medium"
- android:textSize="20sp"
+ android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="@+id/station_button_fav"
app:layout_constraintEnd_toStartOf="@+id/station_button_fav"
app:layout_constraintStart_toStartOf="parent"
@@ -27,7 +27,7 @@
android:layout_marginEnd="16dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
- android:textSize="10sp"
+ android:textSize="14sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/station_name_fav"
diff --git a/doc/screenshots/favourites.png b/doc/screenshots/favourites.png
index 1d6bb42..36e0a05 100644
Binary files a/doc/screenshots/favourites.png and b/doc/screenshots/favourites.png differ
diff --git a/doc/screenshots/main_window.png b/doc/screenshots/main_window.png
index 2c6a1c4..7984a27 100644
Binary files a/doc/screenshots/main_window.png and b/doc/screenshots/main_window.png differ
diff --git a/doc/screenshots/station_screen.png b/doc/screenshots/station_screen.png
index d27116c..c67ee7a 100644
Binary files a/doc/screenshots/station_screen.png and b/doc/screenshots/station_screen.png differ
diff --git a/doc/screenshots/station_screen_with_menu.png b/doc/screenshots/station_screen_with_menu.png
index 7134bda..eea9e82 100644
Binary files a/doc/screenshots/station_screen_with_menu.png and b/doc/screenshots/station_screen_with_menu.png differ