diff --git a/app/build.gradle b/app/build.gradle
index a7ab958..85157f6 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -6,6 +6,8 @@ android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
+ apply plugin: "androidx.navigation.safeargs"
+
defaultConfig {
applicationId "cc.pogoda.mobile.pogodacc"
minSdkVersion 24
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 47abb4a..8c132dd 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -28,6 +28,10 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsDirection.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsDirection.java
index 5e46592..6fd635c 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsDirection.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsDirection.java
@@ -16,7 +16,6 @@ import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.github.mikephil.charting.utils.ColorTemplate;
-import org.threeten.bp.Instant;
import org.threeten.bp.LocalDateTime;
import org.threeten.bp.ZoneId;
import org.threeten.bp.ZoneOffset;
@@ -340,7 +339,7 @@ public class StationDetailsPlotsDirection extends AppCompatActivity implements S
valuesWindDirection = new ArrayList<>();
if (data != null) {
- for (StationData d : data.listOfStationData) {
+ 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/pogodacc/activity/StationDetailsPlotsTemperature.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsTemperature.java
index 1a297c4..bcea3b2 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsTemperature.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsTemperature.java
@@ -14,9 +14,6 @@ import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
-import com.github.mikephil.charting.formatter.IFillFormatter;
-import com.github.mikephil.charting.interfaces.dataprovider.LineDataProvider;
-import com.github.mikephil.charting.interfaces.datasets.ILineDataSet;
import com.github.mikephil.charting.utils.ColorTemplate;
import org.threeten.bp.LocalDateTime;
@@ -30,7 +27,6 @@ import java.util.ArrayList;
import cc.pogoda.mobile.pogodacc.R;
import cc.pogoda.mobile.pogodacc.activity.handler.PlotClickEvent;
-import cc.pogoda.mobile.pogodacc.config.AppConfiguration;
import cc.pogoda.mobile.pogodacc.dao.LastStationDataDao;
import cc.pogoda.mobile.pogodacc.dao.StationDataDao;
import cc.pogoda.mobile.pogodacc.type.StationDetailsPlot;
@@ -114,7 +110,7 @@ public class StationDetailsPlotsTemperature extends AppCompatActivity implements
}
if (data instanceof ListOfStationData) {
- for (StationData d : data.listOfStationData) {
+ for (StationData d : data.list_of_station_data) {
valuesTemperature.add(new Entry(d.epoch * 1000, d.temperature));
}
}
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsWind.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsWind.java
index 7edd85a..b50b5cf 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsWind.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/StationDetailsPlotsWind.java
@@ -218,7 +218,7 @@ public class StationDetailsPlotsWind extends AppCompatActivity implements SeekBa
valuesWindGusts = new ArrayList<>();
if (data instanceof ListOfStationData) {
- for (StationData d : data.listOfStationData) {
+ 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/pogodacc/activity/TrendActivity.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/TrendActivity.java
index f8a8c2b..293c6d2 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/TrendActivity.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/TrendActivity.java
@@ -7,6 +7,7 @@ import com.google.android.material.bottomnavigation.BottomNavigationView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.navigation.NavArgument;
import androidx.navigation.NavController;
+import androidx.navigation.NavDirections;
import androidx.navigation.NavGraph;
import androidx.navigation.Navigation;
import androidx.navigation.fragment.NavHostFragment;
@@ -15,9 +16,19 @@ import androidx.navigation.ui.NavigationUI;
import cc.pogoda.mobile.pogodacc.R;
import cc.pogoda.mobile.pogodacc.activity.trend.pressure.PressureTrendFragment;
+import cc.pogoda.mobile.pogodacc.activity.trend.pressure.PressureTrendFragmentArgs;
+import cc.pogoda.mobile.pogodacc.activity.trend.pressure.PressureTrendFragmentDirections;
+import cc.pogoda.mobile.pogodacc.activity.trend.temperature.TemperatureTrendFragmentDirections;
+import cc.pogoda.mobile.pogodacc.activity.trend.wind.WindTrendFragmentDirections;
public class TrendActivity extends AppCompatActivity {
+ public static String getStation() {
+ return station;
+ }
+
+ private static String station = "";
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -26,9 +37,12 @@ public class TrendActivity extends AppCompatActivity {
NavArgument.Builder builder = new NavArgument.Builder();
+
Bundle bundle = new Bundle();
bundle.putString("station", stationName);
+ this.station = stationName;
+
BottomNavigationView navView = findViewById(R.id.nav_view);
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
@@ -36,17 +50,24 @@ public class TrendActivity extends AppCompatActivity {
R.id.navigation_pressure, R.id.navigation_temperature, R.id.navigation_wind)
.build();
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment);
- NavGraph navGraph = navController.getNavInflater().inflate(R.navigation.mobile_navigation);
- builder.setDefaultValue(stationName);
- navGraph.addArgument("station", builder.build());
- navController.setGraph(navGraph, bundle);
+
+ NavDirections temperature = TemperatureTrendFragmentDirections.actionNavigationTemperatureToNavigationPressure(stationName);
+ NavDirections wind = WindTrendFragmentDirections.actionNavigationWindToNavigationTemperature(stationName);
+ NavDirections pressure = PressureTrendFragmentDirections.actionNavigationPressureToNavigationWind(stationName);
+
+ //NavHostFragment.create(R.navigation.mobile_navigation, bundle);
+
+// NavGraph navGraph = navController.getNavInflater().inflate(R.navigation.mobile_navigation);
+// builder.setDefaultValue(stationName);
+// navGraph.addArgument("station", builder.build());
+// navController.setGraph(navGraph, bundle);
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
NavigationUI.setupWithNavController(navView, navController);
+ //navController.navigate(temperature);
//
// NavArgument.Builder builder = new NavArgument.Builder();
// builder.setDefaultValue(stationName);
// navGraph.addArgument("station", builder.build());
-// // navController.get
// navController.setGraph(navGraph);
}
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/pressure/PressureTrendFragment.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/pressure/PressureTrendFragment.java
index ba64cd9..52911c8 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/pressure/PressureTrendFragment.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/pressure/PressureTrendFragment.java
@@ -13,6 +13,7 @@ import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import cc.pogoda.mobile.pogodacc.R;
+import cc.pogoda.mobile.pogodacc.activity.TrendActivity;
public class PressureTrendFragment extends Fragment {
@@ -32,23 +33,20 @@ public class PressureTrendFragment extends Fragment {
ViewGroup container, Bundle savedInstanceState) {
pressureTrendViewModel =
new ViewModelProvider(this).get(PressureTrendViewModel.class);
-
+
+ pressureTrendViewModel.setStation(TrendActivity.getStation());
// inflate the main layout of the fragment
View root = inflater.inflate(R.layout.fragment_pressure, container, false);
- Bundle arg = this.getArguments();
-
- if (arg != null) {
- station = arg.getString("station");
- }
+ station = TrendActivity.getStation();
// load all elements from the layout
stationName = root.findViewById(R.id.textViewPressureTrendStationName);
lastDataTimestamp = root.findViewById(R.id.textViewPressureTrendLastTimestampValue);
currentValue = root.findViewById(R.id.textViewPressureTrendCurrentValue);
twoHours = root.findViewById(R.id.textViewPressureTrendTwoHoursValue);
- fourHours = root.findViewById(R.id.textViewPressureTrendTwoHoursValue);
+ fourHours = root.findViewById(R.id.textViewPressureTrendFourHoursValue);
sixHours = root.findViewById(R.id.textViewPressureTrendSixHoursValue);
eightHours = root.findViewById(R.id.textViewPressureTrendEightHoursVal);
@@ -80,7 +78,12 @@ public class PressureTrendFragment extends Fragment {
eightHours.setText(s);
});
- //pressureTrendViewModel.updateData();
+ try {
+ pressureTrendViewModel.updateData();
+ }
+ catch (Exception e) {
+ ;
+ }
return root;
}
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/pressure/PressureTrendViewModel.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/pressure/PressureTrendViewModel.java
index 0ce30fb..1beba45 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/pressure/PressureTrendViewModel.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/pressure/PressureTrendViewModel.java
@@ -43,10 +43,31 @@ public class PressureTrendViewModel extends ViewModel {
public void updateData() {
Trend trend = trendDao.getStationTrend(station);
- // format the time and date according to current locale
- String dt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM, FormatStyle.SHORT).format(LocalDateTime.ofEpochSecond(trend.last_timestamp, 0, ZoneOffset.UTC).atOffset(ZoneOffset.UTC).atZoneSameInstant(ZoneOffset.systemDefault()));
+ if (trend != null) {
+ // format the time and date according to current locale
+ String dt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM, FormatStyle.SHORT).format(LocalDateTime.ofEpochSecond(trend.last_timestamp, 0, ZoneOffset.UTC).atOffset(ZoneOffset.UTC).atZoneSameInstant(ZoneOffset.systemDefault()));
- lastMeasuremenetTime.postValue(dt);
+ lastMeasuremenetTime.postValue(dt);
+ stationName.postValue(trend.displayed_name);
+
+ if (!trend.current_qnh_qf.equals("NOT_AVALIABLE")) {
+ currentValue.postValue(String.format("%.1f hPa", trend.pressure_trend.current_value));
+ twoHoursValue.postValue(String.format("%.1f hPa", trend.pressure_trend.two_hours_value));
+ fourHoursValue.postValue(String.format("%.1f hPa", trend.pressure_trend.four_hours_value));
+ sixHoursValue.postValue(String.format("%.1f hPa", trend.pressure_trend.six_hours_value));
+ eightHoursValue.postValue(String.format("%.1f hPa", trend.pressure_trend.eight_hours_value));
+ }
+ else {
+ currentValue.postValue("-- hPa");
+ twoHoursValue.postValue("-- hPa");
+ fourHoursValue.postValue("-- hPa");
+ sixHoursValue.postValue("-- hPa");
+ eightHoursValue.postValue("-- hPa");
+ }
+ }
+ else {
+
+ }
}
public void setStation(String station) {
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/temperature/TemperatureTrendFragment.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/temperature/TemperatureTrendFragment.java
index 67ae8ad..6608bce 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/temperature/TemperatureTrendFragment.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/temperature/TemperatureTrendFragment.java
@@ -12,24 +12,118 @@ import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
+import org.w3c.dom.Text;
+
import cc.pogoda.mobile.pogodacc.R;
+import cc.pogoda.mobile.pogodacc.activity.TrendActivity;
public class TemperatureTrendFragment extends Fragment {
private TemperatureTrendViewModel temperatureTrendViewModel;
+ private TextView textViewTemperatureTrendLastTimestampValue;
+ private TextView textViewTemperatureTrendStationName;
+
+ private TextView textViewTemperatureTrendCurrentTValue;
+ private TextView textViewTemperatureTrendCurrentHValue;
+
+ private TextView textViewTemperatureTrendTwoHoursTValue;
+ private TextView textViewTemperatureTrendTwoHoursHValue;
+
+ private TextView textViewTemperatureTrendFourHoursTValue;
+ private TextView textViewTemperatureTrendFourHoursHValue;
+
+ private TextView textViewTemperatureTrendSixHoursTValue;
+ private TextView textViewTemperatureTrendSixHoursHValue;
+
+ private TextView textViewTemperatureTrendTrendEightHoursTVal;
+ private TextView textViewTemperatureTrendEightHoursHVal;
+
+
+
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
+ String station = TrendActivity.getStation();
+
temperatureTrendViewModel =
new ViewModelProvider(this).get(TemperatureTrendViewModel.class);
View root = inflater.inflate(R.layout.fragment_temperature, container, false);
- final TextView textView = root.findViewById(R.id.text_dashboard);
- temperatureTrendViewModel.getText().observe(getViewLifecycleOwner(), new Observer() {
- @Override
- public void onChanged(@Nullable String s) {
- textView.setText(s);
- }
+//
+ temperatureTrendViewModel.setStation(station);
+
+ textViewTemperatureTrendLastTimestampValue = root.findViewById(R.id.textViewTemperatureTrendLastTimestampValue);
+ textViewTemperatureTrendStationName = root.findViewById(R.id.textViewTemperatureTrendStationName);
+
+ textViewTemperatureTrendCurrentTValue = root.findViewById(R.id.textViewTemperatureTrendCurrentTValue);
+ textViewTemperatureTrendCurrentHValue = root.findViewById(R.id.textViewTemperatureTrendCurrentHValue);
+
+ textViewTemperatureTrendTwoHoursTValue = root.findViewById(R.id.textViewTemperatureTrendTwoHoursTValue);
+ textViewTemperatureTrendTwoHoursHValue = root.findViewById(R.id.textViewTemperatureTrendTwoHoursHValue);
+
+ textViewTemperatureTrendFourHoursTValue = root.findViewById(R.id.textViewTemperatureTrendFourHoursTValue);
+ textViewTemperatureTrendFourHoursHValue = root.findViewById(R.id.textViewTemperatureTrendFourHoursHValue);
+
+ textViewTemperatureTrendSixHoursTValue = root.findViewById(R.id.textViewTemperatureTrendSixHoursTValue);
+ textViewTemperatureTrendSixHoursHValue = root.findViewById(R.id.textViewTemperatureTrendSixHoursHValue);
+
+ textViewTemperatureTrendTrendEightHoursTVal = root.findViewById(R.id.textViewTemperatureTrendTrendEightHoursTVal);
+ textViewTemperatureTrendEightHoursHVal = root.findViewById(R.id.textViewTemperatureTrendEightHoursHVal);
+
+ temperatureTrendViewModel.getDisplayedStationName().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendStationName.setText(s);
});
+
+ temperatureTrendViewModel.getLastMeasuremenetTime().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendLastTimestampValue.setText(s);
+ });
+
+ // current values
+ temperatureTrendViewModel.getCurrentTemperatureValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendCurrentTValue.setText(s);
+ });
+
+ temperatureTrendViewModel.getCurrentHumidityValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendCurrentHValue.setText(s);
+ });
+
+ // two hours ago
+ temperatureTrendViewModel.getTwoHoursTemperatureValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendTwoHoursTValue.setText(s);
+ });
+
+ temperatureTrendViewModel.getTwoHoursHumidityValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendTwoHoursHValue.setText(s);
+ });
+
+ // four hours ago
+ temperatureTrendViewModel.getFourHoursTemperatureValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendFourHoursTValue.setText(s);
+ });
+
+ temperatureTrendViewModel.getFourHoursHumidityValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendFourHoursHValue.setText(s);
+ });
+
+ // six hours ago
+ temperatureTrendViewModel.getSixHoursTemperatureValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendSixHoursTValue.setText(s);
+ });
+
+ temperatureTrendViewModel.getSixHoursHumidityValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendSixHoursHValue.setText(s);
+ });
+
+ //eight hours ago
+ temperatureTrendViewModel.getEightHoursTemperatureValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendTrendEightHoursTVal.setText(s);
+ });
+
+ temperatureTrendViewModel.getEightHoursHumidityValue().observe(getViewLifecycleOwner(), s -> {
+ textViewTemperatureTrendEightHoursHVal.setText(s);
+ });
+
+ temperatureTrendViewModel.getData();
+
return root;
}
}
\ No newline at end of file
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/temperature/TemperatureTrendViewModel.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/temperature/TemperatureTrendViewModel.java
index e355256..3d944ee 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/temperature/TemperatureTrendViewModel.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/temperature/TemperatureTrendViewModel.java
@@ -4,16 +4,142 @@ import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
+import org.threeten.bp.LocalDateTime;
+import org.threeten.bp.ZoneOffset;
+import org.threeten.bp.format.DateTimeFormatter;
+import org.threeten.bp.format.FormatStyle;
+
+import cc.pogoda.mobile.pogodacc.dao.TrendDao;
+import cc.pogoda.mobile.pogodacc.type.web.Trend;
+
public class TemperatureTrendViewModel extends ViewModel {
- private MutableLiveData mText;
+ public void setStation(String station) {
+ this.station = station;
+ }
+
+ private String station = "";
+
+ private TrendDao trendDao;
+
+ private MutableLiveData displayedStationName;
+
+ public MutableLiveData getDisplayedStationName() {
+ return displayedStationName;
+ }
+
+ public MutableLiveData getLastMeasuremenetTime() {
+ return lastMeasuremenetTime;
+ }
+
+ public MutableLiveData getCurrentTemperatureValue() {
+ return currentTemperatureValue;
+ }
+
+ public MutableLiveData getTwoHoursTemperatureValue() {
+ return twoHoursTemperatureValue;
+ }
+
+ public MutableLiveData getFourHoursTemperatureValue() {
+ return fourHoursTemperatureValue;
+ }
+
+ public MutableLiveData getSixHoursTemperatureValue() {
+ return sixHoursTemperatureValue;
+ }
+
+ public MutableLiveData getEightHoursTemperatureValue() {
+ return eightHoursTemperatureValue;
+ }
+
+ public MutableLiveData getCurrentHumidityValue() {
+ return currentHumidityValue;
+ }
+
+ public MutableLiveData getTwoHoursHumidityValue() {
+ return twoHoursHumidityValue;
+ }
+
+ public MutableLiveData getFourHoursHumidityValue() {
+ return fourHoursHumidityValue;
+ }
+
+ public MutableLiveData getSixHoursHumidityValue() {
+ return sixHoursHumidityValue;
+ }
+
+ public MutableLiveData getEightHoursHumidityValue() {
+ return eightHoursHumidityValue;
+ }
+
+ private MutableLiveData lastMeasuremenetTime;
+
+ private MutableLiveData currentTemperatureValue;
+ private MutableLiveData twoHoursTemperatureValue;
+ private MutableLiveData fourHoursTemperatureValue;
+ private MutableLiveData sixHoursTemperatureValue;
+ private MutableLiveData eightHoursTemperatureValue;
+
+ private MutableLiveData currentHumidityValue;
+ private MutableLiveData twoHoursHumidityValue;
+ private MutableLiveData fourHoursHumidityValue;
+ private MutableLiveData sixHoursHumidityValue;
+ private MutableLiveData eightHoursHumidityValue;
public TemperatureTrendViewModel() {
- mText = new MutableLiveData<>();
- mText.setValue("This is dashboard fragment");
+ trendDao = new TrendDao();
+
+ lastMeasuremenetTime = new MutableLiveData();
+ displayedStationName = new MutableLiveData();
+
+ currentTemperatureValue = new MutableLiveData();
+ twoHoursTemperatureValue = new MutableLiveData();
+ fourHoursTemperatureValue = new MutableLiveData();
+ sixHoursTemperatureValue = new MutableLiveData();
+ eightHoursTemperatureValue = new MutableLiveData();
+
+ currentHumidityValue = new MutableLiveData();
+ twoHoursHumidityValue = new MutableLiveData();
+ fourHoursHumidityValue = new MutableLiveData();
+ sixHoursHumidityValue = new MutableLiveData();
+ eightHoursHumidityValue = new MutableLiveData();
}
- public LiveData getText() {
- return mText;
+ public void getData() {
+ Trend trend = trendDao.getStationTrend(this.station);
+
+ if (trend != null) {
+ // format the time and date according to current locale
+ String dt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM, FormatStyle.SHORT).format(LocalDateTime.ofEpochSecond(trend.last_timestamp, 0, ZoneOffset.UTC).atOffset(ZoneOffset.UTC).atZoneSameInstant(ZoneOffset.systemDefault()));
+
+ lastMeasuremenetTime.postValue(dt);
+ displayedStationName.postValue(trend.displayed_name);
+
+ currentTemperatureValue.postValue(String.format("%.1f °C", trend.temperature_trend.current_value));
+ twoHoursTemperatureValue.postValue(String.format("%.1f °C", trend.temperature_trend.two_hours_value));
+ fourHoursTemperatureValue.postValue(String.format("%.1f °C", trend.temperature_trend.four_hours_value));
+ sixHoursTemperatureValue.postValue(String.format("%.1f °C", trend.temperature_trend.six_hours_value));
+ eightHoursTemperatureValue.postValue(String.format("%.1f °C", trend.temperature_trend.eight_hours_value));
+
+ if (!trend.current_humidity_qf.equals("NOT_AVALIABLE")) {
+ currentHumidityValue.postValue(String.format("%.1f %%", trend.humidity_trend.current_value));
+ twoHoursHumidityValue.postValue(String.format("%.1f %%", trend.humidity_trend.two_hours_value));
+ fourHoursHumidityValue.postValue(String.format("%.1f %%", trend.humidity_trend.four_hours_value));
+ sixHoursHumidityValue.postValue(String.format("%.1f %%", trend.humidity_trend.six_hours_value));
+ eightHoursHumidityValue.postValue(String.format("%.1f %%", trend.humidity_trend.eight_hours_value));
+ }
+ else {
+ currentHumidityValue.postValue(String.format("-- %%"));
+ twoHoursHumidityValue.postValue(String.format("-- %%"));
+ fourHoursHumidityValue.postValue(String.format("-- %%"));
+ sixHoursHumidityValue.postValue(String.format("-- %%"));
+ eightHoursHumidityValue.postValue(String.format("-- %%"));
+ }
+ }
+ else {
+ ;
+ }
}
+
+
}
\ No newline at end of file
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/wind/WindTrendFragment.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/wind/WindTrendFragment.java
index d423ebe..5de6a0b 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/wind/WindTrendFragment.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/wind/WindTrendFragment.java
@@ -7,37 +7,114 @@ import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
-import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
-import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProvider;
import cc.pogoda.mobile.pogodacc.R;
+import cc.pogoda.mobile.pogodacc.activity.TrendActivity;
public class WindTrendFragment extends Fragment {
private WindTrendViewModel windTrendViewModel;
+ TextView textViewWindTrendStationName = null;
+ TextView textViewWindTrendLastTimestampValue = null;
+ TextView textViewWindTrendCurrentAverageValue = null;
+ TextView textViewWindTrendCurrentGustValue = null;
+ TextView textViewWindTrendTwoHoursAverageValue = null;
+ TextView textViewWindTrendTwoHoursGustsValue = null;
+ //TextView eightHours = null;
+ TextView textViewWindTrendFourHoursAverageValue = null;
+ TextView textViewWindTrendFourHoursGustValue = null;
+ TextView textViewWindTrendSixHoursAverageValue = null;
+ TextView textViewWindTrendSixHoursGustValue = null;
+ TextView textViewWindTrendEightHoursAverageVal = null;
+ TextView textViewWindTrendEightHoursGustsVal = null;
+
public View onCreateView(@NonNull LayoutInflater inflater,
ViewGroup container, Bundle savedInstanceState) {
- String station = "";
+ String station = TrendActivity.getStation();
windTrendViewModel =
new ViewModelProvider(this).get(WindTrendViewModel.class);
View root = inflater.inflate(R.layout.fragment_wind, container, false);
- final TextView textView = root.findViewById(R.id.text_home);
- windTrendViewModel.getText().observe(getViewLifecycleOwner(), new Observer() {
- @Override
- public void onChanged(@Nullable String s) {
- textView.setText(s);
- }
- });
- Bundle arg = this.getArguments();
- if (arg != null) {
- station = arg.getString("station");
- }
+ windTrendViewModel.setStation(TrendActivity.getStation());
+
+ // load layoyt elements
+ textViewWindTrendStationName = root.findViewById(R.id.textViewTemperatureTrendStationName);
+ textViewWindTrendLastTimestampValue = root.findViewById(R.id.textViewTemperatureTrendLastTimestampValue);
+
+ textViewWindTrendCurrentAverageValue = root.findViewById(R.id.textViewTemperatureTrendCurrentTValue);
+ textViewWindTrendCurrentGustValue = root.findViewById(R.id.textViewTemperatureTrendCurrentHValue);
+
+ textViewWindTrendTwoHoursAverageValue = root.findViewById(R.id.textViewTemperatureTrendTwoHoursTValue);
+ textViewWindTrendTwoHoursGustsValue = root.findViewById(R.id.textViewTemperatureTrendTwoHoursHValue);
+
+ textViewWindTrendFourHoursAverageValue = root.findViewById(R.id.textViewTemperatureTrendFourHoursTValue);
+ textViewWindTrendFourHoursGustValue = root.findViewById(R.id.textViewTemperatureTrendFourHoursHValue);
+
+ textViewWindTrendSixHoursAverageValue = root.findViewById(R.id.textViewTemperatureTrendSixHoursTValue);
+ textViewWindTrendSixHoursGustValue = root.findViewById(R.id.textViewTemperatureTrendSixHoursHValue);
+
+ textViewWindTrendEightHoursAverageVal = root.findViewById(R.id.textViewTemperatureTrendTrendEightHoursTVal);
+ textViewWindTrendEightHoursGustsVal = root.findViewById(R.id.textViewTemperatureTrendEightHoursHVal);
+
+ windTrendViewModel.getDisplayedStationName().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendStationName.setText(s);
+ });
+
+ windTrendViewModel.getLastMeasuremenetTime().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendLastTimestampValue.setText(s);
+ });
+
+ // current values
+ windTrendViewModel.getCurrentMeanValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendCurrentAverageValue.setText(s);
+ });
+
+ windTrendViewModel.getCurrentGustValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendCurrentGustValue.setText(s);
+ });
+
+ // two hours ago
+ windTrendViewModel.getTwoHoursMeanValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendTwoHoursAverageValue.setText(s);
+ });
+
+ windTrendViewModel.getTwoHoursGustValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendTwoHoursGustsValue.setText(s);
+ });
+
+ // four hours ago
+ windTrendViewModel.getFourHoursMeanValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendFourHoursAverageValue.setText(s);
+ });
+
+ windTrendViewModel.getFourHoursGustValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendFourHoursGustValue.setText(s);
+ });
+
+ // six hours ago
+ windTrendViewModel.getSixHoursMeanValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendSixHoursAverageValue.setText(s);
+ });
+
+ windTrendViewModel.getSixHoursGustValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendSixHoursGustValue.setText(s);
+ });
+
+ //eight hours ago
+ windTrendViewModel.getEightHoursMeanValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendEightHoursAverageVal.setText(s);
+ });
+
+ windTrendViewModel.getEightHoursGustValue().observe(getViewLifecycleOwner(), s -> {
+ textViewWindTrendEightHoursGustsVal.setText(s);
+ });
+
+ windTrendViewModel.updateData();
return root;
}
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/wind/WindTrendViewModel.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/wind/WindTrendViewModel.java
index 398d92a..8b806d9 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/wind/WindTrendViewModel.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/activity/trend/wind/WindTrendViewModel.java
@@ -4,16 +4,162 @@ import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
+import org.threeten.bp.LocalDateTime;
+import org.threeten.bp.ZoneOffset;
+import org.threeten.bp.format.DateTimeFormatter;
+import org.threeten.bp.format.FormatStyle;
+
+import cc.pogoda.mobile.pogodacc.config.AppConfiguration;
+import cc.pogoda.mobile.pogodacc.dao.TrendDao;
+import cc.pogoda.mobile.pogodacc.type.web.Trend;
+
public class WindTrendViewModel extends ViewModel {
- private MutableLiveData mText;
+ public void setStation(String station) {
+ this.station = station;
+ }
+
+ private String station = "";
+
+ private TrendDao trendDao;
+
+ private MutableLiveData displayedStationName;
+ private MutableLiveData lastMeasuremenetTime;
+
+ private MutableLiveData currentMeanValue;
+ private MutableLiveData twoHoursMeanValue;
+ private MutableLiveData fourHoursMeanValue;
+ private MutableLiveData sixHoursMeanValue;
+ private MutableLiveData eightHoursMeanValue;
+
+ private MutableLiveData currentGustValue;
+ private MutableLiveData twoHoursGustValue;
+ private MutableLiveData fourHoursGustValue;
+ private MutableLiveData sixHoursGustValue;
+ private MutableLiveData eightHoursGustValue;
+
+ public MutableLiveData getDisplayedStationName() {
+ return displayedStationName;
+ }
+
+ public MutableLiveData getLastMeasuremenetTime() {
+ return lastMeasuremenetTime;
+ }
+
+ public MutableLiveData getCurrentMeanValue() {
+ return currentMeanValue;
+ }
+
+ public MutableLiveData getTwoHoursMeanValue() {
+ return twoHoursMeanValue;
+ }
+
+ public MutableLiveData getFourHoursMeanValue() {
+ return fourHoursMeanValue;
+ }
+
+ public MutableLiveData getSixHoursMeanValue() {
+ return sixHoursMeanValue;
+ }
+
+ public MutableLiveData getEightHoursMeanValue() {
+ return eightHoursMeanValue;
+ }
+
+ public MutableLiveData getCurrentGustValue() {
+ return currentGustValue;
+ }
+
+ public MutableLiveData getTwoHoursGustValue() {
+ return twoHoursGustValue;
+ }
+
+ public MutableLiveData getFourHoursGustValue() {
+ return fourHoursGustValue;
+ }
+
+ public MutableLiveData getSixHoursGustValue() {
+ return sixHoursGustValue;
+ }
+
+ public MutableLiveData getEightHoursGustValue() {
+ return eightHoursGustValue;
+ }
+
+
public WindTrendViewModel() {
- mText = new MutableLiveData<>();
- mText.setValue("This is home fragment");
+ trendDao = new TrendDao();
+
+ displayedStationName = new MutableLiveData();
+ lastMeasuremenetTime = new MutableLiveData();
+
+ currentMeanValue = new MutableLiveData();
+ twoHoursMeanValue = new MutableLiveData();
+ fourHoursMeanValue = new MutableLiveData();
+ sixHoursMeanValue = new MutableLiveData();
+ eightHoursMeanValue = new MutableLiveData();
+
+ currentGustValue = new MutableLiveData();
+ twoHoursGustValue = new MutableLiveData();
+ fourHoursGustValue = new MutableLiveData();
+ sixHoursGustValue = new MutableLiveData();
+ eightHoursGustValue = new MutableLiveData();
+
}
- public LiveData getText() {
- return mText;
+ public void updateData() {
+ Trend trend = trendDao.getStationTrend(station);
+
+ // format the time and date according to current locale
+ String dt = DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM, FormatStyle.SHORT).format(LocalDateTime.ofEpochSecond(trend.last_timestamp, 0, ZoneOffset.UTC).atOffset(ZoneOffset.UTC).atZoneSameInstant(ZoneOffset.systemDefault()));
+
+ if (trend != null) {
+ lastMeasuremenetTime.postValue(dt);
+ displayedStationName.postValue(trend.displayed_name);
+
+ if (!trend.current_wind_qf.equals("NOT_AVALIABLE")) {
+ if (AppConfiguration.replaceMsWithKnots) {
+ // if knots
+ currentMeanValue.postValue(String.format("%.0f kts", trend.average_wind_speed_trend.current_value));
+ twoHoursMeanValue.postValue(String.format("%.0f kts", trend.average_wind_speed_trend.two_hours_value));
+ fourHoursMeanValue.postValue(String.format("%.0f kts", trend.average_wind_speed_trend.four_hours_value));
+ sixHoursMeanValue.postValue(String.format("%.0f kts", trend.average_wind_speed_trend.six_hours_value));
+ eightHoursMeanValue.postValue(String.format("%.0f kts", trend.average_wind_speed_trend.eight_hours_value));
+
+ currentGustValue.postValue(String.format("%.0f kts", trend.maximum_wind_speed_trend.current_value));
+ twoHoursGustValue.postValue(String.format("%.0f kts", trend.maximum_wind_speed_trend.two_hours_value));
+ fourHoursGustValue.postValue(String.format("%.0f kts", trend.maximum_wind_speed_trend.four_hours_value));
+ sixHoursGustValue.postValue(String.format("%.0f kts", trend.maximum_wind_speed_trend.six_hours_value));
+ eightHoursGustValue.postValue(String.format("%.0f kts", trend.maximum_wind_speed_trend.eight_hours_value));
+ } else {
+ // if meters per second
+ currentMeanValue.postValue(String.format("%.1f m/s", trend.average_wind_speed_trend.current_value));
+ twoHoursMeanValue.postValue(String.format("%.1f m/s", trend.average_wind_speed_trend.two_hours_value));
+ fourHoursMeanValue.postValue(String.format("%.1f m/s", trend.average_wind_speed_trend.four_hours_value));
+ sixHoursMeanValue.postValue(String.format("%.1f m/s", trend.average_wind_speed_trend.six_hours_value));
+ eightHoursMeanValue.postValue(String.format("%.1f m/s", trend.average_wind_speed_trend.eight_hours_value));
+
+ currentGustValue.postValue(String.format("%.1f m/s", trend.maximum_wind_speed_trend.current_value));
+ twoHoursGustValue.postValue(String.format("%.1f m/s", trend.maximum_wind_speed_trend.two_hours_value));
+ fourHoursGustValue.postValue(String.format("%.1f m/s", trend.maximum_wind_speed_trend.four_hours_value));
+ sixHoursGustValue.postValue(String.format("%.1f m/s", trend.maximum_wind_speed_trend.six_hours_value));
+ eightHoursGustValue.postValue(String.format("%.1f m/s", trend.maximum_wind_speed_trend.eight_hours_value));
+ }
+ } else {
+ currentMeanValue.postValue("--");
+ twoHoursMeanValue.postValue("--");
+ fourHoursMeanValue.postValue("--");
+ sixHoursMeanValue.postValue("--");
+ eightHoursMeanValue.postValue("--");
+
+ currentGustValue.postValue("--");
+ twoHoursGustValue.postValue("--");
+ fourHoursGustValue.postValue("--");
+ sixHoursGustValue.postValue("--");
+ eightHoursGustValue.postValue("--");
+ }
+ }
}
+
}
\ No newline at end of file
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/type/web/ListOfStationData.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/type/web/ListOfStationData.java
index 9c22cfd..c3fda71 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/type/web/ListOfStationData.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/type/web/ListOfStationData.java
@@ -2,5 +2,5 @@ package cc.pogoda.mobile.pogodacc.type.web;
public class ListOfStationData {
- public StationData[] listOfStationData;
+ public StationData[] list_of_station_data;
}
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/type/web/Trend.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/type/web/Trend.java
index 888eaff..d8d53be 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/type/web/Trend.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/type/web/Trend.java
@@ -4,6 +4,8 @@ public class Trend {
public long last_timestamp;
+ public String displayed_name;
+
public String current_temperature_qf;
public String current_qnh_qf;
diff --git a/app/src/main/java/cc/pogoda/mobile/pogodacc/web/TrendConsumer.java b/app/src/main/java/cc/pogoda/mobile/pogodacc/web/TrendConsumer.java
index 4c4bafd..28a1a05 100644
--- a/app/src/main/java/cc/pogoda/mobile/pogodacc/web/TrendConsumer.java
+++ b/app/src/main/java/cc/pogoda/mobile/pogodacc/web/TrendConsumer.java
@@ -2,9 +2,11 @@ package cc.pogoda.mobile.pogodacc.web;
import cc.pogoda.mobile.pogodacc.type.web.Trend;
import retrofit2.Call;
+import retrofit2.http.GET;
import retrofit2.http.Query;
public interface TrendConsumer {
+ @GET("meteo_backend/trend/")
Call getTrendForStation(@Query("station")String station);
}
diff --git a/app/src/main/res/font/alegreya_sans_light.xml b/app/src/main/res/font/alegreya_sans_light.xml
new file mode 100644
index 0000000..6557b8c
--- /dev/null
+++ b/app/src/main/res/font/alegreya_sans_light.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/app/src/main/res/font/alegreya_sans_sc_medium.xml b/app/src/main/res/font/alegreya_sans_sc_medium.xml
new file mode 100644
index 0000000..70aa933
--- /dev/null
+++ b/app/src/main/res/font/alegreya_sans_sc_medium.xml
@@ -0,0 +1,7 @@
+
+
+
diff --git a/app/src/main/res/layout/fragment_pressure.xml b/app/src/main/res/layout/fragment_pressure.xml
index f2730ef..87b629a 100644
--- a/app/src/main/res/layout/fragment_pressure.xml
+++ b/app/src/main/res/layout/fragment_pressure.xml
@@ -23,6 +23,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
+ android:fontFamily="@font/alegreya_sans_sc_medium"
android:text="@string/last_data_timestamp"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
@@ -32,11 +33,14 @@
android:id="@+id/textViewPressureTrendLastTimestampValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="140dp"
+ android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
+ android:layout_marginEnd="16dp"
android:fontFamily="sans-serif-black"
android:text="TextView"
+ android:textAlignment="center"
android:textSize="30sp"
+ app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewPressureTrendLastTimestamp" />
@@ -46,6 +50,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="32dp"
+ android:fontFamily="@font/alegreya_sans_sc_medium"
android:text="@string/current_value"
android:textSize="18sp"
app:layout_constraintStart_toStartOf="parent"
@@ -69,6 +74,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="32dp"
+ android:fontFamily="@font/alegreya_sans_sc_medium"
android:text="@string/h2_value"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewPressureTrendCurrentValue" />
@@ -90,6 +96,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="8dp"
+ android:fontFamily="@font/alegreya_sans_sc_medium"
android:text="@string/h4_value"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewPressureTrendTwoHoursValue" />
@@ -111,6 +118,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="17dp"
android:layout_marginTop="8dp"
+ android:fontFamily="@font/alegreya_sans_sc_medium"
android:text="@string/h6_value"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewPressureTrendFourHoursValue" />
@@ -132,6 +140,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="18dp"
android:layout_marginTop="8dp"
+ android:fontFamily="@font/alegreya_sans_sc_medium"
android:text="@string/h8_value"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textViewPressureTrendSixHoursValue" />
diff --git a/app/src/main/res/layout/fragment_temperature.xml b/app/src/main/res/layout/fragment_temperature.xml
index 41f8420..b68cd15 100644
--- a/app/src/main/res/layout/fragment_temperature.xml
+++ b/app/src/main/res/layout/fragment_temperature.xml
@@ -7,16 +7,250 @@
tools:context=".activity.trend.temperature.TemperatureTrendFragment">
+
+
+
+
+
+
+
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@id/textViewTemperatureTrendCurrentTValue" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_wind.xml b/app/src/main/res/layout/fragment_wind.xml
index d233a86..9a8bb22 100644
--- a/app/src/main/res/layout/fragment_wind.xml
+++ b/app/src/main/res/layout/fragment_wind.xml
@@ -7,16 +7,250 @@
tools:context=".activity.trend.wind.WindTrendFragment">
+
+
+
+
+
+
+
+
+
+
+
+
+ app:layout_constraintTop_toBottomOf="@id/textViewTemperatureTrendCurrentTValue" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml
index 134c3f8..fe9363a 100644
--- a/app/src/main/res/navigation/mobile_navigation.xml
+++ b/app/src/main/res/navigation/mobile_navigation.xml
@@ -5,6 +5,10 @@
android:id="@+id/mobile_navigation"
app:startDestination="@+id/navigation_wind">
+
+
+
+
+
+
+
+
+ app:argType="string">
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/font_certs.xml b/app/src/main/res/values/font_certs.xml
new file mode 100644
index 0000000..d2226ac
--- /dev/null
+++ b/app/src/main/res/values/font_certs.xml
@@ -0,0 +1,17 @@
+
+
+
+ - @array/com_google_android_gms_fonts_certs_dev
+ - @array/com_google_android_gms_fonts_certs_prod
+
+
+ -
+ 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
+
+
+
diff --git a/app/src/main/res/values/preloaded_fonts.xml b/app/src/main/res/values/preloaded_fonts.xml
new file mode 100644
index 0000000..538f0bf
--- /dev/null
+++ b/app/src/main/res/values/preloaded_fonts.xml
@@ -0,0 +1,7 @@
+
+
+
+ - @font/alegreya_sans_light
+ - @font/alegreya_sans_sc_medium
+
+
diff --git a/build.gradle b/build.gradle
index c8d7712..20585d6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -6,6 +6,7 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
+ classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.2"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files