Commit 6383dae8 authored by melandory's avatar melandory Committed by Commit Bot

Adjust view for the password exceptions in the new UI

BUG=619868

Review-Url: https://codereview.chromium.org/2966383004
Cr-Commit-Position: refs/heads/master@{#485289}
parent a4440342
......@@ -15,48 +15,7 @@
android:orientation="vertical"
android:title="@string/password_entry_editor_title">
<TextView
android:text="@string/password_entry_editor_site_title"
android:textColor="@color/google_blue_700"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginStart="15dp"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/password_entry_editor_url"
android:textColor="@color/default_text_color"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginStart="15dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageButton
android:id="@+id/password_entry_editor_copy_site"
android:background="@null"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
android:src="@drawable/ic_content_copy"
android:contentDescription="@string/password_entry_editor_copy_stored_site"
style="?android:attr/buttonStyleSmall" />
</LinearLayout>
<include layout="@layout/password_entry_editor_site_row"/>
<TextView
android:text="@string/password_entry_editor_username_title"
......
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:text="@string/password_entry_editor_site_title"
android:textColor="@color/google_blue_700"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginStart="15dp"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceMedium" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/password_entry_editor_url"
android:textColor="@color/default_text_color"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginStart="15dp"
android:textAppearance="?android:attr/textAppearanceMedium" />
<View
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1" />
<ImageButton
android:id="@+id/password_entry_editor_copy_site"
android:background="@null"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="end"
android:layout_marginTop="10dp"
android:layout_marginEnd="15dp"
android:src="@drawable/ic_content_copy"
android:contentDescription="@string/password_entry_editor_copy_stored_site"
style="?android:attr/buttonStyleSmall" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2016 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true" >
<LinearLayout
android:id="@+id/password_entry_exception"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:title="@string/password_entry_editor_title">
<include layout="@layout/password_entry_editor_site_row"/>
</LinearLayout>
</ScrollView>
......@@ -66,14 +66,6 @@ public class PasswordEntryEditor extends Fragment {
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (shouldDisplayInteractivePasswordEntryEditor()) {
mView = inflater.inflate(R.layout.password_entry_editor_interactive, container, false);
} else {
mView = inflater.inflate(R.layout.password_entry_editor, container, false);
}
getActivity().setTitle(R.string.password_entry_editor_title);
mClipboard = (ClipboardManager) getActivity().getApplicationContext().getSystemService(
Context.CLIPBOARD_SERVICE);
// Extras are set on this intent in class {@link SavePasswordsPreferences}.
mExtras = getArguments();
assert mExtras != null;
......@@ -81,12 +73,28 @@ public class PasswordEntryEditor extends Fragment {
final String name = mExtras.containsKey(SavePasswordsPreferences.PASSWORD_LIST_NAME)
? mExtras.getString(SavePasswordsPreferences.PASSWORD_LIST_NAME)
: null;
mException = (name == null);
if (shouldDisplayInteractivePasswordEntryEditor()) {
if (!mException) {
mView = inflater.inflate(
R.layout.password_entry_editor_interactive, container, false);
} else {
mView = inflater.inflate(R.layout.password_entry_exception, container, false);
}
} else {
mView = inflater.inflate(R.layout.password_entry_editor, container, false);
}
getActivity().setTitle(R.string.password_entry_editor_title);
mClipboard = (ClipboardManager) getActivity().getApplicationContext().getSystemService(
Context.CLIPBOARD_SERVICE);
TextView nameView = (TextView) mView.findViewById(R.id.password_entry_editor_name);
if (name != null) {
if (!mException) {
nameView.setText(name);
} else {
nameView.setText(R.string.section_saved_passwords_exceptions);
mException = true;
if (!shouldDisplayInteractivePasswordEntryEditor()) {
nameView.setText(R.string.section_saved_passwords_exceptions);
}
}
final String url = mExtras.getString(SavePasswordsPreferences.PASSWORD_LIST_URL);
TextView urlView = (TextView) mView.findViewById(R.id.password_entry_editor_url);
......@@ -95,9 +103,11 @@ public class PasswordEntryEditor extends Fragment {
mKeyguardManager =
(KeyguardManager) getActivity().getApplicationContext().getSystemService(
Context.KEYGUARD_SERVICE);
hidePassword();
hookupPasswordButtons();
hookupCopyUsernameButton();
if (!mException) {
hidePassword();
hookupPasswordButtons();
hookupCopyUsernameButton();
}
hookupCopySiteButton();
} else {
hookupCancelDeleteButtons();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment