Skip to content

Commit

Permalink
5.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparker0i committed Feb 4, 2018
1 parent 5c6e7ef commit 1262325
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.a5corp.weather"
minSdkVersion 17
targetSdkVersion 27
versionCode 654
versionName "5.3.1"
versionCode 656
versionName "5.3.2"
}
buildTypes {
release {
Expand Down
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":654},"path":"app-release.apk","properties":{"packageId":"com.a5corp.weather","split":"","minSdkVersion":"17"}}]
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":656},"path":"app-release.apk","properties":{"packageId":"com.a5corp.weather","split":"","minSdkVersion":"17"}}]
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,22 @@ public class LargeWidgetProvider extends AbstractWidgetProvider {

private static final String ACTION_UPDATE_TIME = "com.a5corp.weather.UPDATE_TIME";

private static final long DURATION_MINUTE = TimeUnit.SECONDS.toMillis(30);

@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
for (int widgetId : appWidgetIds) {
com.a5corp.weather.model.Log.i("In" , "New Widget Provider");
RemoteViews remoteViews = new RemoteViews(context.getPackageName(),
R.layout.widget_large);

Intent intent = new Intent(context, AlarmReceiver.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(context,
Intent intent = new Intent(context, WeatherActivity.class);
PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
remoteViews.setOnClickPendingIntent(R.id.widget_root, pendingIntent);

intent = new Intent(context, AlarmReceiver.class);
pendingIntent = PendingIntent.getBroadcast(context,
0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
remoteViews.setOnClickPendingIntent(R.id.widget_button_refresh, pendingIntent);

intent = new Intent(context, WeatherActivity.class);
pendingIntent = PendingIntent.getActivity(context, 0, intent, 0);
remoteViews.setOnClickPendingIntent(R.id.widget_root, pendingIntent);

SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
WeatherInfo weather;
if(!sp.getString("lastToday", "").equals("")) {
Expand Down Expand Up @@ -112,10 +110,8 @@ private static void scheduleNextUpdate(Context context) {
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
long now = new Date().getTime();
long nextUpdate = now + Long.parseLong(new Prefs(context).getTime());
if (BuildConfig.DEBUG) {
Log.i(TAG, "Next widget update: " +
android.text.format.DateFormat.getTimeFormat(context).format(new Date(nextUpdate)));
}
Log.i(TAG, "Next widget update: " +
android.text.format.DateFormat.getTimeFormat(context).format(new Date(nextUpdate)));
if (Build.VERSION.SDK_INT >= 19) {
alarmManager.setExact(AlarmManager.RTC, nextUpdate, getTimeIntent(context));
} else {
Expand Down

0 comments on commit 1262325

Please sign in to comment.