Эх сурвалжийг харах

remove unsued preferences/strings

AndyScherzinger 7 жил өмнө
parent
commit
acbf30642a

+ 2 - 101
src/main/java/com/owncloud/android/ui/activity/Preferences.java

@@ -46,10 +46,8 @@ import android.preference.PreferenceManager;
 import android.preference.PreferenceScreen;
 import android.preference.SwitchPreference;
 import android.support.annotation.LayoutRes;
-import android.support.annotation.Nullable;
 import android.support.v7.app.ActionBar;
 import android.support.v7.app.AppCompatDelegate;
-import android.support.v7.widget.Toolbar;
 import android.view.Menu;
 import android.view.MenuInflater;
 import android.view.MenuItem;
@@ -63,7 +61,6 @@ import com.owncloud.android.R;
 import com.owncloud.android.authentication.AccountUtils;
 import com.owncloud.android.datamodel.ArbitraryDataProvider;
 import com.owncloud.android.datamodel.ExternalLinksProvider;
-import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.datastorage.DataStorageProvider;
 import com.owncloud.android.datastorage.StoragePoint;
 import com.owncloud.android.lib.common.ExternalLink;
@@ -71,9 +68,7 @@ import com.owncloud.android.lib.common.ExternalLinkType;
 import com.owncloud.android.lib.common.OwnCloudAccount;
 import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
 import com.owncloud.android.lib.common.utils.Log_OC;
-import com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle;
 import com.owncloud.android.utils.AnalyticsUtils;
-import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.ThemeUtils;
 
 import java.io.IOException;
@@ -92,8 +87,6 @@ public class Preferences extends PreferenceActivity
 
     private static final String SCREEN_NAME = "Settings";
 
-    private static final int ACTION_SELECT_UPLOAD_PATH = 1;
-    private static final int ACTION_SELECT_UPLOAD_VIDEO_PATH = 2;
     private static final int ACTION_REQUEST_PASSCODE = 5;
     private static final int ACTION_CONFIRM_PASSCODE = 6;
 
@@ -113,20 +106,6 @@ public class Preferences extends PreferenceActivity
     private Preference pAboutApp;
     private AppCompatDelegate mDelegate;
 
-    private String mUploadPath;
-    private PreferenceCategory mPrefInstantUploadCategory;
-    private CheckBoxPreferenceWithLongTitle mPrefInstantUpload;
-    private Preference mPrefInstantUploadBehaviour;
-    private Preference mPrefInstantUploadPath;
-    private Preference mPrefInstantUploadUseSubfolders;
-    private Preference mPrefInstantPictureUploadOnlyOnCharging;
-    private Preference mPrefInstantUploadPathWiFi;
-    private CheckBoxPreferenceWithLongTitle mPrefInstantVideoUpload;
-    private Preference mPrefInstantVideoUploadPath;
-    private Preference mPrefInstantVideoUploadUseSubfolders;
-    private Preference mPrefInstantVideoUploadPathWiFi;
-    private Preference mPrefInstantVideoUploadOnlyOnCharging;
-    private String mUploadVideoPath;
     private ListPreference mPrefStoragePath;
     private String mStoragePath;
 
@@ -149,7 +128,7 @@ public class Preferences extends PreferenceActivity
         super.onCreate(savedInstanceState);
         addPreferencesFromResource(R.xml.preferences);
 
-        ActionBar actionBar = getSupportActionBar();
+        ActionBar actionBar = getDelegate().getSupportActionBar();
         actionBar.setDisplayHomeAsUpEnabled(true);
         ThemeUtils.setColoredTitle(actionBar, getString(R.string.actionbar_settings));
         actionBar.setBackgroundDrawable(new ColorDrawable(ThemeUtils.primaryColor()));
@@ -565,9 +544,6 @@ public class Preferences extends PreferenceActivity
             });
         }
 
-        mPrefInstantUploadCategory = (PreferenceCategory) findPreference("instant_uploading_category");
-        getPreferenceScreen().removePreference(mPrefInstantUploadCategory);
-
         // About category
         PreferenceCategory preferenceCategoryAbout = (PreferenceCategory) findPreference("about");
         preferenceCategoryAbout.setTitle(ThemeUtils.getColoredTitle(getString(R.string.prefs_category_about),
@@ -706,32 +682,7 @@ public class Preferences extends PreferenceActivity
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
 
-        if (requestCode == ACTION_SELECT_UPLOAD_PATH && resultCode == RESULT_OK) {
-
-            OCFile folderToUpload = data.getParcelableExtra(UploadPathActivity.EXTRA_FOLDER);
-
-            mUploadPath = folderToUpload.getRemotePath();
-
-            mUploadPath = DisplayUtils.getPathWithoutLastSlash(mUploadPath);
-
-            // Show the path on summary preference
-            mPrefInstantUploadPath.setSummary(mUploadPath);
-
-            saveInstantUploadPathOnPreferences();
-
-        } else if (requestCode == ACTION_SELECT_UPLOAD_VIDEO_PATH && resultCode == RESULT_OK) {
-
-            OCFile folderToUploadVideo = data.getParcelableExtra(UploadPathActivity.EXTRA_FOLDER);
-
-            mUploadVideoPath = folderToUploadVideo.getRemotePath();
-
-            mUploadVideoPath = DisplayUtils.getPathWithoutLastSlash(mUploadVideoPath);
-
-            // Show the video path on summary preference
-            mPrefInstantVideoUploadPath.setSummary(mUploadVideoPath);
-
-            saveInstantUploadVideoPathOnPreferences();
-        } else if (requestCode == ACTION_REQUEST_PASSCODE && resultCode == RESULT_OK) {
+        if (requestCode == ACTION_REQUEST_PASSCODE && resultCode == RESULT_OK) {
             String passcode = data.getStringExtra(PassCodeActivity.KEY_PASSCODE);
             if (passcode != null && passcode.length() == 4) {
                 SharedPreferences.Editor appPrefs = PreferenceManager
@@ -759,14 +710,6 @@ public class Preferences extends PreferenceActivity
         }
     }
 
-    public ActionBar getSupportActionBar() {
-        return getDelegate().getSupportActionBar();
-    }
-
-    public void setSupportActionBar(@Nullable Toolbar toolbar) {
-        getDelegate().setSupportActionBar(toolbar);
-    }
-
     @Override
     public MenuInflater getMenuInflater() {
         return getDelegate().getMenuInflater();
@@ -871,16 +814,6 @@ public class Preferences extends PreferenceActivity
         }
     }
 
-    /**
-     * Load upload path set on preferences
-     */
-    private void loadInstantUploadPath() {
-        SharedPreferences appPrefs =
-                PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-        mUploadPath = appPrefs.getString(PreferenceKeys.INSTANT_UPLOAD_PATH, getString(R.string.instant_upload_path));
-        mPrefInstantUploadPath.setSummary(mUploadPath);
-    }
-
     /**
      * Save storage path
      */
@@ -909,38 +842,6 @@ public class Preferences extends PreferenceActivity
         mPrefStoragePath.setSummary(storageDescription);
     }
 
-    /**
-     * Save the "Instant Upload Path" on preferences
-     */
-    private void saveInstantUploadPathOnPreferences() {
-        SharedPreferences appPrefs =
-                PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-        SharedPreferences.Editor editor = appPrefs.edit();
-        editor.putString(PreferenceKeys.INSTANT_UPLOAD_PATH, mUploadPath);
-        editor.apply();
-    }
-
-    /**
-     * Load upload video path set on preferences
-     */
-    private void loadInstantUploadVideoPath() {
-        SharedPreferences appPrefs =
-                PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-        mUploadVideoPath = appPrefs.getString("instant_video_upload_path", getString(R.string.instant_upload_path));
-        mPrefInstantVideoUploadPath.setSummary(mUploadVideoPath);
-    }
-
-    /**
-     * Save the "Instant Video Upload Path" on preferences
-     */
-    private void saveInstantUploadVideoPathOnPreferences() {
-        SharedPreferences appPrefs =
-                PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
-        SharedPreferences.Editor editor = appPrefs.edit();
-        editor.putString(PreferenceKeys.INSTANT_VIDEO_UPLOAD_PATH, mUploadVideoPath);
-        editor.apply();
-    }
-
     @Override
     public void onStorageMigrationFinished(String storagePath, boolean succeed) {
         if (succeed) {

+ 0 - 9
src/main/res/values/strings.xml

@@ -36,21 +36,12 @@
     <string name="drawer_open">Open</string>
     <string name="prefs_category_general">General</string>
     <string name="prefs_category_more">More</string>
-    <string name="prefs_accounts">Accounts</string>
     <string name="prefs_manage_accounts">Manage accounts</string>
     <string name="prefs_passcode">Passcode lock</string>
     <string name="prefs_fingerprint">Fingerprint lock</string>
     <string name="prefs_fingerprint_notsetup">No fingerprints have been set up.</string>
     <string name="prefs_expert_mode">Expert mode</string>
     <string name="prefs_show_hidden_files">Show hidden files</string>
-    <string name="prefs_instant_upload">Instant uploading of pictures</string>
-    <string name="prefs_instant_upload_summary">Upload pictures taken by camera instantly</string>
-    <string name="prefs_instant_video_upload">Instant uploading of video</string>
-    <string name="prefs_instant_video_upload_summary">Upload videos recorded by camera instantly</string>
-    <string name="prefs_log_title">Enable logging</string>
-    <string name="prefs_log_summary">This is used to log problems</string>
-    <string name="prefs_log_title_history">Logging history</string>
-    <string name="prefs_log_summary_history">This shows the recorded logs</string>
     <string name="prefs_log_delete_history_button">Delete history</string>
     <string name="prefs_calendar_contacts">Sync calendar &amp; contacts</string>
     <string name="prefs_calendar_contacts_summary">Set up DAVdroid (v1.3.0+) for current account</string>

+ 0 - 54
src/main/res/xml/preferences.xml

@@ -38,60 +38,6 @@
 			android:key="synced_folders_configure_folders"/>
 	</PreferenceCategory>
 
-    <PreferenceCategory android:title="@string/prefs_category_instant_uploading" android:key="instant_uploading_category">
-		<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle android:key="instant_uploading"
-	                        android:title="@string/prefs_instant_upload"
-	                        android:summary="@string/prefs_instant_upload_summary"/>
-        <com.owncloud.android.ui.PreferenceWithLongSummary
-							android:title="@string/prefs_instant_upload_path_title"
-							android:key="instant_upload_path" />
-		<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
-							android:title="@string/prefs_instant_upload_path_use_subfolders_title"
-                            android:summary="@string/prefs_instant_upload_path_use_subfolders_summary"
-							android:key="instant_upload_path_use_subfolders" />
-	    <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
-			android:dependency="instant_uploading"
-			android:disableDependentsState="true"
-	        android:title="@string/instant_upload_on_wifi"
-	        android:key="instant_upload_on_wifi"/>
-		<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
-			android:title="@string/instant_upload_on_charging"
-			android:key="instant_upload_on_charging"/>
-		<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
-			android:key="instant_video_uploading"
-	        android:title="@string/prefs_instant_video_upload"
-	        android:summary="@string/prefs_instant_video_upload_summary" />
-	    <com.owncloud.android.ui.PreferenceWithLongSummary
-							android:title="@string/prefs_instant_video_upload_path_title"
-							android:key="instant_video_upload_path" />
-		<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
-			android:title="@string/prefs_instant_upload_path_use_subfolders_title"
-			android:summary="@string/prefs_instant_upload_path_use_subfolders_summary"
-			android:key="instant_video_upload_path_use_subfolders" />
-	    <com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
-	        				android:title="@string/instant_video_upload_on_wifi"
-	        				android:key="instant_video_upload_on_wifi"/>
-		<com.owncloud.android.ui.CheckBoxPreferenceWithLongTitle
-			android:title="@string/instant_video_upload_on_charging"
-			android:key="instant_video_upload_on_charging"/>
-		<com.owncloud.android.ui.dialog.OwnCloudListPreference android:key="prefs_instant_behaviour"
-			android:dialogTitle="@string/prefs_instant_behaviour_dialogTitle"
-			android:title="@string/prefs_instant_behaviour_title"
-			android:entries="@array/pref_behaviour_entries"
-			android:entryValues="@array/pref_behaviour_entryValues"
-			android:defaultValue="NOTHING"
-			android:summary="%s"
-			/>
-	    <!-- DISABLED FOR RELEASE UNTIL FIXED
-	    CheckBoxPreference android:key="log_to_file"
-	                        android:title="@string/prefs_log_title"
-	                        android:summary="@string/prefs_log_summary"/>
-		<Preference 		android:key="log_history"
-	                        android:title="@string/prefs_log_title_history"
-	                        android:summary="@string/prefs_log_summary_history"/ -->
-
-    </PreferenceCategory>
-
 	<PreferenceCategory android:title="@string/prefs_category_details" android:key="details">
 		<com.owncloud.android.ui.ThemeableSwitchPreference
 			android:title="@string/prefs_passcode"