Added refresh shortcut

pull/160/head
M66B 6 years ago
parent 1e4e7f79d3
commit 06e78b3a00

@ -64,15 +64,19 @@
android:launchMode="singleInstance"
android:theme="@style/Theme.AppCompat.Translucent">
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
<intent-filter>
<action android:name="${applicationId}.REFRESH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
@ -80,6 +84,7 @@
android:exported="true"
android:launchMode="singleInstance"
android:parentActivityName=".ActivityMain">
<intent-filter>
<action android:name="android.intent.action.APPLICATION_PREFERENCES" />
<category android:name="android.intent.category.DEFAULT" />
@ -89,6 +94,7 @@
<activity
android:name=".ActivityWidgetUnified"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
@ -127,22 +133,23 @@
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<data android:mimeType="*/*" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SENDTO" />
<data android:scheme="mailto" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="mailto" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data android:scheme="mailto" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="mailto" />
</intent-filter>
</activity>
@ -213,6 +220,7 @@
<service
android:name=".ServiceExternal"
android:foregroundServiceType="dataSync">
<intent-filter>
<action android:name="${applicationId}.ENABLE" />
<action android:name="${applicationId}.DISABLE" />
@ -224,6 +232,7 @@
android:icon="@drawable/baseline_sync_disabled_24"
android:label="@string/app_name"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
@ -234,6 +243,7 @@
android:icon="@drawable/baseline_mail_outline_24"
android:label="@string/tile_unseen"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
@ -254,26 +264,26 @@
android:name=".Widget"
android:label="@string/tile_unseen">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget" />
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
</receiver>
<receiver
android:name=".WidgetUnified"
android:label="@string/title_folder_unified">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="@xml/widget_unified" />
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
</receiver>
<service
@ -281,6 +291,7 @@
android:permission="android.permission.BIND_REMOTEVIEWS" />
<receiver android:name=".ReceiverAutoStart">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>

@ -34,6 +34,8 @@ import androidx.preference.PreferenceManager;
import java.util.List;
public class ActivityMain extends ActivityBase implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener {
private static final String ACTION_REFRESH = BuildConfig.APPLICATION_ID + ".REFRESH";
@Override
protected void onCreate(Bundle savedInstanceState) {
getSupportFragmentManager().addOnBackStackChangedListener(this);
@ -83,6 +85,9 @@ public class ActivityMain extends ActivityBase implements FragmentManager.OnBack
protected void onExecuted(Bundle args, Boolean hasAccounts) {
if (hasAccounts) {
startActivity(new Intent(ActivityMain.this, ActivityView.class));
if (ACTION_REFRESH.equals(getIntent().getAction()))
ServiceSynchronize.process(ActivityMain.this, true);
else
ServiceSynchronize.watchdog(ActivityMain.this);
ServiceSend.watchdog(ActivityMain.this);
} else

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

@ -21,6 +21,7 @@
<string name="tile_synchronize">Synchronize</string>
<string name="tile_unseen">New messages</string>
<string name="shortcut_refresh">Refresh</string>
<string name="shortcut_compose">Compose</string>
<string name="shortcut_setup">Settings</string>

@ -1,4 +1,16 @@
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:enabled="true"
android:icon="@drawable/ic_shortcut_refresh"
android:shortcutId="refresh"
android:shortcutShortLabel="@string/shortcut_refresh">
<intent
android:action="eu.faircode.email.REFRESH"
android:targetClass="eu.faircode.email.ActivityMain"
android:targetPackage="eu.faircode.email" />
<categories android:name="android.shortcut.conversation" />
</shortcut>
<shortcut
android:enabled="true"
android:icon="@drawable/ic_shortcut_edit"
@ -12,7 +24,7 @@
</shortcut>
<shortcut
android:enabled="true"
android:enabled="false"
android:icon="@drawable/ic_shortcut_settings"
android:shortcutId="setup"
android:shortcutShortLabel="@string/shortcut_setup">

Loading…
Cancel
Save