├── PhoneSafer
├── .classpath
├── .project
├── .settings
│ └── org.eclipse.core.resources.prefs
├── AndroidManifest.xml
├── libs
│ ├── android-support-v4.jar
│ └── xcl-charts.jar
├── proguard-project.txt
├── project.properties
├── res
│ ├── anim
│ │ └── out_left.xml
│ ├── color
│ │ ├── cpb_complete_state_selector.xml
│ │ ├── cpb_error_state_selector.xml
│ │ └── cpb_idle_state_selector.xml
│ ├── drawable-hdpi
│ │ ├── a.png
│ │ ├── bitmap_book_read_chapterlist_repeat.png
│ │ ├── btn_off_bg.png
│ │ ├── btn_on_bg.png
│ │ ├── checkbox_off.png
│ │ ├── checkbox_on.png
│ │ ├── checked.png
│ │ ├── ic_action_accept.png
│ │ ├── ic_action_cancel.png
│ │ ├── ic_category_mark.png
│ │ ├── ic_item_normal_bg.png
│ │ ├── ic_item_selected_bg.png
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher2.png
│ │ ├── img_background_button_splash_audio_enabled_normal.png
│ │ ├── img_button_minilyric_unlock_ics.png
│ │ ├── ios7_switch_off.png
│ │ ├── ios7_switch_on.png
│ │ ├── jian.png
│ │ ├── later.png
│ │ ├── light.png
│ │ ├── model_select.png
│ │ ├── pressed.png
│ │ ├── sleep.png
│ │ ├── start.png
│ │ ├── support.png
│ │ ├── switch_btn_off.png
│ │ ├── switch_btn_on.png
│ │ ├── switch_btn_slipper.png
│ │ ├── toggle_btn_checked.png
│ │ ├── toggle_btn_unchecked.png
│ │ ├── umeng_fb_see_list_normal.png
│ │ ├── umeng_fb_see_list_pressed.png
│ │ └── vibrator_remind.png
│ ├── drawable-xhdpi
│ │ ├── checkswitch_bottom.png
│ │ ├── checkswitch_btn_pressed.png
│ │ ├── checkswitch_btn_unpressed.png
│ │ ├── checkswitch_frame.png
│ │ ├── checkswitch_mask.png
│ │ ├── scrubber_control_disabled_holo.png
│ │ ├── scrubber_control_focused_holo.png
│ │ ├── scrubber_control_normal_holo.png
│ │ └── scrubber_control_pressed_holo.png
│ ├── drawable
│ │ ├── checkbox_iphone.xml
│ │ ├── cpb_background.xml
│ │ ├── imageview_selector.xml
│ │ ├── ios7_btn.xml
│ │ ├── seek_arc_control_selector.xml
│ │ ├── seekbar_volume_color_style.xml
│ │ ├── selector_category_item.xml
│ │ ├── switch_btn.xml
│ │ └── toggle_btn.xml
│ ├── layout
│ │ ├── activity_gesture_unlock_setting.xml
│ │ ├── activity_main.xml
│ │ ├── activity_model_setting.xml
│ │ ├── activity_more_setting.xml
│ │ ├── activity_password_setting.xml
│ │ ├── activity_ring_setting_select.xml
│ │ ├── activity_setting_delay_time.xml
│ │ ├── activity_setting_speedvalue.xml
│ │ ├── activity_setting_speedvalue_degree.xml
│ │ ├── activity_unlock.xml
│ │ ├── activity_welcome.xml
│ │ ├── fragment1.xml
│ │ ├── fragment2.xml
│ │ ├── fragment_main.xml
│ │ ├── lock_screen_passward.xml
│ │ ├── ring_select_adapter.xml
│ │ ├── ring_setting_activity.xml
│ │ └── select_iamgebutton_adapter.xml
│ ├── menu
│ │ └── main.xml
│ ├── raw
│ │ ├── alarmsound.mp3
│ │ └── blipblip.mp3
│ ├── values-v11
│ │ └── styles.xml
│ ├── values-v14
│ │ └── styles.xml
│ ├── values-w820dp
│ │ └── dimens.xml
│ ├── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── library_circularprogressbutton_strings.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── xml
│ │ └── my_admin.xml
└── src
│ └── com
│ ├── dd
│ └── loadlingButton
│ │ ├── CircularAnimatedDrawable.java
│ │ ├── CircularProgressButton.java
│ │ ├── CircularProgressDrawable.java
│ │ ├── MorphingAnimation.java
│ │ ├── OnAnimationEndListener.java
│ │ ├── StateManager.java
│ │ └── StrokeGradientDrawable.java
│ └── hy2014
│ └── phonesafer
│ ├── activity
│ ├── .gitignore
│ ├── AsyncTaskTest.java
│ ├── BaseActivity.java
│ ├── BaseActivityAbstrat.java
│ ├── BitmapLoadTest.java
│ ├── DeviceManagerActivity.java
│ ├── HomeKeyLocker.java
│ ├── HowViewDraw.java
│ ├── MainActivity.java
│ ├── MediaButtonReceiver.java
│ ├── SelectRingTypeActivity.java
│ ├── SettingDelayTimeActivity.java
│ ├── SettingModelActivity.java
│ ├── SettingPasswordActivity.java
│ ├── SettingRingActivity.java
│ ├── SettingXYAngleActivity.java
│ └── WelcomeActivity.java
│ ├── adapter
│ ├── RingAppSettingAdapter.java
│ └── RingSettingAdapter.java
│ ├── broadcast
│ └── AdminReceiver.java
│ ├── fragment
│ ├── Fragment1.java
│ ├── Fragment2.java
│ └── FragmentMainRotatActivity.java
│ ├── gestureLock
│ ├── GesturUnlockActivity.java
│ ├── GestureLockSettingActivity.java
│ ├── GestureLockView.java
│ └── MyCircle.java
│ ├── service
│ └── AppService.java
│ ├── utils
│ ├── ActivityUtil.java
│ ├── BitmapUtil.java
│ ├── ConnectHttp.java
│ ├── DrawableManager.java
│ ├── LogUtil.java
│ ├── ObjectTransfer.java
│ ├── SortAlgorithm.java
│ └── ToastUtil.java
│ └── view
│ ├── CheckSwitchButton.java
│ ├── CustomImageView.java
│ ├── FrameAnimationController.java
│ ├── GaugeChart01View.java
│ ├── SeekArc.java
│ └── SlideMenu.java
└── README.md
/PhoneSafer/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PhoneSafer/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | PhoneSafer
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 |
--------------------------------------------------------------------------------
/PhoneSafer/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/com/hy2014/phonesafer/view/GaugeChart01View.java=UTF-8
3 |
--------------------------------------------------------------------------------
/PhoneSafer/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
48 |
49 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
90 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
107 |
108 |
109 |
--------------------------------------------------------------------------------
/PhoneSafer/libs/android-support-v4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/libs/android-support-v4.jar
--------------------------------------------------------------------------------
/PhoneSafer/libs/xcl-charts.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/libs/xcl-charts.jar
--------------------------------------------------------------------------------
/PhoneSafer/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 |
--------------------------------------------------------------------------------
/PhoneSafer/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-19
15 | android.library=false
16 |
--------------------------------------------------------------------------------
/PhoneSafer/res/anim/out_left.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
--------------------------------------------------------------------------------
/PhoneSafer/res/color/cpb_complete_state_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
11 |
--------------------------------------------------------------------------------
/PhoneSafer/res/color/cpb_error_state_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
11 |
--------------------------------------------------------------------------------
/PhoneSafer/res/color/cpb_idle_state_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
7 |
9 |
11 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/a.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/bitmap_book_read_chapterlist_repeat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/bitmap_book_read_chapterlist_repeat.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/btn_off_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/btn_off_bg.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/btn_on_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/btn_on_bg.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/checkbox_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/checkbox_off.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/checkbox_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/checkbox_on.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/checked.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ic_action_accept.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ic_action_accept.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ic_action_cancel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ic_action_cancel.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ic_category_mark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ic_category_mark.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ic_item_normal_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ic_item_normal_bg.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ic_item_selected_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ic_item_selected_bg.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ic_launcher2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ic_launcher2.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/img_background_button_splash_audio_enabled_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/img_background_button_splash_audio_enabled_normal.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/img_button_minilyric_unlock_ics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/img_button_minilyric_unlock_ics.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ios7_switch_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ios7_switch_off.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/ios7_switch_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/ios7_switch_on.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/jian.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/jian.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/later.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/later.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/light.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/model_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/model_select.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/pressed.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/sleep.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/sleep.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/start.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/start.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/support.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/support.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/switch_btn_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/switch_btn_off.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/switch_btn_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/switch_btn_on.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/switch_btn_slipper.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/switch_btn_slipper.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/toggle_btn_checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/toggle_btn_checked.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/toggle_btn_unchecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/toggle_btn_unchecked.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/umeng_fb_see_list_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/umeng_fb_see_list_normal.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/umeng_fb_see_list_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/umeng_fb_see_list_pressed.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-hdpi/vibrator_remind.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-hdpi/vibrator_remind.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/checkswitch_bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/checkswitch_bottom.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/checkswitch_btn_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/checkswitch_btn_pressed.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/checkswitch_btn_unpressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/checkswitch_btn_unpressed.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/checkswitch_frame.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/checkswitch_frame.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/checkswitch_mask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/checkswitch_mask.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/scrubber_control_disabled_holo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/scrubber_control_disabled_holo.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/scrubber_control_focused_holo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/scrubber_control_focused_holo.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/scrubber_control_normal_holo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/scrubber_control_normal_holo.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable-xhdpi/scrubber_control_pressed_holo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/drawable-xhdpi/scrubber_control_pressed_holo.png
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/checkbox_iphone.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/cpb_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/imageview_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/ios7_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/seek_arc_control_selector.xml:
--------------------------------------------------------------------------------
1 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/seekbar_volume_color_style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | -
9 |
10 |
11 |
12 |
18 |
19 |
20 |
21 | -
25 |
26 |
27 |
28 |
29 |
30 |
31 |
37 |
38 |
39 |
40 |
53 |
54 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/selector_category_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/switch_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/PhoneSafer/res/drawable/toggle_btn.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_gesture_unlock_setting.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
26 |
27 |
28 |
39 |
40 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
18 |
22 |
23 |
27 |
28 |
34 |
35 |
44 |
45 |
51 |
52 |
53 |
57 |
58 |
59 |
63 |
64 |
69 |
70 |
79 |
80 |
81 |
87 |
88 |
89 |
93 |
94 |
95 |
99 |
100 |
105 |
106 |
115 |
116 |
117 |
123 |
124 |
125 |
129 |
130 |
131 |
135 |
136 |
141 |
142 |
151 |
152 |
153 |
159 |
160 |
161 |
165 |
166 |
167 |
171 |
172 |
177 |
178 |
187 |
188 |
189 |
195 |
196 |
197 |
201 |
202 |
203 |
204 |
208 |
209 |
214 |
215 |
224 |
225 |
226 |
232 |
233 |
234 |
238 |
239 |
240 |
241 |
242 |
249 |
250 |
255 |
256 |
265 |
266 |
267 |
272 |
273 |
274 |
278 |
279 |
285 |
286 |
287 |
288 |
296 |
297 |
310 |
311 |
312 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_model_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
22 |
23 |
30 |
31 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_more_setting.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
15 |
16 |
17 |
18 |
22 |
23 |
24 |
25 |
31 |
32 |
36 |
40 |
41 |
42 |
43 |
47 |
48 |
52 |
56 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_password_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
21 |
22 |
30 |
31 |
35 |
36 |
43 |
44 |
51 |
52 |
53 |
54 |
60 |
61 |
62 |
68 |
69 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_ring_setting_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
22 |
23 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_setting_delay_time.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
15 |
16 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_setting_speedvalue.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
18 |
19 |
25 |
26 |
33 |
34 |
35 |
42 |
43 |
53 |
54 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_setting_speedvalue_degree.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
18 |
19 |
26 |
27 |
28 |
29 |
36 |
37 |
59 |
60 |
69 |
70 |
75 |
76 |
84 |
85 |
90 |
91 |
99 |
100 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_unlock.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
15 |
16 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/activity_welcome.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
15 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/fragment1.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/fragment2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/fragment_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
25 |
26 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/lock_screen_passward.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
24 |
25 |
31 |
32 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/ring_select_adapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
31 |
32 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/ring_setting_activity.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
18 |
19 |
20 |
29 |
30 |
39 |
40 |
41 |
46 |
47 |
52 |
53 |
54 |
59 |
60 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/PhoneSafer/res/layout/select_iamgebutton_adapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
19 |
20 |
28 |
29 |
--------------------------------------------------------------------------------
/PhoneSafer/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
12 |
--------------------------------------------------------------------------------
/PhoneSafer/res/raw/alarmsound.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/raw/alarmsound.mp3
--------------------------------------------------------------------------------
/PhoneSafer/res/raw/blipblip.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/res/raw/blipblip.mp3
--------------------------------------------------------------------------------
/PhoneSafer/res/values-v11/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/PhoneSafer/res/values-v14/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/PhoneSafer/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 | 64dp
9 |
10 |
11 |
--------------------------------------------------------------------------------
/PhoneSafer/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
97 |
--------------------------------------------------------------------------------
/PhoneSafer/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | #ffdedede
6 | #ff0099cc
7 | #ff00719b
8 | #ffff4444
9 | #ffcd3a3a
10 | #ff99cc00
11 | #ff6d9b00
12 | @android:color/white
13 |
14 |
15 | #FFD8D8D8
16 | #FF383838
17 |
18 |
--------------------------------------------------------------------------------
/PhoneSafer/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 16dp
5 | 16dp
6 |
7 | 4dp
8 |
9 |
10 |
--------------------------------------------------------------------------------
/PhoneSafer/res/values/library_circularprogressbutton_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | circularprogressbutton
4 | Dmytro Danylyk
5 | http://dmytrodanylyk.com/
6 | Circular Progress Button
7 | Android Button which can morph to Circular Progress.
8 | 1.1.0
9 | http://dmytrodanylyk.com/pages/portfolio/circular-progress-button.html
10 | mit
11 | true
12 | https://github.com/dmytrodanylyk/circular-progress-button
13 |
14 |
--------------------------------------------------------------------------------
/PhoneSafer/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | 防盗锁
5 | Hello world!
6 | Settings
7 |
8 |
9 | Settings
10 | Settings
11 |
12 | Upload
13 |
14 | 未启动警报
15 | Error
16 | Complete
17 |
18 |
--------------------------------------------------------------------------------
/PhoneSafer/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
14 |
15 |
16 |
19 |
20 |
21 |
29 |
30 |
46 |
47 |
50 |
51 |
54 |
55 |
--------------------------------------------------------------------------------
/PhoneSafer/res/xml/my_admin.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/dd/loadlingButton/CircularAnimatedDrawable.java:
--------------------------------------------------------------------------------
1 | package com.dd.loadlingButton;
2 |
3 | import java.util.Hashtable;
4 | import java.util.List;
5 | import java.util.Map;
6 | import java.util.Set;
7 |
8 | import android.R.integer;
9 | import android.animation.Animator;
10 | import android.animation.ObjectAnimator;
11 | import android.animation.ValueAnimator;
12 | import android.annotation.SuppressLint;
13 | import android.graphics.Canvas;
14 | import android.graphics.ColorFilter;
15 | import android.graphics.Paint;
16 | import android.graphics.PixelFormat;
17 | import android.graphics.Rect;
18 | import android.graphics.RectF;
19 | import android.graphics.drawable.Animatable;
20 | import android.graphics.drawable.Drawable;
21 | import android.util.Property;
22 | import android.view.animation.DecelerateInterpolator;
23 | import android.view.animation.Interpolator;
24 | import android.view.animation.LinearInterpolator;
25 |
26 | class CircularAnimatedDrawable extends Drawable implements Animatable {
27 |
28 | private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator();
29 | private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator();
30 | private static final int ANGLE_ANIMATOR_DURATION = 2000;
31 | private static final int SWEEP_ANIMATOR_DURATION = 600;
32 | public static final int MIN_SWEEP_ANGLE = 30;
33 | private final RectF fBounds = new RectF();
34 |
35 | private ObjectAnimator mObjectAnimatorSweep;
36 | private ObjectAnimator mObjectAnimatorAngle;
37 | private boolean mModeAppearing;
38 | private Paint mPaint;
39 | private float mCurrentGlobalAngleOffset;
40 | private float mCurrentGlobalAngle;
41 | private float mCurrentSweepAngle;
42 | private float mBorderWidth;
43 | private boolean mRunning;
44 |
45 | public CircularAnimatedDrawable(int color, float borderWidth) {
46 | mBorderWidth = borderWidth;
47 |
48 | mPaint = new Paint();
49 | mPaint.setAntiAlias(true);
50 | mPaint.setStyle(Paint.Style.STROKE);
51 | mPaint.setStrokeWidth(borderWidth);
52 | mPaint.setColor(color);
53 |
54 | setupAnimations();
55 | }
56 |
57 | @Override
58 | public void draw(Canvas canvas) {
59 | float startAngle = mCurrentGlobalAngle - mCurrentGlobalAngleOffset;
60 | float sweepAngle = mCurrentSweepAngle;
61 | if (!mModeAppearing) {
62 | startAngle = startAngle + sweepAngle;
63 | sweepAngle = 360 - sweepAngle - MIN_SWEEP_ANGLE;
64 | } else {
65 | sweepAngle += MIN_SWEEP_ANGLE;
66 | }
67 | canvas.drawArc(fBounds, startAngle, sweepAngle, false, mPaint);
68 | }
69 |
70 | @Override
71 | public void setAlpha(int alpha) {
72 | mPaint.setAlpha(alpha);
73 | }
74 |
75 | @Override
76 | public void setColorFilter(ColorFilter cf) {
77 | mPaint.setColorFilter(cf);
78 | }
79 |
80 |
81 | @Override
82 | public int getOpacity() {
83 | return PixelFormat.TRANSPARENT;
84 | }
85 |
86 | private void toggleAppearingMode() {
87 | mModeAppearing = !mModeAppearing;
88 | if (mModeAppearing) {
89 | mCurrentGlobalAngleOffset = (mCurrentGlobalAngleOffset + MIN_SWEEP_ANGLE * 2) % 360;
90 | }
91 | }
92 |
93 | @Override
94 | protected void onBoundsChange(Rect bounds) {
95 | super.onBoundsChange(bounds);
96 | fBounds.left = bounds.left + mBorderWidth / 2f + .5f;
97 | fBounds.right = bounds.right - mBorderWidth / 2f - .5f;
98 | fBounds.top = bounds.top + mBorderWidth / 2f + .5f;
99 | fBounds.bottom = bounds.bottom - mBorderWidth / 2f - .5f;
100 | }
101 |
102 | @SuppressLint("NewApi")
103 | private Property mAngleProperty =
104 | new Property(Float.class, "angle") {
105 | @Override
106 | public Float get(CircularAnimatedDrawable object) {
107 | return object.getCurrentGlobalAngle();
108 | }
109 |
110 | @Override
111 | public void set(CircularAnimatedDrawable object, Float value) {
112 | object.setCurrentGlobalAngle(value);
113 | }
114 | };
115 |
116 | @SuppressLint("NewApi")
117 | private Property mSweepProperty
118 | = new Property(Float.class, "arc") {
119 | @Override
120 | public Float get(CircularAnimatedDrawable object) {
121 | return object.getCurrentSweepAngle();
122 | }
123 |
124 | @Override
125 | public void set(CircularAnimatedDrawable object, Float value) {
126 | object.setCurrentSweepAngle(value);
127 | }
128 | };
129 |
130 | @SuppressLint("NewApi")
131 | private void setupAnimations() {
132 | mObjectAnimatorAngle = ObjectAnimator.ofFloat(this, mAngleProperty, 360f);
133 | mObjectAnimatorAngle.setInterpolator(ANGLE_INTERPOLATOR);
134 | mObjectAnimatorAngle.setDuration(ANGLE_ANIMATOR_DURATION);
135 | mObjectAnimatorAngle.setRepeatMode(ValueAnimator.RESTART);
136 | mObjectAnimatorAngle.setRepeatCount(ValueAnimator.INFINITE);
137 |
138 | mObjectAnimatorSweep = ObjectAnimator.ofFloat(this, mSweepProperty, 360f - MIN_SWEEP_ANGLE * 2);
139 | mObjectAnimatorSweep.setInterpolator(SWEEP_INTERPOLATOR);
140 | mObjectAnimatorSweep.setDuration(SWEEP_ANIMATOR_DURATION);
141 | mObjectAnimatorSweep.setRepeatMode(ValueAnimator.RESTART);
142 | mObjectAnimatorSweep.setRepeatCount(ValueAnimator.INFINITE);
143 | mObjectAnimatorSweep.addListener(new Animator.AnimatorListener() {
144 | @Override
145 | public void onAnimationStart(Animator animation) {
146 |
147 | }
148 |
149 | @Override
150 | public void onAnimationEnd(Animator animation) {
151 |
152 | }
153 |
154 | @Override
155 | public void onAnimationCancel(Animator animation) {
156 |
157 | }
158 |
159 | @Override
160 | public void onAnimationRepeat(Animator animation) {
161 | toggleAppearingMode();
162 | }
163 | });
164 | }
165 |
166 | @Override
167 | public void start() {
168 | if (isRunning()) {
169 | return;
170 | }
171 | mRunning = true;
172 | mObjectAnimatorAngle.start();
173 | mObjectAnimatorSweep.start();
174 | invalidateSelf();
175 | }
176 |
177 | @SuppressLint("NewApi")
178 | @Override
179 | public void stop() {
180 | if (!isRunning()) {
181 | return;
182 | }
183 | mRunning = false;
184 | mObjectAnimatorAngle.cancel();
185 | mObjectAnimatorSweep.cancel();
186 | invalidateSelf();
187 | }
188 |
189 | @Override
190 | public boolean isRunning() {
191 | return mRunning;
192 | }
193 |
194 | public void setCurrentGlobalAngle(float currentGlobalAngle) {
195 | mCurrentGlobalAngle = currentGlobalAngle;
196 | invalidateSelf();
197 | }
198 |
199 | public float getCurrentGlobalAngle() {
200 | return mCurrentGlobalAngle;
201 | }
202 |
203 | public void setCurrentSweepAngle(float currentSweepAngle) {
204 | mCurrentSweepAngle = currentSweepAngle;
205 | invalidateSelf();
206 | }
207 |
208 | public float getCurrentSweepAngle() {
209 | return mCurrentSweepAngle;
210 | }
211 |
212 | }
213 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/dd/loadlingButton/CircularProgressButton.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/dd/loadlingButton/CircularProgressButton.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/dd/loadlingButton/CircularProgressDrawable.java:
--------------------------------------------------------------------------------
1 | package com.dd.loadlingButton;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.ColorFilter;
5 | import android.graphics.Paint;
6 | import android.graphics.Path;
7 | import android.graphics.Rect;
8 | import android.graphics.RectF;
9 | import android.graphics.drawable.Drawable;
10 |
11 | class CircularProgressDrawable extends Drawable {
12 |
13 | private float mSweepAngle;
14 | private float mStartAngle;
15 | private int mSize;
16 | private int mStrokeWidth;
17 | private int mStrokeColor;
18 |
19 | public CircularProgressDrawable(int size, int strokeWidth, int strokeColor) {
20 | mSize = size;
21 | mStrokeWidth = strokeWidth;
22 | mStrokeColor = strokeColor;
23 | mStartAngle = -90;
24 | mSweepAngle = 0;
25 | }
26 |
27 | public void setSweepAngle(float sweepAngle) {
28 | mSweepAngle = sweepAngle;
29 | }
30 |
31 | public int getSize() {
32 | return mSize;
33 | }
34 |
35 | @Override
36 | public void draw(Canvas canvas) {
37 | final Rect bounds = getBounds();
38 |
39 | if (mPath == null) {
40 | mPath = new Path();
41 | }
42 | mPath.reset();
43 | mPath.addArc(getRect(), mStartAngle, mSweepAngle);
44 | mPath.offset(bounds.left, bounds.top);
45 | canvas.drawPath(mPath, createPaint());
46 | }
47 |
48 | @Override
49 | public void setAlpha(int alpha) {
50 |
51 | }
52 |
53 | @Override
54 | public void setColorFilter(ColorFilter cf) {
55 | }
56 |
57 | @Override
58 | public int getOpacity() {
59 | return 1;
60 | }
61 |
62 | private RectF mRectF;
63 | private Paint mPaint;
64 | private Path mPath;
65 |
66 | private RectF getRect() {
67 | if (mRectF == null) {
68 | int index = mStrokeWidth / 2;
69 | mRectF = new RectF(index, index, getSize() - index, getSize() - index);
70 | }
71 | return mRectF;
72 | }
73 |
74 | private Paint createPaint() {
75 | if (mPaint == null) {
76 | mPaint = new Paint();
77 | mPaint.setAntiAlias(true);
78 | mPaint.setStyle(Paint.Style.STROKE);
79 | mPaint.setStrokeWidth(mStrokeWidth);
80 | mPaint.setColor(mStrokeColor);
81 | }
82 |
83 | return mPaint;
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/dd/loadlingButton/MorphingAnimation.java:
--------------------------------------------------------------------------------
1 | package com.dd.loadlingButton;
2 |
3 | import java.util.ArrayList;
4 | import java.util.Vector;
5 |
6 | import android.animation.Animator;
7 | import android.animation.AnimatorSet;
8 | import android.animation.ArgbEvaluator;
9 | import android.animation.ObjectAnimator;
10 | import android.animation.ValueAnimator;
11 | import android.graphics.drawable.GradientDrawable;
12 | import android.widget.TextView;
13 |
14 | class MorphingAnimation
15 | {
16 |
17 | public static final int DURATION_NORMAL = 400;
18 | public static final int DURATION_INSTANT = 1;
19 |
20 | private OnAnimationEndListener mListener;
21 |
22 | private int mDuration;
23 |
24 | private int mFromWidth;
25 | private int mToWidth;
26 |
27 | private int mFromColor;
28 | private int mToColor;
29 |
30 | private int mFromStrokeColor;
31 | private int mToStrokeColor;
32 | private float mFromCornerRadius;
33 | private float mToCornerRadius;
34 |
35 | private float mPadding;
36 |
37 | private TextView mView;
38 | private StrokeGradientDrawable mDrawable;
39 |
40 | public MorphingAnimation(TextView viewGroup, StrokeGradientDrawable drawable) {
41 | mView = viewGroup;
42 | mDrawable = drawable;
43 | }
44 |
45 | public void setDuration(int duration)
46 | {
47 | mDuration = duration;
48 | }
49 |
50 | public void setListener(OnAnimationEndListener listener)
51 | {
52 | mListener = listener;
53 | }
54 |
55 | public void setFromWidth(int fromWidth)
56 | {
57 | mFromWidth = fromWidth;
58 | }
59 |
60 | public void setToWidth(int toWidth)
61 | {
62 | mToWidth = toWidth;
63 | }
64 |
65 | public void setFromColor(int fromColor)
66 | {
67 | mFromColor = fromColor;
68 | }
69 |
70 | public void setToColor(int toColor)
71 | {
72 | mToColor = toColor;
73 | }
74 |
75 | public void setFromStrokeColor(int fromStrokeColor)
76 | {
77 | mFromStrokeColor = fromStrokeColor;
78 | }
79 |
80 | public void setToStrokeColor(int toStrokeColor)
81 | {
82 | mToStrokeColor = toStrokeColor;
83 | }
84 |
85 | public void setFromCornerRadius(float fromCornerRadius)
86 | {
87 | mFromCornerRadius = fromCornerRadius;
88 | }
89 |
90 | public void setToCornerRadius(float toCornerRadius)
91 | {
92 | mToCornerRadius = toCornerRadius;
93 | }
94 |
95 | public void setPadding(float padding)
96 | {
97 | mPadding = padding;
98 | }
99 |
100 | public void start()
101 | {
102 | ValueAnimator widthAnimation = ValueAnimator.ofInt(mFromWidth, mToWidth);
103 | final GradientDrawable gradientDrawable = mDrawable.getGradientDrawable();
104 | widthAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener()
105 | {
106 | @Override
107 | public void onAnimationUpdate(ValueAnimator animation)
108 | {
109 | Integer value = (Integer) animation.getAnimatedValue();
110 | int leftOffset;
111 | int rightOffset;
112 | int padding;
113 |
114 | if (mFromWidth > mToWidth)
115 | {
116 | leftOffset = (mFromWidth - value) / 2;
117 | rightOffset = mFromWidth - leftOffset;
118 | padding = (int) (mPadding * animation.getAnimatedFraction());
119 | } else
120 | {
121 | leftOffset = (mToWidth - value) / 2;
122 | rightOffset = mToWidth - leftOffset;
123 | padding = (int) (mPadding - mPadding * animation.getAnimatedFraction());
124 | }
125 |
126 | gradientDrawable.setBounds(leftOffset + padding, padding, rightOffset - padding, mView.getHeight() - padding);
127 | }
128 | });
129 |
130 | ObjectAnimator bgColorAnimation = ObjectAnimator.ofInt(gradientDrawable, "color", mFromColor, mToColor);
131 | bgColorAnimation.setEvaluator(new ArgbEvaluator());
132 |
133 | ObjectAnimator strokeColorAnimation = ObjectAnimator.ofInt(mDrawable, "strokeColor", mFromStrokeColor, mToStrokeColor);
134 | strokeColorAnimation.setEvaluator(new ArgbEvaluator());
135 |
136 | ObjectAnimator cornerAnimation = ObjectAnimator.ofFloat(gradientDrawable, "cornerRadius", mFromCornerRadius,
137 | mToCornerRadius);
138 | AnimatorSet animatorSet = new AnimatorSet();
139 | animatorSet.setDuration(mDuration);
140 | animatorSet.playTogether(widthAnimation, bgColorAnimation, strokeColorAnimation, cornerAnimation);
141 | animatorSet.addListener(new Animator.AnimatorListener()
142 | {
143 | @Override
144 | public void onAnimationStart(Animator animation)
145 | {
146 |
147 | }
148 |
149 | @Override
150 | public void onAnimationEnd(Animator animation)
151 | {
152 | if (mListener != null)
153 | {
154 | mListener.onAnimationEnd();
155 | }
156 | }
157 |
158 | @Override
159 | public void onAnimationCancel(Animator animation)
160 | {
161 |
162 | }
163 |
164 | @Override
165 | public void onAnimationRepeat(Animator animation)
166 | {
167 |
168 | }
169 | });
170 | animatorSet.start();
171 | }
172 | }
--------------------------------------------------------------------------------
/PhoneSafer/src/com/dd/loadlingButton/OnAnimationEndListener.java:
--------------------------------------------------------------------------------
1 | package com.dd.loadlingButton;
2 |
3 | interface OnAnimationEndListener {
4 |
5 | public void onAnimationEnd();
6 | }
7 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/dd/loadlingButton/StateManager.java:
--------------------------------------------------------------------------------
1 | package com.dd.loadlingButton;
2 |
3 | class StateManager {
4 |
5 | private boolean mIsEnabled;
6 | private int mProgress;
7 |
8 | public StateManager(CircularProgressButton progressButton) {
9 | mIsEnabled = progressButton.isEnabled();
10 | mProgress = progressButton.getProgress();
11 | }
12 |
13 | public void saveProgress(CircularProgressButton progressButton) {
14 | mProgress = progressButton.getProgress();
15 | }
16 |
17 | public boolean isEnabled() {
18 | return mIsEnabled;
19 | }
20 |
21 | public int getProgress() {
22 | return mProgress;
23 | }
24 |
25 | public void checkState(CircularProgressButton progressButton) {
26 | if (progressButton.getProgress() != getProgress()) {
27 | progressButton.setProgress(progressButton.getProgress());
28 | } else if(progressButton.isEnabled() != isEnabled()) {
29 | progressButton.setEnabled(progressButton.isEnabled());
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/dd/loadlingButton/StrokeGradientDrawable.java:
--------------------------------------------------------------------------------
1 | package com.dd.loadlingButton;
2 |
3 | import android.graphics.drawable.GradientDrawable;
4 |
5 | /**
6 | *
7 | * @author
8 | *
9 | */
10 | public class StrokeGradientDrawable {
11 |
12 | private int mStrokeWidth;
13 | private int mStrokeColor;
14 |
15 | private GradientDrawable mGradientDrawable;
16 |
17 | public StrokeGradientDrawable(GradientDrawable drawable) {
18 | mGradientDrawable = drawable;
19 | }
20 |
21 | public int getStrokeWidth() {
22 | return mStrokeWidth;
23 | }
24 |
25 | public void setStrokeWidth(int strokeWidth) {
26 | mStrokeWidth = strokeWidth;
27 | mGradientDrawable.setStroke(strokeWidth, getStrokeColor());
28 | }
29 |
30 | public int getStrokeColor() {
31 | return mStrokeColor;
32 | }
33 |
34 | public void setStrokeColor(int strokeColor) {
35 | mStrokeColor = strokeColor;
36 | mGradientDrawable.setStroke(getStrokeWidth(), strokeColor);
37 | }
38 |
39 | public GradientDrawable getGradientDrawable() {
40 | return mGradientDrawable;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/.gitignore:
--------------------------------------------------------------------------------
1 | /TestNewFile.java
2 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/AsyncTaskTest.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/AsyncTaskTest.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/BaseActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/BaseActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/BaseActivityAbstrat.java:
--------------------------------------------------------------------------------
1 | /*
2 | *@author Dawin,2015-1-20
3 | *
4 | *
5 | *
6 | */
7 | package com.hy2014.phonesafer.activity;
8 |
9 | import android.app.Activity;
10 | import android.os.Bundle;
11 |
12 | public abstract class BaseActivityAbstrat extends Activity
13 | {
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | init();
18 | }
19 |
20 | public void init(){
21 | setContentView();
22 | findViews();
23 | getData();
24 | showContent();
25 | }
26 |
27 | public abstract void setContentView();
28 | public abstract void findViews();
29 | public abstract void getData();
30 | public abstract void showContent();
31 | }
32 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/BitmapLoadTest.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/BitmapLoadTest.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/DeviceManagerActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/DeviceManagerActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/HomeKeyLocker.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/HomeKeyLocker.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/HowViewDraw.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/HowViewDraw.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/MainActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/MainActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/MediaButtonReceiver.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/MediaButtonReceiver.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/SelectRingTypeActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/SelectRingTypeActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingDelayTimeActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingDelayTimeActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingModelActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingModelActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingPasswordActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingPasswordActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingRingActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingRingActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingXYAngleActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/SettingXYAngleActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/activity/WelcomeActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/activity/WelcomeActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/adapter/RingAppSettingAdapter.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/adapter/RingAppSettingAdapter.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/adapter/RingSettingAdapter.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/adapter/RingSettingAdapter.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/broadcast/AdminReceiver.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/broadcast/AdminReceiver.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/fragment/Fragment1.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/fragment/Fragment1.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/fragment/Fragment2.java:
--------------------------------------------------------------------------------
1 | /*
2 | *@author Dawin,2015-1-20
3 | *
4 | *
5 | *
6 | */
7 | package com.hy2014.phonesafer.fragment;
8 |
9 | import com.hy2014.phonesafer.R;
10 |
11 | import android.app.Fragment;
12 | import android.os.Bundle;
13 | import android.view.LayoutInflater;
14 | import android.view.View;
15 | import android.view.ViewGroup;
16 |
17 | public class Fragment2 extends Fragment
18 | {
19 | @Override
20 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
21 | {
22 | return inflater.inflate(R.layout.fragment2, container, false);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/fragment/FragmentMainRotatActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/fragment/FragmentMainRotatActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/gestureLock/GesturUnlockActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/gestureLock/GesturUnlockActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/gestureLock/GestureLockSettingActivity.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/gestureLock/GestureLockSettingActivity.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/gestureLock/GestureLockView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/gestureLock/GestureLockView.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/gestureLock/MyCircle.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/gestureLock/MyCircle.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/service/AppService.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/service/AppService.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/utils/ActivityUtil.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/utils/ActivityUtil.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/utils/BitmapUtil.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/utils/BitmapUtil.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/utils/ConnectHttp.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/utils/ConnectHttp.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/utils/DrawableManager.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/utils/DrawableManager.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/utils/LogUtil.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/utils/LogUtil.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/utils/ObjectTransfer.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/utils/ObjectTransfer.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/utils/SortAlgorithm.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/utils/SortAlgorithm.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/utils/ToastUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | *@author Dawin,2015-1-29
3 | *
4 | *
5 | *
6 | */
7 | package com.hy2014.phonesafer.utils;
8 |
9 | import android.content.Context;
10 | import android.widget.Toast;
11 |
12 | public class ToastUtil
13 | {
14 | public static void makeText(Context context,String msg)
15 | {
16 | Toast.makeText(context, msg, Toast.LENGTH_LONG).show();
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/view/CheckSwitchButton.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/view/CheckSwitchButton.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/view/CustomImageView.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/view/CustomImageView.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/view/FrameAnimationController.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/view/FrameAnimationController.java
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/view/GaugeChart01View.java:
--------------------------------------------------------------------------------
1 |
2 | package com.hy2014.phonesafer.view;
3 | /**
4 | * Copyright 2014 XCL-Charts
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 | * @Project XCL-Charts
19 | * @Description Android图表基类库
20 | * @author XiongChuanLiang
(xcl_168@aliyun.com)
21 | * @Copyright Copyright (c) 2014 XCL-Charts (www.xclcharts.com)
22 | * @license http://www.apache.org/licenses/ Apache v2 License
23 | * @version 1.0
24 | */
25 |
26 | import java.util.ArrayList;
27 | import java.util.List;
28 |
29 | import org.xclcharts.chart.GaugeChart;
30 | import org.xclcharts.renderer.XEnum.SliceLabelStyle;
31 | import org.xclcharts.view.GraphicalView;
32 |
33 | import com.hy2014.phonesafer.utils.LogUtil;
34 |
35 | import android.content.Context;
36 | import android.graphics.Canvas;
37 | import android.graphics.Color;
38 | import android.util.AttributeSet;
39 | import android.util.Log;
40 | import android.util.Pair;
41 |
42 | /**
43 | *仪表盘例子
44 | *
45 | * @author XiongChuanLiang
(xcl_168@aliyun.com)
46 | * 加入xcl-charts.jar
47 | */
48 | public class GaugeChart01View extends GraphicalView {
49 |
50 | private String TAG = "GaugeChart01View";
51 | private GaugeChart chart = new GaugeChart();
52 |
53 | private List mLabels = new ArrayList();
54 | private List mPartitionSet = new ArrayList();
55 | private float mAngle = 0.0f;
56 |
57 | public GaugeChart01View(Context context) {
58 | super(context);
59 | initView();
60 | }
61 |
62 | public GaugeChart01View(Context context, AttributeSet attrs){
63 | super(context, attrs);
64 | initView();
65 | }
66 |
67 | public GaugeChart01View(Context context, AttributeSet attrs, int defStyle) {
68 | super(context, attrs, defStyle);
69 | initView();
70 | }
71 |
72 | private void initView()
73 | {
74 | chartLabels();
75 | chartDataSet();
76 | chartRender();
77 | }
78 |
79 | @Override
80 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {
81 | super.onSizeChanged(w, h, oldw, oldh);
82 | //图所占范围大小
83 | //xml中的设置: android:layout_width="300dip"
84 | // android:layout_height="300dip"
85 | chart.setChartRange(w ,h );
86 | //绘图区范围
87 | //左右各缩进10%
88 | //int offsetX = DensityUtil.dip2px(getContext(), (float) (300 * 0.1));
89 | //偏移高度的25%下来
90 | //int offsetY = DensityUtil.dip2px(getContext(), (float) (300 * 0.25));
91 | // chart.setPadding(offsetY, 0, 0, 0);
92 |
93 | }
94 |
95 | /**
96 | * 设置当前角度
97 | *
98 | * @param currentAngle
99 | * 角度
100 | */
101 | public void setAngle(float currentAngle)
102 | {
103 |
104 | mAngle = currentAngle;
105 | // 设置当前指向角度(0-180).
106 | chart.setCurrentAngle(mAngle);
107 | // 刷新控件
108 | invalidate();
109 |
110 | }
111 | /**
112 | * 设置分区并刷新
113 | */
114 | public void drawPartition(List mPartitionSet)
115 | {
116 | setPartition(mPartitionSet);
117 | chart.setPartition(mPartitionSet);
118 | invalidate();
119 | }
120 |
121 | /**
122 | * 设置分区
123 | */
124 | public void setPartition(List mPartitionSet)
125 | {
126 | this.mPartitionSet=mPartitionSet;
127 | }
128 | /**
129 | * 设置表盘数据:
130 | * 设置步长、标签、分区、角度
131 | *
132 | */
133 | public void chartRender()
134 | {
135 | try {
136 | //设置标题
137 | //chart.setTitle("刻度盘 ");
138 |
139 | //刻度步长
140 | chart.setTickSteps(10d);
141 |
142 | //标签(标签和步长分开,步长即刻度可以密点,标签可以松点)
143 | chart.setCategories(mLabels);
144 |
145 | //分区
146 | chart.setPartition(mPartitionSet);
147 |
148 | //设置当前指向角度(0-180).
149 | //chart.setCurrentAngle(90f);
150 | chart.setCurrentAngle(mAngle);
151 | //绘制边框
152 | //chart.showRoundBorder();
153 | } catch (Exception e) {
154 | Log.e(TAG, e.toString());
155 | }
156 |
157 | }
158 |
159 |
160 | //分区[角度(0-mStartAngle),颜色]
161 | private void chartDataSet()
162 | {
163 | int Angle = 180/3;
164 | mPartitionSet.add(new Pair((float)Angle, Color.rgb(73, 172, 72)));
165 | mPartitionSet.add(new Pair((float)Angle, Color.rgb(247, 156, 27)));
166 | mPartitionSet.add(new Pair((float)Angle, Color.rgb(224, 62, 54)));
167 | }
168 |
169 | private void chartLabels()
170 | {
171 | //标签
172 | /*mLabels.add("起始");
173 | mLabels.add("安全");
174 | mLabels.add("90°");
175 | mLabels.add("危险");
176 | mLabels.add("终止");*/
177 |
178 | mLabels.add("0°");
179 | mLabels.add("");
180 | mLabels.add("90°");
181 | mLabels.add("");
182 | mLabels.add("180°");
183 |
184 | }
185 |
186 | /**
187 | * 刷新
188 | */
189 | @Override
190 | public void render(Canvas canvas) {
191 | try{
192 |
193 | chart.render(canvas);
194 | } catch (Exception e){
195 | Log.e(TAG, e.toString());
196 | }
197 | }
198 | }
199 |
200 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/view/SeekArc.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * The MIT License (MIT)
3 | *
4 | * Copyright (c) 2013 Triggertrap Ltd
5 | * Author Neil Davies
6 | *
7 | * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 | * this software and associated documentation files (the "Software"), to deal in
9 | * the Software without restriction, including without limitation the rights to
10 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 | * the Software, and to permit persons to whom the Software is furnished to do so,
12 | * subject to the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be included in all
15 | * copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 | ******************************************************************************/
24 | package com.hy2014.phonesafer.view;
25 |
26 | import com.hy2014.phonesafer.R;
27 |
28 | import android.content.Context;
29 | import android.content.res.Resources;
30 | import android.content.res.TypedArray;
31 | import android.graphics.Canvas;
32 | import android.graphics.Paint;
33 | import android.graphics.RectF;
34 | import android.graphics.drawable.Drawable;
35 | import android.util.AttributeSet;
36 | import android.util.Log;
37 | import android.view.MotionEvent;
38 | import android.view.View;
39 |
40 | /**
41 | *
42 | * SeekArc.java
43 | *
44 | * This is a class that functions much like a SeekBar but
45 | * follows a circle path instead of a straight line.
46 | *
47 | * @author Neil Davies
48 | *
49 | */
50 | public class SeekArc extends View {
51 |
52 | private static final String TAG = SeekArc.class.getSimpleName();
53 | private static int INVALID_PROGRESS_VALUE = -1;
54 | // The initial rotational offset -90 means we start at 12 o'clock
55 | private final int mAngleOffset = -90;
56 |
57 | /**
58 | * The Drawable for the seek arc thumbnail
59 | */
60 | private Drawable mThumb;
61 |
62 | /**
63 | * The Maximum value that this SeekArc can be set to
64 | */
65 | private int mMax = 100;
66 |
67 | /**
68 | * The Current value that the SeekArc is set to
69 | */
70 | private int mProgress = 0;
71 |
72 | /**
73 | * The width of the progress line for this SeekArc
74 | */
75 | private int mProgressWidth = 4;
76 |
77 | /**
78 | * The Width of the background arc for the SeekArc
79 | */
80 | private int mArcWidth = 2;
81 |
82 | /**
83 | * The Angle to start drawing this Arc from
84 | */
85 | private int mStartAngle = 0;
86 |
87 | /**
88 | * The Angle through which to draw the arc (Max is 360)
89 | */
90 | private int mSweepAngle = 360;
91 |
92 | /**
93 | * The rotation of the SeekArc- 0 is twelve o'clock
94 | */
95 | private int mRotation = 0;
96 |
97 | /**
98 | * Give the SeekArc rounded edges
99 | */
100 | private boolean mRoundedEdges = false;
101 |
102 | /**
103 | * Enable touch inside the SeekArc
104 | */
105 | private boolean mTouchInside = true;
106 |
107 | /**
108 | * Will the progress increase clockwise or anti-clockwise
109 | */
110 | private boolean mClockwise = true;
111 |
112 | // Internal variables
113 | private int mArcRadius = 0;
114 | private float mProgressSweep = 0;
115 | private RectF mArcRect = new RectF();
116 | private Paint mArcPaint;
117 | private Paint mProgressPaint;
118 | private int mTranslateX;
119 | private int mTranslateY;
120 | private int mThumbXPos;
121 | private int mThumbYPos;
122 | private double mTouchAngle;
123 | private float mTouchIgnoreRadius;
124 | private OnSeekArcChangeListener mOnSeekArcChangeListener;
125 |
126 | public interface OnSeekArcChangeListener {
127 |
128 | /**
129 | * Notification that the progress level has changed. Clients can use the
130 | * fromUser parameter to distinguish user-initiated changes from those
131 | * that occurred programmatically.
132 | *
133 | * @param seekArc
134 | * The SeekArc whose progress has changed
135 | * @param progress
136 | * The current progress level. This will be in the range
137 | * 0..max where max was set by
138 | * {@link ProgressArc#setMax(int)}. (The default value for
139 | * max is 100.)
140 | * @param fromUser
141 | * True if the progress change was initiated by the user.
142 | */
143 | void onProgressChanged(SeekArc seekArc, int progress, boolean fromUser);
144 |
145 | /**
146 | * Notification that the user has started a touch gesture. Clients may
147 | * want to use this to disable advancing the seekbar.
148 | *
149 | * @param seekArc
150 | * The SeekArc in which the touch gesture began
151 | */
152 | void onStartTrackingTouch(SeekArc seekArc);
153 |
154 | /**
155 | * Notification that the user has finished a touch gesture. Clients may
156 | * want to use this to re-enable advancing the seekarc.
157 | *
158 | * @param seekArc
159 | * The SeekArc in which the touch gesture began
160 | */
161 | void onStopTrackingTouch(SeekArc seekArc);
162 | }
163 |
164 | public SeekArc(Context context) {
165 | super(context);
166 | init(context, null, 0);
167 | }
168 |
169 | public SeekArc(Context context, AttributeSet attrs) {
170 | super(context, attrs);
171 | init(context, attrs, R.attr.seekArcStyle);
172 | }
173 |
174 | public SeekArc(Context context, AttributeSet attrs, int defStyle) {
175 | super(context, attrs, defStyle);
176 | init(context, attrs, defStyle);
177 | }
178 |
179 | private void init(Context context, AttributeSet attrs, int defStyle) {
180 |
181 | Log.d(TAG, "Initialising SeekArc");
182 | final Resources res = getResources();
183 | float density = context.getResources().getDisplayMetrics().density;
184 |
185 | // Defaults, may need to link this into theme settings
186 | int arcColor = res.getColor(R.color.progress_gray);
187 | int progressColor = res.getColor(android.R.color.holo_blue_light);
188 | int thumbHalfheight = 0;
189 | int thumbHalfWidth = 0;
190 | mThumb = res.getDrawable(R.drawable.seek_arc_control_selector);
191 | // Convert progress width to pixels for current density
192 | mProgressWidth = (int) (mProgressWidth * density);
193 |
194 |
195 | if (attrs != null) {
196 | // Attribute initialization
197 | final TypedArray a = context.obtainStyledAttributes(attrs,
198 | R.styleable.SeekArc, defStyle, 0);
199 |
200 | Drawable thumb = a.getDrawable(R.styleable.SeekArc_thumb);
201 | if (thumb != null) {
202 | mThumb = thumb;
203 | }
204 |
205 |
206 |
207 | thumbHalfheight = (int) mThumb.getIntrinsicHeight() / 2;
208 | thumbHalfWidth = (int) mThumb.getIntrinsicWidth() / 2;
209 | mThumb.setBounds(-thumbHalfWidth, -thumbHalfheight, thumbHalfWidth,
210 | thumbHalfheight);
211 |
212 | mMax = a.getInteger(R.styleable.SeekArc_max0, mMax);
213 | mProgress = a.getInteger(R.styleable.SeekArc_progress, mProgress);
214 | mProgressWidth = (int) a.getDimension(
215 | R.styleable.SeekArc_progressWidth, mProgressWidth);
216 | mArcWidth = (int) a.getDimension(R.styleable.SeekArc_arcWidth,
217 | mArcWidth);
218 | mStartAngle = a.getInt(R.styleable.SeekArc_startAngle, mStartAngle);
219 | mSweepAngle = a.getInt(R.styleable.SeekArc_sweepAngle, mSweepAngle);
220 | mRotation = a.getInt(R.styleable.SeekArc_rotation, mRotation);
221 | mRoundedEdges = a.getBoolean(R.styleable.SeekArc_roundEdges,
222 | mRoundedEdges);
223 | mTouchInside = a.getBoolean(R.styleable.SeekArc_touchInside,
224 | mTouchInside);
225 | mClockwise = a.getBoolean(R.styleable.SeekArc_clockwise,
226 | mClockwise);
227 |
228 | arcColor = a.getColor(R.styleable.SeekArc_arcColor, arcColor);
229 | progressColor = a.getColor(R.styleable.SeekArc_progressColor,
230 | progressColor);
231 |
232 | a.recycle();
233 | }
234 |
235 | mProgress = (mProgress > mMax) ? mMax : mProgress;
236 | mProgress = (mProgress < 0) ? 0 : mProgress;
237 |
238 | mSweepAngle = (mSweepAngle > 360) ? 360 : mSweepAngle;
239 | mSweepAngle = (mSweepAngle < 0) ? 0 : mSweepAngle;
240 |
241 | mStartAngle = (mStartAngle > 360) ? 0 : mStartAngle;
242 | mStartAngle = (mStartAngle < 0) ? 0 : mStartAngle;
243 |
244 | mArcPaint = new Paint();
245 | mArcPaint.setColor(arcColor);
246 | mArcPaint.setAntiAlias(true);
247 | mArcPaint.setStyle(Paint.Style.STROKE);
248 | mArcPaint.setStrokeWidth(mArcWidth);
249 | //mArcPaint.setAlpha(45);
250 |
251 | mProgressPaint = new Paint();
252 | mProgressPaint.setColor(progressColor);
253 | mProgressPaint.setAntiAlias(true);
254 | mProgressPaint.setStyle(Paint.Style.STROKE);
255 | mProgressPaint.setStrokeWidth(mProgressWidth);
256 |
257 | if (mRoundedEdges) {
258 | mArcPaint.setStrokeCap(Paint.Cap.ROUND);
259 | mProgressPaint.setStrokeCap(Paint.Cap.ROUND);
260 | }
261 | }
262 |
263 | @Override
264 | protected void onDraw(Canvas canvas) {
265 | if(!mClockwise) {
266 | canvas.scale(-1, 1, mArcRect.centerX(), mArcRect.centerY() );
267 | }
268 |
269 | // Draw the arcs
270 | final int arcStart = mStartAngle + mAngleOffset + mRotation;
271 | final int arcSweep = mSweepAngle;
272 | canvas.drawArc(mArcRect, arcStart, arcSweep, false, mArcPaint);
273 | canvas.drawArc(mArcRect, arcStart, mProgressSweep, false,
274 | mProgressPaint);
275 |
276 | // Draw the thumb nail
277 | canvas.translate(mTranslateX -mThumbXPos, mTranslateY -mThumbYPos);
278 | mThumb.draw(canvas);
279 | }
280 |
281 |
282 | @Override
283 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
284 |
285 | final int height = getDefaultSize(getSuggestedMinimumHeight(),
286 | heightMeasureSpec);
287 | final int width = getDefaultSize(getSuggestedMinimumWidth(),
288 | widthMeasureSpec);
289 | final int min = Math.min(width, height);
290 | float top = 0;
291 | float left = 0;
292 | int arcDiameter = 0;
293 |
294 | mTranslateX = (int) (width * 0.5f);
295 | mTranslateY = (int) (height * 0.5f);
296 |
297 | arcDiameter = min - getPaddingLeft();
298 | mArcRadius = arcDiameter / 2;
299 | top = height / 2 - (arcDiameter / 2);
300 | left = width / 2 - (arcDiameter / 2);
301 | mArcRect.set(left, top, left + arcDiameter, top + arcDiameter);
302 |
303 | int arcStart = (int)mProgressSweep + mStartAngle + mRotation + 90;
304 | mThumbXPos = (int) (mArcRadius * Math.cos(Math.toRadians(arcStart)));
305 | mThumbYPos = (int) (mArcRadius * Math.sin(Math.toRadians(arcStart)));
306 |
307 | setTouchInSide(mTouchInside);
308 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
309 | }
310 |
311 | @Override
312 | public boolean onTouchEvent(MotionEvent event) {
313 | switch (event.getAction()) {
314 | case MotionEvent.ACTION_DOWN:
315 | onStartTrackingTouch();
316 | updateOnTouch(event);
317 | break;
318 | case MotionEvent.ACTION_MOVE:
319 | updateOnTouch(event);
320 | break;
321 | case MotionEvent.ACTION_UP:
322 | onStopTrackingTouch();
323 | setPressed(false);
324 | break;
325 | case MotionEvent.ACTION_CANCEL:
326 | onStopTrackingTouch();
327 | setPressed(false);
328 |
329 | break;
330 | }
331 |
332 | return true;
333 | }
334 |
335 | @Override
336 | protected void drawableStateChanged() {
337 | super.drawableStateChanged();
338 | if (mThumb != null && mThumb.isStateful()) {
339 | int[] state = getDrawableState();
340 | mThumb.setState(state);
341 | }
342 | invalidate();
343 | }
344 |
345 | private void onStartTrackingTouch() {
346 | if (mOnSeekArcChangeListener != null) {
347 | mOnSeekArcChangeListener.onStartTrackingTouch(this);
348 | }
349 | }
350 |
351 | private void onStopTrackingTouch() {
352 | if (mOnSeekArcChangeListener != null) {
353 | mOnSeekArcChangeListener.onStopTrackingTouch(this);
354 | }
355 | }
356 |
357 | private void updateOnTouch(MotionEvent event) {
358 | boolean ignoreTouch = ignoreTouch(event.getX(), event.getY());
359 | if (ignoreTouch) {
360 | return;
361 | }
362 | setPressed(true);
363 | mTouchAngle = getTouchDegrees(event.getX(), event.getY());
364 | int progress = getProgressForAngle(mTouchAngle);
365 | onProgressRefresh(progress, true);
366 | }
367 |
368 | private boolean ignoreTouch(float xPos, float yPos) {
369 | boolean ignore = false;
370 | float x = xPos - mTranslateX;
371 | float y = yPos - mTranslateY;
372 |
373 | float touchRadius = (float) Math.sqrt(((x * x) + (y * y)));
374 | if (touchRadius < mTouchIgnoreRadius) {
375 | ignore = true;
376 | }
377 | return ignore;
378 | }
379 |
380 | private double getTouchDegrees(float xPos, float yPos) {
381 | float x = xPos - mTranslateX;
382 | float y = yPos - mTranslateY;
383 | //invert the x-coord if we are rotating anti-clockwise
384 | x= (mClockwise) ? x:-x;
385 | // convert to arc Angle
386 | double angle = Math.toDegrees(Math.atan2(y, x) + (Math.PI / 2)
387 | - Math.toRadians(mRotation));
388 | if (angle < 0) {
389 | angle = 360 + angle;
390 | }
391 | angle -= mStartAngle;
392 | return angle;
393 | }
394 |
395 | private int getProgressForAngle(double angle) {
396 | int touchProgress = (int) Math.round(valuePerDegree() * angle);
397 |
398 | touchProgress = (touchProgress < 0) ? INVALID_PROGRESS_VALUE
399 | : touchProgress;
400 | touchProgress = (touchProgress > mMax) ? INVALID_PROGRESS_VALUE
401 | : touchProgress;
402 | return touchProgress;
403 | }
404 |
405 | private float valuePerDegree() {
406 | return (float) mMax / mSweepAngle;
407 | }
408 |
409 | private void onProgressRefresh(int progress, boolean fromUser) {
410 | updateProgress(progress, fromUser);
411 | }
412 |
413 | private void updateThumbPosition() {
414 | int thumbAngle = (int) (mStartAngle + mProgressSweep + mRotation + 90);
415 | mThumbXPos = (int) (mArcRadius * Math.cos(Math.toRadians(thumbAngle)));
416 | mThumbYPos = (int) (mArcRadius * Math.sin(Math.toRadians(thumbAngle)));
417 | }
418 |
419 | private void updateProgress(int progress, boolean fromUser) {
420 |
421 | if (progress == INVALID_PROGRESS_VALUE) {
422 | return;
423 | }
424 |
425 | if (mOnSeekArcChangeListener != null) {
426 | mOnSeekArcChangeListener
427 | .onProgressChanged(this, progress, fromUser);
428 | }
429 |
430 | progress = (progress > mMax) ? mMax : progress;
431 | progress = (mProgress < 0) ? 0 : progress;
432 |
433 | mProgress = progress;
434 | mProgressSweep = (float) progress / mMax * mSweepAngle;
435 |
436 | updateThumbPosition();
437 |
438 | invalidate();
439 | }
440 |
441 | /**
442 | * Sets a listener to receive notifications of changes to the SeekArc's
443 | * progress level. Also provides notifications of when the user starts and
444 | * stops a touch gesture within the SeekArc.
445 | *
446 | * @param l
447 | * The seek bar notification listener
448 | *
449 | * @see SeekArc.OnSeekBarChangeListener
450 | */
451 | public void setOnSeekArcChangeListener(OnSeekArcChangeListener l) {
452 | mOnSeekArcChangeListener = l;
453 | }
454 |
455 | public void setProgress(int progress) {
456 | updateProgress(progress, false);
457 | }
458 |
459 | public int getProgressWidth() {
460 | return mProgressWidth;
461 | }
462 |
463 | public void setProgressWidth(int mProgressWidth) {
464 | this.mProgressWidth = mProgressWidth;
465 | mProgressPaint.setStrokeWidth(mProgressWidth);
466 | }
467 |
468 | public int getArcWidth() {
469 | return mArcWidth;
470 | }
471 |
472 | public void setArcWidth(int mArcWidth) {
473 | this.mArcWidth = mArcWidth;
474 | mArcPaint.setStrokeWidth(mArcWidth);
475 | }
476 | public int getArcRotation() {
477 | return mRotation;
478 | }
479 |
480 | public void setArcRotation(int mRotation) {
481 | this.mRotation = mRotation;
482 | updateThumbPosition();
483 | }
484 |
485 | public int getStartAngle() {
486 | return mStartAngle;
487 | }
488 |
489 | public void setStartAngle(int mStartAngle) {
490 | this.mStartAngle = mStartAngle;
491 | updateThumbPosition();
492 | }
493 |
494 | public int getSweepAngle() {
495 | return mSweepAngle;
496 | }
497 |
498 | public void setSweepAngle(int mSweepAngle) {
499 | this.mSweepAngle = mSweepAngle;
500 | updateThumbPosition();
501 | }
502 |
503 | public void setRoundedEdges(boolean isEnabled) {
504 | mRoundedEdges = isEnabled;
505 | if (mRoundedEdges) {
506 | mArcPaint.setStrokeCap(Paint.Cap.ROUND);
507 | mProgressPaint.setStrokeCap(Paint.Cap.ROUND);
508 | } else {
509 | mArcPaint.setStrokeCap(Paint.Cap.SQUARE);
510 | mProgressPaint.setStrokeCap(Paint.Cap.SQUARE);
511 | }
512 | }
513 |
514 | public void setTouchInSide(boolean isEnabled) {
515 | int thumbHalfheight = (int) mThumb.getIntrinsicHeight() / 2;
516 | int thumbHalfWidth = (int) mThumb.getIntrinsicWidth() / 2;
517 | mTouchInside = isEnabled;
518 | if (mTouchInside) {
519 | mTouchIgnoreRadius = (float) mArcRadius / 4;
520 | } else {
521 | // Don't use the exact radius makes interaction too tricky
522 | mTouchIgnoreRadius = mArcRadius
523 | - Math.min(thumbHalfWidth, thumbHalfheight);
524 | }
525 | }
526 |
527 | public void setClockwise(boolean isClockwise) {
528 | mClockwise = isClockwise;
529 | }
530 | }
531 |
--------------------------------------------------------------------------------
/PhoneSafer/src/com/hy2014/phonesafer/view/SlideMenu.java:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kingdawin/AndroidSensor/7225bc98e6e154c31e1e2f0a4bed289876185a26/PhoneSafer/src/com/hy2014/phonesafer/view/SlideMenu.java
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | use sensor to protect your phone not rob:
2 | ACCELEROMETER-Sensor ,PROXIMIY-sensor, LIGHT-sensor
3 |
4 | # 项目功能
5 | - 设置系统铃声作为报警音、提示音
6 | - 手势解锁
7 | - 按键解锁:锁屏状态按键解锁
8 | - 音量锁定
9 | - 屏蔽关机
10 | - 闪光灯开关
11 | - 振动开关
12 | - 报警模式:口袋模式/重力感应/光感应
13 | - USB拔插报警(拔出耳机或数据线)
14 | - 延迟报警,弹出手势解锁
15 | - 重力感应阀值设置
16 | - 延迟报警和启动时间设置
17 | - 手势锁定手机系统
18 | - 混合模式:加速度传感器,距离传感器,口袋模式组合监控
19 |
--------------------------------------------------------------------------------