├── .gitignore
├── .idea
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── gradle.xml
├── misc.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── allcity.html
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
├── release
│ ├── app-release.apk
│ └── output.json
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── vincent
│ │ └── baseproject
│ │ └── ExampleInstrumentedTest.kt
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ ├── cities.db
│ │ └── city.json
│ ├── java
│ │ └── com
│ │ │ └── vincent
│ │ │ └── baseproject
│ │ │ ├── common
│ │ │ ├── BaseUiFragment.kt
│ │ │ ├── Contsant.kt
│ │ │ ├── MyApplication.kt
│ │ │ └── UIActivity.kt
│ │ │ ├── data
│ │ │ ├── BaseResult.kt
│ │ │ ├── Login.kt
│ │ │ ├── LoginNetWork.kt
│ │ │ ├── LoginRepository.kt
│ │ │ ├── Resource.kt
│ │ │ └── ServiceCreator.kt
│ │ │ ├── ui
│ │ │ ├── DialogActivity.kt
│ │ │ ├── RadiusActivity.kt
│ │ │ ├── ScannerActivity.kt
│ │ │ ├── SettingActivity.kt
│ │ │ ├── WebActivity.kt
│ │ │ ├── city_picker
│ │ │ │ ├── CityPickerActivity.kt
│ │ │ │ └── FileDBManager.kt
│ │ │ ├── home
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── fragment
│ │ │ │ │ ├── HomeFragmentA.kt
│ │ │ │ │ ├── HomeFragmentB.kt
│ │ │ │ │ ├── HomeFragmentC.kt
│ │ │ │ │ └── HomeFragmentD.kt
│ │ │ ├── login
│ │ │ │ ├── LoginActivity.kt
│ │ │ │ ├── LoginModelFactory.kt
│ │ │ │ ├── LoginViewModel.kt
│ │ │ │ └── RegisterActivity.kt
│ │ │ └── space
│ │ │ │ ├── SpaceActivity.kt
│ │ │ │ ├── SpaceFragment.kt
│ │ │ │ └── SpaceInFragmentActivity.kt
│ │ │ └── widget
│ │ │ ├── NumberProgressBar.kt
│ │ │ ├── SettingBar.kt
│ │ │ ├── SquareFrameLayout.kt
│ │ │ ├── SquareImageView.kt
│ │ │ ├── SquareLinearLayout.kt
│ │ │ ├── SquareRelativeLayout.kt
│ │ │ └── XCollapsingToolbarLayout.kt
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── bg_web_progress_bar.xml
│ │ ├── btn_retry.xml
│ │ ├── home_search_bar_bg.xml
│ │ ├── ic_cb_normal.png
│ │ ├── ic_cb_selected.png
│ │ ├── ic_github.xml
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_selector_selectable_home_found.xml
│ │ ├── ic_selector_selectable_home_index.xml
│ │ ├── ic_selector_selectable_home_me.xml
│ │ ├── ic_selector_selectable_home_message.xml
│ │ ├── scan_btn_bg.xml
│ │ ├── scan_flash_select.xml
│ │ ├── scan_flash_selected.xml
│ │ ├── selector_button.xml
│ │ ├── selector_button_rect.xml
│ │ ├── selector_selectable_white.xml
│ │ ├── selector_thumb.xml
│ │ ├── selector_track.xml
│ │ ├── shape_bg_radius.xml
│ │ ├── txt_home_bottom_nav_selector.xml
│ │ └── xupdate_bg_app_info.xml
│ │ ├── layout
│ │ ├── activity_city_picker.xml
│ │ ├── activity_dialog.xml
│ │ ├── activity_login.xml
│ │ ├── activity_main.xml
│ │ ├── activity_radius.xml
│ │ ├── activity_register.xml
│ │ ├── activity_scanner.xml
│ │ ├── activity_setting.xml
│ │ ├── activity_space.xml
│ │ ├── activity_space_in_fragment.xml
│ │ ├── activity_web.xml
│ │ ├── app_toolbar.xml
│ │ ├── banner_item.xml
│ │ ├── dialog_custom.xml
│ │ ├── fragment_space.xml
│ │ ├── home_fragment_a.xml
│ │ ├── home_fragment_b.xml
│ │ ├── home_fragment_c.xml
│ │ ├── home_fragment_d.xml
│ │ ├── layout_empty.xml
│ │ ├── layout_loading.xml
│ │ ├── network_error2_layout.xml
│ │ ├── network_error_layout.xml
│ │ ├── view_setting_bar.xml
│ │ └── xupdate_dialog_app.xml
│ │ ├── menu
│ │ └── menu_home_bottom_nav.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ ├── tab_ico_found.png
│ │ ├── tab_ico_found_off.png
│ │ ├── tab_ico_home.png
│ │ ├── tab_ico_home_off.png
│ │ ├── tab_ico_me.png
│ │ ├── tab_ico_me_off.png
│ │ ├── tab_ico_message.png
│ │ ├── tab_ico_message_off.png
│ │ ├── xupdate_bg_app_top.png
│ │ └── zfb_grid_scan_line.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ ├── tab_ico_found.png
│ │ ├── tab_ico_found_off.png
│ │ ├── tab_ico_home.png
│ │ ├── tab_ico_home_off.png
│ │ ├── tab_ico_me.png
│ │ ├── tab_ico_me_off.png
│ │ ├── tab_ico_message.png
│ │ ├── tab_ico_message_off.png
│ │ └── xupdate_icon_app_close.png
│ │ ├── mipmap-xxhdpi
│ │ ├── bg_launcher.jpg
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ ├── img_custom_dialog_bkg.png
│ │ ├── img_custom_dialog_button.png
│ │ ├── tab_ico_found.png
│ │ ├── tab_ico_found_off.png
│ │ ├── tab_ico_home.png
│ │ ├── tab_ico_home_off.png
│ │ ├── tab_ico_me.png
│ │ ├── tab_ico_me_off.png
│ │ ├── tab_ico_message.png
│ │ └── tab_ico_message_off.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── arrow_right_icon.png
│ │ ├── back.png
│ │ ├── error.png
│ │ ├── ic_empty.png
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_round.png
│ │ ├── ic_network_error.png
│ │ ├── icon_black.png
│ │ ├── scan_change.png
│ │ ├── scan_flash.png
│ │ └── scan_normal.png
│ │ ├── navigation
│ │ └── nav_garden.xml
│ │ ├── raw
│ │ └── weixin_beep.ogg
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── vincent
│ └── baseproject
│ └── ExampleUnitTest.kt
├── base.jks
├── baselibrary
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── vincent
│ │ └── baselibrary
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── vincent
│ │ │ └── baselibrary
│ │ │ ├── base
│ │ │ ├── BaseActivity.kt
│ │ │ ├── BaseActivityHandler.kt
│ │ │ └── BaseLazyFragment.kt
│ │ │ ├── entity
│ │ │ └── NetworkChangeEvent.kt
│ │ │ ├── helper
│ │ │ ├── CacheDataManager.kt
│ │ │ ├── EditTextInputHelper.kt
│ │ │ ├── SettingUtil.kt
│ │ │ └── SpaceLayout.kt
│ │ │ ├── util
│ │ │ ├── DrawableUtil.kt
│ │ │ ├── MarginDecoration.kt
│ │ │ ├── NetUtils.kt
│ │ │ ├── ResourceUtil.kt
│ │ │ └── SquareDelegate.kt
│ │ │ └── widget
│ │ │ ├── ClearEditText.kt
│ │ │ ├── CountdownView.kt
│ │ │ ├── NoScrollViewPager.kt
│ │ │ ├── RoundImageView.kt
│ │ │ ├── SwitchButton.kt
│ │ │ └── radius
│ │ │ ├── RadiusButton.kt
│ │ │ ├── RadiusCheckBox.kt
│ │ │ ├── RadiusEditText.kt
│ │ │ ├── RadiusFrameLayout.kt
│ │ │ ├── RadiusLinearLayout.kt
│ │ │ ├── RadiusRadioButton.kt
│ │ │ ├── RadiusRelativeLayout.kt
│ │ │ ├── RadiusSwitch.kt
│ │ │ ├── RadiusTextView.kt
│ │ │ └── delegate
│ │ │ ├── RadiusCompoundDelegate.kt
│ │ │ ├── RadiusEditTextDelegate.kt
│ │ │ ├── RadiusSwitchDelegate.kt
│ │ │ ├── RadiusTextDelegate.kt
│ │ │ └── RadiusViewDelegate.kt
│ └── res
│ │ ├── anim
│ │ ├── dialog_bottom_in.xml
│ │ ├── dialog_bottom_out.xml
│ │ ├── dialog_ios_in.xml
│ │ ├── dialog_ios_out.xml
│ │ ├── dialog_left_in.xml
│ │ ├── dialog_left_out.xml
│ │ ├── dialog_right_in.xml
│ │ ├── dialog_right_out.xml
│ │ ├── dialog_scale_in.xml
│ │ ├── dialog_scale_out.xml
│ │ ├── dialog_top_in.xml
│ │ └── dialog_top_out.xml
│ │ ├── layout
│ │ └── toast_custom_layout.xml
│ │ ├── mipmap-hdpi
│ │ └── icon_input_del.png
│ │ ├── mipmap-xhdpi
│ │ └── icon_input_del.png
│ │ ├── mipmap-xxhdpi
│ │ └── icon_input_del.png
│ │ └── values
│ │ ├── attr.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── vincent
│ └── baselibrary
│ └── ExampleUnitTest.java
├── build.gradle
├── cityPickerUpdateNote.md
├── citypicker
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── zaaach
│ │ └── citypicker
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── china_cities_v2.db
│ ├── java
│ │ └── com
│ │ │ └── zaaach
│ │ │ └── citypicker
│ │ │ ├── CityPicker.java
│ │ │ ├── CityPickerDialogFragment.java
│ │ │ ├── adapter
│ │ │ ├── CityListAdapter.java
│ │ │ ├── GridListAdapter.java
│ │ │ ├── InnerListener.java
│ │ │ ├── OnPickListener.java
│ │ │ └── decoration
│ │ │ │ ├── DividerItemDecoration.java
│ │ │ │ ├── GridItemDecoration.java
│ │ │ │ └── SectionItemDecoration.java
│ │ │ ├── db
│ │ │ ├── CustomDBManager.java
│ │ │ ├── DBConfig.java
│ │ │ ├── DBManager.java
│ │ │ └── DefaultDBManager.java
│ │ │ ├── model
│ │ │ ├── City.java
│ │ │ ├── HotCity.java
│ │ │ ├── LocateState.java
│ │ │ └── LocatedCity.java
│ │ │ ├── util
│ │ │ └── ScreenUtil.java
│ │ │ └── view
│ │ │ └── SideIndexBar.java
│ └── res
│ │ ├── anim
│ │ ├── cp_push_bottom_in.xml
│ │ └── cp_push_bottom_out.xml
│ │ ├── drawable
│ │ ├── cp_grid_item_bg.xml
│ │ └── cp_overlay_bg.xml
│ │ ├── layout
│ │ ├── cp_dialog_city_picker.xml
│ │ ├── cp_empty_view.xml
│ │ ├── cp_grid_item_layout.xml
│ │ ├── cp_list_item_default_layout.xml
│ │ ├── cp_list_item_hot_layout.xml
│ │ ├── cp_list_item_location_layout.xml
│ │ └── cp_search_view.xml
│ │ ├── mipmap-xxhdpi
│ │ ├── cp_icon_clear_all.png
│ │ └── cp_icon_empty.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── zaaach
│ └── citypicker
│ └── ExampleUnitTest.java
├── config.gradle
├── doc
└── NetworkExceptionChecking.md
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── screenCapture
├── checkVersion.jpg
├── cityPicker.jpg
├── fileDownload.jpg
├── installTip.jpg
├── netError.gif
├── radiusView1.png
├── radiusView2.png
├── radiusView3.png
├── scan.jpg
├── scanResult.jpg
├── selectDate.png
├── setting.jpg
├── spaceLayout.gif
├── tab1.jpg
├── tab2.jpg
├── tab3.jpg
└── tab4.jpg
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .idea/
15 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/release/app-release.apk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/release/app-release.apk
--------------------------------------------------------------------------------
/app/release/output.json:
--------------------------------------------------------------------------------
1 | [{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/vincent/baseproject/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject
2 |
3 | import android.content.Context
4 | import android.graphics.Color
5 | import android.util.AttributeSet
6 | import android.util.Log
7 | import android.view.View
8 | import androidx.test.InstrumentationRegistry
9 | import androidx.test.runner.AndroidJUnit4
10 |
11 | import org.junit.Test
12 | import org.junit.runner.RunWith
13 |
14 | import org.junit.Assert.*
15 |
16 | /**
17 | * Instrumented test, which will execute on an Android device.
18 | *
19 | * See [testing documentation](http://d.android.com/tools/testing).
20 | */
21 | @RunWith(AndroidJUnit4::class)
22 | class ExampleInstrumentedTest {
23 | @Test
24 | fun useAppContext() {
25 |
26 | }
27 |
28 | fun calculateColor(color: Int, alpha: Int): Int {
29 | if (alpha == 0) {
30 | return color
31 | }
32 | val a = 1 - alpha / 255f
33 | var red = color shr 16 and 0xff
34 | var green = color shr 8 and 0xff
35 | var blue = color and 0xff
36 | println(red)
37 | println(green)
38 | println(blue)
39 | return Color.argb(alpha,red,green,blue)
40 | }
41 | }
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
25 |
26 |
27 |
28 |
29 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
45 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/app/src/main/assets/cities.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/assets/cities.db
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/common/BaseUiFragment.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.common
2 |
3 | import android.view.Gravity
4 | import android.view.LayoutInflater
5 | import com.haoge.easyandroid.easy.EasyToast
6 | import com.vincent.baselibrary.base.BaseLazyFragment
7 |
8 | /**
9 | *
文件描述:
10 | *
@author 烤鱼
11 | *
@date 2019/7/21 0021
12 | *
@update 2019/7/21 0021
13 | *
版本号:1
14 | *
15 | */
16 | abstract class BaseUiFragment :BaseLazyFragment(){
17 | open val toastCustom by lazy {
18 | // 创建自定义的Toast.
19 | val layout = LayoutInflater.from(context).inflate(com.vincent.baselibrary.R.layout.toast_custom_layout, null)
20 | EasyToast.newBuilder(layout, com.vincent.baselibrary.R.id.toast_tv)
21 | .setGravity(Gravity.CENTER, 0, 0)
22 | .build()
23 | }
24 | fun toast(resString: Int) {
25 | toastCustom.show(resString)
26 | }
27 |
28 | fun toast(s: String) {
29 | toastCustom.show(s)
30 | }
31 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/common/Contsant.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.common
2 |
3 | /**
4 | * 创建日期:2019/3/8 0008on 下午 3:36
5 | * 描述:常量类
6 | * @author:Vincent
7 | * QQ:3332168769
8 | * 备注:
9 | */
10 | object Contsant {
11 | const val SWIPE_ENABLED = "swipeEnabled"
12 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/data/BaseResult.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.data
2 |
3 | /**
4 | * 创建日期:2019/3/9 0009on 下午 3:02
5 | * 描述:返回实体
6 | * @author:Vincent
7 | * QQ:3332168769
8 | * 备注:
9 | */
10 | data class BaseResult(val t:T,val errorCode:Int,val errorMsg:String?)
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/data/Login.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.data
2 |
3 | import okhttp3.RequestBody
4 | import retrofit2.Call
5 | import retrofit2.http.Body
6 | import retrofit2.http.POST
7 |
8 | /**
9 | * 创建日期:2019/3/9 0009on 下午 2:55
10 | * 描述:登录模块api
11 | * @author:Vincent
12 | * QQ:3332168769
13 | * 备注:
14 | */
15 | interface Login {
16 | @POST("user/login")
17 | fun login(@Body body: RequestBody): Call>
18 |
19 | @POST("user/register")
20 | fun register(@Body body: RequestBody): Call>
21 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/data/LoginNetWork.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.data
2 |
3 | import okhttp3.MultipartBody
4 | import retrofit2.Callback
5 |
6 | /**
7 | * 创建日期:2019/3/9 0009on 下午 3:11
8 | * 描述:
9 | * @author:Vincent
10 | * QQ:3332168769
11 | * 备注:
12 | */
13 | object LoginNetWork {
14 | private val services = ServiceCreator.create(Login::class.java)
15 |
16 | /**
17 | * 登录
18 | */
19 | fun login(username:String, password:String,callback: Callback>){
20 | val builder = MultipartBody.Builder().setType(MultipartBody.FORM)
21 | builder.addFormDataPart("username", username)
22 | builder.addFormDataPart("password",password)
23 | services.login(builder.build()).enqueue(callback)
24 | }
25 |
26 | /**
27 | * 注册
28 | */
29 | fun register(username:String, password:String,repassword:String,callback: Callback>){
30 | val builder = MultipartBody.Builder().setType(MultipartBody.FORM)
31 | builder.addFormDataPart("username", username)
32 | builder.addFormDataPart("password",password)
33 | builder.addFormDataPart("password",password)
34 | services.register(builder.build()).enqueue(callback)
35 | }
36 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/data/LoginRepository.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.data
2 |
3 | import androidx.lifecycle.MutableLiveData
4 | import retrofit2.Call
5 | import retrofit2.Callback
6 | import retrofit2.Response
7 |
8 | /**
9 | * 创建日期:2019/3/9 0009on 下午 3:32
10 | * 描述:
11 | * @author:Vincent
12 | * QQ:3332168769
13 | * 备注:
14 | */
15 | class LoginRepository private constructor() {
16 | val login = MutableLiveData>()
17 | val register = MutableLiveData>()
18 | fun login(username: String, password: String) {
19 |
20 | login.value = Resource.loading(null)
21 | LoginNetWork.login(username, password, object : Callback> {
22 | override fun onFailure(call: Call>, t: Throwable) {
23 | login.postValue(Resource.error("登录失败", null))
24 | }
25 |
26 | override fun onResponse(call: Call>, response: Response>) {
27 | val body = response.body()
28 | if (body?.errorCode == 0) {
29 | login.postValue(Resource.success("登录成功"))
30 | } else {
31 | login.postValue(Resource.error("登录失败", body?.errorMsg))
32 | }
33 | }
34 | })
35 |
36 | }
37 |
38 | fun register(username: String, password: String, rePassword: String) {
39 |
40 | register.value = Resource.loading(null)
41 | LoginNetWork.register(username, password, rePassword, object : Callback> {
42 | override fun onFailure(call: Call>, t: Throwable) {
43 | register.postValue(Resource.error("登录失败", null))
44 | }
45 |
46 | override fun onResponse(call: Call>, response: Response>) {
47 | val body = response.body()
48 | if (body?.errorCode == 0) {
49 | register.postValue(Resource.success("登录成功"))
50 | } else {
51 | register.postValue(Resource.error("登录失败", body?.errorMsg))
52 | }
53 | }
54 | })
55 | }
56 |
57 | companion object {
58 | private var instance: LoginRepository? = null
59 | fun getInstance(): LoginRepository {
60 | if (instance == null) {
61 | synchronized(LoginRepository::class.java) {
62 | if (instance == null) {
63 | instance = LoginRepository()
64 | }
65 | }
66 | }
67 | return instance!!
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/data/Resource.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.data
2 |
3 | /**
4 | * 创建日期:2019/3/9 0009on 下午 3:37
5 | * 描述:liveData回调对象
6 | * @author:Vincent
7 | * QQ:3332168769
8 | * 备注:
9 | */
10 | data class Resource(val status: Int, val data: T?, val message: String?) {
11 | companion object {
12 | const val SUCCESS = 0
13 | const val ERROR = 1
14 | const val LOADING = 2
15 |
16 | fun success(data: T?) = Resource(SUCCESS, data, null)
17 |
18 | fun error(msg: String, data: T?) = Resource(ERROR, data, msg)
19 |
20 | fun loading(data: T?) = Resource(LOADING, data, null)
21 | }
22 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/data/ServiceCreator.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.data
2 |
3 | import okhttp3.OkHttpClient
4 | import retrofit2.Retrofit
5 | import retrofit2.converter.gson.GsonConverterFactory
6 |
7 | /**
8 | * 创建日期:2019/3/9 0009on 下午 3:14
9 | * 描述:Retrofit 基类
10 | * @author:Vincent
11 | * QQ:3332168769
12 | * 备注:
13 | */
14 | object ServiceCreator {
15 | private const val BASE_URL = "http://www.wanandroid.com/"
16 |
17 | private val httpClient = OkHttpClient.Builder()
18 |
19 | private val builder = Retrofit.Builder()
20 | .baseUrl(BASE_URL)
21 | .client(httpClient.build())
22 | .addConverterFactory(GsonConverterFactory.create())
23 |
24 | private val retrofit = builder.build()
25 |
26 | fun create(serviceClass: Class): T = retrofit.create(serviceClass)
27 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/ui/city_picker/FileDBManager.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.ui.city_picker
2 |
3 | import android.content.Context
4 | import android.database.sqlite.SQLiteDatabase
5 | import com.zaaach.citypicker.db.DBConfig
6 | import com.zaaach.citypicker.db.DBManager
7 | import com.zaaach.citypicker.model.City
8 | import java.io.File
9 | import java.util.*
10 |
11 | /**
12 | * 创建日期:2019/4/2 0002on 上午 10:14
13 | * 描述:通过db文件获取自定义数据
14 | * @author:Vincent
15 | * QQ:3332168769
16 | * 备注:
17 | */
18 |
19 | //由于是构造函数初始化调用copyDBFile方法,因此所有字段需要提前进行赋值,所以此处设置成静态,
20 | private const val tbName = "cities.db"
21 | private const val tableName = "targetcity"
22 | class FileDBManager( ctx: Context) : DBManager(ctx) {
23 |
24 | /**
25 | * assets文件夹下数据库文件名称
26 | */
27 |
28 | override fun copyDBFile() {
29 | val dir = File(DB_PATH)
30 | if (!dir.exists()) {
31 | dir.mkdirs()
32 | }
33 |
34 | createDbFile(tbName)
35 | }
36 |
37 | override fun getAllCities(): MutableList {
38 | val db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + tbName, null)
39 | val cursor = db.rawQuery("select * from $tableName", null)
40 | val result = mutableListOf()
41 | var city: City
42 | while (cursor.moveToNext()) {
43 | val name = cursor.getString(cursor.getColumnIndex(DBConfig.COLUMN_C_NAME))
44 | val province = cursor.getString(cursor.getColumnIndex(DBConfig.COLUMN_C_PROVINCE))
45 | val pinyin = cursor.getString(cursor.getColumnIndex(DBConfig.COLUMN_C_PINYIN))
46 | val code = cursor.getString(cursor.getColumnIndex(DBConfig.COLUMN_C_CODE))
47 | city = City(name, province, pinyin, code)
48 | result.add(city)
49 | }
50 | cursor.close()
51 | db.close()
52 | Collections.sort(result, CityComparator())
53 | return result
54 | }
55 |
56 | override fun searchCity(keyword: String?): MutableList {
57 | val sql = ("select * from " + tableName + " where "
58 | + DBConfig.COLUMN_C_NAME + " like ? " + "or "
59 | + DBConfig.COLUMN_C_PINYIN + " like ? ")
60 | val db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + tbName, null)
61 | val cursor = db.rawQuery(sql, arrayOf("%$keyword%", "$keyword%"))
62 |
63 | val result = mutableListOf()
64 | while (cursor.moveToNext()) {
65 | val name = cursor.getString(cursor.getColumnIndex(DBConfig.COLUMN_C_NAME))
66 | val province = cursor.getString(cursor.getColumnIndex(DBConfig.COLUMN_C_PROVINCE))
67 | val pinyin = cursor.getString(cursor.getColumnIndex(DBConfig.COLUMN_C_PINYIN))
68 | val code = cursor.getString(cursor.getColumnIndex(DBConfig.COLUMN_C_CODE))
69 | val city = City(name, province, pinyin, code)
70 | result.add(city)
71 | }
72 | cursor.close()
73 | db.close()
74 | val comparator = CityComparator()
75 | Collections.sort(result, comparator)
76 | return result
77 | }
78 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/ui/home/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.ui.home
2 |
3 |
4 | import androidx.navigation.Navigation
5 | import androidx.navigation.fragment.NavHostFragment
6 | import androidx.navigation.ui.NavigationUI
7 | import com.google.android.material.bottomnavigation.BottomNavigationView
8 | import com.vincent.baselibrary.helper.SpaceLayout
9 | import com.vincent.baseproject.R
10 | import com.vincent.baseproject.common.UIActivity
11 |
12 | class MainActivity : UIActivity() {
13 | override fun getLayoutId() = R.layout.activity_main
14 |
15 | override fun initView() {
16 | val navHostFragment = supportFragmentManager.findFragmentById(R.id.nav_fragment) as NavHostFragment
17 | val navController = navHostFragment.navController
18 | val navigation = findViewById(R.id.navigation)
19 | NavigationUI.setupWithNavController(navigation, navController)
20 | navigation.itemIconTintList = null
21 |
22 | // 如果首页不加载网络数据 建议在此处初始化,有利于提高app启动速度
23 | SpaceLayout.init(this)
24 | SpaceLayout.setEmptyLayout(R.layout.layout_empty)
25 | SpaceLayout.setLoadingLayout(R.layout.layout_loading)
26 | SpaceLayout.setNetworkErrorLayout(R.layout.network_error2_layout)
27 |
28 | }
29 |
30 |
31 | override fun onSupportNavigateUp(): Boolean {
32 | return Navigation.findNavController(this, R.id.nav_fragment).navigateUp()
33 | }
34 |
35 | override fun isSupportSwipeBack(): Boolean {
36 | return false
37 | }
38 |
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/ui/home/fragment/HomeFragmentB.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.ui.home.fragment
2 |
3 |
4 | import android.view.Gravity
5 | import android.view.LayoutInflater
6 | import androidx.fragment.app.Fragment
7 | import com.haoge.easyandroid.easy.EasyToast
8 | import com.vincent.baselibrary.base.BaseLazyFragment
9 | import com.vincent.baseproject.R
10 | import com.vincent.baseproject.common.BaseUiFragment
11 | import kotlinx.android.synthetic.main.app_toolbar.*
12 | import kotlinx.android.synthetic.main.home_fragment_b.*
13 |
14 |
15 | /**
16 | * A simple [Fragment] subclass.
17 | *
18 | */
19 | class HomeFragmentB : BaseUiFragment() {
20 |
21 | override fun getLayoutId(): Int {
22 | return R.layout.home_fragment_b
23 | }
24 |
25 | override fun initView() {
26 | tv_title.text = "发现"
27 | initToolBar(app_toolbar)
28 | }
29 |
30 | override fun initEvent() {
31 | super.initEvent()
32 | homeB_cv_countdown.setOnClickListener {
33 | toast(R.string.countdown_code_send_succeed)
34 |
35 | }
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/ui/login/LoginModelFactory.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.ui.login
2 |
3 | import androidx.lifecycle.ViewModel
4 | import androidx.lifecycle.ViewModelProvider
5 | import com.vincent.baseproject.data.LoginRepository
6 |
7 | /**
8 | * 创建日期:2019/3/9 0009on 下午 3:48
9 | * 描述:
10 | * @author:Vincent
11 | * QQ:3332168769
12 | * 备注:
13 | */
14 | class LoginModelFactory(private val repository:LoginRepository): ViewModelProvider.NewInstanceFactory() {
15 | override fun create(modelClass: Class): T {
16 | return super.create(modelClass)
17 | }
18 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/ui/login/LoginViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.ui.login
2 |
3 | import androidx.lifecycle.Transformations
4 | import androidx.lifecycle.ViewModel
5 | import com.vincent.baseproject.data.LoginRepository
6 |
7 | /**
8 | * 创建日期:2019/3/9 0009on 下午 3:54
9 | * 描述:
10 | * @author:Vincent
11 | * QQ:3332168769
12 | * 备注:
13 | */
14 | class LoginViewModel(private val repository: LoginRepository) : ViewModel() {
15 | val loginState = Transformations.map(repository.login) { it }!!
16 | val registerState = Transformations.map(repository.register) { it }!!
17 | fun logun(username: String, password: String) = repository.login(username, password)
18 | fun register(username: String, password: String, rePassword: String) =
19 | repository.register(username, password, rePassword)
20 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/ui/space/SpaceActivity.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.ui.space
2 |
3 | import android.view.View
4 | import com.vincent.baselibrary.helper.SpaceLayout
5 | import com.vincent.baseproject.R
6 | import com.vincent.baseproject.common.UIActivity
7 | import kotlinx.android.synthetic.main.activity_space.*
8 | import kotlinx.android.synthetic.main.app_toolbar.*
9 |
10 | class SpaceActivity : UIActivity() {
11 | override fun getLayoutId() = R.layout.activity_space
12 |
13 | override fun initView() {
14 | tv_title.text = "布局测试"
15 | tv_rightMenu.text = "重置"
16 | tv_rightMenu.visibility = View.VISIBLE
17 | initToolBar(app_toolbar)
18 | }
19 |
20 | /**
21 | * 返回之前都先关掉弹窗
22 | */
23 | override fun onBackPressed() {
24 | SpaceLayout.onDestroy(windowManager)
25 | super.onBackPressed()
26 | }
27 |
28 | override fun initEvent() {
29 | super.initEvent()
30 | // 重置公共布局
31 | tv_rightMenu.setOnClickListener {
32 | SpaceLayout.onDestroy(windowManager)
33 | }
34 | // 展示空布局
35 | ll_btn_empty.setOnClickListener {
36 | SpaceLayout.showEmptyLayout(ll_content, windowManager)
37 | }
38 | // 展示加载中布局
39 | ll_btn_loading.setOnClickListener {
40 | SpaceLayout.showLoadingLayout(ll_content, windowManager)
41 | }
42 |
43 | // 展示网络异常页面,支持点击事件回调
44 | ll_btn_error.setOnClickListener {
45 | // 防止回调事件错乱 因此回调事件的作用只有一次 即重置的时候对事件进行了回收
46 | SpaceLayout.setOnRetryClickedListener(R.id.retry,object :SpaceLayout.OnRetryClickedListener{
47 | override fun onRetryClick() {
48 | SpaceLayout.onDestroy(windowManager)
49 | }
50 |
51 | })
52 | SpaceLayout.showNetworkErrorLayout(ll_content, windowManager)
53 | }
54 | ll_btn_fragment.setOnClickListener {
55 | easyStart(SpaceInFragmentActivity::class.java)
56 | }
57 |
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/ui/space/SpaceFragment.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.ui.space
2 |
3 |
4 | import android.os.Bundle
5 | import android.os.Handler
6 | import android.view.LayoutInflater
7 | import android.view.View
8 | import android.view.ViewGroup
9 | import com.vincent.baselibrary.base.BaseLazyFragment
10 | import com.vincent.baselibrary.helper.SpaceLayout
11 | import com.vincent.baseproject.R
12 | import kotlinx.android.synthetic.main.fragment_space.*
13 |
14 |
15 | /**
16 | * @author Vincent
17 | * 测试Fragment
18 | */
19 | class SpaceFragment : BaseLazyFragment() {
20 | override fun getLayoutId(): Int {
21 | return R.layout.fragment_space
22 | }
23 |
24 | override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
25 | if (mRootView == null && getLayoutId() > 0) {
26 | mRootView = layoutInflater.inflate(getLayoutId(), container, false)
27 | }
28 | container?.removeView(mRootView)
29 | return SpaceLayout.LoadLayout(mRootView!!)
30 | }
31 |
32 | override fun initView() {
33 |
34 | }
35 |
36 | override fun initEvent() {
37 | super.initEvent()
38 | fragment_btn_empty.setOnClickListener {
39 | Handler().post {
40 | SpaceLayout.showEmptyLayout(this)
41 | }
42 |
43 | }
44 | fragment_btn_loading.setOnClickListener {
45 | Handler().post {
46 | SpaceLayout.showLoadingLayout(this)
47 | }
48 |
49 | }
50 |
51 | fragment_btn_error.setOnClickListener {
52 | Handler().post {
53 | SpaceLayout.setOnFragmentRetryClickedListener(
54 | this@SpaceFragment,
55 | R.id.retry,
56 | object : SpaceLayout.OnRetryClickedListener {
57 | override fun onRetryClick() {
58 | SpaceLayout.onDestroy(this@SpaceFragment)
59 | }
60 |
61 | })
62 | SpaceLayout.showNetworkErrorLayout(this)
63 | }
64 |
65 | }
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/ui/space/SpaceInFragmentActivity.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.ui.space
2 |
3 | import android.view.View
4 | import com.vincent.baselibrary.helper.SpaceLayout
5 | import com.vincent.baseproject.R
6 | import com.vincent.baseproject.common.UIActivity
7 | import kotlinx.android.synthetic.main.app_toolbar.*
8 |
9 | class SpaceInFragmentActivity : UIActivity() {
10 |
11 | private lateinit var space:SpaceFragment
12 | override fun getLayoutId() = R.layout.activity_space_in_fragment
13 |
14 | override fun initView() {
15 | tv_title.text = "Fragment 布局测试"
16 | tv_rightMenu.text = "重置"
17 | tv_rightMenu.visibility = View.VISIBLE
18 | initToolBar(app_toolbar)
19 | space = SpaceFragment()
20 | supportFragmentManager.beginTransaction().replace(R.id.container, space).commit()
21 | }
22 |
23 |
24 | override fun initEvent() {
25 | super.initEvent()
26 | tv_rightMenu.setOnClickListener {
27 | SpaceLayout.onDestroy(space)
28 | }
29 |
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/widget/SquareFrameLayout.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.FrameLayout
6 | import com.vincent.baselibrary.util.SquareDelegate
7 |
8 | /**
9 | * author : Android 轮子哥
10 | * github : https://github.com/getActivity/AndroidProject
11 | * time : 2018/10/18
12 | * desc : 正方形的FrameLayout
13 | */
14 | class SquareFrameLayout : FrameLayout {
15 |
16 | constructor(context: Context) : super(context)
17 |
18 | constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
19 |
20 | constructor(context: Context, attrs: AttributeSet) : super(context, attrs)
21 |
22 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
23 | super.onMeasure(
24 | SquareDelegate.measureWidth(widthMeasureSpec, heightMeasureSpec),
25 | SquareDelegate.measureHeight(widthMeasureSpec, heightMeasureSpec)
26 | )
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/widget/SquareImageView.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.appcompat.widget.AppCompatImageView
6 | import com.vincent.baselibrary.util.SquareDelegate
7 |
8 | /**
9 | * author : Android 轮子哥
10 | * github : https://github.com/getActivity/AndroidProject
11 | * time : 2018/10/18
12 | * desc : 正方形的ImageView
13 | */
14 | class SquareImageView : AppCompatImageView {
15 |
16 | constructor(context: Context) : super(context) {}
17 |
18 | constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}
19 |
20 | constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
21 |
22 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
23 | super.onMeasure(
24 | SquareDelegate.measureWidth(widthMeasureSpec, heightMeasureSpec),
25 | SquareDelegate.measureHeight(widthMeasureSpec, heightMeasureSpec)
26 | )
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/widget/SquareLinearLayout.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.LinearLayout
6 | import com.vincent.baselibrary.util.SquareDelegate
7 |
8 | /**
9 | * author : Android 轮子哥
10 | * github : https://github.com/getActivity/AndroidProject
11 | * time : 2018/10/18
12 | * desc : 正方形的LinearLayout
13 | */
14 | class SquareLinearLayout : LinearLayout {
15 |
16 | constructor(context: Context) : super(context) {}
17 |
18 | constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
19 |
20 | constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}
21 |
22 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
23 | super.onMeasure(
24 | SquareDelegate.measureWidth(widthMeasureSpec, heightMeasureSpec),
25 | SquareDelegate.measureHeight(widthMeasureSpec, heightMeasureSpec)
26 | )
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/widget/SquareRelativeLayout.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.RelativeLayout
6 | import com.vincent.baselibrary.util.SquareDelegate
7 |
8 | /**
9 | * author : Android 轮子哥
10 | * github : https://github.com/getActivity/AndroidProject
11 | * time : 2018/10/18
12 | * desc : 正方形的RelativeLayout
13 | */
14 | class SquareRelativeLayout : RelativeLayout {
15 |
16 | constructor(context: Context) : super(context) {}
17 |
18 | constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {}
19 |
20 | constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {}
21 |
22 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
23 | super.onMeasure(
24 | SquareDelegate.measureWidth(widthMeasureSpec, heightMeasureSpec),
25 | SquareDelegate.measureHeight(widthMeasureSpec, heightMeasureSpec)
26 | )
27 | }
28 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/vincent/baseproject/widget/XCollapsingToolbarLayout.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject.widget
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import com.google.android.material.appbar.CollapsingToolbarLayout
6 |
7 | /**
8 | * author : Android 轮子哥
9 | * github : https://github.com/getActivity/AndroidProject
10 | * time : 2018/10/18
11 | * desc : 支持监听渐变的CollapsingToolbarLayout
12 | */
13 | class XCollapsingToolbarLayout : CollapsingToolbarLayout {
14 |
15 | var mListener: OnScrimsListener? = null // 渐变监听
16 | var isCurrentScrimsShown: Boolean = false // 当前渐变状态
17 |
18 | constructor(context: Context) : super(context)
19 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
20 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
21 |
22 | override fun setScrimsShown(shown: Boolean, animate: Boolean) {
23 | super.setScrimsShown(shown, animate)
24 | if(isCurrentScrimsShown != shown){
25 | isCurrentScrimsShown = shown
26 | mListener?.onScrimsStateChange(shown)
27 | }
28 | }
29 |
30 | /**
31 | * CollapsingToolbarLayout渐变监听器
32 | */
33 | interface OnScrimsListener {
34 |
35 | /**
36 | * 渐变状态变化
37 | *
38 | * @param shown 渐变开关
39 | */
40 | fun onScrimsStateChange(shown: Boolean)
41 | }
42 |
43 |
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_web_progress_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
11 |
12 |
13 | -
14 |
15 |
16 |
17 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/btn_retry.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/home_search_bar_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_cb_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/drawable/ic_cb_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_cb_selected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/drawable/ic_cb_selected.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_github.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_selector_selectable_home_found.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_selector_selectable_home_index.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_selector_selectable_home_me.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_selector_selectable_home_message.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/scan_btn_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
11 |
12 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/scan_flash_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/scan_flash_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
11 |
12 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_button.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 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_button_rect.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_selectable_white.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_thumb.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
14 |
15 |
16 |
17 | -
18 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/selector_track.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
6 |
9 |
10 |
11 |
14 |
15 |
16 | -
17 |
19 |
22 |
23 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/shape_bg_radius.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/txt_home_bottom_nav_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/xupdate_bg_app_info.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_city_picker.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
20 |
21 |
29 |
30 |
38 |
39 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_login.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
14 |
15 |
20 |
21 |
33 |
34 |
38 |
39 |
51 |
52 |
56 |
57 |
67 |
68 |
77 |
78 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
20 |
21 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_scanner.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
20 |
21 |
22 |
30 |
31 |
32 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
21 |
22 |
28 |
29 |
30 |
35 |
36 |
45 |
46 |
51 |
58 |
59 |
60 |
66 |
67 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_space.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
21 |
22 |
29 |
30 |
37 |
38 |
45 |
46 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_space_in_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_web.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
21 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/app_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
21 |
22 |
34 |
35 |
45 |
46 |
47 |
55 |
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/banner_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_custom.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_space.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
18 |
19 |
27 |
28 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_empty.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/layout_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/network_error2_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/network_error_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_setting_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
16 |
17 |
26 |
27 |
35 |
36 |
37 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_home_bottom_nav.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/tab_ico_found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/tab_ico_found.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/tab_ico_found_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/tab_ico_found_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/tab_ico_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/tab_ico_home.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/tab_ico_home_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/tab_ico_home_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/tab_ico_me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/tab_ico_me.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/tab_ico_me_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/tab_ico_me_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/tab_ico_message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/tab_ico_message.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/tab_ico_message_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/tab_ico_message_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/xupdate_bg_app_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/xupdate_bg_app_top.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/zfb_grid_scan_line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-hdpi/zfb_grid_scan_line.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_ico_found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/tab_ico_found.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_ico_found_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/tab_ico_found_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_ico_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/tab_ico_home.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_ico_home_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/tab_ico_home_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_ico_me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/tab_ico_me.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_ico_me_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/tab_ico_me_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_ico_message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/tab_ico_message.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/tab_ico_message_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/tab_ico_message_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/xupdate_icon_app_close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xhdpi/xupdate_icon_app_close.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/bg_launcher.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/bg_launcher.jpg
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/img_custom_dialog_bkg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/img_custom_dialog_bkg.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/img_custom_dialog_button.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/img_custom_dialog_button.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tab_ico_found.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/tab_ico_found.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tab_ico_found_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/tab_ico_found_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tab_ico_home.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/tab_ico_home.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tab_ico_home_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/tab_ico_home_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tab_ico_me.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/tab_ico_me.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tab_ico_me_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/tab_ico_me_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tab_ico_message.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/tab_ico_message.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/tab_ico_message_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxhdpi/tab_ico_message_off.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/arrow_right_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/arrow_right_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/back.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/error.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/ic_empty.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_network_error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/ic_network_error.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/icon_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/icon_black.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/scan_change.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/scan_change.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/scan_flash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/scan_flash.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/scan_normal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/mipmap-xxxhdpi/scan_normal.png
--------------------------------------------------------------------------------
/app/src/main/res/navigation/nav_garden.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
16 |
17 |
21 |
22 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/weixin_beep.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/app/src/main/res/raw/weixin_beep.ogg
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 | #F4F4F4
8 |
9 |
10 | #1976d2
11 |
12 | #DDDDDD
13 |
14 | #ECECEC
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 5dp
6 |
7 |
8 | 1px
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.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 | Copyright © 2018
36 |
37 |
38 | Hello blank fragment
39 | 空数据
40 | 加载页
41 | 网络异常
42 | Fragment 测试
43 |
44 |
--------------------------------------------------------------------------------
/app/src/test/java/com/vincent/baseproject/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baseproject
2 |
3 | import android.graphics.Color
4 | import android.util.AttributeSet
5 | import org.junit.Test
6 |
7 | import org.junit.Assert.*
8 |
9 | /**
10 | * Example local unit test, which will execute on the development machine (host).
11 | *
12 | * See [testing documentation](http://d.android.com/tools/testing).
13 | */
14 | class ExampleUnitTest {
15 | @Test
16 | fun addition_isCorrect() {
17 | val color = calculateColor(0xffffff,100)
18 | print(color)
19 | }
20 |
21 | fun calculateColor(color: Int, alpha: Int): Int {
22 | if (alpha == 0) {
23 | return color
24 | }
25 | val a = 1 - alpha / 255f
26 | var red = color shr 16 and 0xff
27 | var green = color shr 8 and 0xff
28 | var blue = color and 0xff
29 | println(red)
30 | println(green)
31 | println(blue)
32 | return Color.argb(alpha,red,green,blue)
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/base.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/base.jks
--------------------------------------------------------------------------------
/baselibrary/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/baselibrary/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | apply plugin: 'kotlin-android'
4 | apply plugin: 'kotlin-android-extensions'
5 | android {
6 | compileSdkVersion rootProject.ext.compileSdkVersion
7 |
8 |
9 |
10 | defaultConfig {
11 | minSdkVersion rootProject.ext.minSdkVersion
12 | targetSdkVersion rootProject.ext.targetSdkVersion
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 |
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 |
27 | }
28 |
29 | dependencies {
30 | implementation fileTree(include: ['*.jar'], dir: 'libs')
31 | implementation "androidx.appcompat:appcompat:$rootProject.ext.appcompat"
32 | testImplementation "junit:junit:$rootProject.ext.junit"
33 | androidTestImplementation "androidx.test:runner:$rootProject.ext.runner"
34 | androidTestImplementation "androidx.test.espresso:espresso-core:$rootProject.ext.espressoCore"
35 |
36 | // RecyclerView
37 | api "androidx.recyclerview:recyclerview:$rootProject.ext.recyclerview"
38 | // EventBus
39 | api "org.greenrobot:eventbus:$rootProject.ext.eventbus"
40 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
41 | }
42 | repositories {
43 | mavenCentral()
44 | }
45 |
--------------------------------------------------------------------------------
/baselibrary/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/baselibrary/src/androidTest/java/com/vincent/baselibrary/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.vincent.baselibrary.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/baselibrary/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/base/BaseActivityHandler.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.base
2 |
3 | import android.app.Activity
4 | import android.os.Handler
5 | import android.os.Looper
6 | import java.lang.ref.WeakReference
7 |
8 | /**
9 | * author : Android 轮子哥
10 | * github : https://github.com/getActivity/AndroidProject
11 | * time : 2018/10/18
12 | * desc : 在 Activity 中优化 Handler 基类
13 | */
14 | abstract class BaseActivityHandler(activity: T) : Handler(Looper.getMainLooper()) {
15 | private val mActivity = WeakReference(activity)
16 | /**
17 | * 判断当前Handler是否可用
18 | */
19 | fun isEnabled(): Boolean {
20 | return mActivity.get() != null && mActivity.get()?.isFinishing ?: true
21 | }
22 |
23 | /**
24 | * 在Activity销毁前移除所有的任务
25 | */
26 | fun onDestroy() {
27 | //删除所有的回调函数和消息
28 | removeCallbacksAndMessages(null)
29 | }
30 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/entity/NetworkChangeEvent.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.entity
2 |
3 | /**
4 | * 创建日期:2019/3/22 0022on 下午 1:57
5 | * 描述:网络事件 Event
6 | * @author:Vincent
7 | * QQ:3332168769
8 | * 备注:
9 | */
10 | data class NetworkChangeEvent(val isConnected:Boolean)
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/helper/EditTextInputHelper.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.helper
2 |
3 | import android.text.Editable
4 | import android.text.TextWatcher
5 | import android.view.View
6 | import android.widget.EditText
7 |
8 | /**
9 | * author : Android 轮子哥
10 | * github : https://github.com/getActivity/AndroidProject
11 | * time : 2018/10/18
12 | * desc : 文本输入辅助类,通过管理多个 EditText 输入是否为空来启用或者禁用按钮的点击事件
13 | * blog : https://www.jianshu.com/p/fd3795e8a6b3
14 | */
15 | class EditTextInputHelper(val view: View,var alpha:Boolean = false) :TextWatcher{
16 |
17 | private var mViewSet: MutableList = mutableListOf()
18 | fun addView(vararg edits: EditText){
19 | for (e in edits){
20 | e.addTextChangedListener(this)
21 | mViewSet.add(e)
22 | }
23 | afterTextChanged(null)
24 | }
25 |
26 | fun removeViews(){
27 | if(mViewSet.isEmpty())return
28 | for (e in mViewSet){
29 | e.removeTextChangedListener(this)
30 | }
31 | mViewSet.clear()
32 |
33 | }
34 |
35 | /**
36 | * 设置 View 的事件
37 | * @param enabled 启用或者禁用 View 的事件
38 | */
39 | fun setEnabled(enabled: Boolean) {
40 | if(enabled == view.isEnabled)return
41 | if(enabled){
42 | view.isEnabled = true
43 | if(alpha)view.alpha = 1f
44 | }else{
45 | view.isEnabled = false
46 | if(alpha)view.alpha = 0.5f
47 | }
48 | }
49 | override fun afterTextChanged(s: Editable?) {
50 | for (e in mViewSet){
51 | if(e.text.toString().isBlank()){
52 | setEnabled(false)
53 | return
54 | }
55 | }
56 | setEnabled(true)
57 | }
58 |
59 | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
60 |
61 | }
62 |
63 | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
64 |
65 | }
66 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/helper/SettingUtil.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.helper
2 |
3 | import android.content.ComponentName
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.net.Uri
7 | import android.os.Build
8 |
9 |
10 | object SettingUtil {
11 |
12 |
13 | /**
14 | * 跳转到系统设置
15 | * 小米10使用小米专用方法会崩溃,因此一并使用默认方法
16 | */
17 | fun goSetting(context: Context) {
18 |
19 | val manufacturer = Build.MANUFACTURER.toLowerCase()
20 | when {
21 | manufacturer.contains("huawei") -> goHuaweiPermission(context)
22 | manufacturer.contains("meizu") -> goMeizuPermission(context)
23 | else -> goDefaultSetting(context)
24 | }
25 |
26 |
27 |
28 | }
29 |
30 | private fun goDefaultSetting(context: Context) {
31 | val intent = Intent()
32 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
33 | intent.action = "android.settings.APPLICATION_DETAILS_SETTINGS"
34 | intent.data = Uri.fromParts("package", context.packageName, null)
35 | context.startActivity(intent)
36 | }
37 |
38 |
39 | /**
40 | * 跳转到魅族的权限管理系统
41 | */
42 | private fun goMeizuPermission(context: Context) {
43 | try {
44 | val intent = Intent("com.meizu.safe.security.SHOW_APPSEC")
45 | intent.addCategory(Intent.CATEGORY_DEFAULT)
46 | intent.putExtra("packageName", context.packageName)
47 | context.startActivity(intent)
48 | } catch (e: Exception) {
49 | goDefaultSetting(context)
50 | e.printStackTrace()
51 |
52 | }
53 |
54 | }
55 |
56 | /**
57 | * 华为的权限管理页面
58 | */
59 | private fun goHuaweiPermission(context: Context) {
60 | try {
61 | val intent = Intent()
62 | intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
63 | val comp = ComponentName("com.huawei.systemmanager", "com.huawei.permissionmanager.ui.MainActivity")//华为权限管理
64 | intent.component = comp
65 | context.startActivity(intent)
66 | } catch (e: Exception) {
67 | goDefaultSetting(context)
68 | e.printStackTrace()
69 | }
70 |
71 | }
72 |
73 |
74 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/util/DrawableUtil.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("unused")
2 | package com.vincent.baselibrary.util
3 |
4 | import android.content.res.ColorStateList
5 | import android.graphics.PorterDuff
6 | import android.graphics.drawable.Drawable
7 | import androidx.annotation.ColorInt
8 | import androidx.core.graphics.drawable.DrawableCompat
9 |
10 |
11 | object DrawableUtil {
12 | /**
13 | * 设置drawable宽高
14 | *
15 | * @param drawable
16 | * @param width
17 | * @param height
18 | */
19 | fun setDrawableWidthHeight(drawable: Drawable?, width: Int, height: Int) {
20 | drawable?.setBounds(
21 | 0, 0,
22 | if (width >= 0) width else drawable.intrinsicWidth,
23 | if (height >= 0) height else drawable.intrinsicHeight
24 | )
25 | }
26 |
27 | /**
28 | * 复制当前drawable
29 | *
30 | * @param drawable
31 | * @return
32 | */
33 | fun getNewDrawable(drawable: Drawable?): Drawable? {
34 | return drawable?.constantState?.newDrawable()
35 | }
36 |
37 |
38 | /**
39 | * 给一个Drawable变换线框颜色
40 | *
41 | * @param drawable 需要变换颜色的drawable
42 | * @param color 需要变换的颜色
43 | * @return
44 | */
45 | fun setTintDrawable(drawable: Drawable?, @ColorInt color: Int): Drawable? {
46 | drawable?.let {
47 | DrawableCompat.setTint(it, color)
48 | }
49 | return drawable
50 | }
51 |
52 | fun setTintDrawable(drawable: Drawable?, tint: ColorStateList?): Drawable? {
53 |
54 | if (drawable != null && tint != null) {
55 | DrawableCompat.setTintList(drawable, tint)
56 | }
57 | return drawable
58 | }
59 |
60 | fun setTintMode(drawable: Drawable?, tintMode: PorterDuff.Mode?): Drawable? {
61 | if (drawable != null && tintMode != null) {
62 | DrawableCompat.setTintMode(drawable, tintMode)
63 | }
64 | return drawable
65 | }
66 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/util/MarginDecoration.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.util
2 |
3 | import android.graphics.Rect
4 | import android.view.View
5 | import androidx.recyclerview.widget.RecyclerView
6 |
7 | /**
8 | * 创建日期:2019/1/15 0015on 下午 1:34
9 | * 描述:根据位置设置不同的分割线
10 | * author:Vincent
11 | * QQ:3332168769
12 | * 备注:分割线工具类
13 | */
14 | class MarginDecoration(val callback: MarginDecorationCallback) : RecyclerView.ItemDecoration() {
15 |
16 | /**
17 | * 绘制分割线
18 | *
19 | *
20 | * if (parent.getChildLayoutPosition(view) == 0) {
21 | * outRect?.set(0, 0, 0, 0)
22 | * }else {
23 | * val margin = view.context.resources.getDimension(R.dimen.textSize_10).toInt()
24 | * outRect?.set(0, margin, 0, margin)
25 | * }
26 | *
27 | *
28 | */
29 | override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
30 | callback.onGetItemOffsets(outRect, parent.getChildLayoutPosition(view))
31 | }
32 |
33 |
34 | }
35 |
36 | interface MarginDecorationCallback {
37 | fun onGetItemOffsets(outRect: Rect?, position: Int)
38 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/util/SquareDelegate.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.util
2 |
3 | import android.view.View
4 |
5 | /**
6 | * author : Android 轮子哥
7 | * github : https://github.com/getActivity/AndroidProject
8 | * time : 2018/10/27
9 | * desc : 用于限定正方形大小的控件的算法
10 | */
11 | object SquareDelegate {
12 |
13 | /**
14 | * 测量出正方形的宽度
15 | *
16 | * @param widthMeasureSpec onMeasure中的同名参数
17 | * @param heightMeasureSpec onMeasure中的同名参数
18 | * @return 返回用于测量的参数
19 | */
20 | fun measureWidth(widthMeasureSpec: Int, heightMeasureSpec: Int): Int {
21 |
22 | val widthSpecMode = View.MeasureSpec.getMode(widthMeasureSpec)
23 | val widthSpecSize = View.MeasureSpec.getSize(widthMeasureSpec)
24 |
25 | val heightSpecMode = View.MeasureSpec.getMode(heightMeasureSpec)
26 | val heightSpecSize = View.MeasureSpec.getSize(heightMeasureSpec)
27 |
28 | // 如果当前宽度不是写死的
29 | return if (widthSpecMode != View.MeasureSpec.EXACTLY) {
30 | // 如果当前高度不是写死的
31 | if (heightSpecMode != View.MeasureSpec.EXACTLY) {
32 | // 对比高度和宽度,返回最大值的那个
33 | View.MeasureSpec.makeMeasureSpec(Math.max(widthSpecSize, heightSpecSize), View.MeasureSpec.EXACTLY)
34 | } else {
35 | // 如果已经定死了高度,而宽度没有写死,则使用高度代替宽度
36 | heightMeasureSpec
37 | }
38 | } else {
39 | // 宽度和高度已经写死,这里不做任何处理
40 | widthMeasureSpec
41 | }
42 | }
43 |
44 | /**
45 | * 测量出正方形的高度
46 | *
47 | * @param widthMeasureSpec onMeasure中的同名参数
48 | * @param heightMeasureSpec onMeasure中的同名参数
49 | * @return 返回用于测量的参数
50 | */
51 | fun measureHeight(widthMeasureSpec: Int, heightMeasureSpec: Int): Int {
52 |
53 | val widthSpecMode = View.MeasureSpec.getMode(widthMeasureSpec)
54 | val widthSpecSize = View.MeasureSpec.getSize(widthMeasureSpec)
55 |
56 | val heightSpecMode = View.MeasureSpec.getMode(heightMeasureSpec)
57 | val heightSpecSize = View.MeasureSpec.getSize(heightMeasureSpec)
58 |
59 | // 如果当前高度不是写死的
60 | return if (heightSpecMode != View.MeasureSpec.EXACTLY) {
61 | // 如果当前宽度不是写死的
62 | if (widthSpecMode != View.MeasureSpec.EXACTLY) {
63 | // 对比高度和宽度,返回最大值的那个
64 | View.MeasureSpec.makeMeasureSpec(Math.max(widthSpecSize, heightSpecSize), View.MeasureSpec.EXACTLY)
65 | } else {
66 | // 如果已经定死了宽度,而高度没有写死,则使用高度代替宽度
67 | widthMeasureSpec
68 | }
69 | } else {
70 | // 宽度和高度已经写死,这里不做任何处理
71 | heightMeasureSpec
72 | }
73 | }
74 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/CountdownView.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("unused")
2 | package com.vincent.baselibrary.widget
3 |
4 | import android.annotation.SuppressLint
5 | import android.content.Context
6 | import android.util.AttributeSet
7 | import android.widget.TextView
8 |
9 | /**
10 | * author : Android 轮子哥
11 | * github : https://github.com/getActivity/AndroidProject
12 | * time : 2018/10/18
13 | * desc : 验证码倒计时
14 | */
15 | // 秒数单位文本
16 | private const val TIME_UNIT = "S"
17 | class CountdownView: TextView, Runnable {
18 |
19 |
20 | /**
21 | * 倒计时秒数
22 | */
23 | var mTotalTime = 60
24 | /**
25 | * 当前秒数
26 | */
27 | private var mCurrentTime: Int = 0
28 | /**
29 | * 记录原有的文本
30 | */
31 | private var mRecordText: CharSequence? = null
32 | /**
33 | * 标记是否重置了倒计控件
34 | */
35 | private var mFlag: Boolean = false
36 |
37 | constructor(context: Context) : super(context)
38 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
39 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)
40 |
41 | /**
42 | * 重置倒计时控件
43 | */
44 | fun resetState() {
45 | mFlag = true
46 | }
47 |
48 | override fun onAttachedToWindow() {
49 | super.onAttachedToWindow()
50 | //设置点击的属性
51 | isClickable = true
52 | }
53 |
54 | override fun onDetachedFromWindow() {
55 | // 移除延迟任务,避免内存泄露
56 | removeCallbacks(this)
57 | super.onDetachedFromWindow()
58 | }
59 |
60 | override fun performClick(): Boolean {
61 | val click = super.performClick()
62 | mRecordText = text
63 | isEnabled = false
64 | mCurrentTime = mTotalTime
65 | post(this)
66 | return click
67 | }
68 |
69 | @SuppressLint("SetTextI18n")
70 | override fun run() {
71 | if (mCurrentTime == 0 || mFlag) {
72 | text = mRecordText
73 | isEnabled = true
74 | mFlag = false
75 | } else {
76 | mCurrentTime--
77 | text = mCurrentTime.toString() + "\t" + TIME_UNIT
78 | postDelayed(this, 1000)
79 | }
80 | }
81 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/NoScrollViewPager.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("unused")
2 | package com.vincent.baselibrary.widget
3 |
4 | import android.annotation.SuppressLint
5 | import android.content.Context
6 | import android.util.AttributeSet
7 | import android.view.KeyEvent
8 | import android.view.MotionEvent
9 | import androidx.annotation.NonNull
10 | import androidx.viewpager.widget.ViewPager
11 |
12 | /**
13 | * author : Android 轮子哥
14 | * github : https://github.com/getActivity/AndroidProject
15 | * time : 2018/10/18
16 | * desc : 禁用水平滑动的ViewPager(一般用于APP主页的ViewPager + Fragment)
17 | */
18 | class NoScrollViewPager : ViewPager {
19 |
20 | var enableScroll = false
21 |
22 | constructor(context: Context) : super(context)
23 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
24 |
25 | override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
26 | // 不拦截这个事件
27 | return enableScroll
28 | }
29 |
30 | @SuppressLint("ClickableViewAccessibility")
31 | override fun onTouchEvent(ev: MotionEvent): Boolean {
32 | // 不处理这个事件
33 | return enableScroll
34 | }
35 |
36 | override fun executeKeyEvent(@NonNull event: KeyEvent): Boolean {
37 | // 不处理按键事件
38 | return enableScroll
39 | }
40 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusButton.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import androidx.appcompat.widget.AppCompatButton
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusTextDelegateImp
7 | import kotlin.math.max
8 |
9 | /**
10 | * 文件描述:
11 | *
@author 烤鱼
12 | *
@date 2019/7/21 0021
13 | *
@update 2019/7/21 0021
14 | *
版本号:1
15 | *
16 | */
17 | class RadiusButton:AppCompatButton {
18 |
19 | var delegate: RadiusTextDelegateImp? = null
20 |
21 | constructor(context: Context) : super(context) {
22 | delegate = RadiusTextDelegateImp(this, context, null)
23 | }
24 |
25 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
26 | delegate = RadiusTextDelegateImp(this, context, attrs)
27 | }
28 |
29 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
30 | delegate = RadiusTextDelegateImp(this, context, attrs)
31 | }
32 |
33 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
34 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
35 | val max = max(width, height)
36 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
37 | super.onMeasure(measureSpec, measureSpec)
38 | return
39 | }
40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
41 | }
42 |
43 | override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
44 | super.onLayout(changed, left, top, right, bottom)
45 | if (delegate?.getRadiusHalfHeightEnable() == true) {
46 | delegate?.setRadius(height / 2f)
47 | }
48 | delegate?.initShape()
49 | }
50 |
51 | override fun setSelected(selected: Boolean) {
52 | super.setSelected(selected)
53 | delegate?.setSelected(selected)
54 | }
55 |
56 | override fun setEnabled(enabled: Boolean) {
57 | super.setEnabled(enabled)
58 | delegate?.initShape()
59 | }
60 |
61 | override fun setPressed(pressed: Boolean) {
62 | super.setPressed(pressed)
63 | delegate?.initShape()
64 | }
65 |
66 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusCheckBox.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.CheckBox
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusCompoundDelegateImp
7 | import kotlin.math.max
8 |
9 | /**
10 | *
文件描述:
11 | *
@author 烤鱼
12 | *
@date 2019/7/12 0012
13 | *
@update 2019/7/12 0012
14 | *
版本号:1
15 | *
16 | */
17 | class RadiusCheckBox : CheckBox {
18 |
19 | var delegate: RadiusCompoundDelegateImp? = null
20 |
21 | constructor(context: Context) : super(context) {
22 | delegate = RadiusCompoundDelegateImp(this, context, null)
23 | }
24 |
25 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
26 | delegate = RadiusCompoundDelegateImp(this, context, attrs)
27 | }
28 |
29 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
30 | delegate = RadiusCompoundDelegateImp(this, context, attrs)
31 | }
32 |
33 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
34 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
35 | val max = max(width, height)
36 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
37 | super.onMeasure(measureSpec, measureSpec)
38 | return
39 | }
40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
41 | }
42 |
43 | override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
44 | super.onLayout(changed, left, top, right, bottom)
45 | if (delegate?.getRadiusHalfHeightEnable() == true) {
46 | delegate?.setRadius(height / 2f)
47 | }
48 | delegate?.initShape()
49 | }
50 |
51 | override fun setSelected(selected: Boolean) {
52 | super.setSelected(selected)
53 | delegate?.setSelected(selected)
54 | }
55 |
56 | override fun setEnabled(enabled: Boolean) {
57 | super.setEnabled(enabled)
58 | delegate?.initShape()
59 | }
60 |
61 | override fun setPressed(pressed: Boolean) {
62 | super.setPressed(pressed)
63 | delegate?.initShape()
64 | }
65 |
66 | override fun setChecked(checked: Boolean) {
67 | super.setChecked(checked)
68 | delegate?.initShape()
69 | }
70 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusEditText.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.EditText
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusEditTextDelegateImp
7 | import kotlin.math.max
8 |
9 | /**
10 | *
文件描述:
11 | *
author 烤鱼
12 | *
date 2019/7/12 0012
13 | *
update 2019/7/12 0012
14 | *
版本号:1
15 | *
16 | */
17 | class RadiusEditText : EditText {
18 |
19 | /**
20 | * 是否设置完成光标标识
21 | */
22 | private var mSelectionEndDone: Boolean = false
23 | var delegate: RadiusEditTextDelegateImp? = null
24 |
25 | constructor(context: Context) : super(context) {
26 | delegate = RadiusEditTextDelegateImp(this, context, null)
27 | }
28 |
29 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
30 | delegate = RadiusEditTextDelegateImp(this, context, attrs)
31 | }
32 |
33 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
34 | delegate = RadiusEditTextDelegateImp(this, context, attrs)
35 | }
36 |
37 | override fun setText(text: CharSequence?, type: BufferType?) {
38 | super.setText(text, type)
39 | text ?: return
40 | if (delegate?.isSelectionEndEnable() == false) {
41 | return
42 | }
43 | if (mSelectionEndDone) return
44 |
45 | setSelection(text.length)
46 | mSelectionEndDone = delegate?.isSelectionEndOnceEnable() ?: true
47 | }
48 |
49 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
50 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
51 | val max = max(width, height)
52 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
53 | super.onMeasure(measureSpec, measureSpec)
54 | return
55 | }
56 |
57 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
58 | }
59 |
60 | override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
61 | super.onLayout(changed, left, top, right, bottom)
62 | if (delegate?.getRadiusHalfHeightEnable() == true) {
63 | delegate?.setRadius(height / 2f)
64 | }
65 | delegate?.initShape()
66 | }
67 |
68 | override fun setSelected(selected: Boolean) {
69 | super.setSelected(selected)
70 | delegate?.setSelected(selected)
71 | }
72 |
73 | override fun setEnabled(enabled: Boolean) {
74 | super.setEnabled(enabled)
75 | delegate?.initShape()
76 | }
77 |
78 | override fun setPressed(pressed: Boolean) {
79 | super.setPressed(pressed)
80 | delegate?.initShape()
81 | }
82 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusFrameLayout.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.FrameLayout
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusViewDelegateImp
7 | import kotlin.math.max
8 |
9 | /**
10 | *
文件描述:
11 | *
author 烤鱼
12 | *
date 2019/7/12 0012
13 | *
update 2019/7/12 0012
14 | *
版本号:1
15 | *
16 | */
17 | class RadiusFrameLayout : FrameLayout {
18 |
19 | var delegate: RadiusViewDelegateImp? = null
20 |
21 | constructor(context: Context) : super(context) {
22 | delegate = RadiusViewDelegateImp(this, context, null)
23 | }
24 |
25 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
26 | delegate = RadiusViewDelegateImp(this, context, attrs)
27 | }
28 |
29 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
30 | delegate = RadiusViewDelegateImp(this, context, attrs)
31 | }
32 |
33 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
34 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
35 | val max = max(width, height)
36 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
37 | super.onMeasure(measureSpec, measureSpec)
38 | return
39 | }
40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
41 | }
42 |
43 | override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
44 | super.onLayout(changed, l, t, r, b)
45 | if (delegate?.getRadiusHalfHeightEnable() == true) {
46 | delegate?.setRadius(height / 2f)
47 | }
48 | delegate?.initShape()
49 | }
50 |
51 | override fun setSelected(selected: Boolean) {
52 | super.setSelected(selected)
53 | delegate?.setSelected(selected)
54 | }
55 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusLinearLayout.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.LinearLayout
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusViewDelegateImp
7 | import kotlin.math.max
8 |
9 | /**
10 | *
文件描述:
11 | *
author 烤鱼
12 | *
date 2019/7/12 0012
13 | *
update 2019/7/12 0012
14 | *
版本号:1
15 | *
16 | */
17 | class RadiusLinearLayout : LinearLayout {
18 |
19 | var delegate: RadiusViewDelegateImp? = null
20 |
21 | constructor(context: Context) : super(context) {
22 | delegate = RadiusViewDelegateImp(this, context, null)
23 | }
24 |
25 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
26 | delegate = RadiusViewDelegateImp(this, context, attrs)
27 | }
28 |
29 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
30 | delegate = RadiusViewDelegateImp(this, context, attrs)
31 | }
32 |
33 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
34 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
35 | val max = max(width, height)
36 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
37 | super.onMeasure(measureSpec, measureSpec)
38 | return
39 | }
40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
41 | }
42 |
43 | override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
44 | super.onLayout(changed, l, t, r, b)
45 | if (delegate?.getRadiusHalfHeightEnable() == true) {
46 | delegate?.setRadius(height / 2f)
47 | }
48 | delegate?.initShape()
49 | }
50 |
51 | override fun setSelected(selected: Boolean) {
52 | super.setSelected(selected)
53 | delegate?.setSelected(selected)
54 | }
55 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusRadioButton.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.RadioButton
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusCompoundDelegateImp
7 | import kotlin.math.max
8 |
9 | /**
10 | *
文件描述:
11 | *
author 烤鱼
12 | *
date 2019/7/12 0012
13 | *
update 2019/7/12 0012
14 | *
版本号:1
15 | *
16 | */
17 | class RadiusRadioButton : RadioButton {
18 |
19 | var delegate: RadiusCompoundDelegateImp? = null
20 |
21 | constructor(context: Context) : super(context) {
22 | delegate = RadiusCompoundDelegateImp(this, context, null)
23 | }
24 |
25 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
26 | delegate = RadiusCompoundDelegateImp(this, context, attrs)
27 | }
28 |
29 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
30 | delegate = RadiusCompoundDelegateImp(this, context, attrs)
31 | }
32 |
33 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
34 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
35 | val max = max(width, height)
36 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
37 | super.onMeasure(measureSpec, measureSpec)
38 | return
39 | }
40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
41 | }
42 |
43 | override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
44 | super.onLayout(changed, left, top, right, bottom)
45 | if (delegate?.getRadiusHalfHeightEnable() == true) {
46 | delegate?.setRadius(height / 2f)
47 | }
48 | delegate?.initShape()
49 | }
50 |
51 | override fun setSelected(selected: Boolean) {
52 | super.setSelected(selected)
53 | delegate?.setSelected(selected)
54 | }
55 |
56 | override fun setEnabled(enabled: Boolean) {
57 | super.setEnabled(enabled)
58 | delegate?.initShape()
59 | }
60 |
61 | override fun setPressed(pressed: Boolean) {
62 | super.setPressed(pressed)
63 | delegate?.initShape()
64 | }
65 |
66 | override fun setChecked(checked: Boolean) {
67 | super.setChecked(checked)
68 | delegate?.initShape()
69 | }
70 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusRelativeLayout.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.RelativeLayout
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusViewDelegateImp
7 | import kotlin.math.max
8 |
9 |
10 | /**
11 | *
文件描述:
12 | *
@author 烤鱼
13 | *
@date 2019/7/12 0012
14 | *
@update 2019/7/12 0012
15 | *
版本号:1
16 | *
17 | */
18 | class RadiusRelativeLayout : RelativeLayout {
19 |
20 | var delegate: RadiusViewDelegateImp? = null
21 |
22 | constructor(context: Context) : super(context) {
23 | delegate = RadiusViewDelegateImp(this, context, null)
24 | }
25 |
26 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
27 | delegate = RadiusViewDelegateImp(this, context, attrs)
28 | }
29 |
30 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
31 | delegate = RadiusViewDelegateImp(this, context, attrs)
32 | }
33 |
34 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
35 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
36 | val max = max(width, height)
37 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
38 | super.onMeasure(measureSpec, measureSpec)
39 | return
40 | }
41 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
42 | }
43 |
44 | override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
45 | super.onLayout(changed, l, t, r, b)
46 | if (delegate?.getRadiusHalfHeightEnable() == true) {
47 | delegate?.setRadius(height / 2f)
48 | }
49 | delegate?.initShape()
50 | }
51 |
52 | override fun setSelected(selected: Boolean) {
53 | super.setSelected(selected)
54 | delegate?.setSelected(selected)
55 | }
56 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusSwitch.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.Switch
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusSwitchDelegateImp
7 | import kotlin.math.max
8 |
9 |
10 | /**
11 | *
文件描述:
12 | *
author 烤鱼
13 | *
date 2019/7/10 0010
14 | *
update 2019/7/10 0010
15 | *
版本号:1
16 | *
17 | */
18 | class RadiusSwitch : Switch {
19 | var delegate: RadiusSwitchDelegateImp? = null
20 |
21 | constructor(context: Context) : super(context) {
22 | delegate = RadiusSwitchDelegateImp(this, context, null)
23 | }
24 |
25 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
26 | delegate = RadiusSwitchDelegateImp(this, context, attrs)
27 | }
28 |
29 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
30 | delegate = RadiusSwitchDelegateImp(this, context, attrs)
31 | }
32 |
33 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
34 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
35 | val max = max(width, height)
36 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
37 | super.onMeasure(measureSpec, measureSpec)
38 | } else {
39 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
40 | }
41 | }
42 |
43 | override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
44 | super.onLayout(changed, left, top, right, bottom)
45 | if (delegate?.getRadiusHalfHeightEnable() == true) {
46 | delegate?.setRadius(height / 2f)
47 | }
48 | delegate?.initShape()
49 | }
50 |
51 | override fun setSelected(selected: Boolean) {
52 | super.setSelected(selected)
53 | delegate?.setSelected(selected)
54 | }
55 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/RadiusTextView.kt:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary.widget.radius
2 |
3 | import android.content.Context
4 | import android.util.AttributeSet
5 | import android.widget.TextView
6 | import com.vincent.baselibrary.widget.radius.delegate.RadiusTextDelegateImp
7 | import kotlin.math.max
8 |
9 | /**
10 | *
文件描述:
11 | *
author 烤鱼
12 | *
date 2019/7/12 0012
13 | *
update 2019/7/12 0012
14 | *
版本号:1
15 | *
16 | */
17 | class RadiusTextView : TextView {
18 |
19 | var delegate: RadiusTextDelegateImp? = null
20 |
21 | constructor(context: Context) : super(context) {
22 | delegate = RadiusTextDelegateImp(this, context, null)
23 | }
24 |
25 | constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
26 | delegate = RadiusTextDelegateImp(this, context, attrs)
27 | }
28 |
29 | constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int = 0) : super(context, attrs, defStyleAttr) {
30 | delegate = RadiusTextDelegateImp(this, context, attrs)
31 | }
32 |
33 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
34 | if (delegate?.getWidthHeightEqualEnable() == true && width > 0 && height > 0) {
35 | val max = max(width, height)
36 | val measureSpec = MeasureSpec.makeMeasureSpec(max, MeasureSpec.EXACTLY)
37 | super.onMeasure(measureSpec, measureSpec)
38 | return
39 | }
40 | super.onMeasure(widthMeasureSpec, heightMeasureSpec)
41 | }
42 |
43 | override fun onLayout(changed: Boolean, left: Int, top: Int, right: Int, bottom: Int) {
44 | super.onLayout(changed, left, top, right, bottom)
45 | if (delegate?.getRadiusHalfHeightEnable() == true) {
46 | delegate?.setRadius(height / 2f)
47 | }
48 | delegate?.initShape()
49 | }
50 |
51 | override fun setSelected(selected: Boolean) {
52 | super.setSelected(selected)
53 | delegate?.setSelected(selected)
54 | }
55 |
56 | override fun setEnabled(enabled: Boolean) {
57 | super.setEnabled(enabled)
58 | delegate?.initShape()
59 | }
60 |
61 | override fun setPressed(pressed: Boolean) {
62 | super.setPressed(pressed)
63 | delegate?.initShape()
64 | }
65 | }
--------------------------------------------------------------------------------
/baselibrary/src/main/java/com/vincent/baselibrary/widget/radius/delegate/RadiusEditTextDelegate.kt:
--------------------------------------------------------------------------------
1 | @file:Suppress("unused", "UNCHECKED_CAST", "RtlHardcoded", "NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS")
2 |
3 | package com.vincent.baselibrary.widget.radius.delegate
4 |
5 | import android.content.Context
6 | import android.content.res.TypedArray
7 | import android.util.AttributeSet
8 | import android.widget.EditText
9 | import com.vincent.baselibrary.R
10 |
11 | /**
12 | *
文件描述:
13 | *
author 烤鱼
14 | *
date 2019/7/11 0011
15 | *
update 2019/7/11 0011
16 | *
版本号:1
17 | *
18 | */
19 | open class RadiusEditTextDelegate constructor(editText: EditText, context: Context, attrs: AttributeSet?) :
20 | RadiusTextDelegate(editText, context, attrs) where T : RadiusTextDelegate {
21 |
22 | private var mSelectionEndEnable: Boolean = false
23 | private var mSelectionEndOnceEnable: Boolean = false
24 |
25 | override fun initAttributes(typedArray: TypedArray) {
26 | mSelectionEndEnable = typedArray.getBoolean(R.styleable.RadiusView_rv_selectionEndEnable, true)
27 | mSelectionEndOnceEnable = typedArray.getBoolean(R.styleable.RadiusView_rv_selectionEndOnceEnable, false)
28 | super.initAttributes(typedArray)
29 | }
30 |
31 |
32 | fun isSelectionEndEnable(): Boolean {
33 | return mSelectionEndEnable
34 | }
35 |
36 | /**
37 | * 是否调用setText后光标默认移动至结尾处
38 | *
39 | * @param selectionEndEnable
40 | * @return
41 | */
42 | fun setSelectionEndEnable(selectionEndEnable: Boolean): T {
43 | mSelectionEndEnable = selectionEndEnable
44 | return back()
45 | }
46 |
47 | fun isSelectionEndOnceEnable(): Boolean {
48 | return mSelectionEndOnceEnable
49 | }
50 |
51 | /**
52 | * 是否调用setText后光标位置移动结尾效果只执行一次setSelectionEndEnable(true)后该方法方有意义
53 | *
54 | * @param selectionEndOnceEnable
55 | * @return
56 | */
57 | fun setSelectionEndOnceEnable(selectionEndOnceEnable: Boolean): T {
58 | mSelectionEndOnceEnable = selectionEndOnceEnable
59 | return back()
60 | }
61 | }
62 |
63 | class RadiusEditTextDelegateImp(editText: EditText, context: Context, attrs: AttributeSet?) :
64 | RadiusEditTextDelegate(editText, context, attrs)
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_bottom_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_bottom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_ios_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
17 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_ios_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
17 |
18 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_left_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_left_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_right_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_right_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_scale_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
22 |
23 |
32 |
33 |
38 |
39 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_scale_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
18 |
19 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_top_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/anim/dialog_top_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/layout/toast_custom_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/mipmap-hdpi/icon_input_del.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/baselibrary/src/main/res/mipmap-hdpi/icon_input_del.png
--------------------------------------------------------------------------------
/baselibrary/src/main/res/mipmap-xhdpi/icon_input_del.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/baselibrary/src/main/res/mipmap-xhdpi/icon_input_del.png
--------------------------------------------------------------------------------
/baselibrary/src/main/res/mipmap-xxhdpi/icon_input_del.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/baselibrary/src/main/res/mipmap-xxhdpi/icon_input_del.png
--------------------------------------------------------------------------------
/baselibrary/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #00000000
5 |
6 | #0cFFFFFF
7 | #22FFFFFF
8 | #33FFFFFF
9 | #44FFFFFF
10 | #66FFFFFF
11 | #88FFFFFF
12 | #99FFFFFF
13 | #BBFFFFFF
14 | #CCFFFFFF
15 | #EEFFFFFF
16 | #FFFFFFFF
17 |
18 | #FF000000
19 | #EE000000
20 | #CC000000
21 | #BB000000
22 | #99000000
23 | #88000000
24 | #66000000
25 | #44000000
26 | #33000000
27 | #22000000
28 | #0c000000
29 |
30 |
31 | #808080
32 |
33 | #FF0000
34 |
35 | #FFD700
36 |
37 | #FFFF00
38 |
39 | #008000
40 |
41 | #0000FF
42 |
43 | #800080
44 |
45 | #FFC0CB
46 |
47 | #FFA500
48 |
49 | #DCDCDC
50 |
51 | #393939
52 | #393939
53 | #969696
54 | #1382FF
55 | #1382FF
56 | #F0F0F0
57 | #FFFFFF
58 | @color/colorLineGray
59 | #e5e3e4
60 |
61 | #c8cccccc
62 |
63 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 10dp
4 | 110dp
5 | 14dp
6 | 48dp
7 | 5dp
8 | 10dp
9 | 2dp
10 | 2dp
11 | 0.5dp
12 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BaseLibrary
3 |
4 |
--------------------------------------------------------------------------------
/baselibrary/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/baselibrary/src/test/java/com/vincent/baselibrary/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.vincent.baselibrary;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | apply from: "config.gradle"
3 | buildscript {
4 | ext.kotlin_version = '1.3.40'
5 | repositories {
6 | google()
7 | jcenter()
8 | maven { url 'https://jitpack.io' }
9 | }
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:3.4.2'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
14 | // classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
15 | // classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
16 | // NOTE: Do not place your application dependencies here; they belong
17 | // in the individual module build.gradle files
18 | }
19 | }
20 |
21 | allprojects {
22 | repositories {
23 | google()
24 | jcenter()
25 | maven { url 'https://jitpack.io' }
26 | }
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/cityPickerUpdateNote.md:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/cityPickerUpdateNote.md
--------------------------------------------------------------------------------
/citypicker/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/citypicker/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 27
5 | buildToolsVersion "28.0.3"
6 | defaultConfig {
7 | minSdkVersion 17
8 | targetSdkVersion 27
9 | versionCode 7
10 | versionName "2.0.4"
11 |
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 |
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(include: ['*.jar'], dir: 'libs')
25 | androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
26 | exclude group: 'com.android.support', module: 'support-annotations'
27 | })
28 | testImplementation 'junit:junit:4.12'
29 | compileOnly 'com.android.support:appcompat-v7:27.1.1'
30 | compileOnly 'com.android.support:recyclerview-v7:27.1.1'
31 | compileOnly 'com.android.support:design:27.1.1'
32 | }
--------------------------------------------------------------------------------
/citypicker/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in F:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/citypicker/src/androidTest/java/com/zaaach/citypicker/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.zaaach.citypicker.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/citypicker/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/citypicker/src/main/assets/china_cities_v2.db:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/citypicker/src/main/assets/china_cities_v2.db
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/adapter/InnerListener.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.adapter;
2 |
3 | import com.zaaach.citypicker.model.City;
4 |
5 | public interface InnerListener {
6 | void dismiss(int position, City data);
7 | void locate();
8 | }
9 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/adapter/OnPickListener.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.adapter;
2 |
3 | import com.zaaach.citypicker.model.City;
4 |
5 | public interface OnPickListener {
6 | void onPick(int position, City data);
7 | void onLocate();
8 | void onCancel();
9 | }
10 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/adapter/decoration/DividerItemDecoration.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.adapter.decoration;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.graphics.Paint;
6 | import android.graphics.Rect;
7 | import android.util.TypedValue;
8 | import android.view.View;
9 | import androidx.recyclerview.widget.RecyclerView;
10 | import com.zaaach.citypicker.R;
11 |
12 | public class DividerItemDecoration extends RecyclerView.ItemDecoration {
13 | private float dividerHeight;
14 | private Paint mPaint;
15 |
16 | public DividerItemDecoration(Context context) {
17 | mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
18 |
19 | TypedValue typedValue = new TypedValue();
20 | context.getTheme().resolveAttribute(R.attr.cpSectionBackground, typedValue, true);
21 | mPaint.setColor(context.getResources().getColor(typedValue.resourceId));
22 | dividerHeight = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 0.5f, context.getResources().getDisplayMetrics());
23 | }
24 |
25 | @Override
26 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
27 | super.getItemOffsets(outRect, view, parent, state);
28 | outRect.bottom = (int) dividerHeight;
29 | }
30 |
31 | @Override
32 | public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) {
33 | int childCount = parent.getChildCount();
34 | int left = parent.getPaddingLeft();
35 | int right = parent.getWidth() - parent.getPaddingRight();
36 |
37 | for (int i = 0; i < childCount - 1; i++) {
38 | View view = parent.getChildAt(i);
39 | float top = view.getBottom();
40 | float bottom = view.getBottom() + dividerHeight;
41 | c.drawRect(left, top, right, bottom, mPaint);
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/adapter/decoration/GridItemDecoration.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.adapter.decoration;
2 |
3 | import android.graphics.Rect;
4 | import android.view.View;
5 | import androidx.recyclerview.widget.RecyclerView;
6 |
7 | public class GridItemDecoration extends RecyclerView.ItemDecoration{
8 | private int mSpanCount;
9 | private int mSpace;
10 |
11 | public GridItemDecoration(int spanCount, int space) {
12 | this.mSpanCount = spanCount;
13 | this.mSpace = space;
14 | }
15 |
16 | @Override
17 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
18 | int position = parent.getChildAdapterPosition(view);
19 | int column = position % mSpanCount;
20 |
21 | outRect.left = column * mSpace / mSpanCount;
22 | outRect.right = mSpace - (column + 1) * mSpace / mSpanCount;
23 | if (position >= mSpanCount) {
24 | outRect.top = mSpace;
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/db/CustomDBManager.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.db;
2 |
3 | import android.content.Context;
4 | import android.database.SQLException;
5 | import android.database.sqlite.SQLiteDatabase;
6 | import android.database.sqlite.SQLiteStatement;
7 | import com.zaaach.citypicker.model.City;
8 |
9 | import java.util.List;
10 |
11 | import static com.zaaach.citypicker.db.DBConfig.LATEST_DB_NAME;
12 | import static com.zaaach.citypicker.db.DBConfig.TABLE_NAME;
13 |
14 | /**
15 | * 创建日期:2019/4/1 0001on 下午 1:46
16 | * 描述:通过List集合接收数据源
17 | * @author Vincent
18 | * QQ:3332168769
19 | * 备注:
20 | */
21 | public class CustomDBManager extends DefaultDBManager {
22 | public CustomDBManager(Context context, List source) {
23 | super(context);
24 | updateDao(source);
25 | }
26 |
27 | private void updateDao(List source) {
28 | SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + LATEST_DB_NAME, null);
29 |
30 | try {
31 | db.delete(TABLE_NAME, null, null);
32 |
33 | db.beginTransaction();
34 | SQLiteStatement stat = db.compileStatement("insert into " + TABLE_NAME + " ('c_name','c_pinyin','c_code','c_province') VALUES (?,?, ?, ?)");
35 | for (int i = 0; i < source.size(); i++) {
36 | City city = source.get(i);
37 | stat.bindString(1, city.getName());
38 | stat.bindString(2, city.getPinyin());
39 | stat.bindString(3, city.getCode());
40 | stat.bindString(4, city.getProvince());
41 | stat.executeInsert();
42 | }
43 | db.setTransactionSuccessful();
44 | } catch (SQLException e) {
45 | e.printStackTrace();
46 | } finally {
47 | db.endTransaction();
48 | db.close();
49 | }
50 | }
51 |
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/db/DBConfig.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.db;
2 |
3 | public class DBConfig {
4 | public static final String DB_NAME_V1 = "china_cities.db";
5 | public static final String DB_NAME_V2 = "china_cities_v2.db";
6 | public static final String LATEST_DB_NAME = DB_NAME_V2;
7 |
8 | public static final String TABLE_NAME = "cities";
9 |
10 | public static final String COLUMN_C_NAME = "c_name";
11 | public static final String COLUMN_C_PROVINCE = "c_province";
12 | public static final String COLUMN_C_PINYIN = "c_pinyin";
13 | public static final String COLUMN_C_CODE = "c_code";
14 | }
15 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/db/DBManager.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.db;
2 |
3 | import android.content.Context;
4 | import android.os.Environment;
5 |
6 | import com.zaaach.citypicker.model.City;
7 |
8 | import java.io.File;
9 | import java.io.FileOutputStream;
10 | import java.io.IOException;
11 | import java.io.InputStream;
12 | import java.io.OutputStream;
13 | import java.util.Comparator;
14 | import java.util.List;
15 |
16 | import static com.zaaach.citypicker.db.DBConfig.DB_NAME_V1;
17 | import static com.zaaach.citypicker.db.DBConfig.LATEST_DB_NAME;
18 |
19 | public abstract class DBManager {
20 | public static final int BUFFER_SIZE = 1024;
21 |
22 | public String DB_PATH;
23 | public Context mContext;
24 |
25 | public DBManager(Context context) {
26 | this.mContext = context;
27 | DB_PATH = File.separator + "data"
28 | + Environment.getDataDirectory().getAbsolutePath() + File.separator
29 | + context.getPackageName() + File.separator + "databases" + File.separator;
30 | copyDBFile();
31 | }
32 |
33 | public void copyDBFile() {
34 | File dir = new File(DB_PATH);
35 | if (!dir.exists()) {
36 | dir.mkdirs();
37 | }
38 |
39 | createDbFile(LATEST_DB_NAME);
40 | }
41 |
42 | public void createDbFile(String tbName) {
43 | //创建新版本数据库
44 | File dbFile = new File(DB_PATH + tbName);
45 | if (!dbFile.exists()) {
46 | InputStream is;
47 | OutputStream os;
48 | try {
49 | is = mContext.getAssets().open(tbName);
50 | // mContext.getResources().getAssets().open(tbName);
51 | os = new FileOutputStream(dbFile);
52 | byte[] buffer = new byte[BUFFER_SIZE];
53 | int length;
54 | while ((length = is.read(buffer, 0, buffer.length)) > 0) {
55 | os.write(buffer, 0, length);
56 | }
57 | os.flush();
58 | os.close();
59 | is.close();
60 | } catch (IOException e) {
61 | e.printStackTrace();
62 | }
63 | }
64 | }
65 |
66 | public abstract List getAllCities();
67 |
68 | public abstract List searchCity(final String keyword);
69 |
70 | /**
71 | * sort by a-z
72 | */
73 | public class CityComparator implements Comparator {
74 | @Override
75 | public int compare(City lhs, City rhs) {
76 | String a = lhs.getPinyin().substring(0, 1);
77 | String b = rhs.getPinyin().substring(0, 1);
78 | return a.compareTo(b);
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/db/DefaultDBManager.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.db;
2 |
3 | import android.content.Context;
4 | import android.database.Cursor;
5 | import android.database.sqlite.SQLiteDatabase;
6 |
7 | import com.zaaach.citypicker.model.City;
8 |
9 | import java.io.File;
10 | import java.util.ArrayList;
11 | import java.util.Collections;
12 | import java.util.List;
13 |
14 | import static com.zaaach.citypicker.db.DBConfig.COLUMN_C_CODE;
15 | import static com.zaaach.citypicker.db.DBConfig.COLUMN_C_NAME;
16 | import static com.zaaach.citypicker.db.DBConfig.COLUMN_C_PINYIN;
17 | import static com.zaaach.citypicker.db.DBConfig.COLUMN_C_PROVINCE;
18 | import static com.zaaach.citypicker.db.DBConfig.DB_NAME_V1;
19 | import static com.zaaach.citypicker.db.DBConfig.LATEST_DB_NAME;
20 | import static com.zaaach.citypicker.db.DBConfig.TABLE_NAME;
21 |
22 | /**
23 | * @author Vincent
24 | */
25 | public class DefaultDBManager extends DBManager {
26 |
27 |
28 | public DefaultDBManager(Context context) {
29 | super(context);
30 | //如果旧版数据库存在,则删除
31 | File dbV1 = new File(DB_PATH + DB_NAME_V1);
32 | if (dbV1.exists()) {
33 | dbV1.delete();
34 | }
35 | }
36 |
37 |
38 | public List getAllCities() {
39 | SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + LATEST_DB_NAME, null);
40 | Cursor cursor = db.rawQuery("select * from " + TABLE_NAME, null);
41 | List result = new ArrayList<>();
42 | City city;
43 | while (cursor.moveToNext()) {
44 | String name = cursor.getString(cursor.getColumnIndex(COLUMN_C_NAME));
45 | String province = cursor.getString(cursor.getColumnIndex(COLUMN_C_PROVINCE));
46 | String pinyin = cursor.getString(cursor.getColumnIndex(COLUMN_C_PINYIN));
47 | String code = cursor.getString(cursor.getColumnIndex(COLUMN_C_CODE));
48 | city = new City(name, province, pinyin, code);
49 | result.add(city);
50 | }
51 | cursor.close();
52 | db.close();
53 | Collections.sort(result, new CityComparator());
54 | return result;
55 | }
56 |
57 | public List searchCity(final String keyword) {
58 | String sql = "select * from " + TABLE_NAME + " where "
59 | + COLUMN_C_NAME + " like ? " + "or "
60 | + COLUMN_C_PINYIN + " like ? ";
61 | SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + LATEST_DB_NAME, null);
62 | Cursor cursor = db.rawQuery(sql, new String[]{"%" + keyword + "%", keyword + "%"});
63 |
64 | List result = new ArrayList<>();
65 | while (cursor.moveToNext()) {
66 | String name = cursor.getString(cursor.getColumnIndex(COLUMN_C_NAME));
67 | String province = cursor.getString(cursor.getColumnIndex(COLUMN_C_PROVINCE));
68 | String pinyin = cursor.getString(cursor.getColumnIndex(COLUMN_C_PINYIN));
69 | String code = cursor.getString(cursor.getColumnIndex(COLUMN_C_CODE));
70 | City city = new City(name, province, pinyin, code);
71 | result.add(city);
72 | }
73 | cursor.close();
74 | db.close();
75 | CityComparator comparator = new CityComparator();
76 | Collections.sort(result, comparator);
77 | return result;
78 | }
79 |
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/model/City.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.model;
2 |
3 | import android.text.TextUtils;
4 |
5 | import java.util.regex.Matcher;
6 | import java.util.regex.Pattern;
7 |
8 | /**
9 | * author Bro0cL on 2016/1/26.
10 | */
11 | public class City {
12 | private String name;
13 | private String province;
14 | private String pinyin;
15 | private String code;
16 |
17 | public City(String name, String province, String pinyin, String code) {
18 | this.name = name;
19 | this.province = province;
20 | this.pinyin = pinyin;
21 | this.code = code;
22 | }
23 |
24 | /***
25 | * 获取悬浮栏文本,(#、定位、热门 需要特殊处理)
26 | * @return
27 | */
28 | public String getSection(){
29 | if (TextUtils.isEmpty(pinyin)) {
30 | return "#";
31 | } else {
32 | String c = pinyin.substring(0, 1);
33 | Pattern p = Pattern.compile("[a-zA-Z]");
34 | Matcher m = p.matcher(c);
35 | if (m.matches()) {
36 | return c.toUpperCase();
37 | }
38 | //在添加定位和热门数据时设置的section就是‘定’、’热‘开头
39 | else if (TextUtils.equals(c, "定") || TextUtils.equals(c, "热"))
40 | return pinyin;
41 | else
42 | return "#";
43 | }
44 | }
45 |
46 | public String getName() {
47 | return name;
48 | }
49 |
50 | public void setName(String name) {
51 | this.name = name;
52 | }
53 |
54 | public String getPinyin() {
55 | return pinyin;
56 | }
57 |
58 | public void setPinyin(String pinyin) {
59 | this.pinyin = pinyin;
60 | }
61 |
62 | public String getProvince() {
63 | return province;
64 | }
65 |
66 | public void setProvince(String province) {
67 | this.province = province;
68 | }
69 |
70 | public String getCode() {
71 | return code;
72 | }
73 |
74 | public void setCode(String code) {
75 | this.code = code;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/model/HotCity.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.model;
2 |
3 | public class HotCity extends City {
4 |
5 | public HotCity(String name, String province, String code) {
6 | super(name, province, "热门城市", code);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/model/LocateState.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.model;
2 |
3 |
4 |
5 | import androidx.annotation.IntDef;
6 |
7 | import java.lang.annotation.Retention;
8 | import java.lang.annotation.RetentionPolicy;
9 |
10 | public class LocateState {
11 | public static final int LOCATING = 123;
12 | public static final int SUCCESS = 132;
13 | public static final int FAILURE = 321;
14 |
15 | @IntDef({SUCCESS, FAILURE})
16 | @Retention(RetentionPolicy.SOURCE)
17 | public @interface State{}
18 | }
19 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/model/LocatedCity.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.model;
2 |
3 | public class LocatedCity extends City {
4 |
5 | public LocatedCity(String name, String province, String code) {
6 | super(name, province, "定位城市", code);
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/citypicker/src/main/java/com/zaaach/citypicker/util/ScreenUtil.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker.util;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.res.Configuration;
6 | import android.content.res.Resources;
7 | import android.os.Build;
8 | import android.provider.Settings;
9 | import android.util.DisplayMetrics;
10 | import android.view.Display;
11 | import android.view.WindowManager;
12 |
13 | /**
14 | * @Author: Bro0cL
15 | * @Date: 2018/12/4 11:35
16 | * @Discription:
17 | */
18 | public class ScreenUtil {
19 |
20 | private static int getInternalDimensionSize(Context context, String key) {
21 | int result = 0;
22 | try {
23 | int resourceId = context.getResources().getIdentifier(key, "dimen", "android");
24 | if (resourceId > 0) {
25 | result = Math.round(context.getResources().getDimensionPixelSize(resourceId) *
26 | Resources.getSystem().getDisplayMetrics().density /
27 | context.getResources().getDisplayMetrics().density);
28 | }
29 | } catch (Resources.NotFoundException ignored) {
30 | return 0;
31 | }
32 | return result;
33 | }
34 |
35 | public static int getStatusBarHeight(Context context){
36 | return getInternalDimensionSize(context, "status_bar_height");
37 | }
38 |
39 | public static int getNavigationBarHeight(Context context) {
40 | boolean mInPortrait = context.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT;
41 | int result = 0;
42 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
43 | if (hasNavBar((Activity) context)) {
44 | String key;
45 | if (mInPortrait) {
46 | key = "navigation_bar_height";
47 | } else {
48 | key = "navigation_bar_height_landscape";
49 | }
50 | return getInternalDimensionSize(context, key);
51 | }
52 | }
53 | return result;
54 | }
55 |
56 | private static boolean hasNavBar(Activity activity) {
57 | //判断小米手机是否开启了全面屏,开启了,直接返回false
58 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
59 | if (Settings.Global.getInt(activity.getContentResolver(), "force_fsg_nav_bar", 0) != 0) {
60 | return false;
61 | }
62 | }
63 | //其他手机根据屏幕真实高度与显示高度是否相同来判断
64 | WindowManager windowManager = activity.getWindowManager();
65 | Display d = windowManager.getDefaultDisplay();
66 |
67 | DisplayMetrics realDisplayMetrics = new DisplayMetrics();
68 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
69 | d.getRealMetrics(realDisplayMetrics);
70 | }
71 |
72 | int realHeight = realDisplayMetrics.heightPixels;
73 | int realWidth = realDisplayMetrics.widthPixels;
74 |
75 | DisplayMetrics displayMetrics = new DisplayMetrics();
76 | d.getMetrics(displayMetrics);
77 |
78 | int displayHeight = displayMetrics.heightPixels;
79 | int displayWidth = displayMetrics.widthPixels;
80 |
81 | return (realWidth - displayWidth) > 0 || (realHeight - displayHeight) > 0;
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/anim/cp_push_bottom_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/anim/cp_push_bottom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/drawable/cp_grid_item_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/drawable/cp_overlay_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
12 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/layout/cp_dialog_city_picker.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
12 |
13 |
18 |
19 |
29 |
30 |
31 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/layout/cp_empty_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
14 |
15 |
21 |
22 |
30 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/layout/cp_grid_item_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/layout/cp_list_item_default_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/layout/cp_list_item_hot_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/layout/cp_list_item_location_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
27 |
28 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/layout/cp_search_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
25 |
26 |
34 |
35 |
38 |
39 |
43 |
44 |
47 |
48 |
55 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/mipmap-xxhdpi/cp_icon_clear_all.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/citypicker/src/main/res/mipmap-xxhdpi/cp_icon_clear_all.png
--------------------------------------------------------------------------------
/citypicker/src/main/res/mipmap-xxhdpi/cp_icon_empty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/citypicker/src/main/res/mipmap-xxhdpi/cp_icon_empty.png
--------------------------------------------------------------------------------
/citypicker/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #3F51B5
6 |
7 | #cdcdcd
8 | #999999
9 | #666666
10 | #333333
11 | #EDEDED
12 | #f5f5f5
13 |
14 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 |
5 | 36dp
6 | 13sp
7 |
8 | 15sp
9 | 15sp
10 |
11 | 56dp
12 | 56dp
13 | 14sp
14 |
15 | 32dp
16 | 15sp
17 |
18 | 50dp
19 | 15sp
20 |
21 | 16dp
22 | 10dp
23 |
24 | 100dp
25 | 100dp
26 | 28sp
27 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | CityPicker
3 | 城市中文名或拼音
4 | 取消
5 | 没有找到,换个词试试~
6 | 定位失败
7 | 正在定位…
8 |
9 |
--------------------------------------------------------------------------------
/citypicker/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
20 |
21 |
61 |
62 |
--------------------------------------------------------------------------------
/citypicker/src/test/java/com/zaaach/citypicker/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.zaaach.citypicker;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/config.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 | // Sdk and tools
3 | targetSdkVersion = 28
4 | compileSdkVersion = 28
5 | minSdkVersion = 21
6 | // Google Support
7 | appcompat = '1.1.0-alpha01'
8 | core = '1.1.0-alpha01'
9 | constraintlayout = '1.1.2'
10 | supportV4 = '1.0.0-beta01'
11 | junit = '4.13-beta-3'
12 | runner = '1.3.0-alpha01'
13 | espressoCore = '3.3.0-alpha01'
14 |
15 | // Retrofit
16 | retrofit = '2.6.0'
17 | gson = '2.6.0'
18 |
19 | // 状态栏
20 | statusbarutil = '1.5.1'
21 | // 页面侧滑
22 | swipebacklayout = '1.2.0@aar'
23 | // 键对值存储
24 | hawk = '2.0.1'
25 | // Jetpack navigation
26 | nav_version = '1.0.0'
27 | // jetpack LifeRecycler
28 | lifecycle_version = '2.2.0-alpha02'
29 | // 滑动选择对话框
30 | WheelPicker = '1.5.6'
31 | // RecyclerView
32 | recyclerview = '1.0.0'
33 | // 工具库
34 | EasyAndroid = '1.2.5'
35 | // adapter
36 | BaseRecyclerViewAdapterHelper = '2.9.46'
37 | // autosize 屏幕适配
38 | autosize = '1.1.2'
39 | // 选择城市
40 | // citypicker = '2.0.3'
41 | // banner
42 | mzBanner = 'v2.0.2'
43 | glide = '4.9.0'
44 |
45 | //版本更新
46 | updatePlugin = '3.1.2'
47 | // 扫一扫
48 | zxing = '2.1.3'
49 | // EventBus
50 | eventbus = '3.1.1'
51 | }
--------------------------------------------------------------------------------
/doc/NetworkExceptionChecking.md:
--------------------------------------------------------------------------------
1 | ### 网络监测工具类
2 |
3 | 一般做法是通过广播接收系统网络变化的通知,然后在```UI```页面中做相应的提示,但是这里使用```NetworkRequest.Builder```来实现,向下兼容到 Android 5.0,具体使用如下:
4 | * 注册全局网络监测(建议在```APPlication```中实例化)
5 |
6 | ```
7 | // 网络监听
8 | NetUtils.netWorkListener(this)
9 | ```
10 | * 进入```UI```(可见状态)前检查网络
11 | ```
12 | override fun onResume() {
13 | super.onResume()
14 | checkNetWork(NetUtils.isConnected)
15 | }
16 |
17 | // 检查网络
18 | private fun checkNetWork(isConnected: Boolean) {
19 | if (isConnected) {
20 | // 当网络连接时显示UI等操作
21 | if (netErrorView.parent != null) {
22 | mWindowManager.removeViewImmediate(netErrorView)
23 | netErrorView.setOnClickListener(null)
24 | }
25 | } else {
26 | // 当网络断开时显示UI等操作
27 | if (netErrorView.parent == null) {
28 | mWindowManager.addView(netErrorView, mLayoutParams)
29 | initErrorViewEvent()
30 | }
31 | }
32 | }
33 |
34 | ```
35 |
36 | * 实时检测
37 | ```
38 |
39 | @Subscribe(threadMode = ThreadMode.MAIN)
40 | fun onNetworkChangeEvent(event: NetworkChangeEvent) {
41 | this.checkNetWork(event.isConnected)
42 | }
43 |
44 |
45 | ```
46 | [使用示例](https://github.com/Vicent9920/BaseProject/blob/master/app/src/main/java/com/vincent/baseproject/common/UIActivity.kt)
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
22 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Jul 13 10:24:08 CST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/screenCapture/checkVersion.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/checkVersion.jpg
--------------------------------------------------------------------------------
/screenCapture/cityPicker.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/cityPicker.jpg
--------------------------------------------------------------------------------
/screenCapture/fileDownload.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/fileDownload.jpg
--------------------------------------------------------------------------------
/screenCapture/installTip.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/installTip.jpg
--------------------------------------------------------------------------------
/screenCapture/netError.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/netError.gif
--------------------------------------------------------------------------------
/screenCapture/radiusView1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/radiusView1.png
--------------------------------------------------------------------------------
/screenCapture/radiusView2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/radiusView2.png
--------------------------------------------------------------------------------
/screenCapture/radiusView3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/radiusView3.png
--------------------------------------------------------------------------------
/screenCapture/scan.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/scan.jpg
--------------------------------------------------------------------------------
/screenCapture/scanResult.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/scanResult.jpg
--------------------------------------------------------------------------------
/screenCapture/selectDate.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/selectDate.png
--------------------------------------------------------------------------------
/screenCapture/setting.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/setting.jpg
--------------------------------------------------------------------------------
/screenCapture/spaceLayout.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/spaceLayout.gif
--------------------------------------------------------------------------------
/screenCapture/tab1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/tab1.jpg
--------------------------------------------------------------------------------
/screenCapture/tab2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/tab2.jpg
--------------------------------------------------------------------------------
/screenCapture/tab3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/tab3.jpg
--------------------------------------------------------------------------------
/screenCapture/tab4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Vicent9920/BaseProject/cbc262ed79dc301e73d29f63c478e28f2ffec6f8/screenCapture/tab4.jpg
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':baselibrary', ':citypicker'
2 |
--------------------------------------------------------------------------------