├── .gitattributes ├── .gradle ├── 4.1 │ ├── fileChanges │ │ └── last-build.bin │ ├── fileContent │ │ └── fileContent.lock │ ├── fileHashes │ │ ├── fileHashes.bin │ │ ├── fileHashes.lock │ │ └── resourceHashesCache.bin │ ├── javaCompile │ │ ├── classAnalysis.bin │ │ ├── jarAnalysis.bin │ │ ├── javaCompile.lock │ │ ├── taskHistory.bin │ │ └── taskJars.bin │ └── taskHistory │ │ ├── fileSnapshots.bin │ │ ├── taskHistory.bin │ │ └── taskHistory.lock └── buildOutputCleanup │ ├── built.bin │ ├── cache.properties │ └── cache.properties.lock ├── .idea ├── gradle.xml ├── libraries │ ├── __local_aars___F__android_work_x_android_app_libs_sukeinte1_2_jar_unspecified_jar.xml │ ├── com_android_support_animated_vector_drawable_25_3_1.xml │ ├── com_android_support_appcompat_v7_25_3_1.xml │ ├── com_android_support_constraint_constraint_layout_1_0_2.xml │ ├── com_android_support_constraint_constraint_layout_solver_1_0_2_jar.xml │ ├── com_android_support_design_25_3_1.xml │ ├── com_android_support_recyclerview_v7_25_3_1.xml │ ├── com_android_support_support_annotations_25_3_1_jar.xml │ ├── com_android_support_support_compat_25_3_1.xml │ ├── com_android_support_support_core_ui_25_3_1.xml │ ├── com_android_support_support_core_utils_25_3_1.xml │ ├── com_android_support_support_fragment_25_3_1.xml │ ├── com_android_support_support_media_compat_25_3_1.xml │ ├── com_android_support_support_v4_25_3_1.xml │ ├── com_android_support_support_vector_drawable_25_3_1.xml │ ├── com_android_support_transition_25_3_1.xml │ ├── com_blankj_utilcode_1_11_1.xml │ ├── com_github_bumptech_glide_glide_3_7_0_jar.xml │ ├── com_github_limedroid_ARecyclerView_v1_1_5.xml │ ├── com_github_limedroid_XStateController_v1_1_1.xml │ ├── com_google_code_findbugs_jsr305_3_0_1_jar.xml │ ├── com_google_code_gson_gson_2_7_jar.xml │ ├── com_jakewharton_butterknife_8_4_0.xml │ ├── com_jakewharton_butterknife_annotations_8_4_0_jar.xml │ ├── com_nineoldandroids_library_2_4_0_jar.xml │ ├── com_squareup_okhttp3_okhttp_3_6_0_jar.xml │ ├── com_squareup_okio_okio_1_11_0_jar.xml │ ├── com_squareup_retrofit2_adapter_rxjava2_2_2_0_jar.xml │ ├── com_squareup_retrofit2_converter_gson_2_2_0_jar.xml │ ├── com_squareup_retrofit2_retrofit_2_2_0_jar.xml │ ├── com_tapadoo_android_alerter_2_0_2.xml │ ├── com_tbruyelle_rxpermissions2_rxpermissions_0_9_3.xml │ ├── com_trello_rxlifecycle2_rxlifecycle_2_0_1_jar.xml │ ├── com_trello_rxlifecycle2_rxlifecycle_android_2_0_1.xml │ ├── com_trello_rxlifecycle2_rxlifecycle_components_2_0_1.xml │ ├── com_wang_avi_library_1_0_2.xml │ ├── com_yanzhenjie_alertdialog_alertdialog_1_0_1.xml │ ├── com_yanzhenjie_permission_1_1_2.xml │ ├── io_reactivex_rxjava2_rxandroid_2_0_1.xml │ ├── io_reactivex_rxjava2_rxjava_2_0_1_jar.xml │ ├── org_greenrobot_eventbus_3_0_0_jar.xml │ └── org_reactivestreams_reactive_streams_1_0_0_jar.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── workspace.xml ├── README.md ├── app ├── app.iml ├── build.gradle ├── libs │ └── sukeinte1.2.jar ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── suke │ │ └── czx │ │ └── demo │ │ ├── App.java │ │ ├── AppConstant.java │ │ ├── AppSetting.java │ │ ├── base │ │ ├── AppBaseResult.java │ │ ├── BaseActivity.java │ │ ├── BaseFragment.java │ │ └── BaseLazyFragment.java │ │ ├── interceptor │ │ └── DataInterceptor.java │ │ ├── kit │ │ └── AppKit.java │ │ ├── model │ │ └── user │ │ │ ├── TokenEntity.java │ │ │ └── UserEntity.java │ │ ├── net │ │ ├── Api.java │ │ └── Service.java │ │ ├── present │ │ └── user │ │ │ └── LoginPresent.java │ │ ├── ui │ │ └── LoginActivity.java │ │ ├── utils │ │ └── PageUtils.java │ │ └── widget │ │ ├── AlertView.java │ │ ├── DialogLoading.java │ │ └── StateView.java │ └── res │ ├── drawable-v21 │ ├── dialog_alert_bg.xml │ ├── item_part_touch.xml │ └── loading_dialog_background.xml │ ├── drawable │ ├── ic_arrow_white_24dp.xml │ ├── ic_keyboard_arrow_right_green_24dp.xml │ ├── ic_person_black_24dp.xml │ ├── ic_save_white_24dp.xml │ ├── ic_share_white_24dp.xml │ ├── item_part_touch.xml │ ├── view_border.xml │ └── view_shadow.xml │ ├── layout │ ├── activity_login.xml │ ├── layout_dialog_loading.xml │ ├── layout_upkeep_admin_management_popup_window.xml │ ├── view_loading.xml │ ├── view_state.xml │ ├── view_toolbar.xml │ └── view_toolbar_defined.xml │ ├── menu │ ├── menu_main.xml │ └── menu_web.xml │ ├── mipmap-hdpi │ └── ic_launcher.png │ ├── mipmap-mdpi │ └── ic_launcher.png │ ├── mipmap-xhdpi │ ├── back_btn.png │ ├── ic_error.png │ ├── ic_launcher.png │ └── xdroid_logo_128.png │ ├── mipmap-xxhdpi │ └── ic_launcher.png │ ├── mipmap-xxxhdpi │ └── ic_launcher.png │ ├── values-w820dp │ └── dimens.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── conf.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── local.properties ├── mvp ├── build.gradle ├── mvp.iml ├── proguard-pro │ ├── proguard-ARecyclerView.pro │ ├── proguard-avi-loading.pro │ ├── proguard-butterknife.pro │ ├── proguard-canary-debug.pro │ ├── proguard-canary-release.pro │ ├── proguard-constraint-layout.pro │ ├── proguard-design.pro │ ├── proguard-eventbus-3.pro │ ├── proguard-eventbus.pro │ ├── proguard-glide.pro │ ├── proguard-google-gson.pro │ ├── proguard-normal.pro │ ├── proguard-okhttp3-logging-interceptor.pro │ ├── proguard-okhttp3.pro │ ├── proguard-picasso.pro │ ├── proguard-proguard-design.pro │ ├── proguard-recyclerview-v7.pro │ ├── proguard-retrofit-adapter-rxjava.pro │ ├── proguard-retrofit-converter-gson.pro │ ├── proguard-retrofit.pro │ ├── proguard-rxandroid.pro │ ├── proguard-rxjava.pro │ ├── proguard-rxlifecycle-android.pro │ ├── proguard-rxlifecycle-components.pro │ ├── proguard-rxlifecycle.pro │ ├── proguard-rxpermissions.pro │ ├── proguard-self.pro │ ├── proguard-support-v4.pro │ └── proguard-support-v7-appcompat.pro ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── cn │ │ └── droidlover │ │ └── xdroidmvp │ │ ├── XDroidConf.java │ │ ├── base │ │ ├── ListItemCallback.java │ │ ├── SimpleListAdapter.java │ │ ├── SimpleRecAdapter.java │ │ ├── XFragmentAdapter.java │ │ └── XListAdapter.java │ │ ├── cache │ │ ├── DiskCache.java │ │ ├── DiskLruCache.java │ │ ├── ICache.java │ │ ├── MemoryCache.java │ │ └── SharedPref.java │ │ ├── event │ │ ├── BusProvider.java │ │ ├── IBus.java │ │ └── RxBusImpl.java │ │ ├── imageloader │ │ ├── GlideLoader.java │ │ ├── ILFactory.java │ │ ├── ILoader.java │ │ └── LoadCallback.java │ │ ├── kit │ │ ├── Codec.java │ │ ├── Kits.java │ │ ├── KnifeKit.java │ │ └── SimpleCallback.java │ │ ├── log │ │ ├── LogFormat.java │ │ ├── XLog.java │ │ └── XPrinter.java │ │ ├── mvp │ │ ├── IPresent.java │ │ ├── IView.java │ │ ├── LazyFragment.java │ │ ├── VDelegate.java │ │ ├── VDelegateBase.java │ │ ├── XActivity.java │ │ ├── XFragment.java │ │ ├── XLazyFragment.java │ │ └── XPresent.java │ │ ├── net │ │ ├── ApiSubscriber.java │ │ ├── Https.java │ │ ├── IModel.java │ │ ├── LogInterceptor.java │ │ ├── NetError.java │ │ ├── NetProvider.java │ │ ├── RequestHandler.java │ │ ├── XApi.java │ │ ├── XInterceptor.java │ │ ├── cookie │ │ │ ├── CookieJarImpl.java │ │ │ ├── CookieStore.java │ │ │ ├── HasCookieStore.java │ │ │ ├── MemoryCookieStore.java │ │ │ ├── PersistentCookieStore.java │ │ │ └── SerializableHttpCookie.java │ │ └── progress │ │ │ ├── ProRequestBody.java │ │ │ ├── ProResponseBody.java │ │ │ ├── ProgressHelper.java │ │ │ └── ProgressListener.java │ │ └── router │ │ ├── Router.java │ │ ├── RouterCallback.java │ │ └── SimpleRouterCallback.java │ └── res │ └── values │ └── strings.xml ├── pic ├── demo_video.mp4 ├── img1.png └── img2.png ├── settings.gradle └── x_android.iml /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gradle/4.1/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/4.1/fileContent/fileContent.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/fileContent/fileContent.lock -------------------------------------------------------------------------------- /.gradle/4.1/fileHashes/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/fileHashes/fileHashes.bin -------------------------------------------------------------------------------- /.gradle/4.1/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/4.1/fileHashes/resourceHashesCache.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/fileHashes/resourceHashesCache.bin -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/classAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/javaCompile/classAnalysis.bin -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/jarAnalysis.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/javaCompile/jarAnalysis.bin -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/javaCompile.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/javaCompile/javaCompile.lock -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/javaCompile/taskHistory.bin -------------------------------------------------------------------------------- /.gradle/4.1/javaCompile/taskJars.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/javaCompile/taskJars.bin -------------------------------------------------------------------------------- /.gradle/4.1/taskHistory/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/taskHistory/fileSnapshots.bin -------------------------------------------------------------------------------- /.gradle/4.1/taskHistory/taskHistory.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/taskHistory/taskHistory.bin -------------------------------------------------------------------------------- /.gradle/4.1/taskHistory/taskHistory.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/4.1/taskHistory/taskHistory.lock -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/built.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/.gradle/buildOutputCleanup/built.bin -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Jan 29 08:51:15 CST 2018 2 | gradle.version=4.1 3 | -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties.lock: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/__local_aars___F__android_work_x_android_app_libs_sukeinte1_2_jar_unspecified_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_animated_vector_drawable_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_appcompat_v7_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_constraint_constraint_layout_1_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_constraint_constraint_layout_solver_1_0_2_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_design_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_recyclerview_v7_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_annotations_25_3_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_compat_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_core_ui_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_core_utils_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_fragment_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_media_compat_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_v4_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_support_vector_drawable_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_android_support_transition_25_3_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_blankj_utilcode_1_11_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_github_bumptech_glide_glide_3_7_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_github_limedroid_ARecyclerView_v1_1_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_github_limedroid_XStateController_v1_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_google_code_findbugs_jsr305_3_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_google_code_gson_gson_2_7_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_jakewharton_butterknife_8_4_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_jakewharton_butterknife_annotations_8_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_nineoldandroids_library_2_4_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_squareup_okhttp3_okhttp_3_6_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_squareup_okio_okio_1_11_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_squareup_retrofit2_adapter_rxjava2_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_squareup_retrofit2_converter_gson_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_squareup_retrofit2_retrofit_2_2_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_tapadoo_android_alerter_2_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_tbruyelle_rxpermissions2_rxpermissions_0_9_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_trello_rxlifecycle2_rxlifecycle_2_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/com_trello_rxlifecycle2_rxlifecycle_android_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_trello_rxlifecycle2_rxlifecycle_components_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_wang_avi_library_1_0_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_yanzhenjie_alertdialog_alertdialog_1_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/com_yanzhenjie_permission_1_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/io_reactivex_rxjava2_rxandroid_2_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/io_reactivex_rxjava2_rxjava_2_0_1_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/org_greenrobot_eventbus_3_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/libraries/org_reactivestreams_reactive_streams_1_0_0_jar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | 33 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **项目说明** 2 | - X-Android 是一个轻量级的android快速开发框架 ,基于 《XDroid》 项目的修改而来, 3 | 4 | - 与 《X-SpringBoot》 后台开发框架完美结合使用,请求与响应数据来回加密 5 | 6 |
7 | 8 | ![image](https://github.com/yzcheng90/x-android/blob/master/pic/img1.png) 9 | 10 | >项目示例图 11 | [![Watch the video](https://github.com/yzcheng90/x-android/blob/master/pic/img2.png)](https://github.com/yzcheng90/x-android/blob/master/pic/demo_video.mp4) 12 | 13 | 14 | 15 | 16 | - 本人QQ:913624256 17 | 如果喜欢,记得star fork 谢谢您的关注 x_android会持续维护 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion rootProject.ext.android.compileSdkVersion 5 | buildToolsVersion rootProject.ext.android.buildToolsVersion 6 | 7 | defaultConfig { 8 | applicationId 'com.suke.czx.demo' 9 | minSdkVersion rootProject.ext.android.minSdkVersion 10 | targetSdkVersion rootProject.ext.android.targetSdkVersion 11 | versionCode rootProject.ext.android.versionCode 12 | versionName rootProject.ext.android.versionName 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | 24 | dependencies { 25 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 26 | compile fileTree(dir: 'libs', include: ['*.jar']) 27 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' 28 | compile rootProject.ext.dependencies["avi-loading"] 29 | compile 'com.blankj:utilcode:1.11.1' 30 | compile 'com.tapadoo.android:alerter:2.0.2' 31 | compile 'com.yanzhenjie:permission:1.1.2' 32 | compile project(":mvp") 33 | } 34 | -------------------------------------------------------------------------------- /app/libs/sukeinte1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yzcheng90/x-android/f3b87065a4ca2b6dd31463f8302109ea9bc0a6d5/app/libs/sukeinte1.2.jar -------------------------------------------------------------------------------- /app/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 /Users/wanglei/DevTools/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 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/App.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo; 2 | 3 | import android.app.Activity; 4 | import android.app.Application; 5 | import android.content.Context; 6 | import com.blankj.utilcode.util.Utils; 7 | import com.suke.czx.demo.interceptor.DataInterceptor; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | import cn.droidlover.xdroidmvp.net.NetError; 13 | import cn.droidlover.xdroidmvp.net.NetProvider; 14 | import cn.droidlover.xdroidmvp.net.RequestHandler; 15 | import cn.droidlover.xdroidmvp.net.XApi; 16 | import okhttp3.CookieJar; 17 | import okhttp3.Interceptor; 18 | import okhttp3.OkHttpClient; 19 | 20 | /** 21 | * Created by czx on 2017/1/29. 22 | */ 23 | 24 | public class App extends Application { 25 | 26 | private static Context context; 27 | private static List activityList = new ArrayList<>(); 28 | 29 | @Override 30 | public void onCreate() { 31 | super.onCreate(); 32 | context = this; 33 | 34 | Utils.init(this); 35 | 36 | XApi.registerProvider(new NetProvider() { 37 | 38 | @Override 39 | public Interceptor[] configInterceptors() { 40 | return new Interceptor[]{new DataInterceptor()}; 41 | } 42 | 43 | @Override 44 | public void configHttps(OkHttpClient.Builder builder) { 45 | 46 | } 47 | 48 | @Override 49 | public CookieJar configCookie() { 50 | return null; 51 | } 52 | 53 | @Override 54 | public RequestHandler configHandler() { 55 | return null; 56 | } 57 | 58 | @Override 59 | public long configConnectTimeoutMills() { 60 | return 0; 61 | } 62 | 63 | @Override 64 | public long configReadTimeoutMills() { 65 | return 0; 66 | } 67 | 68 | @Override 69 | public boolean configLogEnable() { 70 | return true; 71 | } 72 | 73 | @Override 74 | public boolean handleError(NetError error) { 75 | return false; 76 | } 77 | 78 | @Override 79 | public boolean dispatchProgressEnable() { 80 | return false; 81 | } 82 | }); 83 | } 84 | 85 | public static Context getContext() { 86 | return context; 87 | } 88 | 89 | public static void addActivity(Activity activity){ 90 | activityList.add(activity); 91 | } 92 | 93 | public static void removeActivity(Activity activity){ 94 | activityList.remove(activity); 95 | } 96 | 97 | public static void closeAllActivity(){ 98 | for (Activity activity : activityList){ 99 | if(activity != null){ 100 | activity.finish(); 101 | } 102 | } 103 | activityList.clear(); 104 | AppSetting.Initial(context).removePreferences(AppConstant.USER_INFO); 105 | } 106 | 107 | public static List getActivityList(){ 108 | return activityList; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/AppConstant.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo; 2 | 3 | /** 4 | * Created by czx on 2017/7/13. 5 | */ 6 | 7 | public class AppConstant { 8 | 9 | public final static String PROJECT_NAME = "psm_mobile/"; 10 | public final static String URL_HELLO = "api/root/check"; 11 | 12 | public final static String DEBUG_URL = "http://192.168.0.133:8080/x_springboot/"; 13 | 14 | // ==================setting============// 15 | public static final String IS_FIRST_INSTALL = "is_first_install"; 16 | public static final String API_URL_INFO = "api_url_info"; 17 | public static final String SETTING_NAME = "mobile_app_config"; 18 | public static final String USER_INFO = "user_info"; 19 | public static final String USER_TYPE = "user_type"; 20 | public static final String USER_STAFF_INFO = "user_staff_info"; 21 | public static final String USER_TOKEN = "user_token"; 22 | public static final String USER_NAME_PASSWORD = "user_name_password"; 23 | public static final String SERVICE_IP = "service_ip"; 24 | public static final String SERVICE_PORT = "service_port"; 25 | public static final int PAGESIZE = 10; 26 | public static final int PAGE_INDEX = 1; 27 | 28 | public static final boolean IS_LOCAL_DEBUG = true; 29 | 30 | 31 | } 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/AppSetting.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | 6 | /** 7 | * Created by czx on 2017/7/13. 8 | */ 9 | 10 | public class AppSetting { 11 | 12 | private static Context context; 13 | private static SharedPreferences sharedPreferences; 14 | private static SharedPreferences.Editor editor; 15 | private static AppSetting instance; 16 | 17 | public static AppSetting Initial(Context inContext) { 18 | context = inContext; 19 | sharedPreferences = context.getSharedPreferences(AppConstant.SETTING_NAME, Context.MODE_PRIVATE); 20 | editor = sharedPreferences.edit(); 21 | if (instance == null) { 22 | synchronized (AppSetting.class) { 23 | if (instance == null) { 24 | instance = new AppSetting(); 25 | } 26 | } 27 | } 28 | return instance; 29 | } 30 | 31 | public void setStringPreferences(String key,String value){ 32 | editor.putString(key, value); 33 | editor.apply(); 34 | editor.commit(); //提交修改 35 | } 36 | 37 | public String getStringPreferences(String key){ 38 | return sharedPreferences.getString(key, null); 39 | } 40 | 41 | public void setIntPreferences(String key,int value){ 42 | editor.putInt(key, value); 43 | editor.apply(); 44 | editor.commit(); //提交修改 45 | } 46 | 47 | public int getIntPreferences(String key){ 48 | return sharedPreferences.getInt(key, 0); 49 | } 50 | 51 | 52 | public void removePreferences(String key){ 53 | editor.remove(key); 54 | editor.commit(); //提交修改 55 | } 56 | 57 | public void setBooleanPreferences(String key,Boolean value){ 58 | editor.putBoolean(key, value); 59 | editor.apply(); 60 | editor.commit(); //提交修改 61 | } 62 | 63 | public Boolean getBooleanPreferences(String key){ 64 | return sharedPreferences.getBoolean(key, false); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/base/AppBaseResult.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.base; 2 | 3 | import com.google.gson.Gson; 4 | import com.suke.czx.crypt.CDESCrypt; 5 | 6 | import cn.droidlover.xdroidmvp.net.IModel; 7 | 8 | /** 9 | * Created by czx on 2017/9/8. 10 | */ 11 | 12 | public class AppBaseResult implements IModel { 13 | 14 | private int code = 200; 15 | private String message; 16 | private T data; 17 | private String version = "1.0"; 18 | private String mobile = "android"; 19 | 20 | public final static int ERROR = 401; 21 | public final static int SUCCESS = 200; 22 | public final static int FAIL = 500; 23 | public final static int TOKENFAIL = 1000; 24 | public final static String KEY = "czx12345"; 25 | 26 | public int getCode() { 27 | return code; 28 | } 29 | 30 | public void setCode(int code) { 31 | this.code = code; 32 | } 33 | 34 | public String getMessage() { 35 | return message; 36 | } 37 | 38 | public void setMessage(String message) { 39 | this.message = message; 40 | } 41 | 42 | public T getData() { 43 | return data; 44 | } 45 | 46 | public void setData(T data) { 47 | this.data = data; 48 | } 49 | 50 | public void setEncryptData(T t){ 51 | String mData = new Gson().toJson(t); 52 | try { 53 | if(mData != null && !mData.equals("")){ 54 | this.data = (T) CDESCrypt.encryptString(mData, KEY); 55 | }else{ 56 | this.data = t; 57 | } 58 | } catch (Exception e) { 59 | e.printStackTrace(); 60 | } 61 | } 62 | 63 | public String getVersion() { 64 | return version; 65 | } 66 | 67 | public void setVersion(String version) { 68 | this.version = version; 69 | } 70 | 71 | public String getMobile() { 72 | return mobile; 73 | } 74 | 75 | public void setMobile(String mobile) { 76 | this.mobile = mobile; 77 | } 78 | 79 | @Override 80 | public boolean isNull() { 81 | return false; 82 | } 83 | 84 | @Override 85 | public boolean isAuthError() { 86 | return getCode() == TOKENFAIL; 87 | } 88 | 89 | @Override 90 | public boolean isBizError() { 91 | return false; 92 | } 93 | 94 | @Override 95 | public String getErrorMsg() { 96 | return null; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/base/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.base; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | 7 | import com.google.gson.Gson; 8 | import com.suke.czx.demo.App; 9 | import com.suke.czx.demo.AppConstant; 10 | import com.suke.czx.demo.AppSetting; 11 | import com.suke.czx.demo.model.user.UserEntity; 12 | import com.suke.czx.demo.widget.AlertView; 13 | 14 | import java.util.HashMap; 15 | import cn.droidlover.xdroidmvp.mvp.XActivity; 16 | import cn.droidlover.xdroidmvp.net.NetError; 17 | 18 | /** 19 | * Created by czx on 2017/5/13. 20 | */ 21 | 22 | public abstract class BaseActivity

extends XActivity { 23 | 24 | public UserEntity result = null; 25 | private P mPresenter; 26 | public HashMap staffInfo = null; 27 | 28 | @Override 29 | protected void onCreate(@Nullable Bundle savedInstanceState) { 30 | App.addActivity(this); 31 | super.onCreate(savedInstanceState); 32 | } 33 | 34 | @Override 35 | public P newP() { 36 | return mPresenter; 37 | } 38 | 39 | public P getmPresenter(){ 40 | return (P) getP(); 41 | } 42 | 43 | public UserEntity getUserInfo(){ 44 | String user_info = AppSetting.Initial(context).getStringPreferences(AppConstant.USER_INFO); 45 | if(user_info!=null && !user_info.equals("")){ 46 | Gson json = new Gson(); 47 | result = json.fromJson(user_info,UserEntity.class); 48 | } 49 | return result; 50 | } 51 | 52 | public void showSuccessForResult(){ 53 | Intent intent = new Intent(); 54 | //通过Intent对象返回结果,调用setResult方法 55 | setResult(RESULT_OK,intent); 56 | finish();//结束当前的activity的生命周期 57 | } 58 | 59 | public void showAlert(String msg){ 60 | AlertView.showTip(context,msg); 61 | } 62 | 63 | public void showError(NetError error) { 64 | if (error != null) { 65 | switch (error.getType()) { 66 | case NetError.ParseError: 67 | AlertView.showTip(context,"数据解析异常!"); 68 | break; 69 | 70 | case NetError.AuthError: 71 | AlertView.showTip(context,"用户验证过期或已在它端登录"); 72 | break; 73 | 74 | case NetError.NoConnectError: 75 | AlertView.showTip(context,"网络无连接!"); 76 | break; 77 | 78 | case NetError.OtherError: 79 | AlertView.showTip(context,"服务器繁忙!"); 80 | break; 81 | } 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/base/BaseFragment.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.base; 2 | 3 | import android.content.Intent; 4 | 5 | import com.google.gson.Gson; 6 | import com.suke.czx.demo.AppConstant; 7 | import com.suke.czx.demo.AppSetting; 8 | import com.suke.czx.demo.model.user.UserEntity; 9 | 10 | 11 | import java.util.HashMap; 12 | 13 | import cn.droidlover.xdroidmvp.mvp.IPresent; 14 | import cn.droidlover.xdroidmvp.mvp.XFragment; 15 | 16 | /** 17 | * Created by czx on 2017/11/13. 18 | */ 19 | 20 | public abstract class BaseFragment

extends XFragment

{ 21 | 22 | public UserEntity result = null; 23 | public HashMap staffInfo = null; 24 | 25 | public UserEntity getUserInfo(){ 26 | String user_info = AppSetting.Initial(context).getStringPreferences(AppConstant.USER_INFO); 27 | if(user_info!=null && !user_info.equals("")){ 28 | Gson json = new Gson(); 29 | result = json.fromJson(user_info,UserEntity.class); 30 | } 31 | return result; 32 | } 33 | 34 | 35 | public void showSuccessForResult(){ 36 | Intent intent = new Intent(); 37 | //通过Intent对象返回结果,调用setResult方法 38 | context.setResult(context.RESULT_OK,intent); 39 | context.finish();//结束当前的activity的生命周期 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/base/BaseLazyFragment.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.base; 2 | 3 | import com.google.gson.Gson; 4 | import com.suke.czx.demo.AppConstant; 5 | import com.suke.czx.demo.AppSetting; 6 | import com.suke.czx.demo.model.user.UserEntity; 7 | 8 | import cn.droidlover.xdroidmvp.mvp.IPresent; 9 | import cn.droidlover.xdroidmvp.mvp.XLazyFragment; 10 | 11 | /** 12 | * Created by czx on 2017/11/13. 13 | */ 14 | 15 | public abstract class BaseLazyFragment

extends XLazyFragment

{ 16 | 17 | public UserEntity result = null; 18 | 19 | public UserEntity getUserInfo(){ 20 | String user_info = AppSetting.Initial(context).getStringPreferences(AppConstant.USER_INFO); 21 | if(user_info!=null && !user_info.equals("")){ 22 | Gson json = new Gson(); 23 | result = json.fromJson(user_info,UserEntity.class); 24 | } 25 | return result; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/interceptor/DataInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.interceptor; 2 | 3 | import com.google.gson.Gson; 4 | import com.suke.czx.crypt.CDESCrypt; 5 | import com.suke.czx.demo.App; 6 | import com.suke.czx.demo.AppConstant; 7 | import com.suke.czx.demo.AppSetting; 8 | import com.suke.czx.demo.base.AppBaseResult; 9 | import com.suke.czx.demo.model.user.TokenEntity; 10 | import java.io.IOException; 11 | import okhttp3.Interceptor; 12 | import okhttp3.MediaType; 13 | import okhttp3.Request; 14 | import okhttp3.Response; 15 | import okhttp3.ResponseBody; 16 | 17 | /** 18 | * Created by czx on 2017/4/27. 19 | */ 20 | 21 | public class DataInterceptor implements Interceptor { 22 | 23 | @Override 24 | public Response intercept(Chain chain) throws IOException { 25 | Request request = chain.request(); 26 | String requestUrl = request.url().toString(); 27 | String responseBody = ""; 28 | Request.Builder requestBuilder = request.newBuilder(); 29 | String userToken = AppSetting.Initial(App.getContext()).getStringPreferences(AppConstant.USER_TOKEN); 30 | if(userToken != null){ 31 | TokenEntity tokenEntity = new Gson().fromJson(userToken,TokenEntity.class); 32 | if(tokenEntity != null){ 33 | requestBuilder.addHeader("token", tokenEntity.getToken()); 34 | } 35 | } 36 | 37 | Response response = chain.proceed(requestBuilder.build()); 38 | String context = response.body().string(); 39 | if(requestUrl.contains("?")){ 40 | responseBody = context; 41 | }else{ 42 | AppBaseResult appBaseResult = new Gson().fromJson(context,AppBaseResult.class); 43 | try { 44 | Object data = appBaseResult.getData(); 45 | if(data != null && !data.toString().equals("")){ 46 | responseBody = "{\"code\":"+appBaseResult.getCode()+",\"message\":\""+appBaseResult.getMessage()+"\",\"data\":"+CDESCrypt.decryptString(new Gson().toJson(data),AppBaseResult.KEY)+"}"; 47 | }else{ 48 | responseBody = "{\"code\":"+appBaseResult.getCode()+",\"message\":\""+appBaseResult.getMessage()+"\",\"data\":null}"; 49 | } 50 | } catch (Exception e) { 51 | e.printStackTrace(); 52 | } 53 | } 54 | 55 | MediaType mediaType = response.body().contentType(); 56 | return response.newBuilder().body(ResponseBody.create(mediaType, responseBody)).build(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/kit/AppKit.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.kit; 2 | 3 | import android.content.ClipData; 4 | import android.content.ClipboardManager; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.net.Uri; 8 | import android.widget.Toast; 9 | 10 | import java.io.IOException; 11 | 12 | import okhttp3.MediaType; 13 | import okhttp3.Request; 14 | import okio.Buffer; 15 | 16 | /** 17 | * Created by wanglei on 2016/12/11. 18 | */ 19 | 20 | public class AppKit { 21 | 22 | public static void copyToClipBoard(Context context, String text) { 23 | ClipboardManager cm = (ClipboardManager) context.getSystemService( 24 | Context.CLIPBOARD_SERVICE); 25 | cm.setPrimaryClip(ClipData.newPlainText("xdroid_copy", text)); 26 | Toast.makeText(context, "复制成功", Toast.LENGTH_SHORT).show(); 27 | } 28 | 29 | public static void openInBrowser(Context context, String url) { 30 | Intent intent = new Intent(); 31 | intent.setAction(Intent.ACTION_VIEW); 32 | Uri uri = Uri.parse(url); 33 | intent.setData(uri); 34 | if (intent.resolveActivity(context.getPackageManager()) != null) { 35 | context.startActivity(intent); 36 | } else { 37 | Toast.makeText(context, "打开失败了,没有可打开的应用", Toast.LENGTH_SHORT).show(); 38 | } 39 | } 40 | 41 | public static void shareText(Context context, String shareText) { 42 | Intent intent = new Intent(Intent.ACTION_SEND); 43 | intent.setType("text/plain"); 44 | intent.putExtra(Intent.EXTRA_SUBJECT, "分享"); 45 | intent.putExtra(Intent.EXTRA_TEXT, shareText); 46 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 47 | context.startActivity(Intent.createChooser(intent, "分享")); 48 | } 49 | 50 | public static void shareImage(Context context, Uri uri) { 51 | Intent shareIntent = new Intent(); 52 | shareIntent.setAction(Intent.ACTION_SEND); 53 | shareIntent.putExtra(Intent.EXTRA_STREAM, uri); 54 | shareIntent.setType("image/jpeg"); 55 | context.startActivity(Intent.createChooser(shareIntent, "分享图片")); 56 | } 57 | 58 | public static boolean isText(MediaType mediaType) { 59 | if (mediaType.type() != null && mediaType.type().equals("text")) { 60 | return true; 61 | } 62 | if (mediaType.subtype() != null) { 63 | if (mediaType.subtype().equals("json") || 64 | mediaType.subtype().equals("xml") || 65 | mediaType.subtype().equals("html") || 66 | mediaType.subtype().equals("webviewhtml") 67 | ) 68 | return true; 69 | } 70 | return false; 71 | } 72 | 73 | public static String bodyToString(final Request request) { 74 | try { 75 | final Request copy = request.newBuilder().build(); 76 | final Buffer buffer = new Buffer(); 77 | copy.body().writeTo(buffer); 78 | return buffer.readUtf8(); 79 | } catch (final IOException e) { 80 | return "something error when show requestBody."; 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/model/user/TokenEntity.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.model.user; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | 7 | /** 8 | * 用户Token 9 | * 10 | * @author czx 11 | * @email object_czx@163.com 12 | * @date 2017-03-23 15:22:07 13 | */ 14 | public class TokenEntity implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | //用户ID 18 | private String userId; 19 | //token 20 | private String token; 21 | //过期时间 22 | private Date expireTime; 23 | //更新时间 24 | private Date updateTime; 25 | 26 | private long expire; 27 | 28 | public long getExpire() { 29 | return expire; 30 | } 31 | 32 | public void setExpire(long expire) { 33 | this.expire = expire; 34 | } 35 | 36 | /** 37 | * 设置:用户ID 38 | */ 39 | public void setUserId(String userId) { 40 | this.userId = userId; 41 | } 42 | /** 43 | * 获取:用户ID 44 | */ 45 | public String getUserId() { 46 | return userId; 47 | } 48 | /** 49 | * 设置:token 50 | */ 51 | public void setToken(String token) { 52 | this.token = token; 53 | } 54 | /** 55 | * 获取:token 56 | */ 57 | public String getToken() { 58 | return token; 59 | } 60 | /** 61 | * 设置:过期时间 62 | */ 63 | public void setExpireTime(Date expireTime) { 64 | this.expireTime = expireTime; 65 | } 66 | /** 67 | * 获取:过期时间 68 | */ 69 | public Date getExpireTime() { 70 | return expireTime; 71 | } 72 | /** 73 | * 设置:更新时间 74 | */ 75 | public void setUpdateTime(Date updateTime) { 76 | this.updateTime = updateTime; 77 | } 78 | /** 79 | * 获取:更新时间 80 | */ 81 | public Date getUpdateTime() { 82 | return updateTime; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/model/user/UserEntity.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.model.user; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | 7 | /** 8 | * 用户表 9 | * 10 | * @author czx 11 | * @email object_czx@163.com 12 | * @date 2018-01-26 16:33:18 13 | */ 14 | public class UserEntity implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | //用户id 18 | private Long userId; 19 | //用户名 20 | private String username; 21 | //手机号 22 | private String mobile; 23 | //密码 24 | private String password; 25 | //创建时间 26 | private Date createTime; 27 | 28 | //token 29 | private String token; 30 | 31 | private long expire; 32 | 33 | public String getToken() { 34 | return token; 35 | } 36 | 37 | public void setToken(String token) { 38 | this.token = token; 39 | } 40 | 41 | public long getExpire() { 42 | return expire; 43 | } 44 | 45 | public void setExpire(long expire) { 46 | this.expire = expire; 47 | } 48 | 49 | /** 50 | * 设置:用户id 51 | */ 52 | public void setUserId(Long userId) { 53 | this.userId = userId; 54 | } 55 | /** 56 | * 获取:用户id 57 | */ 58 | public Long getUserId() { 59 | return userId; 60 | } 61 | /** 62 | * 设置:用户名 63 | */ 64 | public void setUsername(String username) { 65 | this.username = username; 66 | } 67 | /** 68 | * 获取:用户名 69 | */ 70 | public String getUsername() { 71 | return username; 72 | } 73 | /** 74 | * 设置:手机号 75 | */ 76 | public void setMobile(String mobile) { 77 | this.mobile = mobile; 78 | } 79 | /** 80 | * 获取:手机号 81 | */ 82 | public String getMobile() { 83 | return mobile; 84 | } 85 | /** 86 | * 设置:密码 87 | */ 88 | public void setPassword(String password) { 89 | this.password = password; 90 | } 91 | /** 92 | * 获取:密码 93 | */ 94 | public String getPassword() { 95 | return password; 96 | } 97 | /** 98 | * 设置:创建时间 99 | */ 100 | public void setCreateTime(Date createTime) { 101 | this.createTime = createTime; 102 | } 103 | /** 104 | * 获取:创建时间 105 | */ 106 | public Date getCreateTime() { 107 | return createTime; 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/net/Api.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.net; 2 | 3 | import com.suke.czx.demo.AppConstant; 4 | 5 | import cn.droidlover.xdroidmvp.net.XApi; 6 | 7 | /** 8 | * Created by czx on 2018/1/29. 9 | */ 10 | 11 | public class Api { 12 | 13 | private static Service service; 14 | 15 | public static Service getService() { 16 | if (service == null) { 17 | synchronized (Api.class) { 18 | if (service == null) { 19 | service = XApi.getInstance().getRetrofit(AppConstant.DEBUG_URL, true).create(Service.class); 20 | } 21 | } 22 | } 23 | return service; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/net/Service.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.net; 2 | 3 | import com.suke.czx.demo.base.AppBaseResult; 4 | import com.suke.czx.demo.model.user.UserEntity; 5 | 6 | import io.reactivex.Flowable; 7 | import retrofit2.http.Body; 8 | import retrofit2.http.POST; 9 | 10 | /** 11 | * Created by czx on 2018/1/29. 12 | */ 13 | 14 | public interface Service { 15 | 16 | @POST("app/login") 17 | Flowable> login(@Body AppBaseResult appBaseResult); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/present/user/LoginPresent.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.present.user; 2 | 3 | import com.suke.czx.demo.base.AppBaseResult; 4 | import com.suke.czx.demo.model.user.UserEntity; 5 | import com.suke.czx.demo.net.Api; 6 | import com.suke.czx.demo.ui.LoginActivity; 7 | import java.util.HashMap; 8 | import cn.droidlover.xdroidmvp.mvp.XPresent; 9 | import cn.droidlover.xdroidmvp.net.ApiSubscriber; 10 | import cn.droidlover.xdroidmvp.net.NetError; 11 | import cn.droidlover.xdroidmvp.net.XApi; 12 | 13 | /** 14 | * Created by czx on 2018/1/12. 15 | */ 16 | 17 | public class LoginPresent extends XPresent { 18 | 19 | public void login(HashMap hashMap){ 20 | AppBaseResult appBaseResult = new AppBaseResult(); 21 | appBaseResult.setEncryptData(hashMap); 22 | Api.getService().login(appBaseResult) 23 | .compose(XApi.>getApiTransformer()) 24 | .compose(XApi.>getScheduler()) 25 | .subscribe(new ApiSubscriber>() { 26 | @Override 27 | protected void onFail(NetError error) { 28 | getV().showError(error); 29 | } 30 | 31 | @Override 32 | public void onNext(AppBaseResult result) { 33 | if(result.getCode() == AppBaseResult.SUCCESS){ 34 | getV().showSuccess(result.getData()); 35 | }else{ 36 | getV().showAlert(result.getMessage()); 37 | } 38 | } 39 | }); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/utils/PageUtils.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.utils; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | /** 7 | * 分页工具类 8 | * 9 | * @author czx 10 | * @email object_czx@163.com 11 | * @date 2016年11月4日 下午12:59:00 12 | */ 13 | public class PageUtils implements Serializable { 14 | private static final long serialVersionUID = 1L; 15 | //总记录数 16 | private int totalCount; 17 | //每页记录数 18 | private int pageSize; 19 | //总页数 20 | private int totalPage; 21 | //当前页数 22 | private int currPage; 23 | //列表数据 24 | private List list; 25 | 26 | /** 27 | * 分页 28 | * @param list 列表数据 29 | * @param totalCount 总记录数 30 | * @param pageSize 每页记录数 31 | * @param currPage 当前页数 32 | */ 33 | public PageUtils(List list, int totalCount, int pageSize, int currPage) { 34 | this.list = list; 35 | this.totalCount = totalCount; 36 | this.pageSize = pageSize; 37 | this.currPage = currPage; 38 | this.totalPage = (int)Math.ceil((double)totalCount/pageSize); 39 | } 40 | 41 | public int getTotalCount() { 42 | return totalCount; 43 | } 44 | 45 | public void setTotalCount(int totalCount) { 46 | this.totalCount = totalCount; 47 | } 48 | 49 | public int getPageSize() { 50 | return pageSize; 51 | } 52 | 53 | public void setPageSize(int pageSize) { 54 | this.pageSize = pageSize; 55 | } 56 | 57 | public int getTotalPage() { 58 | return totalPage; 59 | } 60 | 61 | public void setTotalPage(int totalPage) { 62 | this.totalPage = totalPage; 63 | } 64 | 65 | public int getCurrPage() { 66 | return currPage; 67 | } 68 | 69 | public void setCurrPage(int currPage) { 70 | this.currPage = currPage; 71 | } 72 | 73 | public List getList() { 74 | return list; 75 | } 76 | 77 | public void setList(List list) { 78 | this.list = list; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/widget/AlertView.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.widget; 2 | 3 | import android.app.Activity; 4 | 5 | import com.suke.czx.demo.R; 6 | import com.tapadoo.alerter.Alerter; 7 | 8 | /** 9 | * Created by czx on 2018/1/29. 10 | */ 11 | 12 | public class AlertView { 13 | 14 | public static void showTip(Activity activity, String msg){ 15 | Alerter.create(activity) 16 | //.setTitle("系统提示") 17 | .setText(msg) 18 | .setIcon(R.drawable.alerter_ic_notifications) 19 | .setBackgroundColorRes(R.color.colorPrimary) // or setBackgroundColorInt(Color.CYAN) 20 | .show(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/widget/DialogLoading.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.widget; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.os.Bundle; 6 | import android.view.Gravity; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.Window; 10 | import android.widget.TextView; 11 | 12 | import com.suke.czx.demo.R; 13 | 14 | 15 | /** 16 | * Created by czx on 2017/4/10. 17 | */ 18 | 19 | public class DialogLoading extends Dialog{ 20 | 21 | private Context context; 22 | private String text_value; 23 | 24 | public DialogLoading(Context context){ 25 | super(context, R.style.record_voice_dialog_loading); 26 | this.context = context; 27 | } 28 | 29 | public DialogLoading(Context context, String text){ 30 | super(context, R.style.record_voice_dialog_loading); 31 | this.context = context; 32 | this.text_value = text; 33 | } 34 | 35 | @Override 36 | protected void onCreate(Bundle savedInstanceState) { 37 | super.onCreate(savedInstanceState); 38 | init(); 39 | } 40 | 41 | public void init(){ 42 | LayoutInflater inflater = LayoutInflater.from(context); 43 | View view = inflater.inflate(R.layout.layout_dialog_loading, null); 44 | setContentView(view); 45 | setCanceledOnTouchOutside(false); 46 | 47 | TextView textView = (TextView) view.findViewById(R.id.text_value); 48 | if(text_value != null){ 49 | textView.setText(text_value); 50 | } 51 | Window window = getWindow(); 52 | window.setGravity(Gravity.CENTER); 53 | } 54 | 55 | public String getText_value() { 56 | return text_value; 57 | } 58 | 59 | public void setText_value(String text_value) { 60 | this.text_value = text_value; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/suke/czx/demo/widget/StateView.java: -------------------------------------------------------------------------------- 1 | package com.suke.czx.demo.widget; 2 | 3 | import android.content.Context; 4 | import android.text.TextUtils; 5 | import android.util.AttributeSet; 6 | import android.widget.LinearLayout; 7 | import android.widget.TextView; 8 | 9 | import butterknife.BindView; 10 | import com.suke.czx.demo.R; 11 | import cn.droidlover.xdroidmvp.kit.KnifeKit; 12 | 13 | /** 14 | * Created by wanglei on 2016/12/31. 15 | */ 16 | 17 | public class StateView extends LinearLayout { 18 | 19 | @BindView(R.id.tv_msg) 20 | TextView tvMsg; 21 | 22 | public StateView(Context context) { 23 | super(context); 24 | setupView(context); 25 | } 26 | 27 | public StateView(Context context, AttributeSet attrs) { 28 | super(context, attrs); 29 | setupView(context); 30 | } 31 | 32 | public StateView(Context context, AttributeSet attrs, int defStyleAttr) { 33 | super(context, attrs, defStyleAttr); 34 | setupView(context); 35 | } 36 | 37 | private void setupView(Context context) { 38 | inflate(context, R.layout.view_state, this); 39 | KnifeKit.bind(this); 40 | } 41 | 42 | public void setMsg(String msg) { 43 | if (!TextUtils.isEmpty(msg)) { 44 | tvMsg.setText(msg); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/dialog_alert_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/item_part_touch.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/loading_dialog_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_arrow_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_keyboard_arrow_right_green_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_person_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_save_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_share_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/item_part_touch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/view_border.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 12 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/view_shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 19 | 20 | 29 | 30 |