Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppSidebar (2/2) #18

Open
wants to merge 1 commit into
base: jb4.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions res/layout/seek_bar_preference.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/widget_frame"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingTop="5dp"
android:paddingRight="10dp"
android:paddingBottom="5dp"
>

<TextView android:id="@android:id/title"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium" />

<TextView android:id="@android:id/summary"
android:layout_alignParentLeft="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@android:id/title"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary" />

<TextView android:id="@+id/seekBarPrefUnitsRight"
android:layout_alignParentRight="true"
android:layout_below="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView android:id="@+id/seekBarPrefValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@id/seekBarPrefUnitsRight"
android:layout_below="@android:id/title"
android:gravity="right"
android:textAppearance="?android:attr/textAppearanceSmall" />

<TextView android:id="@+id/seekBarPrefUnitsLeft"
android:layout_below="@android:id/title"
android:layout_toLeftOf="@id/seekBarPrefValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall" />

<LinearLayout android:id="@+id/seekBarPrefBarContainer"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@android:id/summary">
</LinearLayout>

</RelativeLayout>
36 changes: 36 additions & 0 deletions res/layout/seekbar_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center_horizontal">

<TextView android:id="@+id/value"
android:layout_centerInParent="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="5dip"
android:textAppearance="?android:textAppearanceLarge" />

<SeekBar android:id="@+id/seekbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dip"
android:paddingTop="5dip" />

</LinearLayout>
32 changes: 32 additions & 0 deletions res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -916,4 +916,36 @@
<!-- Always allow app to send to premium SMS short code. -->
<item>Always allow</item>
</string-array>

<!-- App sidebar -->
<string-array name="app_sidebar_position_entries" translatable="false">
<item>@string/app_sidebar_position_left</item>
<item>@string/app_sidebar_position_right</item>
</string-array>
<string-array name="app_sidebar_position_values" translatable="false">
<item>0</item>
<item>1</item>
</string-array>

<string-array name="tab_position_entries">
<item>Top</item>
<item>Middle</item>
<item>Bottom</item>
</string-array>
<string-array name="tab_position_entryValues">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>

<string-array name="tab_size_entries">
<item>Small</item>
<item>Medium</item>
<item>Large</item>
</string-array>
<string-array name="tab_size_entryValues">
<item>1.0</item>
<item>1.5</item>
<item>2.0</item>
</string-array>
</resources>
5 changes: 5 additions & 0 deletions res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,9 @@
<attr name="useDefaultController" format="boolean" />
</declare-styleable>

<declare-styleable name="SeekBarPreference">
<attr name="min" format="integer" />
<attr name="unitsLeft" format="string" />
<attr name="unitsRight" format="string" />
</declare-styleable>
</resources>
30 changes: 30 additions & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4534,4 +4534,34 @@

<!-- Text to display in regulatory info screen (from device overlay). -->
<string name="regulatory_info_text"></string>

<!-- App sidebar -->
<string name="app_sidebar_title">Appbar</string>
<string name="app_sidebar_enable_title">Enable Appbar</string>
<string name="app_sidebar_enable_summaryOn">\@appbar is enabled</string>
<string name="app_sidebar_enable_summaryOff">\@appbar is disabled</string>
<string name="app_sidebar_setup_items_title">Setup Appbar content</string>
<string name="app_sidebar_setup_items_summary">Add, remove, and position items in the @ppbar</string>
<string name="app_sidebar_transparency_title">Appbar transparency</string>
<string name="app_sidebar_transparency_summary">Adjust the Appbar transparency level</string>
<string name="app_sidebar_position_title">Appbar position</string>
<string name="app_sidebar_position_summary">Position the Appbar on the left or right side of the screen</string>
<string name="app_sidebar_position_left">Left</string>
<string name="app_sidebar_position_right">Right</string>
<string name="app_sidebar_hide_labels_title">Hide icon labels</string>
<string name="app_sidebar_hide_labels_summary">Hide Appbar icon labels</string>
<string name="tab_category">Visible Tab</string>
<string name="use_tab_title">Display tab</string>
<string name="use_tab_summary">Display a visible tab on the side which will display the \@appbar when touched.</string>
<string name="tab_position_title">Tab location</string>
<string name="tab_position_summary">Display the tab on the top, middle, or bottom on the side of the screen.</string>
<string name="tab_size_title">Tab size</string>
<string name="tab_size_summary">Change the size of the visible tab.</string>
<string name="trigger_category">Trigger region</string>
<string name="trigger_width_title">Trigger width</string>
<string name="trigger_width_summary">Adjust the width of the trigger area</string>
<string name="trigger_top_title">Trigger position</string>
<string name="trigger_top_summary">Adjust the vertical postion of the trigger area</string>
<string name="trigger_bottom_title">Trigger height</string>
<string name="trigger_bottom_summary">Adjust the height of the trigger area</string>
</resources>
98 changes: 98 additions & 0 deletions res/xml/app_sidebar_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2012 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.
-->

<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
android:title="@string/app_sidebar_title" >

<SwitchPreference
android:key="sidebar_enable"
android:title="@string/app_sidebar_enable_title"
android:summaryOn="@string/app_sidebar_enable_summaryOn"
android:summaryOff="@string/app_sidebar_enable_summaryOff"
android:defaultValue="false" />

<Preference
android:key="sidebar_setup_items"
android:title="@string/app_sidebar_setup_items_title"
android:summary="@string/app_sidebar_setup_items_summary"
android:dependency="sidebar_enable" />

<ListPreference
android:key="sidebar_position"
android:title="@string/app_sidebar_position_title"
android:summary="@string/app_sidebar_position_summary"
android:entries="@array/app_sidebar_position_entries"
android:entryValues="@array/app_sidebar_position_values"
android:defaultValue="0"
android:dependency="sidebar_enable" />

<CheckBoxPreference
android:key="sidebar_hide_labels"
android:title="@string/app_sidebar_hide_labels_title"
android:summary="@string/app_sidebar_hide_labels_summary"
android:defaultValue="false"
android:dependency="sidebar_enable" />

<com.android.settings.slim.SeekBarPreference
android:key="sidebar_transparency"
android:title="@string/app_sidebar_transparency_title"
android:summary="@string/app_sidebar_transparency_summary"
android:max="50"
settings:min="0"
settings:unitsLeft=""
settings:unitsRight="%"
android:defaultValue="0"
android:dependency="sidebar_enable" />

<PreferenceCategory
android:title="@string/trigger_category" />

<com.android.settings.slim.SeekBarPreference
android:key="trigger_width"
android:title="@string/trigger_width_title"
android:summary="@string/trigger_width_summary"
android:defaultValue="4"
android:max="64"
settings:min="4"
settings:unitsLeft=""
settings:unitsRight="px"
android:dependency="sidebar_enable" />

<com.android.settings.slim.SeekBarPreference
android:key="trigger_top"
android:title="@string/trigger_top_title"
android:summary="@string/trigger_top_summary"
android:defaultValue="0"
android:max="99"
settings:min="0"
settings:unitsLeft=""
settings:unitsRight="%"
android:dependency="sidebar_enable" />

<com.android.settings.slim.SeekBarPreference
android:key="trigger_bottom"
android:title="@string/trigger_bottom_title"
android:summary="@string/trigger_bottom_summary"
android:defaultValue="100"
android:max="100"
settings:min="1"
settings:unitsLeft=""
settings:unitsRight="%"
android:dependency="sidebar_enable" />

</PreferenceScreen>
5 changes: 5 additions & 0 deletions res/xml/slim_interface_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
android:fragment="com.android.settings.slim.StatusBar"
android:title="@string/status_bar_title" />

<PreferenceScreen
android:key="app_sidebar"
android:fragment="com.android.settings.slim.AppSidebar"
android:title="@string/app_sidebar_title" />

<PreferenceScreen
android:key="themes_settings"
android:title="@string/themes_settings_title">
Expand Down
Loading