Skip to content

Commit 0256736

Browse files
committed
V2.8
Add toggle button for sum
1 parent 10aced4 commit 0256736

File tree

6 files changed

+36
-2
lines changed

6 files changed

+36
-2
lines changed

app/build.gradle

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ android {
2121
applicationId "org.woheller69.solxpect"
2222
minSdkVersion 26
2323
targetSdk 35
24-
versionCode 27
25-
versionName "2.7"
24+
versionCode 28
25+
versionName "2.8"
2626

2727
buildConfigField "String", "BASE_URL", "\"https://api.open-meteo.com/v1/\""
2828
buildConfigField "String", "TILES_URL","\"https://tile.openstreetmap.org/\""
@@ -52,4 +52,5 @@ dependencies {
5252
implementation 'net.lingala.zip4j:zip4j:2.9.1'
5353
implementation 'com.github.woheller69:CompassView:948f3db329'
5454
implementation 'androidx.webkit:webkit:1.5.0'
55+
implementation 'com.github.woheller69:FreeDroidWarn:V1.6'
5556
}

app/src/main/java/org/woheller69/weather/activities/ForecastCityActivity.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,14 @@ public boolean onCreateOptionsMenu(Menu menu) {
174174
refreshActionButton.getActionView().setOnClickListener(v -> m.performIdentifierAction(refreshActionButton.getItemId(), 0));
175175
if (isRefreshing) startRefreshAnimation();
176176

177+
SharedPreferences prefManager = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
178+
boolean modeSum = prefManager.getBoolean("pref_summarize",false);
179+
if (modeSum) {
180+
menu.findItem(R.id.menu_summarize).getIcon().setAlpha(255);
181+
} else {
182+
menu.findItem(R.id.menu_summarize).getIcon().setAlpha(50);
183+
}
184+
177185
return true;
178186
}
179187

@@ -210,6 +218,11 @@ public boolean onOptionsItemSelected(final MenuItem item) {
210218
alertDialogBuilder.setPositiveButton(getString(android.R.string.ok), (dialog, which) -> { });
211219
AlertDialog alertDialog = alertDialogBuilder.create();
212220
alertDialog.show();
221+
} else if (id==R.id.menu_summarize){
222+
SharedPreferences prefManager = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
223+
boolean modeSum = prefManager.getBoolean("pref_summarize",false);
224+
prefManager.edit().putBoolean("pref_summarize",!modeSum).commit();
225+
recreate();
213226
}
214227

215228
return super.onOptionsItemSelected(item);

app/src/main/java/org/woheller69/weather/activities/NavigationActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import android.view.MenuItem;
2525

2626

27+
import org.woheller69.freeDroidWarn.FreeDroidWarn;
2728
import org.woheller69.weather.BuildConfig;
2829
import org.woheller69.weather.R;
2930
import org.woheller69.weather.database.SQLiteHelper;
@@ -55,6 +56,7 @@ protected void onCreate(Bundle savedInstanceState) {
5556

5657
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
5758
mHandler = new Handler(Looper.getMainLooper());
59+
FreeDroidWarn.showWarningOnUpgrade(this, BuildConfig.VERSION_CODE);
5860
prefManager = new AppPreferencesManager(PreferenceManager.getDefaultSharedPreferences(this));
5961
if (prefManager.showStarDialog(this)) {
6062
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="960"
5+
android:viewportHeight="960">
6+
<path
7+
android:pathData="M240,800v-80l260,-240 -260,-240v-80h480v120L431,280l215,200 -215,200h289v120L240,800Z"
8+
android:fillColor="#FFFFFF"/>
9+
</vector>

app/src/main/res/menu/activity_forecast_city.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<menu xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:app="http://schemas.android.com/apk/res-auto">
4+
<item
5+
android:id="@+id/menu_summarize"
6+
android:orderInCategory="70"
7+
android:visible="true"
8+
android:icon="@drawable/ic_sum_24dp"
9+
app:showAsAction="always"
10+
android:title="@string/settings_summarize" />
411
<item
512
android:id="@+id/menu_sun_position"
613
android:orderInCategory="80"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Toggle button for sum
2+
Add warning with link to Keep Android Open

0 commit comments

Comments
 (0)