Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c5fb839d authored by arangelov's avatar arangelov
Browse files

Hide empty state icon and button in landscape mode.

This is to accommodate for the case when the user
has max font size and max display size. The rest of
the empty state screen won't fit unless we hide the
icon and "Turn on work" button.

Test: manual
Fixes: 149817494
Fixes: 152274446
Change-Id: I95b90461ac36b4bbf6b0e4c4dd223e941d8c75cb
parent 1f9fef65
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -374,9 +374,6 @@ public abstract class AbstractMultiProfilePagerAdapter extends PagerAdapter {
        resetViewVisibilities(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);

@@ -388,9 +385,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);
        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();
    }
+1 −1
Original line number Diff line number Diff line
@@ -2667,7 +2667,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() {
+1 −1
Original line number Diff line number Diff line
@@ -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" />
+1 −1
Original line number Diff line number Diff line
@@ -16,5 +16,5 @@
  -->

<resources>
    <bool name="sharesheet_show_content_preview">true</bool>
    <bool name="resolver_landscape_phone">false</bool>
</resources>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -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>
Loading