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

Commit 17d39919 authored by Jesse Chan's avatar Jesse Chan
Browse files

Implement hide gestural navigation hint bar [2/5]



Change-Id: I14dd73414c9f7ee1b01f315c9eeae0fd3ac4f859
Signed-off-by: default avatarJesse Chan <jc@lineageos.org>
parent cdd1d9d5
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -146,4 +146,26 @@
                  android:ellipsize="marquee" />

    </LinearLayout>

    <TextView
        android:textStyle="bold"
        android:layout_marginTop="8dip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_marginBottom="2dp"
        android:layout_marginStart="12dp"
        android:textColor="?android:attr/textColorPrimary"
        android:text="@string/show_navbar_hint_title" />

    <Switch
        android:id="@+id/show_navbar_hint"
        android:layout_marginTop="22dip"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:layout_marginBottom="2dp"
        android:layout_marginStart="12dp"
        android:textColor="?android:attr/textColorSecondary"
        android:text="@string/show_navbar_hint_summary"/>
</LinearLayout>
 No newline at end of file
+4 −0
Original line number Diff line number Diff line
@@ -173,4 +173,8 @@
    <string name="back_exclusion_summary">Exclude part of the top of the screen from the back gesture area</string>
    <string name="min_label">Min</string>
    <string name="max_label">Max</string>

    <!-- Navigation bar hint -->
    <string name="show_navbar_hint_title">Navigation hint</string>
    <string name="show_navbar_hint_summary">Show navigation hint bar at the bottom of the screen</string>
</resources>
+9 −0
Original line number Diff line number Diff line
@@ -73,6 +73,11 @@ public class GestureNavigationBackSensitivityDialog extends InstrumentedDialogFr
        final SeekBar excludedTopSeekBar = view.findViewById(R.id.back_excluded_top_seekbar);
        excludedTopSeekBar.setProgress(excludedPercentage);

        final boolean isShowHintEnabled = LineageSettings.System.getInt(cr,
                LineageSettings.System.NAVIGATION_BAR_HINT, 1) == 1;
        final Switch hintSwitch = view.findViewById(R.id.show_navbar_hint);
        hintSwitch.setChecked(isShowHintEnabled);

        return new AlertDialog.Builder(getContext())
                .setTitle(R.string.edge_to_edge_navigation_title)
                .setView(view)
@@ -85,6 +90,10 @@ public class GestureNavigationBackSensitivityDialog extends InstrumentedDialogFr
                    int excludedTopPercentage = excludedTopSeekBar.getProgress();
                    LineageSettings.Secure.putInt(cr,
                            LineageSettings.Secure.GESTURE_BACK_EXCLUDE_TOP, excludedTopPercentage);

                    int showHint = hintSwitch.isChecked() ? 1 : 0;
                    LineageSettings.System.putInt(cr,
                            LineageSettings.System.NAVIGATION_BAR_HINT, showHint);
                })
                .create();
    }