Skip to content

Commit

Permalink
Update V6.2
Browse files Browse the repository at this point in the history
Bugfix
  • Loading branch information
woheller69 committed Aug 31, 2023
1 parent d75824d commit 531b548
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.woheller69.weather"
minSdkVersion 21
targetSdkVersion 33
versionCode 61
versionName "6.1"
versionCode 62
versionName "6.2"

buildConfigField "String", "DEFAULT_API_KEY", "\"00000000000000000000000000000000\""
buildConfigField "String", "BASE_URL", "\"https://api.openweathermap.org/data/2.5/\""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public class CourseOfDayAdapter extends RecyclerView.Adapter<CourseOfDayAdapter.
this.courseOfDayList = courseOfDayList;
this.recyclerViewHeader=recyclerViewHeader;
this.recyclerView=recyclerView;
if (courseOfDayList.size()!=0 && courseOfDayList.get(0)!=null) {
if (courseOfDayList!= null && courseOfDayList.size()!=0 && courseOfDayList.get(0)!=null) {
this.courseOfDayHeaderDate = new Date(courseOfDayList.get(0).getLocalForecastTime(context));
}else this.courseOfDayHeaderDate=new Date(); //fallback if no data available
}else this.courseOfDayHeaderDate=new Date(); //fallback if no data available*/
}

public void setWeekRecyclerView(RecyclerView weekRecyclerView){
Expand Down Expand Up @@ -142,7 +142,8 @@ private void updateRecyclerViewHeader() {

@Override
public int getItemCount() {
return courseOfDayList.size();
if (courseOfDayList==null) return 0;
else return courseOfDayList.size();
}

class CourseOfDayViewHolder extends RecyclerView.ViewHolder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,14 @@ public static void updateLocation(final Context context, int cityID, boolean man
Location locationGPS = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (locationGPS != null) {
CityToWatch city;
double lat = Math.round(locationGPS.getLatitude()*100.0)/100.0; //round 2 digits
double lon = Math.round(locationGPS.getLongitude()*100.0)/100.0; //round 2 digits
double lat = locationGPS.getLatitude();
double lon = locationGPS.getLongitude();
for (int i=0; i<cities.size();i++){
if (cities.get(i).getCityId()==cityID) {
city = cities.get(i);
city.setLatitude((float) lat);
city.setLongitude((float) lon);
city.setCityName(String.format(Locale.getDefault(),"%.2f° / %.2f°", lat, lon));
//Toast.makeText(context.getApplicationContext(), String.format("%.2f / %.2f", lat, lon), Toast.LENGTH_SHORT).show();
db.updateCityToWatch(city);

break;
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/de-DE/changelogs/62.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fehlerbehebung
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/62.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bugfix

0 comments on commit 531b548

Please sign in to comment.