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

Commit f8de84e2 authored by Kenneth Ford's avatar Kenneth Ford Committed by Android (Google) Code Review
Browse files

Merge "String update for rear display mode" into tm-qpr-dev

parents a882d8bf 56b1f401
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -41,9 +41,10 @@
    </androidx.cardview.widget.CardView>

    <TextView
        android:id="@+id/rear_display_title_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_fold_bottom_sheet_title"
        android:text="@string/rear_display_folded_bottom_sheet_title"
        android:textAppearance="@style/TextAppearance.Dialog.Title"
        android:lineSpacingExtra="2sp"
        android:paddingTop="@dimen/rear_display_title_top_padding"
@@ -54,7 +55,7 @@
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_bottom_sheet_description"
        android:text="@string/rear_display_folded_bottom_sheet_description"
        android:textAppearance="@style/TextAppearance.Dialog.Body"
        android:lineSpacingExtra="2sp"
        android:translationY="-1.24sp"
+3 −12
Original line number Diff line number Diff line
@@ -42,9 +42,10 @@
    </androidx.cardview.widget.CardView>

    <TextView
        android:id="@+id/rear_display_title_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_unfold_bottom_sheet_title"
        android:text="@string/rear_display_unfolded_bottom_sheet_title"
        android:textAppearance="@style/TextAppearance.Dialog.Title"
        android:lineSpacingExtra="2sp"
        android:paddingTop="@dimen/rear_display_title_top_padding"
@@ -55,21 +56,11 @@
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_bottom_sheet_description"
        android:text="@string/rear_display_unfolded_bottom_sheet_description"
        android:textAppearance="@style/TextAppearance.Dialog.Body"
        android:lineSpacingExtra="2sp"
        android:translationY="-1.24sp"
        android:gravity="center_horizontal|top"
    />

    <TextView
        android:id="@+id/rear_display_warning_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/rear_display_bottom_sheet_warning"
        android:textAppearance="@style/TextAppearance.Dialog.Body"
        android:lineSpacingExtra="2sp"
        android:gravity="center_horizontal|top"
    />

</LinearLayout>
+7 −7
Original line number Diff line number Diff line
@@ -2780,15 +2780,15 @@
    <!-- Text for education page of cancel button to hide the page. [CHAR_LIMIT=NONE] -->
    <string name="rear_display_bottom_sheet_cancel">Cancel</string>
    <!-- Text for the user to confirm they flipped the device around. [CHAR_LIMIT=NONE] -->
    <string name="rear_display_bottom_sheet_confirm">Flip now</string>
    <string name="rear_display_bottom_sheet_confirm">Switch screens now</string>
    <!-- Text for education page title to guide user to unfold phone. [CHAR_LIMIT=50] -->
    <string name="rear_display_fold_bottom_sheet_title">Unfold phone for a better selfie</string>
    <!-- Text for education page title to guide user to flip to the front display. [CHAR_LIMIT=50] -->
    <string name="rear_display_unfold_bottom_sheet_title">Flip to front display for a better selfie?</string>
    <string name="rear_display_folded_bottom_sheet_title">Unfold phone</string>
    <!-- Text for education page title to guide user to switch to the front display. [CHAR_LIMIT=50] -->
    <string name="rear_display_unfolded_bottom_sheet_title">Switch screens?</string>
    <!-- Text for education page description to suggest user to use rear selfie capture. [CHAR_LIMIT=NONE] -->
    <string name="rear_display_bottom_sheet_description">Use the rear-facing camera for a wider photo with higher resolution.</string>
    <!-- Text for education page description to warn user that the display will turn off if the button is clicked. [CHAR_LIMIT=NONE] -->
    <string name="rear_display_bottom_sheet_warning"><b>&#x2731; This screen will turn off</b></string>
    <string name="rear_display_folded_bottom_sheet_description">For higher resolution, use the rear camera</string>
    <!-- Text for unfolded education page description to suggest user to use rear selfie capture. [CHAR_LIMIT=NONE] -->
    <string name="rear_display_unfolded_bottom_sheet_description">For higher resolution, flip the phone</string>
    <!-- Text for education page content description for folded animation. [CHAR_LIMIT=NONE] -->
    <string name="rear_display_accessibility_folded_animation">Foldable device being unfolded</string>
    <!-- Text for education page content description for unfolded animation. [CHAR_LIMIT=NONE] -->
+0 −1
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import com.android.internal.annotations.VisibleForTesting;
import com.android.systemui.CoreStartable;
import com.android.systemui.R;
import com.android.systemui.dagger.SysUISingleton;
import com.android.systemui.dagger.qualifiers.Background;
import com.android.systemui.dagger.qualifiers.Main;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.phone.SystemUIDialog;
+12 −11
Original line number Diff line number Diff line
@@ -16,14 +16,13 @@

package com.android.systemui.reardisplay;

import static junit.framework.Assert.assertNotNull;
import static junit.framework.Assert.assertNull;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertTrue;

import android.hardware.devicestate.DeviceStateManager;
import android.testing.AndroidTestingRunner;
import android.testing.TestableLooper;
import android.view.View;
import android.widget.TextView;

import androidx.test.filters.SmallTest;

@@ -37,8 +36,6 @@ import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;

import java.util.concurrent.Executor;

@SmallTest
@RunWith(AndroidTestingRunner.class)
@TestableLooper.RunWithLooper(setAsMainLooper = true)
@@ -63,9 +60,11 @@ public class RearDisplayDialogControllerTest extends SysuiTestCase {

        controller.showRearDisplayDialog(CLOSED_BASE_STATE);
        assertTrue(controller.mRearDisplayEducationDialog.isShowing());
        View deviceOpenedWarningTextView = controller.mRearDisplayEducationDialog.findViewById(
                R.id.rear_display_warning_text_view);
        assertNull(deviceOpenedWarningTextView);
        TextView deviceClosedTitleTextView = controller.mRearDisplayEducationDialog.findViewById(
                R.id.rear_display_title_text_view);
        assertEquals(deviceClosedTitleTextView.getText().toString(),
                getContext().getResources().getString(
                        R.string.rear_display_folded_bottom_sheet_title));
    }

    @Test
@@ -79,9 +78,11 @@ public class RearDisplayDialogControllerTest extends SysuiTestCase {
        controller.showRearDisplayDialog(OPEN_BASE_STATE);

        assertTrue(controller.mRearDisplayEducationDialog.isShowing());
        View deviceOpenedWarningTextView = controller.mRearDisplayEducationDialog.findViewById(
                R.id.rear_display_warning_text_view);
        assertNotNull(deviceOpenedWarningTextView);
        TextView deviceClosedTitleTextView = controller.mRearDisplayEducationDialog.findViewById(
                R.id.rear_display_title_text_view);
        assertEquals(deviceClosedTitleTextView.getText().toString(),
                getContext().getResources().getString(
                        R.string.rear_display_unfolded_bottom_sheet_title));
    }

    /**