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

Commit e762e915 authored by Michael Bestas's avatar Michael Bestas
Browse files

Button & keyboard backlight brightness adjustment (1/2)



PS2: move from display to button settings
PS3: fix tab

Signed-off-by: default avatarMichael Bestas <mikeioannina@gmail.com>

Change-Id: I35a6d149affc1da08707b7c40fb02761321cba41
parent 47c38ec5
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2013 The CyanogenMod 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.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center_horizontal"
            android:paddingBottom="20dip">

        <TextView android:id="@+id/button_backlight_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/button_backlight_title"
                android:paddingTop="10dip"
                android:paddingLeft="20dip"
                android:paddingRight="20dip" />
        <TextView android:id="@+id/button_backlight_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:paddingTop="10dip"
                android:paddingLeft="20dip"
                android:paddingRight="20dip" />
        <SeekBar android:id="@+id/button_backlight_seekbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/button_backlight_text"
                android:paddingTop="2dip"
                android:paddingLeft="20dip"
                android:paddingRight="20dip" />

    </RelativeLayout>
</ScrollView>
+50 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2013 The CyanogenMod 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.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

    <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:gravity="center_horizontal"
            android:paddingBottom="20dip">

        <TextView android:id="@+id/keyboard_backlight_text"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/keyboard_backlight_title"
                android:paddingTop="10dip"
                android:paddingLeft="20dip"
                android:paddingRight="20dip" />
        <TextView android:id="@+id/keyboard_backlight_value"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:paddingTop="10dip"
                android:paddingLeft="20dip"
                android:paddingRight="20dip" />
        <SeekBar android:id="@+id/keyboard_backlight_seekbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/keyboard_backlight_text"
                android:paddingTop="2dip"
                android:paddingLeft="20dip"
                android:paddingRight="20dip" />

    </RelativeLayout>
</ScrollView>
+5 −0
Original line number Diff line number Diff line
@@ -997,6 +997,11 @@ two in order to insert additional control points. \'Remove\' deletes the selecte
    <string name="color_green_title">Green</string>
    <string name="color_blue_title">Blue</string>

    <!-- Hardware tunables - Key backlight -->
    <string name="key_backlight_title">Backlight</string>
    <string name="button_backlight_title">Button backlight brightness</string>
    <string name="keyboard_backlight_title">Keyboard backlight brightness</string>

    <!--  Other device settings -->
    <string name="more_device_controls_title">More\u2026</string>
    <string name="more_device_settings_title">Other device options</string>
+18 −0
Original line number Diff line number Diff line
@@ -146,4 +146,22 @@

    </PreferenceCategory>

    <PreferenceCategory
        android:key="key_backlight"
        android:title="@string/key_backlight_title" >

            <com.android.settings.cyanogenmod.ButtonBacklightBrightness
                android:key="button_backlight"
                android:title="@string/button_backlight_title"
                android:dialogTitle="@string/button_backlight_title"
                android:persistent="false" />

            <com.android.settings.cyanogenmod.KeyboardBacklightBrightness
                android:key="keyboard_backlight"
                android:title="@string/keyboard_backlight_title"
                android:dialogTitle="@string/keyboard_backlight_title"
                android:persistent="false" />

    </PreferenceCategory>

</PreferenceScreen>
+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ public class BootReceiver extends BroadcastReceiver {
        /* Restore the hardware tunable values */
        DisplayColor.restore(ctx);
        VibratorIntensity.restore(ctx);
        ButtonBacklightBrightness.restore(ctx);
        KeyboardBacklightBrightness.restore(ctx);
    }

    private void initFreqCapFiles(Context ctx)
Loading