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

Commit b8090a0c authored by Matt Casey's avatar Matt Casey
Browse files

Layout and style updates for LongScreenshotActivity

- Give save button accent color.
- Remove cancel button (may come back in another form later)
- Share button becomes and icon on the right.
- Edit button moves to the bottom, gets icon + text

Bug: 180967468
Test: Visual eval with light and dark themes
Change-Id: I19ccea06e7dbec47b26ffd0684ebb7e31bdfe8b4
parent 177d8e36
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -336,7 +336,7 @@
        </receiver>
        </receiver>


        <activity android:name=".screenshot.LongScreenshotActivity"
        <activity android:name=".screenshot.LongScreenshotActivity"
                  android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
                  android:theme="@style/LongScreenshotActivity"
                  android:process=":screenshot"
                  android:process=":screenshot"
                  android:exported="false"
                  android:exported="false"
                  android:finishOnTaskLaunch="true" />
                  android:finishOnTaskLaunch="true" />
+34 −39
Original line number Original line Diff line number Diff line
@@ -24,51 +24,27 @@


    <Button
    <Button
        android:id="@+id/save"
        android:id="@+id/save"
        style="@android:style/Widget.DeviceDefault.Button.Colored"
        android:layout_width="wrap_content"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/save"
        android:text="@string/save"
        app:layout_constraintEnd_toStartOf="@id/cancel"
        android:layout_marginLeft="8dp"
        app:layout_constraintHorizontal_chainStyle="packed"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/guideline" />
        app:layout_constraintBottom_toTopOf="@id/preview" />


    <Button
    <ImageButton
        android:id="@+id/cancel"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/cancel"
        app:layout_constraintEnd_toStartOf="@id/edit"
        app:layout_constraintStart_toEndOf="@id/save"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/guideline" />

    <Button
        android:id="@+id/edit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/screenshot_edit_label"
        app:layout_constraintEnd_toStartOf="@id/share"
        app:layout_constraintStart_toEndOf="@id/cancel"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/guideline" />

    <Button
        android:id="@+id/share"
        android:id="@+id/share"
        android:layout_width="wrap_content"
        style="@android:style/Widget.Material.Button.Borderless"
        android:layout_height="wrap_content"
        android:tint="?android:textColorPrimary"
        android:text="@*android:string/share"
        android:layout_width="48dp"
        android:layout_height="48dp"
        android:padding="6dp"
        android:src="@drawable/ic_screenshot_share"
        android:layout_marginRight="8dp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toEndOf="@+id/edit"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintBottom_toTopOf="@id/guideline" />
        app:layout_constraintBottom_toTopOf="@id/preview" />

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/guideline"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintGuide_percent="0.1" />


    <ImageView
    <ImageView
        android:id="@+id/preview"
        android:id="@+id/preview"
@@ -78,7 +54,7 @@
        android:layout_marginHorizontal="48dp"
        android:layout_marginHorizontal="48dp"
        app:layout_constrainedHeight="true"
        app:layout_constrainedHeight="true"
        app:layout_constrainedWidth="true"
        app:layout_constrainedWidth="true"
        app:layout_constraintTop_toBottomOf="@id/guideline"
        app:layout_constraintTop_toBottomOf="@id/save"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
@@ -93,7 +69,7 @@
        android:layout_marginBottom="42dp"
        android:layout_marginBottom="42dp"
        app:layout_constrainedHeight="true"
        app:layout_constrainedHeight="true"
        app:layout_constrainedWidth="true"
        app:layout_constrainedWidth="true"
        app:layout_constraintTop_toBottomOf="@id/guideline"
        app:layout_constraintTop_toTopOf="@id/preview"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintBottom_toBottomOf="parent"
@@ -110,7 +86,7 @@
        android:layout_width="200dp"
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:layout_height="200dp"
        android:elevation="2dp"
        android:elevation="2dp"
        app:layout_constraintTop_toBottomOf="@id/guideline"
        app:layout_constraintTop_toTopOf="@id/preview"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:handleThickness="@dimen/screenshot_crop_handle_thickness"
        app:handleThickness="@dimen/screenshot_crop_handle_thickness"
        app:handleColor="@*android:color/accent_device_default"
        app:handleColor="@*android:color/accent_device_default"
@@ -119,5 +95,24 @@
        app:borderColor="#fff"
        app:borderColor="#fff"
        />
        />


    <Button
        android:id="@+id/edit"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        style="@android:style/Widget.DeviceDefault.Button.Colored"
        android:backgroundTint="?android:colorBackground"
        android:drawableStart="@drawable/ic_screenshot_edit"
        android:drawableTint="?android:textColorPrimary"
        android:paddingStart="16dp"
        android:paddingEnd="8dp"
        android:paddingVertical="8dp"
        android:textColor="?android:textColorPrimary"
        android:text="@string/screenshot_edit_label"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
    />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
+5 −0
Original line number Original line Diff line number Diff line
@@ -610,6 +610,11 @@
        <item name="android:windowCloseOnTouchOutside">true</item>
        <item name="android:windowCloseOnTouchOutside">true</item>
    </style>
    </style>


    <!-- Screenshots -->
    <style name="LongScreenshotActivity" parent="@android:style/Theme.DeviceDefault.DayNight">
        <item name="android:windowNoTitle">true</item>
    </style>

    <!-- Privacy dialog -->
    <!-- Privacy dialog -->
    <style name="PrivacyDialog" parent="ScreenRecord">
    <style name="PrivacyDialog" parent="ScreenRecord">
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
        <item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
+0 −6
Original line number Original line Diff line number Diff line
@@ -76,7 +76,6 @@ public class LongScreenshotActivity extends Activity {


    private ImageView mPreview;
    private ImageView mPreview;
    private View mSave;
    private View mSave;
    private View mCancel;
    private View mEdit;
    private View mEdit;
    private View mShare;
    private View mShare;
    private CropView mCropView;
    private CropView mCropView;
@@ -117,7 +116,6 @@ public class LongScreenshotActivity extends Activity {


        mPreview = requireViewById(R.id.preview);
        mPreview = requireViewById(R.id.preview);
        mSave = requireViewById(R.id.save);
        mSave = requireViewById(R.id.save);
        mCancel = requireViewById(R.id.cancel);
        mEdit = requireViewById(R.id.edit);
        mEdit = requireViewById(R.id.edit);
        mShare = requireViewById(R.id.share);
        mShare = requireViewById(R.id.share);
        mCropView = requireViewById(R.id.crop_view);
        mCropView = requireViewById(R.id.crop_view);
@@ -125,7 +123,6 @@ public class LongScreenshotActivity extends Activity {
        mCropView.setCropInteractionListener(mMagnifierView);
        mCropView.setCropInteractionListener(mMagnifierView);


        mSave.setOnClickListener(this::onClicked);
        mSave.setOnClickListener(this::onClicked);
        mCancel.setOnClickListener(this::onClicked);
        mEdit.setOnClickListener(this::onClicked);
        mEdit.setOnClickListener(this::onClicked);
        mShare.setOnClickListener(this::onClicked);
        mShare.setOnClickListener(this::onClicked);


@@ -313,7 +310,6 @@ public class LongScreenshotActivity extends Activity {


    private void setButtonsEnabled(boolean enabled) {
    private void setButtonsEnabled(boolean enabled) {
        mSave.setEnabled(enabled);
        mSave.setEnabled(enabled);
        mCancel.setEnabled(enabled);
        mEdit.setEnabled(enabled);
        mEdit.setEnabled(enabled);
        mShare.setEnabled(enabled);
        mShare.setEnabled(enabled);
    }
    }
@@ -350,8 +346,6 @@ public class LongScreenshotActivity extends Activity {
        setButtonsEnabled(false);
        setButtonsEnabled(false);
        if (id == R.id.save) {
        if (id == R.id.save) {
            startExport(PendingAction.SAVE);
            startExport(PendingAction.SAVE);
        } else if (id == R.id.cancel) {
            finishAndRemoveTask();
        } else if (id == R.id.edit) {
        } else if (id == R.id.edit) {
            mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_EDIT);
            mUiEventLogger.log(ScreenshotEvent.SCREENSHOT_LONG_SCREENSHOT_EDIT);
            startExport(PendingAction.EDIT);
            startExport(PendingAction.EDIT);