├── .classpath
├── .gitignore
├── .project
├── AndroidManifest.xml
├── assets
└── xposed_init
├── ic_launcher-web.png
├── proguard-project.txt
├── project.properties
├── res
├── anim
│ ├── animcontrol_grow_fade_in_center_ribbon.xml
│ ├── animcontrol_grow_fade_in_from_bottom_ribbon.xml
│ ├── animcontrol_grow_fade_in_left_ribbon.xml
│ ├── animcontrol_grow_fade_in_ribbon.xml
│ ├── animcontrol_grow_fade_in_right_ribbon.xml
│ ├── animcontrol_shrink_fade_out_center_ribbon.xml
│ ├── animcontrol_shrink_fade_out_from_bottom_ribbon.xml
│ ├── animcontrol_shrink_fade_out_left_ribbon.xml
│ ├── animcontrol_shrink_fade_out_ribbon.xml
│ ├── animcontrol_shrink_fade_out_right_ribbon.xml
│ ├── animcontrol_slide_in_down.xml
│ ├── animcontrol_slide_in_left_no_fade.xml
│ ├── animcontrol_slide_in_left_ribbon.xml
│ ├── animcontrol_slide_in_right_no_fade.xml
│ ├── animcontrol_slide_in_right_ribbon.xml
│ ├── animcontrol_slide_in_up_ribbon.xml
│ ├── animcontrol_slide_out_down_ribbon.xml
│ ├── animcontrol_slide_out_left_no_fade.xml
│ ├── animcontrol_slide_out_left_ribbon.xml
│ ├── animcontrol_slide_out_right_no_fade.xml
│ ├── animcontrol_slide_out_right_ribbon.xml
│ ├── animcontrol_slide_out_up.xml
│ ├── animcontrol_slow_fade_in.xml
│ ├── animcontrol_slow_fade_out.xml
│ ├── animcontrol_translucent_enter_ribbon.xml
│ ├── animcontrol_translucent_exit_ribbon.xml
│ ├── honami_activity_close_enter.xml
│ ├── honami_activity_close_exit.xml
│ ├── honami_activity_open_enter.xml
│ ├── honami_activity_open_exit.xml
│ ├── honami_app_starting_exit.xml
│ ├── honami_dialog_enter.xml
│ ├── honami_dialog_exit.xml
│ ├── honami_lock_screen_exit.xml
│ ├── honami_options_panel_enter.xml
│ ├── honami_options_panel_exit.xml
│ ├── honami_recent_enter.xml
│ ├── honami_recent_exit.xml
│ ├── honami_recents_fade_in.xml
│ ├── honami_recents_fade_out.xml
│ ├── honami_submenu_enter.xml
│ ├── honami_submenu_exit.xml
│ ├── honami_task_close_enter.xml
│ ├── honami_task_close_exit.xml
│ ├── honami_task_open_enter.xml
│ ├── honami_task_open_exit.xml
│ ├── honami_toast_enter.xml
│ ├── honami_toast_exit.xml
│ ├── honami_window_move_from_decor.xml
│ ├── tn_activity_close_enter.xml
│ ├── tn_activity_close_exit.xml
│ ├── tn_activity_open_enter.xml
│ ├── tn_activity_open_exit.xml
│ ├── tn_app_starting_exit.xml
│ ├── tn_dialog_enter.xml
│ ├── tn_dialog_exit.xml
│ ├── tn_input_method_enter.xml
│ ├── tn_input_method_exit.xml
│ ├── tn_input_method_extract_enter.xml
│ ├── tn_input_method_extract_exit.xml
│ ├── tn_input_method_fancy_enter.xml
│ ├── tn_input_method_fancy_exit.xml
│ ├── tn_lock_screen_exit.xml
│ ├── tn_options_panel_enter.xml
│ ├── tn_options_panel_exit.xml
│ ├── tn_recent_enter.xml
│ ├── tn_recent_exit.xml
│ ├── tn_recents_fade_in.xml
│ ├── tn_recents_fade_out.xml
│ ├── tn_submenu_enter.xml
│ ├── tn_submenu_exit.xml
│ ├── tn_task_close_enter.xml
│ ├── tn_task_close_exit.xml
│ ├── tn_task_open_enter.xml
│ ├── tn_task_open_exit.xml
│ ├── tn_toast_enter.xml
│ ├── tn_toast_exit.xml
│ ├── tn_window_move_from_decor.xml
│ ├── toko_activity_close_enter.xml
│ ├── toko_activity_close_exit.xml
│ ├── toko_activity_open_enter.xml
│ ├── toko_activity_open_exit.xml
│ ├── toko_app_starting_exit.xml
│ ├── toko_dialog_enter.xml
│ ├── toko_dialog_exit.xml
│ ├── toko_lock_screen_exit.xml
│ ├── toko_options_panel_enter.xml
│ ├── toko_options_panel_exit.xml
│ ├── toko_recent_enter.xml
│ ├── toko_recent_exit.xml
│ ├── toko_recents_fade_in.xml
│ ├── toko_recents_fade_out.xml
│ ├── toko_submenu_enter.xml
│ ├── toko_submenu_exit.xml
│ ├── toko_task_close_enter.xml
│ ├── toko_task_close_exit.xml
│ ├── toko_task_open_enter.xml
│ ├── toko_task_open_exit.xml
│ ├── toko_toast_enter.xml
│ ├── toko_toast_exit.xml
│ ├── toko_window_move_from_decor.xml
│ ├── xylon_activity_close_enter.xml
│ ├── xylon_activity_close_exit.xml
│ ├── xylon_activity_open_enter.xml
│ ├── xylon_activity_open_exit.xml
│ ├── xylon_app_starting_exit.xml
│ ├── xylon_dialog_enter.xml
│ ├── xylon_dialog_exit.xml
│ ├── xylon_input_method_enter.xml
│ ├── xylon_input_method_exit.xml
│ ├── xylon_input_method_extract_enter.xml
│ ├── xylon_input_method_extract_exit.xml
│ ├── xylon_input_method_fancy_enter.xml
│ ├── xylon_input_method_fancy_exit.xml
│ ├── xylon_lock_screen_exit.xml
│ ├── xylon_options_panel_enter.xml
│ ├── xylon_options_panel_exit.xml
│ ├── xylon_recent_enter.xml
│ ├── xylon_recent_exit.xml
│ ├── xylon_recents_fade_in.xml
│ ├── xylon_recents_fade_out.xml
│ ├── xylon_submenu_enter.xml
│ ├── xylon_submenu_exit.xml
│ ├── xylon_task_close_enter.xml
│ ├── xylon_task_close_exit.xml
│ ├── xylon_task_open_enter.xml
│ ├── xylon_task_open_exit.xml
│ ├── xylon_toast_enter.xml
│ ├── xylon_toast_exit.xml
│ └── xylon_window_move_from_decor.xml
├── drawable-hdpi
│ └── ic_launcher.png
├── drawable-mdpi
│ └── ic_launcher.png
├── drawable-xhdpi
│ └── ic_launcher.png
├── layout
│ ├── pref_app_picker.xml
│ ├── pref_bar_height.xml
│ ├── pref_seekbar.xml
│ ├── view_app_dialog.xml
│ └── view_dialog_colorpicker.xml
├── values-de
│ └── strings.xml
├── values-es
│ └── strings.xml
├── values-fr
│ └── strings.xml
├── values-hu
│ └── strings.xml
├── values-ja
│ └── strings.xml
├── values-ko
│ └── strings.xml
├── values-pl
│ └── strings.xml
├── values-pt
│ └── strings.xml
├── values-ru
│ └── strings.xml
├── values-tr
│ └── strings.xml
├── values-zh-rCN
│ └── strings.xml
├── values-zh-rHK
│ └── strings.xml
├── values-zh-rTW
│ └── strings.xml
├── values
│ ├── arrays_anim_control.xml
│ ├── arrays_anim_ime.xml
│ ├── arrays_anim_ticker.xml
│ ├── arrays_anim_toast.xml
│ ├── arrays_batterybar_color_mode.xml
│ ├── arrays_listview.xml
│ ├── arrays_seconds_lettercase.xml
│ ├── arrays_system_anim.xml
│ ├── arrays_torch.xml
│ ├── strings.xml
│ └── styles.xml
└── xml
│ ├── pref_anim_control.xml
│ ├── pref_batterybar_color.xml
│ ├── pref_random_color.xml
│ └── pref_setting.xml
└── src
└── com
└── zst
└── xposed
└── xuimod
├── Common.java
├── SettingActivity.java
├── XuiMod.java
├── mods
├── AnimationControlsMod.java
├── BatteryBarMod.java
├── ClassicRecentsMod.java
├── EdgeEffectMod.java
├── InputMethodAnimationMod.java
├── ListViewAnimationMod.java
├── LockscreenTorchMod.java
├── LockscreenVolumeMod.java
├── RandomQuickSettingsColorMod.java
├── ScrollerMod.java
├── SecondsClockMod.java
├── SystemAnimationMod.java
├── TickerAnimation.java
├── ToastAnimationMod.java
├── VolumePanelMod.java
├── animation
│ ├── AppTransitionConstants.java
│ ├── AwesomeAnimationHelper.java
│ ├── InputMethodAnimationHelper.java
│ └── ToastAnimationHelper.java
└── batterybar
│ ├── BatteryBarController.java
│ └── BatteryBarView.java
└── preference
├── ApplicationsDialog.java
├── BarHeight.java
├── ColorPicker.java
├── SeekBarDialog.java
├── TestKeyboard.java
├── TestListView.java
├── VolumePanelAlpha.java
├── activity
├── AnimControlPreference.java
├── BatteryBarColor.java
├── ChooseRandomColor.java
└── ListViewBlacklist.java
└── colorpicker
├── AlphaPatternDrawable.java
├── ColorPanelView.java
├── ColorPickerView.java
└── ColorSettingsDialog.java
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /bin
2 | /temp
3 | /gen
4 | .classpath
5 | .project
6 | proguard-project.txt
7 | project.properties
8 | .DS_Store
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | XuiMod
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
21 |
24 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
51 |
52 |
55 |
56 |
59 |
60 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/assets/xposed_init:
--------------------------------------------------------------------------------
1 | com.zst.xposed.xuimod.XuiMod
--------------------------------------------------------------------------------
/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zst123/XuiMod/3c794ac576835ec53a9d365fcb5892c7677b22f9/ic_launcher-web.png
--------------------------------------------------------------------------------
/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
--------------------------------------------------------------------------------
/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-14
15 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_grow_fade_in_center_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_grow_fade_in_from_bottom_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_grow_fade_in_left_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_grow_fade_in_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_grow_fade_in_right_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_shrink_fade_out_center_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_shrink_fade_out_from_bottom_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_shrink_fade_out_left_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_shrink_fade_out_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_shrink_fade_out_right_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_in_down.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_in_left_no_fade.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_in_left_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_in_right_no_fade.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_in_right_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_in_up_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_out_down_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_out_left_no_fade.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_out_left_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_out_right_no_fade.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_out_right_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slide_out_up.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slow_fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_slow_fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_translucent_enter_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/animcontrol_translucent_exit_ribbon.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_activity_close_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/honami_activity_close_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_activity_open_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_activity_open_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/honami_app_starting_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/honami_dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/honami_dialog_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/honami_lock_screen_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_options_panel_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_options_panel_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_recent_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_recent_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_recents_fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/honami_recents_fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/honami_submenu_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_submenu_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_task_close_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_task_close_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_task_open_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_task_open_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/honami_toast_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/honami_toast_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/honami_window_move_from_decor.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/tn_activity_close_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_activity_close_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_activity_open_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_activity_open_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_app_starting_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/tn_dialog_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/tn_input_method_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/tn_input_method_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/tn_input_method_extract_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/res/anim/tn_input_method_extract_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/res/anim/tn_input_method_fancy_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/tn_input_method_fancy_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/res/anim/tn_lock_screen_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_options_panel_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/tn_options_panel_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/tn_recent_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_recent_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_recents_fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/tn_recents_fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/tn_submenu_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/tn_submenu_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/tn_task_close_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_task_close_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_task_open_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_task_open_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_toast_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_toast_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/tn_window_move_from_decor.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/toko_activity_close_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_activity_close_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_activity_open_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_activity_open_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_app_starting_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/toko_dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/toko_dialog_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_lock_screen_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/toko_options_panel_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/toko_options_panel_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_recent_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_recent_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_recents_fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/toko_recents_fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/toko_submenu_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_submenu_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/toko_task_close_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/toko_task_close_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/toko_task_open_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/res/anim/toko_task_open_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/res/anim/toko_toast_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/toko_toast_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/toko_window_move_from_decor.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/xylon_activity_close_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_activity_close_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/xylon_activity_open_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_activity_open_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_app_starting_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/xylon_dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_dialog_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/xylon_input_method_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/res/anim/xylon_input_method_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
14 |
--------------------------------------------------------------------------------
/res/anim/xylon_input_method_extract_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/xylon_input_method_extract_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/xylon_input_method_fancy_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_input_method_fancy_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_lock_screen_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_options_panel_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_options_panel_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_recent_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_recent_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_recents_fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/xylon_recents_fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/xylon_submenu_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_submenu_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_task_close_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/xylon_task_close_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/xylon_task_open_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/xylon_task_open_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/res/anim/xylon_toast_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/res/anim/xylon_toast_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/anim/xylon_window_move_from_decor.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zst123/XuiMod/3c794ac576835ec53a9d365fcb5892c7677b22f9/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zst123/XuiMod/3c794ac576835ec53a9d365fcb5892c7677b22f9/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zst123/XuiMod/3c794ac576835ec53a9d365fcb5892c7677b22f9/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/res/layout/pref_app_picker.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
23 |
24 |
25 |
26 |
27 |
37 |
38 |
39 |
40 |
43 |
44 |
48 |
49 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/res/layout/pref_bar_height.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
17 |
18 |
26 |
27 |
28 |
29 |
36 |
37 |
42 |
43 |
48 |
49 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/res/layout/pref_seekbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
18 |
19 |
26 |
27 |
34 |
35 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/res/layout/view_app_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
25 |
32 |
33 |
43 |
44 |
52 |
53 |
61 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/res/layout/view_dialog_colorpicker.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
25 |
26 |
30 |
31 |
37 |
38 |
46 |
47 |
56 |
57 |
63 |
64 |
65 |
66 |
72 |
73 |
78 |
79 |
88 |
89 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/res/values/arrays_anim_control.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | - @string/animation_default
8 | - @string/animation_fade
9 | - @string/animation_slide_right
10 | - @string/animation_slide_left
11 | - @string/animation_slide_right_no_fade
12 | - @string/animation_slide_left_no_fade
13 | - @string/animation_slide_up
14 | - @string/animation_slide_down
15 | - @string/animation_translucent
16 | - @string/animation_grow_shrink
17 | - @string/animation_grow_shrink_center
18 | - @string/animation_grow_shrink_bottom
19 | - @string/animation_grow_shrink_left
20 | - @string/animation_grow_shrink_right
21 | - @string/animation_random
22 |
23 |
24 |
25 | - 0
26 | - 1
27 | - 2
28 | - 3
29 | - 4
30 | - 5
31 | - 6
32 | - 7
33 | - 8
34 | - 9
35 | - 10
36 | - 11
37 | - 12
38 | - 13
39 | - -1
40 |
41 |
42 |
--------------------------------------------------------------------------------
/res/values/arrays_anim_ime.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | - @string/animation_default
8 | - @string/animation_fade
9 | - @string/animation_slide_right
10 | - @string/animation_slide_left
11 | - @string/animation_slide_right_no_fade
12 | - @string/animation_slide_left_no_fade
13 | - @string/animation_slide_up
14 | - @string/animation_slide_down
15 | - @string/animation_translucent
16 | - @string/animation_grow_shrink
17 | - @string/animation_grow_shrink_center
18 | - @string/animation_grow_shrink_bottom
19 | - @string/animation_grow_shrink_left
20 | - @string/animation_grow_shrink_right
21 | - @string/anim_ime_entries_fancy
22 | - @string/anim_ime_entries_tn
23 | - @string/anim_ime_entries_xylon_slide
24 | - @string/animation_random
25 |
26 |
27 |
28 | - 0
29 | - 1
30 | - 2
31 | - 3
32 | - 4
33 | - 5
34 | - 6
35 | - 7
36 | - 8
37 | - 9
38 | - 10
39 | - 11
40 | - 12
41 | - 13
42 | - 14
43 | - 15
44 | - 16
45 | - -1
46 |
47 |
48 |
--------------------------------------------------------------------------------
/res/values/arrays_anim_ticker.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - @string/animation_default
6 | - @string/animation_fade
7 | - @string/animation_slide_right
8 | - @string/animation_slide_left
9 | - @string/animation_slide_right_no_fade
10 | - @string/animation_slide_left_no_fade
11 | - @string/animation_slide_up
12 | - @string/animation_slide_down
13 | - @string/animation_translucent
14 | - @string/animation_grow_shrink
15 | - @string/animation_grow_shrink_center
16 | - @string/animation_grow_shrink_bottom
17 | - @string/animation_grow_shrink_left
18 | - @string/animation_grow_shrink_right
19 | - @string/animation_random
20 |
21 |
22 |
23 | - 0
24 | - 1
25 | - 2
26 | - 3
27 | - 4
28 | - 5
29 | - 6
30 | - 7
31 | - 8
32 | - 9
33 | - 10
34 | - 11
35 | - 12
36 | - 13
37 | - -1
38 |
39 |
40 |
--------------------------------------------------------------------------------
/res/values/arrays_anim_toast.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - @string/anim_toast_entries_none
6 | - @string/animation_fade
7 | - @string/animation_slide_right
8 | - @string/animation_slide_left
9 | - @string/animation_slide_right_no_fade
10 | - @string/animation_slide_left_no_fade
11 | - @string/animation_slide_up
12 | - @string/animation_slide_down
13 | - @string/animation_translucent
14 | - @string/animation_grow_shrink
15 | - @string/animation_grow_shrink_center
16 | - @string/animation_grow_shrink_bottom
17 | - @string/animation_grow_shrink_left
18 | - @string/animation_grow_shrink_right
19 | - @string/anim_toast_entries_toko
20 | - @string/anim_toast_entries_tn
21 | - @string/anim_toast_entries_xylon
22 | - @string/anim_toast_entries_z1
23 | - @string/animation_random
24 |
25 |
26 |
27 | - 0
28 | - 1
29 | - 2
30 | - 3
31 | - 4
32 | - 5
33 | - 6
34 | - 7
35 | - 8
36 | - 9
37 | - 10
38 | - 11
39 | - 12
40 | - 13
41 | - 14
42 | - 15
43 | - 16
44 | - 17
45 | - -1
46 |
47 |
48 |
--------------------------------------------------------------------------------
/res/values/arrays_batterybar_color_mode.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - @string/batterybar_color_color_0
6 | - @string/batterybar_color_color_1
7 | - @string/batterybar_color_color_2
8 | - @string/batterybar_color_color_3
9 |
10 |
11 |
12 | - 0
13 | - 1
14 | - 2
15 | - 3
16 |
17 |
18 |
--------------------------------------------------------------------------------
/res/values/arrays_listview.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - @string/listview_off
6 | - @string/listview_wave_left
7 | - @string/listview_wave_right
8 | - @string/listview_scale
9 | - @string/listview_alpha
10 | - @string/listview_stack_top
11 | - @string/listview_stack_bottom
12 | - @string/listview_unfold
13 | - @string/listview_fold
14 | - @string/listview_translate_left
15 | - @string/listview_translate_right
16 | - @string/listview_rotate
17 | - @string/listview_googlenow_left
18 | - @string/listview_googlenow_right
19 |
20 |
21 |
22 | - 0
23 | - 1
24 | - 2
25 | - 3
26 | - 4
27 | - 5
28 | - 6
29 | - 7
30 | - 8
31 | - 9
32 | - 10
33 | - 11
34 | - 12
35 | - 13
36 |
37 |
38 |
39 |
40 | - @string/listview_off
41 | - @string/listview_accelerate_interpolator
42 | - @string/listview_decelerate_interpolator
43 | - @string/listview_accelerate_decelerate_interpolator
44 | - @string/listview_anticipate_interpolator
45 | - @string/listview_overshoot_interpolator
46 | - @string/listview_anticipate_overshoot_interpolator
47 | - @string/listview_bounce_interpolator
48 | - @string/listview_cycle_interpolator
49 | - @string/listview_linear_interpolator
50 |
51 |
52 |
53 | - 0
54 | - 1
55 | - 2
56 | - 3
57 | - 4
58 | - 5
59 | - 6
60 | - 7
61 | - 8
62 | - 9
63 |
64 |
65 |
66 | - @string/listview_cache_none
67 | - @string/listview_cache_anim
68 | - @string/listview_cache_scroll
69 | - @string/listview_cache_all
70 |
71 |
72 |
73 | - 0
74 | - 1
75 | - 2
76 | - 3
77 |
78 |
79 |
--------------------------------------------------------------------------------
/res/values/arrays_seconds_lettercase.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | - @string/seconds_lettercase_default
7 | - @string/seconds_lettercase_lowercase
8 | - @string/seconds_lettercase_uppercase
9 |
10 |
11 |
12 | - 0
13 | - 1
14 | - 2
15 |
16 |
17 |
--------------------------------------------------------------------------------
/res/values/arrays_system_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | - @string/window_transitions_default
7 | - @string/window_transitions_xylon
8 | - @string/window_transitions_tn
9 | - @string/window_transitions_honami
10 | - @string/window_transitions_toko
11 |
12 |
13 |
14 | - 0
15 | - 1
16 | - 2
17 | - 3
18 | - 4
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/res/values/arrays_torch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - @string/lockscreen_torch_cm_torch
6 | - @string/lockscreen_torch_tesla_torch
7 | - @string/lockscreen_torch_dashlight_torch
8 |
9 |
10 |
11 | - 0
12 | - 1
13 | - 2
14 |
15 |
16 |
--------------------------------------------------------------------------------
/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/res/xml/pref_anim_control.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
13 |
14 |
23 |
24 |
30 |
31 |
37 |
38 |
44 |
45 |
51 |
52 |
58 |
59 |
65 |
66 |
72 |
73 |
79 |
80 |
86 |
87 |
93 |
94 |
--------------------------------------------------------------------------------
/res/xml/pref_batterybar_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
18 |
22 |
26 |
30 |
34 |
38 |
42 |
46 |
47 |
--------------------------------------------------------------------------------
/res/xml/pref_random_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
13 |
17 |
21 |
25 |
29 |
33 |
37 |
38 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/XuiMod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zst.xposed.xuimod;
18 |
19 | import com.zst.xposed.xuimod.mods.AnimationControlsMod;
20 | import com.zst.xposed.xuimod.mods.BatteryBarMod;
21 | import com.zst.xposed.xuimod.mods.ClassicRecentsMod;
22 | import com.zst.xposed.xuimod.mods.EdgeEffectMod;
23 | import com.zst.xposed.xuimod.mods.InputMethodAnimationMod;
24 | import com.zst.xposed.xuimod.mods.ListViewAnimationMod;
25 | import com.zst.xposed.xuimod.mods.LockscreenTorchMod;
26 | import com.zst.xposed.xuimod.mods.LockscreenVolumeMod;
27 | import com.zst.xposed.xuimod.mods.RandomQuickSettingsColorMod;
28 | import com.zst.xposed.xuimod.mods.ScrollerMod;
29 | import com.zst.xposed.xuimod.mods.SecondsClockMod;
30 | import com.zst.xposed.xuimod.mods.SystemAnimationMod;
31 | import com.zst.xposed.xuimod.mods.TickerAnimation;
32 | import com.zst.xposed.xuimod.mods.ToastAnimationMod;
33 | import com.zst.xposed.xuimod.mods.VolumePanelMod;
34 |
35 | import de.robv.android.xposed.IXposedHookInitPackageResources;
36 | import de.robv.android.xposed.IXposedHookLoadPackage;
37 | import de.robv.android.xposed.IXposedHookZygoteInit;
38 | import de.robv.android.xposed.XSharedPreferences;
39 | import de.robv.android.xposed.callbacks.XC_InitPackageResources.InitPackageResourcesParam;
40 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
41 |
42 | public class XuiMod implements IXposedHookZygoteInit,IXposedHookLoadPackage,IXposedHookInitPackageResources{
43 |
44 | public static String MODULE_PATH = null;
45 | public static XSharedPreferences pref;
46 |
47 | @Override
48 | public void initZygote(StartupParam startupParam) throws Throwable {
49 | MODULE_PATH = startupParam.modulePath;
50 | pref = new XSharedPreferences(Common.MY_PACKAGE_NAME);
51 | AnimationControlsMod.initZygote();
52 | }
53 |
54 | @Override
55 | public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
56 | pref.reload();
57 | SecondsClockMod.handleLoadPackage(lpparam);
58 | BatteryBarMod.handleLoadPackage(lpparam,pref);
59 | LockscreenVolumeMod.handleLoadPackage(lpparam,pref);
60 | ListViewAnimationMod.handleLoadPackage(pref);
61 | VolumePanelMod.handleLoadPackage(lpparam,pref);
62 | LockscreenTorchMod.handleLoadPackage(lpparam,pref);
63 | AnimationControlsMod.handleLoadPackage(lpparam);
64 | InputMethodAnimationMod.handleLoadPackage(lpparam,pref);
65 | ToastAnimationMod.handleLoadPackage(lpparam,pref);
66 | RandomQuickSettingsColorMod.loadPackage(lpparam,pref);
67 | ClassicRecentsMod.loadPackage(lpparam,pref);
68 | ScrollerMod.handleLoadPackage(pref);
69 | EdgeEffectMod.handleLoadPackage(lpparam, pref);
70 | TickerAnimation.handleLoadPackage(lpparam, pref);
71 | }
72 |
73 | @Override
74 | public void handleInitPackageResources(InitPackageResourcesParam resparam) throws Throwable {
75 | pref.reload();
76 | SystemAnimationMod.handleInitPackageResources(pref, resparam);
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/BatteryBarMod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zst.xposed.xuimod.mods;
18 |
19 | import com.zst.xposed.xuimod.Common;
20 | import com.zst.xposed.xuimod.mods.batterybar.BatteryBarController;
21 |
22 | import android.os.Build;
23 | import android.view.Gravity;
24 | import android.view.Surface;
25 | import android.view.View;
26 | import android.widget.FrameLayout;
27 | import android.widget.LinearLayout;
28 | import de.robv.android.xposed.XC_MethodHook;
29 | import de.robv.android.xposed.XSharedPreferences;
30 | import de.robv.android.xposed.XposedBridge;
31 | import de.robv.android.xposed.XposedHelpers;
32 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
33 |
34 | public class BatteryBarMod {
35 |
36 | static boolean mStatusBarTopEnabled;
37 | static boolean mStatusBarBottomEnabled;
38 | static boolean mNavBarTopEnabled;
39 | static boolean mNavBarBottomEnabled;
40 |
41 | public static void handleLoadPackage(final LoadPackageParam lpp, final XSharedPreferences pref) {
42 | if (!lpp.packageName.equals("com.android.systemui")) return;
43 | if (!pref.getBoolean(Common.KEY_BATTERYBAR_ENABLE, Common.DEFAULT_BATTERYBAR_ENABLE))
44 | return;
45 |
46 | mStatusBarTopEnabled = pref.getBoolean(Common.KEYS_BATTERYBAR_POSITION[0],
47 | Common.DEFAULT_BATTERYBAR_POSITION_STATBAR);
48 | mStatusBarBottomEnabled = pref.getBoolean(Common.KEYS_BATTERYBAR_POSITION[3],
49 | Common.DEFAULT_BATTERYBAR_POSITION_NAVBAR);
50 | mNavBarTopEnabled = pref.getBoolean(Common.KEYS_BATTERYBAR_POSITION[1],
51 | Common.DEFAULT_BATTERYBAR_POSITION_NAVBAR);
52 | mNavBarBottomEnabled = pref.getBoolean(Common.KEYS_BATTERYBAR_POSITION[2],
53 | Common.DEFAULT_BATTERYBAR_POSITION_NAVBAR);
54 |
55 | if (mStatusBarTopEnabled || mStatusBarBottomEnabled) {
56 | hookStatusBar(lpp);
57 | }
58 | if (mNavBarTopEnabled || mNavBarBottomEnabled) {
59 | hookNavigationBar(lpp);
60 | }
61 | }
62 |
63 | private static void hookStatusBar(final LoadPackageParam lpp) {
64 | final XC_MethodHook hook = new XC_MethodHook() {
65 | @Override
66 | protected void afterHookedMethod(MethodHookParam param) throws Throwable {
67 | FrameLayout root = (FrameLayout) param.thisObject;
68 | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(
69 | LinearLayout.LayoutParams.MATCH_PARENT, 1);
70 |
71 | if (mStatusBarTopEnabled) {
72 | BatteryBarController battery_bar = new BatteryBarController(root.getContext());
73 | battery_bar.setLayoutParams(params);
74 | battery_bar.setVisibility(View.VISIBLE);
75 | root.addView(battery_bar);
76 | }
77 | if (mStatusBarBottomEnabled) {
78 | FrameLayout.LayoutParams root_param = new FrameLayout.LayoutParams(
79 | FrameLayout.LayoutParams.WRAP_CONTENT,
80 | FrameLayout.LayoutParams.WRAP_CONTENT, Gravity.BOTTOM);
81 | BatteryBarController battery_bar = new BatteryBarController(root.getContext());
82 | battery_bar.setLayoutParams(params);
83 | battery_bar.setVisibility(View.VISIBLE);
84 | root.addView(battery_bar, root_param);
85 | }
86 | }
87 | };
88 |
89 | try {
90 | final Class> phoneStatusBar = XposedHelpers.findClass(
91 | "com.android.systemui.statusbar.phone.PhoneStatusBarView", lpp.classLoader);
92 | XposedBridge.hookAllMethods(phoneStatusBar, "onAttachedToWindow", hook);
93 | } catch (Throwable t) {
94 | XposedBridge.log(t);
95 | }
96 | try {
97 | if (Build.VERSION.SDK_INT < 19) {
98 | // Google removed tablet layouts in kitkat.
99 | final Class> tabletStatusBar = XposedHelpers.findClass(
100 | "com.android.systemui.statusbar.tablet.TabletStatusBarView", lpp.classLoader);
101 | XposedBridge.hookAllMethods(tabletStatusBar, "onAttachedToWindow", hook);
102 | }
103 | } catch (Throwable t) {
104 | XposedBridge.log(t);
105 | }
106 | }
107 |
108 | private static void hookNavigationBar(final LoadPackageParam lpp) {
109 | Class> navBar;
110 | try {
111 | navBar = XposedHelpers.findClass(
112 | "com.android.systemui.statusbar.phone.NavigationBarView", lpp.classLoader);
113 | } catch (Throwable t) {
114 | navBar = XposedHelpers.findClass(
115 | "com.android.systemui.statusbar.NavigationBarView", lpp.classLoader);
116 | }
117 | XposedBridge.hookAllMethods(navBar, "onFinishInflate", new XC_MethodHook() {
118 | @Override
119 | protected void afterHookedMethod(MethodHookParam param) throws Throwable {
120 | final LinearLayout thizz = (LinearLayout) param.thisObject;
121 | final View[] rotated_views = (View[]) XposedHelpers.getObjectField(thizz, "mRotatedViews");
122 |
123 | final FrameLayout portrait = (FrameLayout) rotated_views[Surface.ROTATION_0];
124 | final FrameLayout landscape = (FrameLayout) rotated_views[Surface.ROTATION_90];
125 |
126 | if (mNavBarTopEnabled) {
127 | /* Portrait Top */
128 | BatteryBarController portrait_topbar = new BatteryBarController(thizz.getContext());
129 | portrait_topbar.setLayoutParams(new LinearLayout.LayoutParams(
130 | LinearLayout.LayoutParams.MATCH_PARENT, 1));
131 | portrait_topbar.setVisibility(View.VISIBLE);
132 | portrait.addView(portrait_topbar);
133 |
134 | /* Landscape Top */
135 | BatteryBarController landscape_top_bar = new BatteryBarController(thizz
136 | .getContext());
137 | landscape_top_bar.setLayoutParams(new LinearLayout.LayoutParams(1,
138 | LinearLayout.LayoutParams.MATCH_PARENT));
139 | landscape_top_bar.setVisibility(View.VISIBLE);
140 | landscape.addView(landscape_top_bar);
141 | }
142 |
143 | if (mNavBarBottomEnabled) {
144 | /* Portrait Bottom */
145 | BatteryBarController portrait_bottom_bar = new BatteryBarController(thizz
146 | .getContext());
147 | portrait_bottom_bar.setVisibility(View.VISIBLE);
148 | portrait.addView(portrait_bottom_bar, new FrameLayout.LayoutParams(
149 | FrameLayout.LayoutParams.MATCH_PARENT, 1, Gravity.BOTTOM));
150 |
151 | /* Landscape Bottom */
152 | BatteryBarController landscape_bottom_bar = new BatteryBarController(thizz
153 | .getContext());
154 | landscape_bottom_bar.setVisibility(View.VISIBLE);
155 | landscape.addView(landscape_bottom_bar, new FrameLayout.LayoutParams(1,
156 | FrameLayout.LayoutParams.MATCH_PARENT, Gravity.RIGHT));
157 | }
158 | }
159 | });
160 | }
161 | }
162 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/ClassicRecentsMod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | * Based on source code from SlimRoms, Copyright (C) 2013
4 | * Contains portions from The CyanogenMod Project, Copyright (C) 2012
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.zst.xposed.xuimod.mods;
20 |
21 | import static de.robv.android.xposed.XposedHelpers.findClass;
22 |
23 | import java.lang.reflect.Method;
24 |
25 | import com.zst.xposed.xuimod.Common;
26 |
27 | import android.content.BroadcastReceiver;
28 | import android.content.Context;
29 | import android.content.Intent;
30 | import android.content.IntentFilter;
31 | import de.robv.android.xposed.XC_MethodHook;
32 | import de.robv.android.xposed.XSharedPreferences;
33 | import de.robv.android.xposed.XposedBridge;
34 | import de.robv.android.xposed.XposedHelpers;
35 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
36 |
37 | public class ClassicRecentsMod {
38 |
39 | private static final String ACTION_SHOW_RECENT_APP_DIALOG = Common.MY_PACKAGE_NAME
40 | + ".SHOW_RECENT_APP_DIALOG";
41 |
42 | public static void loadPackage(final LoadPackageParam lp, final XSharedPreferences pref) {
43 | if (!lp.packageName.equals("android")) return;
44 | try {
45 | final Class> phone_window_manager_class = findClass(
46 | "com.android.internal.policy.impl.PhoneWindowManager", lp.classLoader);
47 | final Class> status_bar_class = findClass(
48 | "com.android.server.StatusBarManagerService", lp.classLoader);
49 | hookRecentApps(status_bar_class, pref);
50 | hookForBroadcastReceiver(phone_window_manager_class);
51 | } catch (Throwable t) {
52 | t.printStackTrace();
53 | }
54 | }
55 |
56 | private static void hookRecentApps(final Class> hookClass, final XSharedPreferences pref)
57 | throws Throwable {
58 | XposedBridge.hookAllMethods(hookClass, "toggleRecentApps", new XC_MethodHook() {
59 | @Override
60 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
61 | pref.reload();
62 | if (!pref.getBoolean(Common.KEY_CLASSIC_RECENTS, Common.DEFAULT_CLASSIC_RECENTS)) {
63 | return;
64 | }
65 | final Context ctx = (Context) XposedHelpers.getObjectField(param.thisObject, "mContext");
66 | ctx.sendBroadcast(new Intent(ACTION_SHOW_RECENT_APP_DIALOG));
67 | param.setResult(null);
68 | }
69 | });
70 | }
71 |
72 | /* Register a receiver to call showOrHideRecentAppsDialog() */
73 | private static void hookForBroadcastReceiver(final Class> hookClass) throws Throwable {
74 | XposedBridge.hookAllMethods(hookClass, "init", new XC_MethodHook() {
75 | @Override
76 | protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
77 | try {
78 | final Context context = (Context) param.args[0];
79 | final Method showDialog = param.thisObject.getClass().getDeclaredMethod(
80 | "showOrHideRecentAppsDialog", int.class);
81 | showDialog.setAccessible(true);
82 | final BroadcastReceiver receiver = new BroadcastReceiver() {
83 | @Override
84 | public void onReceive(Context context, Intent intent) {
85 | try {
86 | showDialog.invoke(param.thisObject, (int) 0);
87 | } catch (Exception e) {
88 | e.printStackTrace();
89 | }
90 | }
91 | };
92 | final IntentFilter filter = new IntentFilter();
93 | filter.addAction(ACTION_SHOW_RECENT_APP_DIALOG);
94 | context.registerReceiver(receiver, filter);
95 | } catch (Throwable t) {
96 | t.printStackTrace();
97 | }
98 | }
99 | });
100 | }
101 |
102 | }
103 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/EdgeEffectMod.java:
--------------------------------------------------------------------------------
1 | package com.zst.xposed.xuimod.mods;
2 |
3 | import com.zst.xposed.xuimod.Common;
4 |
5 | import android.graphics.drawable.ColorDrawable;
6 | import android.graphics.drawable.Drawable;
7 | import android.graphics.Color;
8 | import android.graphics.PorterDuff;
9 | import android.widget.EdgeEffect;
10 | import de.robv.android.xposed.XC_MethodHook;
11 | import de.robv.android.xposed.XSharedPreferences;
12 | import de.robv.android.xposed.XposedBridge;
13 | import de.robv.android.xposed.XposedHelpers;
14 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
15 |
16 | public class EdgeEffectMod {
17 |
18 | static XSharedPreferences mPref;
19 |
20 | public static void handleLoadPackage(LoadPackageParam lpparam, XSharedPreferences pref) {
21 | mPref = pref;
22 | hook(lpparam);
23 | }
24 |
25 | private static void hook(LoadPackageParam o) {
26 | XposedBridge.hookAllConstructors(EdgeEffect.class, new XC_MethodHook() {
27 | @Override
28 | protected void afterHookedMethod(final MethodHookParam param) throws Throwable {
29 | mPref.reload();
30 | if (!mPref.getBoolean(Common.KEY_SCROLLING_GLOW_ENABLE,
31 | Common.DEFAULT_SCROLLING_GLOW_ENABLE))
32 | return;
33 |
34 | final Drawable edge = (Drawable) XposedHelpers.getObjectField(param.thisObject, "mEdge");
35 | final Drawable glow = (Drawable) XposedHelpers.getObjectField(param.thisObject, "mGlow");
36 |
37 | if (mPref.getBoolean(Common.KEY_SCROLLING_GLOW_DISABLE,
38 | Common.DEFAULT_SCROLLING_GLOW_DISABLE)) {
39 | //Disable glow by setting transparent color
40 | final Drawable transparent = new ColorDrawable(Color.TRANSPARENT);
41 | XposedHelpers.setObjectField(param.thisObject, "mEdge", transparent);
42 | XposedHelpers.setObjectField(param.thisObject, "mGlow", transparent);
43 | return;
44 | }
45 |
46 | final String str_edge = mPref.getString(Common.KEY_SCROLLING_GLOW_EDGE,
47 | Common.DEFAULT_SCROLLING_GLOW_EDGE);
48 | final String str_glow = mPref.getString(Common.KEY_SCROLLING_GLOW_GLOW,
49 | Common.DEFAULT_SCROLLING_GLOW_GLOW);
50 |
51 | final int edge_color = Common.parseColorFromString(str_edge, Common.COLOR_HOLO_BLUE);
52 | final int glow_color = Common.parseColorFromString(str_glow, Common.COLOR_HOLO_BLUE);
53 |
54 | glow.setColorFilter(ignoreColorAlpha(glow_color), PorterDuff.Mode.SRC_ATOP);
55 | edge.setColorFilter(ignoreColorAlpha(edge_color), PorterDuff.Mode.SRC_ATOP);
56 |
57 | /* When setting a color filter with translucency, the previous color will be
58 | * see through like in layers. We don't want that, so we separate the RGB
59 | * Also, "drawable.setAlpha" has no effect on the glow, it's probably the
60 | * canvas drawing (??) */
61 |
62 | XposedHelpers.setObjectField(param.thisObject, "mEdge", edge);
63 | XposedHelpers.setObjectField(param.thisObject, "mGlow", glow);
64 | }
65 | });
66 | }
67 |
68 | private static int ignoreColorAlpha(int color) {
69 | return Color.argb(255, Color.red(color), Color.green(color), Color.blue(color));
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/LockscreenVolumeMod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zst.xposed.xuimod.mods;
18 |
19 | import static de.robv.android.xposed.XposedHelpers.findClass;
20 | import android.os.Build;
21 | import android.view.KeyEvent;
22 |
23 | import com.zst.xposed.xuimod.Common;
24 |
25 | import de.robv.android.xposed.XC_MethodHook;
26 | import de.robv.android.xposed.XSharedPreferences;
27 | import de.robv.android.xposed.XposedBridge;
28 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
29 |
30 | public class LockscreenVolumeMod {
31 |
32 | protected static XSharedPreferences mPref;
33 |
34 | public static void handleLoadPackage(LoadPackageParam lpparam, XSharedPreferences pref ) {
35 | if (!lpparam.packageName.equals("android") &&
36 | !lpparam.packageName.equals("com.android.keyguard")) return;
37 | // with kitkat, lockscreen is in a different package name (com.android.keyguard)
38 |
39 | mPref = pref;
40 | try {
41 | Lockscreen_Volume_Button(lpparam);
42 | } catch (Throwable t) {
43 | }
44 | }
45 |
46 | private static String getClassStringFromSdk(int sdk) {
47 | switch (sdk) {
48 | case 14:
49 | case 15:
50 | return "com.android.internal.policy.impl.KeyguardViewBase";
51 | /* Ice Cream Sandwich */
52 | case 16:
53 | case 17:
54 | case 18:
55 | return "com.android.internal.policy.impl.keyguard.KeyguardViewManager.ViewManagerHost";
56 | /* Jelly Bean */
57 | case 19:
58 | return "com.android.keyguard.KeyguardViewManager.ViewManagerHost";
59 | /* KitKat */
60 | }
61 | return null;
62 | }
63 |
64 | private static void Lockscreen_Volume_Button(final LoadPackageParam lpparam) {
65 | String classs = getClassStringFromSdk(Build.VERSION.SDK_INT);
66 | Class> hookClass = findClass(classs, lpparam.classLoader);
67 | XposedBridge.hookAllMethods(hookClass, "dispatchKeyEvent", new XC_MethodHook(XC_MethodHook.PRIORITY_HIGHEST){
68 | @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable {
69 | KeyEvent event = (KeyEvent)param.args[0];
70 | if (!isVolume(event))return; //Key is not a volume key. Let system handle
71 | mPref.reload();
72 | if (mPref.getBoolean(Common.KEY_LOCKSCREEN_VOLUME, Common.DEFAULT_LOCKSCREEN_VOLUME)){
73 | param.setResult(Boolean.TRUE);
74 | } // Change return result to TRUE so system knows we are handling it
75 | }
76 | });
77 | }
78 | private static boolean isVolume(KeyEvent event){
79 | if (event.getKeyCode() == KeyEvent.KEYCODE_VOLUME_DOWN) return true;
80 | if (event.getKeyCode() == KeyEvent.KEYCODE_VOLUME_UP) return true;
81 | return false;
82 | }
83 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/RandomQuickSettingsColorMod.java:
--------------------------------------------------------------------------------
1 | package com.zst.xposed.xuimod.mods;
2 |
3 | import static de.robv.android.xposed.XposedHelpers.findClass;
4 |
5 | import java.util.Random;
6 |
7 | import com.zst.xposed.xuimod.Common;
8 |
9 | import android.os.Build;
10 | import android.view.View;
11 | import android.widget.FrameLayout;
12 | import de.robv.android.xposed.XC_MethodHook;
13 | import de.robv.android.xposed.XSharedPreferences;
14 | import de.robv.android.xposed.XposedBridge;
15 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
16 |
17 | public class RandomQuickSettingsColorMod {
18 |
19 | static String[] mColorArray = new String[8];
20 | static boolean mQuickSettingColorEnabled;
21 |
22 | public static void loadPackage(final LoadPackageParam lp, final XSharedPreferences main_pref) {
23 | if (!lp.packageName.equals("com.android.systemui")) return;
24 | if (Build.VERSION.SDK_INT < 17) return;
25 |
26 | mQuickSettingColorEnabled = main_pref.getBoolean(
27 | Common.KEY_NOTIFICATION_RANDOM_QS_TILE_COLOR,
28 | Common.DEFAULT_NOTIFICATION_RANDOM_QS_TILE_COLOR);
29 |
30 | if (!mQuickSettingColorEnabled) return;
31 |
32 | XSharedPreferences random_color_pref = new XSharedPreferences(Common.MY_PACKAGE_NAME,
33 | Common.RANDOM_COLOR_PREFERENCE_FILENAME);
34 | for (int x = 0; x < 8; x++) {
35 | mColorArray[x] = random_color_pref.getString(
36 | Common.RANDOM_COLOR_PREFERENCE_FILENAME + "_" + x, Common.COLOR_HOLO_BLUE);
37 | }
38 |
39 | if (mQuickSettingColorEnabled) {
40 | try {
41 | hookQuickSettingsTileView(lp);
42 | } catch (Throwable e) {
43 | }
44 | }
45 | }
46 |
47 | private static void hookQuickSettingsTileView(final LoadPackageParam lpp) throws Throwable {
48 | final Class> c = findClass("com.android.systemui.statusbar.phone.QuickSettingsTileView",
49 | lpp.classLoader);
50 | XposedBridge.hookAllConstructors(c, new XC_MethodHook() {
51 | @Override
52 | protected void afterHookedMethod(MethodHookParam param) throws Throwable {
53 | setBackgroundStyle((FrameLayout) param.thisObject);
54 | }
55 | });
56 | }
57 |
58 | private static void setBackgroundStyle(View v) {
59 | final String color_str = mColorArray[new Random().nextInt(mColorArray.length)];
60 | final int color = Common.parseColorFromString(color_str, Common.COLOR_HOLO_BLUE);
61 | v.setBackgroundColor(color);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/ScrollerMod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | * Based on source code from AOKP by Steve Spear - Stevespear426, Copyright (C) 2012
4 | * Based on source code by Jason Fry, Copyright (C) 2011
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | /**
20 | * Based on:
21 | *
22 | * (commit)
23 | * https://github.com/IceColdSandwich/android_frameworks_base/commit/
24 | * 28ef92eb671ab18372c89bf24dfd6f8e47598283
25 | *
26 | * (article)
27 | * http://jasonfry.co.uk/blog/android-overscroll-revisited/
28 | */
29 |
30 | package com.zst.xposed.xuimod.mods;
31 |
32 | import com.zst.xposed.xuimod.Common;
33 |
34 | import android.content.Context;
35 | import android.content.res.Configuration;
36 | import android.content.res.Resources;
37 | import android.view.View;
38 | import android.view.ViewConfiguration;
39 | import android.widget.ListView;
40 | import android.widget.ScrollView;
41 | import de.robv.android.xposed.XC_MethodHook;
42 | import de.robv.android.xposed.XSharedPreferences;
43 | import de.robv.android.xposed.XposedBridge;
44 | import de.robv.android.xposed.XposedHelpers;
45 |
46 | public class ScrollerMod {
47 |
48 | static XSharedPreferences mPref;
49 | static float mDensity = -1;
50 |
51 | static final float MULTIPLIER_SCROLL_FRICTION = 10000f;
52 |
53 | public static void handleLoadPackage(XSharedPreferences pref) {
54 | mPref = pref;
55 | hookViewConfiguration(ViewConfiguration.class);
56 | hookScrollbarNoFading(ViewConfiguration.class);
57 | hookOverscrollDistance(ViewConfiguration.class);
58 | hookOverflingDistance(ViewConfiguration.class);
59 | hookMaxFlingVelocity(ViewConfiguration.class);
60 | hookScrollFriction(ViewConfiguration.class);
61 |
62 | // TODO velocity 0 to 100000 / def 8000 // try 2000
63 | // overscroll dist 0 to 1000 / def 0
64 | // overfling dist 0 to 1000 / def 6
65 | // friction * 10000 // 0 to 2000 //def 150 // try 50
66 | }
67 |
68 | private static void hookViewConfiguration(final Class> clazz) {
69 | XposedBridge.hookAllConstructors(clazz, new XC_MethodHook() {
70 | @Override
71 | protected void afterHookedMethod(MethodHookParam param) throws Throwable {
72 | if (param.args == null) return;
73 | // Not null means there's a context for density scaling
74 | Context context = (Context) param.args[0];
75 | final Resources res = context.getResources();
76 | final float density = res.getDisplayMetrics().density;
77 | if (res.getConfiguration().isLayoutSizeAtLeast(
78 | Configuration.SCREENLAYOUT_SIZE_XLARGE)) {
79 | mDensity = density * 1.5f;
80 | } else {
81 | mDensity = density;
82 | }
83 | }
84 | });
85 | }
86 |
87 | private static void hookMaxFlingVelocity(final Class> clazz) {
88 | XposedBridge.hookAllMethods(clazz, "getMaximumFlingVelocity", new XC_MethodHook() {
89 | @Override
90 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
91 | if (!isEnabled()) return;
92 | param.setResult(mPref.getInt(Common.KEY_SCROLLING_VELOCITY,
93 | Common.DEFAULT_SCROLLING_VELOCITY));
94 | }
95 | });
96 |
97 | XposedBridge.hookAllMethods(clazz, "getScaledMaximumFlingVelocity", new XC_MethodHook() {
98 | @Override
99 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
100 | if (!isEnabled()) return;
101 | final int max_velocity = mPref.getInt(Common.KEY_SCROLLING_VELOCITY,
102 | Common.DEFAULT_SCROLLING_VELOCITY);
103 | if (mDensity == -1) {
104 | param.setResult(max_velocity);
105 | } else {
106 | final int scaled_velocity = (int) (mDensity * max_velocity + 0.5f);
107 | param.setResult(scaled_velocity);
108 | }
109 | }
110 | });
111 | }
112 |
113 | private static void hookScrollFriction(final Class> clazz) {
114 | XposedBridge.hookAllMethods(clazz, "getScrollFriction", new XC_MethodHook() {
115 | @Override
116 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
117 | if (!isEnabled()) return;
118 | final int raw_friction = mPref.getInt(Common.KEY_SCROLLING_FRICTION,
119 | Common.DEFAULT_SCROLLING_FRICTION);
120 | final float actual_friction = ((float)raw_friction) / MULTIPLIER_SCROLL_FRICTION;
121 | param.setResult(actual_friction);
122 | }
123 | });
124 | }
125 |
126 | private static void hookOverscrollDistance(final Class> clazz) {
127 | XposedBridge.hookAllMethods(clazz, "getScaledOverscrollDistance", new XC_MethodHook() {
128 | @Override
129 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
130 | if (!isEnabled()) return;
131 | final int overscroll_distance = mPref.getInt(Common.KEY_SCROLLING_OVERSCROLL,
132 | Common.DEFAULT_SCROLLING_OVERSCROLL);
133 | if (mDensity == -1) {
134 | param.setResult(overscroll_distance);
135 | } else {
136 | final int scaled_dist = (int) (mDensity * overscroll_distance + 0.5f);
137 | param.setResult(scaled_dist);
138 | }
139 | }
140 | });
141 | }
142 |
143 | private static void hookOverflingDistance(final Class> clazz) {
144 | XposedBridge.hookAllMethods(clazz, "getScaledOverflingDistance", new XC_MethodHook() {
145 | @Override
146 | protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
147 | if (!isEnabled()) return;
148 | final int overfling = mPref.getInt(Common.KEY_SCROLLING_OVERFLING,
149 | Common.DEFAULT_SCROLLING_OVERFLING);
150 | if (mDensity == -1) {
151 | param.setResult(overfling);
152 | } else {
153 | final int scaled_dist = (int) (mDensity * overfling + 0.5f);
154 | param.setResult(scaled_dist);
155 | }
156 | }
157 | });
158 | }
159 |
160 | private static void hookScrollbarNoFading(final Class> clazz) {
161 | XposedBridge.hookAllConstructors(View.class, new XC_MethodHook() {
162 | @Override
163 | protected void afterHookedMethod(MethodHookParam param) throws Throwable {
164 | if (!(param.thisObject instanceof ScrollView) &&
165 | !(param.thisObject instanceof ListView)) {
166 | // If we set scrollbar for non-scrollable views, we will bootloop
167 | return;
168 | }
169 |
170 | if (!isEnabled()) return;
171 | if (!mPref.getBoolean(Common.KEY_SCROLLING_NO_FADING,
172 | Common.DEFAULT_SCROLLING_NO_FADING)) return;
173 |
174 | final View that = (View) param.thisObject;
175 |
176 | final Object scroll_cache = XposedHelpers
177 | .findField(that.getClass(), "mScrollCache").get(that);
178 | if (scroll_cache == null) return;
179 | // If null, the ScrollView/ListView is not scrollable
180 | // in the first place (poorly written apps)
181 |
182 | final Object scroll_bar_drawable = XposedHelpers.findField(scroll_cache.getClass(),
183 | "scrollBar").get(scroll_cache);
184 | if (scroll_bar_drawable == null) return;
185 | // If null, the ScrollView/ListView is not currently scrollable
186 | // (when screen is big enough to show all contents)
187 | // Don't continue, else the app will have NullPointerException.
188 | // Apparently, Google didn't catch this in the first place
189 |
190 | that.setScrollbarFadingEnabled(false);
191 | }
192 | });
193 |
194 | }
195 |
196 | private static boolean isEnabled() {
197 | mPref.reload();
198 | return mPref.getBoolean(Common.KEY_SCROLLING_ENABLE, Common.DEFAULT_SCROLLING_ENABLE);
199 | }
200 | }
201 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/VolumePanelMod.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zst.xposed.xuimod.mods;
18 |
19 | import static de.robv.android.xposed.XposedHelpers.findClass;
20 | import android.app.Dialog;
21 | import android.os.Handler;
22 | import android.view.Window;
23 | import android.view.WindowManager;
24 |
25 | import com.zst.xposed.xuimod.Common;
26 |
27 | import de.robv.android.xposed.XC_MethodReplacement;
28 | import de.robv.android.xposed.XSharedPreferences;
29 | import de.robv.android.xposed.XposedBridge;
30 | import de.robv.android.xposed.XposedHelpers;
31 | import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
32 |
33 | public class VolumePanelMod {
34 |
35 | protected static XSharedPreferences mPref;
36 | static final int MSG_TIMEOUT = 5; // Constant value from source
37 |
38 | public static void handleLoadPackage(LoadPackageParam lpparam, XSharedPreferences pref) {
39 | if (!lpparam.packageName.equals("android")) return;
40 | mPref=pref;
41 | VolumePanel_Hook(lpparam);
42 | }
43 |
44 |
45 | private static void VolumePanel_Hook(final LoadPackageParam lpparam) {
46 | Class> hookClass = findClass("android.view.VolumePanel", lpparam.classLoader);
47 | /* When Volume Button is pressed, Volume Panel shows up.
48 | * Handler shows Volume Panel then calls "resetTimeout"
49 | * to close the Volume Panel after 3 seconds(default)
50 | */
51 | XposedBridge.hookAllMethods(hookClass, "resetTimeout", new XC_MethodReplacement(){
52 | @Override
53 | protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
54 | mPref.reload();
55 | Handler h = (Handler) param.thisObject;
56 |
57 | try {
58 | Dialog mDialog = (Dialog) XposedHelpers.getObjectField(h, "mDialog");
59 | Window window = mDialog.getWindow();
60 | /* Set Transparency */
61 | WindowManager.LayoutParams lp = window.getAttributes();
62 | lp.alpha = (getAlphaInDecimal(mPref));
63 | window.setAttributes(lp);
64 | } catch (Throwable t) {
65 | // If we cannot find mDialog, nevermind, make the timeout mod continue.
66 | }
67 |
68 | /* Set Timeout */
69 | h.removeMessages(MSG_TIMEOUT); // Code from source
70 | h.sendMessageDelayed(h.obtainMessage(MSG_TIMEOUT), getTimeout(mPref));
71 |
72 | return null;
73 | }
74 | });
75 | }
76 |
77 | private static int getTimeout(XSharedPreferences pref){
78 | try{
79 | String timeString = pref.getString(Common.KEY_VOLUME_TIMEOUT, Common.DEFAULT_VOLUME_TIMEOUT);
80 | timeString = timeString.replaceAll( "[^\\d]", "" ); //Remove all non-numeric characters
81 | int timeInt = Integer.parseInt(timeString);
82 | return timeInt;
83 | }catch(Exception e){ //If timeout string is empty, it throws exception.
84 | return Integer.parseInt(Common.DEFAULT_VOLUME_TIMEOUT);
85 | }
86 | }
87 |
88 | private static float getAlphaInDecimal(XSharedPreferences pref) {
89 | final int percentage = pref.getInt(Common.KEY_VOLUME_ALPHA, Common.DEFAULT_VOLUME_ALPHA);
90 | return (percentage * 0.01f);
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/animation/AppTransitionConstants.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2011 The Android Open Source Project
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.zst.xposed.xuimod.mods.animation;
17 |
18 | /*
19 | * This class contains all the constants from AppTransition.java from Android 4.3
20 | * Directly copied from source
21 | */
22 | public class AppTransitionConstants {
23 |
24 | /** Bit mask that is set for all enter transition. */
25 | public static final int TRANSIT_ENTER_MASK = 0x1000;
26 |
27 | /** Bit mask that is set for all exit transitions. */
28 | public static final int TRANSIT_EXIT_MASK = 0x2000;
29 |
30 | /** Not set up for a transition. */
31 | public static final int TRANSIT_UNSET = -1;
32 | /** No animation for transition. */
33 | public static final int TRANSIT_NONE = 0;
34 | /** A window in a new activity is being opened on top of an existing one in the same task. */
35 | public static final int TRANSIT_ACTIVITY_OPEN = 6 | TRANSIT_ENTER_MASK;
36 | /** The window in the top-most activity is being closed to reveal the
37 | * previous activity in the same task. */
38 | public static final int TRANSIT_ACTIVITY_CLOSE = 7 | TRANSIT_EXIT_MASK;
39 | /** A window in a new task is being opened on top of an existing one
40 | * in another activity's task. */
41 | public static final int TRANSIT_TASK_OPEN = 8 | TRANSIT_ENTER_MASK;
42 | /** A window in the top-most activity is being closed to reveal the
43 | * previous activity in a different task. */
44 | public static final int TRANSIT_TASK_CLOSE = 9 | TRANSIT_EXIT_MASK;
45 | /** A window in an existing task is being displayed on top of an existing one
46 | * in another activity's task. */
47 | public static final int TRANSIT_TASK_TO_FRONT = 10 | TRANSIT_ENTER_MASK;
48 | /** A window in an existing task is being put below all other tasks. */
49 | public static final int TRANSIT_TASK_TO_BACK = 11 | TRANSIT_EXIT_MASK;
50 | /** A window in a new activity that doesn't have a wallpaper is being opened on top of one that
51 | * does, effectively closing the wallpaper. */
52 | public static final int TRANSIT_WALLPAPER_CLOSE = 12 | TRANSIT_EXIT_MASK;
53 | /** A window in a new activity that does have a wallpaper is being opened on one that didn't,
54 | * effectively opening the wallpaper. */
55 | public static final int TRANSIT_WALLPAPER_OPEN = 13 | TRANSIT_ENTER_MASK;
56 | /** A window in a new activity is being opened on top of an existing one, and both are on top
57 | * of the wallpaper. */
58 | public static final int TRANSIT_WALLPAPER_INTRA_OPEN = 14 | TRANSIT_ENTER_MASK;
59 | /** The window in the top-most activity is being closed to reveal the previous activity, and
60 | * both are on top of the wallpaper. */
61 | public static final int TRANSIT_WALLPAPER_INTRA_CLOSE = 15 | TRANSIT_EXIT_MASK;
62 |
63 | public static final int NEXT_TRANSIT_TYPE_NONE = 0;
64 | public static final int NEXT_TRANSIT_TYPE_CUSTOM = 1;
65 | public static final int NEXT_TRANSIT_TYPE_SCALE_UP = 2;
66 | public static final int NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_UP = 3;
67 | public static final int NEXT_TRANSIT_TYPE_THUMBNAIL_SCALE_DOWN = 4;
68 | }
69 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/animation/AwesomeAnimationHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 AOKP by Steve Spear - Stevespear426
3 | * This code has been modified. Portions copyright (C) 2013, XuiMod.
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.zst.xposed.xuimod.mods.animation;
19 |
20 | import java.util.ArrayList;
21 | import java.util.Random;
22 |
23 | import android.content.Context;
24 | import android.content.res.Resources;
25 | import android.view.animation.AnimationUtils;
26 | import android.view.animation.Interpolator;
27 |
28 | import com.zst.xposed.xuimod.R;
29 |
30 | public class AwesomeAnimationHelper {
31 |
32 | public static final int INTERPOLATOR_NONE = 0;
33 | public static final int INTERPOLATOR_ACCELERATE = 1;
34 | public static final int INTERPOLATOR_DECELERATE = 2;
35 | public static final int INTERPOLATOR_ACCELERATE_DECELERATE = 3;
36 | public static final int INTERPOLATOR_ANTICIPATE = 4;
37 | public static final int INTERPOLATOR_OVERSHOOT = 5;
38 | public static final int INTERPOLATOR_ANTICIPATE_OVERSHOOT = 6;
39 | public static final int INTERPOLATOR_BOUNCE = 7;
40 | public static final int INTERPOLATOR_CYCLE = 8;
41 | public static final int INTERPOLATOR_LINEAR = 9;
42 |
43 | public final static int ANIMATION_RANDOM = -1;
44 | public final static int ANIMATION_DEFAULT = 0;
45 | public final static int ANIMATION_FADE = 1;
46 | public final static int ANIMATION_SLIDE_RIGHT = 2;
47 | public final static int ANIMATION_SLIDE_LEFT = 3;
48 | public final static int ANIMATION_SLIDE_RIGHT_NO_FADE = 4;
49 | public final static int ANIMATION_SLIDE_LEFT_NO_FADE = 5;
50 | public final static int ANIMATION_SLIDE_UP = 6;
51 | public final static int ANIMATION_SLIDE_DOWN = 7;
52 | public final static int ANIMATION_TRANSLUCENT = 8;
53 | public final static int ANIMATION_GROW_SHRINK = 9;
54 | public final static int ANIMATION_GROW_SHRINK_CENTER = 10;
55 | public final static int ANIMATION_GROW_SHRINK_BOTTOM = 11;
56 | public final static int ANIMATION_GROW_SHRINK_LEFT = 12;
57 | public final static int ANIMATION_GROW_SHRINK_RIGHT = 13;
58 |
59 | public static int[] getAnimationsList() {
60 | ArrayList animList = new ArrayList();
61 | animList.add(ANIMATION_DEFAULT);
62 | animList.add(ANIMATION_FADE);
63 | animList.add(ANIMATION_SLIDE_RIGHT);
64 | animList.add(ANIMATION_SLIDE_LEFT);
65 | animList.add(ANIMATION_SLIDE_RIGHT_NO_FADE);
66 | animList.add(ANIMATION_SLIDE_LEFT_NO_FADE);
67 | animList.add(ANIMATION_SLIDE_UP);
68 | animList.add(ANIMATION_SLIDE_DOWN);
69 | animList.add(ANIMATION_TRANSLUCENT);
70 | animList.add(ANIMATION_GROW_SHRINK);
71 | animList.add(ANIMATION_GROW_SHRINK_CENTER);
72 | animList.add(ANIMATION_GROW_SHRINK_BOTTOM);
73 | animList.add(ANIMATION_GROW_SHRINK_LEFT);
74 | animList.add(ANIMATION_GROW_SHRINK_RIGHT);
75 | int length = animList.size();
76 | int[] anim = new int[length];
77 | for (int i = 0; i < length; i++) {
78 | anim[i] = animList.get(i);
79 | }
80 | return anim;
81 | }
82 |
83 | public static int[] getAnimations(int mAnim) {
84 | if (mAnim == ANIMATION_RANDOM){
85 | mAnim = (new Random()).nextInt(14);
86 | // Random number from 0 to 13
87 | }
88 | int[] anim = new int[2];
89 | switch (mAnim) {
90 | case ANIMATION_FADE:
91 | anim[0] = R.anim.animcontrol_slow_fade_out;
92 | anim[1] = R.anim.animcontrol_slow_fade_in;
93 | break;
94 | case ANIMATION_SLIDE_RIGHT:
95 | anim[0] = R.anim.animcontrol_slide_out_right_ribbon;
96 | anim[1] = R.anim.animcontrol_slide_in_right_ribbon;
97 | break;
98 | case ANIMATION_SLIDE_LEFT:
99 | anim[0] = R.anim.animcontrol_slide_out_left_ribbon;
100 | anim[1] = R.anim.animcontrol_slide_in_left_ribbon;
101 | break;
102 | case ANIMATION_SLIDE_UP:
103 | anim[0] = R.anim.animcontrol_slide_out_down_ribbon;
104 | anim[1] = R.anim.animcontrol_slide_in_up_ribbon;
105 | break;
106 | case ANIMATION_SLIDE_DOWN:
107 | anim[0] = R.anim.animcontrol_slide_out_up;
108 | anim[1] = R.anim.animcontrol_slide_in_down;
109 | break;
110 | case ANIMATION_SLIDE_RIGHT_NO_FADE:
111 | anim[0] = R.anim.animcontrol_slide_out_right_no_fade;
112 | anim[1] = R.anim.animcontrol_slide_in_right_no_fade;
113 | break;
114 | case ANIMATION_SLIDE_LEFT_NO_FADE:
115 | anim[0] = R.anim.animcontrol_slide_out_left_no_fade;
116 | anim[1] = R.anim.animcontrol_slide_in_left_no_fade;
117 | break;
118 | case ANIMATION_TRANSLUCENT:
119 | anim[0] = R.anim.animcontrol_translucent_exit_ribbon;
120 | anim[1] = R.anim.animcontrol_translucent_enter_ribbon;
121 | break;
122 | case ANIMATION_GROW_SHRINK:
123 | anim[0] = R.anim.animcontrol_shrink_fade_out_ribbon;
124 | anim[1] = R.anim.animcontrol_grow_fade_in_ribbon;
125 | break;
126 | case ANIMATION_GROW_SHRINK_CENTER:
127 | anim[0] = R.anim.animcontrol_shrink_fade_out_center_ribbon;
128 | anim[1] = R.anim.animcontrol_grow_fade_in_center_ribbon;
129 | break;
130 | case ANIMATION_GROW_SHRINK_LEFT:
131 | anim[0] = R.anim.animcontrol_shrink_fade_out_left_ribbon;
132 | anim[1] = R.anim.animcontrol_grow_fade_in_left_ribbon;
133 | break;
134 | case ANIMATION_GROW_SHRINK_RIGHT:
135 | anim[0] = R.anim.animcontrol_shrink_fade_out_right_ribbon;
136 | anim[1] = R.anim.animcontrol_grow_fade_in_right_ribbon;
137 | break;
138 | case ANIMATION_GROW_SHRINK_BOTTOM:
139 | anim[0] = R.anim.animcontrol_shrink_fade_out_from_bottom_ribbon;
140 | anim[1] = R.anim.animcontrol_grow_fade_in_from_bottom_ribbon;
141 | break;
142 | }
143 | return anim;
144 | }
145 |
146 | public static String getProperName(Resources res, int index) {
147 | String[] str = res.getStringArray(R.array.anim_controls_entries);
148 | if (index == ANIMATION_RANDOM){
149 | index = str.length - 1;
150 | }
151 | return str[index];
152 | }
153 |
154 | public static Interpolator getInterpolator(Context c, int index) {
155 | Interpolator itplr = null;
156 | switch(index) {
157 | case INTERPOLATOR_ACCELERATE:
158 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.accelerate_interpolator);
159 | break;
160 | case INTERPOLATOR_DECELERATE:
161 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.decelerate_interpolator);
162 | break;
163 | case INTERPOLATOR_ACCELERATE_DECELERATE:
164 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.accelerate_decelerate_interpolator);
165 | break;
166 | case INTERPOLATOR_ANTICIPATE:
167 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.anticipate_interpolator);
168 | break;
169 | case INTERPOLATOR_OVERSHOOT:
170 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.overshoot_interpolator);
171 | break;
172 | case INTERPOLATOR_ANTICIPATE_OVERSHOOT:
173 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.anticipate_overshoot_interpolator);
174 | break;
175 | case INTERPOLATOR_BOUNCE:
176 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.bounce_interpolator);
177 | break;
178 | case INTERPOLATOR_CYCLE:
179 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.cycle_interpolator);
180 | break;
181 | case INTERPOLATOR_LINEAR:
182 | itplr = AnimationUtils.loadInterpolator(c, android.R.anim.linear_interpolator);
183 | break;
184 | }
185 | return itplr;
186 | }
187 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/animation/InputMethodAnimationHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zst.xposed.xuimod.mods.animation;
18 |
19 | import java.util.Random;
20 |
21 | import com.zst.xposed.xuimod.R;
22 |
23 | public class InputMethodAnimationHelper {
24 |
25 | public final static int ANIMATION_RANDOM = -1;
26 | public final static int ANIMATION_DEFAULT = 0;
27 | public final static int ANIMATION_FANCY = 14;
28 | public final static int ANIMATION_TN = 15;
29 | public final static int ANIMATION_XYLON = 16;
30 |
31 | public static int[] getAnimationInt(int index) {
32 | int[] anim = new int[2];
33 | if (index == ANIMATION_RANDOM) {
34 | index = (new Random()).nextInt(18);
35 | // Random from 0 to 17
36 | }
37 |
38 | switch (index) {
39 | case ANIMATION_DEFAULT:
40 | break;
41 |
42 | case ANIMATION_FANCY:
43 | anim[0] = R.anim.xylon_input_method_fancy_exit;
44 | anim[1] = R.anim.xylon_input_method_fancy_enter;
45 | break;
46 |
47 | case ANIMATION_TN:
48 | anim[0] = R.anim.tn_input_method_exit;
49 | anim[1] = R.anim.tn_input_method_enter;
50 | break;
51 |
52 | case ANIMATION_XYLON:
53 | anim[0] = R.anim.xylon_input_method_exit;
54 | anim[1] = R.anim.xylon_input_method_enter;
55 | break;
56 |
57 | default:
58 | anim = AwesomeAnimationHelper.getAnimations(index);
59 | }
60 | return anim;
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/animation/ToastAnimationHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2014 XuiMod
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zst.xposed.xuimod.mods.animation;
18 |
19 | import java.util.Random;
20 | import com.zst.xposed.xuimod.R;
21 |
22 | public class ToastAnimationHelper {
23 |
24 | public final static int ANIMATION_RANDOM = -1;
25 | public final static int ANIMATION_DEFAULT = 0;
26 | public final static int ANIMATION_TOKO = 14;
27 | public final static int ANIMATION_TN = 15;
28 | public final static int ANIMATION_XYLON = 16;
29 | public final static int ANIMATION_Z1 = 17;
30 |
31 | public static int[] getAnimationInt(int index) {
32 | int[] anim = new int[2];
33 | if (index == ANIMATION_RANDOM) {
34 | index = (new Random()).nextInt(18);
35 | // Random from 0 to 17
36 | }
37 |
38 | switch (index) {
39 | case ANIMATION_DEFAULT:
40 | break;
41 |
42 | case ANIMATION_TOKO:
43 | anim[0] = R.anim.toko_toast_exit;
44 | anim[1] = R.anim.toko_toast_enter;
45 | break;
46 |
47 | case ANIMATION_TN:
48 | anim[0] = R.anim.tn_toast_exit;
49 | anim[1] = R.anim.tn_toast_enter;
50 | break;
51 |
52 | case ANIMATION_XYLON:
53 | anim[0] = R.anim.xylon_toast_exit;
54 | anim[1] = R.anim.xylon_toast_enter;
55 | break;
56 |
57 | case ANIMATION_Z1:
58 | anim[0] = R.anim.honami_toast_exit;
59 | anim[1] = R.anim.honami_toast_enter;
60 | break;
61 |
62 | default:
63 | anim = AwesomeAnimationHelper.getAnimations(index);
64 | }
65 | return anim;
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/mods/batterybar/BatteryBarController.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | * Based on source obtained from the PACman Project, Copyright (C) 2012
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.zst.xposed.xuimod.mods.batterybar;
19 |
20 | import com.zst.xposed.xuimod.Common;
21 |
22 | import de.robv.android.xposed.XSharedPreferences;
23 | import android.content.BroadcastReceiver;
24 | import android.content.Context;
25 | import android.content.Intent;
26 | import android.content.IntentFilter;
27 | import android.content.res.Configuration;
28 | import android.os.BatteryManager;
29 | import android.util.AttributeSet;
30 | import android.util.DisplayMetrics;
31 | import android.view.View;
32 | import android.view.ViewGroup;
33 | import android.widget.LinearLayout;
34 |
35 | public class BatteryBarController extends LinearLayout {
36 |
37 | private static XSharedPreferences mPref;
38 | private static int LAST_BATTERY_LEVEL = 0;
39 |
40 | BatteryBarView mainBar;
41 | BatteryBarView alternateStyleBar;
42 |
43 | public static final int STYLE_UNKNOWN = -1;
44 | public static final int STYLE_REGULAR = 0;
45 | public static final int STYLE_SYMMETRIC = 1;
46 |
47 | int mStyle = STYLE_UNKNOWN;
48 | private int mBatteryLevel = 0;
49 | private boolean mBatteryCharging = false;
50 |
51 | boolean isAttached = false;
52 | boolean isVertical = false;
53 |
54 | public BatteryBarController(Context context) {
55 | this(context, null);
56 | }
57 |
58 | public BatteryBarController(Context context, AttributeSet attrs) {
59 | super(context, attrs);
60 | mPref = new XSharedPreferences(Common.MY_PACKAGE_NAME);
61 | }
62 |
63 | @Override
64 | protected void onAttachedToWindow() {
65 | super.onAttachedToWindow();
66 | if (!isAttached) {
67 | isVertical = (getLayoutParams().height == LayoutParams.MATCH_PARENT);
68 |
69 | isAttached = true;
70 | IntentFilter filter = new IntentFilter();
71 | filter.addAction(Intent.ACTION_BATTERY_CHANGED);
72 | filter.addAction(Common.ACTION_SETTINGS_CHANGED);
73 |
74 | getContext().registerReceiver(mIntentReceiver, filter);
75 |
76 | updateSettings();
77 | }
78 | }
79 |
80 | private final BroadcastReceiver mIntentReceiver = new BroadcastReceiver() {
81 | @Override
82 | public void onReceive(Context context, Intent intent) {
83 | String action = intent.getAction();
84 |
85 | if (Intent.ACTION_BATTERY_CHANGED.equals(action)) {
86 | mBatteryLevel = intent.getIntExtra(BatteryManager.EXTRA_LEVEL,
87 | 0);
88 | mBatteryCharging = intent.getIntExtra(
89 | BatteryManager.EXTRA_STATUS, 0) == BatteryManager.BATTERY_STATUS_CHARGING;
90 | LAST_BATTERY_LEVEL = mBatteryLevel;
91 | } else if (Common.ACTION_SETTINGS_CHANGED.equals(action)) {
92 | XSharedPreferences pref = new XSharedPreferences(Common.MY_PACKAGE_NAME);
93 | boolean enabled = pref.getBoolean(Common.KEY_BATTERYBAR_ENABLE,
94 | Common.DEFAULT_BATTERYBAR_ENABLE);
95 | if (enabled){
96 | updateSettings();
97 | }else{
98 | removeBars();
99 | mStyle = STYLE_UNKNOWN;
100 | // Reset the style so oldStyle isn't the same
101 | }
102 | }
103 | }
104 | };
105 |
106 | @Override
107 | protected void onConfigurationChanged(Configuration newConfig) {
108 | super.onConfigurationChanged(newConfig);
109 | if (isAttached) {
110 | getHandler().postDelayed(new Runnable() {
111 | @Override
112 | public void run() {
113 | updateSettings();
114 | }
115 | }, 500);
116 |
117 | }
118 | }
119 |
120 | public void setHeight(int pixels) {
121 | ViewGroup.LayoutParams params = (ViewGroup.LayoutParams) getLayoutParams();
122 |
123 | if (isVertical) {
124 | params.width = pixels;
125 | } else {
126 | params.height = pixels;
127 | }
128 | setLayoutParams(params);
129 | }
130 |
131 | public void addBar() {
132 | setOrientation(LinearLayout.HORIZONTAL);
133 | LayoutParams ll = new LinearLayout.LayoutParams(
134 | LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 1);
135 |
136 | mBatteryLevel = LAST_BATTERY_LEVEL;
137 | if (mStyle == STYLE_REGULAR) {
138 | mainBar = new BatteryBarView(getContext(),
139 | mBatteryCharging, mBatteryLevel, isVertical);
140 | alternateStyleBar = null;
141 |
142 | addView(mainBar, ll);
143 | } else if (mStyle == STYLE_SYMMETRIC) {
144 | mainBar = new BatteryBarView(getContext(),
145 | mBatteryCharging, mBatteryLevel, isVertical);
146 | alternateStyleBar = new BatteryBarView(getContext(),
147 | mBatteryCharging, mBatteryLevel, isVertical);
148 |
149 | if (isVertical) {
150 | setOrientation(LinearLayout.VERTICAL);
151 | alternateStyleBar.setRotation(180);
152 | addView(alternateStyleBar, ll);
153 | addView(mainBar, ll);
154 | } else {
155 | mainBar.setRotation(180);
156 | addView(mainBar, ll);
157 | addView(alternateStyleBar, ll);
158 | }
159 | }
160 | }
161 |
162 | public int getSettingsHeight(XSharedPreferences pref) {
163 | DisplayMetrics metrics = getContext().getResources()
164 | .getDisplayMetrics();
165 | float dp = (float) pref.getInt(Common.KEY_BATTERYBAR_HEIGHT,
166 | Common.DEFAULT_BATTERYBAR_HEIGHT);
167 | return (int) ((metrics.density * dp) + 0.5);
168 | }
169 |
170 | public void removeBars() {
171 | removeAllViews();
172 | }
173 |
174 | public void updateSettings() {
175 | int oldStyle = mStyle;
176 | mPref.reload();
177 | mStyle = mPref.getBoolean(Common.KEY_BATTERYBAR_STYLE,
178 | Common.DEFAULT_BATTERYBAR_STYLE) ? STYLE_SYMMETRIC
179 | : STYLE_REGULAR;
180 | setHeight(getSettingsHeight(mPref));
181 |
182 | if (oldStyle == mStyle) return;
183 |
184 | removeBars();
185 | addBar();
186 | setVisibility(View.VISIBLE);
187 | }
188 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/BarHeight.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | * Copyright (C) 2013 Dzakus
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.zst.xposed.xuimod.preference;
19 |
20 | import com.zst.xposed.xuimod.Common;
21 | import com.zst.xposed.xuimod.R;
22 | import static com.zst.xposed.xuimod.Common.KEY_BATTERYBAR_HEIGHT;
23 | import static com.zst.xposed.xuimod.Common.DEFAULT_BATTERYBAR_HEIGHT;
24 | import static com.zst.xposed.xuimod.Common.LIMIT_MAX_BATTERYBAR_HEIGHT;
25 | import static com.zst.xposed.xuimod.Common.LIMIT_MIN_BATTERYBAR_HEIGHT;
26 |
27 | import android.app.AlertDialog;
28 | import android.content.Context;
29 | import android.content.DialogInterface;
30 | import android.content.SharedPreferences;
31 | import android.content.SharedPreferences.Editor;
32 | import android.graphics.Color;
33 | import android.os.Bundle;
34 | import android.preference.DialogPreference;
35 | import android.util.AttributeSet;
36 | import android.view.View;
37 | import android.widget.Button;
38 | import android.widget.SeekBar;
39 | import android.widget.TextView;
40 |
41 | public class BarHeight extends DialogPreference implements
42 | SeekBar.OnSeekBarChangeListener {
43 |
44 | private View mLine;
45 | private SeekBar mSeekBar;
46 | private TextView mValue;
47 |
48 | public BarHeight(Context context, AttributeSet attrs) {
49 | super(context, attrs);
50 |
51 | setDialogLayoutResource(R.layout.pref_bar_height);
52 | }
53 |
54 | @Override
55 | protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
56 | builder.setNeutralButton(R.string.settings_default,
57 | new DialogInterface.OnClickListener() {
58 | @Override
59 | public void onClick(DialogInterface dialog, int which) {
60 | }
61 | });
62 | }
63 |
64 | @Override
65 | protected void onBindDialogView(View view) {
66 | super.onBindDialogView(view);
67 |
68 | mLine = (View) view.findViewById(R.id.line);
69 | mValue = (TextView) view.findViewById(R.id.value);
70 | mSeekBar = (SeekBar) view.findViewById(R.id.seekbar);
71 | mSeekBar.setOnSeekBarChangeListener(this);
72 | }
73 |
74 | @Override
75 | protected void showDialog(Bundle state) {
76 | super.showDialog(state);
77 |
78 | // can't use onPrepareDialogBuilder for this as we want the dialog
79 | // to be kept open on click
80 | AlertDialog d = (AlertDialog) getDialog();
81 | Button defaultsButton = d.getButton(DialogInterface.BUTTON_NEUTRAL);
82 | defaultsButton.setOnClickListener(new View.OnClickListener() {
83 | @Override
84 | public void onClick(View v) {
85 | mSeekBar.setProgress(DEFAULT_BATTERYBAR_HEIGHT-LIMIT_MIN_BATTERYBAR_HEIGHT);
86 | }
87 | });
88 |
89 | final SharedPreferences prefs = getSharedPreferences();
90 |
91 | int value = prefs.getInt(KEY_BATTERYBAR_HEIGHT, DEFAULT_BATTERYBAR_HEIGHT);
92 | value -= LIMIT_MIN_BATTERYBAR_HEIGHT;
93 |
94 | mSeekBar.setMax(LIMIT_MAX_BATTERYBAR_HEIGHT - LIMIT_MIN_BATTERYBAR_HEIGHT);
95 | mSeekBar.setProgress(value);
96 |
97 | String colorString = prefs.getString(Common.KEY_BATTERYBAR_COLOR_100, Common.DEFAULT_BATTERYBAR_COLOR);
98 | mLine.setBackgroundColor(parseLineColor(colorString));
99 | }
100 |
101 | public int parseLineColor(String colorString) {
102 | try{
103 | return Color.parseColor(colorString);
104 | }catch(Throwable t){ //Error parsing color, try removing non-numeric characters
105 | try{
106 | colorString = colorString.replaceAll( "[^\\d]", "" ); //Remove non-numeric characters
107 | return Color.parseColor("#" + colorString);
108 | }catch(Throwable t1){ // Error parsing the string. Use default anyway.
109 | return 0xFF33B5E5;
110 | }
111 | }
112 | }
113 |
114 | @Override
115 | protected void onDialogClosed(boolean positiveResult) {
116 | super.onDialogClosed(positiveResult);
117 |
118 | if (positiveResult) {
119 | int realValue = mSeekBar.getProgress() + LIMIT_MIN_BATTERYBAR_HEIGHT;
120 | Editor editor = getEditor();
121 | editor.putInt(KEY_BATTERYBAR_HEIGHT, realValue);
122 | editor.commit();
123 |
124 | }
125 | }
126 |
127 | @Override
128 | public void onProgressChanged(SeekBar seekBar, int progress,
129 | boolean fromUser) {
130 | int realValue = progress + LIMIT_MIN_BATTERYBAR_HEIGHT;
131 |
132 | mLine.setMinimumHeight(realValue);
133 | mValue.setText(realValue + "dp");
134 | }
135 |
136 | @Override
137 | public void onStartTrackingTouch(SeekBar seekBar) {
138 | // TODO Auto-generated method stub
139 | }
140 |
141 | @Override
142 | public void onStopTrackingTouch(SeekBar seekBar) {
143 | // TODO Auto-generated method stub
144 | }
145 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/ColorPicker.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | * Copyright (C) 2012 The CyanogenMod Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.zst.xposed.xuimod.preference;
19 |
20 | import com.zst.xposed.xuimod.Common;
21 | import com.zst.xposed.xuimod.R;
22 | import com.zst.xposed.xuimod.preference.colorpicker.ColorSettingsDialog;
23 |
24 | import android.app.AlertDialog;
25 | import android.content.Context;
26 | import android.content.DialogInterface;
27 | import android.content.SharedPreferences;
28 | import android.content.res.Resources;
29 | import android.preference.Preference;
30 | import android.preference.Preference.OnPreferenceClickListener;
31 | import android.util.AttributeSet;
32 | import android.view.View;
33 | import android.widget.ImageView;
34 |
35 | public class ColorPicker extends Preference implements OnPreferenceClickListener {
36 |
37 | SharedPreferences mPref;
38 | ImageView mColorBox;
39 | Resources mRes;
40 | String mDefaultColor;
41 | boolean mHideAlpha;
42 |
43 | public ColorPicker(Context context, AttributeSet attrs) {
44 | super(context, attrs);
45 |
46 | mDefaultColor = attrs.getAttributeValue(null, "defaultValue");
47 | if (attrs.getAttributeValue(null, "hideAlpha") != null) {
48 | mHideAlpha = true;
49 | }
50 | }
51 |
52 | @Override
53 | protected void onBindView(View view) {
54 | super.onBindView(view);
55 | mColorBox = (ImageView) view.findViewById(android.R.id.icon);
56 | mPref = getPreferenceManager().getSharedPreferences();
57 | mRes = getContext().getResources();
58 | setOnPreferenceClickListener(this);
59 | refreshColorBox();
60 | }
61 |
62 | @Override
63 | public boolean onPreferenceClick(Preference arg0) {
64 | final ColorSettingsDialog d = new ColorSettingsDialog(getContext(), getColor(), mDefaultColor);
65 | d.setAlphaSliderVisible(!mHideAlpha);
66 | final DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
67 | @Override
68 | public void onClick(DialogInterface dialog, int which) {
69 | switch (which){
70 | case AlertDialog.BUTTON_POSITIVE:
71 | setColor(d.getColorString());
72 | break;
73 | case AlertDialog.BUTTON_NEUTRAL:
74 | setColor(mDefaultColor);
75 | break;
76 | }
77 | Common.settingsChanged(getContext());
78 | }
79 | };
80 | d.setButton(AlertDialog.BUTTON_POSITIVE, mRes.getString(android.R.string.ok), listener);
81 | d.setButton(AlertDialog.BUTTON_NEUTRAL, mRes.getString(R.string.settings_default), listener);
82 | d.setButton(AlertDialog.BUTTON_NEGATIVE, mRes.getString(android.R.string.cancel), listener);
83 | d.show();
84 | return true;
85 | }
86 |
87 | public String getColorString() {
88 | return Integer.toHexString(getColor());
89 | }
90 |
91 | public int getColor() {
92 | String str = mPref.getString(getKey(), mDefaultColor);
93 | return Common.parseColorFromString(str, mDefaultColor);
94 | }
95 |
96 | private void refreshColorBox(){
97 | if (mColorBox != null) {
98 | mColorBox.setBackgroundColor(getColor());
99 | mColorBox.setVisibility(View.VISIBLE);
100 | }
101 | }
102 | public void setColor(String clr) {
103 | mPref.edit().putString(getKey(), clr).commit();
104 | refreshColorBox();
105 | }
106 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/SeekBarDialog.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | * Copyright (C) 2013 Dzakus
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.zst.xposed.xuimod.preference;
19 |
20 | import com.zst.xposed.xuimod.R;
21 |
22 | import android.app.AlertDialog;
23 | import android.content.Context;
24 | import android.content.DialogInterface;
25 | import android.content.SharedPreferences;
26 | import android.content.SharedPreferences.Editor;
27 | import android.os.Bundle;
28 | import android.preference.DialogPreference;
29 | import android.util.AttributeSet;
30 | import android.view.View;
31 | import android.widget.Button;
32 | import android.widget.SeekBar;
33 | import android.widget.TextView;
34 |
35 | public class SeekBarDialog extends DialogPreference implements SeekBar.OnSeekBarChangeListener {
36 |
37 | private SeekBar mSeekBar;
38 | private TextView mValue;
39 |
40 | private String mKey = "";
41 | private String mSuffix = "";
42 | private int mMin;
43 | private int mMax;
44 | private int mDefault;
45 |
46 | public SeekBarDialog(Context context, AttributeSet attrs) {
47 | super(context, attrs);
48 |
49 | setDialogLayoutResource(R.layout.pref_seekbar);
50 | mDefault = Integer.parseInt(attrs.getAttributeValue(null, "defaultValue"));
51 | mMin = Integer.parseInt(attrs.getAttributeValue(null, "minimum"));
52 | mMax = Integer.parseInt(attrs.getAttributeValue(null, "maximum"));
53 | mSuffix = attrs.getAttributeValue(null, "suffix");
54 | }
55 |
56 | @Override
57 | protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
58 | builder.setNeutralButton(R.string.settings_default, new DialogInterface.OnClickListener() {
59 | @Override
60 | public void onClick(DialogInterface dialog, int which) {
61 | }
62 | });
63 | }
64 |
65 | @Override
66 | protected void onBindDialogView(View view) {
67 | super.onBindDialogView(view);
68 |
69 | mValue = (TextView) view.findViewById(R.id.value);
70 | mSeekBar = (SeekBar) view.findViewById(R.id.seekbar);
71 | mSeekBar.setOnSeekBarChangeListener(this);
72 | }
73 |
74 | @Override
75 | protected void showDialog(Bundle state) {
76 | super.showDialog(state);
77 |
78 | // can't use onPrepareDialogBuilder for this as we want the dialog
79 | // to be kept open on click
80 | AlertDialog d = (AlertDialog) getDialog();
81 | Button defaultsButton = d.getButton(DialogInterface.BUTTON_NEUTRAL);
82 | defaultsButton.setOnClickListener(new View.OnClickListener() {
83 | @Override
84 | public void onClick(View v) {
85 | mSeekBar.setProgress(mDefault - mMin);
86 | }
87 | });
88 |
89 | final SharedPreferences prefs = getSharedPreferences();
90 | mKey = getKey();
91 | int value = prefs.getInt(mKey, mDefault);
92 | value -= mMin;
93 | mSeekBar.setMax(mMax - mMin);
94 | mSeekBar.setProgress(value);
95 |
96 | }
97 |
98 | @Override
99 | protected void onDialogClosed(boolean positiveResult) {
100 | super.onDialogClosed(positiveResult);
101 |
102 | if (positiveResult) {
103 | int realValue = mSeekBar.getProgress() + mMin;
104 | Editor editor = getEditor();
105 | editor.putInt(mKey, realValue);
106 | editor.commit();
107 | }
108 | }
109 |
110 | @Override
111 | public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
112 | int realValue = progress + mMin;
113 | mValue.setText(realValue + mSuffix);
114 | if (realValue == -1){
115 | mValue.setText(R.string.settings_default);
116 | }
117 | }
118 |
119 | @Override
120 | public void onStartTrackingTouch(SeekBar seekBar) {
121 | // TODO Auto-generated method stub
122 | }
123 |
124 | @Override
125 | public void onStopTrackingTouch(SeekBar seekBar) {
126 | // TODO Auto-generated method stub
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/TestKeyboard.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.zst.xposed.xuimod.preference;
17 |
18 | import android.content.Context;
19 | import android.preference.Preference;
20 | import android.text.InputType;
21 | import android.util.AttributeSet;
22 | import android.view.Gravity;
23 | import android.view.View;
24 | import android.view.ViewGroup;
25 | import android.widget.EditText;
26 |
27 | public class TestKeyboard extends Preference{
28 |
29 | int mHint;
30 |
31 | public TestKeyboard(Context context, AttributeSet attrs) {
32 | super(context, attrs);
33 | mHint = attrs.getAttributeResourceValue(null, "hint", 0);
34 | }
35 |
36 | @Override
37 | protected View onCreateView(ViewGroup parent){
38 | EditText tv = new EditText(this.getContext());
39 | tv.setPadding(0, 15, 0, 15);
40 | tv.setHint(mHint);
41 | tv.setGravity(Gravity.CENTER);
42 | tv.setInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
43 | return tv;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/TestListView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zst.xposed.xuimod.preference;
18 |
19 | import com.zst.xposed.xuimod.R;
20 |
21 | import android.app.AlertDialog;
22 | import android.content.Context;
23 | import android.content.res.Resources;
24 | import android.preference.DialogPreference;
25 | import android.util.AttributeSet;
26 | import android.widget.ArrayAdapter;
27 | import android.widget.ListView;
28 |
29 | public class TestListView extends DialogPreference {
30 |
31 | final Resources mRes;
32 |
33 | public TestListView(Context context, AttributeSet attrs) {
34 | super(context, attrs);
35 | mRes = context.getResources();
36 | }
37 |
38 | @Override
39 | protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
40 | final ListView list = new ListView(getContext());
41 | final ArrayAdapter adapter = new ArrayAdapter(getContext(),
42 | android.R.layout.simple_list_item_1, android.R.id.text1);
43 | adapter.add(mRes.getString(R.string.test_listview_instructions));
44 | final String itemText = mRes.getString(R.string.test_listview_item);
45 | for (int x = 1; x <= 200; x++) {
46 | adapter.add(itemText + " " + x);
47 | }
48 | list.setAdapter(adapter);
49 | builder.setView(list);
50 | }
51 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/VolumePanelAlpha.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 XuiMod
3 | * Copyright (C) 2013 Dzakus
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.zst.xposed.xuimod.preference;
19 |
20 | import com.zst.xposed.xuimod.R;
21 | import static com.zst.xposed.xuimod.Common.KEY_VOLUME_ALPHA;
22 | import static com.zst.xposed.xuimod.Common.DEFAULT_VOLUME_ALPHA;
23 | import static com.zst.xposed.xuimod.Common.LIMIT_MAX_VOLUME_ALPHA;
24 | import static com.zst.xposed.xuimod.Common.LIMIT_MIN_VOLUME_ALPHA;
25 |
26 | import android.app.AlertDialog;
27 | import android.app.Dialog;
28 | import android.content.Context;
29 | import android.content.DialogInterface;
30 | import android.content.SharedPreferences;
31 | import android.content.SharedPreferences.Editor;
32 | import android.os.Bundle;
33 | import android.preference.DialogPreference;
34 | import android.util.AttributeSet;
35 | import android.view.View;
36 | import android.view.Window;
37 | import android.view.WindowManager;
38 | import android.widget.Button;
39 | import android.widget.SeekBar;
40 | import android.widget.TextView;
41 |
42 | public class VolumePanelAlpha extends DialogPreference implements
43 | SeekBar.OnSeekBarChangeListener {
44 |
45 | private SeekBar mSeekBar;
46 | private TextView mValue;
47 |
48 | public VolumePanelAlpha(Context context, AttributeSet attrs) {
49 | super(context, attrs);
50 |
51 | setDialogLayoutResource(R.layout.pref_seekbar);
52 | }
53 |
54 | @Override
55 | protected void onPrepareDialogBuilder(AlertDialog.Builder builder) {
56 | builder.setNeutralButton(R.string.settings_default,
57 | new DialogInterface.OnClickListener() {
58 | @Override
59 | public void onClick(DialogInterface dialog, int which) {
60 | }
61 | });
62 | }
63 |
64 | @Override
65 | protected void onBindDialogView(View view) {
66 | super.onBindDialogView(view);
67 |
68 | mValue = (TextView) view.findViewById(R.id.value);
69 | mSeekBar = (SeekBar) view.findViewById(R.id.seekbar);
70 | mSeekBar.setOnSeekBarChangeListener(this);
71 |
72 | }
73 |
74 | @Override
75 | protected void showDialog(Bundle state) {
76 | super.showDialog(state);
77 |
78 | // can't use onPrepareDialogBuilder for this as we want the dialog
79 | // to be kept open on click
80 | AlertDialog d = (AlertDialog) getDialog();
81 | Button defaultsButton = d.getButton(DialogInterface.BUTTON_NEUTRAL);
82 | defaultsButton.setOnClickListener(new View.OnClickListener() {
83 | @Override
84 | public void onClick(View v) {
85 | mSeekBar.setProgress(DEFAULT_VOLUME_ALPHA-LIMIT_MIN_VOLUME_ALPHA);
86 | }
87 | });
88 |
89 | final SharedPreferences prefs = getSharedPreferences();
90 |
91 | int value = prefs.getInt(KEY_VOLUME_ALPHA, DEFAULT_VOLUME_ALPHA);
92 | value -= LIMIT_MIN_VOLUME_ALPHA;
93 |
94 | mSeekBar.setMax(LIMIT_MAX_VOLUME_ALPHA - LIMIT_MIN_VOLUME_ALPHA);
95 | mSeekBar.setProgress(value);
96 |
97 | }
98 |
99 | @Override
100 | protected void onDialogClosed(boolean positiveResult) {
101 | super.onDialogClosed(positiveResult);
102 |
103 | if (positiveResult) {
104 | int realValue = mSeekBar.getProgress() + LIMIT_MIN_VOLUME_ALPHA;
105 | Editor editor = getEditor();
106 | editor.putInt(KEY_VOLUME_ALPHA, realValue);
107 | editor.commit();
108 | }
109 | }
110 |
111 | @Override
112 | public void onProgressChanged(SeekBar seekBar, int progress,
113 | boolean fromUser) {
114 | int realValue = progress + LIMIT_MIN_VOLUME_ALPHA;
115 |
116 | Dialog dialog = getDialog();
117 | if (dialog != null) {
118 | Window window = dialog.getWindow();
119 | WindowManager.LayoutParams lp = window.getAttributes();
120 | lp.alpha = (realValue * 0.01f); // Convert Percentage to Decimal
121 | window.setAttributes(lp);
122 | }
123 |
124 | mValue.setText(realValue + "%");
125 | }
126 |
127 | @Override
128 | public void onStartTrackingTouch(SeekBar seekBar) {
129 | // TODO Auto-generated method stub
130 | }
131 |
132 | @Override
133 | public void onStopTrackingTouch(SeekBar seekBar) {
134 | // TODO Auto-generated method stub
135 | }
136 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/activity/AnimControlPreference.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 AOKP by Steve Spear - Stevespear426
3 | * This code has been modified. Portions copyright (C) 2013, XuiMod
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package com.zst.xposed.xuimod.preference.activity;
18 |
19 | import android.content.SharedPreferences;
20 | import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
21 | import android.os.Bundle;
22 | import android.preference.PreferenceActivity;
23 |
24 | import com.zst.xposed.xuimod.Common;
25 | import com.zst.xposed.xuimod.R;
26 | import com.zst.xposed.xuimod.mods.animation.AwesomeAnimationHelper;
27 |
28 | public class AnimControlPreference extends PreferenceActivity implements OnSharedPreferenceChangeListener {
29 |
30 | @Override
31 | public void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 | getPreferenceManager().setSharedPreferencesMode(MODE_WORLD_READABLE);
34 | getPreferenceManager().setSharedPreferencesName(Common.ANIM_CONTROLS_PREFERENCE_FILENAME);
35 | addPreferencesFromResource(R.xml.pref_anim_control);
36 | reloadSummary(getPreferenceManager().getSharedPreferences());
37 | getPreferenceManager().getSharedPreferences()
38 | .registerOnSharedPreferenceChangeListener(this);
39 | }
40 |
41 | @Override
42 | public void onSharedPreferenceChanged(SharedPreferences pref, String key) {
43 | Common.settingsChanged(this);
44 | reloadSummary(pref);
45 | }
46 |
47 | private void reloadSummary(SharedPreferences pref) {
48 | for (int x = 0; x < Common.KEYS_ANIMATION_CONTROLS_ACTIVITY.length; x++){
49 | String key = Common.KEYS_ANIMATION_CONTROLS_ACTIVITY[x];
50 | String value = pref.getString(key, Common.DEFAULT_ANIMATION_CONTROLS_ACTIVITY);
51 | String summary = AwesomeAnimationHelper.getProperName(getResources(),
52 | Integer.valueOf(value));
53 | findPreference(key).setSummary(summary);
54 | }
55 |
56 | int duration = pref.getInt(Common.KEY_ANIMATION_CONTROLS_DURATION,
57 | Common.DEFAULT_ANIMATION_CONTROLS_DURATION);
58 | String summary = (duration < 0) ? getResources().getString(R.string.settings_default) : (duration + " ms");
59 | findPreference(Common.KEY_ANIMATION_CONTROLS_DURATION).setSummary(summary);
60 |
61 | }
62 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/activity/BatteryBarColor.java:
--------------------------------------------------------------------------------
1 | package com.zst.xposed.xuimod.preference.activity;
2 |
3 | import com.zst.xposed.xuimod.Common;
4 | import com.zst.xposed.xuimod.R;
5 |
6 | import android.content.SharedPreferences;
7 | import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
8 | import android.os.Bundle;
9 | import android.preference.PreferenceActivity;
10 |
11 | public class BatteryBarColor extends PreferenceActivity implements OnSharedPreferenceChangeListener {
12 |
13 | @Override
14 | public void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | addPreferencesFromResource(R.xml.pref_batterybar_color);
17 | }
18 |
19 | @Override
20 | public void onSharedPreferenceChanged(SharedPreferences arg0, String arg1) {
21 | Common.settingsChanged(this);
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/activity/ChooseRandomColor.java:
--------------------------------------------------------------------------------
1 | package com.zst.xposed.xuimod.preference.activity;
2 |
3 | import com.zst.xposed.xuimod.Common;
4 | import com.zst.xposed.xuimod.R;
5 |
6 | import android.content.SharedPreferences;
7 | import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
8 | import android.os.Bundle;
9 | import android.preference.PreferenceActivity;
10 |
11 | public class ChooseRandomColor extends PreferenceActivity implements
12 | OnSharedPreferenceChangeListener {
13 |
14 | @Override
15 | public void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | getPreferenceManager().setSharedPreferencesMode(MODE_WORLD_READABLE);
18 | getPreferenceManager().setSharedPreferencesName(Common.RANDOM_COLOR_PREFERENCE_FILENAME);
19 | addPreferencesFromResource(R.xml.pref_random_color);
20 | }
21 |
22 | @Override
23 | public void onSharedPreferenceChanged(SharedPreferences pref, String key) {
24 | Common.settingsChanged(this);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/colorpicker/AlphaPatternDrawable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 Daniel Nilsson
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.zst.xposed.xuimod.preference.colorpicker;
18 |
19 |
20 | import android.graphics.*;
21 | import android.graphics.Bitmap.Config;
22 | import android.graphics.drawable.Drawable;
23 |
24 | /**
25 | * This drawable that draws a simple white and gray chessboard pattern.
26 | * It's pattern you will often see as a background behind a
27 | * partly transparent image in many applications.
28 | * @author Daniel Nilsson
29 | */
30 | public class AlphaPatternDrawable extends Drawable {
31 |
32 | private int mRectangleSize = 10;
33 |
34 | private Paint mPaint = new Paint();
35 | private Paint mPaintWhite = new Paint();
36 | private Paint mPaintGray = new Paint();
37 |
38 | private int numRectanglesHorizontal;
39 | private int numRectanglesVertical;
40 |
41 | /**
42 | * Bitmap in which the pattern will be cahched.
43 | */
44 | private Bitmap mBitmap;
45 |
46 | public AlphaPatternDrawable(int rectangleSize) {
47 | mRectangleSize = rectangleSize;
48 | mPaintWhite.setColor(0xffffffff);
49 | mPaintGray.setColor(0xffcbcbcb);
50 | }
51 |
52 | @Override
53 | public void draw(Canvas canvas) {
54 | canvas.drawBitmap(mBitmap, null, getBounds(), mPaint);
55 | }
56 |
57 | @Override
58 | public int getOpacity() {
59 | return 0;
60 | }
61 |
62 | @Override
63 | public void setAlpha(int alpha) {
64 | throw new UnsupportedOperationException("Alpha is not supported by this drawwable.");
65 | }
66 |
67 | @Override
68 | public void setColorFilter(ColorFilter cf) {
69 | throw new UnsupportedOperationException("ColorFilter is not supported by this drawwable.");
70 | }
71 |
72 | @Override
73 | protected void onBoundsChange(Rect bounds) {
74 | super.onBoundsChange(bounds);
75 |
76 | int height = bounds.height();
77 | int width = bounds.width();
78 |
79 | numRectanglesHorizontal = (int) Math.ceil((width / mRectangleSize));
80 | numRectanglesVertical = (int) Math.ceil(height / mRectangleSize);
81 |
82 | generatePatternBitmap();
83 | }
84 |
85 | /**
86 | * This will generate a bitmap with the pattern
87 | * as big as the rectangle we were allow to draw on.
88 | * We do this to chache the bitmap so we don't need to
89 | * recreate it each time draw() is called since it
90 | * takes a few milliseconds.
91 | */
92 | private void generatePatternBitmap(){
93 | if(getBounds().width() <= 0 || getBounds().height() <= 0){
94 | return;
95 | }
96 |
97 | mBitmap = Bitmap.createBitmap(getBounds().width(), getBounds().height(), Config.ARGB_8888);
98 | Canvas canvas = new Canvas(mBitmap);
99 |
100 | Rect r = new Rect();
101 | boolean verticalStartWhite = true;
102 | for (int i = 0; i <= numRectanglesVertical; i++) {
103 |
104 | boolean isWhite = verticalStartWhite;
105 | for (int j = 0; j <= numRectanglesHorizontal; j++) {
106 |
107 | r.top = i * mRectangleSize;
108 | r.left = j * mRectangleSize;
109 | r.bottom = r.top + mRectangleSize;
110 | r.right = r.left + mRectangleSize;
111 |
112 | canvas.drawRect(r, isWhite ? mPaintWhite : mPaintGray);
113 |
114 | isWhite = !isWhite;
115 | }
116 | verticalStartWhite = !verticalStartWhite;
117 | }
118 | }
119 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/colorpicker/ColorPanelView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 Daniel Nilsson
3 | * Copyright (C) 2012 THe CyanogenMod Project
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package com.zst.xposed.xuimod.preference.colorpicker;
19 |
20 | import android.content.Context;
21 | import android.graphics.Canvas;
22 | import android.graphics.Paint;
23 | import android.graphics.RectF;
24 | import android.util.AttributeSet;
25 | import android.view.View;
26 |
27 | /**
28 | * This class draws a panel which which will be filled with a color which can be set.
29 | * It can be used to show the currently selected color which you will get from
30 | * the {@link ColorPickerView}.
31 | * @author Daniel Nilsson
32 | *
33 | */
34 | public class ColorPanelView extends View {
35 |
36 | /**
37 | * The width in pixels of the border
38 | * surrounding the color panel.
39 | */
40 | private final static float BORDER_WIDTH_PX = 1;
41 |
42 | private float mDensity = 1f;
43 |
44 | private int mBorderColor = 0xff6E6E6E;
45 | private int mColor = 0xff000000;
46 |
47 | private Paint mBorderPaint;
48 | private Paint mColorPaint;
49 |
50 | private RectF mDrawingRect;
51 | private RectF mColorRect;
52 |
53 | private AlphaPatternDrawable mAlphaPattern;
54 |
55 | public ColorPanelView(Context context){
56 | this(context, null);
57 | }
58 |
59 | public ColorPanelView(Context context, AttributeSet attrs){
60 | this(context, attrs, 0);
61 | }
62 |
63 | public ColorPanelView(Context context, AttributeSet attrs, int defStyle) {
64 | super(context, attrs, defStyle);
65 | init();
66 | }
67 |
68 | private void init(){
69 | mBorderPaint = new Paint();
70 | mColorPaint = new Paint();
71 | mDensity = getContext().getResources().getDisplayMetrics().density;
72 | }
73 |
74 |
75 | @Override
76 | protected void onDraw(Canvas canvas) {
77 |
78 | final RectF rect = mColorRect;
79 |
80 | if(BORDER_WIDTH_PX > 0){
81 | mBorderPaint.setColor(mBorderColor);
82 | canvas.drawRect(mDrawingRect, mBorderPaint);
83 | }
84 |
85 | if(mAlphaPattern != null){
86 | mAlphaPattern.draw(canvas);
87 | }
88 | mColorPaint.setColor(mColor);
89 | canvas.drawRect(rect, mColorPaint);
90 | }
91 |
92 | @Override
93 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
94 | int width = MeasureSpec.getSize(widthMeasureSpec);
95 | int height = MeasureSpec.getSize(heightMeasureSpec);
96 | setMeasuredDimension(width, height);
97 | }
98 |
99 | @Override
100 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {
101 | super.onSizeChanged(w, h, oldw, oldh);
102 |
103 | mDrawingRect = new RectF();
104 | mDrawingRect.left = getPaddingLeft();
105 | mDrawingRect.right = w - getPaddingRight();
106 | mDrawingRect.top = getPaddingTop();
107 | mDrawingRect.bottom = h - getPaddingBottom();
108 | setUpColorRect();
109 | }
110 |
111 | private void setUpColorRect(){
112 | final RectF dRect = mDrawingRect;
113 | float left = dRect.left + BORDER_WIDTH_PX;
114 | float top = dRect.top + BORDER_WIDTH_PX;
115 | float bottom = dRect.bottom - BORDER_WIDTH_PX;
116 | float right = dRect.right - BORDER_WIDTH_PX;
117 |
118 | mColorRect = new RectF(left,top, right, bottom);
119 | mAlphaPattern = new AlphaPatternDrawable((int)(5 * mDensity));
120 | mAlphaPattern.setBounds(
121 | Math.round(mColorRect.left),
122 | Math.round(mColorRect.top),
123 | Math.round(mColorRect.right),
124 | Math.round(mColorRect.bottom)
125 | );
126 | }
127 |
128 | /**
129 | * Set the color that should be shown by this view.
130 | * @param color
131 | */
132 | public void setColor(int color){
133 | mColor = color;
134 | invalidate();
135 | }
136 |
137 | /**
138 | * Get the color currently show by this view.
139 | * @return
140 | */
141 | public int getColor(){
142 | return mColor;
143 | }
144 |
145 | /**
146 | * Set the color of the border surrounding the panel.
147 | * @param color
148 | */
149 | public void setBorderColor(int color){
150 | mBorderColor = color;
151 | invalidate();
152 | }
153 |
154 | /**
155 | * Get the color of the border surrounding the panel.
156 | */
157 | public int getBorderColor(){
158 | return mBorderColor;
159 | }
160 | }
--------------------------------------------------------------------------------
/src/com/zst/xposed/xuimod/preference/colorpicker/ColorSettingsDialog.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2010 Daniel Nilsson
3 | * Copyright (C) 2012 The CyanogenMod Project
4 | * Copyright (C) 2013 XuiMod
5 | *
6 | * Licensed under the Apache License, Version 2.0 (the "License");
7 | * you may not use this file except in compliance with the License.
8 | * You may obtain a copy of the License at
9 | *
10 | * http://www.apache.org/licenses/LICENSE-2.0
11 | *
12 | * Unless required by applicable law or agreed to in writing, software
13 | * distributed under the License is distributed on an "AS IS" BASIS,
14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | * See the License for the specific language governing permissions and
16 | * limitations under the License.
17 | */
18 |
19 | package com.zst.xposed.xuimod.preference.colorpicker;
20 |
21 | import java.util.Locale;
22 |
23 | import com.zst.xposed.xuimod.Common;
24 | import com.zst.xposed.xuimod.R;
25 | import com.zst.xposed.xuimod.preference.colorpicker.ColorPickerView.OnColorChangedListener;
26 |
27 | import android.app.AlertDialog;
28 | import android.content.Context;
29 | import android.graphics.PixelFormat;
30 | import android.view.LayoutInflater;
31 | import android.view.View;
32 | import android.widget.Button;
33 | import android.widget.EditText;
34 |
35 | public class ColorSettingsDialog extends AlertDialog implements
36 | ColorPickerView.OnColorChangedListener {
37 |
38 | private ColorPickerView mColorPicker;
39 |
40 | private ColorPanelView mOldColor;
41 | private ColorPanelView mNewColor;
42 | private EditText mHexColor;
43 | private Button mHexButton;
44 |
45 | private LayoutInflater mInflater;
46 | private OnColorChangedListener mListener;
47 |
48 | public ColorSettingsDialog(Context context, int initialColor, final String defColor) {
49 | super(context);
50 | getWindow().setFormat(PixelFormat.RGBA_8888);
51 | // To fight color banding.
52 | setUp(initialColor, defColor);
53 | }
54 |
55 | private void setUp(int color, final String defColor) {
56 | mInflater = (LayoutInflater) getContext()
57 | .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
58 |
59 | View layout = mInflater.inflate(R.layout.view_dialog_colorpicker, null);
60 |
61 | mColorPicker = (ColorPickerView) layout.findViewById(R.id.color_picker_view);
62 | mOldColor = (ColorPanelView) layout.findViewById(R.id.old_color_panel);
63 | mNewColor = (ColorPanelView) layout.findViewById(R.id.new_color_panel);
64 | mHexColor = (EditText) layout.findViewById(R.id.current_hex_text);
65 |
66 | mColorPicker.setOnColorChangedListener(this);
67 | mOldColor.setColor(color);
68 | mColorPicker.setColor(color, true);
69 |
70 | mHexButton = (Button) layout.findViewById(R.id.color_apply);
71 | mHexButton.setOnClickListener(new View.OnClickListener(){
72 | @Override
73 | public void onClick(View v) {
74 | int color = Common.parseColorFromString(mHexColor.getText().toString(), defColor);
75 | mColorPicker.setColor(color);
76 | colorChange(color);
77 | }
78 | });
79 |
80 | setView(layout);
81 | }
82 |
83 | @Override
84 | public void onColorChanged(int color) {
85 | colorChange(color);
86 | }
87 |
88 | private void colorChange(int color){
89 | mNewColor.setColor(color);
90 | mHexColor.setText((String.format("%08X", (0xFFFFFFFF & color))).toUpperCase(Locale.ENGLISH));
91 | if (mListener != null) {
92 | mListener.onColorChanged(color);
93 | }
94 | }
95 |
96 | public void setAlphaSliderVisible(boolean visible) {
97 | mColorPicker.setAlphaSliderVisible(visible);
98 | }
99 |
100 | public String getColorString() {
101 | return String.format("%08X", (0xFFFFFFFF & mColorPicker.getColor()));
102 | }
103 |
104 | public int getColor() {
105 | return mColorPicker.getColor();
106 | }
107 |
108 | }
--------------------------------------------------------------------------------