Merge "Use GLIF theme for Settings > Security > Screen lock" into nyc-mr1-dev
This commit is contained in:
@@ -32,7 +32,6 @@ import android.hardware.fingerprint.Fingerprint;
|
||||
import android.hardware.fingerprint.FingerprintManager;
|
||||
import android.hardware.fingerprint.FingerprintManager.RemovalCallback;
|
||||
import android.os.Bundle;
|
||||
import android.os.Process;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
import android.os.storage.StorageManager;
|
||||
@@ -42,9 +41,7 @@ import android.support.v7.preference.PreferenceScreen;
|
||||
import android.text.TextUtils;
|
||||
import android.util.EventLog;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.internal.widget.LockPatternUtils;
|
||||
|
@@ -25,7 +25,6 @@ import android.inputmethodservice.KeyboardView;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.os.UserHandle;
|
||||
import android.text.Editable;
|
||||
import android.text.InputType;
|
||||
import android.text.Selection;
|
||||
@@ -40,6 +39,7 @@ import android.view.View.OnClickListener;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TextView.OnEditorActionListener;
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.android.internal.widget.PasswordEntryKeyboardHelper;
|
||||
import com.android.internal.widget.PasswordEntryKeyboardView;
|
||||
import com.android.internal.widget.TextViewInputDisabler;
|
||||
import com.android.settings.notification.RedactionInterstitial;
|
||||
import com.android.setupwizardlib.GlifLayout;
|
||||
|
||||
public class ChooseLockPassword extends SettingsActivity {
|
||||
public static final String PASSWORD_MIN_KEY = "lockscreen.password_min";
|
||||
@@ -143,6 +144,8 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
CharSequence msg = getText(R.string.lockpassword_choose_your_password_header);
|
||||
setTitle(msg);
|
||||
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
|
||||
layout.setFitsSystemWindows(false);
|
||||
}
|
||||
|
||||
public static class ChooseLockPasswordFragment extends InstrumentedFragment
|
||||
@@ -287,7 +290,10 @@ public class ChooseLockPassword extends SettingsActivity {
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.choose_lock_password, container, false);
|
||||
GlifLayout layout = (GlifLayout) inflater.inflate(
|
||||
R.layout.choose_lock_password, container, false);
|
||||
layout.setHeaderText(getActivity().getTitle());
|
||||
return layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -21,12 +21,12 @@ import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
@@ -37,6 +37,7 @@ import com.android.internal.widget.LockPatternView;
|
||||
import com.android.internal.widget.LockPatternView.Cell;
|
||||
import com.android.internal.widget.LockPatternView.DisplayMode;
|
||||
import com.android.settings.notification.RedactionInterstitial;
|
||||
import com.android.setupwizardlib.GlifLayout;
|
||||
import com.google.android.collect.Lists;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -113,6 +114,8 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
CharSequence msg = getText(R.string.lockpassword_choose_your_pattern_header);
|
||||
setTitle(msg);
|
||||
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
|
||||
layout.setFitsSystemWindows(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -391,7 +394,10 @@ public class ChooseLockPattern extends SettingsActivity {
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.choose_lock_pattern, container, false);
|
||||
final GlifLayout layout = (GlifLayout) inflater.inflate(
|
||||
R.layout.choose_lock_pattern, container, false);
|
||||
layout.setHeaderText(getActivity().getTitle());
|
||||
return layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -23,19 +23,26 @@ import android.app.admin.DevicePolicyManager;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.accessibility.AccessibilityManager;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.internal.logging.MetricsProto.MetricsEvent;
|
||||
import com.android.settings.utils.SettingsDividerItemDecoration;
|
||||
import com.android.setupwizardlib.GlifPreferenceLayout;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EncryptionInterstitial extends SettingsActivity {
|
||||
private final static String TAG = EncryptionInterstitial.class.getSimpleName();
|
||||
private static final String TAG = EncryptionInterstitial.class.getSimpleName();
|
||||
|
||||
protected static final String EXTRA_PASSWORD_QUALITY = "extra_password_quality";
|
||||
protected static final String EXTRA_UNLOCK_METHOD_INTENT = "extra_unlock_method_intent";
|
||||
@@ -63,6 +70,13 @@ public class EncryptionInterstitial extends SettingsActivity {
|
||||
.putExtra(EXTRA_UNLOCK_METHOD_INTENT, unlockMethodIntent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstance) {
|
||||
super.onCreate(savedInstance);
|
||||
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
|
||||
layout.setFitsSystemWindows(false);
|
||||
}
|
||||
|
||||
public static class EncryptionInterstitialFragment extends SettingsPreferenceFragment
|
||||
implements DialogInterface.OnClickListener {
|
||||
|
||||
@@ -126,7 +140,8 @@ public class EncryptionInterstitial extends SettingsActivity {
|
||||
disableId = R.string.encrypt_dont_require_password;
|
||||
break;
|
||||
}
|
||||
TextView message = createHeaderView();
|
||||
TextView message = (TextView) LayoutInflater.from(getActivity()).inflate(
|
||||
R.layout.encryption_interstitial_header, null, false);
|
||||
message.setText(msgId);
|
||||
setHeaderView(message);
|
||||
|
||||
@@ -138,10 +153,25 @@ public class EncryptionInterstitial extends SettingsActivity {
|
||||
EXTRA_REQUIRE_PASSWORD, true));
|
||||
}
|
||||
|
||||
protected TextView createHeaderView() {
|
||||
TextView message = (TextView) LayoutInflater.from(getActivity()).inflate(
|
||||
R.layout.encryption_interstitial_header, null, false);
|
||||
return message;
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
GlifPreferenceLayout layout = (GlifPreferenceLayout) view;
|
||||
layout.setDividerItemDecoration(new SettingsDividerItemDecoration(getContext()));
|
||||
|
||||
layout.setIcon(getContext().getDrawable(R.drawable.ic_lock));
|
||||
layout.setHeaderText(getActivity().getTitle());
|
||||
|
||||
// Use the dividers in SetupWizardRecyclerLayout. Suppress the dividers in
|
||||
// PreferenceFragment.
|
||||
setDivider(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecyclerView onCreateRecyclerView(LayoutInflater inflater, ViewGroup parent,
|
||||
Bundle savedInstanceState) {
|
||||
GlifPreferenceLayout layout = (GlifPreferenceLayout) parent;
|
||||
return layout.onCreateRecyclerView(inflater, parent, savedInstanceState);
|
||||
}
|
||||
|
||||
protected void startLockIntent() {
|
||||
|
@@ -21,13 +21,8 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.setupwizardlib.GlifLayout;
|
||||
|
||||
/**
|
||||
* Setup Wizard's version of ChooseLockPassword screen. It inherits the logic and basic structure
|
||||
* from ChooseLockPassword class, and should remain similar to that behaviorally. This class should
|
||||
@@ -90,22 +85,6 @@ public class SetupChooseLockPassword extends ChooseLockPassword {
|
||||
|
||||
public static class SetupChooseLockPasswordFragment extends ChooseLockPasswordFragment {
|
||||
|
||||
private GlifLayout mLayout;
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
mLayout = (GlifLayout) inflater.inflate(
|
||||
R.layout.setup_choose_lock_password, container, false);
|
||||
return mLayout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
mLayout.setHeaderText(getActivity().getTitle());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Intent getRedactionInterstitialIntent(Context context) {
|
||||
return null;
|
||||
|
@@ -20,14 +20,7 @@ import android.app.Fragment;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.os.UserHandle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.setupwizardlib.GlifLayout;
|
||||
|
||||
/**
|
||||
* Setup Wizard's version of ChooseLockPattern screen. It inherits the logic and basic structure
|
||||
@@ -70,13 +63,6 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
|
||||
return SetupChooseLockPatternFragment.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstance) {
|
||||
super.onCreate(savedInstance);
|
||||
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
|
||||
layout.setFitsSystemWindows(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onApplyThemeResource(Resources.Theme theme, int resid, boolean first) {
|
||||
resid = SetupWizardUtils.getTheme(getIntent());
|
||||
@@ -85,15 +71,6 @@ public class SetupChooseLockPattern extends ChooseLockPattern {
|
||||
|
||||
public static class SetupChooseLockPatternFragment extends ChooseLockPatternFragment {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
final GlifLayout layout = (GlifLayout) inflater.inflate(
|
||||
R.layout.setup_choose_lock_pattern, container, false);
|
||||
layout.setHeaderText(getActivity().getTitle());
|
||||
return layout;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Intent getRedactionInterstitialIntent(Context context) {
|
||||
return null;
|
||||
|
@@ -25,7 +25,6 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.android.settings.utils.SettingsDividerItemDecoration;
|
||||
import com.android.setupwizardlib.GlifPreferenceLayout;
|
||||
@@ -94,13 +93,6 @@ public class SetupEncryptionInterstitial extends EncryptionInterstitial {
|
||||
setDivider(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TextView createHeaderView() {
|
||||
TextView message = (TextView) LayoutInflater.from(getActivity()).inflate(
|
||||
R.layout.setup_encryption_interstitial_header, null, false);
|
||||
return message;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RecyclerView onCreateRecyclerView(LayoutInflater inflater, ViewGroup parent,
|
||||
Bundle savedInstanceState) {
|
||||
|
@@ -19,11 +19,8 @@ package com.android.settings;
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.android.settings.notification.RedactionInterstitial;
|
||||
|
||||
@@ -55,39 +52,8 @@ public class SetupRedactionInterstitial extends RedactionInterstitial {
|
||||
super.onApplyThemeResource(theme, resid, first);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstance) {
|
||||
super.onCreate(savedInstance);
|
||||
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
|
||||
layout.setFitsSystemWindows(false);
|
||||
}
|
||||
public static class SetupRedactionInterstitialFragment extends RedactionInterstitialFragment {
|
||||
|
||||
public static class SetupRedactionInterstitialFragment extends RedactionInterstitialFragment
|
||||
implements View.OnClickListener {
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.setup_redaction_interstitial, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(View view, Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
final Button button = (Button) view.findViewById(R.id.redaction_next_button);
|
||||
button.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.redaction_next_button) {
|
||||
final SetupRedactionInterstitial activity =
|
||||
(SetupRedactionInterstitial) getActivity();
|
||||
if (activity != null) {
|
||||
activity.setResult(RESULT_OK, activity.getResultIntentData());
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
// Setup wizard specific UI customizations can be done here
|
||||
}
|
||||
}
|
||||
|
@@ -25,8 +25,9 @@ import android.provider.Settings;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.Button;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.TextView;
|
||||
@@ -59,6 +60,13 @@ public class RedactionInterstitial extends SettingsActivity {
|
||||
return RedactionInterstitialFragment.class.getName().equals(fragmentName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstance) {
|
||||
super.onCreate(savedInstance);
|
||||
LinearLayout layout = (LinearLayout) findViewById(R.id.content_parent);
|
||||
layout.setFitsSystemWindows(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an intent for launching RedactionInterstitial.
|
||||
* @return An intent to launch the activity is if is available, @null if the activity is not
|
||||
@@ -66,10 +74,6 @@ public class RedactionInterstitial extends SettingsActivity {
|
||||
*/
|
||||
public static Intent createStartIntent(Context ctx, int userId) {
|
||||
return new Intent(ctx, RedactionInterstitial.class)
|
||||
.putExtra(EXTRA_PREFS_SHOW_BUTTON_BAR, true)
|
||||
.putExtra(EXTRA_PREFS_SET_BACK_TEXT, (String) null)
|
||||
.putExtra(EXTRA_PREFS_SET_NEXT_TEXT, ctx.getString(
|
||||
R.string.app_notifications_dialog_done))
|
||||
.putExtra(EXTRA_SHOW_FRAGMENT_TITLE_RESID,
|
||||
Utils.isManagedProfile(UserManager.get(ctx), userId)
|
||||
? R.string.lock_screen_notifications_interstitial_title_profile
|
||||
@@ -78,7 +82,8 @@ public class RedactionInterstitial extends SettingsActivity {
|
||||
}
|
||||
|
||||
public static class RedactionInterstitialFragment extends SettingsPreferenceFragment
|
||||
implements RadioGroup.OnCheckedChangeListener, CompoundButton.OnCheckedChangeListener {
|
||||
implements RadioGroup.OnCheckedChangeListener, CompoundButton.OnCheckedChangeListener,
|
||||
View.OnClickListener {
|
||||
|
||||
private RadioGroup mRadioGroup;
|
||||
private RestrictedRadioButton mShowAllButton;
|
||||
@@ -120,6 +125,20 @@ public class RedactionInterstitial extends SettingsActivity {
|
||||
((RadioButton) view.findViewById(R.id.hide_all))
|
||||
.setText(R.string.lock_screen_notifications_summary_disable_profile);
|
||||
}
|
||||
|
||||
final Button button = (Button) view.findViewById(R.id.redaction_done_button);
|
||||
button.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (v.getId() == R.id.redaction_done_button) {
|
||||
final RedactionInterstitial activity = (RedactionInterstitial) getActivity();
|
||||
if (activity != null) {
|
||||
activity.setResult(RESULT_OK, activity.getResultIntentData());
|
||||
finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user