import com.actionbarsherlock.app.SherlockPreferenceActivity;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
+import com.owncloud.android.BuildConfig;
import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.authentication.AccountUtils;
import com.owncloud.android.ui.RadioButtonPreference;
import com.owncloud.android.utils.DisplayUtils;
-import java.io.File;
-
/**
* An Activity that allows the user to change the application's settings.
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.actionbar_settings);
+ // For adding content description tag to a title field in the action bar
+ int actionBarTitleId = getResources().getIdentifier("action_bar_title", "id", "android");
+ View actionBarTitleView = getWindow().getDecorView().findViewById(actionBarTitleId);
+ if (actionBarTitleView != null) { // it's null in Android 2.x
+ getWindow().getDecorView().findViewById(actionBarTitleId).
+ setContentDescription(getString(R.string.actionbar_settings));
+ }
+
// Load the accounts category for adding the list of accounts
mAccountsPrefCategory = (PreferenceCategory) findPreference("accounts_category");
pCode.setOnPreferenceChangeListener(new OnPreferenceChangeListener() {
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
- Intent i = new Intent(getApplicationContext(), PinCodeActivity.class);
- i.putExtra(PinCodeActivity.EXTRA_ACTIVITY, "preferences");
- i.putExtra(PinCodeActivity.EXTRA_NEW_STATE, newValue.toString());
+ Intent i = new Intent(getApplicationContext(), PassCodeActivity.class);
+ Boolean enable = (Boolean) newValue;
+ i.setAction(
+ enable.booleanValue() ? PassCodeActivity.ACTION_ENABLE : PassCodeActivity.ACTION_DISABLE
+ );
startActivity(i);
return true;
}
-
+ if (BuildConfig.DEBUG) {
+ Preference pLog = findPreference("log");
+ if (pLog != null ){
+ pLog.setOnPreferenceClickListener(new OnPreferenceClickListener() {
+ @Override
+ public boolean onPreferenceClick(Preference preference) {
+ Intent loggerIntent = new Intent(getApplicationContext(),LogHistoryActivity.class);
+ startActivity(loggerIntent);
+ return true;
+ }
+ });
+ }
+ }
+
boolean recommendEnabled = getResources().getBoolean(R.bool.recommend_enabled);
Preference pRecommend = findPreference("recommend");
if (pRecommend != null){
}
@Override
- protected void onPause() {
- super.onPause();
- }
-
- @Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
// Filter for only showing contextual menu when long press on the
FileDisplayActivity.class
);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
startActivity(i);
} else {
finish();