Merge "Hide empty state icon and button in landscape mode." into rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
5e8e9e5f1a
@@ -387,9 +387,6 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter {
|
||||
resetViewVisibilitiesForWorkProfileEmptyState(emptyStateView);
|
||||
emptyStateView.setVisibility(View.VISIBLE);
|
||||
|
||||
ImageView icon = emptyStateView.findViewById(R.id.resolver_empty_state_icon);
|
||||
icon.setImageResource(iconRes);
|
||||
|
||||
TextView title = emptyStateView.findViewById(R.id.resolver_empty_state_title);
|
||||
title.setText(titleRes);
|
||||
|
||||
@@ -401,9 +398,17 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter {
|
||||
subtitle.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
ImageView icon = emptyStateView.findViewById(R.id.resolver_empty_state_icon);
|
||||
Button button = emptyStateView.findViewById(R.id.resolver_empty_state_button);
|
||||
button.setVisibility(buttonOnClick != null ? View.VISIBLE : View.GONE);
|
||||
button.setOnClickListener(buttonOnClick);
|
||||
if (!getContext().getResources().getBoolean(R.bool.resolver_landscape_phone)) {
|
||||
icon.setVisibility(View.VISIBLE);
|
||||
icon.setImageResource(iconRes);
|
||||
button.setVisibility(buttonOnClick != null ? View.VISIBLE : View.GONE);
|
||||
button.setOnClickListener(buttonOnClick);
|
||||
} else {
|
||||
icon.setVisibility(View.GONE);
|
||||
button.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
activeListAdapter.markTabLoaded();
|
||||
}
|
||||
|
||||
@@ -2674,7 +2674,7 @@ public class ChooserActivity extends ResolverActivity implements
|
||||
*/
|
||||
private boolean shouldShowStickyContentPreview() {
|
||||
return shouldShowStickyContentPreviewNoOrientationCheck()
|
||||
&& getResources().getBoolean(R.bool.sharesheet_show_content_preview);
|
||||
&& !getResources().getBoolean(R.bool.resolver_landscape_phone);
|
||||
}
|
||||
|
||||
private boolean shouldShowStickyContentPreviewNoOrientationCheck() {
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
android:orientation="vertical"
|
||||
android:gravity="center_horizontal"
|
||||
android:visibility="gone"
|
||||
android:paddingTop="48dp"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp">
|
||||
<ImageView
|
||||
android:id="@+id/resolver_empty_state_icon"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_centerHorizontal="true" />
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
-->
|
||||
|
||||
<resources>
|
||||
<bool name="sharesheet_show_content_preview">true</bool>
|
||||
<bool name="resolver_landscape_phone">false</bool>
|
||||
</resources>
|
||||
@@ -29,5 +29,5 @@
|
||||
<p>The main purpose is for OEMs to customize the rendering of the
|
||||
lockscreen, setting this to true should come with customized drawables. -->
|
||||
<bool name="use_lock_pattern_drawable">false</bool>
|
||||
<bool name="sharesheet_show_content_preview">false</bool>
|
||||
<bool name="resolver_landscape_phone">true</bool>
|
||||
</resources>
|
||||
|
||||
@@ -3929,7 +3929,7 @@
|
||||
<java-symbol type="dimen" name="resolver_empty_state_height" />
|
||||
<java-symbol type="dimen" name="resolver_empty_state_height_with_tabs" />
|
||||
<java-symbol type="dimen" name="resolver_max_collapsed_height_with_tabs" />
|
||||
<java-symbol type="bool" name="sharesheet_show_content_preview" />
|
||||
<java-symbol type="bool" name="resolver_landscape_phone" />
|
||||
<java-symbol type="dimen" name="resolver_tab_text_size" />
|
||||
|
||||
<!-- Toast message for background started foreground service while-in-use permission restriction feature -->
|
||||
|
||||
Reference in New Issue
Block a user