Materialize the button bar in the Deletion Helper.

Older Android style buttons were used for the bottom button bar.
By changing them to use the buttonBarBottomStyle, they are updated
to flat buttons. The bottom button bar for settings preference
fragments now more closely tracks the Material Design spec as seen
here in [0].

The other Settings views which use the button bar buttons are the
Redaction settings and WiFi network picker in some contexts. These
should be unaffected as they are based on the SettingsActivity,
rather than the SettingsFragment, and inflate a different view.

[0] https://material-design.storage.googleapis.com/publish/material_v_8/material_ext_publish/0B7WCemMG6e0VaDdZWXpLXzNicjg/components_buttons_usage6.png

Bug: 28845586
Change-Id: I9ea55aa2fe1e76f8f952880675501cbb0f76719d
This commit is contained in:
Daniel Nishi
2016-05-18 15:38:35 -07:00
parent ab5a648ddb
commit 5af567eca7
2 changed files with 12 additions and 3 deletions

View File

@@ -83,6 +83,7 @@
android:visibility="gone">
<Button android:id="@+id/back_button"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:layout_margin="5dip"
@@ -97,7 +98,8 @@
android:layout_alignParentEnd="true">
<Button android:id="@+id/skip_button"
android:layout_width="150dip"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:text="@*android:string/skip_button_label"
@@ -105,7 +107,8 @@
/>
<Button android:id="@+id/next_button"
android:layout_width="150dip"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dip"
android:text="@*android:string/next_button_label"

View File

@@ -25,7 +25,9 @@ import android.text.format.Formatter;
import android.util.ArraySet;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.LinearLayout;
import com.android.settings.deletionhelper.DownloadsDeletionPreference;
import com.android.settings.CollapsibleCheckboxPreferenceGroup;
import com.android.settings.PhotosDeletionPreference;
@@ -113,13 +115,17 @@ public class DeletionHelperFragment extends SettingsPreferenceFragment implement
}
private void initializeButtons(View v) {
mCancel = (Button) v.findViewById(R.id.back_button);
mCancel = (Button) v.findViewById(R.id.skip_button);
mCancel.setText(R.string.cancel);
mCancel.setOnClickListener(this);
mCancel.setVisibility(View.VISIBLE);
mFree = (Button) v.findViewById(R.id.next_button);
mFree.setText(R.string.storage_menu_free);
mFree.setOnClickListener(this);
Button back = (Button) v.findViewById(R.id.back_button);
back.setVisibility(View.GONE);
}
private void initializeDeletionPreferences() {