فهرست منبع

Add actionBar

masensio 9 سال پیش
والد
کامیت
4f2f0ceb80

+ 1 - 1
build.gradle

@@ -23,7 +23,7 @@ dependencies {
     compile 'com.android.support:support-v4:19.1.0'
     compile project(':owncloud-android-library')
     compile 'com.jakewharton:disklrucache:2.0.2'
-    compile 'com.android.support:appcompat-v7:22.1.1'
+    compile 'com.android.support:appcompat-v7:19.1.0'
 }
 
 android {

+ 4 - 3
res/layout-land/account_setup.xml

@@ -93,7 +93,7 @@
 						android:drawablePadding="5dp"
 						android:paddingRight="55dp"
 						android:contentDescription="@string/auth_host_address"
-						>
+						android:textColor="@color/textColor">
 						<requestFocus />
 					</EditText>
 					<ImageButton
@@ -166,7 +166,8 @@
 					android:ems="10"
 					android:hint="@string/auth_username"
 					android:inputType="textNoSuggestions"
-					android:contentDescription="@string/auth_username"/>
+					android:contentDescription="@string/auth_username"
+					android:textColor="@color/textColor" />
 		
 				<EditText
 				    android:id="@+id/account_password"
@@ -177,7 +178,7 @@
 					android:inputType="textPassword"
 					android:drawablePadding="5dp"
 					android:contentDescription="@string/auth_password"
-					/>
+					android:textColor="@color/textColor" />
 		        
 				<TextView
 					android:id="@+id/auth_status_text"

+ 3 - 3
res/layout/account_setup.xml

@@ -81,7 +81,7 @@
 				android:drawablePadding="5dp"
 				android:paddingRight="55dp"
 				android:contentDescription="@string/auth_host_address"
-				>
+                android:textColor="@color/textColor">
 				<requestFocus />
 			</EditText>
 			<ImageButton
@@ -153,7 +153,7 @@
             android:hint="@string/auth_username"
             android:inputType="textNoSuggestions"
             android:contentDescription="@string/auth_username"
-			/>
+            android:textColor="@color/textColor" />
 
 		<EditText
 		    android:id="@+id/account_password"
@@ -164,7 +164,7 @@
 		    android:hint="@string/auth_password"
 		    android:inputType="textPassword"
 		    android:contentDescription="@string/auth_password"
-            />
+            android:textColor="@color/textColor" />
         
         <TextView
             android:id="@+id/auth_status_text"

+ 11 - 8
res/menu/main_menu.xml

@@ -17,51 +17,54 @@
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 -->
-<menu xmlns:android="http://schemas.android.com/apk/res/android" >
+<menu xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <item
         android:id="@+id/action_upload"
         android:icon="@drawable/ic_action_upload"
         android:orderInCategory="2"
-        android:showAsAction="always"
+        app:showAsAction="always"
         android:title="@string/actionbar_upload"
         android:contentDescription="@string/actionbar_upload"/>
     <item
         android:id="@+id/action_create_dir"
         android:icon="@drawable/ic_action_create_dir"
         android:orderInCategory="2"
-        android:showAsAction="always"
+        app:showAsAction="always"
         android:title="@string/actionbar_mkdir"
         android:contentDescription="@string/actionbar_mkdir"/>
     <item
         android:id="@+id/action_sync_account"
         android:icon="@drawable/ic_action_refresh"
         android:orderInCategory="2"
-        android:showAsAction="never"
+        app:showAsAction="never"
         android:title="@string/actionbar_sync"
         android:contentDescription="@string/actionbar_sync"/>
     <item
         android:id="@+id/action_settings"
         android:icon="@drawable/ic_action_settings"
         android:orderInCategory="2"
-        android:showAsAction="never"
+        app:showAsAction="never"
         android:title="@string/actionbar_settings"
         android:contentDescription="@string/actionbar_settings"/>
     <item
         android:id="@+id/action_logger"
         android:icon="@drawable/ic_action_settings"
         android:orderInCategory="2"
-        android:showAsAction="never"
+        app:showAsAction="never"
         android:title="@string/actionbar_logger"
         android:contentDescription="@string/actionbar_logger"/>
 	<item
         android:id="@+id/action_sort"
         android:icon="@android:drawable/ic_menu_sort_alphabetically"
         android:orderInCategory="2"
-        android:showAsAction="never"
+        app:showAsAction="never"
         android:title="@string/actionbar_sort"
         android:contentDescription="@string/actionbar_sort"/>
 
-    <!-- <item android:id="@+id/search" android:title="@string/actionbar_search" android:icon="@drawable/ic_action_search"></item> -->
+    <!-- <item android:id="@+id/search"
+    android:title="@string/actionbar_search"
+    android:icon="@drawable/ic_action_search"></item> -->
 
 </menu>

+ 7 - 19
res/values/styles.xml

@@ -25,24 +25,16 @@
     	<item name="android:actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
     	<item name="actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
     	<item name="android:buttonStyle">@style/Theme.ownCloud.ButtonStyle</item>
-    	<item name="actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
-    	<item name="android:actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
 	</style>
 	
-	<style name="Theme.ownCloud.noActionBar" parent="style/Theme.AppCompat.Light.NoActionBar">
-      <item name="android:actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
-      <item name="actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
-      <item name="android:buttonStyle">@style/Theme.ownCloud.ButtonStyle</item>
-      <item name="actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
-      <item name="android:actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
+	<style name="Theme.ownCloud.noActionBar" parent="style/Theme.AppCompat">
+        <item name="android:buttonStyle">@style/Theme.ownCloud.ButtonStyle</item>
     </style>
-	
-	<style name="Theme.ownCloud.Fullscreen" parent="style/Theme.AppCompat.NoActionBar">
-      <item name="android:actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
-      <item name="actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
-      <item name="android:windowFullscreen">true</item>
-      <item name="actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
-      <item name="android:actionDropDownStyle">@style/Theme.ownCloud.DropDownStyle</item>
+
+	<style name="Theme.ownCloud.Fullscreen" parent="style/Theme.AppCompat">
+        <item name="android:actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
+        <item name="actionBarStyle">@style/Theme.ownCloud.Widget.ActionBar</item>
+        <item name="android:windowFullscreen">true</item>
     </style>
 	
 	
@@ -55,10 +47,6 @@
     	<item name="android:shadowRadius">1</item>
     	<item name="android:shadowDy">1</item>
     	<item name="android:backgroundSplit">@drawable/split_action_bg</item>
-    	<item name="android:indeterminateProgressStyle">
-			@style/Theme.ownCloud.IndeterminateStyle
-		</item>
-    	<item name="indeterminateProgressStyle">@style/Theme.ownCloud.IndeterminateStyle</item>
 	</style>
 
 	<!-- Dialogs -->

+ 1 - 3
res/values/versioned_styles.xml

@@ -10,14 +10,12 @@
 	<!-- DropDown -->
 	<style name="Theme.ownCloud.DropDownStyle"
 		parent="style/Widget.AppCompat.Spinner.DropDown.ActionBar">
-	    <!-- <item name="android:background">@drawable/abs__spinner_ab_holo_dark</item> -->
-		<item name="android:background">@drawable/spinner_inner</item>
+		<!--<item name="android:background">@drawable/spinner_inner</item>-->
 	</style>
 	
 	<style name="Theme.ownCloud.IndeterminateStyle"
 		parent="style/Widget.AppCompat.ProgressBar">
 	    <!--<item name="android:indeterminateDrawable">@drawable/abs__progress_medium_holo</item>-->
-		<item name="android:indeterminateDrawable">@drawable/progress_small</item>
 	</style>
 
 	<!-- Notifications -->

+ 2 - 2
src/com/owncloud/android/authentication/AccountAuthenticatorActivity.java

@@ -19,7 +19,7 @@ package com.owncloud.android.authentication;
 import android.accounts.AccountAuthenticatorResponse;
 import android.accounts.AccountManager;
 import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.ActionBarActivity;
 
 /*
  * Base class for implementing an Activity that is used to help implement an AbstractAccountAuthenticator. 
@@ -32,7 +32,7 @@ import android.support.v7.app.AppCompatActivity;
  * then error AccountManager.ERROR_CODE_CANCELED will be called on the response.
  */
 
-public class AccountAuthenticatorActivity extends AppCompatActivity {
+public class AccountAuthenticatorActivity extends ActionBarActivity {
 
     private AccountAuthenticatorResponse mAccountAuthenticatorResponse = null;
     private Bundle mResultBundle = null;

+ 1 - 1
src/com/owncloud/android/authentication/AuthenticatorActivity.java

@@ -206,7 +206,7 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
     protected void onCreate(Bundle savedInstanceState) {
         //Log_OC.wtf(TAG,  "onCreate init");
         super.onCreate(savedInstanceState);
-        //getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
 
         mIsFirstAuthAttempt = true;
 

+ 2 - 2
src/com/owncloud/android/ui/activity/ErrorsWhileCopyingHandlerActivity.java

@@ -30,7 +30,7 @@ import android.os.AsyncTask;
 import android.os.Bundle;
 import android.os.Handler;
 import android.support.v4.app.DialogFragment;
-import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.ActionBarActivity;
 import android.text.method.ScrollingMovementMethod;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -61,7 +61,7 @@ import com.owncloud.android.utils.FileStorageUtils;
  * 
  * Shown when the error notification summarizing the list of errors is clicked by the user.
  */
-public class ErrorsWhileCopyingHandlerActivity  extends AppCompatActivity
+public class ErrorsWhileCopyingHandlerActivity  extends ActionBarActivity
         implements OnClickListener {
 
     private static final String TAG = ErrorsWhileCopyingHandlerActivity.class.getSimpleName();

+ 2 - 2
src/com/owncloud/android/ui/activity/FileActivity.java

@@ -37,7 +37,7 @@ import android.os.IBinder;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
-import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.ActionBarActivity;
 import android.widget.Toast;
 
 import com.owncloud.android.MainApp;
@@ -70,7 +70,7 @@ import com.owncloud.android.utils.ErrorMessageAdapter;
  * Activity with common behaviour for activities handling {@link OCFile}s in ownCloud
  * {@link Account}s .
  */
-public class FileActivity extends AppCompatActivity
+public class FileActivity extends ActionBarActivity
         implements OnRemoteOperationListener, ComponentsGetter {
 
     public static final String EXTRA_FILE = "com.owncloud.android.ui.activity.FILE";

+ 2 - 2
src/com/owncloud/android/ui/activity/GenericExplanationActivity.java

@@ -26,7 +26,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v7.app.ActionBar;
-import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.ActionBarActivity;
 import android.text.method.ScrollingMovementMethod;
 import android.view.View;
 import android.view.ViewGroup;
@@ -45,7 +45,7 @@ import com.owncloud.android.utils.DisplayUtils;
  * Added to show explanations for notifications when the user clicks on them, and there no place
  * better to show them.
  */
-public class GenericExplanationActivity  extends AppCompatActivity {
+public class GenericExplanationActivity  extends ActionBarActivity {
 
     public static final String EXTRA_LIST = GenericExplanationActivity.class.getCanonicalName() +
             ".EXTRA_LIST";

+ 2 - 2
src/com/owncloud/android/ui/activity/LogHistoryActivity.java

@@ -36,7 +36,7 @@ import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentManager;
 import android.support.v4.app.FragmentTransaction;
 import android.support.v7.app.ActionBar;
-import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.ActionBarActivity;
 import android.view.MenuItem;
 import android.view.View;
 import android.view.View.OnClickListener;
@@ -51,7 +51,7 @@ import com.owncloud.android.utils.DisplayUtils;
 import com.owncloud.android.utils.FileStorageUtils;
 
 
-public class LogHistoryActivity extends AppCompatActivity {
+public class LogHistoryActivity extends ActionBarActivity {
 
     private static final String MAIL_ATTACHMENT_TYPE = "text/plain";
 

+ 60 - 33
src/com/owncloud/android/ui/activity/PassCodeActivity.java

@@ -28,7 +28,7 @@ import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.preference.PreferenceManager;
 import android.support.v7.app.ActionBar;
-import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.ActionBarActivity;
 import android.text.Editable;
 import android.text.TextWatcher;
 import android.view.KeyEvent;
@@ -43,14 +43,17 @@ import com.owncloud.android.R;
 import com.owncloud.android.lib.common.utils.Log_OC;
 import com.owncloud.android.utils.DisplayUtils;
 
-public class PassCodeActivity extends AppCompatActivity {
+public class PassCodeActivity extends ActionBarActivity {
 
 
     private static final String TAG = PassCodeActivity.class.getSimpleName();
 
-    public final static String ACTION_ENABLE = PassCodeActivity.class.getCanonicalName() + ".ENABLE";
-    public final static String ACTION_DISABLE = PassCodeActivity.class.getCanonicalName() + ".DISABLE";
-    public final static String ACTION_REQUEST = PassCodeActivity.class.getCanonicalName()  + ".REQUEST";
+    public final static String ACTION_ENABLE = PassCodeActivity.class.getCanonicalName() +
+            ".ENABLE";
+    public final static String ACTION_DISABLE = PassCodeActivity.class.getCanonicalName() +
+            ".DISABLE";
+    public final static String ACTION_REQUEST = PassCodeActivity.class.getCanonicalName()  +
+            ".REQUEST";
 
     private Button mBCancel;
     private TextView mPassCodeHdr;
@@ -66,7 +69,8 @@ public class PassCodeActivity extends AppCompatActivity {
     /**
      * Initializes the activity.
      *
-     * An intent with a valid ACTION is expected; if none is found, an {@link IllegalArgumentException} will be thrown.
+     * An intent with a valid ACTION is expected; if none is found, an
+     * {@link IllegalArgumentException} will be thrown.
      *
      * @param savedInstanceState    Previously saved state - irrelevant in this case
      */
@@ -79,7 +83,8 @@ public class PassCodeActivity extends AppCompatActivity {
         mPassCodeHdrExplanation = (TextView) findViewById(R.id.explanation);
         mPassCodeEditTexts[0] = (EditText) findViewById(R.id.txt0);
         mPassCodeEditTexts[0].requestFocus();
-        getWindow().setSoftInputMode(android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
+        getWindow().setSoftInputMode(
+                android.view.WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
         mPassCodeEditTexts[1] = (EditText) findViewById(R.id.txt1);
         mPassCodeEditTexts[2] = (EditText) findViewById(R.id.txt2);
         mPassCodeEditTexts[3] = (EditText) findViewById(R.id.txt3);
@@ -91,9 +96,11 @@ public class PassCodeActivity extends AppCompatActivity {
             setCancelButtonEnabled(false);      // no option to cancel
 
         } else if (ACTION_ENABLE.equals(getIntent().getAction())) {
-            /// pass code preference has just been activated in Preferences; will receive and confirm pass code value
+            /// pass code preference has just been activated in Preferences;
+            // will receive and confirm pass code value
             mPassCodeHdr.setText(R.string.pass_code_configure_your_pass_code);
-            //mPassCodeHdr.setText(R.string.pass_code_enter_pass_code); // TODO choose a header, check iOS
+            //mPassCodeHdr.setText(R.string.pass_code_enter_pass_code);
+            // TODO choose a header, check iOS
             mPassCodeHdrExplanation.setVisibility(View.VISIBLE);
             setCancelButtonEnabled(true);
 
@@ -105,7 +112,8 @@ public class PassCodeActivity extends AppCompatActivity {
             setCancelButtonEnabled(true);
 
         } else {
-            throw new IllegalArgumentException("A valid ACTION is needed in the Intent passed to " + TAG);
+            throw new IllegalArgumentException("A valid ACTION is needed in the Intent passed to "
+                    + TAG);
         }
 
         setTextListeners();
@@ -116,7 +124,8 @@ public class PassCodeActivity extends AppCompatActivity {
 
 
     /**
-     * Enables or disables the cancel button to allow the user interrupt the ACTION requested to the activity.
+     * Enables or disables the cancel button to allow the user interrupt the ACTION
+     * requested to the activity.
      *
      * @param enabled       'True' makes the cancel button available, 'false' hides it.
      */
@@ -155,7 +164,8 @@ public class PassCodeActivity extends AppCompatActivity {
 
             @Override
             public boolean onKey(View v, int keyCode, KeyEvent event) {
-                if (keyCode == KeyEvent.KEYCODE_DEL && mBChange) {  // TODO WIP: event should be used to control what's exactly happening with DEL, not any custom field...
+                if (keyCode == KeyEvent.KEYCODE_DEL && mBChange) {  // TODO WIP: event should be
+                // used to control what's exactly happening with DEL, not any custom field...
                     mPassCodeEditTexts[0].setText("");
                     mPassCodeEditTexts[0].requestFocus();
                     if (!mConfirmingPassCode)
@@ -174,7 +184,9 @@ public class PassCodeActivity extends AppCompatActivity {
             @Override
             public void onFocusChange(View v, boolean hasFocus) {
                 /// TODO WIP: should take advantage of hasFocus to reduce processing
-                if (mPassCodeEditTexts[0].getText().toString().equals("")) {    // TODO WIP validation could be done in a global way, with a single OnFocusChangeListener for all the input fields
+                if (mPassCodeEditTexts[0].getText().toString().equals("")) {  // TODO WIP validation
+                // could be done in a global way, with a single OnFocusChangeListener for all the
+                // input fields
                     mPassCodeEditTexts[0].requestFocus();
                 }
             }
@@ -263,8 +275,8 @@ public class PassCodeActivity extends AppCompatActivity {
     /**
      * Processes the pass code entered by the user just after the last digit was in.
      *
-     * Takes into account the action requested to the activity, the currently saved pass code and the previously
-     * typed pass code, if any.
+     * Takes into account the action requested to the activity, the currently saved pass code and
+     * the previously typed pass code, if any.
      */
     private void processFullPassCode() {
         if (ACTION_REQUEST.equals(getIntent().getAction())) {
@@ -273,7 +285,8 @@ public class PassCodeActivity extends AppCompatActivity {
                 finish();
 
             }  else {
-                showErrorAndRestart(R.string.pass_code_wrong, R.string.pass_code_enter_pass_code, View.INVISIBLE);
+                showErrorAndRestart(R.string.pass_code_wrong, R.string.pass_code_enter_pass_code,
+                        View.INVISIBLE);
             }
 
         } else if (ACTION_DISABLE.equals(getIntent().getAction())) {
@@ -281,14 +294,16 @@ public class PassCodeActivity extends AppCompatActivity {
                 /// pass code accepted when disabling, pass code is removed
                 SharedPreferences.Editor appPrefs = PreferenceManager
                         .getDefaultSharedPreferences(getApplicationContext()).edit();
-                appPrefs.putBoolean("set_pincode", false);  // TODO remove; this should be unnecessary, was done before entering in the activity
+                appPrefs.putBoolean("set_pincode", false);  // TODO remove; this should be
+                // unnecessary, was done before entering in the activity
                 appPrefs.commit();
 
                 Toast.makeText(PassCodeActivity.this, R.string.pass_code_removed, Toast.LENGTH_LONG).show();
                 finish();
 
             } else {
-                showErrorAndRestart(R.string.pass_code_wrong, R.string.pass_code_enter_pass_code, View.INVISIBLE);
+                showErrorAndRestart(R.string.pass_code_wrong, R.string.pass_code_enter_pass_code,
+                        View.INVISIBLE);
             }
 
         } else if (ACTION_ENABLE.equals(getIntent().getAction())) {
@@ -309,18 +324,20 @@ public class PassCodeActivity extends AppCompatActivity {
     }
 
 
-    private void showErrorAndRestart(int errorMessage, int headerMessage, int explanationVisibility) {
+    private void showErrorAndRestart(int errorMessage, int headerMessage,
+                                     int explanationVisibility) {
         Arrays.fill(mPassCodeDigits, null);
         CharSequence errorSeq = getString(errorMessage);
         Toast.makeText(this, errorSeq, Toast.LENGTH_LONG).show();
         mPassCodeHdr.setText(headerMessage);                // TODO check if really needed
-        mPassCodeHdrExplanation.setVisibility(explanationVisibility);  // TODO check if really needed
+        mPassCodeHdrExplanation.setVisibility(explanationVisibility); // TODO check if really needed
         clearBoxes();
     }
 
 
     /**
-     * Ask to the user for retyping the pass code just entered before saving it as the current pass code.
+     * Ask to the user for retyping the pass code just entered before saving it as the current pass
+     * code.
      */
     protected void requestPassCodeConfirmation(){
         clearBoxes();
@@ -346,13 +363,15 @@ public class PassCodeActivity extends AppCompatActivity {
 
         boolean result = true;
         for (int i = 0; i < mPassCodeDigits.length && result; i++) {
-            result = result && (mPassCodeDigits[i] != null) && mPassCodeDigits[i].equals(savedPassCodeDigits[i]);
+            result = result && (mPassCodeDigits[i] != null) &&
+                    mPassCodeDigits[i].equals(savedPassCodeDigits[i]);
         }
         return result;
     }
 
     /**
-     * Compares pass code retyped by the user in the input fields with the value entered just before.
+     * Compares pass code retyped by the user in the input fields with the value entered just
+     * before.
      *
      * @return     'True' if retyped pass code equals to the entered before.
      */
@@ -361,7 +380,8 @@ public class PassCodeActivity extends AppCompatActivity {
 
         boolean result = true;
         for (int i = 0; i < mPassCodeEditTexts.length && result; i++) {
-            result = result && ((mPassCodeEditTexts[i].getText().toString()).equals(mPassCodeDigits[i]));
+            result = result &&
+                    ((mPassCodeEditTexts[i].getText().toString()).equals(mPassCodeDigits[i]));
         }
         return result;
     }
@@ -377,8 +397,8 @@ public class PassCodeActivity extends AppCompatActivity {
     }
 
     /**
-     * Overrides click on the BACK arrow to correctly cancel ACTION_ENABLE or ACTION_DISABLE, while preventing
-     * than ACTION_REQUEST may be worked around.
+     * Overrides click on the BACK arrow to correctly cancel ACTION_ENABLE or ACTION_DISABLE, while
+     * preventing than ACTION_REQUEST may be worked around.
      *
      * @param keyCode       Key code of the key that triggered the down event.
      * @param event         Event triggered.
@@ -387,7 +407,8 @@ public class PassCodeActivity extends AppCompatActivity {
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event){
         if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount()== 0){
-            if (ACTION_ENABLE.equals(getIntent().getAction()) || ACTION_DISABLE.equals(getIntent().getAction())) {
+            if (ACTION_ENABLE.equals(getIntent().getAction()) ||
+                    ACTION_DISABLE.equals(getIntent().getAction())) {
                 revertActionAndExit();
             }
             return true;
@@ -406,7 +427,8 @@ public class PassCodeActivity extends AppCompatActivity {
         appPrefs.putString("PrefPinCode2", mPassCodeDigits[1]);
         appPrefs.putString("PrefPinCode3", mPassCodeDigits[2]);
         appPrefs.putString("PrefPinCode4", mPassCodeDigits[3]);
-        appPrefs.putBoolean("set_pincode", true);    /// TODO remove; unnecessary, Preferences did it before entering here
+        appPrefs.putBoolean("set_pincode", true);    /// TODO remove; unnecessary,
+                                                     // Preferences did it before entering here
         appPrefs.commit();
 
         Toast.makeText(this, R.string.pass_code_stored, Toast.LENGTH_LONG).show();
@@ -426,7 +448,8 @@ public class PassCodeActivity extends AppCompatActivity {
 
         boolean state = appPrefs.getBoolean("set_pincode", false);
         appPrefsE.putBoolean("set_pincode", !state);
-        // TODO WIP: this is reverting the value of the preference because it was changed BEFORE entering
+        // TODO WIP: this is reverting the value of the preference because it was changed BEFORE
+        // entering
         // TODO         in this activity; was the PreferenceCheckBox in the caller who did it
         appPrefsE.commit();
         finish();
@@ -441,15 +464,18 @@ public class PassCodeActivity extends AppCompatActivity {
         /**
          * Constructor
          *
-         * @param index         Position in the pass code of the input field that will be bound to this watcher.
-         * @param lastOne       'True' means that watcher corresponds to the last position of the pass code.
+         * @param index         Position in the pass code of the input field that will be bound to
+         *                      this watcher.
+         * @param lastOne       'True' means that watcher corresponds to the last position of the
+         *                      pass code.
          */
         public PassCodeDigitTextWatcher(int index, boolean lastOne) {
             mIndex = index;
             mLastOne  = lastOne;
             if (mIndex < 0) {
                 throw new IllegalArgumentException(
-                        "Invalid index in " + PassCodeDigitTextWatcher.class.getSimpleName() + " constructor"
+                        "Invalid index in " + PassCodeDigitTextWatcher.class.getSimpleName() +
+                                " constructor"
                 );
             }
         }
@@ -460,7 +486,8 @@ public class PassCodeActivity extends AppCompatActivity {
 
         /**
          * Performs several actions when the user types a digit in an input field:
-         *  - saves the input digit to the state of the activity; this will allow retyping the pass code to confirm it.
+         *  - saves the input digit to the state of the activity; this will allow retyping the
+         *    pass code to confirm it.
          *  - moves the focus automatically to the next field
          *  - for the last field, triggers the processing of the full pass code
          *

+ 3 - 3
src/com/owncloud/android/ui/dialog/ConflictsResolveDialog.java

@@ -28,7 +28,7 @@ import android.os.Bundle;
 import android.support.v4.app.DialogFragment;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.FragmentTransaction;
-import android.support.v7.app.AppCompatActivity;
+import android.support.v7.app.ActionBarActivity;
 
 import com.owncloud.android.R;
 import com.owncloud.android.utils.DisplayUtils;
@@ -91,7 +91,7 @@ public class ConflictsResolveDialog extends DialogFragment {
                    .create();
     }
     
-    public void showDialog(AppCompatActivity activity) {
+    public void showDialog(ActionBarActivity activity) {
         Fragment prev = activity.getSupportFragmentManager().findFragmentByTag("dialog");
         FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();
         if (prev != null) {
@@ -102,7 +102,7 @@ public class ConflictsResolveDialog extends DialogFragment {
         this.show(ft, "dialog");
     }
 
-    public void dismissDialog(AppCompatActivity activity) {
+    public void dismissDialog(ActionBarActivity activity) {
         Fragment prev = activity.getSupportFragmentManager().findFragmentByTag(getTag());
         if (prev != null) {
             FragmentTransaction ft = activity.getSupportFragmentManager().beginTransaction();