queryBuilder = mManager.getDaoSession().queryBuilder(RecordSleepBean.class);
142 | return queryBuilder.where(RecordSleepBeanDao.Properties._id.eq(id)).list();
143 | }
144 | }
145 |
--------------------------------------------------------------------------------
/app/src/main/java/top/jplayer/audio/utils/SizeUtils.java:
--------------------------------------------------------------------------------
1 | package top.jplayer.audio.utils;
2 |
3 | import android.util.DisplayMetrics;
4 | import android.util.TypedValue;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | import top.jplayer.audio.AudioApplication;
9 |
10 | /**
11 | *
12 | * author: Blankj
13 | * blog : http://blankj.com
14 | * time : 2016/08/02
15 | * desc : 尺寸相关工具类
16 | *
17 | */
18 | public final class SizeUtils {
19 |
20 | private SizeUtils() {
21 | throw new UnsupportedOperationException("u can't instantiate me...");
22 | }
23 |
24 | /**
25 | * dp 转 px
26 | *
27 | * @param dpValue dp 值
28 | * @return px 值
29 | */
30 | public static int dp2px(final float dpValue) {
31 | final float scale = AudioApplication.application.getResources().getDisplayMetrics().density;
32 | return (int) (dpValue * scale + 0.5f);
33 | }
34 |
35 | /**
36 | * px 转 dp
37 | *
38 | * @param pxValue px 值
39 | * @return dp 值
40 | */
41 | public static int px2dp(final float pxValue) {
42 | final float scale = AudioApplication.application.getResources().getDisplayMetrics().density;
43 | return (int) (pxValue / scale + 0.5f);
44 | }
45 |
46 | /**
47 | * sp 转 px
48 | *
49 | * @param spValue sp 值
50 | * @return px 值
51 | */
52 | public static int sp2px(final float spValue) {
53 | final float fontScale = AudioApplication.application.getResources().getDisplayMetrics().scaledDensity;
54 | return (int) (spValue * fontScale + 0.5f);
55 | }
56 |
57 | /**
58 | * px 转 sp
59 | *
60 | * @param pxValue px 值
61 | * @return sp 值
62 | */
63 | public static int px2sp(final float pxValue) {
64 | final float fontScale = AudioApplication.application.getResources().getDisplayMetrics().scaledDensity;
65 | return (int) (pxValue / fontScale + 0.5f);
66 | }
67 |
68 | /**
69 | * 各种单位转换
70 | * 该方法存在于 TypedValue
71 | *
72 | * @param unit 单位
73 | * @param value 值
74 | * @param metrics DisplayMetrics
75 | * @return 转换结果
76 | */
77 | public static float applyDimension(final int unit,
78 | final float value,
79 | final DisplayMetrics metrics) {
80 | switch (unit) {
81 | case TypedValue.COMPLEX_UNIT_PX:
82 | return value;
83 | case TypedValue.COMPLEX_UNIT_DIP:
84 | return value * metrics.density;
85 | case TypedValue.COMPLEX_UNIT_SP:
86 | return value * metrics.scaledDensity;
87 | case TypedValue.COMPLEX_UNIT_PT:
88 | return value * metrics.xdpi * (1.0f / 72);
89 | case TypedValue.COMPLEX_UNIT_IN:
90 | return value * metrics.xdpi;
91 | case TypedValue.COMPLEX_UNIT_MM:
92 | return value * metrics.xdpi * (1.0f / 25.4f);
93 | }
94 | return 0;
95 | }
96 |
97 | /**
98 | * 在 onCreate 中获取视图的尺寸
99 | * 需回调 onGetSizeListener 接口,在 onGetSize 中获取 view 宽高
100 | * 用法示例如下所示
101 | *
102 | * SizeUtils.forceGetViewSize(view, new SizeUtils.onGetSizeListener() {
103 | * Override
104 | * public void onGetSize(final View view) {
105 | * view.getWidth();
106 | * }
107 | * });
108 | *
109 | *
110 | * @param view 视图
111 | * @param listener 监听器
112 | */
113 | public static void forceGetViewSize(final View view, final onGetSizeListener listener) {
114 | view.post(new Runnable() {
115 | @Override
116 | public void run() {
117 | if (listener != null) {
118 | listener.onGetSize(view);
119 | }
120 | }
121 | });
122 | }
123 |
124 | /**
125 | * 获取到 View 尺寸的监听
126 | */
127 | public interface onGetSizeListener {
128 | void onGetSize(View view);
129 | }
130 |
131 | /**
132 | * 测量视图尺寸
133 | *
134 | * @param view 视图
135 | * @return arr[0]: 视图宽度, arr[1]: 视图高度
136 | */
137 | public static int[] measureView(final View view) {
138 | ViewGroup.LayoutParams lp = view.getLayoutParams();
139 | if (lp == null) {
140 | lp = new ViewGroup.LayoutParams(
141 | ViewGroup.LayoutParams.MATCH_PARENT,
142 | ViewGroup.LayoutParams.WRAP_CONTENT
143 | );
144 | }
145 | int widthSpec = ViewGroup.getChildMeasureSpec(0, 0, lp.width);
146 | int lpHeight = lp.height;
147 | int heightSpec;
148 | if (lpHeight > 0) {
149 | heightSpec = View.MeasureSpec.makeMeasureSpec(lpHeight, View.MeasureSpec.EXACTLY);
150 | } else {
151 | heightSpec = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
152 | }
153 | view.measure(widthSpec, heightSpec);
154 | return new int[]{view.getMeasuredWidth(), view.getMeasuredHeight()};
155 | }
156 |
157 | /**
158 | * 获取测量视图宽度
159 | *
160 | * @param view 视图
161 | * @return 视图宽度
162 | */
163 | public static int getMeasuredWidth(final View view) {
164 | return measureView(view)[0];
165 | }
166 |
167 | /**
168 | * 获取测量视图高度
169 | *
170 | * @param view 视图
171 | * @return 视图高度
172 | */
173 | public static int getMeasuredHeight(final View view) {
174 | return measureView(view)[1];
175 | }
176 | }
177 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
26 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_center.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
26 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
21 |
22 |
23 |
27 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_in_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
26 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_center.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
26 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_right.xml:
--------------------------------------------------------------------------------
1 |
2 |
20 |
21 |
22 |
26 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/slide_out_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_btn_login_selected.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 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
16 |
21 |
26 |
31 |
36 |
41 |
46 |
51 |
56 |
61 |
66 |
71 |
76 |
81 |
86 |
91 |
96 |
101 |
106 |
111 |
116 |
121 |
126 |
131 |
136 |
141 |
146 |
151 |
156 |
161 |
166 |
171 |
172 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login_act.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
21 |
22 |
34 |
35 |
40 |
41 |
48 |
49 |
54 |
55 |
69 |
70 |
77 |
78 |
79 |
83 |
84 |
90 |
91 |
96 |
97 |
111 |
112 |
119 |
120 |
126 |
127 |
128 |
132 |
133 |
143 |
144 |
148 |
149 |
159 |
160 |
164 |
165 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
190 |
191 |
198 |
199 |
205 |
206 |
213 |
214 |
215 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
17 |
22 |
23 |
32 |
33 |
42 |
43 |
53 |
54 |
64 |
65 |
66 |
75 |
76 |
77 |
78 |
79 |
87 |
88 |
104 |
105 |
106 |
115 |
116 |
125 |
126 |
135 |
136 |
145 |
146 |
156 |
157 |
158 |
159 |
160 |
161 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_sleep_record.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
13 |
14 |
19 |
20 |
28 |
29 |
37 |
38 |
46 |
47 |
55 |
56 |
64 |
65 |
73 |
74 |
82 |
83 |
84 |
85 |
86 |
93 |
94 |
97 |
98 |
110 |
111 |
112 |
113 |
114 |
115 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_svg.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
26 |
27 |
41 |
42 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_wave_play.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
27 |
28 |
36 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_webview.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
22 |
23 |
29 |
30 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_current_record.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
22 |
23 |
32 |
33 |
42 |
43 |
49 |
50 |
51 |
55 |
56 |
62 |
63 |
72 |
73 |
74 |
75 |
79 |
80 |
86 |
87 |
96 |
97 |
98 |
99 |
103 |
104 |
110 |
111 |
120 |
121 |
122 |
123 |
127 |
128 |
134 |
135 |
144 |
145 |
146 |
147 |
151 |
152 |
158 |
159 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_forget_sure.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
23 |
24 |
32 |
33 |
34 |
42 |
43 |
44 |
58 |
59 |
66 |
67 |
73 |
74 |
75 |
81 |
82 |
88 |
89 |
98 |
99 |
104 |
105 |
114 |
115 |
116 |
117 |
118 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_register.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
21 |
22 |
34 |
35 |
40 |
41 |
48 |
49 |
54 |
55 |
69 |
70 |
77 |
78 |
79 |
83 |
84 |
90 |
91 |
96 |
97 |
111 |
112 |
119 |
120 |
126 |
127 |
128 |
132 |
133 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_value_sure.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
13 |
21 |
22 |
36 |
37 |
43 |
44 |
50 |
51 |
60 |
61 |
66 |
67 |
76 |
77 |
78 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xhdpi/ic_clear.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_mobile_flag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xhdpi/ic_mobile_flag.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_password_flag.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xhdpi/ic_password_flag.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xxhdpi/black.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xxhdpi/logo.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/arrays.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @android:color/white
5 | - @color/google_red
6 | - @color/google_yellow
7 | - @color/google_blue
8 | - @color/google_green
9 |
10 |
11 | - M142.9,24.2C97.6,39.7,59,73.6,37.5,116.5c-7.5,14.8-12.9,30.5-16.2,46.8c-8.2,40.4-2.5,83.5,16.1,120.3 c12.1,24,29.5,45.4,50.5,62.1c19.9,15.8,43,27.6,67.6,34.1c31,8.3,64,8.1,95.2,1c28.2-6.5,54.9-20,76.2-39.6 c22.5-20.7,38.6-47.9,47.1-77.2c9.3-31.9,10.5-66,4.7-98.8c-58.3,0-116.7,0-175,0c0,24.2,0,48.4,0,72.6c33.8,0,67.6,0,101.4,0 c-3.9,23.2-17.7,44.4-37.2,57.5c-12.3,8.3-26.4,13.6-41,16.2c-14.6,2.5-29.8,2.8-44.4-0.1c-14.9-3-29-9.2-41.4-17.9 c-19.8-13.9-34.9-34.2-42.6-57.1c-7.9-23.3-8-49.2,0-72.4c5.6-16.4,14.8-31.5,27-43.9c15-15.4,34.5-26.4,55.6-30.9 c18-3.8,37-3.1,54.6,2.2c15,4.5,28.8,12.8,40.1,23.6c11.4-11.4,22.8-22.8,34.2-34.2c6-6.1,12.3-12,18.1-18.3 c-17.3-16-37.7-28.9-59.9-37.1C228.2,10.6,183.2,10.3,142.9,24.2z
12 | - M142.9,24.2c40.2-13.9,85.3-13.6,125.3,1.1c22.2,8.2,42.5,21,59.9,37.1c-5.8,6.3-12.1,12.2-18.1,18.3 c-11.4,11.4-22.8,22.8-34.2,34.2c-11.3-10.8-25.1-19-40.1-23.6c-17.6-5.3-36.6-6.1-54.6-2.2c-21,4.5-40.5,15.5-55.6,30.9 c-12.2,12.3-21.4,27.5-27,43.9c-20.3-15.8-40.6-31.5-61-47.3C59,73.6,97.6,39.7,142.9,24.2z
13 | - M21.4,163.2c3.3-16.2,8.7-32,16.2-46.8c20.3,15.8,40.6,31.5,61,47.3c-8,23.3-8,49.2,0,72.4 c-20.3,15.8-40.6,31.6-60.9,47.3C18.9,246.7,13.2,203.6,21.4,163.2z
14 | - M203.7,165.1c58.3,0,116.7,0,175,0c5.8,32.7,4.5,66.8-4.7,98.8c-8.5,29.3-24.6,56.5-47.1,77.2 c-19.7-15.3-39.4-30.6-59.1-45.9c19.5-13.1,33.3-34.3,37.2-57.5c-33.8,0-67.6,0-101.4,0C203.7,213.5,203.7,189.3,203.7,165.1z
15 | - M37.5,283.5c20.3-15.7,40.6-31.5,60.9-47.3c7.8,22.9,22.8,43.2,42.6,57.1c12.4,8.7,26.6,14.9,41.4,17.9 c14.6,3,29.7,2.6,44.4,0.1c14.6-2.6,28.7-7.9,41-16.2c19.7,15.3,39.4,30.6,59.1,45.9c-21.3,19.7-48,33.1-76.2,39.6 c-31.2,7.1-64.2,7.3-95.2-1c-24.6-6.5-47.7-18.2-67.6-34.1C67,328.9,49.6,307.5,37.5,283.5z
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #769aff
4 | #dd769aff
5 | #FF4081
6 | #000000
7 | #FFFFFF
8 | #F15250
9 | #35D599
10 | #7bbef7
11 | #55666666
12 | #F3A5AF
13 | #80BFF5
14 | #BDBDBD
15 | #EA4335
16 | #FBBC05
17 | #4285F4
18 | #34A853
19 | #FC2572
20 | #FF2B66
21 | #FF9911
22 | #510069
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/values/integers.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 300
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BestSleep
3 | 注册
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
20 |
21 |
26 |
27 |
32 |
33 |
38 |
39 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/backup_descriptor.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/provider.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/test/java/top/jplayer/audio/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package top.jplayer.audio;
2 |
3 | import org.junit.Test;
4 |
5 | import java.util.Calendar;
6 |
7 | import static org.junit.Assert.*;
8 |
9 | /**
10 | * Example local unit test, which will execute on the development machine (host).
11 | *
12 | * @see Testing documentation
13 | */
14 | public class ExampleUnitTest {
15 | @Test
16 | public void addition_isCorrect() throws Exception {
17 | assertEquals(4, 2 + 2);
18 | System.out.println(getTime());
19 | }
20 |
21 | public static String getTime() {
22 | Calendar c = Calendar.getInstance();//可以对每个时间域单独修改
23 |
24 | int hour = c.get(Calendar.HOUR_OF_DAY);
25 |
26 | int minute = c.get(Calendar.MINUTE);
27 |
28 | int second = c.get(Calendar.SECOND);
29 |
30 | return (hour + ":" + minute + ":" + second);
31 |
32 | }
33 | }
--------------------------------------------------------------------------------
/app/tinker-support.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.tencent.bugly.tinker-support'
2 |
3 | def bakPath = file("${buildDir}/bakApk/")
4 |
5 | /**
6 | * 此处填写每次构建生成的基准包目录
7 | */
8 | def baseApkDir = "app-0509-15-42-28"
9 |
10 | /**
11 | * 对于插件各参数的详细解析请参考
12 | */
13 | tinkerSupport {
14 |
15 | // 开启tinker-support插件,默认值true
16 | enable = true
17 |
18 | // 指定归档目录,默认值当前module的子目录tinker
19 | autoBackupApkDir = "${bakPath}"
20 |
21 | // 是否启用覆盖tinkerPatch配置功能,默认值false
22 | // 开启后tinkerPatch配置不生效,即无需添加tinkerPatch
23 | overrideTinkerPatchConfiguration = true
24 |
25 | // 编译补丁包时,必需指定基线版本的apk,默认值为空
26 | // 如果为空,则表示不是进行补丁包的编译
27 | // @{link tinkerPatch.oldApk }
28 | baseApk = "${bakPath}/${baseApkDir}/app-release.apk"
29 |
30 | // 对应tinker插件applyMapping
31 | // baseApkProguardMapping = "${bakPath}/${baseApkDir}/app-release-mapping.txt"
32 |
33 | // 对应tinker插件applyResourceMapping
34 | baseApkResourceMapping = "${bakPath}/${baseApkDir}/app-release-R.txt"
35 |
36 | // 构建基准包和补丁包都要指定不同的tinkerId,并且必须保证唯一性
37 | tinkerId = "base-1.1.1"
38 |
39 | // 构建多渠道补丁时使用
40 | // buildAllFlavorsDir = "${bakPath}/${baseApkDir}"
41 |
42 | // 是否启用加固模式,默认为false.(tinker-spport 1.0.7起支持)
43 | isProtectedApp = true
44 |
45 | // 是否开启反射Application模式
46 | enableProxyApplication = true
47 |
48 | }
49 |
50 | /**
51 | * 一般来说,我们无需对下面的参数做任何的修改
52 | * 对于各参数的详细介绍请参考:
53 | * https://github.com/Tencent/tinker/wiki/Tinker-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97
54 | */
55 | tinkerPatch {
56 | //oldApk ="${bakPath}/${appName}/app-release.apk"
57 | ignoreWarning = false
58 | useSign = true
59 | dex {
60 | dexMode = "jar"
61 | pattern = ["classes*.dex"]
62 | loader = []
63 | }
64 | lib {
65 | pattern = ["lib/*/*.so"]
66 | }
67 |
68 | res {
69 | pattern = ["res/*", "r/*", "assets/*", "resources.arsc", "AndroidManifest.xml"]
70 | ignoreChange = []
71 | largeModSize = 100
72 | }
73 |
74 | packageConfig {
75 | }
76 | sevenZip {
77 | zipArtifact = "com.tencent.mm:SevenZip:1.1.10"
78 | // path = "/usr/local/bin/7za"
79 | }
80 | buildConfig {
81 | keepDexApply = false
82 | //tinkerId = "1.0.1-base"
83 | //applyMapping = "${bakPath}/${appName}/app-release-mapping.txt" // 可选,设置mapping文件,建议保持旧apk的proguard混淆方式
84 | //applyResourceMapping = "${bakPath}/${appName}/app-release-R.txt" // 可选,设置R.txt文件,通过旧apk文件保持ResId的分配
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/audio.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/audio.jks
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | mavenCentral() // add repository
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.0.1'
12 | classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
13 | classpath 'com.jakewharton:butterknife-gradle-plugin:8.5.1'
14 | classpath 'com.tencent.bugly:tinker-support:1.1.1'
15 | // NOTE: Do not place your application dependencies here; they belong
16 | // in the individual module build.gradle files
17 | }
18 | }
19 |
20 | allprojects {
21 | repositories {
22 | google()
23 | jcenter()
24 | maven { url 'https://jitpack.io' }
25 | }
26 | }
27 |
28 | task clean(type: Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jplayer-top/SnoringRecord/c4783f9e355044fc4590f6ae1e5430ab8f40e328/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri May 04 22:30:56 CST 2018
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------