0
0
mirror of https://github.com/ankidroid/Anki-Android.git synced 2024-09-20 20:03:05 +02:00

Minor widget enhancements

- Update the widget after sync (in case sync finishes in background)
- Launch the correct activity when the widget is clicked. Make it
  behave like our normal launcher icon.
This commit is contained in:
Houssam Salem 2015-10-27 11:12:06 +11:00 committed by timrae
parent 87b8ee470c
commit 49c6cdc783
2 changed files with 3 additions and 2 deletions

View File

@ -1475,6 +1475,7 @@ public class DeckPicker extends NavigationDrawerActivity implements
showSyncLogMessage(R.string.sync_database_acknowledge);
}
updateDeckList();
WidgetStatus.update(DeckPicker.this);
}
// Write the time last sync was carried out. Useful for automatic sync interval.

View File

@ -29,7 +29,7 @@ import android.view.View;
import android.widget.RemoteViews;
import com.ichi2.anki.AnkiDroidApp;
import com.ichi2.anki.DeckPicker;
import com.ichi2.anki.IntentHandler;
import com.ichi2.anki.R;
import com.ichi2.compat.CompatHelper;
@ -161,7 +161,7 @@ public class AnkiDroidWidgetSmall extends AppWidgetProvider {
// Add a click listener to open Anki from the icon.
// This should be always there, whether there are due cards or not.
Intent ankiDroidIntent = new Intent(context, DeckPicker.class);
Intent ankiDroidIntent = new Intent(context, IntentHandler.class);
ankiDroidIntent.setAction(Intent.ACTION_MAIN);
ankiDroidIntent.addCategory(Intent.CATEGORY_LAUNCHER);
PendingIntent pendingAnkiDroidIntent = PendingIntent.getActivity(context, 0, ankiDroidIntent,