Skip to content

Commit

Permalink
Wakelock Blocker [2/2]
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimrodsv committed Aug 7, 2015
1 parent b0d37f5 commit cc4a5a7
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 0 deletions.
Binary file added res/drawable-hdpi/ic_menu_save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-mdpi/ic_menu_save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xhdpi/ic_menu_save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/drawable-xxhdpi/ic_menu_save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
89 changes: 89 additions & 0 deletions res/layout/wakelock_blocker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2013, 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:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:paddingEnd="?android:attr/scrollbarSize"
android:background="?android:attr/selectableItemBackground"
android:orientation="vertical">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">

<RelativeLayout
android:layout_width="200dip"
android:layout_height="wrap_content"
android:layout_marginTop="6dip"
android:layout_marginBottom="6dip"
android:layout_weight="1">

<TextView android:id="@+id/wakelock_blocker_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceMedium"
android:ellipsize="marquee"
android:text="@string/wakelock_blocker_title"
android:fadingEdge="horizontal" />

<TextView android:id="@+id/wakelock_blocker_title_summary"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/wakelock_blocker_title"
android:layout_alignStart="@id/wakelock_blocker_title"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="?android:attr/textColorSecondary"
android:text="@string/wakelock_blocker_summary"
android:maxLines="4" />

</RelativeLayout>

<LinearLayout android:id="@+android:id/widget_frame"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="vertical" >

<Switch
android:id="@+id/wakelock_blocker_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="4dip"/>

</LinearLayout>

</LinearLayout>

<TextView
android:id="@+id/wakelock_list_header"
android:text="@string/wakelock_list_header"
style="?android:attr/listSeparatorTextViewStyle" />

<ListView
android:id="@+id/wakelock_list"
android:layout_width="match_parent"
android:layout_height="match_parent"/>

</LinearLayout>
32 changes: 32 additions & 0 deletions res/layout/wakelock_item.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2013, 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="fill_parent"
android:layout_height="wrap_content">

<CheckBox
android:id="@+id/wakelock_blocked"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:focusable="false"/>

</LinearLayout>
9 changes: 9 additions & 0 deletions res/values/slim_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1314,4 +1314,13 @@
<string name="volume_steps_7">7</string>
<string name="volume_steps_5">5</string>

<!-- Wakelock blocker -->
<string name="wakelock_blocker_title">Wakelock blocker</string>
<string name="wakelock_blocker_summary">Block system wakelocks use with caution</string>
<string name="wakelock_blocker_save">Save</string>
<string name="wakelock_list_header">Available wakelocks</string>
<string name="wakelock_blocker_reload">Reload</string>
<string name="wakelock_blocker_warning_title">Proceed with caution</string>
<string name="wakelock_blocker_warning">Blocking wakelocks have the potential to cause instability, crashes or data loss</string>

</resources>
6 changes: 6 additions & 0 deletions res/xml/slim_advanced_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@
android:targetClass="com.cyngn.maxxaudio.activity.ActivityMusic" />
</PreferenceScreen>

<PreferenceScreen
android:key="wakelock_blocker"
android:title="@string/wakelock_blocker_title"
android:summary="@string/wakelock_blocker_summary"
android:icon="@drawable/ic_menu_save"
android:fragment="com.android.settings.slim.WakeLockBlocker" />
</PreferenceCategory>

<PreferenceCategory
Expand Down

0 comments on commit cc4a5a7

Please sign in to comment.