Skip to content

Commit

Permalink
V2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
woheller69 committed Aug 19, 2024
1 parent 801950c commit 260d850
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "org.woheller69.omweather"
minSdkVersion 21
targetSdkVersion 34
versionCode 28
versionName "2.8"
versionCode 29
versionName "2.9"

buildConfigField "String", "BASE_URL", "\"https://api.open-meteo.com/v1/\""
buildConfigField "String", "GITHUB_URL","\"https://github.com/woheller69/omweather/\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ protected void onCreate(Bundle savedInstanceState) {
mapPreload.setTilesScaledToDpi(true);

Configuration.getInstance().load(this, PreferenceManager.getDefaultSharedPreferences(this));
Configuration.getInstance().setUserAgentValue(getPackageName());

mapView.setMultiTouchControls(true);
mapView.getZoomController().setVisibility(CustomZoomButtonsController.Visibility.ALWAYS);
Expand Down Expand Up @@ -143,7 +144,7 @@ protected void onCreate(Bundle savedInstanceState) {
@Override
public boolean onZoom(ZoomEvent event) {
Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(() -> mapView.getController().animateTo(mapView.getMapCenter()),200); //Refresh after 200ms
handler.postDelayed(() -> refreshMap(mapView),200); //Refresh after 200ms
return false;
}
});
Expand All @@ -155,7 +156,7 @@ public boolean onZoom(ZoomEvent event) {
@Override
public boolean onZoom(ZoomEvent event) {
Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(() -> mapView2.getController().animateTo(mapView2.getMapCenter()),200); //Refresh after 200ms
handler.postDelayed(() -> refreshMap(mapView2),200); //Refresh after 200ms
return false;
}
});
Expand Down Expand Up @@ -313,7 +314,7 @@ public void showFrame(int position){

private void crossFade(MapView fromMap, MapView toMap) {
int animationDuration;
if (radarTilesOverlayEntries.size() <= 1) animationDuration = 1000; //slowdown intro
if (radarTilesOverlayEntries.size() <= 1) animationDuration = 2000; //slowdown intro
else animationDuration = 200; //milliseconds
toMap.setAlpha(0f);
toMap.setVisibility(View.VISIBLE);
Expand All @@ -331,12 +332,16 @@ private void crossFade(MapView fromMap, MapView toMap) {
@Override
public void onAnimationEnd(Animator animation) {
fromMap.setVisibility(View.INVISIBLE);
toMap.getController().animateTo(toMap.getMapCenter()); //another refresh, sometimes overlays do not fully load
refreshMap(toMap); //another refresh, sometimes overlays do not fully load
crossfadeRunning = false;
}
});
}

private static void refreshMap(MapView map) {
map.getController().animateTo(map.getMapCenter());
}

private void replaceLayer(MapView map, TilesOverlay newRadarOverlay, TilesOverlay newInfraredOverlay, IGeoPoint center, double zoom) {
map.getOverlays().clear();
map.getOverlays().add(newInfraredOverlay);
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/29.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Minor fixes for rain radar

0 comments on commit 260d850

Please sign in to comment.