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