From 06f6ec0f1899f9243eabb9e02db790b6363dbc08 Mon Sep 17 00:00:00 2001 From: Gitsaibot Date: Fri, 24 Jun 2022 14:55:34 +0200 Subject: [PATCH] Cleanup --- app/src/main/java/net/gitsaibot/af/AfProvider.java | 2 +- app/src/main/java/net/gitsaibot/af/ColorView.java | 2 +- app/src/main/java/net/gitsaibot/af/data/AfMetWeatherData.java | 4 +--- .../main/java/net/gitsaibot/af/widget/AfDetailedWidget.java | 3 --- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/net/gitsaibot/af/AfProvider.java b/app/src/main/java/net/gitsaibot/af/AfProvider.java index ed2a0d2..2110d36 100644 --- a/app/src/main/java/net/gitsaibot/af/AfProvider.java +++ b/app/src/main/java/net/gitsaibot/af/AfProvider.java @@ -1277,7 +1277,7 @@ public int bulkInsert(@NonNull Uri uri, @NonNull ContentValues[] values) { } break; default: - throw new UnsupportedOperationException("AixProvider.bulkInsert() Unsupported URI: " + uri); + throw new UnsupportedOperationException("AfProvider.bulkInsert() Unsupported URI: " + uri); } return numInserted; diff --git a/app/src/main/java/net/gitsaibot/af/ColorView.java b/app/src/main/java/net/gitsaibot/af/ColorView.java index d5901eb..e73372d 100644 --- a/app/src/main/java/net/gitsaibot/af/ColorView.java +++ b/app/src/main/java/net/gitsaibot/af/ColorView.java @@ -385,7 +385,7 @@ public void setColor(int color) { invalidate(); } else if (mMode == MODE_ALPHA) { mShader = buildShader( - mMode == MODE_ALPHA ? buildAlphaColorArray(mColor) : HUE_COLORS); + buildAlphaColorArray(mColor)); mColorAreaPaint.setShader(mShader); invalidate(); } diff --git a/app/src/main/java/net/gitsaibot/af/data/AfMetWeatherData.java b/app/src/main/java/net/gitsaibot/af/data/AfMetWeatherData.java index ff93eb2..2c1a422 100644 --- a/app/src/main/java/net/gitsaibot/af/data/AfMetWeatherData.java +++ b/app/src/main/java/net/gitsaibot/af/data/AfMetWeatherData.java @@ -149,9 +149,7 @@ public void update(AfLocationInfo afLocationInfo, long currentUtcTime) case XmlPullParser.END_TAG: if (parser.getName().equals("time") && contentValues != null) { - if (currentList != null && contentValues != null) { - currentList.add(contentValues); - } + currentList.add(contentValues); } break; case XmlPullParser.START_TAG: diff --git a/app/src/main/java/net/gitsaibot/af/widget/AfDetailedWidget.java b/app/src/main/java/net/gitsaibot/af/widget/AfDetailedWidget.java index 52e6978..d4967aa 100644 --- a/app/src/main/java/net/gitsaibot/af/widget/AfDetailedWidget.java +++ b/app/src/main/java/net/gitsaibot/af/widget/AfDetailedWidget.java @@ -77,7 +77,6 @@ public class AfDetailedWidget { private final Context mContext; private final AfLocationInfo mAfLocationInfo; - private final AfWidgetInfo mAfWidgetInfo; private final AfWidgetSettings mWidgetSettings; /* Common Properties */ @@ -142,7 +141,6 @@ private AfDetailedWidget(final Context context, AfWidgetInfo widgetInfo, AfLocat mNumHours = 24; mNumWeatherDataBufferHours = 6; - mAfWidgetInfo = widgetInfo; mAfLocationInfo = locationInfo; mWidgetSettings = widgetInfo.getWidgetSettings(); @@ -1453,7 +1451,6 @@ private void setupEpochAndTimes() { // Update timeFrom and timeTo to correct values given the epoch calendar.setTimeInMillis(epoch); - //calendar.setTimeInMillis(timeTemp); mTimeFrom = calendar.getTimeInMillis(); calendar.add(Calendar.HOUR_OF_DAY, mNumHours); mTimeTo = calendar.getTimeInMillis();