getFragmentList() {
32 | return fragmentList;
33 | }
34 |
35 | @NonNull
36 | @Override
37 | public Fragment createFragment(int position) {
38 | return fragmentList.get(position);
39 | }
40 |
41 | @Override
42 | public int getItemCount() {
43 | return fragmentList.size();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/anim/bottom_dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/anim/bottom_dialog_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/anim/scale_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
17 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/anim/top_dialog_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/draw_launch.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | -
14 |
17 |
18 |
19 | -
21 |
24 |
25 |
26 |
27 | -
28 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_android_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_camera.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_facing.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_facing_back.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_facing_front.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_flash_auto.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_flash_off.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_flash_on.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_flash_torch.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_gallery.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_info.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_photo.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_preview.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/ic_settings.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/item_card_border.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/item_card_border_parent.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/launch_bg.xml:
--------------------------------------------------------------------------------
1 |
6 |
11 |
17 |
23 |
29 |
30 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/logomark_light.xml:
--------------------------------------------------------------------------------
1 |
6 |
12 |
18 |
24 |
25 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/shape_age.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/shape_constellation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
11 |
12 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/tab_bg_with_shadow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
11 |
12 |
13 |
14 |
15 | -
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/tab_discovery.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/tab_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/tab_mailbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/tab_person.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/tab_title_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/drawable/video_button.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
9 |
10 |
11 | -
12 |
13 |
16 |
17 |
20 |
21 |
22 | -
23 |
24 |
27 |
28 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/activity_aplash.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
17 |
18 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/activity_card.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/activity_person_new.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
25 |
26 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/activity_pop_view_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
20 |
21 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/activity_vertical.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/content_vertical.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
19 |
20 |
25 |
26 |
32 |
33 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/fragment_discovery.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
23 |
24 |
28 |
29 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/fragment_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/fragment_holder.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
18 |
19 |
27 |
28 |
40 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
32 |
33 |
34 |
35 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/fragment_home_new.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
19 |
20 |
25 |
26 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/fragment_mailbox.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
19 |
20 |
26 |
27 |
33 |
37 |
38 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/fragment_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/item_adapter_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/item_mailbox_item_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/item_menu_adapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
30 |
31 |
41 |
42 |
49 |
50 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/item_user_detail_tab.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/item_viewpager_image.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/layout_my_album_adapter.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
27 |
28 |
29 |
38 |
39 |
54 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/my_album_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
16 |
17 |
26 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/simple_location_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
16 |
17 |
18 |
31 |
32 |
33 |
45 |
46 |
58 |
59 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/sy_floating_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/uc_item_main_image_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/layout/view_lucky_draw_card_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
19 |
20 |
26 |
27 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/menu/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/btn_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/btn_normal.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/btn_pressed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/btn_pressed.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/bubble0.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/bubble0.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/bubble1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/bubble1.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_add.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_album_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_album_add.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_back_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_back_bg.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_def_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_def_avatar.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_delete_image.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_delete_image.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_diamond.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_diamond.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_discovery_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_discovery_normal.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_discovery_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_discovery_select.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_home_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_home_normal.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_home_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_home_select.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_mailbox_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_mailbox_normal.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_mailbox_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_mailbox_select.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_main_menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_main_menu.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_open_red_packet.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_open_red_packet.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_person_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_person_normal.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_person_select.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_person_select.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_picture_video_play.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_picture_video_play.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_questionmark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_questionmark.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_red_packet_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_red_packet_bg.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/icon_red_packet_open_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/icon_red_packet_open_bg.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_avatar_01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_avatar_01.jpg
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_avatar_02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_avatar_02.jpg
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_avatar_03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_avatar_03.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_avatar_04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_avatar_04.jpg
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_avatar_05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_avatar_05.jpg
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_avatar_06.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_avatar_06.jpg
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_avatar_07.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_avatar_07.jpg
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_card_background.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_card_background.9.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_dislike.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_dislike.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/img_like.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/img_like.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xhdpi/luckybg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xhdpi/luckybg.jpg
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xxhdpi/bg_launcher.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xxhdpi/bg_launcher.jpg
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xxhdpi/bg_launcher_bottom_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xxhdpi/bg_launcher_bottom_icon.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xxhdpi/bg_launcher_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xxhdpi/bg_launcher_name.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/appinfo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/appinfo/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #D81B60
5 | #D81B60
6 | #ffffff
7 |
8 | #999999
9 | #EE398E
10 |
11 |
12 | #FFFFFF
13 | #FFFFFF
14 | #1a000000
15 |
16 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 18sp
3 | 16sp
4 | 14sp
5 | 12sp
6 | 0.5dp
7 | 5dp
8 | 13sp
9 | 16sp
10 |
11 | 25dp
12 | 3dp
13 |
14 | 30dp
15 |
16 | 60dp
17 | 80dp
18 |
19 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | 小玩意儿
3 | 首页
4 | 信箱
5 | 我的
6 | 发现
7 | 获取应用信息
8 | goToTestBehaviorActivity
9 | com.yumu.appinfo.byeburgernavigationview.ByeBurgerTitleBehavior
10 | com.yumu.appinfo.byeburgernavigationview.ByeBurgerBehavior
11 | com.yumu.appinfo.byeburgernavigationview.AppBarLayoutOverScrollViewBehavior
12 | About
13 | CameraKit is open source software distributed under the MIT license.\n\nFor more details visit www.camerakit.website/.
14 |
15 | Open Drawer
16 | Close Drawer
17 |
18 |
19 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
14 |
15 |
16 |
17 |
20 |
21 |
28 |
29 |
32 |
33 |
37 |
38 |
--------------------------------------------------------------------------------
/appinfo/src/main/res/xml/file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
11 |
14 |
17 |
20 |
23 |
24 |
25 |
28 |
31 |
34 |
37 |
40 |
41 |
44 |
47 |
50 |
53 |
56 |
59 |
62 |
63 |
--------------------------------------------------------------------------------
/appinfo/src/test/java/com/yumu/appinfo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.yumu.appinfo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | maven { url "https://nexus.her520.cn/repository/central/" }
6 |
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:7.0.2'
10 | classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30'
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | maven { url "https://nexus.her520.cn/repository/central/" }
19 | }
20 | }
21 |
22 | task clean(type: Delete) {
23 | delete rootProject.buildDir
24 | }
25 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 |
21 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Nov 22 17:39:29 CST 2022
2 | distributionBase=GRADLE_USER_HOME
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
4 | distributionPath=wrapper/dists
5 | zipStorePath=wrapper/dists
6 | zipStoreBase=GRADLE_USER_HOME
7 |
--------------------------------------------------------------------------------
/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 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
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 Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/images/appinfos.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/images/appinfos.gif
--------------------------------------------------------------------------------
/images/appinfos_scroll.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/images/appinfos_scroll.gif
--------------------------------------------------------------------------------
/images/appinfos_scroll_tab.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/images/appinfos_scroll_tab.gif
--------------------------------------------------------------------------------
/images/prize.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/images/prize.gif
--------------------------------------------------------------------------------
/images/scroll.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/images/scroll.gif
--------------------------------------------------------------------------------
/indicatorlib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/indicatorlib/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 | buildToolsVersion "27.0.3"
6 |
7 |
8 |
9 | defaultConfig {
10 | minSdkVersion 16
11 | targetSdkVersion 28
12 | versionCode 1
13 | versionName "1.0"
14 |
15 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
16 |
17 | }
18 |
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | implementation fileTree(dir: 'libs', include: ['*.jar'])
30 |
31 | implementation 'com.android.support:appcompat-v7:28.0.0'
32 | testImplementation 'junit:junit:4.12'
33 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
34 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
35 | }
36 |
--------------------------------------------------------------------------------
/indicatorlib/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/indicatorlib/src/androidTest/java/com/example/indicatorlib/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.example.indicatorlib.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/base/BaseFragmentAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.base;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 |
7 | import java.util.ArrayList;
8 | import java.util.Collection;
9 | import java.util.List;
10 |
11 | /**
12 | *
13 | * author : Wp
14 | * e-mail : 18141924293@163.com
15 | * time : 2018/06/25
16 | * desc : BaseFragmentAdapter
17 | * version: 1.0
18 | *
19 | */
20 | public class BaseFragmentAdapter extends FragmentPagerAdapter {
21 |
22 | List fragmentList = new ArrayList();
23 | private List mTitles;
24 |
25 | public BaseFragmentAdapter(FragmentManager fm, List fragmentList) {
26 | super(fm);
27 | this.fragmentList = fragmentList;
28 | }
29 |
30 | public BaseFragmentAdapter(FragmentManager fm, List fragmentList, List mTitles) {
31 | super(fm);
32 | this.fragmentList = fragmentList;
33 | this.mTitles = mTitles;
34 | }
35 |
36 | @Override
37 | public CharSequence getPageTitle(int position) {
38 | return !isNullOrEmpty(mTitles) ? mTitles.get(position) : "";
39 | }
40 |
41 | @Override
42 | public Fragment getItem(int position) {
43 | return fragmentList.get(position);
44 | }
45 |
46 | @Override
47 | public int getCount() {
48 | return fragmentList.size();
49 | }
50 | /**
51 | * 判断集合是否为null或者0个元素
52 | *
53 | * @param c
54 | * @return
55 | */
56 | public static boolean isNullOrEmpty(Collection c) {
57 | if (null == c || c.isEmpty()) {
58 | return true;
59 | }
60 | return false;
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/IndicatorManager.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views;
2 |
3 | import android.support.annotation.Nullable;
4 |
5 | import com.example.indicatorlib.views.animation.AnimationManager;
6 | import com.example.indicatorlib.views.animation.controller.ValueController;
7 | import com.example.indicatorlib.views.animation.data.Value;
8 | import com.example.indicatorlib.views.draw.DrawManager;
9 | import com.example.indicatorlib.views.draw.data.Indicator;
10 |
11 |
12 | public class IndicatorManager implements ValueController.UpdateListener {
13 |
14 | private DrawManager drawManager;
15 | private AnimationManager animationManager;
16 | private Listener listener;
17 |
18 | interface Listener {
19 | void onIndicatorUpdated();
20 | }
21 |
22 | IndicatorManager(@Nullable Listener listener) {
23 | this.listener = listener;
24 | this.drawManager = new DrawManager();
25 | this.animationManager = new AnimationManager(drawManager.indicator(), this);
26 | }
27 |
28 | public AnimationManager animate() {
29 | return animationManager;
30 | }
31 |
32 | public Indicator indicator() {
33 | return drawManager.indicator();
34 | }
35 |
36 | public DrawManager drawer() {
37 | return drawManager;
38 | }
39 |
40 | @Override
41 | public void onValueUpdated(@Nullable Value value) {
42 | drawManager.updateValue(value);
43 | if (listener != null) {
44 | listener.onIndicatorUpdated();
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/AnimationManager.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation;
2 |
3 | import com.example.indicatorlib.views.animation.controller.AnimationController;
4 | import com.example.indicatorlib.views.animation.controller.ValueController;
5 | import com.example.indicatorlib.views.draw.data.Indicator;
6 |
7 | import android.support.annotation.NonNull;
8 |
9 | public class AnimationManager {
10 |
11 | private AnimationController animationController;
12 |
13 | public AnimationManager(@NonNull Indicator indicator, @NonNull ValueController.UpdateListener listener) {
14 | this.animationController = new AnimationController(indicator, listener);
15 | }
16 |
17 | public void basic() {
18 | if (animationController != null) {
19 | animationController.end();
20 | animationController.basic();
21 | }
22 | }
23 |
24 | public void interactive(float progress) {
25 | if (animationController != null) {
26 | animationController.interactive(progress);
27 | }
28 | }
29 |
30 | public void end() {
31 | if (animationController != null) {
32 | animationController.end();
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/AnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data;
2 |
3 | import com.example.indicatorlib.views.animation.data.type.*;
4 |
5 | import android.support.annotation.NonNull;
6 |
7 | public class AnimationValue {
8 |
9 | private ColorAnimationValue colorAnimationValue;
10 | private ScaleAnimationValue scaleAnimationValue;
11 | private WormAnimationValue wormAnimationValue;
12 | private FillAnimationValue fillAnimationValue;
13 | private ThinWormAnimationValue thinWormAnimationValue;
14 | private DropAnimationValue dropAnimationValue;
15 | private SwapAnimationValue swapAnimationValue;
16 |
17 | @NonNull
18 | public ColorAnimationValue getColorAnimationValue() {
19 | if (colorAnimationValue == null) {
20 | colorAnimationValue = new ColorAnimationValue();
21 | }
22 | return colorAnimationValue;
23 | }
24 |
25 | @NonNull
26 | public ScaleAnimationValue getScaleAnimationValue() {
27 | if (scaleAnimationValue == null) {
28 | scaleAnimationValue = new ScaleAnimationValue();
29 | }
30 | return scaleAnimationValue;
31 | }
32 |
33 | @NonNull
34 | public WormAnimationValue getWormAnimationValue() {
35 | if (wormAnimationValue == null) {
36 | wormAnimationValue = new WormAnimationValue();
37 | }
38 | return wormAnimationValue;
39 | }
40 |
41 | @NonNull
42 | public FillAnimationValue getFillAnimationValue() {
43 | if (fillAnimationValue == null) {
44 | fillAnimationValue = new FillAnimationValue();
45 | }
46 | return fillAnimationValue;
47 | }
48 |
49 | @NonNull
50 | public ThinWormAnimationValue getThinWormAnimationValue() {
51 | if (thinWormAnimationValue == null) {
52 | thinWormAnimationValue = new ThinWormAnimationValue();
53 | }
54 | return thinWormAnimationValue;
55 | }
56 |
57 | @NonNull
58 | public DropAnimationValue getDropAnimationValue() {
59 | if (dropAnimationValue == null) {
60 | dropAnimationValue = new DropAnimationValue();
61 | }
62 | return dropAnimationValue;
63 | }
64 |
65 | @NonNull
66 | public SwapAnimationValue getSwapAnimationValue() {
67 | if (swapAnimationValue == null) {
68 | swapAnimationValue = new SwapAnimationValue();
69 | }
70 | return swapAnimationValue;
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/Value.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data;
2 |
3 | public interface Value {/*empty*/}
4 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/ColorAnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data.type;
2 |
3 | import com.example.indicatorlib.views.animation.data.Value;
4 |
5 | public class ColorAnimationValue implements Value {
6 |
7 | private int color;
8 | private int colorReverse;
9 |
10 | public int getColor() {
11 | return color;
12 | }
13 |
14 | public void setColor(int color) {
15 | this.color = color;
16 | }
17 |
18 | public int getColorReverse() {
19 | return colorReverse;
20 | }
21 |
22 | public void setColorReverse(int colorReverse) {
23 | this.colorReverse = colorReverse;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/DropAnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data.type;
2 |
3 | import com.example.indicatorlib.views.animation.data.Value;
4 |
5 | public class DropAnimationValue implements Value {
6 |
7 | private int width;
8 | private int height;
9 | private int radius;
10 |
11 | public int getWidth() {
12 | return width;
13 | }
14 |
15 | public void setWidth(int width) {
16 | this.width = width;
17 | }
18 |
19 | public int getHeight() {
20 | return height;
21 | }
22 |
23 | public void setHeight(int height) {
24 | this.height = height;
25 | }
26 |
27 | public int getRadius() {
28 | return radius;
29 | }
30 |
31 | public void setRadius(int radius) {
32 | this.radius = radius;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/FillAnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data.type;
2 |
3 | import com.example.indicatorlib.views.animation.data.Value;
4 |
5 | public class FillAnimationValue extends ColorAnimationValue implements Value {
6 |
7 | private int radius;
8 | private int radiusReverse;
9 |
10 | private int stroke;
11 | private int strokeReverse;
12 |
13 | public int getRadius() {
14 | return radius;
15 | }
16 |
17 | public void setRadius(int radius) {
18 | this.radius = radius;
19 | }
20 |
21 | public int getRadiusReverse() {
22 | return radiusReverse;
23 | }
24 |
25 | public void setRadiusReverse(int radiusReverse) {
26 | this.radiusReverse = radiusReverse;
27 | }
28 |
29 | public int getStroke() {
30 | return stroke;
31 | }
32 |
33 | public void setStroke(int stroke) {
34 | this.stroke = stroke;
35 | }
36 |
37 | public int getStrokeReverse() {
38 | return strokeReverse;
39 | }
40 |
41 | public void setStrokeReverse(int strokeReverse) {
42 | this.strokeReverse = strokeReverse;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/ScaleAnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data.type;
2 |
3 | import com.example.indicatorlib.views.animation.data.Value;
4 |
5 | public class ScaleAnimationValue extends ColorAnimationValue implements Value {
6 |
7 | private int radius;
8 | private int radiusReverse;
9 |
10 | public int getRadius() {
11 | return radius;
12 | }
13 |
14 | public void setRadius(int radius) {
15 | this.radius = radius;
16 | }
17 |
18 | public int getRadiusReverse() {
19 | return radiusReverse;
20 | }
21 |
22 | public void setRadiusReverse(int radiusReverse) {
23 | this.radiusReverse = radiusReverse;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/SlideAnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data.type;
2 |
3 | import com.example.indicatorlib.views.animation.data.Value;
4 |
5 | public class SlideAnimationValue implements Value {
6 |
7 | private int coordinate;
8 |
9 | public int getCoordinate() {
10 | return coordinate;
11 | }
12 |
13 | public void setCoordinate(int coordinate) {
14 | this.coordinate = coordinate;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/SwapAnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data.type;
2 |
3 | import com.example.indicatorlib.views.animation.data.Value;
4 |
5 | public class SwapAnimationValue implements Value {
6 |
7 | private int coordinate;
8 | private int coordinateReverse;
9 |
10 | public int getCoordinate() {
11 | return coordinate;
12 | }
13 |
14 | public void setCoordinate(int coordinate) {
15 | this.coordinate = coordinate;
16 | }
17 |
18 | public int getCoordinateReverse() {
19 | return coordinateReverse;
20 | }
21 |
22 | public void setCoordinateReverse(int coordinateReverse) {
23 | this.coordinateReverse = coordinateReverse;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/ThinWormAnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data.type;
2 |
3 | import com.example.indicatorlib.views.animation.data.Value;
4 |
5 | public class ThinWormAnimationValue extends WormAnimationValue implements Value {
6 |
7 | private int height;
8 |
9 | public int getHeight() {
10 | return height;
11 | }
12 |
13 | public void setHeight(int height) {
14 | this.height = height;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/data/type/WormAnimationValue.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.data.type;
2 |
3 | import com.example.indicatorlib.views.animation.data.Value;
4 |
5 | public class WormAnimationValue implements Value {
6 |
7 | private int rectStart;
8 | private int rectEnd;
9 |
10 | public int getRectStart() {
11 | return rectStart;
12 | }
13 |
14 | public void setRectStart(int rectStartEdge) {
15 | this.rectStart = rectStartEdge;
16 | }
17 |
18 | public int getRectEnd() {
19 | return rectEnd;
20 | }
21 |
22 | public void setRectEnd(int rectEnd) {
23 | this.rectEnd = rectEnd;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/type/AnimationType.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.type;
2 |
3 | public enum AnimationType {NONE, COLOR, SCALE, WORM, SLIDE, FILL, THIN_WORM, DROP, SWAP, SCALE_DOWN}
4 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/type/BaseAnimation.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.type;
2 |
3 | import android.animation.Animator;
4 | import android.animation.ValueAnimator;
5 |
6 | import com.example.indicatorlib.views.animation.controller.ValueController;
7 |
8 | import android.support.annotation.NonNull;
9 | import android.support.annotation.NonNull;
10 | import android.support.annotation.Nullable;
11 |
12 | public abstract class BaseAnimation {
13 |
14 | public static final int DEFAULT_ANIMATION_TIME = 350;
15 | protected long animationDuration = DEFAULT_ANIMATION_TIME;
16 |
17 | protected ValueController.UpdateListener listener;
18 | protected T animator;
19 |
20 | public BaseAnimation(@Nullable ValueController.UpdateListener listener) {
21 | this.listener = listener;
22 | animator = createAnimator();
23 | }
24 |
25 | @NonNull
26 | public abstract T createAnimator();
27 |
28 | public abstract BaseAnimation progress(float progress);
29 |
30 | public BaseAnimation duration(long duration) {
31 | animationDuration = duration;
32 |
33 | if (animator instanceof ValueAnimator) {
34 | animator.setDuration(animationDuration);
35 | }
36 |
37 | return this;
38 | }
39 |
40 | public void start() {
41 | if (animator != null && !animator.isRunning()) {
42 | animator.start();
43 | }
44 | }
45 |
46 | public void end() {
47 | if (animator != null && animator.isStarted()) {
48 | animator.end();
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/animation/type/ScaleDownAnimation.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.animation.type;
2 |
3 | import android.animation.IntEvaluator;
4 | import android.animation.PropertyValuesHolder;
5 |
6 | import com.example.indicatorlib.views.animation.controller.ValueController;
7 |
8 | import android.support.annotation.NonNull;
9 |
10 | public class ScaleDownAnimation extends ScaleAnimation {
11 |
12 | public ScaleDownAnimation(@NonNull ValueController.UpdateListener listener) {
13 | super(listener);
14 | }
15 |
16 | @NonNull
17 | @Override
18 | protected PropertyValuesHolder createScalePropertyHolder(boolean isReverse) {
19 | String propertyName;
20 | int startRadiusValue;
21 | int endRadiusValue;
22 |
23 | if (isReverse) {
24 | propertyName = ANIMATION_SCALE_REVERSE;
25 | startRadiusValue = (int) (radius * scaleFactor);
26 | endRadiusValue = radius;
27 | } else {
28 | propertyName = ANIMATION_SCALE;
29 | startRadiusValue = radius;
30 | endRadiusValue = (int) (radius * scaleFactor);
31 | }
32 |
33 | PropertyValuesHolder holder = PropertyValuesHolder.ofInt(propertyName, startRadiusValue, endRadiusValue);
34 | holder.setEvaluator(new IntEvaluator());
35 |
36 | return holder;
37 | }
38 | }
39 |
40 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/DrawManager.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.support.annotation.Nullable;
6 | import android.util.AttributeSet;
7 | import android.util.Pair;
8 | import android.view.MotionEvent;
9 |
10 | import com.example.indicatorlib.views.animation.data.Value;
11 | import com.example.indicatorlib.views.draw.controller.AttributeController;
12 | import com.example.indicatorlib.views.draw.controller.DrawController;
13 | import com.example.indicatorlib.views.draw.controller.MeasureController;
14 | import com.example.indicatorlib.views.draw.data.Indicator;
15 |
16 | import android.support.annotation.NonNull;
17 |
18 | public class DrawManager {
19 |
20 | private Indicator indicator;
21 | private DrawController drawController;
22 | private MeasureController measureController;
23 | private AttributeController attributeController;
24 |
25 | public DrawManager() {
26 | this.indicator = new Indicator();
27 | this.drawController = new DrawController(indicator);
28 | this.measureController = new MeasureController();
29 | this.attributeController = new AttributeController(indicator);
30 | }
31 |
32 | @NonNull
33 | public Indicator indicator() {
34 | if (indicator == null) {
35 | indicator = new Indicator();
36 | }
37 |
38 | return indicator;
39 | }
40 |
41 | public void setClickListener(@Nullable DrawController.ClickListener listener) {
42 | drawController.setClickListener(listener);
43 | }
44 |
45 | public void touch(@Nullable MotionEvent event) {
46 | drawController.touch(event);
47 | }
48 |
49 | public void updateValue(@Nullable Value value) {
50 | drawController.updateValue(value);
51 | }
52 |
53 | public void draw(@NonNull Canvas canvas) {
54 | drawController.draw(canvas);
55 | }
56 |
57 | public Pair measureViewSize(int widthMeasureSpec, int heightMeasureSpec) {
58 | return measureController.measureViewSize(indicator, widthMeasureSpec, heightMeasureSpec);
59 | }
60 |
61 | public void initAttributes(@NonNull Context context, @Nullable AttributeSet attrs) {
62 | attributeController.init(context, attrs);
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/data/Orientation.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.data;
2 |
3 | public enum Orientation {HORIZONTAL, VERTICAL}
4 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/data/PositionSavedState.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.data;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 | import android.view.View;
6 |
7 | public class PositionSavedState extends View.BaseSavedState {
8 |
9 | private int selectedPosition;
10 | private int selectingPosition;
11 | private int lastSelectedPosition;
12 |
13 | public PositionSavedState(Parcelable superState) {
14 | super(superState);
15 | }
16 |
17 | private PositionSavedState(Parcel in) {
18 | super(in);
19 | this.selectedPosition = in.readInt();
20 | this.selectingPosition = in.readInt();
21 | this.lastSelectedPosition = in.readInt();
22 | }
23 |
24 | public int getSelectedPosition() {
25 | return selectedPosition;
26 | }
27 |
28 | public void setSelectedPosition(int selectedPosition) {
29 | this.selectedPosition = selectedPosition;
30 | }
31 |
32 | public int getSelectingPosition() {
33 | return selectingPosition;
34 | }
35 |
36 | public void setSelectingPosition(int selectingPosition) {
37 | this.selectingPosition = selectingPosition;
38 | }
39 |
40 | public int getLastSelectedPosition() {
41 | return lastSelectedPosition;
42 | }
43 |
44 | public void setLastSelectedPosition(int lastSelectedPosition) {
45 | this.lastSelectedPosition = lastSelectedPosition;
46 | }
47 |
48 | @Override
49 | public void writeToParcel(Parcel out, int flags) {
50 | super.writeToParcel(out, flags);
51 | out.writeInt(this.selectedPosition);
52 | out.writeInt(this.selectingPosition);
53 | out.writeInt(this.lastSelectedPosition);
54 | }
55 |
56 | public static final Creator CREATOR = new Creator() {
57 | public PositionSavedState createFromParcel(Parcel in) {
58 | return new PositionSavedState(in);
59 | }
60 |
61 | public PositionSavedState[] newArray(int size) {
62 | return new PositionSavedState[size];
63 | }
64 | };
65 | }
66 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/data/RtlMode.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.data;
2 |
3 | public enum RtlMode {On, Off, Auto}
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/BaseDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Paint;
4 |
5 | import com.example.indicatorlib.views.draw.data.Indicator;
6 |
7 | import android.support.annotation.NonNull;
8 |
9 | class BaseDrawer {
10 |
11 | Paint paint;
12 | Indicator indicator;
13 |
14 | BaseDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
15 | this.paint = paint;
16 | this.indicator = indicator;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/BasicDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | import com.example.indicatorlib.views.animation.type.AnimationType;
7 | import com.example.indicatorlib.views.draw.data.Indicator;
8 |
9 | import android.support.annotation.NonNull;
10 |
11 | public class BasicDrawer extends BaseDrawer {
12 |
13 | private Paint strokePaint;
14 |
15 | public BasicDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
16 | super(paint, indicator);
17 |
18 | strokePaint = new Paint();
19 | strokePaint.setStyle(Paint.Style.STROKE);
20 | strokePaint.setAntiAlias(true);
21 | strokePaint.setStrokeWidth(indicator.getStroke());
22 | }
23 |
24 | public void draw(
25 | @NonNull Canvas canvas,
26 | int position,
27 | boolean isSelectedItem,
28 | int coordinateX,
29 | int coordinateY) {
30 |
31 | float radius = indicator.getRadius();
32 | int strokePx = indicator.getStroke();
33 | float scaleFactor = indicator.getScaleFactor();
34 |
35 | int selectedColor = indicator.getSelectedColor();
36 | int unselectedColor = indicator.getUnselectedColor();
37 | int selectedPosition = indicator.getSelectedPosition();
38 | AnimationType animationType = indicator.getAnimationType();
39 |
40 | if (animationType == AnimationType.SCALE && !isSelectedItem) {
41 | radius *= scaleFactor;
42 |
43 | } else if (animationType == AnimationType.SCALE_DOWN && isSelectedItem) {
44 | radius *= scaleFactor;
45 | }
46 |
47 | int color = unselectedColor;
48 | if (position == selectedPosition) {
49 | color = selectedColor;
50 | }
51 |
52 | Paint paint;
53 | if (animationType == AnimationType.FILL && position != selectedPosition) {
54 | paint = strokePaint;
55 | paint.setStrokeWidth(strokePx);
56 | } else {
57 | paint = this.paint;
58 | }
59 |
60 | paint.setColor(color);
61 | canvas.drawCircle(coordinateX, coordinateY, radius, paint);
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/ColorDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | import com.example.indicatorlib.views.animation.data.Value;
7 | import com.example.indicatorlib.views.animation.data.type.ColorAnimationValue;
8 | import com.example.indicatorlib.views.draw.data.Indicator;
9 |
10 | import android.support.annotation.NonNull;
11 |
12 | public class ColorDrawer extends BaseDrawer {
13 |
14 | public ColorDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
15 | super(paint, indicator);
16 | }
17 |
18 | public void draw(@NonNull Canvas canvas,
19 | @NonNull Value value,
20 | int position,
21 | int coordinateX,
22 | int coordinateY) {
23 |
24 | if (!(value instanceof ColorAnimationValue)) {
25 | return;
26 | }
27 |
28 | ColorAnimationValue v = (ColorAnimationValue) value;
29 | float radius = indicator.getRadius();
30 | int color = indicator.getSelectedColor();
31 |
32 | int selectedPosition = indicator.getSelectedPosition();
33 | int selectingPosition = indicator.getSelectingPosition();
34 | int lastSelectedPosition = indicator.getLastSelectedPosition();
35 |
36 | if (indicator.isInteractiveAnimation()) {
37 | if (position == selectingPosition) {
38 | color = v.getColor();
39 |
40 | } else if (position == selectedPosition) {
41 | color = v.getColorReverse();
42 | }
43 |
44 | } else {
45 | if (position == selectedPosition) {
46 | color = v.getColor();
47 |
48 | } else if (position == lastSelectedPosition) {
49 | color = v.getColorReverse();
50 | }
51 | }
52 |
53 | paint.setColor(color);
54 | canvas.drawCircle(coordinateX, coordinateY, radius, paint);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/DropDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | import com.example.indicatorlib.views.animation.data.Value;
7 | import com.example.indicatorlib.views.animation.data.type.DropAnimationValue;
8 | import com.example.indicatorlib.views.draw.data.Indicator;
9 | import com.example.indicatorlib.views.draw.data.Orientation;
10 |
11 | import android.support.annotation.NonNull;
12 |
13 | public class DropDrawer extends BaseDrawer {
14 |
15 | public DropDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
16 | super(paint, indicator);
17 | }
18 |
19 | public void draw(
20 | @NonNull Canvas canvas,
21 | @NonNull Value value,
22 | int coordinateX,
23 | int coordinateY) {
24 |
25 | if (!(value instanceof DropAnimationValue)) {
26 | return;
27 | }
28 |
29 | DropAnimationValue v = (DropAnimationValue) value;
30 | int unselectedColor = indicator.getUnselectedColor();
31 | int selectedColor = indicator.getSelectedColor();
32 | float radius = indicator.getRadius();
33 |
34 | paint.setColor(unselectedColor);
35 | canvas.drawCircle(coordinateX, coordinateY, radius, paint);
36 |
37 | paint.setColor(selectedColor);
38 | if (indicator.getOrientation() == Orientation.HORIZONTAL) {
39 | canvas.drawCircle(v.getWidth(), v.getHeight(), v.getRadius(), paint);
40 | } else {
41 | canvas.drawCircle(v.getHeight(), v.getWidth(), v.getRadius(), paint);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/ScaleDownDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | import com.example.indicatorlib.views.animation.data.Value;
7 | import com.example.indicatorlib.views.animation.data.type.ScaleAnimationValue;
8 | import com.example.indicatorlib.views.draw.data.Indicator;
9 |
10 | import android.support.annotation.NonNull;
11 |
12 | public class ScaleDownDrawer extends BaseDrawer {
13 |
14 | public ScaleDownDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
15 | super(paint, indicator);
16 | }
17 |
18 | public void draw(
19 | @NonNull Canvas canvas,
20 | @NonNull Value value,
21 | int position,
22 | int coordinateX,
23 | int coordinateY) {
24 |
25 | if (!(value instanceof ScaleAnimationValue)) {
26 | return;
27 | }
28 |
29 | ScaleAnimationValue v = (ScaleAnimationValue) value;
30 | float radius = indicator.getRadius();
31 | int color = indicator.getSelectedColor();
32 |
33 | int selectedPosition = indicator.getSelectedPosition();
34 | int selectingPosition = indicator.getSelectingPosition();
35 | int lastSelectedPosition = indicator.getLastSelectedPosition();
36 |
37 | if (indicator.isInteractiveAnimation()) {
38 | if (position == selectingPosition) {
39 | radius = v.getRadius();
40 | color = v.getColor();
41 |
42 | } else if (position == selectedPosition) {
43 | radius = v.getRadiusReverse();
44 | color = v.getColorReverse();
45 | }
46 |
47 | } else {
48 | if (position == selectedPosition) {
49 | radius = v.getRadius();
50 | color = v.getColor();
51 |
52 | } else if (position == lastSelectedPosition) {
53 | radius = v.getRadiusReverse();
54 | color = v.getColorReverse();
55 | }
56 | }
57 |
58 | paint.setColor(color);
59 | canvas.drawCircle(coordinateX, coordinateY, radius, paint);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/ScaleDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | import com.example.indicatorlib.views.animation.data.Value;
7 | import com.example.indicatorlib.views.animation.data.type.ScaleAnimationValue;
8 | import com.example.indicatorlib.views.draw.data.Indicator;
9 |
10 | import android.support.annotation.NonNull;
11 |
12 | public class ScaleDrawer extends BaseDrawer {
13 |
14 | public ScaleDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
15 | super(paint, indicator);
16 | }
17 |
18 | public void draw(
19 | @NonNull Canvas canvas,
20 | @NonNull Value value,
21 | int position,
22 | int coordinateX,
23 | int coordinateY) {
24 |
25 | if (!(value instanceof ScaleAnimationValue)) {
26 | return;
27 | }
28 |
29 | ScaleAnimationValue v = (ScaleAnimationValue) value;
30 | float radius = indicator.getRadius();
31 | int color = indicator.getSelectedColor();
32 |
33 | int selectedPosition = indicator.getSelectedPosition();
34 | int selectingPosition = indicator.getSelectingPosition();
35 | int lastSelectedPosition = indicator.getLastSelectedPosition();
36 |
37 | if (indicator.isInteractiveAnimation()) {
38 | if (position == selectingPosition) {
39 | radius = v.getRadius();
40 | color = v.getColor();
41 |
42 | } else if (position == selectedPosition) {
43 | radius = v.getRadiusReverse();
44 | color = v.getColorReverse();
45 | }
46 |
47 | } else {
48 | if (position == selectedPosition) {
49 | radius = v.getRadius();
50 | color = v.getColor();
51 |
52 | } else if (position == lastSelectedPosition) {
53 | radius = v.getRadiusReverse();
54 | color = v.getColorReverse();
55 | }
56 | }
57 |
58 | paint.setColor(color);
59 | canvas.drawCircle(coordinateX, coordinateY, radius, paint);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/SlideDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | import com.example.indicatorlib.views.animation.data.Value;
7 | import com.example.indicatorlib.views.animation.data.type.SlideAnimationValue;
8 | import com.example.indicatorlib.views.draw.data.Indicator;
9 | import com.example.indicatorlib.views.draw.data.Orientation;
10 |
11 | import android.support.annotation.NonNull;
12 |
13 | public class SlideDrawer extends BaseDrawer {
14 |
15 | public SlideDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
16 | super(paint, indicator);
17 | }
18 |
19 | public void draw(
20 | @NonNull Canvas canvas,
21 | @NonNull Value value,
22 | int coordinateX,
23 | int coordinateY) {
24 |
25 | if (!(value instanceof SlideAnimationValue)) {
26 | return;
27 | }
28 |
29 | SlideAnimationValue v = (SlideAnimationValue) value;
30 | int coordinate = v.getCoordinate();
31 | int unselectedColor = indicator.getUnselectedColor();
32 | int selectedColor = indicator.getSelectedColor();
33 | int radius = indicator.getRadius();
34 |
35 | paint.setColor(unselectedColor);
36 | canvas.drawCircle(coordinateX, coordinateY, radius, paint);
37 |
38 | paint.setColor(selectedColor);
39 | if (indicator.getOrientation() == Orientation.HORIZONTAL) {
40 | canvas.drawCircle(coordinate, coordinateY, radius, paint);
41 | } else {
42 | canvas.drawCircle(coordinateX, coordinate, radius, paint);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/ThinWormDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 |
6 | import com.example.indicatorlib.views.animation.data.Value;
7 | import com.example.indicatorlib.views.animation.data.type.ThinWormAnimationValue;
8 | import com.example.indicatorlib.views.draw.data.Indicator;
9 | import com.example.indicatorlib.views.draw.data.Orientation;
10 |
11 | import android.support.annotation.NonNull;
12 |
13 | public class ThinWormDrawer extends WormDrawer {
14 |
15 | public ThinWormDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
16 | super(paint, indicator);
17 | }
18 |
19 | public void draw(
20 | @NonNull Canvas canvas,
21 | @NonNull Value value,
22 | int coordinateX,
23 | int coordinateY) {
24 |
25 | if (!(value instanceof ThinWormAnimationValue)) {
26 | return;
27 | }
28 |
29 | ThinWormAnimationValue v = (ThinWormAnimationValue) value;
30 | int rectStart = v.getRectStart();
31 | int rectEnd = v.getRectEnd();
32 | int height = v.getHeight() / 2;
33 |
34 | int radius = indicator.getRadius();
35 | int unselectedColor = indicator.getUnselectedColor();
36 | int selectedColor = indicator.getSelectedColor();
37 |
38 | if (indicator.getOrientation() == Orientation.HORIZONTAL) {
39 | rect.left = rectStart;
40 | rect.right = rectEnd;
41 | rect.top = coordinateY - height;
42 | rect.bottom = coordinateY + height;
43 |
44 | } else {
45 | rect.left = coordinateX - height;
46 | rect.right = coordinateX + height;
47 | rect.top = rectStart;
48 | rect.bottom = rectEnd;
49 | }
50 |
51 | paint.setColor(unselectedColor);
52 | canvas.drawCircle(coordinateX, coordinateY, radius, paint);
53 |
54 | paint.setColor(selectedColor);
55 | canvas.drawRoundRect(rect, radius, radius, paint);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/draw/drawer/type/WormDrawer.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.draw.drawer.type;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Paint;
5 | import android.graphics.RectF;
6 |
7 | import com.example.indicatorlib.views.animation.data.Value;
8 | import com.example.indicatorlib.views.animation.data.type.WormAnimationValue;
9 | import com.example.indicatorlib.views.draw.data.Indicator;
10 | import com.example.indicatorlib.views.draw.data.Orientation;
11 |
12 | import android.support.annotation.NonNull;
13 |
14 | public class WormDrawer extends BaseDrawer {
15 |
16 | public RectF rect;
17 |
18 | public WormDrawer(@NonNull Paint paint, @NonNull Indicator indicator) {
19 | super(paint, indicator);
20 | rect = new RectF();
21 | }
22 |
23 | public void draw(
24 | @NonNull Canvas canvas,
25 | @NonNull Value value,
26 | int coordinateX,
27 | int coordinateY) {
28 |
29 | if (!(value instanceof WormAnimationValue)) {
30 | return;
31 | }
32 |
33 | WormAnimationValue v = (WormAnimationValue) value;
34 | int rectStart = v.getRectStart();
35 | int rectEnd = v.getRectEnd();
36 |
37 | int radius = indicator.getRadius();
38 | int unselectedColor = indicator.getUnselectedColor();
39 | int selectedColor = indicator.getSelectedColor();
40 |
41 | if (indicator.getOrientation() == Orientation.HORIZONTAL) {
42 | rect.left = rectStart;
43 | rect.right = rectEnd;
44 | rect.top = coordinateY - radius;
45 | rect.bottom = coordinateY + radius;
46 |
47 | } else {
48 | rect.left = coordinateX - radius;
49 | rect.right = coordinateX + radius;
50 | rect.top = rectStart;
51 | rect.bottom = rectEnd;
52 | }
53 |
54 | paint.setColor(unselectedColor);
55 | canvas.drawCircle(coordinateX, coordinateY, radius, paint);
56 |
57 | paint.setColor(selectedColor);
58 | canvas.drawRoundRect(rect, radius, radius, paint);
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/utils/DensityUtils.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.utils;
2 |
3 | import android.content.res.Resources;
4 | import android.util.TypedValue;
5 |
6 | public class DensityUtils {
7 |
8 | public static int dpToPx(int dp) {
9 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, Resources.getSystem().getDisplayMetrics());
10 | }
11 |
12 | public static int pxToDp(float px) {
13 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_PX, px, Resources.getSystem().getDisplayMetrics());
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/java/com/example/indicatorlib/views/utils/IdUtils.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib.views.utils;
2 |
3 | import android.os.Build;
4 | import android.view.View;
5 |
6 | import java.util.concurrent.atomic.AtomicInteger;
7 |
8 | public class IdUtils {
9 |
10 | private static final AtomicInteger nextGeneratedId = new AtomicInteger(1);
11 |
12 | public static int generateViewId(){
13 | if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
14 | return generateId();
15 | } else {
16 | return View.generateViewId();
17 | }
18 | }
19 |
20 | /**
21 | * Generate a value suitable for use in #setId(int).
22 | * This value will not collide with ID values generated at build time by aapt for R.id.
23 | *
24 | * @return a generated ID value
25 | */
26 | private static int generateId() {
27 | for (; ; ) {
28 | final int result = nextGeneratedId.get();
29 | // aapt-generated IDs have the high byte nonzero; clamp to the range under that.
30 | int newValue = result + 1;
31 | if (newValue > 0x00FFFFFF) newValue = 1; // Roll over to 1, not 0.
32 | if (nextGeneratedId.compareAndSet(result, newValue)) {
33 | return result;
34 | }
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/indicatorlib/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | IndicatorLib
3 |
4 |
--------------------------------------------------------------------------------
/indicatorlib/src/test/java/com/example/indicatorlib/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.example.indicatorlib;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/jks/appinfo.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/jks/appinfo.jks
--------------------------------------------------------------------------------
/jks/密码.txt:
--------------------------------------------------------------------------------
1 | Key alias:appinfo
2 | 密码: appinfo
3 | 都是:appinfo
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 29
5 |
6 | defaultConfig {
7 | minSdkVersion 20
8 | targetSdkVersion 29
9 |
10 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
11 |
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(dir: 'libs', include: ['*.jar'])
23 | implementation 'androidx.appcompat:appcompat:1.1.0'
24 | implementation 'androidx.viewpager2:viewpager2:1.0.0'
25 | }
--------------------------------------------------------------------------------
/library/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/library/src/main/java/com/aohanyao/transformer/library/conf/OnPageTransformerListener.java:
--------------------------------------------------------------------------------
1 | package com.aohanyao.transformer.library.conf;
2 |
3 | import android.view.View;
4 |
5 | /**
6 | * Created by jjc on 2017/6/17.
7 | * 自定义动画的时候使用
8 | * Customize when using animation
9 | */
10 | public interface OnPageTransformerListener {
11 | void onPageTransformerListener(View page, float position);
12 | }
13 |
--------------------------------------------------------------------------------
/library/src/main/java/com/aohanyao/transformer/library/conf/PageTransformerConfig.java:
--------------------------------------------------------------------------------
1 | package com.aohanyao.transformer.library.conf;
2 |
3 |
4 | import androidx.annotation.IntDef;
5 |
6 | /**
7 | * Created by jjc on 2017/6/17.
8 | * 相关的配置
9 | */
10 |
11 | public class PageTransformerConfig {
12 | /**
13 | * 方向
14 | */
15 | @IntDef({HORIZONTAL, VERTICAL})
16 | public @interface Orientation {
17 | }
18 |
19 | /**
20 | * 动画类型
21 | */
22 | @IntDef({NONE, ROTATION, ALPHA})
23 | public @interface AnimationType {
24 | }
25 |
26 | /**
27 | * 视图类型
28 | */
29 | @IntDef({BOTTOM, BOTTOM_LEFT, BOTTOM_RIGHT, TOP, TOP_LEFT, TOP_RIGHT, LEFT, RIGHT})
30 | public @interface ViewType {
31 | }
32 |
33 | /**
34 | * 没有动画
35 | */
36 | public static final int NONE = 99;
37 | /**
38 | * 旋转
39 | */
40 | public static final int ROTATION = 98;
41 | /**
42 | * 透明度
43 | */
44 | public static final int ALPHA = 97;
45 | /**
46 | * 水平方向
47 | */
48 | public static final int HORIZONTAL = -1;
49 | /**
50 | * 垂直方向
51 | */
52 | public static final int VERTICAL = -2;
53 |
54 | /**
55 | * 底部
56 | */
57 | public static final int BOTTOM = 1;
58 | /**
59 | * 底部 左边
60 | */
61 | public static final int BOTTOM_LEFT = 11;
62 | /**
63 | * 底部右边
64 | */
65 | public static final int BOTTOM_RIGHT = 12;
66 | /**
67 | * 上面
68 | */
69 | public static final int TOP = 2;
70 | /**
71 | * 上左
72 | */
73 | public static final int TOP_LEFT = 21;
74 | /**
75 | * 上右
76 | */
77 | public static final int TOP_RIGHT = 22;
78 | /**
79 | * 左边
80 | */
81 | public static final int LEFT = 3;
82 | /**
83 | * 右边
84 | */
85 | public static final int RIGHT = 4;
86 | }
87 |
--------------------------------------------------------------------------------
/library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | CardPageTransformer
3 |
4 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':appinfo','FlycoTabLayout_Lib','simplelocation','library','indicatorlib'
2 |
--------------------------------------------------------------------------------
/simplelocation/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/simplelocation/.DS_Store
--------------------------------------------------------------------------------
/simplelocation/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 29
5 | buildToolsVersion "29.0.1"
6 |
7 |
8 | defaultConfig {
9 | minSdkVersion 15
10 | targetSdkVersion 29
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15 |
16 |
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 |
24 | }
25 |
26 | dependencies {
27 | implementation fileTree(dir: 'libs', include: ['*.jar'])
28 | implementation 'androidx.appcompat:appcompat:1.0.2'
29 | }
30 | }
--------------------------------------------------------------------------------
/simplelocation/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/simplelocation/src/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/snn-hp/GetAppInfo/acb0fc9bb91a832094b7b1e1c64a24e400940d3c/simplelocation/src/.DS_Store
--------------------------------------------------------------------------------
/simplelocation/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/bean/ParseLocation.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.bean;
2 |
3 | public abstract class ParseLocation {
4 |
5 | public abstract Latlng paseLocation(T t);
6 | }
7 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/constant/Constant.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.constant;
2 |
3 | public class Constant {
4 |
5 | /** google服务*/
6 | public static final int GOOGLE_API = 0;
7 |
8 | /** 腾讯服务*/
9 | public static final int TENCENT_API = 1;
10 |
11 | /** 高德服务*/
12 | public static final int GAODE_API = 2;
13 |
14 | /** 百度服务*/
15 | public static final int BAIDU_API = 3;
16 |
17 | /** 谷歌LocationManager定位*/
18 | public static final int LM_API = 4;
19 |
20 | /** unwiredlabs.com 基站定位*/
21 | public static final int BS_UNWIRED_API = 5;
22 |
23 | /** cellocation 基站地位*/
24 | public static final int BS_OPENCELLID_API = 6;
25 | }
26 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/constant/ResponseConstant.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.constant;
2 |
3 | public class ResponseConstant {
4 |
5 | /** 谷歌返地理编码成功*/
6 | public static final int GOOGLE_API_SUCCESS = 0;
7 |
8 | /** 谷歌返地理编码服务不可用*/
9 | public static final int GOOGLE_API_OUT_OF_CONDITON = 1;
10 |
11 | /** 谷歌反地理编码请求超时*/
12 | public static final int GOOGLE_API_TIMEOUT = 2;
13 |
14 | /** 谷歌返地理编码失败*/
15 | public static final int GOOGLE_API_ON_FALI = 3;
16 | }
17 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/constant/UrlConstant.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.constant;
2 |
3 | public class UrlConstant {
4 |
5 | /** 百度api返地理编码*/
6 | public static final String BAIDU_URL = "https://api.map.baidu.com";
7 |
8 | /** 腾讯api返地理编码*/
9 | public static final String TENCENT_URL = "https://apis.map.qq.com";
10 |
11 | /** 高德api返地理编码*/
12 | public static final String GAODE_URL = "https://restapi.amap.com";
13 |
14 | /** 基站定位的网址*/
15 | public static final String BS_URL = "http://api.cellocation.com";
16 |
17 | /** openCellid 开放式数据库和地理位置数据库*/
18 | public static final String OPEN_CELLID_URL = "https://ap1.unwiredlabs.com";
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/helper/ConverHelper.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.helper;
2 |
3 | import android.location.Address;
4 | import android.location.Location;
5 |
6 | import com.mjzuo.location.bean.Latlng;
7 |
8 | public class ConverHelper {
9 |
10 | public static Latlng loConverToLatlng(Location location) {
11 | if(location == null)
12 | return null;
13 | Latlng latlng = new Latlng();
14 | latlng.setLatitude(location.getLatitude());
15 | latlng.setLongitude(location.getLongitude());
16 | latlng.setProvider(location.getProvider());
17 |
18 | latlng.setBearing(location.getBearing());
19 | latlng.setSpeed(location.getSpeed());
20 | return latlng;
21 | }
22 |
23 | public static Latlng asConverToLatlng(Latlng latlng, Address address) {
24 | if(address == null || latlng == null)
25 | return null;
26 | latlng.setCountry(address.getCountryName());
27 | latlng.setCountryCode(address.getCountryCode());
28 | latlng.setCity(address.getAdminArea());
29 | latlng.setSublocality(address.getSubLocality());
30 | latlng.setAddress(address.getSubAdminArea()+""+address.getThoroughfare());
31 | latlng.setName(address.getFeatureName());
32 | return latlng;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/helper/GeReFactory.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.helper;
2 |
3 | import android.content.Context;
4 |
5 | import com.mjzuo.location.constant.Constant;
6 | import com.mjzuo.location.location.BsGeocoding;
7 | import com.mjzuo.location.location.GoogleGeocoding;
8 | import com.mjzuo.location.location.IGeocoding;
9 | import com.mjzuo.location.location.OpenCellidGeocoding;
10 | import com.mjzuo.location.regelocation.BaiduGeRe;
11 | import com.mjzuo.location.regelocation.GaodeGeRe;
12 | import com.mjzuo.location.regelocation.GoogleRege;
13 | import com.mjzuo.location.regelocation.IReGe;
14 | import com.mjzuo.location.regelocation.TencentGeRe;
15 |
16 | public class GeReFactory {
17 |
18 | public static IReGe getReGeByType(int reGeType){
19 | IReGe iReGe;
20 | switch (reGeType) {
21 | case Constant.GOOGLE_API:
22 | iReGe = new GoogleRege();
23 | break;
24 | case Constant.BAIDU_API:
25 | iReGe = new BaiduGeRe();
26 | break;
27 | case Constant.TENCENT_API:
28 | iReGe = new TencentGeRe();
29 | break;
30 | case Constant.GAODE_API:
31 | iReGe = new GaodeGeRe();
32 | break;
33 | default:
34 | iReGe = new GoogleRege();
35 | }
36 | return iReGe;
37 | }
38 |
39 | public static IGeocoding getGeocodingType(Context context, int geocodingType){
40 | IGeocoding iGeocoding;
41 | switch (geocodingType) {
42 | case Constant.LM_API:
43 | iGeocoding = new GoogleGeocoding(context);
44 | break;
45 | case Constant.BS_UNWIRED_API:
46 | iGeocoding = new BsGeocoding(context);
47 | break;
48 | case Constant.BS_OPENCELLID_API:
49 | iGeocoding = new OpenCellidGeocoding(context);
50 | break;
51 | default:
52 | iGeocoding = new GoogleGeocoding(context);
53 | }
54 | return iGeocoding;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/location/IGeocoding.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.location;
2 |
3 | import com.mjzuo.location.bean.Latlng;
4 |
5 | public interface IGeocoding {
6 |
7 | /**
8 | * 开始获取位置
9 | */
10 | void start(ISiLoResponseListener listener);
11 |
12 | /**
13 | * 重新请求
14 | */
15 | void reStart();
16 |
17 | /**
18 | * 结束
19 | */
20 | void stop();
21 |
22 | /**
23 | * 结果监听
24 | */
25 | interface ISiLoResponseListener {
26 | void onSuccess(Latlng latlng);
27 | void onFail(String msg);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/net/StreamUtil.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.net;
2 |
3 | import java.io.ByteArrayOutputStream;
4 | import java.io.Closeable;
5 | import java.io.IOException;
6 | import java.io.InputStream;
7 |
8 | public class StreamUtil {
9 |
10 | private static final int BUF_SIZE = 4096;
11 |
12 | public static byte[] toBytes(InputStream is) {
13 | ByteArrayOutputStream baos = null;
14 | try {
15 | baos = new ByteArrayOutputStream();
16 | byte[] buf = new byte[BUF_SIZE];
17 | int count;
18 | while ((count = is.read(buf, 0, buf.length)) != -1) {
19 | baos.write(buf, 0, count);
20 | }
21 | baos.flush();
22 | return baos.toByteArray();
23 |
24 | } catch (IOException e) {
25 | e.printStackTrace();
26 | } finally {
27 | safeClose(baos);
28 | }
29 | return null;
30 | }
31 |
32 | private static void safeClose(Closeable c) {
33 | if (c != null) {
34 | try {
35 | c.close();
36 | } catch (IOException e) {
37 | e.printStackTrace();
38 | }
39 | }
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/regelocation/IReGe.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.regelocation;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.annotation.Nullable;
6 |
7 | import com.mjzuo.location.ReverseGeocodingManager;
8 | import com.mjzuo.location.bean.Latlng;
9 |
10 | public interface IReGe {
11 |
12 | /**
13 | * 初始化工作
14 | */
15 | void init(@Nullable Context context);
16 |
17 | /**
18 | * 配置参数
19 | */
20 | void setOptions(@Nullable ReverseGeocodingManager.ReGeOption options);
21 |
22 | /**
23 | * 反向编码
24 | */
25 | void reGeToAddress(Latlng latlng);
26 |
27 | /**
28 | * 结束
29 | */
30 | void stop();
31 |
32 | /**
33 | * 注册监听
34 | */
35 | void addReGeListener(IReGeListener listener);
36 |
37 | /**
38 | * 反编码的回调
39 | */
40 | interface IReGeListener {
41 | void onSuccess(int state, Latlng latlng);
42 | void onFail(int errorCode, String error);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/util/CommonUtil.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.util;
2 |
3 | public class CommonUtil {
4 |
5 | /**
6 | * 来自stackoverflow的MD5计算方法,调用了MessageDigest库函数,并把byte数组结果转换成16进制
7 | * @param md5
8 | * @return
9 | */
10 | public static String MD5(String md5) {
11 | try {
12 | java.security.MessageDigest md = java.security.MessageDigest
13 | .getInstance("MD5");
14 | byte[] array = md.digest(md5.getBytes());
15 | StringBuffer sb = new StringBuffer();
16 | for (int i = 0; i < array.length; ++i) {
17 | sb.append(Integer.toHexString((array[i] & 0xFF) | 0x100)
18 | .substring(1, 3));
19 | }
20 | return sb.toString();
21 | } catch (java.security.NoSuchAlgorithmException e) {
22 | }
23 | return null;
24 | }
25 |
26 | /**
27 | * 将String转换成bytes
28 | */
29 | public static byte[] stringToBytes(String s) {
30 | if (s != null) {
31 | try {
32 | return s.getBytes("UTF-8");
33 | } catch (Exception var2) {
34 | return new byte[0];
35 | }
36 | }
37 | return new byte[0];
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/simplelocation/src/main/java/com/mjzuo/location/util/LogUtil.java:
--------------------------------------------------------------------------------
1 | package com.mjzuo.location.util;
2 |
3 | import android.util.Log;
4 |
5 | public class LogUtil {
6 |
7 | public static boolean DEBUG= false;
8 |
9 | public static final String TAG = "tag_sl";
10 |
11 | public static void d(String text){
12 | if (DEBUG){
13 | Log.d(TAG,text);
14 | }
15 | }
16 |
17 | public static void i(String text){
18 | if(DEBUG){
19 | Log.i(TAG,text);
20 | }
21 | }
22 |
23 | public static void w(String text){
24 | if(DEBUG){
25 | Log.w(TAG,text);
26 | }
27 | }
28 |
29 | public static void e(String text){
30 | if(DEBUG){
31 | Log.e(TAG,text);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/simplelocation/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | simplelocation
3 |
4 |
--------------------------------------------------------------------------------