diff options
Diffstat (limited to 'org.fox.ttrss/src')
4 files changed, 14 insertions, 41 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java index 31f5749d..32a2d2e2 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/OnlineActivity.java @@ -19,6 +19,7 @@ import android.net.Uri; import android.os.Bundle; import android.os.Handler; import android.preference.PreferenceManager; +import android.support.design.widget.Snackbar; import android.support.v4.app.DialogFragment; import android.support.v7.view.ActionMode; import android.support.v7.widget.Toolbar; @@ -178,49 +179,18 @@ public class OnlineActivity extends CommonActivity { } } - // TODO: if necessary rework into a class for multiple alert dialog types - public static class SwitchOfflineDialogFragment extends DialogFragment { - - public static SwitchOfflineDialogFragment newInstance() { - SwitchOfflineDialogFragment frag = new SwitchOfflineDialogFragment(); - Bundle args = new Bundle(); - frag.setArguments(args); - return frag; - } - - @Override - public Dialog onCreateDialog(Bundle savedInstanceState) { - - return new AlertDialog.Builder( - getActivity()) - .setMessage(R.string.dialog_offline_success) - .setPositiveButton(R.string.dialog_offline_go, - new Dialog.OnClickListener() { - public void onClick(DialogInterface dialog, - int which) { - - ((OnlineActivity)getActivity()).switchOfflineSuccess(); - - } - }) - .setNegativeButton(R.string.dialog_cancel, - new Dialog.OnClickListener() { - public void onClick(DialogInterface dialog, - int which) { - - ((OnlineActivity)getActivity()).cancelOfflineSync(); - - } - }) - .create(); - } - } protected void switchOffline() { if (m_offlineModeStatus == 2) { - DialogFragment frag = SwitchOfflineDialogFragment.newInstance(); - frag.show(getSupportFragmentManager(), FRAG_DIALOG); + Snackbar.make(findViewById(android.R.id.content), R.string.dialog_offline_success, Snackbar.LENGTH_LONG) + .setAction(R.string.dialog_offline_go, new View.OnClickListener() { + @Override + public void onClick(View v) { + switchOfflineSuccess(); + } + }) + .show(); } else if (m_offlineModeStatus == 0) { diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineDownloadService.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineDownloadService.java index ab31c43e..5aa80af8 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineDownloadService.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/offline/OfflineDownloadService.java @@ -134,6 +134,7 @@ public class OfflineDownloadService extends Service { NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext()) .setContentTitle(getString(R.string.dialog_offline_success)) + .setContentText(getString(R.string.offline_tap_to_switch)) .setContentIntent(contentIntent) .setWhen(System.currentTimeMillis()) .setSmallIcon(R.drawable.ic_notification) @@ -142,7 +143,7 @@ public class OfflineDownloadService extends Service { .setOnlyAlertOnce(true); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - builder.setCategory(Notification.CATEGORY_PROGRESS) + builder.setCategory(Notification.CATEGORY_MESSAGE) .setVibrate(new long[0]) .setVisibility(Notification.VISIBILITY_PUBLIC) .setColor(0x88b0f0) diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/util/ImageCacheService.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/util/ImageCacheService.java index 8326f36e..f25bc718 100644 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/util/ImageCacheService.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/util/ImageCacheService.java @@ -143,6 +143,7 @@ public class ImageCacheService extends IntentService { NotificationCompat.Builder builder = new NotificationCompat.Builder(getApplicationContext()) .setContentTitle(getString(R.string.dialog_offline_success)) + .setContentText(getString(R.string.offline_tap_to_switch)) .setContentIntent(contentIntent) .setWhen(System.currentTimeMillis()) .setSmallIcon(R.drawable.ic_notification) @@ -151,7 +152,7 @@ public class ImageCacheService extends IntentService { .setOnlyAlertOnce(true); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - builder.setCategory(Notification.CATEGORY_PROGRESS) + builder.setCategory(Notification.CATEGORY_MESSAGE) .setVibrate(new long[0]) .setVisibility(Notification.VISIBILITY_PUBLIC) .setColor(0x88b0f0) diff --git a/org.fox.ttrss/src/main/res/values/strings.xml b/org.fox.ttrss/src/main/res/values/strings.xml index 61ee0352..ca2011df 100755 --- a/org.fox.ttrss/src/main/res/values/strings.xml +++ b/org.fox.ttrss/src/main/res/values/strings.xml @@ -255,4 +255,5 @@ <string name="pref_widget_update_interval_summary">This interval is imprecise due to Android limitations</string> <string name="prefs_offline_sort_by_feed">Group headlines by feeds</string> <string name="reload">Reload</string> + <string name="offline_tap_to_switch">Tap to switch offline</string> </resources> |