Redo the empty states in print settings

In the end the UI does not change but the new states:

- Are similar to the "empty" states we use in the print spooler
- Use the system print icon
- Use a translucent background icon which works correctly with dark mode

Test: Looked at all changed Settings pages
Fixes: 115830412
Change-Id: I1f5b005674e7072e989355f01ebd3fdaf56c9355
This commit is contained in:
Philip P. Moltmann
2018-09-20 17:03:23 -07:00
parent 68956715d4
commit 2f4f269264
6 changed files with 60 additions and 79 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

@@ -14,48 +14,40 @@
limitations under the License. limitations under the License.
--> -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/empty_print_state" android:layout_width="match_parent"
android:layout_width="fill_parent" android:layout_height="match_parent"
android:layout_height="fill_parent" android:layout_marginStart="16dp"
android:visibility="gone"> android:layout_marginEnd="16dp"
android:gravity="center"
android:orientation="vertical">
<LinearLayout <ImageView
android:layout_width="120dp"
android:layout_height="110dp"
android:layout_marginBottom="12dp"
android:src="@*android:drawable/ic_print"
android:scaleType="fitEnd"
android:alpha="0.1"
android:tint="?android:colorForeground"
android:importantForAccessibility="no" />
<TextView
android:id="@+id/message"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_marginBottom="16dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary" />
<ImageView <Button
android:id="@+id/icon" android:id="@+id/add_new_service"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="12dip" style="?android:attr/borderlessButtonStyle"
android:src="@drawable/ic_grayedout_printer" android:textColor="?android:attr/textColorSecondary"
android:contentDescription="@null"> android:text="@string/print_menu_item_add_service"
</ImageView> android:visibility="gone" />
<TextView </LinearLayout>
android:id="@+id/message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary">
</TextView>
<Button android:id="@+id/add_new_service"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center"
android:visibility="gone"
style="?android:attr/buttonBarButtonStyle"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/print_menu_item_add_service"
android:textAllCaps="true"
/>
</LinearLayout>
</FrameLayout>

View File

@@ -14,45 +14,38 @@
limitations under the License. limitations under the License.
--> -->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/empty_printers_list_service_enabled" android:layout_width="match_parent"
android:layout_width="fill_parent" android:layout_height="match_parent"
android:layout_height="fill_parent" android:layout_marginStart="16dp"
android:visibility="gone"> android:layout_marginEnd="16dp"
android:gravity="center"
android:orientation="vertical">
<LinearLayout <ImageView
android:layout_width="120dp"
android:layout_height="110dp"
android:layout_marginBottom="12dp"
android:src="@*android:drawable/ic_print"
android:scaleType="fitEnd"
android:alpha="0.1"
android:tint="?android:colorForeground"
android:importantForAccessibility="no"/>
<TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_marginBottom="16dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/print_searching_for_printers"/>
<ImageView <ProgressBar
android:layout_width="wrap_content" android:layout_width="300dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="12dip" android:indeterminate="true"
android:src="@drawable/ic_grayedout_printer" android:importantForAccessibility="no"
android:importantForAccessibility="no"> style="?android:attr/progressBarStyleHorizontal"/>
</ImageView>
<TextView </LinearLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="32dip"
android:layout_marginRight="32dip"
android:gravity="center"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/print_searching_for_printers">
</TextView>
<ProgressBar
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:indeterminate="true"
style="?android:attr/progressBarStyleHorizontal">
</ProgressBar>
</LinearLayout>
</FrameLayout>

View File

@@ -190,8 +190,6 @@ public class PrintServiceSettingsFragment extends SettingsPreferenceFragment
if (emptyView == null) { if (emptyView == null) {
emptyView = getActivity().getLayoutInflater().inflate( emptyView = getActivity().getLayoutInflater().inflate(
R.layout.empty_print_state, contentRoot, false); R.layout.empty_print_state, contentRoot, false);
ImageView iconView = (ImageView) emptyView.findViewById(R.id.icon);
iconView.setContentDescription(getString(R.string.print_service_disabled));
TextView textView = (TextView) emptyView.findViewById(R.id.message); TextView textView = (TextView) emptyView.findViewById(R.id.message);
textView.setText(R.string.print_service_disabled); textView.setText(R.string.print_service_disabled);
contentRoot.addView(emptyView); contentRoot.addView(emptyView);
@@ -216,8 +214,6 @@ public class PrintServiceSettingsFragment extends SettingsPreferenceFragment
if (emptyView == null) { if (emptyView == null) {
emptyView = getActivity().getLayoutInflater().inflate( emptyView = getActivity().getLayoutInflater().inflate(
R.layout.empty_print_state, contentRoot, false); R.layout.empty_print_state, contentRoot, false);
ImageView iconView = (ImageView) emptyView.findViewById(R.id.icon);
iconView.setContentDescription(getString(R.string.print_no_printers_found));
TextView textView = (TextView) emptyView.findViewById(R.id.message); TextView textView = (TextView) emptyView.findViewById(R.id.message);
textView.setText(R.string.print_no_printers_found); textView.setText(R.string.print_no_printers_found);
contentRoot.addView(emptyView); contentRoot.addView(emptyView);