Skip to content

Commit 17966d6

Browse files
committed
add HorCali
1 parent cd33983 commit 17966d6

30 files changed

+1736
-0
lines changed

HorCali/Android.mk

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
LOCAL_PATH:=$(call my-dir)
2+
include $(CLEAR_VARS)
3+
4+
LOCAL_MODULE_TAGS := optional
5+
LOCAL_SRC_FILES := $(call all-subdir-java-files)
6+
LOCAL_CERTIFICATE := platform
7+
LOCAL_PRIVILEGED_MODULE := true
8+
LOCAL_PACKAGE_NAME := HorCali
9+
10+
include $(BUILD_PACKAGE)

HorCali/AndroidManifest.xml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.android.HorCali"
4+
android:sharedUserId="android.uid.phone"
5+
android:versionCode="1"
6+
android:versionName="1.0" >
7+
8+
9+
<application android:label="@string/app_name"
10+
android:theme="@style/Theme.Settings">
11+
<activity
12+
android:name=".sensor.SensorCalibration"
13+
android:exported="true"
14+
android:label="@string/app_name"
15+
android:theme="@style/Theme.Settings"
16+
android:screenOrientation="portrait" >
17+
<intent-filter>
18+
<action android:name="android.intent.action.MAIN" />
19+
</intent-filter>
20+
</activity>
21+
</application>
22+
23+
</manifest>

HorCali/proguard.flags

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
-optimizationpasses 5
2+
-dontusemixedcaseclassnames
3+
-dontskipnonpubliclibraryclasses
4+
-dontpreverify
5+
-verbose
6+
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7+
8+
-keep public class * extends android.app.Activity
9+
-keep public class * extends android.app.Application
10+
-keep public class * extends android.app.Service
11+
-keep public class * extends android.content.BroadcastReceiver
12+
-keep public class * extends android.content.ContentProvider
13+
-keep public class * extends android.app.backup.BackupAgentHelper
14+
-keep public class * extends android.preference.Preference
15+
-keep public class com.android.vending.licensing.ILicensingService
16+
17+
-keepclasseswithmembernames class * {
18+
native <methods>;
19+
}
20+
21+
-keepclasseswithmembers class * {
22+
public <init>(android.content.Context, android.util.AttributeSet);
23+
}
24+
25+
-keepclasseswithmembers class * {
26+
public <init>(android.content.Context, android.util.AttributeSet, int);
27+
}
28+
29+
-keepclassmembers class * extends android.app.Activity {
30+
public void *(android.view.View);
31+
}
32+
33+
-keepclassmembers enum * {
34+
public static **[] values();
35+
public static ** valueOf(java.lang.String);
36+
}
37+
38+
-keep class * implements android.os.Parcelable {
39+
public static final android.os.Parcelable$Creator *;
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item android:color="#3478f6"/>
4+
<item android:color="#663478f6" android:state_pressed="true"/>
5+
<item android:color="#c8c8c8" android:state_enabled="false"/>
6+
</selector>
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
<item
4+
android:state_focused="false"
5+
android:state_pressed="false"
6+
android:drawable="@drawable/ic_ab_back_default_prize" />
7+
<item
8+
android:state_pressed="true"
9+
android:drawable="@drawable/ic_ab_back_press_prize" />
10+
</selector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item android:drawable="@drawable/ic_calibration_button_selected" android:state_pressed="true"/>
5+
<item android:drawable="@drawable/ic_calibration_button_unselected" android:state_focused="false" android:state_pressed="false"/>
6+
<item android:drawable="@drawable/ic_calibration_button_selected" android:state_focused="true"/>
7+
<item android:drawable="@drawable/ic_calibration_button_unselected" android:state_focused="false"/>
8+
9+
</selector>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent"
5+
android:background="#f5f5f5">
6+
7+
8+
<TextView
9+
android:id="@+id/calibrationAttention"
10+
android:layout_width="match_parent"
11+
android:layout_height="wrap_content"
12+
android:gravity="center_horizontal"
13+
android:layout_marginTop="15dp"
14+
android:text="@string/calibration_attention_init"
15+
android:textColor="#000000"
16+
android:textSize="@dimen/prize_horizontal_calibration_textview_size" />
17+
<RelativeLayout
18+
android:layout_width="match_parent"
19+
android:layout_height="@dimen/prize_horizontal_calibration_button_height"
20+
android:layout_centerHorizontal="true"
21+
android:layout_alignParentBottom="true">
22+
<View
23+
android:id="@+id/prize_lines"
24+
android:layout_width="match_parent"
25+
android:layout_height="2dp"
26+
android:background="@mipmap/prize_elevation" />
27+
<Button
28+
android:layout_below="@id/prize_lines"
29+
android:id="@+id/calibration"
30+
android:layout_width="match_parent"
31+
android:layout_height="match_parent"
32+
android:layout_gravity="center_horizontal"
33+
android:gravity="center"
34+
android:background="#fafafa"
35+
android:text="@string/calibration_button"
36+
android:textColor="@color/prize_calibration_button_color"
37+
/>
38+
39+
</RelativeLayout>
40+
<!--<Button-->
41+
<!--android:id="@+id/calibration"-->
42+
<!--android:layout_width="match_parent"-->
43+
<!--android:layout_height="@dimen/prize_horizontal_calibration_button_height"-->
44+
<!--android:layout_gravity="center_horizontal"-->
45+
<!--android:gravity="center"-->
46+
<!--android:background="@null"-->
47+
<!--android:text="@string/calibration_button"-->
48+
<!--android:textColor="@color/prize_calibration_button_color"-->
49+
<!--android:layout_centerHorizontal="true"-->
50+
<!--android:layout_alignParentBottom="true" />-->
51+
52+
<RelativeLayout
53+
android:layout_width="match_parent"
54+
android:layout_height="match_parent"
55+
android:layout_above="@id/calibration"
56+
android:layout_below="@id/calibrationAttention"
57+
>
58+
<com.android.HorCali.sensor.HorizontalCalibrationView
59+
android:id="@+id/main_horizontalcalibrationview"
60+
android:layout_width="wrap_content"
61+
android:layout_height="wrap_content"
62+
android:layout_centerInParent="true"/>
63+
</RelativeLayout>
64+
65+
</RelativeLayout>
1.05 KB
Loading

HorCali/res/values-zh-rCN/strings.xml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2007 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
19+
20+
<string name="hello">Hello World, EngineerMode!</string>
21+
<string name="app_name">CaliDemo</string>
22+
<string name="internal_app_name">InternalEngineerMode</string>
23+
<string name="Settings">Settings</string>
24+
25+
<!-- Main View -->
26+
<string name="title_activity_engineer_mode">EngineerMode</string>
27+
<string name="tab_telephony">Telephony</string>
28+
<string name="tab_connectivity">Connectivity</string>
29+
<string name="tab_hardware_testing">Hardware Testing</string>
30+
<string name="tab_location">Location</string>
31+
<string name="tab_log_and_debugging">Log and Debugging</string>
32+
<string name="tab_others">Others</string>
33+
<string name="activiti_notfind">Can not find module!</string>
34+
35+
36+
37+
38+
<!-- Motion Sensor start -->
39+
<string name="sensor">Sensor</string>
40+
<string name="sensor_data">MSensor</string>
41+
<string name="msensor_current_data">Msensor Current Data</string>
42+
<string name="msensor_read_file">Get history data from file</string>
43+
<string name="psensor_clear_data">Clear Current Data</string>
44+
<string name="psensor_get_data">Get One Data</string>
45+
<string name="sensor_calibration">Sensor Calibration</string>
46+
<string name="sensor_calibration_gsensor">水平校准</string>
47+
<string name="sensor_calibration_gyroscope">Gyroscope Calibration</string>
48+
<string name="sensor_calibration_do_20">Do calibration (20% tolerance)</string>
49+
<string name="sensor_calibration_do_40">Do calibration (40% tolerance)</string>
50+
<string name="sensor_calibration_clear">Clear calibration</string>
51+
<string name="sensor_calibration_note">NOTE: The phone must stay still on a horizontal plane during calibration.</string>
52+
<string name="sensor_calibration_current_data_hint">Sensor current data: </string>
53+
<string name="sensor_calibration_sensor_data_hint">Sensor calibration data: </string>
54+
<string name="sensor_ps">Light/Proximity Sensor</string>
55+
<string name="psensor_calibration_select">PS Calibration</string>
56+
<string name="psensor_data_collection">PS Data Collection</string>
57+
<string name="psensor_calibration">Calibration</string>
58+
<string name="psensor_change_threshold">Change Threshold</string>
59+
<string name="sensor_ps_calibration_current_data">PS:\nThreshold High:\nThreshold Low:"</string>
60+
<string name="sensor_ps_calibration_current_data_format">"PS: %1$d\nThreshold High: %2$d\nThreshold Low: %3$d"</string>
61+
<string name="sensor_ps_calibration_min_hint">Put phone on a horizontal plane and click the button.\nNOTE: Donnot cover P-Sensor after button clicked.</string>
62+
<string name="sensor_ps_calibration_get_min">Calculate min value</string>
63+
<string name="sensor_ps_calibration_min_value">Min value: </string>
64+
<string name="sensor_ps_calibration_max_hint">Cover P-Sensor then click the button.</string>
65+
<string name="sensor_ps_calibration_get_max">Calculate max value</string>
66+
<string name="sensor_ps_calibration_max_value">Max value: </string>
67+
<string name="sensor_ps_calibration_do_cali">Do calibration</string>
68+
<string name="sensor_ps_calibration_clear_cali">Clear calibration</string>
69+
<string name="sensor_ps_calibration_result">Result: </string>
70+
<string name="sensor_ps_threshold_high">Threshold High (0~65535): </string>
71+
<string name="sensor_ps_threshold_low">Threshold Low (0~65535): </string>
72+
<string name="sensor_ps_change_threshold_set">Set</string>
73+
<string name="sensor_ps_threshold_prefix">0x</string>
74+
<!-- Motion Sensor end -->
75+
76+
77+
<!-- Settings title in intelligent accessibility screen for sensor_calibration_settings by huangdianjun-->
78+
<string name="proximity_sensor_settings">"接近传感器校准"</string>
79+
<string name="sensor_calibration_settings">"传感器校准"</string>
80+
<string name="proximity_sensor_title">"注意"</string>
81+
<string name="proximity_sensor_context">"校准接近传感器?"</string>
82+
<string name="proximity_sensor_positive">"确定"</string>
83+
<string name="proximity_sensor_negative">"取消"</string>
84+
<string name="proximity_sensor_success_toast">"校准完成"</string>
85+
<string name="proximity_sensor_failed_toast">"校准失败"</string>
86+
87+
<string name="horizontal_calibration_settings">"水平校准"</string>
88+
<string name="horizontal_calibration_settings_summary">"使用加速仪水平校准"</string>
89+
<string name="calibration_attention_init">"将设备放在水平表面上并点击校准"</string>
90+
<string name="calibration_attention_calibrating">"正在校准,请不要移动手机。请稍等..."</string>
91+
<string name="calibration_button">"校准"</string>
92+
<string name="calibration_success_toast">"已校准"</string>
93+
<string name="calibration_failed_toast">"校准失败"</string>
94+
<string name="horizontal_calibration_title">"水平校准"</string>
95+
<!--prize-add-huangdianjun-end-->
96+
<string name="sensor_operation_succuss">"校准成功"</string>
97+
<string name="sensor_operation_fail">"校准失败"</string>
98+
</resources>

HorCali/res/values-zh-rHK/strings.xml

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright (C) 2007 The Android Open Source Project
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
18+
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
19+
20+
<string name="hello">Hello World, EngineerMode!</string>
21+
<string name="app_name">CaliDemo</string>
22+
<string name="internal_app_name">InternalEngineerMode</string>
23+
<string name="Settings">Settings</string>
24+
25+
<!-- Main View -->
26+
<string name="title_activity_engineer_mode">EngineerMode</string>
27+
<string name="tab_telephony">Telephony</string>
28+
<string name="tab_connectivity">Connectivity</string>
29+
<string name="tab_hardware_testing">Hardware Testing</string>
30+
<string name="tab_location">Location</string>
31+
<string name="tab_log_and_debugging">Log and Debugging</string>
32+
<string name="tab_others">Others</string>
33+
<string name="activiti_notfind">Can not find module!</string>
34+
35+
36+
37+
38+
<!-- Motion Sensor start -->
39+
<string name="sensor">Sensor</string>
40+
<string name="sensor_data">MSensor</string>
41+
<string name="msensor_current_data">Msensor Current Data</string>
42+
<string name="msensor_read_file">Get history data from file</string>
43+
<string name="psensor_clear_data">Clear Current Data</string>
44+
<string name="psensor_get_data">Get One Data</string>
45+
<string name="sensor_calibration">Sensor Calibration</string>
46+
<string name="sensor_calibration_gsensor">水平校準</string>
47+
<string name="sensor_calibration_gyroscope">Gyroscope Calibration</string>
48+
<string name="sensor_calibration_do_20">Do calibration (20% tolerance)</string>
49+
<string name="sensor_calibration_do_40">Do calibration (40% tolerance)</string>
50+
<string name="sensor_calibration_clear">Clear calibration</string>
51+
<string name="sensor_calibration_note">NOTE: The phone must stay still on a horizontal plane during calibration.</string>
52+
<string name="sensor_calibration_current_data_hint">Sensor current data: </string>
53+
<string name="sensor_calibration_sensor_data_hint">Sensor calibration data: </string>
54+
<string name="sensor_ps">Light/Proximity Sensor</string>
55+
<string name="psensor_calibration_select">PS Calibration</string>
56+
<string name="psensor_data_collection">PS Data Collection</string>
57+
<string name="psensor_calibration">Calibration</string>
58+
<string name="psensor_change_threshold">Change Threshold</string>
59+
<string name="sensor_ps_calibration_current_data">PS:\nThreshold High:\nThreshold Low:"</string>
60+
<string name="sensor_ps_calibration_current_data_format">"PS: %1$d\nThreshold High: %2$d\nThreshold Low: %3$d"</string>
61+
<string name="sensor_ps_calibration_min_hint">Put phone on a horizontal plane and click the button.\nNOTE: Donnot cover P-Sensor after button clicked.</string>
62+
<string name="sensor_ps_calibration_get_min">Calculate min value</string>
63+
<string name="sensor_ps_calibration_min_value">Min value: </string>
64+
<string name="sensor_ps_calibration_max_hint">Cover P-Sensor then click the button.</string>
65+
<string name="sensor_ps_calibration_get_max">Calculate max value</string>
66+
<string name="sensor_ps_calibration_max_value">Max value: </string>
67+
<string name="sensor_ps_calibration_do_cali">Do calibration</string>
68+
<string name="sensor_ps_calibration_clear_cali">Clear calibration</string>
69+
<string name="sensor_ps_calibration_result">Result: </string>
70+
<string name="sensor_ps_threshold_high">Threshold High (0~65535): </string>
71+
<string name="sensor_ps_threshold_low">Threshold Low (0~65535): </string>
72+
<string name="sensor_ps_change_threshold_set">Set</string>
73+
<string name="sensor_ps_threshold_prefix">0x</string>
74+
<!-- Motion Sensor end -->
75+
76+
77+
<!-- Settings title in intelligent accessibility screen for sensor_calibration_settings by huangdianjun-->
78+
<string name="proximity_sensor_settings">"接近傳感器校準"</string>
79+
<string name="sensor_calibration_settings">"傳感器校準"</string>
80+
<string name="proximity_sensor_title">"注意"</string>
81+
<string name="proximity_sensor_context">"校準接近傳感器?"</string>
82+
<string name="proximity_sensor_positive">"確定"</string>
83+
<string name="proximity_sensor_negative">"取消"</string>
84+
<string name="proximity_sensor_success_toast">"校準完成"</string>
85+
<string name="proximity_sensor_failed_toast">"校準失敗"</string>
86+
87+
<string name="horizontal_calibration_settings">"水平校準"</string>
88+
<string name="horizontal_calibration_settings_summary">"使用加速儀水平校準"</string>
89+
<string name="calibration_attention_init">"將設備放在水平表面上並點擊校準"</string>
90+
<string name="calibration_attention_calibrating">"正在校準,請不要移動手機。請稍等..."</string>
91+
<string name="calibration_button">"校準"</string>
92+
<string name="calibration_success_toast">"已校準"</string>
93+
<string name="calibration_failed_toast">"校準失敗"</string>
94+
<string name="horizontal_calibration_title">"水平校準"</string>
95+
<!--prize-add-huangdianjun-end-->
96+
<string name="sensor_operation_succuss">"校準成功"</string>
97+
<string name="sensor_operation_fail">"校準失敗"</string>
98+
</resources>

0 commit comments

Comments
 (0)