Skip to content

Commit fd473a9

Browse files
committed
add deprecation warning
code clean-up prepare for RainViewer changes
1 parent a29c1c6 commit fd473a9

8 files changed

Lines changed: 16 additions & 40 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
```
2+
Google has announced that, starting in 2026/2027, all apps on certified Android devices
3+
will require the developer to submit personal identity details directly to Google.
4+
Since the developers of this app do not agree to this requirement, this app will no longer
5+
work on certified Android devices after that time.
6+
```
7+
18
<pre>Send a coffee to
29
woheller69@t-online.de
310
<a href= "https://www.paypal.com/signin"><img align="left" src="https://www.paypalobjects.com/webstatic/de_DE/i/de-pp-logo-150px.png"></a>

app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,5 @@ dependencies {
4848
implementation 'org.osmdroid:osmdroid-android:6.1.18'
4949
implementation 'net.lingala.zip4j:zip4j:2.9.1'
5050
implementation 'androidx.work:work-runtime:2.10.2'
51+
implementation 'com.github.woheller69:FreeDroidWarn:+'
5152
}

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

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
package org.woheller69.weather.activities;
22

3-
import android.appwidget.AppWidgetManager;
4-
import android.appwidget.AppWidgetProviderInfo;
5-
import android.content.ComponentName;
6-
import android.content.Context;
73
import android.content.DialogInterface;
84
import android.content.Intent;
95
import android.content.SharedPreferences;
@@ -25,13 +21,11 @@
2521
import androidx.appcompat.widget.Toolbar;
2622

2723
import android.os.Looper;
28-
import android.os.PowerManager;
29-
import android.provider.Settings;
3024
import android.view.Menu;
3125
import android.view.MenuItem;
32-
import android.widget.Toast;
3326

3427

28+
import org.woheller69.freeDroidWarn.FreeDroidWarn;
3529
import org.woheller69.weather.BuildConfig;
3630
import org.woheller69.weather.R;
3731
import org.woheller69.weather.database.SQLiteHelper;
@@ -64,22 +58,8 @@ protected void onCreate(Bundle savedInstanceState) {
6458
super.onCreate(savedInstanceState);
6559

6660
mSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
67-
/* int promptCount = mSharedPreferences.getInt("battery_optimization_prompt_count", 0);
68-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && checkAppWidget()) {
69-
PowerManager powerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
70-
if (!powerManager.isIgnoringBatteryOptimizations(getPackageName())) {
71-
Toast.makeText(this, "Needs permission Ignore... "+promptCount, Toast.LENGTH_SHORT).show();
72-
if (promptCount < 3) {
73-
SharedPreferences.Editor editor = mSharedPreferences.edit();
74-
editor.putInt("battery_optimization_prompt_count", promptCount + 1);
75-
editor.apply();
76-
77-
startActivity(new Intent(Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS, Uri.parse("package:"+getPackageName())));
78-
}
79-
}
80-
}*/
81-
AppWidgetManager.getInstance(this).getInstalledProviders();
8261
mHandler = new Handler(Looper.getMainLooper());
62+
FreeDroidWarn.showWarningOnUpgrade(this, BuildConfig.VERSION_CODE);
8363
prefManager = new AppPreferencesManager(PreferenceManager.getDefaultSharedPreferences(this));
8464
if (prefManager.showStarDialog(this)) {
8565
AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);
@@ -252,20 +232,4 @@ protected void onPause() {
252232
isVisible=false;
253233
}
254234

255-
public boolean checkAppWidget(){
256-
AppWidgetManager appWidgetManager = AppWidgetManager.getInstance(this);
257-
List<AppWidgetProviderInfo> providers = appWidgetManager.getInstalledProviders();
258-
259-
for (AppWidgetProviderInfo info : providers) {
260-
ComponentName provider = info.provider;
261-
if (provider.getPackageName().equals(getPackageName())) {
262-
int[] widgetIds = appWidgetManager.getAppWidgetIds(provider);
263-
if (widgetIds.length > 0) {
264-
// At least one instance of this widget is on the home screen
265-
return true;
266-
}
267-
}
268-
}
269-
return false;
270-
}
271235
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ public class RainViewerActivity extends AppCompatActivity {
8585
private List<TilesOverlayEntry> radarTilesOverlayEntries;
8686
private List<TilesOverlayEntry> infraredTilesOverlayEntries;
8787
private GeoPoint startPoint;
88-
public static int rainViewerMaxZoom = 9; //Todo: max 7 starting Jan 2026 and infrared frames + nowcast must be removed
88+
public static int rainViewerWidgetZoom = 10;
89+
public static int rainViewerMaxZoom = 11; //Todo: max 7 starting Jan 2026 and infrared frames + nowcast must be removed
8990
private double initialZoom = 8d;
9091

9192
@Override

app/src/main/java/org/woheller69/weather/services/UpdateDataService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ private void handleUpdateRadar(Intent intent) {
132132

133133
// Get the calculated radar timestamp
134134
long radarTimeGMT = calendar.getTimeInMillis();
135-
int zoom = RainViewerActivity.rainViewerMaxZoom;
135+
int zoom = RainViewerActivity.rainViewerWidgetZoom;
136136
String radarUrl = "https://tilecache.rainviewer.com/v2/radar/" + radarTimeGMT/1000 + "/256/" + zoom +"/"+ city.getLatitude() +"/" + city.getLongitude() + "/2/1_1.png";
137137

138138
ImageRequest imageRequest = new ImageRequest(radarUrl,

app/src/main/res/layout/activity_rain_viewer.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
android:paddingHorizontal="7dp"
7676
android:layout_alignParentBottom="true"
7777
android:textColor="@color/colorAccent"
78+
android:singleLine="true"
7879
android:alpha="0.65"
7980
android:background="@color/white" />
8081
</RelativeLayout>

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ allprojects {
2323
url 'https://maven.google.com/'
2424
name 'Google'
2525
}
26+
maven { url 'https://jitpack.io' }
2627
}
2728
tasks.withType(JavaCompile) {
2829
options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"

fastlane/metadata/android/en-US/changelogs/43.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ Reduce max. zoom level for RainViewer due to discontinuation of services
22
Keep screen on during RainViewer animation
33
Improved update mechanism for widgets
44
Translations
5+
Deprecation warning
56
Bugfixes

0 commit comments

Comments
 (0)