diff options
| author | Dirk Rettschlag <dirk.rettschlag@gmail.com> | 2014-03-06 15:45:13 +0100 |
|---|---|---|
| committer | LorDClockaN <davor@losinj.com> | 2014-03-08 23:06:20 +0100 |
| commit | 7fa73a9abba6ef5ecd21bb542dd05054d7a4e544 (patch) | |
| tree | 83784277b78113d071c65f8c038603b10ce29ded | |
| parent | 485f00c7dafc2e2dab0cd8c1df458d7be800d433 (diff) | |
Add option to enable/disable navring (2/2)
This will add an option to toggle navigation ring.
If the navigation bar is disabled then a standalone
navigation ring is added.
Change-Id: I4d9c2db0ccd801052d1880c3ff29fb2ab2750bc7
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
| -rw-r--r-- | res/layout-land/navigation_ring_targets.xml | 101 | ||||
| -rw-r--r-- | res/layout-sw600dp/navigation_ring_targets.xml | 35 | ||||
| -rw-r--r-- | res/layout/navigation_ring_targets.xml | 40 | ||||
| -rw-r--r-- | res/values/strings.xml | 2 |
4 files changed, 127 insertions, 51 deletions
diff --git a/res/layout-land/navigation_ring_targets.xml b/res/layout-land/navigation_ring_targets.xml index 830483b..b456546 100644 --- a/res/layout-land/navigation_ring_targets.xml +++ b/res/layout-land/navigation_ring_targets.xml @@ -1,24 +1,79 @@ <?xml version="1.0" encoding="utf-8"?> +<!-- +/** + * Copyright (c) 2013, The Android Open Kang 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. + */ +--> + <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:prvandroid="http://schemas.android.com/apk/prv/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > - <TextView + <TextView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="bottom" + android:layout_margin="8dp" + android:background="@android:color/transparent" + android:gravity="center_horizontal" + android:padding="5dp" + android:text="@string/navring_target_info" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="#FFFFFF" + android:textStyle="italic" /> + + <com.android.internal.widget.multiwaveview.GlowPadView + android:id="@+id/navring_target" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:gravity="right" + android:layout_gravity="right" + prvandroid:targetDescriptions="@array/lockscreen_target_descriptions_unlock_only" + prvandroid:targetDrawables="@array/lockscreen_targets_unlock_only" + prvandroid:directionDescriptions="@array/lockscreen_target_descriptions_unlock_only" + prvandroid:outerRingDrawable="@drawable/navbar_search_outerring" + prvandroid:outerRadius="@dimen/navbar_search_outerring_radius" + prvandroid:innerRadius="@*android:dimen/glowpadview_inner_radius" + prvandroid:snapMargin="@dimen/navbar_search_snap_margin" + prvandroid:feedbackCount="1" + prvandroid:vibrationDuration="20" + prvandroid:alwaysTrackFinger="true" + prvandroid:handleDrawable="@drawable/ic_navigation_ring_hint" + prvandroid:glowRadius="@*android:dimen/glowpadview_glow_radius" + prvandroid:pointDrawable="@*android:drawable/ic_lockscreen_glowdot" /> + + <LinearLayout + android:orientation="vertical" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="top" > + + <com.aokp.romcontrol.settings.CheckboxSetting android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_gravity="bottom" - android:layout_margin="8dp" - android:background="@android:color/transparent" - android:gravity="center_horizontal" - android:padding="5dp" - android:text="@string/navring_target_info" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="#FFFFFF" - android:textStyle="italic" /> - - <com.aokp.romcontrol.settings.SingleChoiceSetting + android:layout_gravity="top" + android:id="@+id/setting_enable_navring" + android:title="@string/enable_navring_title" + android:summary="@string/enable_navring_summary" + android:key="enable_navring" + android:defaultValue="true" /> + + <com.aokp.romcontrol.settings.SingleChoiceSetting android:id="@+id/ring_amount" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -28,25 +83,7 @@ android:key="systemui_navring_amount" android:title="@string/navring_target_amount_text" /> - <com.android.internal.widget.multiwaveview.GlowPadView - android:id="@+id/navring_target" - android:orientation="vertical" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:gravity="right" - android:layout_gravity="right" - prvandroid:targetDescriptions="@array/lockscreen_target_descriptions_unlock_only" - prvandroid:targetDrawables="@array/lockscreen_targets_unlock_only" - prvandroid:directionDescriptions="@array/lockscreen_target_descriptions_unlock_only" - prvandroid:outerRingDrawable="@drawable/navbar_search_outerring" - prvandroid:outerRadius="@dimen/navbar_search_outerring_radius" - prvandroid:innerRadius="@*android:dimen/glowpadview_inner_radius" - prvandroid:snapMargin="@dimen/navbar_search_snap_margin" - prvandroid:feedbackCount="1" - prvandroid:vibrationDuration="20" - prvandroid:alwaysTrackFinger="true" - prvandroid:handleDrawable="@drawable/ic_navigation_ring_hint" - prvandroid:glowRadius="@*android:dimen/glowpadview_glow_radius" - prvandroid:pointDrawable="@*android:drawable/ic_lockscreen_glowdot" /> + </LinearLayout> </FrameLayout> + diff --git a/res/layout-sw600dp/navigation_ring_targets.xml b/res/layout-sw600dp/navigation_ring_targets.xml index a6e24ba..9a35a4c 100644 --- a/res/layout-sw600dp/navigation_ring_targets.xml +++ b/res/layout-sw600dp/navigation_ring_targets.xml @@ -28,15 +28,34 @@ android:layout_width="match_parent" android:layout_height="wrap_content" > - <com.aokp.romcontrol.settings.SingleChoiceSetting - android:id="@+id/ring_amount" - android:layout_width="match_parent" + <LinearLayout + android:orientation="vertical" + android:layout_width="fill_parent" android:layout_height="wrap_content" - android:layout_gravity="top" - android:entries="@array/pref_navring_amount_entries" - android:entryValues="@array/pref_navring_amount_values" - android:key="systemui_navring_amount" - android:title="@string/navring_target_amount_text" /> + android:layout_gravity="top"> + + <com.aokp.romcontrol.settings.CheckboxSetting + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:id="@+id/setting_enable_navring" + android:title="@string/enable_navring_title" + android:summary="@string/enable_navring_summary" + android:key="enable_navring" + android:defaultValue="true" /> + + <com.aokp.romcontrol.settings.SingleChoiceSetting + android:id="@+id/ring_amount" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:entries="@array/pref_navring_amount_entries" + android:entryValues="@array/pref_navring_amount_values" + android:key="systemui_navring_amount" + android:title="@string/navring_target_amount_text" /> + + </LinearLayout> + </FrameLayout> <FrameLayout diff --git a/res/layout/navigation_ring_targets.xml b/res/layout/navigation_ring_targets.xml index fd0b543..87b804c 100644 --- a/res/layout/navigation_ring_targets.xml +++ b/res/layout/navigation_ring_targets.xml @@ -26,18 +26,36 @@ <FrameLayout android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1" > + android:layout_height="wrap_content" > - <com.aokp.romcontrol.settings.SingleChoiceSetting - android:id="@+id/ring_amount" - android:layout_width="match_parent" + <LinearLayout + android:orientation="vertical" + android:layout_width="fill_parent" android:layout_height="wrap_content" - android:layout_gravity="top" - android:entries="@array/pref_navring_amount_entries" - android:entryValues="@array/pref_navring_amount_values" - android:key="systemui_navring_amount" - android:title="@string/navring_target_amount_text" /> + android:layout_gravity="top"> + + <com.aokp.romcontrol.settings.CheckboxSetting + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:id="@+id/setting_enable_navring" + android:title="@string/enable_navring_title" + android:summary="@string/enable_navring_summary" + android:key="enable_navring" + android:defaultValue="true" /> + + <com.aokp.romcontrol.settings.SingleChoiceSetting + android:id="@+id/ring_amount" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_gravity="top" + android:entries="@array/pref_navring_amount_entries" + android:entryValues="@array/pref_navring_amount_values" + android:key="systemui_navring_amount" + android:title="@string/navring_target_amount_text" /> + + </LinearLayout> + </FrameLayout> <FrameLayout @@ -63,7 +81,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="bottom" - android:layout_marginTop="-15dp" + android:layout_marginTop="30dp" android:contentDescription="@*android:string/keyguard_accessibility_slide_area" android:orientation="horizontal" prvandroid:allowScaling="false" diff --git a/res/values/strings.xml b/res/values/strings.xml index 9866b5b..0968e39 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -356,6 +356,8 @@ <string name="four_targets">4 targets</string> <string name="five_targets">5 targets</string> <string name="custom_app_icon_successfully">"'s icon set successfully!"</string> + <string name="enable_navring_title">Enable navigation ring</string> + <string name="enable_navring_summary">@null</string> <!-- Animation Controls --> <string name="title_animation_controls">Animations</string> |
