1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-06-24 08:16:23 +00:00

Add param to disable push_on_receive mechanism

This commit is contained in:
Loic Blot 2015-06-23 18:46:47 +02:00
parent 3b7351db79
commit af171ce788
3 changed files with 12 additions and 2 deletions

View File

@ -9,6 +9,12 @@
android:negativeButtonText="@null" android:negativeButtonText="@null"
android:positiveButtonText="@null" android:positiveButtonText="@null"
android:title="@string/pref_title_sync_frequency" /> android:title="@string/pref_title_sync_frequency" />
<CheckBoxPreference android:id="@+id/checkbox_push_on_receive"
android:defaultValue="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:key="push_on_receive"
android:title="@string/pref_push_on_receive" />
<CheckBoxPreference android:id="@+id/checkbox_sync_wifi" <CheckBoxPreference android:id="@+id/checkbox_sync_wifi"
android:defaultValue="true" android:defaultValue="true"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -43,6 +43,7 @@ public class GeneralSettingsActivity extends NrzSettingsActivity {
_prefsRessourceFile = R.xml.pref_data_sync; _prefsRessourceFile = R.xml.pref_data_sync;
// Bind our boolean preferences // Bind our boolean preferences
_boolPrefs.add(new BindObjectPref("push_on_receive", DefaultPrefs.pushOnReceive));
_boolPrefs.add(new BindObjectPref("sync_wifi", DefaultPrefs.syncWifi)); _boolPrefs.add(new BindObjectPref("sync_wifi", DefaultPrefs.syncWifi));
_boolPrefs.add(new BindObjectPref("sync_4g", DefaultPrefs.sync4G)); _boolPrefs.add(new BindObjectPref("sync_4g", DefaultPrefs.sync4G));
_boolPrefs.add(new BindObjectPref("sync_3g", DefaultPrefs.sync3G)); _boolPrefs.add(new BindObjectPref("sync_3g", DefaultPrefs.sync3G));
@ -59,7 +60,8 @@ public class GeneralSettingsActivity extends NrzSettingsActivity {
protected static void handleCheckboxPreference(final String key, final Boolean value) { protected static void handleCheckboxPreference(final String key, final Boolean value) {
// Network types allowed for sync // Network types allowed for sync
if(key.equals(new String("sync_wifi")) || key.equals("sync_2g") || if(key.equals(new String("push_on_receive")) ||
key.equals(new String("sync_wifi")) || key.equals("sync_2g") ||
key.equals(new String("sync_3g")) || key.equals("sync_gprs") || key.equals(new String("sync_3g")) || key.equals("sync_gprs") ||
key.equals("sync_4g") || key.equals("sync_others")) { key.equals("sync_4g") || key.equals("sync_others")) {
final OCSMSSharedPrefs prefs = new OCSMSSharedPrefs(_context); final OCSMSSharedPrefs prefs = new OCSMSSharedPrefs(_context);

View File

@ -2,9 +2,11 @@ package fr.unix_experience.owncloud_sms.defines;
public class DefaultPrefs { public class DefaultPrefs {
public final static Integer syncInterval = 15; public final static Integer syncInterval = 15;
public final static Boolean pushOnReceive = true;
public final static Boolean syncWifi = true; public final static Boolean syncWifi = true;
public final static Boolean sync2G = true; public final static Boolean sync2G = true;
public final static Boolean syncGPRS = true; public final static Boolean syncGPRS = true;
public final static Boolean sync3G = true; public final static Boolean sync3G = true;
public final static Boolean sync4G = true; public final static Boolean sync4G = true;
public final static Boolean syncOthers = true; public final static Boolean syncOthers = true;