├── .github
├── FUNDING.yml
└── workflows
│ ├── gradle-publish.yml
│ └── release-apk.yml
├── .gitignore
├── .idea
├── codeStyles
│ └── Project.xml
├── copyright
│ ├── liyujiang_Default.xml
│ ├── liyujiang_MulanPSL.xml
│ └── profiles_settings.xml
└── inspectionProfiles
│ └── Project_Default.xml
├── .jitpack.yml
├── API.md
├── AddressPicker
├── README.md
├── build.gradle
├── consumer-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── china_address.json
│ └── java
│ └── com
│ └── github
│ └── gzuliyujiang
│ └── wheelpicker
│ ├── AddressPicker.java
│ ├── annotation
│ └── AddressMode.java
│ ├── contract
│ ├── AddressLoader.java
│ ├── AddressParser.java
│ ├── AddressReceiver.java
│ ├── OnAddressLoadListener.java
│ └── OnAddressPickedListener.java
│ ├── entity
│ ├── AddressEntity.java
│ ├── CityEntity.java
│ ├── CountyEntity.java
│ └── ProvinceEntity.java
│ ├── impl
│ ├── AddressProvider.java
│ └── AssetAddressLoader.java
│ └── utility
│ └── AddressJsonParser.java
├── CalendarPicker
├── README.md
├── build.gradle
├── consumer-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── github
│ │ └── gzuliyujiang
│ │ └── calendarpicker
│ │ ├── CalendarPicker.java
│ │ ├── OnRangeDatePickListener.java
│ │ ├── OnSingleDatePickListener.java
│ │ ├── core
│ │ ├── CalendarAdapter.java
│ │ ├── CalendarView.java
│ │ ├── ColorScheme.java
│ │ ├── DateUtils.java
│ │ ├── DayEntity.java
│ │ ├── DayStatus.java
│ │ ├── DayView.java
│ │ ├── FestivalProvider.java
│ │ ├── Interval.java
│ │ ├── ItemViewProvider.java
│ │ ├── MonthEntity.java
│ │ ├── MonthView.java
│ │ ├── NumInterval.java
│ │ ├── OnDateClickListener.java
│ │ ├── OnDateSelectedListener.java
│ │ ├── TimeUtils.java
│ │ └── WeekAdapter.java
│ │ └── listener
│ │ ├── OnPageChangeCallback.java
│ │ └── ScrollEventAdapter.java
│ └── res
│ └── layout
│ └── calendar_body.xml
├── ChangeLog.md
├── ColorPicker
├── README.md
├── build.gradle
├── consumer-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── github
│ │ └── gzuliyujiang
│ │ └── colorpicker
│ │ ├── BrightnessGradientView.java
│ │ ├── ColorGradientView.java
│ │ ├── ColorPicker.java
│ │ ├── OnColorChangedListener.java
│ │ ├── OnColorPickedListener.java
│ │ ├── SavedState.java
│ │ └── Utils.java
│ └── res
│ ├── layout
│ └── color_picker_content.xml
│ └── mipmap-xxhdpi
│ └── color_picker_pointer.png
├── Common
├── README.md
├── build.gradle
├── consumer-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── github
│ │ └── gzuliyujiang
│ │ └── dialog
│ │ ├── BaseDialog.java
│ │ ├── BottomDialog.java
│ │ ├── CornerRound.java
│ │ ├── DialogColor.java
│ │ ├── DialogConfig.java
│ │ ├── DialogLog.java
│ │ ├── DialogStyle.java
│ │ └── ModalDialog.java
│ └── res
│ ├── anim
│ ├── dialog_sheet_enter.xml
│ └── dialog_sheet_exit.xml
│ ├── layout
│ ├── dialog_footer_style_1.xml
│ ├── dialog_footer_style_2.xml
│ ├── dialog_footer_style_3.xml
│ ├── dialog_header_style_1.xml
│ ├── dialog_header_style_2.xml
│ ├── dialog_header_style_3.xml
│ └── dialog_header_style_default.xml
│ ├── mipmap-xxhdpi
│ └── dialog_close_icon.png
│ └── values
│ ├── dialog_anims.xml
│ └── dialog_themes.xml
├── FilePicker
├── README.md
├── build.gradle
├── consumer-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── github
│ │ └── gzuliyujiang
│ │ └── filepicker
│ │ ├── ExplorerConfig.java
│ │ ├── FileExplorer.java
│ │ ├── FilePicker.java
│ │ ├── adapter
│ │ ├── FileAdapter.java
│ │ ├── FileEntity.java
│ │ ├── PathAdapter.java
│ │ └── ViewHolder.java
│ │ ├── annotation
│ │ ├── ExplorerMode.java
│ │ └── FileSort.java
│ │ ├── contract
│ │ ├── OnFileClickedListener.java
│ │ ├── OnFileLoadedListener.java
│ │ ├── OnFilePickedListener.java
│ │ └── OnPathClickedListener.java
│ │ ├── filter
│ │ ├── PatternFilter.java
│ │ └── SimpleFilter.java
│ │ └── sort
│ │ ├── SortByExtension.java
│ │ ├── SortByName.java
│ │ ├── SortBySize.java
│ │ └── SortByTime.java
│ └── res
│ ├── layout
│ └── file_picker_content.xml
│ └── mipmap-xxhdpi
│ ├── file_picker_arrow.png
│ ├── file_picker_file.png
│ ├── file_picker_folder.png
│ ├── file_picker_home.png
│ └── file_picker_up.png
├── ImagePicker
├── README.md
├── build.gradle
├── consumer-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── github
│ │ └── gzuliyujiang
│ │ └── imagepicker
│ │ ├── ActivityBuilder.java
│ │ ├── ActivityResult.java
│ │ ├── BitmapCroppingTask.java
│ │ ├── BitmapLoadingTask.java
│ │ ├── BitmapUtils.java
│ │ ├── CropImageActivity.java
│ │ ├── CropImageAnimation.java
│ │ ├── CropImageConsts.java
│ │ ├── CropImageOptions.java
│ │ ├── CropImageView.java
│ │ ├── CropOverlayView.java
│ │ ├── CropWindowHandler.java
│ │ ├── CropWindowMoveHandler.java
│ │ ├── HybridityUtils.java
│ │ ├── ImagePicker.java
│ │ ├── ImageProvider.java
│ │ └── PickCallback.java
│ └── res
│ ├── drawable-xxhdpi
│ ├── crop_image_back.png
│ ├── crop_image_done.png
│ └── crop_image_rotate.png
│ ├── layout
│ ├── crop_image_activity.xml
│ └── crop_image_view.xml
│ ├── values
│ └── crop_image_attrs.xml
│ └── xml
│ └── crop_image_paths.xml
├── LICENSE
├── NOTICE
├── README.md
├── WheelPicker
├── README.md
├── build.gradle
├── consumer-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── github
│ │ └── gzuliyujiang
│ │ └── wheelpicker
│ │ ├── BirthdayPicker.java
│ │ ├── CarPlatePicker.java
│ │ ├── ConstellationPicker.java
│ │ ├── DatePicker.java
│ │ ├── DatimePicker.java
│ │ ├── EthnicPicker.java
│ │ ├── LinkagePicker.java
│ │ ├── NumberPicker.java
│ │ ├── OptionPicker.java
│ │ ├── PhoneCodePicker.java
│ │ ├── SexPicker.java
│ │ ├── TimePicker.java
│ │ ├── annotation
│ │ ├── DateMode.java
│ │ ├── EthnicSpec.java
│ │ └── TimeMode.java
│ │ ├── contract
│ │ ├── DateFormatter.java
│ │ ├── LinkageProvider.java
│ │ ├── OnCarPlatePickedListener.java
│ │ ├── OnDatePickedListener.java
│ │ ├── OnDateSelectedListener.java
│ │ ├── OnDatimePickedListener.java
│ │ ├── OnDatimeSelectedListener.java
│ │ ├── OnLinkagePickedListener.java
│ │ ├── OnLinkageSelectedListener.java
│ │ ├── OnNumberPickedListener.java
│ │ ├── OnNumberSelectedListener.java
│ │ ├── OnOptionPickedListener.java
│ │ ├── OnOptionSelectedListener.java
│ │ ├── OnTimeMeridiemPickedListener.java
│ │ ├── OnTimeMeridiemSelectedListener.java
│ │ ├── OnTimePickedListener.java
│ │ ├── OnTimeSelectedListener.java
│ │ └── TimeFormatter.java
│ │ ├── entity
│ │ ├── ConstellationEntity.java
│ │ ├── DateEntity.java
│ │ ├── DatimeEntity.java
│ │ ├── EthnicEntity.java
│ │ ├── PhoneCodeEntity.java
│ │ ├── SexEntity.java
│ │ └── TimeEntity.java
│ │ ├── impl
│ │ ├── BirthdayFormatter.java
│ │ ├── CarPlateProvider.java
│ │ ├── SimpleDateFormatter.java
│ │ ├── SimpleTimeFormatter.java
│ │ ├── SimpleWheelFormatter.java
│ │ ├── UnitDateFormatter.java
│ │ └── UnitTimeFormatter.java
│ │ └── widget
│ │ ├── BaseWheelLayout.java
│ │ ├── CarPlateWheelLayout.java
│ │ ├── DateWheelLayout.java
│ │ ├── DatimeWheelLayout.java
│ │ ├── LinkageWheelLayout.java
│ │ ├── NumberWheelLayout.java
│ │ ├── OptionWheelLayout.java
│ │ └── TimeWheelLayout.java
│ └── res
│ ├── layout
│ ├── wheel_picker_date.xml
│ ├── wheel_picker_datime.xml
│ ├── wheel_picker_linkage.xml
│ ├── wheel_picker_number.xml
│ ├── wheel_picker_option.xml
│ └── wheel_picker_time.xml
│ └── values
│ └── wheel_attrs.xml
├── WheelView
├── README.md
├── build.gradle
├── consumer-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── github
│ │ └── gzuliyujiang
│ │ └── wheelview
│ │ ├── annotation
│ │ ├── CurtainCorner.java
│ │ ├── ItemTextAlign.java
│ │ └── ScrollState.java
│ │ ├── contract
│ │ ├── OnWheelChangedListener.java
│ │ ├── TextProvider.java
│ │ └── WheelFormatter.java
│ │ └── widget
│ │ ├── NumberWheelView.java
│ │ └── WheelView.java
│ └── res
│ └── values
│ ├── wheel_attrs.xml
│ └── wheel_styles.xml
├── _config.yml
├── app
├── build.gradle
├── debug.keystore
├── gradle.properties
├── proguard-common.pro
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── china_address_guizhou.json
│ ├── china_address_guizhou_city.json
│ ├── city.json
│ ├── city.txt
│ └── pca-code.json
│ ├── java
│ └── com
│ │ └── github
│ │ └── gzuliyujiang
│ │ └── fallback
│ │ ├── DemoApp.java
│ │ ├── activity
│ │ ├── AddressPickerActivity.java
│ │ ├── BackAbleActivity.java
│ │ ├── CalendarPickerActivity.java
│ │ ├── ColorPickerActivity.java
│ │ ├── DateTimePickerActivity.java
│ │ ├── FileExplorerFragment.java
│ │ ├── FilePickerActivity.java
│ │ ├── ImagePickerActivity.java
│ │ ├── LinkagePickerActivity.java
│ │ ├── MainActivity.java
│ │ ├── OptionPickerFragment.java
│ │ └── SinglePickerActivity.java
│ │ ├── bean
│ │ └── GoodsCategoryBean.java
│ │ └── custom
│ │ ├── AntFortuneLikePicker.java
│ │ ├── AntFortuneLikeProvider.java
│ │ ├── CustomAddressPicker.java
│ │ ├── TextAddressLoader.java
│ │ └── TextAddressParser.java
│ └── res
│ ├── layout
│ ├── activity_picker_address.xml
│ ├── activity_picker_calendar.xml
│ ├── activity_picker_color.xml
│ ├── activity_picker_date_time.xml
│ ├── activity_picker_file.xml
│ ├── activity_picker_image.xml
│ ├── activity_picker_linkage.xml
│ ├── activity_picker_main.xml
│ ├── activity_picker_single.xml
│ ├── fragment_file_explorer.xml
│ ├── layout_title_bar.xml
│ └── wheel_picker_custom_ui_address.xml
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ ├── styles.xml
│ └── themes.xml
├── build.gradle
├── buildAPK.bat
├── demo.apk
├── gradle.properties
├── gradle
├── app.gradle
├── common.gradle
├── config.gradle
├── dependency.gradle
├── git.gradle
├── init.d
│ └── init.gradle
├── library.gradle
├── publish.gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── publishAAR.bat
├── screenshots
├── 1.webp
├── 2.webp
├── 3.webp
├── 4.webp
├── 5.webp
├── 6.webp
├── 7.webp
├── 8.webp
└── 9.webp
└── settings.gradle
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | custom: [ 'https://gitee.com/li_yu_jiang' ]
4 |
--------------------------------------------------------------------------------
/.github/workflows/gradle-publish.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build a package using Gradle and then publish it to maven local when a release is created
2 | # See https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3 | # and https://github.com/actions/starter-workflows/blob/master/ci/gradle-publish.yml
4 |
5 | name: Gradle Package
6 |
7 | on:
8 | release:
9 | types: [ created ]
10 |
11 | jobs:
12 | build:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - name: Checkout source code
16 | uses: actions/checkout@v2
17 | - name: Set up JDK 11
18 | uses: actions/setup-java@v1
19 | with:
20 | java-version: 11
21 | - name: Grant execute permission for gradlew
22 | run: chmod +x gradlew
23 | - name: Build with Gradle
24 | run: ./gradlew build
25 | - name: Publish to mavenLocal()
26 | run: ./gradlew publishToMavenLocal --info --warning-mode all
27 | - name: Auto send a request to JitPack
28 | uses: badasintended/autojitpack@v0
29 |
--------------------------------------------------------------------------------
/.github/workflows/release-apk.yml:
--------------------------------------------------------------------------------
1 | # This workflow will build a Java/Android project with Gradle
2 | # See https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3 | # and https://docs.github.com/en/actions/guides/storing-workflow-data-as-artifacts
4 |
5 | name: Release APK
6 |
7 | on:
8 | push:
9 | branches: [ master ]
10 | pull_request:
11 | branches: [ master ]
12 |
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - name: Checkout source code
19 | uses: actions/checkout@v2
20 |
21 | - name: Set up JDK 11
22 | uses: actions/setup-java@v1
23 | with:
24 | java-version: 11
25 |
26 | - name: Grant execute permission for gradlew
27 | run: chmod +x gradlew
28 |
29 | - name: Build with Gradle
30 | run: ./gradlew clean assembleRelease --info --warning-mode all
31 |
32 | - name: Store android package
33 | uses: actions/upload-artifact@v4
34 | with:
35 | name: artifact
36 | path: app/build/outputs/apk/pub/release/*.apk
37 | if-no-files-found: warn
38 | retention-days: 7
39 |
--------------------------------------------------------------------------------
/.idea/copyright/liyujiang_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/copyright/liyujiang_MulanPSL.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/.jitpack.yml:
--------------------------------------------------------------------------------
1 | jdk: openjdk11
2 |
--------------------------------------------------------------------------------
/AddressPicker/README.md:
--------------------------------------------------------------------------------
1 | # 地址选择器
2 |
3 | 省市区县地址联动选择器,含省市县、省区及市县。
4 |
--------------------------------------------------------------------------------
/AddressPicker/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/library.gradle"
15 | apply from: "${rootDir}/gradle/publish.gradle"
16 |
17 | dependencies {
18 | implementation androidxLibrary.annotation
19 | api project(':Common')
20 | api project(':WheelView')
21 | api project(':WheelPicker')
22 | }
23 |
--------------------------------------------------------------------------------
/AddressPicker/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | # 本库模块专用的混淆规则
2 | # 若通过FastJSON、GSON等对省市区县的数据实体进行序列化及反序列化,则不能混淆Province、City等实体类。
3 | #-keep class com.github.gzuliyujiang.wheelpicker.entity.AddressEntity { *;}
4 | #-keep class * extends com.github.gzuliyujiang.wheelpicker.entity.AddressEntity { *;}
5 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/annotation/AddressMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.annotation;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * 地址模式
21 | *
22 | * @author 贵州山野羡民(1032694760@qq.com)
23 | * @since 2019/6/15 12:19
24 | */
25 | @Retention(RetentionPolicy.SOURCE)
26 | public @interface AddressMode {
27 | /**
28 | * 省级、市级、县级
29 | */
30 | int PROVINCE_CITY_COUNTY = 0;
31 | /**
32 | * 省级、市级
33 | */
34 | int PROVINCE_CITY = 1;
35 | /**
36 | * 市级、县级
37 | */
38 | int CITY_COUNTY = 2;
39 | }
40 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/AddressLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | import androidx.annotation.MainThread;
17 | import androidx.annotation.NonNull;
18 |
19 | /**
20 | * 地址数据加载器
21 | *
22 | * @author 贵州山野羡民(1032694760@qq.com)
23 | * @since 2019/6/17 16:42
24 | */
25 | public interface AddressLoader {
26 |
27 | @MainThread
28 | void loadJson(@NonNull AddressReceiver receiver, @NonNull AddressParser parser);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/AddressParser.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | import androidx.annotation.NonNull;
17 | import androidx.annotation.WorkerThread;
18 |
19 | import com.github.gzuliyujiang.wheelpicker.entity.ProvinceEntity;
20 |
21 | import java.util.List;
22 |
23 | /**
24 | * 地址数据解析器
25 | *
26 | * @author 贵州山野羡民(1032694760@qq.com)
27 | * @since 2021/6/12 16:53
28 | */
29 | public interface AddressParser {
30 |
31 | @WorkerThread
32 | @NonNull
33 | List parseData(@NonNull String text);
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/AddressReceiver.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | import androidx.annotation.MainThread;
17 | import androidx.annotation.NonNull;
18 |
19 | import com.github.gzuliyujiang.wheelpicker.entity.ProvinceEntity;
20 |
21 | import java.util.List;
22 |
23 | /**
24 | * 地址数据接收器
25 | *
26 | * @author 贵州山野羡民(1032694760@qq.com)
27 | * @since 2019/6/17 16:42
28 | */
29 | public interface AddressReceiver {
30 |
31 | @MainThread
32 | void onAddressReceived(@NonNull List data);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnAddressLoadListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import com.github.gzuliyujiang.wheelpicker.entity.ProvinceEntity;
19 |
20 | import java.util.List;
21 |
22 | /**
23 | * @author 贵州山野羡民(1032694760@qq.com)
24 | * @since 2021/6/30 15:20
25 | */
26 | public interface OnAddressLoadListener {
27 |
28 | void onAddressLoadStarted();
29 |
30 | void onAddressLoadFinished(@NonNull List data);
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnAddressPickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | import com.github.gzuliyujiang.wheelpicker.entity.CityEntity;
17 | import com.github.gzuliyujiang.wheelpicker.entity.CountyEntity;
18 | import com.github.gzuliyujiang.wheelpicker.entity.ProvinceEntity;
19 |
20 | /**
21 | * 地址选择接口
22 | *
23 | * @author 贵州山野羡民(1032694760@qq.com)
24 | * @since 2019/6/17 18:23
25 | */
26 | public interface OnAddressPickedListener {
27 |
28 | /**
29 | * 联动选择回调
30 | *
31 | * @param province 选中的省/直辖市/自治区
32 | * @param city 选中的地级市/自治州
33 | * @param county 选中的区/县/县级市
34 | */
35 | void onAddressPicked(ProvinceEntity province, CityEntity city, CountyEntity county);
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/entity/AddressEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.entity;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import com.github.gzuliyujiang.wheelview.contract.TextProvider;
19 |
20 | import java.io.Serializable;
21 | import java.util.Objects;
22 |
23 | /**
24 | * 地址数据实体
25 | *
26 | * @author 贵州山野羡民(1032694760@qq.com)
27 | * @since 2019/6/17 11:47
28 | */
29 | class AddressEntity implements TextProvider, Serializable {
30 | private String code;
31 | private String name;
32 |
33 | public String getCode() {
34 | return code;
35 | }
36 |
37 | public void setCode(String code) {
38 | this.code = code;
39 | }
40 |
41 | public String getName() {
42 | return name;
43 | }
44 |
45 | public void setName(String name) {
46 | this.name = name;
47 | }
48 |
49 | @Override
50 | public String provideText() {
51 | return name;
52 | }
53 |
54 | @Override
55 | public boolean equals(Object o) {
56 | if (this == o) {
57 | return true;
58 | }
59 | if (o == null || getClass() != o.getClass()) {
60 | return false;
61 | }
62 | AddressEntity that = (AddressEntity) o;
63 | return Objects.equals(code, that.code) &&
64 | Objects.equals(name, that.name);
65 | }
66 |
67 | @Override
68 | public int hashCode() {
69 | return Objects.hash(code, name);
70 | }
71 |
72 | @NonNull
73 | @Override
74 | public String toString() {
75 | return "AddressEntity{" +
76 | "code='" + code + '\'' +
77 | ", name='" + name + '\'' +
78 | '}';
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/entity/CityEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.entity;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | /**
22 | * 市级数据实体
23 | *
24 | * @author 贵州山野羡民(1032694760@qq.com)
25 | * @since 2019/6/17 11:47
26 | */
27 | public class CityEntity extends AddressEntity {
28 | private List countyList;
29 |
30 | @NonNull
31 | public List getCountyList() {
32 | if (countyList == null) {
33 | countyList = new ArrayList<>();
34 | }
35 | return countyList;
36 | }
37 |
38 | public void setCountyList(List countyList) {
39 | this.countyList = countyList;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/entity/CountyEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.entity;
15 |
16 | /**
17 | * 县级数据实体
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/6/17 11:47
21 | */
22 | public class CountyEntity extends AddressEntity {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/AddressPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/entity/ProvinceEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.entity;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | /**
22 | * 省级数据实体
23 | *
24 | * @author 贵州山野羡民(1032694760@qq.com)
25 | * @since 2019/6/17 11:47
26 | */
27 | public class ProvinceEntity extends AddressEntity {
28 | private List cityList;
29 |
30 | @NonNull
31 | public List getCityList() {
32 | if (cityList == null) {
33 | cityList = new ArrayList<>();
34 | }
35 | return cityList;
36 | }
37 |
38 | public void setCityList(List cityList) {
39 | this.cityList = cityList;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/CalendarPicker/README.md:
--------------------------------------------------------------------------------
1 | # 日历选择器
2 |
3 | 基于 [双向日期选择日历控件](https://github.com/oxsource/calendar) 开发。
4 |
5 | ## 示例
6 |
7 | ```groovy
8 | CalendarPicker picker = new CalendarPicker(this);
9 | picker.setRangeDateOnFuture(3);
10 | if (singleTimeInMillis == 0) {
11 | singleTimeInMillis = System.currentTimeMillis();
12 | }
13 | picker.setSelectedDate(singleTimeInMillis);
14 | picker.setOnSingleDatePickListener(new OnSingleDatePickListener() {
15 | @Override
16 | public void onSingleDatePicked(@NonNull Date date) {
17 | singleTimeInMillis = date.getTime();
18 | }
19 | });
20 | picker.show();
21 | ```
22 |
23 | ## 配色
24 |
25 | ```groovy
26 | CalendarPicker picker = new CalendarPicker(this);
27 | picker.setColorScheme(new ColorScheme()
28 | .daySelectBackgroundColor(0xFF0000FF)
29 | .dayStressTextColor(0xFF0000DD));
30 | picker.show();
31 | ```
32 |
--------------------------------------------------------------------------------
/CalendarPicker/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/library.gradle"
15 | apply from: "${rootDir}/gradle/publish.gradle"
16 |
17 | dependencies {
18 | implementation androidxLibrary.annotation
19 | implementation androidxLibrary.core
20 | implementation androidxLibrary.recyclerview
21 | api project(':Common')
22 | }
23 |
--------------------------------------------------------------------------------
/CalendarPicker/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | # 本库模块专用的混淆规则
2 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/OnRangeDatePickListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.util.Date;
19 |
20 | /**
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2019/4/30 13:36
23 | */
24 | public interface OnRangeDatePickListener {
25 |
26 | void onRangeDatePicked(@NonNull Date startDate, @NonNull Date endDate);
27 |
28 | void onMonthChanged(Date date);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/OnSingleDatePickListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.util.Date;
19 |
20 | /**
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2019/4/30 13:36
23 | */
24 | public interface OnSingleDatePickListener {
25 |
26 | void onSingleDatePicked(@NonNull Date date);
27 |
28 | void onMonthChanged(Date date);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/core/DayStatus.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker.core;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * Created by peng on 2017/8/2.
21 | */
22 | @Retention(RetentionPolicy.SOURCE)
23 | public @interface DayStatus {
24 | //正常
25 | int NORMAL = 0;
26 | //不可用
27 | int INVALID = 1;
28 | //范围内
29 | int RANGE = 2;
30 | //左边界
31 | int BOUND_L = 3;
32 | //单选
33 | int BOUND_M = 4;
34 | //右边界
35 | int BOUND_R = 5;
36 | //强调
37 | int STRESS = 6;
38 | }
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/core/FestivalProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker.core;
15 |
16 | import java.util.Date;
17 |
18 | /**
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2021/10/28 9:52
21 | */
22 | public interface FestivalProvider {
23 |
24 | String provideText(Date date);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/core/Interval.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker.core;
15 |
16 | /**
17 | * Created by peng on 2017/8/4.
18 | */
19 | public class Interval {
20 | private int lBound;
21 | private T left;
22 | private int rBound;
23 | private T right;
24 |
25 | public int lBound() {
26 | return lBound;
27 | }
28 |
29 | public void lBound(int lBound) {
30 | this.lBound = lBound;
31 | }
32 |
33 | public T left() {
34 | return left;
35 | }
36 |
37 | public Interval left(T left) {
38 | this.left = left;
39 | return this;
40 | }
41 |
42 | public int rBound() {
43 | return rBound;
44 | }
45 |
46 | public void rBound(int rBound) {
47 | this.rBound = rBound;
48 | }
49 |
50 | public T right() {
51 | return right;
52 | }
53 |
54 | public Interval right(T right) {
55 | this.right = right;
56 | return this;
57 | }
58 |
59 | public boolean bothNoNull() {
60 | return null != left() && null != right();
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/core/ItemViewProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker.core;
15 |
16 | import android.content.Context;
17 | import android.widget.TextView;
18 |
19 | /**
20 | * @author liyuj
21 | * @since 2022/1/5 16:03
22 | */
23 | public interface ItemViewProvider {
24 |
25 | TextView provideTitleView(Context context);
26 |
27 | MonthView provideMonthView(Context context);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/core/NumInterval.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker.core;
15 |
16 | /**
17 | * Created by peng on 2017/8/4.
18 | */
19 | public class NumInterval extends Interval {
20 |
21 | public NumInterval() {
22 | left(-1);
23 | lBound(-1);
24 | right(-1);
25 | rBound(-1);
26 | }
27 |
28 | public boolean contain(int index) {
29 | return index >= left() && index <= right();
30 | }
31 | }
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/core/OnDateClickListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker.core;
15 |
16 | import java.util.Date;
17 |
18 | /**
19 | * Created by peng on 2017/8/4.
20 | */
21 | public interface OnDateClickListener {
22 |
23 | void onCalendarDayClick(Date date);
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/core/OnDateSelectedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker.core;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.util.Date;
19 |
20 | /**
21 | * Created by peng on 2017/8/4.
22 | */
23 | public interface OnDateSelectedListener {
24 |
25 | void onSingleSelected(@NonNull Date date);
26 |
27 | void onRangeSelected(@NonNull Date start, @NonNull Date end);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/core/TimeUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.calendarpicker.core;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.text.SimpleDateFormat;
19 | import java.util.Date;
20 | import java.util.HashMap;
21 | import java.util.Locale;
22 | import java.util.Map;
23 |
24 | /**
25 | * 时间工具
26 | */
27 | public class TimeUtils {
28 | private final static Map dateMap = new HashMap<>();
29 |
30 | private static void ensureDateFormatMap(@NonNull String format) {
31 | if (!dateMap.containsKey(format)) {
32 | try {
33 | SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.getDefault());
34 | dateMap.put(format, sdf);
35 | } catch (Exception e) {
36 | e.printStackTrace();
37 | }
38 | }
39 | }
40 |
41 | public static Date date(String dateText, @NonNull String format) throws Exception {
42 | ensureDateFormatMap(format);
43 | if (dateMap.containsKey(format)) {
44 | SimpleDateFormat sdf = dateMap.get(format);
45 | if (sdf != null) {
46 | return sdf.parse(dateText);
47 | }
48 | }
49 | return null;
50 | }
51 |
52 | public static String dateText(long date, @NonNull String format) {
53 | String value = "";
54 | ensureDateFormatMap(format);
55 | if (dateMap.containsKey(format)) {
56 | SimpleDateFormat sdf = dateMap.get(format);
57 | if (sdf != null) {
58 | value = sdf.format(new Date(date));
59 | }
60 | }
61 | return value;
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/java/com/github/gzuliyujiang/calendarpicker/listener/OnPageChangeCallback.java:
--------------------------------------------------------------------------------
1 | package com.github.gzuliyujiang.calendarpicker.listener;
2 |
3 | import androidx.annotation.Px;
4 |
5 | public abstract class OnPageChangeCallback {
6 | /**
7 | * This method will be invoked when the current page is scrolled, either as part
8 | * of a programmatically initiated smooth scroll or a user initiated touch scroll.
9 | *
10 | * @param position Position index of the first page currently being displayed.
11 | * Page position+1 will be visible if positionOffset is nonzero.
12 | * @param positionOffset Value from [0, 1) indicating the offset from the page at position.
13 | * @param positionOffsetPixels Value in pixels indicating the offset from position.
14 | */
15 | public void onPageScrolled(int position, float positionOffset,
16 | @Px int positionOffsetPixels) {
17 | }
18 |
19 | /**
20 | * This method will be invoked when a new page becomes selected. Animation is not
21 | * necessarily complete.
22 | *
23 | * @param position Position index of the new selected page.
24 | */
25 | public void onPageSelected(int position) {
26 | }
27 |
28 | /**
29 | * Called when the scroll state changes. Useful for discovering when the user begins
30 | * dragging, when a fake drag is started, when the pager is automatically settling to the
31 | * current page, or when it is fully stopped/idle. {@code state} can be one of {@link
32 | */
33 | public void onPageScrollStateChanged(int state) {
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/CalendarPicker/src/main/res/layout/calendar_body.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
26 |
27 |
33 |
34 |
--------------------------------------------------------------------------------
/ColorPicker/README.md:
--------------------------------------------------------------------------------
1 | # 颜色选择器
2 |
3 | 颜色选择面板,改自[AndroidColorPicker](https://github.com/jbruchanov/AndroidColorPicker)
4 |
--------------------------------------------------------------------------------
/ColorPicker/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/library.gradle"
15 | apply from: "${rootDir}/gradle/publish.gradle"
16 |
17 | dependencies {
18 | implementation androidxLibrary.annotation
19 | api project(':Common')
20 | }
21 |
--------------------------------------------------------------------------------
/ColorPicker/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | # 本库模块专用的混淆规则
2 |
--------------------------------------------------------------------------------
/ColorPicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ColorPicker/src/main/java/com/github/gzuliyujiang/colorpicker/BrightnessGradientView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.colorpicker;
15 |
16 | import android.content.Context;
17 | import android.util.AttributeSet;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2021/6/10 12:59
22 | */
23 | public class BrightnessGradientView extends ColorGradientView {
24 |
25 | public BrightnessGradientView(Context context) {
26 | super(context);
27 | asBrightnessGradient();
28 | }
29 |
30 | public BrightnessGradientView(Context context, AttributeSet attrs) {
31 | super(context, attrs);
32 | asBrightnessGradient();
33 | }
34 |
35 | public BrightnessGradientView(Context context, AttributeSet attrs, int defStyleAttr) {
36 | super(context, attrs, defStyleAttr);
37 | asBrightnessGradient();
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/ColorPicker/src/main/java/com/github/gzuliyujiang/colorpicker/OnColorChangedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.colorpicker;
15 |
16 | import androidx.annotation.ColorInt;
17 |
18 | /**
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2015/7/20
21 | */
22 | public interface OnColorChangedListener {
23 |
24 | void onColorChanged(ColorGradientView gradientView, @ColorInt int color);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/ColorPicker/src/main/java/com/github/gzuliyujiang/colorpicker/OnColorPickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.colorpicker;
15 |
16 | import androidx.annotation.ColorInt;
17 |
18 | /**
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2015/7/20
21 | */
22 | public interface OnColorPickedListener {
23 |
24 | void onColorPicked(@ColorInt int pickedColor);
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/ColorPicker/src/main/java/com/github/gzuliyujiang/colorpicker/SavedState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.colorpicker;
15 |
16 | import android.os.Parcel;
17 | import android.os.Parcelable;
18 | import android.view.View;
19 |
20 | /**
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2021/6/10 10:56
23 | */
24 | class SavedState extends View.BaseSavedState {
25 | int color;
26 | boolean isBrightnessGradient;
27 |
28 | SavedState(Parcelable superState) {
29 | super(superState);
30 | }
31 |
32 | private SavedState(Parcel in) {
33 | super(in);
34 | color = in.readInt();
35 | isBrightnessGradient = in.readInt() == 1;
36 | }
37 |
38 | @Override
39 | public void writeToParcel(Parcel out, int flags) {
40 | super.writeToParcel(out, flags);
41 | out.writeInt(color);
42 | out.writeInt(isBrightnessGradient ? 1 : 0);
43 | }
44 |
45 | public static final Creator CREATOR =
46 | new Creator() {
47 | public SavedState createFromParcel(Parcel in) {
48 | return new SavedState(in);
49 | }
50 |
51 | public SavedState[] newArray(int size) {
52 | return new SavedState[size];
53 | }
54 | };
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/ColorPicker/src/main/res/layout/color_picker_content.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
24 |
25 |
29 |
30 |
--------------------------------------------------------------------------------
/ColorPicker/src/main/res/mipmap-xxhdpi/color_picker_pointer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/ColorPicker/src/main/res/mipmap-xxhdpi/color_picker_pointer.png
--------------------------------------------------------------------------------
/Common/README.md:
--------------------------------------------------------------------------------
1 | # 基础选择器
2 |
3 | 选择器底部弹窗。
4 |
--------------------------------------------------------------------------------
/Common/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/library.gradle"
15 | apply from: "${rootDir}/gradle/publish.gradle"
16 |
17 | dependencies {
18 | implementation androidxLibrary.annotation
19 | implementation androidxLibrary.core
20 | api androidxLibrary.activity
21 | }
22 |
--------------------------------------------------------------------------------
/Common/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | # 本库模块专用的混淆规则
2 |
--------------------------------------------------------------------------------
/Common/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Common/src/main/java/com/github/gzuliyujiang/dialog/CornerRound.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.dialog;
15 |
16 | /**
17 | * @author 贵州山野羡民(1032694760@qq.com)
18 | * @since 2021/9/17 9:58
19 | */
20 | public @interface CornerRound {
21 | int No = 0;
22 | int Top = 1;
23 | int All = 2;
24 | }
25 |
--------------------------------------------------------------------------------
/Common/src/main/java/com/github/gzuliyujiang/dialog/DialogConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.dialog;
15 |
16 | /**
17 | * @author 贵州山魈羡民 (1032694760@qq.com)
18 | * @since 2021/9/16 15:55
19 | */
20 | public final class DialogConfig {
21 | private static int dialogStyle = DialogStyle.Default;
22 | private static DialogColor dialogColor = new DialogColor();
23 |
24 | private DialogConfig() {
25 | super();
26 | }
27 |
28 | public static void setDialogStyle(@DialogStyle int style) {
29 | dialogStyle = style;
30 | }
31 |
32 | @DialogStyle
33 | public static int getDialogStyle() {
34 | return dialogStyle;
35 | }
36 |
37 | public static void setDialogColor(DialogColor color) {
38 | dialogColor = color;
39 | }
40 |
41 | public static DialogColor getDialogColor() {
42 | if (dialogColor == null) {
43 | dialogColor = new DialogColor();
44 | }
45 | return dialogColor;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/Common/src/main/java/com/github/gzuliyujiang/dialog/DialogLog.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.dialog;
15 |
16 | import android.util.Log;
17 |
18 | import androidx.annotation.NonNull;
19 |
20 | /**
21 | * 调试日志工具类
22 | *
23 | * @author 贵州山魈羡民 (1032694760@qq.com)
24 | * @since 2021/3/26 21:34
25 | */
26 | public final class DialogLog {
27 | private static final String TAG = "AndroidPicker";
28 | private static boolean enable = false;
29 |
30 | private DialogLog() {
31 | super();
32 | }
33 |
34 | /**
35 | * 启用调试日志
36 | */
37 | public static void enable() {
38 | enable = true;
39 | }
40 |
41 | /**
42 | * 打印调试日志
43 | *
44 | * @param log 日志信息
45 | */
46 | public static void print(@NonNull Object log) {
47 | if (!enable) {
48 | return;
49 | }
50 | Log.d(TAG, log.toString());
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/Common/src/main/java/com/github/gzuliyujiang/dialog/DialogStyle.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.dialog;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * 弹窗样式枚举
21 | *
22 | * @author 贵州山野羡民(1032694760@qq.com)
23 | * @since 2021/9/16 15:31
24 | */
25 | @Retention(RetentionPolicy.SOURCE)
26 | public @interface DialogStyle {
27 | int Default = 0;
28 | int One = 1;
29 | int Two = 2;
30 | int Three = 3;
31 | }
32 |
--------------------------------------------------------------------------------
/Common/src/main/res/anim/dialog_sheet_enter.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/Common/src/main/res/anim/dialog_sheet_exit.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/Common/src/main/res/layout/dialog_footer_style_1.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
33 |
34 |
38 |
39 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/Common/src/main/res/layout/dialog_footer_style_2.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Common/src/main/res/layout/dialog_footer_style_3.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
31 |
32 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Common/src/main/res/layout/dialog_header_style_1.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
30 |
--------------------------------------------------------------------------------
/Common/src/main/res/layout/dialog_header_style_2.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
18 |
19 |
35 |
36 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Common/src/main/res/layout/dialog_header_style_3.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
30 |
--------------------------------------------------------------------------------
/Common/src/main/res/layout/dialog_header_style_default.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
18 |
19 |
31 |
32 |
47 |
48 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/Common/src/main/res/mipmap-xxhdpi/dialog_close_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/Common/src/main/res/mipmap-xxhdpi/dialog_close_icon.png
--------------------------------------------------------------------------------
/Common/src/main/res/values/dialog_anims.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
20 |
21 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Common/src/main/res/values/dialog_themes.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 |
22 |
23 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/FilePicker/README.md:
--------------------------------------------------------------------------------
1 | # 文件/目录选择器
2 |
3 | 注意合规性,允许APP读取外置存储器,调用之前要确保已获得用户授予`READ_EXTERNAL_STORAGE`权限。
4 |
--------------------------------------------------------------------------------
/FilePicker/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/library.gradle"
15 | apply from: "${rootDir}/gradle/publish.gradle"
16 |
17 | dependencies {
18 | implementation androidxLibrary.annotation
19 | implementation androidxLibrary.recyclerview
20 | api project(':Common')
21 | }
22 |
--------------------------------------------------------------------------------
/FilePicker/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | # 本库模块专用的混淆规则
2 |
--------------------------------------------------------------------------------
/FilePicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
17 |
18 |
19 |
22 |
23 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/adapter/FileEntity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.adapter;
15 |
16 | import android.graphics.drawable.Drawable;
17 |
18 | import androidx.annotation.NonNull;
19 |
20 | import java.io.File;
21 | import java.io.Serializable;
22 |
23 | /**
24 | * 文件项信息
25 | *
26 | * @author 贵州山野羡民(1032694760@qq.com)
27 | * @since 2014/05/23 18:02
28 | */
29 | public class FileEntity implements Serializable {
30 | private Drawable icon;
31 | private String name;
32 | private File file;
33 |
34 | public void setIcon(Drawable icon) {
35 | this.icon = icon;
36 | }
37 |
38 | public Drawable getIcon() {
39 | return icon;
40 | }
41 |
42 | public String getName() {
43 | return name;
44 | }
45 |
46 | public void setName(String name) {
47 | this.name = name;
48 | }
49 |
50 | public File getFile() {
51 | return file;
52 | }
53 |
54 | public void setFile(File file) {
55 | this.file = file;
56 | }
57 |
58 | @NonNull
59 | @Override
60 | public String toString() {
61 | return "FileEntity{" +
62 | "name='" + name + '\'' +
63 | ", file='" + file + '\'' +
64 | '}';
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/adapter/ViewHolder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.adapter;
15 |
16 | import android.view.View;
17 | import android.widget.ImageView;
18 | import android.widget.TextView;
19 |
20 | import androidx.annotation.NonNull;
21 | import androidx.recyclerview.widget.RecyclerView;
22 |
23 | /**
24 | * @author 贵州山野羡民(1032694760@qq.com)
25 | * @since 2021/6/10 20:47
26 | */
27 | public class ViewHolder extends RecyclerView.ViewHolder {
28 | public TextView textView;
29 | public ImageView imageView;
30 |
31 | public ViewHolder(@NonNull View itemView) {
32 | super(itemView);
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/annotation/ExplorerMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.annotation;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2021/6/10 15:28
22 | */
23 | @Retention(RetentionPolicy.SOURCE)
24 | public @interface ExplorerMode {
25 | int DIRECTORY = 0;
26 | int FILE = 1;
27 | }
28 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/annotation/FileSort.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.annotation;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2021/6/10 14:35
22 | */
23 | @Retention(RetentionPolicy.SOURCE)
24 | public @interface FileSort {
25 | int BY_NAME_ASC = 0;
26 | int BY_NAME_DESC = 1;
27 | int BY_TIME_ASC = 2;
28 | int BY_TIME_DESC = 3;
29 | int BY_SIZE_ASC = 4;
30 | int BY_SIZE_DESC = 5;
31 | int BY_EXTENSION_ASC = 6;
32 | int BY_EXTENSION_DESC = 7;
33 | }
34 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/contract/OnFileClickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.contract;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.io.File;
19 |
20 | /**
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2021/6/10 19:33
23 | */
24 | public interface OnFileClickedListener {
25 |
26 | void onFileClicked(@NonNull File file);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/contract/OnFileLoadedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.contract;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.io.File;
19 |
20 | /**
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2022/3/16 14:29
23 | */
24 | public interface OnFileLoadedListener {
25 |
26 | void onFileLoaded(@NonNull File file);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/contract/OnFilePickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.contract;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.io.File;
19 |
20 | /**
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2015/9/29
23 | */
24 | public interface OnFilePickedListener {
25 |
26 | void onFilePicked(@NonNull File file);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/contract/OnPathClickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.contract;
15 |
16 | import androidx.annotation.NonNull;
17 | import androidx.recyclerview.widget.RecyclerView;
18 |
19 | import com.github.gzuliyujiang.filepicker.adapter.ViewHolder;
20 |
21 | /**
22 | * @author 贵州山野羡民(1032694760@qq.com)
23 | * @since 2021/6/10 20:15
24 | */
25 | public interface OnPathClickedListener {
26 |
27 | void onPathClicked(RecyclerView.Adapter adapter, int position, @NonNull String path);
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/filter/PatternFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.filter;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.io.File;
19 | import java.io.FileFilter;
20 | import java.util.regex.Pattern;
21 |
22 | /**
23 | * @author 贵州山野羡民(1032694760@qq.com)
24 | * @since 2021/6/10 15:07
25 | */
26 | public class PatternFilter implements FileFilter {
27 | private final Pattern pattern;
28 |
29 | public PatternFilter(@NonNull Pattern pattern) {
30 | this.pattern = pattern;
31 | }
32 |
33 | @Override
34 | public boolean accept(File pathname) {
35 | if (pathname == null) {
36 | return false;
37 | }
38 | return pattern.matcher(pathname.getName()).find();
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/sort/SortByExtension.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.sort;
15 |
16 | import java.io.File;
17 | import java.util.Comparator;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2014/4/18
22 | */
23 | public class SortByExtension implements Comparator {
24 |
25 | @Override
26 | public int compare(File f1, File f2) {
27 | if (f1 == null || f2 == null) {
28 | if (f1 == null) {
29 | return -1;
30 | } else {
31 | return 1;
32 | }
33 | } else {
34 | if (f1.isDirectory() && f2.isFile()) {
35 | return -1;
36 | } else if (f1.isFile() && f2.isDirectory()) {
37 | return 1;
38 | } else {
39 | return f1.getName().compareToIgnoreCase(f2.getName());
40 | }
41 | }
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/sort/SortByName.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.sort;
15 |
16 | import java.io.File;
17 | import java.util.Comparator;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2014/4/18
22 | */
23 | public class SortByName implements Comparator {
24 | private static final boolean CASE_SENSITIVE = false;
25 |
26 | @Override
27 | public int compare(File f1, File f2) {
28 | if (f1 == null || f2 == null) {
29 | if (f1 == null) {
30 | return -1;
31 | } else {
32 | return 1;
33 | }
34 | } else {
35 | if (f1.isDirectory() && f2.isFile()) {
36 | return -1;
37 | } else if (f1.isFile() && f2.isDirectory()) {
38 | return 1;
39 | } else {
40 | String s1 = f1.getName();
41 | String s2 = f2.getName();
42 | if (CASE_SENSITIVE) {
43 | return s1.compareTo(s2);
44 | } else {
45 | return s1.compareToIgnoreCase(s2);
46 | }
47 | }
48 | }
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/sort/SortBySize.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.sort;
15 |
16 | import java.io.File;
17 | import java.util.Comparator;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2014/4/18
22 | */
23 | public class SortBySize implements Comparator {
24 |
25 | @Override
26 | public int compare(File f1, File f2) {
27 | if (f1 == null || f2 == null) {
28 | if (f1 == null) {
29 | return -1;
30 | } else {
31 | return 1;
32 | }
33 | } else {
34 | if (f1.isDirectory() && f2.isFile()) {
35 | return -1;
36 | } else if (f1.isFile() && f2.isDirectory()) {
37 | return 1;
38 | } else {
39 | if (f1.length() < f2.length()) {
40 | return -1;
41 | } else if (f1.length() > f2.length()) {
42 | return 1;
43 | } else {
44 | return 0;
45 | }
46 | }
47 | }
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/FilePicker/src/main/java/com/github/gzuliyujiang/filepicker/sort/SortByTime.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.filepicker.sort;
15 |
16 | import java.io.File;
17 | import java.util.Comparator;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2014/4/18
22 | */
23 | public class SortByTime implements Comparator {
24 |
25 | @Override
26 | public int compare(File f1, File f2) {
27 | if (f1 == null || f2 == null) {
28 | if (f1 == null) {
29 | return -1;
30 | } else {
31 | return 1;
32 | }
33 | } else {
34 | if (f1.isDirectory() && f2.isFile()) {
35 | return -1;
36 | } else if (f1.isFile() && f2.isDirectory()) {
37 | return 1;
38 | } else {
39 | if (f1.lastModified() > f2.lastModified()) {
40 | return -1;
41 | } else if (f1.lastModified() < f2.lastModified()) {
42 | return -1;
43 | } else {
44 | return 0;
45 | }
46 | }
47 | }
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_arrow.png
--------------------------------------------------------------------------------
/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_file.png
--------------------------------------------------------------------------------
/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_folder.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_folder.png
--------------------------------------------------------------------------------
/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_home.png
--------------------------------------------------------------------------------
/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/FilePicker/src/main/res/mipmap-xxhdpi/file_picker_up.png
--------------------------------------------------------------------------------
/ImagePicker/README.md:
--------------------------------------------------------------------------------
1 | # 图片选择(相机+相册+裁剪)
2 |
3 | 图片选择(相机+相册+裁剪),改自 [ImagePicker](https://github.com/linchaolong/ImagePicker)
4 | 及 [Android-Image-Cropper](https://github.com/ArthurHub/Android-Image-Cropper) 。
5 |
6 | 注意合规性,允许APP使用摄像头,允许APP读取/写入外置存储器,调用之前要确保已获得用户授予`CAMERA`、`READ_EXTERNAL_STORAGE`、`WRITE_EXTERNAL_STORAGE`权限。
7 |
8 | ## 简单用法
9 |
10 | ```java
11 | public class ImagePickerActivity extends FragmentActivity {
12 | private final PickCallback cropCallback = new PickCallback() {
13 | @Override
14 | public void onPermissionDenied(String[] permissions, String message) {
15 | Toast.makeText(ImagePickerActivity.this, message, Toast.LENGTH_SHORT).show();
16 | }
17 |
18 | @Override
19 | public void cropConfig(ActivityBuilder builder) {
20 | builder.setMultiTouchEnabled(true)
21 | .setGuidelines(CropImageView.Guidelines.ON_TOUCH)
22 | .setCropShape(CropImageView.CropShape.OVAL)
23 | .setRequestedSize(400, 400)
24 | .setFixAspectRatio(true)
25 | .setAspectRatio(1, 1);
26 | }
27 |
28 | @Override
29 | public void onCropImage(@Nullable Uri imageUri) {
30 | Toast.makeText(ImagePickerActivity.this, String.valueOf(imageUri), Toast.LENGTH_SHORT).show();
31 | }
32 | };
33 |
34 | public void onCamera(View view) {
35 | ImagePicker.getInstance().startCamera(this, true, cropCallback);
36 | }
37 |
38 | public void onGallery(View view) {
39 | ImagePicker.getInstance().startGallery(this, true, cropCallback);
40 | }
41 |
42 | @Override
43 | protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
44 | super.onActivityResult(requestCode, resultCode, data);
45 | ImagePicker.getInstance().onActivityResult(this, requestCode, resultCode, data);
46 | }
47 |
48 | @Override
49 | public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
50 | super.onRequestPermissionsResult(requestCode, permissions, grantResults);
51 | ImagePicker.getInstance().onRequestPermissionsResult(this, requestCode, permissions, grantResults);
52 | }
53 |
54 | }
55 | ```
--------------------------------------------------------------------------------
/ImagePicker/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/library.gradle"
15 | apply from: "${rootDir}/gradle/publish.gradle"
16 |
17 | dependencies {
18 | implementation androidxLibrary.annotation
19 | implementation androidxLibrary.core
20 | implementation androidxLibrary.fragment
21 | implementation androidxLibrary.exifinterface
22 | }
23 |
--------------------------------------------------------------------------------
/ImagePicker/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | # 本库模块专用的混淆规则
2 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
28 |
33 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/java/com/github/gzuliyujiang/imagepicker/ActivityResult.java:
--------------------------------------------------------------------------------
1 | package com.github.gzuliyujiang.imagepicker;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.Rect;
5 | import android.net.Uri;
6 | import android.os.Parcel;
7 | import android.os.Parcelable;
8 |
9 | /**
10 | * Result data of Crop Image Activity.
11 | */
12 | public class ActivityResult extends CropImageView.CropResult implements Parcelable {
13 | public static final Creator CREATOR = new Creator() {
14 | @Override
15 | public ActivityResult createFromParcel(Parcel in) {
16 | return new ActivityResult(in);
17 | }
18 |
19 | @Override
20 | public ActivityResult[] newArray(int size) {
21 | return new ActivityResult[size];
22 | }
23 | };
24 |
25 | public ActivityResult(Bitmap bitmap, Uri uri, Exception error, float[] cropPoints, Rect cropRect, int rotation, int sampleSize) {
26 | super(bitmap, uri, error, cropPoints, cropRect, rotation, sampleSize);
27 | }
28 |
29 | protected ActivityResult(Parcel in) {
30 | super(null,
31 | in.readParcelable(Uri.class.getClassLoader()),
32 | (Exception) in.readSerializable(),
33 | in.createFloatArray(),
34 | in.readParcelable(Rect.class.getClassLoader()),
35 | in.readInt(), in.readInt());
36 | }
37 |
38 | @Override
39 | public void writeToParcel(Parcel dest, int flags) {
40 | dest.writeParcelable(getUri(), flags);
41 | dest.writeSerializable(getError());
42 | dest.writeFloatArray(getCropPoints());
43 | dest.writeParcelable(getCropRect(), flags);
44 | dest.writeInt(getRotation());
45 | dest.writeInt(getSampleSize());
46 | }
47 |
48 | @Override
49 | public int describeContents() {
50 | return 0;
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/java/com/github/gzuliyujiang/imagepicker/CropImageConsts.java:
--------------------------------------------------------------------------------
1 | package com.github.gzuliyujiang.imagepicker;
2 |
3 | /**
4 | * @author 贵州山野羡民(1032694760@qq.com)
5 | * @since 2021/7/29 17:49
6 | */
7 | public final class CropImageConsts {
8 |
9 | /**
10 | * The key used to pass crop image source URI to {@link CropImageActivity}.
11 | */
12 | public static final String CROP_IMAGE_EXTRA_SOURCE = "CROP_IMAGE_EXTRA_SOURCE";
13 |
14 | /**
15 | * The key used to pass crop image options to {@link CropImageActivity}.
16 | */
17 | public static final String CROP_IMAGE_EXTRA_OPTIONS = "CROP_IMAGE_EXTRA_OPTIONS";
18 |
19 | /**
20 | * The key used to pass crop image result data back from {@link CropImageActivity}.
21 | */
22 | public static final String CROP_IMAGE_EXTRA_RESULT = "CROP_IMAGE_EXTRA_RESULT";
23 |
24 | /**
25 | * The request code used to start pick image activity to be used on result to identify the this specific request.
26 | */
27 | public static final int PICK_IMAGE_CHOOSER_REQUEST_CODE = 200;
28 |
29 | /**
30 | * The request code used to request permission to pick image from external storage.
31 | */
32 | public static final int PICK_IMAGE_PERMISSIONS_REQUEST_CODE = 201;
33 |
34 | /**
35 | * The request code used to request permission to capture image from camera.
36 | */
37 | public static final int CAMERA_CAPTURE_PERMISSIONS_REQUEST_CODE = 2011;
38 |
39 | /**
40 | * The request code used to start {@link CropImageActivity} to be used on result to identify the this specific
41 | * request.
42 | */
43 | public static final int CROP_IMAGE_ACTIVITY_REQUEST_CODE = 203;
44 |
45 | /**
46 | * The result code used to return error from {@link CropImageActivity}.
47 | */
48 | public static final int CROP_IMAGE_ACTIVITY_RESULT_ERROR_CODE = 204;
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/java/com/github/gzuliyujiang/imagepicker/ImageProvider.java:
--------------------------------------------------------------------------------
1 | package com.github.gzuliyujiang.imagepicker;
2 |
3 | import androidx.core.content.FileProvider;
4 |
5 | /**
6 | * @author 贵州山魈羡民 (1032694760@qq.com)
7 | * @since 2020/12/1 14:58
8 | */
9 | public class ImageProvider extends FileProvider {
10 | }
11 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/java/com/github/gzuliyujiang/imagepicker/PickCallback.java:
--------------------------------------------------------------------------------
1 | package com.github.gzuliyujiang.imagepicker;
2 |
3 | import android.net.Uri;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.annotation.Nullable;
7 |
8 | /**
9 | * @author 贵州山野羡民(1032694760@qq.com)
10 | * @since 2020/4/3 17:18
11 | */
12 | public abstract class PickCallback {
13 |
14 | /**
15 | * 用户取消回调
16 | */
17 | public void onCanceled() {
18 |
19 | }
20 |
21 | /**
22 | * 用户拒绝授权回调
23 | */
24 | public void onPermissionDenied(String[] permissions, String message) {
25 |
26 | }
27 |
28 | /**
29 | * 图片选择回调
30 | */
31 | public void onPickImage(@Nullable Uri imageUri) {
32 |
33 | }
34 |
35 | /**
36 | * 图片裁剪配置
37 | */
38 | public void cropConfig(ActivityBuilder builder) {
39 | builder.setMultiTouchEnabled(false)
40 | .setCropShape(CropImageView.CropShape.OVAL)
41 | .setRequestedSize(640, 640)
42 | .setAspectRatio(5, 5);
43 | }
44 |
45 | /**
46 | * 图片裁剪回调
47 | */
48 | public void onCropImage(@Nullable Uri imageUri) {
49 |
50 | }
51 |
52 | /**
53 | * 图片裁剪出错
54 | */
55 | public void onCropError(@NonNull Exception error) {
56 |
57 | }
58 |
59 | }
60 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/res/drawable-xxhdpi/crop_image_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/ImagePicker/src/main/res/drawable-xxhdpi/crop_image_back.png
--------------------------------------------------------------------------------
/ImagePicker/src/main/res/drawable-xxhdpi/crop_image_done.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/ImagePicker/src/main/res/drawable-xxhdpi/crop_image_done.png
--------------------------------------------------------------------------------
/ImagePicker/src/main/res/drawable-xxhdpi/crop_image_rotate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/ImagePicker/src/main/res/drawable-xxhdpi/crop_image_rotate.png
--------------------------------------------------------------------------------
/ImagePicker/src/main/res/layout/crop_image_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
25 |
26 |
30 |
31 |
41 |
42 |
52 |
53 |
54 |
55 |
59 |
60 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/res/layout/crop_image_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
18 |
19 |
25 |
26 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/res/values/crop_image_attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ImagePicker/src/main/res/xml/crop_image_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
12 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
2 |
3 | The software is licensed under the Mulan PSL v2.
4 | You can use this software according to the terms and conditions of the Mulan PSL v2.
5 | You may obtain a copy of Mulan PSL v2 at:
6 | http://license.coscl.org.cn/MulanPSL2
7 | THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
8 | IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
9 | PURPOSE.
10 | See the Mulan PSL v2 for more details.
11 |
--------------------------------------------------------------------------------
/WheelPicker/README.md:
--------------------------------------------------------------------------------
1 | # 滚轮选择器
2 |
3 | 滚轮选择器,包括单项选择器、数字选择器、二三级联动选择器、日期时间选择器、生日选择器、民族选择器等。
4 |
--------------------------------------------------------------------------------
/WheelPicker/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/library.gradle"
15 | apply from: "${rootDir}/gradle/publish.gradle"
16 |
17 | dependencies {
18 | implementation androidxLibrary.annotation
19 | api project(':Common')
20 | api project(':WheelView')
21 | }
22 |
--------------------------------------------------------------------------------
/WheelPicker/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | # 本库模块专用的混淆规则
2 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/DatePicker.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker;
15 |
16 | import android.app.Activity;
17 | import android.view.View;
18 |
19 | import androidx.annotation.NonNull;
20 | import androidx.annotation.StyleRes;
21 |
22 | import com.github.gzuliyujiang.dialog.ModalDialog;
23 | import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener;
24 | import com.github.gzuliyujiang.wheelpicker.widget.DateWheelLayout;
25 |
26 | /**
27 | * 日期选择器
28 | *
29 | * @author 贵州山野羡民(1032694760@qq.com)
30 | * @since 2021/6/5 18:17
31 | */
32 | @SuppressWarnings("unused")
33 | public class DatePicker extends ModalDialog {
34 | protected DateWheelLayout wheelLayout;
35 | private OnDatePickedListener onDatePickedListener;
36 |
37 | public DatePicker(@NonNull Activity activity) {
38 | super(activity);
39 | }
40 |
41 | public DatePicker(@NonNull Activity activity, @StyleRes int themeResId) {
42 | super(activity, themeResId);
43 | }
44 |
45 | @NonNull
46 | @Override
47 | protected View createBodyView() {
48 | wheelLayout = new DateWheelLayout(activity);
49 | return wheelLayout;
50 | }
51 |
52 | @Override
53 | protected void onCancel() {
54 |
55 | }
56 |
57 | @Override
58 | protected void onOk() {
59 | if (onDatePickedListener != null) {
60 | int year = wheelLayout.getSelectedYear();
61 | int month = wheelLayout.getSelectedMonth();
62 | int day = wheelLayout.getSelectedDay();
63 | onDatePickedListener.onDatePicked(year, month, day);
64 | }
65 | }
66 |
67 | public void setOnDatePickedListener(OnDatePickedListener onDatePickedListener) {
68 | this.onDatePickedListener = onDatePickedListener;
69 | }
70 |
71 | public final DateWheelLayout getWheelLayout() {
72 | return wheelLayout;
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/annotation/DateMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.annotation;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * 日期模式
21 | *
22 | * @author 贵州山野羡民(1032694760@qq.com)
23 | * @since 2019/5/14 17:10
24 | */
25 | @Retention(RetentionPolicy.SOURCE)
26 | public @interface DateMode {
27 | /**
28 | * 不显示
29 | */
30 | int NONE = -1;
31 | /**
32 | * 年月日
33 | */
34 | int YEAR_MONTH_DAY = 0;
35 | /**
36 | * 年月
37 | */
38 | int YEAR_MONTH = 1;
39 | /**
40 | * 月日
41 | */
42 | int MONTH_DAY = 2;
43 | }
44 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/annotation/EthnicSpec.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.annotation;
15 |
16 | /**
17 | * @author 贵州山野羡民(1032694760@qq.com)
18 | * @since 2021/6/12 14:22
19 | */
20 | public @interface EthnicSpec {
21 | int DEFAULT = 1;
22 | int GB3304_91 = 2;
23 | int SEVENTH_NATIONAL_CENSUS = 3;
24 | }
25 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/annotation/TimeMode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.annotation;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * 时间模式
21 | *
22 | * @author 贵州山野羡民(1032694760@qq.com)
23 | * @since 2019/5/14 17:09
24 | */
25 | @Retention(RetentionPolicy.SOURCE)
26 | public @interface TimeMode {
27 | /**
28 | * 不显示
29 | */
30 | int NONE = -1;
31 | /**
32 | * 24小时制(不含秒)
33 | */
34 | int HOUR_24_NO_SECOND = 0;
35 | /**
36 | * 24小时制(包括秒)
37 | */
38 | int HOUR_24_HAS_SECOND = 1;
39 | /**
40 | * 12小时制(不含秒)
41 | */
42 | int HOUR_12_NO_SECOND = 2;
43 | /**
44 | * 12小时制(包括秒)
45 | */
46 | int HOUR_12_HAS_SECOND = 3;
47 | }
48 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/DateFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 日期显示文本格式化接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 19:55
21 | */
22 | public interface DateFormatter {
23 |
24 | /**
25 | * 格式化年份
26 | *
27 | * @param year 年份数字
28 | * @return 格式化后最终显示的年份字符串
29 | */
30 | String formatYear(int year);
31 |
32 | /**
33 | * 格式化月份
34 | *
35 | * @param month 月份数字
36 | * @return 格式化后最终显示的月份字符串
37 | */
38 | String formatMonth(int month);
39 |
40 | /**
41 | * 格式化日子
42 | *
43 | * @param day 日子数字
44 | * @return 格式化后最终显示的日子字符串
45 | */
46 | String formatDay(int day);
47 |
48 | }
49 |
50 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/LinkageProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import java.util.List;
19 |
20 | /**
21 | * 提供二级或三级联动数据
22 | *
23 | * @author 贵州山野羡民(1032694760@qq.com)
24 | * @since 2019/6/17 11:27
25 | */
26 | public interface LinkageProvider {
27 | int INDEX_NO_FOUND = -1;
28 |
29 | /**
30 | * 是否展示第一级
31 | *
32 | * @return 返回true表示展示第一级
33 | */
34 | boolean firstLevelVisible();
35 |
36 | /**
37 | * 是否展示第三级
38 | *
39 | * @return 返回true表示展示第三级
40 | */
41 | boolean thirdLevelVisible();
42 |
43 | /**
44 | * 提供第一级数据
45 | *
46 | * @return 第一级数据
47 | */
48 | @NonNull
49 | List> provideFirstData();
50 |
51 | /**
52 | * 根据第一级数据联动第二级数据
53 | *
54 | * @param firstIndex 第一级数据索引
55 | * @return 第二级数据
56 | */
57 | @NonNull
58 | List> linkageSecondData(int firstIndex);
59 |
60 | /**
61 | * 根据第一二级数据联动第三级数据
62 | *
63 | * @param firstIndex 第一级数据索引
64 | * @param secondIndex 第二级数据索引
65 | * @return 第三级数据
66 | */
67 | @NonNull
68 | List> linkageThirdData(int firstIndex, int secondIndex);
69 |
70 | /**
71 | * 根据第一数据值查找其索引
72 | *
73 | * @param firstValue 第一级数据值
74 | * @return 第一级数据索引
75 | */
76 | int findFirstIndex(Object firstValue);
77 |
78 | /**
79 | * 根据第二数据值查找其索引
80 | *
81 | * @param firstIndex 第一级数据索引
82 | * @param secondValue 第二级数据值
83 | * @return 第二级数据索引
84 | */
85 | int findSecondIndex(int firstIndex, Object secondValue);
86 |
87 | /**
88 | * 根据第三数据值查找其索引
89 | *
90 | * @param firstIndex 第一级数据索引
91 | * @param secondIndex 第二级数据索引
92 | * @param thirdValue 第三级数据值
93 | * @return 第三级数据索引
94 | */
95 | int findThirdIndex(int firstIndex, int secondIndex, Object thirdValue);
96 |
97 | }
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnCarPlatePickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * @author 贵州山野羡民(1032694760@qq.com)
18 | * @since 2021/6/9 11:53
19 | */
20 | public interface OnCarPlatePickedListener {
21 |
22 | void onCarNumberPicked(String province, String letter);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnDatePickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 日期选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 19:57
21 | */
22 | public interface OnDatePickedListener {
23 |
24 | /**
25 | * 已选择的日期
26 | *
27 | * @param year 年
28 | * @param month 月
29 | * @param day 日
30 | */
31 | void onDatePicked(int year, int month, int day);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnDateSelectedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 日期选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 19:57
21 | */
22 | public interface OnDateSelectedListener {
23 |
24 | /**
25 | * 已选择的日期
26 | *
27 | * @param year 年
28 | * @param month 月
29 | * @param day 日
30 | */
31 | void onDateSelected(int year, int month, int day);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnDatimePickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 日期时间选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2021/6/5 17:29
21 | */
22 | public interface OnDatimePickedListener {
23 |
24 | /**
25 | * 日期时间选择回调
26 | *
27 | * @param year 年
28 | * @param month 月
29 | * @param day 日
30 | * @param hour 时
31 | * @param minute 分
32 | * @param second 秒
33 | */
34 | void onDatimePicked(int year, int month, int day, int hour, int minute, int second);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnDatimeSelectedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 日期时间选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2021/6/5 17:29
21 | */
22 | public interface OnDatimeSelectedListener {
23 |
24 | /**
25 | * 日期时间选择回调
26 | *
27 | * @param year 年
28 | * @param month 月
29 | * @param day 日
30 | * @param hour 时
31 | * @param minute 分
32 | * @param second 秒
33 | */
34 | void onDatimeSelected(int year, int month, int day, int hour, int minute, int second);
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnLinkagePickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 联动选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/6/17 18:23
21 | */
22 | public interface OnLinkagePickedListener {
23 |
24 | /**
25 | * 联动选择回调
26 | *
27 | * @param first 选中项的第一级条目内容
28 | * @param second 选中项的第二级条目内容
29 | * @param third 选中项的第三级条目内容
30 | */
31 | void onLinkagePicked(Object first, Object second, Object third);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnLinkageSelectedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 联动选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/6/17 18:23
21 | */
22 | public interface OnLinkageSelectedListener {
23 |
24 | /**
25 | * 联动选择回调
26 | *
27 | * @param first 选中项的第一级条目内容
28 | * @param second 选中项的第二级条目内容
29 | * @param third 选中项的第三级条目内容
30 | */
31 | void onLinkageSelected(Object first, Object second, Object third);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnNumberPickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * @author 贵州山野羡民(1032694760@qq.com)
18 | * @since 2021/6/5 15:17
19 | */
20 | public interface OnNumberPickedListener {
21 |
22 | void onNumberPicked(int position, Number item);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnNumberSelectedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * @author 贵州山野羡民(1032694760@qq.com)
18 | * @since 2021/6/5 15:17
19 | */
20 | public interface OnNumberSelectedListener {
21 |
22 | void onNumberSelected(int position, Number item);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnOptionPickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 单项条目选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 20:00
21 | */
22 | public interface OnOptionPickedListener {
23 |
24 | /**
25 | * 单项条目选择回调
26 | *
27 | * @param position 选中项的索引
28 | * @param item 选中项的内容
29 | */
30 | void onOptionPicked(int position, Object item);
31 |
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnOptionSelectedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 单项条目选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 20:00
21 | */
22 | public interface OnOptionSelectedListener {
23 |
24 | /**
25 | * 单项条目选择回调
26 | *
27 | * @param position 选中项的索引
28 | * @param item 选中项的内容
29 | */
30 | void onOptionSelected(int position, Object item);
31 |
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnTimeMeridiemPickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 时间选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 19:58
21 | */
22 | public interface OnTimeMeridiemPickedListener {
23 |
24 | /**
25 | * 时间选择回调
26 | *
27 | * @param hour 时
28 | * @param minute 分
29 | * @param second 秒
30 | * @param isAnteMeridiem 是否上午
31 | */
32 | void onTimePicked(int hour, int minute, int second, boolean isAnteMeridiem);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnTimeMeridiemSelectedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 时间选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 19:58
21 | */
22 | public interface OnTimeMeridiemSelectedListener {
23 |
24 | /**
25 | * 时间选择回调
26 | *
27 | * @param hour 时
28 | * @param minute 分
29 | * @param second 秒
30 | * @param isAnteMeridiem 是否上午
31 | */
32 | void onTimeSelected(int hour, int minute, int second, boolean isAnteMeridiem);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnTimePickedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 时间选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 19:58
21 | */
22 | public interface OnTimePickedListener {
23 |
24 | /**
25 | * 时间选择回调
26 | *
27 | * @param hour 时
28 | * @param minute 分
29 | * @param second 秒
30 | */
31 | void onTimePicked(int hour, int minute, int second);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/OnTimeSelectedListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 时间选择接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 19:58
21 | */
22 | public interface OnTimeSelectedListener {
23 |
24 | /**
25 | * 时间选择回调
26 | *
27 | * @param hour 时
28 | * @param minute 分
29 | * @param second 秒
30 | */
31 | void onTimeSelected(int hour, int minute, int second);
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/contract/TimeFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.contract;
15 |
16 | /**
17 | * 时间显示文本格式化接口
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 19:55
21 | */
22 | public interface TimeFormatter {
23 |
24 | /**
25 | * 格式化小时数
26 | *
27 | * @param hour 小时数
28 | * @return 格式化后最终显示的小时数字符串
29 | */
30 | String formatHour(int hour);
31 |
32 | /**
33 | * 格式化分钟数
34 | *
35 | * @param minute 分钟数
36 | * @return 格式化后最终显示的分钟数字符串
37 | */
38 | String formatMinute(int minute);
39 |
40 | /**
41 | * 格式化秒数
42 | *
43 | * @param second 秒数
44 | * @return 格式化后最终显示的秒数字符串
45 | */
46 | String formatSecond(int second);
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/impl/BirthdayFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.impl;
15 |
16 | /**
17 | * 生日格式化
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 14:31
21 | */
22 | public class BirthdayFormatter extends SimpleDateFormatter {
23 |
24 | @Override
25 | public String formatYear(int year) {
26 | return super.formatYear(year) + "年";
27 | }
28 |
29 | @Override
30 | public String formatMonth(int month) {
31 | return super.formatMonth(month) + "月";
32 | }
33 |
34 | @Override
35 | public String formatDay(int day) {
36 | return super.formatDay(day) + "日";
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/impl/SimpleDateFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.impl;
15 |
16 | import com.github.gzuliyujiang.wheelpicker.contract.DateFormatter;
17 |
18 | /**
19 | * 简单的日期格式化
20 | *
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2019/5/15 18:11
23 | */
24 | public class SimpleDateFormatter implements DateFormatter {
25 |
26 | @Override
27 | public String formatYear(int year) {
28 | if (year < 1000) {
29 | year += 1000;
30 | }
31 | return "" + year;
32 | }
33 |
34 | @Override
35 | public String formatMonth(int month) {
36 | return month < 10 ? "0" + month : "" + month;
37 | }
38 |
39 | @Override
40 | public String formatDay(int day) {
41 | return day < 10 ? "0" + day : "" + day;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/impl/SimpleTimeFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.impl;
15 |
16 | import com.github.gzuliyujiang.wheelpicker.contract.TimeFormatter;
17 | import com.github.gzuliyujiang.wheelpicker.widget.TimeWheelLayout;
18 |
19 | /**
20 | * 简单的时间格式化
21 | *
22 | * @author 贵州山野羡民(1032694760@qq.com)
23 | * @since 2019/5/15 18:13
24 | */
25 | public class SimpleTimeFormatter implements TimeFormatter {
26 | private final TimeWheelLayout wheelLayout;
27 |
28 | public SimpleTimeFormatter(TimeWheelLayout wheelLayout) {
29 | this.wheelLayout = wheelLayout;
30 | }
31 |
32 | @Override
33 | public String formatHour(int hour) {
34 | if (wheelLayout.isHour12Mode()) {
35 | if (hour == 0) {
36 | hour = 24;
37 | }
38 | if (hour > 12) {
39 | hour = hour - 12;
40 | }
41 | }
42 | return hour < 10 ? "0" + hour : "" + hour;
43 | }
44 |
45 | @Override
46 | public String formatMinute(int minute) {
47 | return minute < 10 ? "0" + minute : "" + minute;
48 | }
49 |
50 | @Override
51 | public String formatSecond(int second) {
52 | return second < 10 ? "0" + second : "" + second;
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/impl/SimpleWheelFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.impl;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import com.github.gzuliyujiang.wheelview.contract.WheelFormatter;
19 |
20 | /**
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2021/6/7 00:06
23 | */
24 | public class SimpleWheelFormatter implements WheelFormatter {
25 |
26 | @Override
27 | public String formatItem(@NonNull Object item) {
28 | return item.toString();
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/impl/UnitDateFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.impl;
15 |
16 | import com.github.gzuliyujiang.wheelpicker.contract.DateFormatter;
17 |
18 | /**
19 | * 带单位的日期格式化
20 | *
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2021/6/4 11:33
23 | */
24 | public class UnitDateFormatter implements DateFormatter {
25 |
26 | @Override
27 | public String formatYear(int year) {
28 | return year + "年";
29 | }
30 |
31 | @Override
32 | public String formatMonth(int month) {
33 | return month + "月";
34 | }
35 |
36 | @Override
37 | public String formatDay(int day) {
38 | return day + "日";
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/impl/UnitTimeFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.impl;
15 |
16 | import com.github.gzuliyujiang.wheelpicker.contract.TimeFormatter;
17 |
18 | /**
19 | * 带单位的时间格式化
20 | *
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2021/6/4 11:33
23 | */
24 | public class UnitTimeFormatter implements TimeFormatter {
25 |
26 | @Override
27 | public String formatHour(int hour) {
28 | return hour + "点";
29 | }
30 |
31 | @Override
32 | public String formatMinute(int minute) {
33 | return minute + "分";
34 | }
35 |
36 | @Override
37 | public String formatSecond(int second) {
38 | return second + "秒";
39 | }
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/java/com/github/gzuliyujiang/wheelpicker/widget/CarPlateWheelLayout.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelpicker.widget;
15 |
16 | import android.content.Context;
17 | import android.util.AttributeSet;
18 |
19 | import androidx.annotation.NonNull;
20 | import androidx.annotation.Nullable;
21 |
22 | import com.github.gzuliyujiang.wheelpicker.impl.CarPlateProvider;
23 |
24 | /**
25 | * @author 贵州山野羡民(1032694760@qq.com)
26 | * @since 2021/6/9 11:57
27 | */
28 | public class CarPlateWheelLayout extends LinkageWheelLayout {
29 | private CarPlateProvider provider;
30 |
31 | public CarPlateWheelLayout(Context context) {
32 | super(context);
33 | }
34 |
35 | public CarPlateWheelLayout(Context context, AttributeSet attrs) {
36 | super(context, attrs);
37 | }
38 |
39 | public CarPlateWheelLayout(Context context, AttributeSet attrs, int defStyleAttr) {
40 | super(context, attrs, defStyleAttr);
41 | }
42 |
43 | public CarPlateWheelLayout(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
44 | super(context, attrs, defStyleAttr, defStyleRes);
45 | }
46 |
47 | @Override
48 | protected void onInit(@NonNull Context context) {
49 | super.onInit(context);
50 | provider = new CarPlateProvider();
51 | setData(provider);
52 | }
53 |
54 | @Override
55 | protected void onAttributeSet(@NonNull Context context, @Nullable AttributeSet attrs) {
56 | super.onAttributeSet(context, attrs);
57 | setFirstVisible(provider.firstLevelVisible());
58 | setThirdVisible(provider.thirdLevelVisible());
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/res/layout/wheel_picker_datime.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
26 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/res/layout/wheel_picker_number.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
18 |
19 |
25 |
26 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/WheelPicker/src/main/res/layout/wheel_picker_option.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
18 |
19 |
25 |
26 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/WheelView/README.md:
--------------------------------------------------------------------------------
1 | # 滚轮
2 |
3 | 仿 IOS 风格的滚轮控件。
4 |
--------------------------------------------------------------------------------
/WheelView/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/library.gradle"
15 | apply from: "${rootDir}/gradle/publish.gradle"
16 |
17 | dependencies {
18 | implementation androidxLibrary.annotation
19 | }
20 |
--------------------------------------------------------------------------------
/WheelView/consumer-rules.pro:
--------------------------------------------------------------------------------
1 | # 本库模块专用的混淆规则
2 |
--------------------------------------------------------------------------------
/WheelView/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/WheelView/src/main/java/com/github/gzuliyujiang/wheelview/annotation/CurtainCorner.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelview.annotation;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2021/10/28 11:27
22 | */
23 | @Retention(RetentionPolicy.SOURCE)
24 | public @interface CurtainCorner {
25 | int NONE = 0;
26 | int ALL = 1;
27 | int TOP = 2;
28 | int BOTTOM = 3;
29 | int LEFT = 4;
30 | int RIGHT = 5;
31 | }
32 |
--------------------------------------------------------------------------------
/WheelView/src/main/java/com/github/gzuliyujiang/wheelview/annotation/ItemTextAlign.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelview.annotation;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * 滚轮条目文本对齐方式
21 | *
22 | * @author 贵州山野羡民(1032694760@qq.com)
23 | * @since 2019/6/19 12:04
24 | */
25 | @Retention(RetentionPolicy.SOURCE)
26 | public @interface ItemTextAlign {
27 | int CENTER = 0;
28 | int LEFT = 1;
29 | int RIGHT = 2;
30 | }
31 |
--------------------------------------------------------------------------------
/WheelView/src/main/java/com/github/gzuliyujiang/wheelview/annotation/ScrollState.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelview.annotation;
15 |
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 |
19 | /**
20 | * @author 贵州山野羡民(1032694760@qq.com)
21 | * @since 2021/10/28 11:28
22 | */
23 | @Retention(RetentionPolicy.SOURCE)
24 | public @interface ScrollState {
25 | int IDLE = 0;
26 | int DRAGGING = 1;
27 | int SCROLLING = 2;
28 | }
29 |
--------------------------------------------------------------------------------
/WheelView/src/main/java/com/github/gzuliyujiang/wheelview/contract/TextProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelview.contract;
15 |
16 | /**
17 | * 提供显示的文本
18 | *
19 | * @author 贵州山野羡民(1032694760@qq.com)
20 | * @since 2019/5/14 20:01
21 | */
22 | public interface TextProvider {
23 |
24 | /**
25 | * 提供显示的文本
26 | *
27 | * @return 显示的文本
28 | */
29 | String provideText();
30 |
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/WheelView/src/main/java/com/github/gzuliyujiang/wheelview/contract/WheelFormatter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.wheelview.contract;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | /**
19 | * 滚轮条目显示文本格式化接口
20 | *
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2019/5/14 20:02
23 | */
24 | public interface WheelFormatter {
25 |
26 | /**
27 | * 格式化滚轮条目显示文本
28 | *
29 | * @param item 滚轮条目的内容
30 | * @return 格式化后最终显示的文本
31 | */
32 | String formatItem(@NonNull Object item);
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/WheelView/src/main/res/values/wheel_styles.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
36 |
37 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-merlot
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply from: "${rootDir}/gradle/app.gradle"
15 |
16 | dependencies {
17 | implementation androidxLibrary.multidex
18 | implementation androidxLibrary.appcompat
19 | implementation library.material
20 | implementation project(':Common')
21 | implementation project(':WheelView')
22 | implementation project(':WheelPicker')
23 | implementation project(':AddressPicker')
24 | implementation project(':ColorPicker')
25 | implementation project(':FilePicker')
26 | implementation project(':CalendarPicker')
27 | implementation project(':ImagePicker')
28 | debugRuntimeOnly library.orhanobut_logger
29 | debugRuntimeOnly library.xcrash
30 | compileOnly library.xcrash
31 | }
32 |
33 | android {
34 | defaultConfig {
35 | //应用的实际包名
36 | applicationId "com.github.gzuliyujiang.demo.picker"
37 | // 配合 productFlavors 节点按不同维度打包
38 | flavorDimensions "MODE"
39 | // 修改 AndroidManifest.xml 里的变量,占位值无法覆盖的坑可参阅 https://www.jianshu.com/p/1d5271c2c366
40 | manifestPlaceholders = [
41 | MY_CHANNEL: "unknown",
42 | ]
43 | }
44 |
45 | // 打包维度列表,会按维度名字母顺序执行,最终发布的具体渠道包的生成可以借助360加固等工具
46 | productFlavors {
47 | // 发布模式/正式环境
48 | pub {
49 | dimension "MODE"
50 | // 服务端接口地址
51 | buildConfigField "String", "API_BASE_URL", '"https://api.example.com"'
52 | // 修改 AndroidManifest.xml 里的变量
53 | manifestPlaceholders = [
54 | MY_CHANNEL: "publisher-default",
55 | ]
56 | }
57 | // 开发模式/测试环境
58 | dev {
59 | dimension "MODE"
60 | // 服务端接口地址
61 | buildConfigField "String", "API_BASE_URL", '"https://test.example.com"'
62 | // 修改 AndroidManifest.xml 里的变量
63 | manifestPlaceholders = [
64 | MY_CHANNEL: "developer-default",
65 | ]
66 | }
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/app/debug.keystore
--------------------------------------------------------------------------------
/app/gradle.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/app/gradle.properties
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | #################
2 | #项目自定义混淆配置
3 | #################
4 |
--------------------------------------------------------------------------------
/app/src/main/assets/china_address_guizhou_city.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "id": "2486",
4 | "name": "贵州",
5 | "code": "520000",
6 | "deep": "1",
7 | "pid": "0",
8 | "city": [
9 | {
10 | "id": "2487",
11 | "name": "贵阳",
12 | "code": "520100",
13 | "deep": "2",
14 | "pid": "2486",
15 | "area": []
16 | },
17 | {
18 | "id": "2498",
19 | "name": "六盘水",
20 | "code": "520200",
21 | "deep": "2",
22 | "pid": "2486",
23 | "area": []
24 | },
25 | {
26 | "id": "2503",
27 | "name": "遵义",
28 | "code": "520300",
29 | "deep": "2",
30 | "pid": "2486",
31 | "area": []
32 | },
33 | {
34 | "id": "2518",
35 | "name": "安顺",
36 | "code": "520400",
37 | "deep": "2",
38 | "pid": "2486",
39 | "area": []
40 | },
41 | {
42 | "id": "2525",
43 | "name": "毕节",
44 | "code": "520500",
45 | "deep": "2",
46 | "pid": "2486",
47 | "area": []
48 | },
49 | {
50 | "id": "2534",
51 | "name": "铜仁",
52 | "code": "520600",
53 | "deep": "2",
54 | "pid": "2486",
55 | "area": []
56 | },
57 | {
58 | "id": "2545",
59 | "name": "黔西南",
60 | "code": "522300",
61 | "deep": "2",
62 | "pid": "2486",
63 | "area": []
64 | },
65 | {
66 | "id": "2554",
67 | "name": "黔东南",
68 | "code": "522600",
69 | "deep": "2",
70 | "pid": "2486",
71 | "area": []
72 | },
73 | {
74 | "id": "2571",
75 | "name": "黔南",
76 | "code": "522700",
77 | "deep": "2",
78 | "pid": "2486",
79 | "area": []
80 | }
81 | ]
82 | }
83 | ]
84 |
--------------------------------------------------------------------------------
/app/src/main/java/com/github/gzuliyujiang/fallback/activity/BackAbleActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.fallback.activity;
15 |
16 | import android.view.View;
17 |
18 | import androidx.fragment.app.FragmentActivity;
19 |
20 | /**
21 | * @author 贵州山野羡民(1032694760@qq.com)
22 | * @since 2021/9/18 10:58
23 | */
24 | public class BackAbleActivity extends FragmentActivity {
25 |
26 | public void goBack(View view) {
27 | finish();
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/github/gzuliyujiang/fallback/activity/LinkagePickerActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.fallback.activity;
15 |
16 | import android.os.Bundle;
17 | import android.view.View;
18 | import android.widget.Toast;
19 |
20 | import androidx.annotation.Nullable;
21 |
22 | import com.github.gzuliyujiang.fallback.R;
23 | import com.github.gzuliyujiang.fallback.custom.AntFortuneLikePicker;
24 | import com.github.gzuliyujiang.wheelpicker.CarPlatePicker;
25 | import com.github.gzuliyujiang.wheelpicker.contract.OnCarPlatePickedListener;
26 | import com.github.gzuliyujiang.wheelpicker.contract.OnLinkagePickedListener;
27 |
28 | /**
29 | * @author 贵州山野羡民(1032694760@qq.com)
30 | * @since 2021/6/4 12:40
31 | */
32 | public class LinkagePickerActivity extends BackAbleActivity implements OnCarPlatePickedListener, OnLinkagePickedListener {
33 |
34 | @Override
35 | protected void onCreate(@Nullable Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.activity_picker_linkage);
38 | }
39 |
40 | @Override
41 | public void onCarNumberPicked(String province, String letter) {
42 | Toast.makeText(getApplication(), province + " " + letter, Toast.LENGTH_SHORT).show();
43 | }
44 |
45 | @Override
46 | public void onLinkagePicked(Object first, Object second, Object third) {
47 | Toast.makeText(getApplication(), first + " " + second + " " + third, Toast.LENGTH_SHORT).show();
48 | }
49 |
50 | public void onCarNumber(View view) {
51 | CarPlatePicker picker = new CarPlatePicker(this);
52 | picker.setBodyWidth(100);
53 | picker.setDefaultValue("贵", "F", "");
54 | picker.setOnCarPlatePickedListener(this);
55 | picker.show();
56 | }
57 |
58 | public void onLikeAntFortune(View view) {
59 | AntFortuneLikePicker picker = new AntFortuneLikePicker(this);
60 | picker.setOnLinkagePickedListener(this);
61 | picker.show();
62 | }
63 |
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/java/com/github/gzuliyujiang/fallback/activity/OptionPickerFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.fallback.activity;
15 |
16 | import android.app.Dialog;
17 | import android.os.Bundle;
18 | import android.widget.Toast;
19 |
20 | import androidx.annotation.NonNull;
21 | import androidx.annotation.Nullable;
22 | import androidx.fragment.app.DialogFragment;
23 |
24 | import com.github.gzuliyujiang.fallback.R;
25 | import com.github.gzuliyujiang.wheelpicker.OptionPicker;
26 | import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener;
27 |
28 | /**
29 | * {@link androidx.fragment.app.Fragment}形式的弹窗
30 | *
31 | * @author 贵州山野羡民(1032694760@qq.com)
32 | * @since 2022/11/04
33 | */
34 | public class OptionPickerFragment extends DialogFragment {
35 |
36 | @NonNull
37 | @Override
38 | public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
39 | OptionPicker picker = new OptionPicker(requireActivity());
40 | picker.setData("土人", "里民子", "羡民", "穿青人", "不在56个民族之内", "未定民族");
41 | picker.setOnOptionPickedListener(new OnOptionPickedListener() {
42 | @Override
43 | public void onOptionPicked(int position, Object item) {
44 | Toast.makeText(requireContext(), item.toString(), Toast.LENGTH_SHORT).show();
45 | }
46 | });
47 | picker.getWheelView().setStyle(R.style.WheelStyleDemo);
48 | return picker;
49 | }
50 |
51 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/github/gzuliyujiang/fallback/bean/GoodsCategoryBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.fallback.bean;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import com.github.gzuliyujiang.wheelview.contract.TextProvider;
19 |
20 | import java.io.Serializable;
21 |
22 | /**
23 | * 示例数据实体
24 | *
25 | * @author 贵州山野羡民(1032694760@qq.com)
26 | * @since 2019/6/23
27 | */
28 | public class GoodsCategoryBean implements Serializable, TextProvider {
29 | private int id;
30 | private String name;
31 |
32 | public GoodsCategoryBean(int id, String name) {
33 | this.id = id;
34 | this.name = name;
35 | }
36 |
37 | public int getId() {
38 | return id;
39 | }
40 |
41 | public void setId(int id) {
42 | this.id = id;
43 | }
44 |
45 | public String getName() {
46 | return name;
47 | }
48 |
49 | public void setName(String name) {
50 | this.name = name;
51 | }
52 |
53 | @Override
54 | public String provideText() {
55 | return name;
56 | }
57 |
58 | @NonNull
59 | @Override
60 | public String toString() {
61 | return "GoodsCategoryBean{" +
62 | "id=" + id +
63 | ", name='" + name + '\'' +
64 | '}';
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/github/gzuliyujiang/fallback/custom/AntFortuneLikeProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | package com.github.gzuliyujiang.fallback.custom;
15 |
16 | import androidx.annotation.NonNull;
17 |
18 | import com.github.gzuliyujiang.wheelpicker.contract.LinkageProvider;
19 |
20 | import java.util.ArrayList;
21 | import java.util.Arrays;
22 | import java.util.List;
23 |
24 | /**
25 | * @author 贵州山野羡民(1032694760@qq.com)
26 | * @since 2021/6/7 12:22
27 | */
28 | public class AntFortuneLikeProvider implements LinkageProvider {
29 |
30 | @Override
31 | public boolean firstLevelVisible() {
32 | return true;
33 | }
34 |
35 | @Override
36 | public boolean thirdLevelVisible() {
37 | return false;
38 | }
39 |
40 | @NonNull
41 | @Override
42 | public List provideFirstData() {
43 | return Arrays.asList("每周", "每两周", "每月", "每日");
44 | }
45 |
46 | @NonNull
47 | @Override
48 | public List linkageSecondData(int firstIndex) {
49 | switch (firstIndex) {
50 | case 0:
51 | case 1:
52 | return Arrays.asList("周一", "周二", "周三", "周四", "周五");
53 | case 2:
54 | List data = new ArrayList<>();
55 | for (int i = 1; i <= 28; i++) {
56 | data.add(i + "日");
57 | }
58 | return data;
59 | }
60 | return new ArrayList<>();
61 | }
62 |
63 | @NonNull
64 | @Override
65 | public List linkageThirdData(int firstIndex, int secondIndex) {
66 | return new ArrayList<>();
67 | }
68 |
69 | @Override
70 | public int findFirstIndex(Object firstValue) {
71 | return 0;
72 | }
73 |
74 | @Override
75 | public int findSecondIndex(int firstIndex, Object secondValue) {
76 | return 0;
77 | }
78 |
79 | @Override
80 | public int findThirdIndex(int firstIndex, int secondIndex, Object thirdValue) {
81 | return 0;
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_picker_color.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
18 |
19 |
23 |
24 |
25 |
26 |
31 |
32 |
37 |
38 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_picker_file.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
24 |
25 |
26 |
27 |
32 |
33 |
38 |
39 |
44 |
45 |
50 |
51 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_picker_image.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
24 |
25 |
26 |
27 |
32 |
33 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_picker_linkage.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
24 |
25 |
26 |
27 |
32 |
33 |
38 |
39 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_file_explorer.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
19 |
20 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_title_bar.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
20 |
21 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
17 |
18 | @android:color/holo_blue_light
19 |
20 | @android:color/holo_blue_light
21 |
22 | @android:color/holo_blue_dark
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 | AndroidPicker
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
32 |
33 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
13 |
14 |
15 |
16 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | buildscript {
15 | apply from: "${rootDir}/gradle/git.gradle"
16 | apply from: "${rootDir}/gradle/config.gradle"
17 | apply from: "${rootDir}/gradle/dependency.gradle"
18 | repositories {
19 | //noinspection JcenterRepositoryObsolete http://developer.android.google.cn/r/tools/jcenter-end-of-service
20 | jcenter()
21 | google()
22 | mavenCentral()
23 | maven { url 'https://repo1.maven.org/maven2/' }
24 | }
25 | dependencies {
26 | classpath 'com.android.tools.build:gradle:4.2.2'
27 | }
28 | }
29 |
30 | allprojects {
31 | repositories {
32 | //noinspection JcenterRepositoryObsolete
33 | jcenter()
34 | google()
35 | mavenCentral()
36 | maven { url "https://www.jitpack.io" }
37 | maven { url 'https://repo1.maven.org/maven2/' }
38 | }
39 | }
40 |
41 | subprojects {
42 | gradle.projectsEvaluated {
43 | tasks.withType(JavaCompile) {
44 | //增加一些编译选项
45 | //options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
46 | }
47 | }
48 | }
49 |
50 | task clean(type: Delete) {
51 | println("********** clean build **********")
52 | println("delete project dir: " + rootProject.buildDir)
53 | rootProject.buildDir.deleteDir()
54 | def dir = new File(new File(".").getAbsolutePath())
55 | println("root dir: " + dir.getAbsolutePath())
56 | dir.eachDirRecurse {
57 | dir2 ->
58 | dir2.eachDirMatch(~/build/) {
59 | directory ->
60 | println("delete child dir:" + directory)
61 | directory.deleteDir()
62 | }
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/buildAPK.bat:
--------------------------------------------------------------------------------
1 | @rem JAVA_HOME -> jdk1.8
2 | @echo build and proguard apk
3 | cd /d ./
4 | gradlew.bat clean assembleRelease --info --warning-mode all
5 | pause
6 |
7 |
--------------------------------------------------------------------------------
/demo.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/demo.apk
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | #
4 | # The software is licensed under the Mulan PSL v2.
5 | # You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | # You may obtain a copy of Mulan PSL v2 at:
7 | # http://license.coscl.org.cn/MulanPSL2
8 | # THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | # IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | # PURPOSE.
11 | # See the Mulan PSL v2 for more details.
12 | #
13 | org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M" -XX\:+HeapDumpOnOutOfMemoryError -Dfile.encoding\=UTF-8
14 | # 并行构建
15 | org.gradle.parallel=true
16 | # 进程守护
17 | org.gradle.daemon=true
18 | # 按需配置
19 | org.gradle.configureondemand=true
20 | # 项目路径含中文需加上此句
21 | #android.overridePathCheck=true
22 | # 启用AndroidX
23 | android.useAndroidX=true
24 | # 将依赖包迁移到AndroidX
25 | android.enableJetifier=true
26 | # R8混淆模式
27 | #android.enableR8.fullMode=true
28 | # 显示有问题的gradle堆栈
29 | android.debug.obsoleteApi=true
30 | # INSTALL_FAILED_TEST_ONLY
31 | android.injected.testOnly=false
32 | # 资源混淆
33 | android.enableResourceOptimizations=true
34 |
--------------------------------------------------------------------------------
/gradle/config.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | ext {
15 |
16 | //Android版本(4.4-19、5.0-21、5.1-22、6.0-23、7.0-24、8.0-26、9.0-28、10-29、11-30)
17 | minSdkVersion = 19
18 | targetSdkVersion = 30
19 | compileSdkVersion = 30
20 | buildToolsVersion = '30.0.3'
21 | //启用x86架构支持(模拟器运行时需要)
22 | enableX86Support = true
23 | //发布包是否混淆Java代码
24 | enableJavaProguard = true
25 | //发布包是否移除未用到的资源文件
26 | removeUnusedResource = true
27 | //避免编译错误”a .dex file cannot exceed 64K“
28 | enableMultiDex = true
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/gradle/init.d/init.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | buildscript {
15 | repositories {
16 | maven { url 'https://maven.aliyun.com/repositories/jcenter' }
17 | maven { url 'https://maven.aliyun.com/repositories/google' }
18 | maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | maven { url 'https://maven.aliyun.com/repositories/jcenter' }
25 | maven { url 'https://maven.aliyun.com/repositories/google' }
26 | maven { url 'https://maven.aliyun.com/repository/central' }
27 | maven { url "https://www.jitpack.io" }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/gradle/library.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | apply plugin: 'com.android.library'
15 | apply from: "${rootDir}/gradle/common.gradle"
16 |
17 | android {
18 | defaultConfig {
19 | consumerProguardFiles 'consumer-rules.pro'
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/gradle/wrapper/gradle-wrapper.properties
--------------------------------------------------------------------------------
/publishAAR.bat:
--------------------------------------------------------------------------------
1 | @rem JAVA_HOME -> jdk1.8
2 | @echo publish aar to local repository
3 | cd /d ./
4 | gradlew.bat clean publishReleasePublicationToLocalRepository --info --warning-mode all
5 | pause
6 |
7 |
--------------------------------------------------------------------------------
/screenshots/1.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/1.webp
--------------------------------------------------------------------------------
/screenshots/2.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/2.webp
--------------------------------------------------------------------------------
/screenshots/3.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/3.webp
--------------------------------------------------------------------------------
/screenshots/4.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/4.webp
--------------------------------------------------------------------------------
/screenshots/5.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/5.webp
--------------------------------------------------------------------------------
/screenshots/6.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/6.webp
--------------------------------------------------------------------------------
/screenshots/7.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/7.webp
--------------------------------------------------------------------------------
/screenshots/8.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/8.webp
--------------------------------------------------------------------------------
/screenshots/9.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/gzu-liyujiang/AndroidPicker/ce6d3379eb1165467252e7a18b6a958c5f452d07/screenshots/9.webp
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016-present 贵州纳雍穿青人李裕江<1032694760@qq.com>
3 | *
4 | * The software is licensed under the Mulan PSL v2.
5 | * You can use this software according to the terms and conditions of the Mulan PSL v2.
6 | * You may obtain a copy of Mulan PSL v2 at:
7 | * http://license.coscl.org.cn/MulanPSL2
8 | * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
9 | * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
10 | * PURPOSE.
11 | * See the Mulan PSL v2 for more details.
12 | */
13 |
14 | include ':app'
15 | include ':Common'
16 | include ':WheelView'
17 | include ':WheelPicker'
18 | include ':AddressPicker'
19 | include ':FilePicker'
20 | include ':ColorPicker'
21 | include ':CalendarPicker'
22 | include ':ImagePicker'
23 |
--------------------------------------------------------------------------------