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

Unverified Commit b0731149 authored by ezio84's avatar ezio84 Committed by Michael Bestas
Browse files

Screenrecord: add blinking stop dot and low quality options

We could want to stop the recording without expanding the notification
panel and show sensitive info.
Long pressing on the red dot moves it to the opposite side,
in case the user wants not to cover specific elements on the screen.

Add also a low quality option that still gives a good recording
reducing a lot the final file size (useful when sharing the screenrecord
on data connections).

old commits ref:
https://github.com/ezio84/abc_frameworks_base/commit/6092d9ca8b0949d64c1b87d6cd53d66daf002e14
https://github.com/ezio84/abc_frameworks_base/commit/b50c7caf8b46c731093b11f5647028a23346f937
https://github.com/ezio84/abc_frameworks_base/commit/91c00e8fb70cb17b8658678bf476452f96cd44d1

Change-Id: If413241c3fa533650690cf3b7df5c05fb2f8c8ed
parent c594eccd
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2020 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="#FF000000"
        android:pathData="M7,15h3c0.55,0 1,-0.45 1,-1v-1.5c0,-0.55 -0.45,-1 -1,-1H7.5v-1h2V11H11v-1c0,-0.55 -0.45,-1 -1,-1H7c-0.55,0 -1,0.45 -1,1v1.5c0,0.55 0.45,1 1,1h2.5v1h-2V13H6v1C6,14.55 6.45,15 7,15z"/>
    <path
        android:fillColor="#FF000000"
        android:pathData="M18,14v-4c0,-0.55 -0.45,-1 -1,-1h-4v6h4C17.55,15 18,14.55 18,14zM16.5,13.5h-2v-3h2V13.5z"/>
    <path
        android:fillColor="#FF000000"
        android:pathData="M20,4H4C2.89,4 2,4.9 2,6v12c0,1.1 0.89,2 2,2h16c1.1,0 2,-0.9 2,-2V6C22,4.9 21.1,4 20,4zM20,18H4V6h16V18z"/>
</vector>
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2020 The Android Open Source Project

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24.0"
    android:viewportHeight="24.0">
    <path
        android:fillColor="#FF000000"
        android:pathData="m 8,16 h 8 V 8 H 8 Z M 12,2 C 6.48,2 2,6.48 2,12 2,17.52 6.48,22 12,22 17.52,22 22,17.52 22,12 22,6.48 17.52,2 12,2 Z"/>
</vector>
+25 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright (C) 2017 ABC rom

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

         http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="48dp"
    android:height="48dp"
    android:viewportWidth="48.0"
    android:viewportHeight="48.0">
    <path
        android:fillColor="#ffbf1818"
        android:pathData="M 24 4.3476562 A 19.652719 19.652719 0 0 0 4.3476562 24 A 19.652719 19.652719 0 0 0 24 43.652344 A 19.652719 19.652719 0 0 0 43.652344 24 A 19.652719 19.652719 0 0 0 24 4.3476562 z "/>
</vector>
+86 −0
Original line number Diff line number Diff line
@@ -129,6 +129,92 @@
                        android:contentDescription="@string/screenrecord_taps_label"
                        style="@style/ScreenRecord.Switch"/>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:layout_marginTop="@dimen/screenrecord_option_padding">
                    <ImageView
                        android:layout_width="@dimen/screenrecord_option_icon_size"
                        android:layout_height="@dimen/screenrecord_option_icon_size"
                        android:layout_weight="0"
                        android:src="@drawable/ic_sr_stopdot"
                        android:tint="?android:attr/textColorSecondary"
                        android:layout_gravity="center"
                        android:layout_marginRight="@dimen/screenrecord_option_padding"/>
                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_weight="1"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:importantForAccessibility="no"
                            android:text="@string/screenrecord_stopdot_label"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:importantForAccessibility="no"
                            android:text="@string/screenrecord_stopdot_summary"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:textColorSecondary" />
                    </LinearLayout>
                    <Switch
                        android:layout_width="wrap_content"
                        android:minWidth="48dp"
                        android:layout_height="48dp"
                        android:layout_weight="0"
                        android:id="@+id/screenrecord_stopdot_switch"
                        android:contentDescription="@string/screenrecord_stopdot_label"
                        style="@style/ScreenRecord.Switch"/>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal"
                    android:layout_marginTop="@dimen/screenrecord_option_padding">
                    <ImageView
                        android:layout_width="@dimen/screenrecord_option_icon_size"
                        android:layout_height="@dimen/screenrecord_option_icon_size"
                        android:layout_weight="0"
                        android:src="@drawable/ic_sr_quality"
                        android:tint="?android:attr/textColorSecondary"
                        android:layout_gravity="center"
                        android:layout_marginRight="@dimen/screenrecord_option_padding"/>
                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_weight="1"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:importantForAccessibility="no"
                            android:text="@string/screenrecord_lowquality_label"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="?android:attr/textColorPrimary" />
                        <TextView
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:importantForAccessibility="no"
                            android:text="@string/screenrecord_lowquality_summary"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="?android:textColorSecondary" />
                    </LinearLayout>
                    <Switch
                        android:layout_width="wrap_content"
                        android:minWidth="48dp"
                        android:layout_height="48dp"
                        android:layout_weight="0"
                        android:id="@+id/screenrecord_lowquality_switch"
                        android:contentDescription="@string/screenrecord_lowquality_label"
                        style="@style/ScreenRecord.Switch"/>
                </LinearLayout>
            </LinearLayout>

            <!-- Buttons -->
+94 −0
Original line number Diff line number Diff line
@@ -85,4 +85,98 @@
            style="@style/ScreenRecord.Switch"
            android:importantForAccessibility="yes" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/show_stopdot"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:layout_marginTop="@dimen/screenrecord_option_padding">
        <ImageView
            android:layout_width="@dimen/screenrecord_option_icon_size"
            android:layout_height="@dimen/screenrecord_option_icon_size"
            android:src="@drawable/ic_sr_stopdot"
            android:tint="?android:attr/textColorSecondary"
            android:layout_marginRight="@dimen/screenrecord_option_padding"
            android:importantForAccessibility="no"/>
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:minHeight="48dp"
            android:layout_weight="1"
            android:orientation="vertical">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fontFamily="@*android:string/config_bodyFontFamily"
                android:text="@string/screenrecord_stopdot_label"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="?android:attr/textColorPrimary"
                android:contentDescription="@string/screenrecord_stopdot_label"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:importantForAccessibility="no"
                android:fontFamily="@*android:string/config_bodyFontFamily"
                android:text="@string/screenrecord_stopdot_summary"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="?android:textColorSecondary"/>
        </LinearLayout>

        <Switch
            android:layout_width="wrap_content"
            android:minWidth="48dp"
            android:layout_height="48dp"
            android:id="@+id/screenrecord_stopdot_switch"
            android:contentDescription="@string/screenrecord_stopdot_label"
            style="@style/ScreenRecord.Switch"
            android:importantForAccessibility="yes" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/show_lowquality"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:gravity="center_vertical"
        android:layout_marginTop="@dimen/screenrecord_option_padding">
        <ImageView
            android:layout_width="@dimen/screenrecord_option_icon_size"
            android:layout_height="@dimen/screenrecord_option_icon_size"
            android:src="@drawable/ic_sr_quality"
            android:tint="?android:attr/textColorSecondary"
            android:layout_marginRight="@dimen/screenrecord_option_padding"
            android:importantForAccessibility="no"/>
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:minHeight="48dp"
            android:layout_weight="1"
            android:orientation="vertical">
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fontFamily="@*android:string/config_bodyFontFamily"
                android:text="@string/screenrecord_lowquality_label"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textColor="?android:attr/textColorPrimary"
                android:contentDescription="@string/screenrecord_lowquality_label"/>
            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:importantForAccessibility="no"
                android:fontFamily="@*android:string/config_bodyFontFamily"
                android:text="@string/screenrecord_lowquality_summary"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textColor="?android:textColorSecondary"/>
        </LinearLayout>

        <Switch
            android:layout_width="wrap_content"
            android:minWidth="48dp"
            android:layout_height="48dp"
            android:id="@+id/screenrecord_lowquality_switch"
            android:contentDescription="@string/screenrecord_lowquality_label"
            style="@style/ScreenRecord.Switch"
            android:importantForAccessibility="yes" />
    </LinearLayout>
</LinearLayout>
 No newline at end of file
Loading