├── .gitignore ├── .idea ├── encodings.xml ├── gradle.xml ├── misc.xml └── runConfigurations.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── proguardMapping.txt ├── qzs_android.jks ├── release │ ├── app-release.apk │ └── output.json ├── signing.properties └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── qzs │ │ └── wanandroid │ │ └── ExampleInstrumentedTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── qzs │ │ │ └── wanandroid │ │ │ ├── base │ │ │ ├── BaseMvpActivity.java │ │ │ ├── BaseMvpFragment.java │ │ │ ├── BaseMvpPresenter.java │ │ │ ├── IActivity.java │ │ │ ├── IBaseMvpView.java │ │ │ ├── IFragment.java │ │ │ ├── OnLoadDatasListener.java │ │ │ ├── SimpleRecyclerAdapter.java │ │ │ └── SimpleViewHolder.java │ │ │ ├── bean │ │ │ └── CurrencyBean.java │ │ │ ├── common │ │ │ ├── ItemType.java │ │ │ ├── MainActivity.java │ │ │ └── MyApplication.java │ │ │ ├── http │ │ │ ├── AddCookiesInterceptor.java │ │ │ ├── ApiException.java │ │ │ ├── ApiService.java │ │ │ ├── BaseObserver.java │ │ │ ├── BaseResponse.java │ │ │ ├── ReceivedCookiesInterceptor.java │ │ │ └── RetrofitFactory.java │ │ │ ├── imageloader │ │ │ ├── GlideFile.java │ │ │ └── GlideUtils.java │ │ │ ├── mvp │ │ │ ├── model │ │ │ │ ├── IBannerModel.java │ │ │ │ ├── ICollectModel.java │ │ │ │ ├── IFrHomeModel.java │ │ │ │ ├── IFrProjectModel.java │ │ │ │ ├── ILoginModel.java │ │ │ │ ├── IMyCollectModel.java │ │ │ │ ├── INavigateModel.java │ │ │ │ ├── IRegisterModel.java │ │ │ │ ├── ISearchDetailModel.java │ │ │ │ └── impl │ │ │ │ │ ├── BannerModelImpl.java │ │ │ │ │ ├── CollectModelImpl.java │ │ │ │ │ ├── FrHomeModelImpl.java │ │ │ │ │ ├── FrProjectModelImpl.java │ │ │ │ │ ├── LoginModelImpl.java │ │ │ │ │ ├── MyCollectModelImpl.java │ │ │ │ │ ├── NavigateImpl.java │ │ │ │ │ ├── RegisterModelImpl.java │ │ │ │ │ └── SearchDetailModelImpl.java │ │ │ ├── presenter │ │ │ │ ├── ArticleDetailsPresenter.java │ │ │ │ ├── CurrencyPresenter.java │ │ │ │ ├── FrHomePresenter.java │ │ │ │ ├── FrPCenterPresenter.java │ │ │ │ ├── FrProjectPresenter.java │ │ │ │ ├── FrProjectSecPresenter.java │ │ │ │ ├── LoginPresenter.java │ │ │ │ ├── MainPresenter.java │ │ │ │ ├── MyCollectPresenter.java │ │ │ │ ├── NavigatePresenter.java │ │ │ │ ├── RegisterPresenter.java │ │ │ │ └── SearchDetailPresenter.java │ │ │ └── view │ │ │ │ ├── CurrencyView.java │ │ │ │ ├── IArticleDetailView.java │ │ │ │ ├── IFrProjectSecView.java │ │ │ │ ├── IFragmentHomeView.java │ │ │ │ ├── IFragmentPCenterView.java │ │ │ │ ├── IFragmentProjectView.java │ │ │ │ ├── ILoginView.java │ │ │ │ ├── IMainView.java │ │ │ │ ├── IMyCollectView.java │ │ │ │ ├── INavigateView.java │ │ │ │ ├── IRegisterView.java │ │ │ │ └── ISearchDetailView.java │ │ │ ├── ui │ │ │ └── information │ │ │ │ ├── activity │ │ │ │ ├── ArticleDetailsActivity.java │ │ │ │ ├── LoginActivity.java │ │ │ │ ├── MyCollectActivity.java │ │ │ │ ├── QzsActivity.java │ │ │ │ ├── RegisterActivity.java │ │ │ │ └── SearchDetailActivity.java │ │ │ │ ├── adapter │ │ │ │ ├── HomeAdapter.java │ │ │ │ ├── LeftAdapter.java │ │ │ │ ├── MyCollectAdapter.java │ │ │ │ ├── ProjectAdapter.java │ │ │ │ └── RightAdapter.java │ │ │ │ ├── bean │ │ │ │ ├── BannerBean.java │ │ │ │ ├── MainListBean.java │ │ │ │ ├── MyCollectBean.java │ │ │ │ ├── NavigateBean.java │ │ │ │ ├── ProjectListBean.java │ │ │ │ └── ProjectTitleBean.java │ │ │ │ ├── fragment │ │ │ │ ├── HomeFragment.java │ │ │ │ ├── NavigateFragment.java │ │ │ │ ├── PersonalCenterFragment.java │ │ │ │ ├── ProjectFragment.java │ │ │ │ └── ProjectSecFragment.java │ │ │ │ └── viewholder │ │ │ │ ├── LeftViewHolder.java │ │ │ │ ├── RightBigSortViewHolder.java │ │ │ │ └── RightSmallSortViewHolder.java │ │ │ ├── utils │ │ │ ├── CommonUtil.java │ │ │ ├── DensityUtil.java │ │ │ ├── DialogUtils.java │ │ │ ├── HideUtil.java │ │ │ ├── LogUtils.java │ │ │ ├── MyUtils.java │ │ │ ├── RecycleViewAnimationUtils.java │ │ │ ├── SpUtils.java │ │ │ └── Utils.java │ │ │ └── widget │ │ │ └── ProgressWebView.java │ └── res │ │ ├── anim │ │ ├── item_animation_fall_down.xml │ │ └── layout_animation_fall_down.xml │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── banner_pot1.xml │ │ ├── banner_pot2.xml │ │ ├── bg_card.xml │ │ ├── drawable_addfriend_search_bg.xml │ │ ├── drawable_complete_person_head_back2.xml │ │ ├── drawable_home_label1.xml │ │ ├── drawable_home_label2.xml │ │ ├── drawable_load_error_btn.xml │ │ ├── drawable_login_btn.xml │ │ ├── drawable_my_collect_delete_bg.xml │ │ ├── drawable_personal_center_bg1.xml │ │ ├── foreground_cardview.xml │ │ ├── ic_launcher_background.xml │ │ ├── ic_login_btn1.png │ │ ├── ic_login_btn2.png │ │ ├── shape_bg_white_search.xml │ │ └── shape_toobar.xml │ │ ├── layout │ │ ├── activity_article_detail.xml │ │ ├── activity_login.xml │ │ ├── activity_main.xml │ │ ├── activity_my_collect.xml │ │ ├── activity_qzs.xml │ │ ├── activity_register.xml │ │ ├── activity_search_detail.xml │ │ ├── fragment_home.xml │ │ ├── fragment_navigate.xml │ │ ├── fragment_personal_center.xml │ │ ├── fragment_project.xml │ │ ├── fragment_project_sec.xml │ │ ├── item_banner_image.xml │ │ ├── item_home_banner.xml │ │ ├── item_home_info.xml │ │ ├── item_home_list.xml │ │ ├── item_my_collect.xml │ │ ├── item_project_list.xml │ │ ├── item_view_home_load.xml │ │ ├── layout_load_error.xml │ │ ├── layout_personal_center1.xml │ │ ├── layout_personal_center2.xml │ │ ├── loading_dialog.xml │ │ ├── recyclerview_item_right_big_sort.xml │ │ ├── recyclerview_item_right_small_sort.xml │ │ └── recyclerview_item_search_sort_left.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ └── test.jpg │ │ ├── mipmap-xhdpi │ │ ├── assets_back.png │ │ ├── ic1.png │ │ ├── ic2.png │ │ ├── ic3.png │ │ ├── ic_addfriend_find.png │ │ ├── ic_adoption_share.png │ │ ├── ic_arrows_left_white.png │ │ ├── ic_home_author.png │ │ ├── ic_home_search_bg.png │ │ ├── ic_launcher.png │ │ ├── ic_launcher_round.png │ │ ├── ic_load_error.png │ │ ├── ic_location_delete.png │ │ ├── ic_login_out.png │ │ ├── ic_main_classification1.png │ │ ├── ic_main_classification2.png │ │ ├── ic_main_home1.png │ │ ├── ic_main_home2.png │ │ ├── ic_main_me1.png │ │ ├── ic_main_me2.png │ │ ├── ic_main_navigate1.png │ │ ├── ic_main_navigate2.png │ │ ├── ic_main_project1.png │ │ ├── ic_main_project2.png │ │ ├── ic_me.jpg │ │ ├── ic_my_collect.png │ │ ├── ic_my_help.png │ │ ├── ic_my_meat.png │ │ ├── ic_personal_center_bg.png │ │ ├── ic_project_bg.png │ │ ├── ic_project_bg1.png │ │ ├── ic_search.png │ │ ├── ic_settings.png │ │ ├── ic_star_normal.png │ │ ├── ic_star_select.png │ │ └── loading_bg.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── integers.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── qzs │ └── wanandroid │ └── ExampleUnitTest.java ├── build.gradle ├── gif ├── ic11.jpg ├── ic2.jpg ├── ic3.jpg ├── ic4.jpg ├── ic5.jpg ├── ic6.gif └── ic_me.jpg ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── wandroid_sdk ├── .gitignore ├── build.gradle ├── libs └── tbs_sdk_thirdapp_v4.3.0.1020_43633_sharewithdownload_withoutGame_obfs_20190111_105200.jar ├── proguard-rules.pro └── src ├── androidTest └── java │ └── com │ └── qzs │ └── wandroid_sdk │ └── ExampleInstrumentedTest.java ├── main ├── AndroidManifest.xml └── res │ └── values │ └── strings.xml └── test └── java └── com └── qzs └── wandroid_sdk └── ExampleUnitTest.java /.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/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QzsWanAndroid 2 | 基于 wanandroid.com 开发的 MVP + Retrofit2 + RxJava2 +okhttp3 开发的 Android APP 3 | 4 | ![](https://github.com/javaexception/QzsWanAndroid/blob/master/gif/ic6.gif)![](https://github.com/javaexception/QzsWanAndroid/blob/master/gif/ic11.jpg)![](https://github.com/javaexception/QzsWanAndroid/blob/master/gif/ic2.jpg)![](https://github.com/javaexception/QzsWanAndroid/blob/master/gif/ic3.jpg)![](https://github.com/javaexception/QzsWanAndroid/blob/master/gif/ic4.jpg)![](https://github.com/javaexception/QzsWanAndroid/blob/master/gif/ic5.jpg) 5 | 6 | /n 7 | ### 目前已完成的功能(持续更新) 8 | 9 | - 登录注册登出 10 | - 首页文章列表 11 | - 首页搜索文章 12 | - 项目分类 13 | - 项目列表 14 | - 收藏文章 15 | - 取消收藏 16 | - 收藏列表 17 | 18 | ### dependenices 19 | 20 | - [retrofit](https://github.com/square/retrofit) 21 | - [okhttp](https://github.com/square/okhttp) 22 | - [rxjava](https://github.com/ReactiveX/RxJava) 23 | - [Glide](https://github.com/bumptech/glide) 24 | - [Banner](https://github.com/youth5201314/banner) 25 | - [SmartRefreshLayout](https://github.com/scwang90/SmartRefreshLayout) 26 | - [BaseRecyclerViewAdapterHelper](https://github.com/CymChad/BaseRecyclerViewAdapterHelper) 27 | - [flowlayout](https://github.com/hongyangAndroid/FlowLayout) 28 | - [SwipeDelMenuLayout](https://github.com/mcxtzhang/SwipeDelMenuLayout) 29 | 30 | ### APK下载安装 31 | 32 | - [点击下载安装](https://www.pgyer.com/pxdM) 33 | 34 | ### 我的联系方式 35 | 36 | - 我的微信公众号 37 | ![](https://github.com/javaexception/QzsWanAndroid/blob/master/gif/ic_me.jpg) 38 | 39 | 40 | - 我的微信号: lengquele5311 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.qzs.wanandroid" 7 | 8 | minSdkVersion rootProject.ext.minSdkVersion 9 | targetSdkVersion rootProject.ext.targetSdkVersion 10 | versionCode rootProject.ext.versionCode 11 | versionName rootProject.ext.versionName 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | 15 | signingConfigs { 16 | 17 | // release { 18 | // keyAlias 'qzs_android' 19 | // keyPassword '123456' 20 | // 21 | // storeFile file('./qzs_android.keystore') 22 | // storePassword '123456' 23 | // } 24 | // debug { 25 | // keyAlias 'androiddebugkey' 26 | // keyPassword 'android' 27 | // 28 | // storeFile file('./debug.keystore') 29 | // storePassword 'android' 30 | // 31 | // } 32 | } 33 | buildTypes { 34 | release { 35 | // 混淆 36 | minifyEnabled true 37 | // Zipalign优化 38 | zipAlignEnabled true 39 | // 移除无用的resource文件 40 | shrinkResources true 41 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 42 | } 43 | } 44 | } 45 | 46 | dependencies { 47 | implementation fileTree(dir: 'libs', include: ['*.jar']) 48 | implementation 'com.android.support:appcompat-v7:28.0.0' 49 | implementation 'com.android.support:support-v4:28.0.0' 50 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 51 | testImplementation 'junit:junit:4.12' 52 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 53 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 54 | 55 | implementation project(':wandroid_sdk') 56 | debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5' 57 | releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5' 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /app/qzs_android.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaexception/QzsWanAndroid/d3805a0f3316b364aba6239cde8c74af77e0bb82/app/qzs_android.jks -------------------------------------------------------------------------------- /app/release/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaexception/QzsWanAndroid/d3805a0f3316b364aba6239cde8c74af77e0bb82/app/release/app-release.apk -------------------------------------------------------------------------------- /app/release/output.json: -------------------------------------------------------------------------------- 1 | [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] -------------------------------------------------------------------------------- /app/signing.properties: -------------------------------------------------------------------------------- 1 | STORE_FILE=qzs_android.jks 2 | STORE_PASSWORD=123456 3 | KEY_ALIAS=qzs_android 4 | KEY_PASSWORD=123456 -------------------------------------------------------------------------------- /app/src/androidTest/java/com/qzs/wanandroid/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid; 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.qzs.wanandroid", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 22 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 36 | 37 | 40 | 41 | 42 | 45 | 46 | 48 | 49 | 50 | 53 | 54 | 55 | 58 | 59 | 60 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/BaseMvpActivity.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | import android.app.Dialog; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.view.View; 7 | 8 | import com.gyf.immersionbar.ImmersionBar; 9 | import com.qzs.wanandroid.common.MyApplication; 10 | import com.qzs.wanandroid.utils.DialogUtils; 11 | import com.squareup.leakcanary.RefWatcher; 12 | import com.trello.rxlifecycle2.components.support.RxAppCompatActivity; 13 | 14 | 15 | public abstract class BaseMvpActivity> extends RxAppCompatActivity implements IBaseMvpView, IActivity , View.OnClickListener{ 16 | 17 | protected P mPresenter; 18 | 19 | protected Dialog dialog; 20 | 21 | @SuppressWarnings("unchecked") 22 | @Override 23 | protected void onCreate(@Nullable Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(getLayout()); 26 | ImmersionBar.with(this).init(); 27 | if (mPresenter == null) { 28 | mPresenter = createPresenter(); 29 | } 30 | mPresenter.attachMvpView((V) this); 31 | initImmersionBar(); 32 | dialog = DialogUtils.createLoadingDialog(this, "请稍后..."); 33 | initView(); 34 | initData( savedInstanceState); 35 | } 36 | 37 | protected abstract P createPresenter(); 38 | 39 | @Override 40 | protected void onDestroy() { 41 | super.onDestroy(); 42 | //内存泄漏 43 | RefWatcher refWatcher = MyApplication.getRefWatcher(this);//1 44 | refWatcher.watch(this); 45 | if (mPresenter != null) { 46 | mPresenter.detachMvpView(); 47 | } 48 | } 49 | 50 | @Override 51 | protected void onResume() { 52 | super.onResume(); 53 | } 54 | 55 | @Override 56 | protected void onPause() { 57 | super.onPause(); 58 | } 59 | 60 | /** 61 | * 初始化沉浸式 62 | * Init immersion bar. 63 | */ 64 | protected void initImmersionBar() { 65 | //设置共同沉浸式样式 66 | ImmersionBar.with(this).init(); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/BaseMvpFragment.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | import android.app.Dialog; 4 | import android.os.Bundle; 5 | import android.support.annotation.NonNull; 6 | import android.support.annotation.Nullable; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | 11 | import com.gyf.immersionbar.ImmersionBar; 12 | import com.qzs.wanandroid.R; 13 | import com.qzs.wanandroid.common.MyApplication; 14 | import com.qzs.wanandroid.utils.DialogUtils; 15 | import com.qzs.wanandroid.utils.HideUtil; 16 | import com.squareup.leakcanary.RefWatcher; 17 | import com.trello.rxlifecycle2.components.support.RxFragment; 18 | 19 | public abstract class BaseMvpFragment> extends RxFragment implements IBaseMvpView, IFragment, View.OnClickListener{ 20 | 21 | protected P mPresenter; 22 | 23 | protected View rootView;// 缓存Fragment view 24 | protected Dialog dialog; 25 | 26 | @Nullable 27 | @Override 28 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 29 | if (rootView == null) { 30 | rootView = inflater.inflate(getLayout(), null); 31 | } 32 | // 缓存的rootView需要判断是否已经被加过parent,如果有parent需要从parent删除,要不然会发生这个rootview已经有parent的错误。 33 | ViewGroup parent = (ViewGroup) rootView.getParent(); 34 | if (parent != null) { 35 | parent.removeView(rootView); 36 | } 37 | 38 | // unbinder = ButterKnife.bind(this, rootView); 39 | if (rootView instanceof ViewGroup) { 40 | HideUtil.init(getActivity(), (ViewGroup) rootView);//初始化触摸关闭软键盘 41 | } 42 | 43 | if (mPresenter == null) { 44 | mPresenter = createPresenter(); 45 | } 46 | mPresenter.attachMvpView((V) this); 47 | 48 | dialog = DialogUtils.createLoadingDialog(getActivity(), "请稍后..."); 49 | 50 | initImmersionBar(); 51 | initView(); 52 | initData(savedInstanceState); 53 | return rootView; 54 | } 55 | 56 | 57 | protected abstract P createPresenter(); 58 | 59 | @Override 60 | public void onDestroyView() { 61 | super.onDestroyView(); 62 | RefWatcher refWatcher = MyApplication.getRefWatcher(getActivity());//1 63 | refWatcher.watch(this); 64 | if (mPresenter != null) { 65 | mPresenter.detachMvpView(); 66 | } 67 | } 68 | 69 | /** 70 | * 初始化沉浸式 71 | * Init immersion bar. 72 | */ 73 | protected void initImmersionBar() { 74 | //设置共同沉浸式样式 75 | ImmersionBar.with(this).init(); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/BaseMvpPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | import java.lang.ref.WeakReference; 4 | 5 | 6 | public class BaseMvpPresenter { 7 | 8 | /** 9 | * v层泛型引用 10 | */ 11 | protected V mView; 12 | 13 | private WeakReference weakReferenceView; 14 | //防止空指针 15 | protected V getView(){ 16 | if(mView == null) { 17 | throw new IllegalStateException("view not attached"); 18 | } 19 | else{ 20 | return mView; 21 | } 22 | } 23 | 24 | public void attachMvpView(V view) { 25 | if (view!=null){ 26 | weakReferenceView = new WeakReference<>(view); 27 | this.mView = weakReferenceView.get(); 28 | } 29 | 30 | } 31 | 32 | 33 | public void detachMvpView() { 34 | weakReferenceView.clear(); 35 | weakReferenceView = null; 36 | mView = null; 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/IActivity.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | import android.os.Bundle; 4 | 5 | /** 6 | * @author qinzishuai 7 | * 描述: 8 | * 创建日期:2019/7/12 9 | * 10 | */ 11 | public interface IActivity { 12 | 13 | int getLayout(); 14 | 15 | void initView(); 16 | 17 | void initData(Bundle savedInstanceState); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/IBaseMvpView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | 4 | import android.app.Dialog; 5 | 6 | public interface IBaseMvpView { 7 | /** 8 | * 获取view层的dialog 9 | * 10 | * @return retuen 11 | */ 12 | Dialog getLoadDialog(); 13 | 14 | /*** 15 | * 关闭view层的dialog 16 | */ 17 | void cancelLoadDialog(); 18 | 19 | 20 | 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/IFragment.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | import android.os.Bundle; 4 | 5 | 6 | public interface IFragment { 7 | 8 | int getLayout(); 9 | 10 | void initView(); 11 | 12 | void initData(Bundle savedInstanceState); 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/OnLoadDatasListener.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | /** 4 | * @author qinzishuai 5 | * 描述: 6 | * 创建日期:2019/7/12 7 | * 8 | */ 9 | public interface OnLoadDatasListener { 10 | 11 | /** 12 | * 成功 13 | * @param t 数据 14 | */ 15 | void onSuccess(T t); 16 | 17 | 18 | /** 19 | * 失败 20 | * @param error 错误信息 21 | */ 22 | void onFailure(String error); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/SimpleRecyclerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | 4 | import android.support.v7.widget.RecyclerView; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author pengbo 10 | * @date 2018/5/22 11 | */ 12 | public abstract class SimpleRecyclerAdapter extends RecyclerView.Adapter> { 13 | 14 | protected List mListData; 15 | 16 | private SimpleRecyclerAdapter.OnItemClickListener onItemClickListener; 17 | private SimpleRecyclerAdapter.OnItemLongClickListener mOnItemLongClickListener; 18 | 19 | public void setOnItemClickListener(OnItemClickListener onItemClickListener) { 20 | this.onItemClickListener = onItemClickListener; 21 | } 22 | public void setOnItemLongClickListener(OnItemLongClickListener mOnItemLongClickListener) { 23 | this.mOnItemLongClickListener = mOnItemLongClickListener; 24 | } 25 | void onItemClick(T data, int index) { 26 | if (onItemClickListener != null) { 27 | onItemClickListener.onItemClick(data, index); 28 | } 29 | 30 | } 31 | void onItemLongClick(T data,int index){ 32 | if(mOnItemLongClickListener!=null){ 33 | mOnItemLongClickListener.onItemLongClick(data,index); 34 | } 35 | } 36 | 37 | /** 38 | * 设置列表数据 39 | * @param data 40 | */ 41 | public void setListData(List data) { 42 | this.mListData = data; 43 | } 44 | 45 | @Override 46 | public void onBindViewHolder(SimpleViewHolder holder, int position) { 47 | holder.refresh(mListData.get(position), position); 48 | } 49 | 50 | @Override 51 | public void onBindViewHolder(SimpleViewHolder holder, int position, List payloads) { 52 | if (payloads.isEmpty()){ 53 | holder.refresh(mListData.get(position), position); 54 | }else{ 55 | holder.refreshItemWidget(mListData.get(position), position,payloads); 56 | } 57 | } 58 | 59 | @Override 60 | public int getItemCount() { 61 | return mListData == null ? 0 : mListData.size(); 62 | } 63 | 64 | public interface OnItemClickListener { 65 | void onItemClick(T item, int index); 66 | } 67 | public interface OnItemLongClickListener{ 68 | void onItemLongClick(T item, int position); 69 | } 70 | } -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/base/SimpleViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.base; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.View; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @author pengbo 12 | * @date 2018/5/22 13 | */ 14 | public class SimpleViewHolder extends RecyclerView.ViewHolder{ 15 | 16 | private ItemViewClickListener itemViewClickListener; 17 | private OnItemLongClickListener onItemLongClickListener; 18 | public SimpleRecyclerAdapter adapter; 19 | private View itemView; 20 | 21 | public SimpleViewHolder(View itemView) { 22 | this(itemView, null); 23 | } 24 | 25 | /** 26 | * 传入adapter 设置onItemClickListener才会有效 27 | * @param itemView 28 | * @param adapter 29 | */ 30 | public SimpleViewHolder(View itemView, @Nullable SimpleRecyclerAdapter adapter) { 31 | super(itemView); 32 | this.itemView = itemView; 33 | if (adapter != null) { 34 | itemViewClickListener = new ItemViewClickListener(); 35 | itemView.setOnClickListener(itemViewClickListener); 36 | onItemLongClickListener=new OnItemLongClickListener(); 37 | itemView.setOnLongClickListener(onItemLongClickListener); 38 | this.adapter = adapter; 39 | } 40 | } 41 | 42 | public final void refresh(T data, int position) { 43 | if (itemViewClickListener != null) { 44 | itemViewClickListener.data = data; 45 | itemViewClickListener.position = position; 46 | } 47 | if (onItemLongClickListener != null) { 48 | onItemLongClickListener.data = data; 49 | onItemLongClickListener.position = position; 50 | } 51 | refreshView(data); 52 | } 53 | 54 | public final void refreshItemWidget(T data, int position, List payloads) { 55 | if (itemViewClickListener != null) { 56 | itemViewClickListener.data = data; 57 | itemViewClickListener.position = position; 58 | } 59 | if (onItemLongClickListener != null) { 60 | onItemLongClickListener.data = data; 61 | onItemLongClickListener.position = position; 62 | } 63 | refreshItemWidgetView(data,payloads); 64 | } 65 | 66 | protected Context getContext() { 67 | return itemView.getContext(); 68 | } 69 | 70 | protected void refreshView(T data) {}; 71 | 72 | protected void refreshItemWidgetView(T data, List payloads){} 73 | 74 | private class ItemViewClickListener implements View.OnClickListener { 75 | 76 | T data; 77 | 78 | int position; 79 | 80 | @Override 81 | public void onClick(View v) { 82 | adapter.onItemClick(data, position); 83 | } 84 | } 85 | 86 | private class OnItemLongClickListener implements View.OnLongClickListener { 87 | T data; 88 | int position; 89 | 90 | @Override 91 | public boolean onLongClick(View view) { 92 | adapter.onItemLongClick(data,position); 93 | return true; 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/bean/CurrencyBean.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.bean; 2 | 3 | /** 4 | * @author qinzishuai 5 | * 描述: 通用bean 6 | * 创建日期:2019/4/26 7 | * 8 | */ 9 | public class CurrencyBean{ 10 | 11 | 12 | /** 13 | * msg : success 14 | * code : 0 15 | * data : {} 16 | */ 17 | 18 | private String errorMsg; 19 | private int errorCode; 20 | private DataBean data; 21 | 22 | public String getMsg() { 23 | return errorMsg; 24 | } 25 | 26 | public void setMsg(String msg) { 27 | this.errorMsg = msg; 28 | } 29 | 30 | public int getCode() { 31 | return errorCode; 32 | } 33 | 34 | public void setCode(int code) { 35 | this.errorCode = code; 36 | } 37 | 38 | public DataBean getData() { 39 | return data; 40 | } 41 | 42 | public void setData(DataBean data) { 43 | this.data = data; 44 | } 45 | 46 | public static class DataBean { 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/common/ItemType.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.common; 2 | 3 | import android.support.annotation.IntDef; 4 | 5 | 6 | @IntDef({ItemType.BIG_SORT, ItemType.SMALL_SORT}) 7 | public @interface ItemType { 8 | int BIG_SORT = 0; 9 | int SMALL_SORT = 1; 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/common/MyApplication.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.common; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.qzs.wanandroid.utils.LogUtils; 7 | import com.scwang.smartrefresh.header.MaterialHeader; 8 | import com.scwang.smartrefresh.layout.SmartRefreshLayout; 9 | import com.scwang.smartrefresh.layout.api.DefaultRefreshFooterCreator; 10 | import com.scwang.smartrefresh.layout.api.DefaultRefreshHeaderCreator; 11 | import com.scwang.smartrefresh.layout.api.RefreshFooter; 12 | import com.scwang.smartrefresh.layout.api.RefreshHeader; 13 | import com.scwang.smartrefresh.layout.api.RefreshLayout; 14 | import com.scwang.smartrefresh.layout.footer.ClassicsFooter; 15 | import com.squareup.leakcanary.LeakCanary; 16 | import com.squareup.leakcanary.RefWatcher; 17 | import com.tencent.smtt.export.external.TbsCoreSettings; 18 | import com.tencent.smtt.sdk.QbSdk; 19 | 20 | import java.util.HashMap; 21 | 22 | /** 23 | * @author qinzishuai 24 | * 描述: 25 | * 创建日期:2019/7/15 26 | * 27 | */ 28 | public class MyApplication extends Application { 29 | 30 | public static Context mContext; 31 | 32 | private RefWatcher refWatcher; 33 | static { 34 | //设置全局的Header构建器 35 | SmartRefreshLayout.setDefaultRefreshHeaderCreator(new DefaultRefreshHeaderCreator() { 36 | @Override 37 | public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) { 38 | 39 | // layout.setPrimaryColorsId(R.color.white, android.R.color.white);//全局设置主题颜色 40 | return new MaterialHeader(context);//.setTimeFormat(new DynamicTimeFormat("更新于 %s"));//指定为经典Header,默认是 贝塞尔雷达Header 41 | } 42 | }); 43 | //设置全局的Footer构建器 44 | SmartRefreshLayout.setDefaultRefreshFooterCreator(new DefaultRefreshFooterCreator() { 45 | @Override 46 | public RefreshFooter createRefreshFooter(Context context, RefreshLayout layout) { 47 | //指定为经典Footer,默认是 BallPulseFooter 48 | return new ClassicsFooter(context).setDrawableSize(20); 49 | 50 | } 51 | }); 52 | } 53 | @Override 54 | public void onCreate() { 55 | super.onCreate(); 56 | mContext = this; 57 | refWatcher= setupLeakCanary(); 58 | initX5(); 59 | } 60 | 61 | /*** 62 | * 腾讯X5内核 63 | */ 64 | private void initX5() { 65 | HashMap map = new HashMap(); 66 | map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true); 67 | QbSdk.initTbsSettings(map); 68 | //非wifi情况下,主动下载x5内核 69 | QbSdk.setDownloadWithoutWifi(true); 70 | //搜集本地tbs内核信息并上报服务器,服务器返回结果决定使用哪个内核。 71 | QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() { 72 | @Override 73 | public void onViewInitFinished(boolean arg0) { 74 | //x5內核初始化完成的回调,为true表示x5内核加载成功,否则表示x5内核加载失败,会自动切换到系统内核。 75 | LogUtils.d("开启TBS===X5加速成功"); 76 | } 77 | 78 | @Override 79 | public void onCoreInitFinished() { 80 | LogUtils.d("开启TBS===X5加速失败"); 81 | 82 | } 83 | }; 84 | //x5内核初始化接口 85 | QbSdk.initX5Environment(getApplicationContext(), cb); 86 | } 87 | 88 | /**获取context对象 89 | * 90 | * @return 91 | */ 92 | public static synchronized Context getContext() { 93 | return mContext; 94 | } 95 | 96 | private RefWatcher setupLeakCanary() { 97 | if (LeakCanary.isInAnalyzerProcess(this)) { 98 | return RefWatcher.DISABLED; 99 | } 100 | return LeakCanary.install(this); 101 | } 102 | 103 | public static RefWatcher getRefWatcher(Context context) { 104 | MyApplication leakApplication = (MyApplication) context.getApplicationContext(); 105 | return leakApplication.refWatcher; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/http/AddCookiesInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.http; 2 | import com.qzs.wanandroid.utils.LogUtils; 3 | import com.qzs.wanandroid.utils.SpUtils; 4 | import java.io.IOException; 5 | import okhttp3.Interceptor; 6 | import okhttp3.Request; 7 | import okhttp3.Response; 8 | 9 | public class AddCookiesInterceptor implements Interceptor { 10 | 11 | @Override 12 | public Response intercept(Chain chain) throws IOException { 13 | 14 | final Request.Builder builder = chain.request().newBuilder(); 15 | 16 | //添加Cookie 17 | // if(!TextUtils.isEmpty(NetClient.COOKIE)){ 18 | builder.addHeader("Cookie", SpUtils.GetConfigString("cookie")); 19 | LogUtils.d("我发送了cookie--------------- "+ SpUtils.GetConfigString("cookie")); 20 | // } 21 | return chain.proceed(builder.build()); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/http/ApiException.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.http; 2 | 3 | 4 | public class ApiException extends RuntimeException { 5 | 6 | private String errorCode; 7 | 8 | public ApiException(String code, String msg) { 9 | super(msg); 10 | this.errorCode = code; 11 | } 12 | 13 | public String getErrorCode() { 14 | return errorCode; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/http/ApiService.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.http; 2 | 3 | 4 | 5 | import com.qzs.wanandroid.bean.CurrencyBean; 6 | import com.qzs.wanandroid.ui.information.bean.BannerBean; 7 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 8 | import com.qzs.wanandroid.ui.information.bean.MyCollectBean; 9 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 10 | import com.qzs.wanandroid.ui.information.bean.ProjectListBean; 11 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 12 | 13 | import java.util.List; 14 | 15 | import io.reactivex.Observable; 16 | import retrofit2.http.Field; 17 | import retrofit2.http.FormUrlEncoded; 18 | import retrofit2.http.GET; 19 | import retrofit2.http.POST; 20 | import retrofit2.http.Path; 21 | import retrofit2.http.Query; 22 | 23 | /** 24 | * @author qinzishuai 25 | * 描述: 接口 26 | * 创建日期:2019/7/12 27 | * 28 | */ 29 | public interface ApiService { 30 | 31 | 32 | String BASE_URL = "https://www.wanandroid.com/"; 33 | 34 | //网络请求时长 35 | int HTTP_TIME =0; 36 | 37 | 38 | /*** 39 | * 获取首页列表数据 40 | * @param page 41 | * @return 42 | */ 43 | @GET("article/list/{page}/json") 44 | Observable> getHomeList(@Path("page") int page); 45 | 46 | /*** 47 | * 获取项目模块的title 48 | * @return 49 | */ 50 | @GET("project/tree/json") 51 | Observable>> getProjectTitle(); 52 | 53 | /*** 54 | * 获取项目模块的内容 55 | * @param page 56 | * @param id 57 | * @return 58 | */ 59 | @GET("project/list/{page}/json") 60 | Observable> getProjectList(@Path("page") int page, @Query("cid") String id); 61 | 62 | 63 | /*** 64 | * 登录 65 | * @param username 66 | * @param password 67 | * @return 68 | */ 69 | @FormUrlEncoded 70 | @POST("user/login") 71 | Observable> login(@Field("username") String username, @Field("password") String password); 72 | 73 | 74 | /**** 75 | * 站内收藏 76 | * @param id 77 | * @return 78 | */ 79 | @POST("lg/collect/{id}/json") 80 | Observable> collectIn(@Path("id") String id); 81 | /**** 82 | * 取消收藏 83 | * @param id 84 | * @return 85 | */ 86 | @POST("lg/uncollect_originId/{id}/json") 87 | Observable> cancelCollect(@Path("id") String id); 88 | 89 | 90 | @FormUrlEncoded 91 | @POST("user/register") 92 | Observable> register(@Field("username") String username, @Field("password") String password, @Field("repassword") String repassword); 93 | 94 | 95 | /*** 96 | * 获取导航lsit 97 | * @return 98 | */ 99 | @GET("navi/json") 100 | Observable>> getNavigateList(); 101 | 102 | 103 | 104 | @FormUrlEncoded 105 | @POST("article/query/{page}/json") 106 | Observable> searchDetail(@Path("page") int page,@Field("k") String k); 107 | 108 | 109 | /*** 110 | * 我的收藏 111 | * @return 112 | */ 113 | @GET("lg/collect/list/{page}/json") 114 | Observable> getMyCollect(@Path("page") int page); 115 | 116 | 117 | 118 | /*** 119 | * 首页banner 120 | * @return 121 | */ 122 | @GET("banner/json") 123 | Observable>> getBanner(); 124 | 125 | 126 | /*** 127 | * 登出 128 | * @return 129 | */ 130 | @GET("user/logout/json") 131 | Observable> loginOut(); 132 | } 133 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/http/BaseResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 jeasonlzy(廖子尧) 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.qzs.wanandroid.http; 17 | 18 | import java.io.Serializable; 19 | 20 | /** 21 | * @author qinzishuai 22 | * 描述: 23 | * 创建日期:2019/7/12 24 | * 25 | */ 26 | public class BaseResponse implements Serializable { 27 | private static int SUCCESS_CODE = 0;//成功的code 28 | private static final long serialVersionUID = 5213230387175987834L; 29 | 30 | public int getCode() { 31 | return errorCode; 32 | } 33 | 34 | public void setCode(int code) { 35 | this.errorCode = code; 36 | } 37 | 38 | public String getMsg() { 39 | return errorMsg; 40 | } 41 | 42 | public void setMsg(String msg) { 43 | this.errorMsg = msg; 44 | } 45 | 46 | public T getData() { 47 | return data; 48 | } 49 | 50 | public void setData(T data) { 51 | this.data = data; 52 | } 53 | 54 | public int errorCode; 55 | public String errorMsg; 56 | public T data; 57 | 58 | 59 | public boolean isSuccess() { 60 | return getCode() == SUCCESS_CODE; 61 | } 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/http/ReceivedCookiesInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.http; 2 | 3 | import com.qzs.wanandroid.utils.LogUtils; 4 | import com.qzs.wanandroid.utils.SpUtils; 5 | 6 | 7 | import java.io.IOException; 8 | 9 | import okhttp3.Interceptor; 10 | import okhttp3.Response; 11 | 12 | public class ReceivedCookiesInterceptor implements Interceptor { 13 | @Override 14 | public Response intercept(Chain chain) throws IOException { 15 | 16 | Response originalResponse = chain.proceed(chain.request()); 17 | 18 | if (!originalResponse.headers("Set-Cookie").isEmpty()) { 19 | StringBuilder stringBuilder = new StringBuilder(); 20 | //解析Cookie 21 | for (String header : originalResponse.headers("Set-Cookie")) { 22 | 23 | stringBuilder.append(header); 24 | 25 | 26 | if(header.contains("JSESSIONID")){ 27 | 28 | String cookie = header.substring(header.indexOf("JSESSIONID"), header.indexOf(";")); 29 | SpUtils.SetConfigString("cookie", cookie); 30 | LogUtils.d("cookie---qzs "+cookie); 31 | 32 | 33 | } 34 | } 35 | LogUtils.d("cookie全部----- " + stringBuilder.toString()); 36 | } 37 | 38 | return originalResponse; 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/imageloader/GlideFile.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.imageloader; 2 | 3 | import android.content.Context; 4 | 5 | import com.bumptech.glide.Glide; 6 | import com.bumptech.glide.request.target.Target; 7 | 8 | import java.io.File; 9 | import java.util.concurrent.ExecutionException; 10 | 11 | public class GlideFile { 12 | 13 | /** 14 | * 加载网络图片 15 | */ 16 | public static File loadIntentPic (Context context,String imgUrl) throws ExecutionException, InterruptedException { 17 | 18 | File file = Glide.with(context) 19 | .load(imgUrl) 20 | .downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL) 21 | .get(); 22 | 23 | return file; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/IBannerModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.ui.information.bean.BannerBean; 5 | import com.qzs.wanandroid.ui.information.bean.ProjectListBean; 6 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @author qinzishuai 12 | * 描述: 13 | * 创建日期:2019/7/20 14 | * 15 | */ 16 | public interface IBannerModel { 17 | 18 | void handleBanner(OnLoadDatasListener> onLoadDatasListener); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/ICollectModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | 6 | /** 7 | * @author qinzishuai 8 | * 描述: 登录model 9 | * 创建日期:2019/7/23 10 | * 11 | */ 12 | public interface ICollectModel { 13 | /**** 14 | * |站内收藏 15 | * @param id 16 | * @param onLoadDatasListener 17 | */ 18 | void handleCollectIn(String id, OnLoadDatasListener onLoadDatasListener); 19 | 20 | /*** 21 | * 取消收藏 22 | */ 23 | void handleCancelCollect(String id, OnLoadDatasListener onLoadDatasListener); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/IFrHomeModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 5 | 6 | /** 7 | * @author qinzishuai 8 | * 描述: 主页fragment-model 9 | * 创建日期:2019/7/17 10 | * 11 | */ 12 | public interface IFrHomeModel { 13 | 14 | void handleHomeList(int page,OnLoadDatasListener onLoadDatasListener); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/IFrProjectModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 6 | import com.qzs.wanandroid.ui.information.bean.ProjectListBean; 7 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author qinzishuai 13 | * 描述: 14 | * 创建日期:2019/7/20 15 | * 16 | */ 17 | public interface IFrProjectModel { 18 | 19 | void handleProjectTitle(OnLoadDatasListener> onLoadDatasListener); 20 | 21 | void handleProjectList(int page, String id,OnLoadDatasListener onLoadDatasListener); 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/ILoginModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 6 | 7 | /** 8 | * @author qinzishuai 9 | * 描述: 登录model 10 | * 创建日期:2019/7/23 11 | * 12 | */ 13 | public interface ILoginModel { 14 | 15 | void handleLogin(String username, String password, OnLoadDatasListener onLoadDatasListener); 16 | 17 | 18 | void handleLoginOut(OnLoadDatasListener onLoadDatasListener); 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/IMyCollectModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 5 | import com.qzs.wanandroid.ui.information.bean.MyCollectBean; 6 | 7 | /** 8 | * @author qinzishuai 9 | * 描述: 10 | * 创建日期:2019/7/31 11 | * 12 | */ 13 | public interface IMyCollectModel { 14 | 15 | void handleMyCollectList(int page, OnLoadDatasListener onLoadDatasListener); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/INavigateModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author qinzishuai 11 | * 描述:导航 12 | * 创建日期:2019/7/25 13 | * 14 | */ 15 | public interface INavigateModel { 16 | 17 | void handleNavigate(OnLoadDatasListener> onLoadDatasListener); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/IRegisterModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | 6 | /** 7 | * @author qinzishuai 8 | * 描述: 注册model 9 | * 创建日期:2019/7/23 10 | * 11 | */ 12 | public interface IRegisterModel { 13 | 14 | void handleRegister(String username, String password,String passwordagain ,OnLoadDatasListener onLoadDatasListener); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/ISearchDetailModel.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 5 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author qinzishuai 11 | * 描述: 搜索 12 | * 创建日期:2019/7/26 13 | * 14 | */ 15 | public interface ISearchDetailModel { 16 | 17 | void handleSearchDetail(int page,String k,OnLoadDatasListener onLoadDatasListener); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/BannerModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.http.BaseObserver; 6 | import com.qzs.wanandroid.http.RetrofitFactory; 7 | import com.qzs.wanandroid.mvp.model.IBannerModel; 8 | import com.qzs.wanandroid.mvp.model.ILoginModel; 9 | import com.qzs.wanandroid.ui.information.bean.BannerBean; 10 | import com.qzs.wanandroid.utils.LogUtils; 11 | 12 | import java.util.List; 13 | 14 | public class BannerModelImpl implements IBannerModel { 15 | 16 | 17 | 18 | @Override 19 | public void handleBanner(final OnLoadDatasListener> onLoadDatasListener) { 20 | RetrofitFactory.getInstence().getBanner(new BaseObserver>() { 21 | @Override 22 | protected void onSuccees(List dataBeans) throws Exception { 23 | onLoadDatasListener.onSuccess(dataBeans); 24 | 25 | } 26 | 27 | @Override 28 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 29 | onLoadDatasListener.onFailure(error); 30 | 31 | } 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/CollectModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.http.BaseObserver; 6 | import com.qzs.wanandroid.http.RetrofitFactory; 7 | import com.qzs.wanandroid.mvp.model.ICollectModel; 8 | import com.qzs.wanandroid.mvp.model.ILoginModel; 9 | import com.qzs.wanandroid.utils.LogUtils; 10 | 11 | public class CollectModelImpl implements ICollectModel { 12 | 13 | 14 | @Override 15 | public void handleCollectIn(String id, final OnLoadDatasListener onLoadDatasListener) { 16 | 17 | 18 | RetrofitFactory 19 | .getInstence().collectIn(id, new BaseObserver() { 20 | @Override 21 | protected void onSuccees(CurrencyBean.DataBean dataBean) throws Exception { 22 | onLoadDatasListener.onSuccess(dataBean); 23 | 24 | } 25 | 26 | @Override 27 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 28 | onLoadDatasListener.onFailure(error); 29 | 30 | } 31 | }); 32 | } 33 | 34 | @Override 35 | public void handleCancelCollect(String id, final OnLoadDatasListener onLoadDatasListener) { 36 | RetrofitFactory 37 | .getInstence().cancelCollect(id, new BaseObserver() { 38 | @Override 39 | protected void onSuccees(CurrencyBean.DataBean dataBean) throws Exception { 40 | 41 | onLoadDatasListener.onSuccess(dataBean); 42 | 43 | } 44 | 45 | @Override 46 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 47 | onLoadDatasListener.onFailure(error); 48 | 49 | } 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/FrHomeModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.http.BaseObserver; 5 | import com.qzs.wanandroid.http.RetrofitFactory; 6 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 7 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 8 | 9 | public class FrHomeModelImpl implements IFrHomeModel { 10 | 11 | /*** 12 | * 获取首页list 13 | * @param onLoadDatasListener 14 | */ 15 | @Override 16 | public void handleHomeList(int page, final OnLoadDatasListener onLoadDatasListener) { 17 | RetrofitFactory 18 | .getInstence() 19 | .getHomeList(page, new BaseObserver() { 20 | @Override 21 | protected void onSuccees(MainListBean.DataBean dataBean) throws Exception { 22 | 23 | onLoadDatasListener.onSuccess(dataBean); 24 | 25 | } 26 | 27 | @Override 28 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 29 | onLoadDatasListener.onFailure(error); 30 | } 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/FrProjectModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.http.BaseObserver; 6 | import com.qzs.wanandroid.http.RetrofitFactory; 7 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 8 | import com.qzs.wanandroid.mvp.model.IFrProjectModel; 9 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 10 | import com.qzs.wanandroid.ui.information.bean.ProjectListBean; 11 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 12 | import com.qzs.wanandroid.utils.LogUtils; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author qinzishuai 18 | * 描述: 19 | * 创建日期:2019/7/20 20 | * 21 | */ 22 | public class FrProjectModelImpl implements IFrProjectModel { 23 | 24 | 25 | @Override 26 | public void handleProjectTitle(final OnLoadDatasListener> onLoadDatasListener) { 27 | RetrofitFactory 28 | .getInstence() 29 | .getProjectTitle( new BaseObserver>() { 30 | @Override 31 | protected void onSuccees(List dataBean) throws Exception { 32 | 33 | LogUtils.d("model--- "+dataBean); 34 | 35 | onLoadDatasListener.onSuccess(dataBean); 36 | 37 | } 38 | 39 | @Override 40 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 41 | onLoadDatasListener.onFailure(error); 42 | } 43 | }); 44 | } 45 | 46 | @Override 47 | public void handleProjectList(int page, String id, final OnLoadDatasListener onLoadDatasListener) { 48 | RetrofitFactory 49 | .getInstence() 50 | .getProjectList( page,id,new BaseObserver() { 51 | @Override 52 | protected void onSuccees(ProjectListBean.DataBean dataBean) throws Exception { 53 | 54 | onLoadDatasListener.onSuccess(dataBean); 55 | 56 | } 57 | 58 | @Override 59 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 60 | onLoadDatasListener.onFailure(error); 61 | } 62 | }); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/LoginModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.http.BaseObserver; 6 | import com.qzs.wanandroid.http.RetrofitFactory; 7 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 8 | import com.qzs.wanandroid.mvp.model.ILoginModel; 9 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 10 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 11 | import com.qzs.wanandroid.utils.LogUtils; 12 | 13 | import java.util.List; 14 | 15 | public class LoginModelImpl implements ILoginModel { 16 | 17 | @Override 18 | public void handleLogin(String username, String password, final OnLoadDatasListener onLoadDatasListener) { 19 | RetrofitFactory 20 | .getInstence() 21 | .login(username, password, new BaseObserver() { 22 | @Override 23 | protected void onSuccees(CurrencyBean.DataBean dataBean) throws Exception { 24 | onLoadDatasListener.onSuccess(dataBean); 25 | 26 | } 27 | 28 | @Override 29 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 30 | onLoadDatasListener.onFailure(error); 31 | 32 | } 33 | }); 34 | 35 | } 36 | 37 | /*** 38 | * 登出 39 | * @param onLoadDatasListener 40 | */ 41 | @Override 42 | public void handleLoginOut(final OnLoadDatasListener onLoadDatasListener) { 43 | RetrofitFactory 44 | .getInstence() 45 | .loginOut(new BaseObserver() { 46 | @Override 47 | protected void onSuccees(CurrencyBean.DataBean dataBean) throws Exception { 48 | onLoadDatasListener.onSuccess(dataBean); 49 | } 50 | 51 | @Override 52 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 53 | onLoadDatasListener.onFailure(error); 54 | } 55 | }); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/MyCollectModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.http.BaseObserver; 5 | import com.qzs.wanandroid.http.RetrofitFactory; 6 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 7 | import com.qzs.wanandroid.mvp.model.IMyCollectModel; 8 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 9 | import com.qzs.wanandroid.ui.information.bean.MyCollectBean; 10 | 11 | public class MyCollectModelImpl implements IMyCollectModel { 12 | 13 | 14 | @Override 15 | public void handleMyCollectList(int page, final OnLoadDatasListener onLoadDatasListener) { 16 | RetrofitFactory 17 | .getInstence() 18 | .getMyCollect(page, new BaseObserver() { 19 | @Override 20 | protected void onSuccees(MyCollectBean.DataBean dataBean) throws Exception { 21 | 22 | onLoadDatasListener.onSuccess(dataBean); 23 | 24 | } 25 | 26 | @Override 27 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 28 | onLoadDatasListener.onFailure(error); 29 | } 30 | }); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/NavigateImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.http.BaseObserver; 6 | import com.qzs.wanandroid.http.RetrofitFactory; 7 | import com.qzs.wanandroid.mvp.model.IFrProjectModel; 8 | import com.qzs.wanandroid.mvp.model.INavigateModel; 9 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 10 | import com.qzs.wanandroid.ui.information.bean.ProjectListBean; 11 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 12 | import com.qzs.wanandroid.utils.LogUtils; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * @author qinzishuai 18 | * 描述: 19 | * 创建日期:2019/7/20 20 | * 21 | */ 22 | public class NavigateImpl implements INavigateModel { 23 | 24 | @Override 25 | public void handleNavigate(final OnLoadDatasListener> onLoadDatasListener) { 26 | RetrofitFactory 27 | .getInstence() 28 | .navigateList(new BaseObserver>() { 29 | @Override 30 | protected void onSuccees(List dataBean) throws Exception { 31 | onLoadDatasListener.onSuccess(dataBean); 32 | 33 | } 34 | 35 | @Override 36 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 37 | onLoadDatasListener.onFailure(error); 38 | 39 | } 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/RegisterModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.http.BaseObserver; 6 | import com.qzs.wanandroid.http.RetrofitFactory; 7 | import com.qzs.wanandroid.mvp.model.ILoginModel; 8 | import com.qzs.wanandroid.mvp.model.IRegisterModel; 9 | import com.qzs.wanandroid.utils.LogUtils; 10 | 11 | public class RegisterModelImpl implements IRegisterModel { 12 | 13 | 14 | @Override 15 | public void handleRegister(String username, String password, String passwordagain, final OnLoadDatasListener onLoadDatasListener) { 16 | 17 | RetrofitFactory 18 | .getInstence() 19 | .register(username, password, passwordagain, new BaseObserver() { 20 | @Override 21 | protected void onSuccees(CurrencyBean.DataBean dataBean) throws Exception { 22 | onLoadDatasListener.onSuccess(dataBean); 23 | 24 | } 25 | 26 | @Override 27 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 28 | onLoadDatasListener.onFailure(error); 29 | } 30 | }); 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/model/impl/SearchDetailModelImpl.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.model.impl; 2 | 3 | import com.qzs.wanandroid.base.OnLoadDatasListener; 4 | import com.qzs.wanandroid.http.BaseObserver; 5 | import com.qzs.wanandroid.http.RetrofitFactory; 6 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 7 | import com.qzs.wanandroid.mvp.model.ISearchDetailModel; 8 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 9 | 10 | import java.util.List; 11 | 12 | public class SearchDetailModelImpl implements ISearchDetailModel { 13 | 14 | 15 | @Override 16 | public void handleSearchDetail(int page, String k, final OnLoadDatasListener onLoadDatasListener) { 17 | RetrofitFactory 18 | .getInstence() 19 | .searchDetail(page, k, new BaseObserver() { 20 | @Override 21 | protected void onSuccees(MainListBean.DataBean dataBeans) throws Exception { 22 | onLoadDatasListener.onSuccess(dataBeans); 23 | } 24 | 25 | @Override 26 | protected void onFailure(String error, boolean isNetWorkError) throws Exception { 27 | onLoadDatasListener.onFailure(error); 28 | } 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/ArticleDetailsPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | 4 | import com.qzs.wanandroid.base.BaseMvpPresenter; 5 | import com.qzs.wanandroid.mvp.view.IArticleDetailView; 6 | import com.qzs.wanandroid.mvp.view.IMainView; 7 | 8 | public class ArticleDetailsPresenter extends BaseMvpPresenter { 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/CurrencyPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | 4 | import com.qzs.wanandroid.base.BaseMvpPresenter; 5 | import com.qzs.wanandroid.mvp.view.CurrencyView; 6 | import com.qzs.wanandroid.mvp.view.IArticleDetailView; 7 | 8 | public class CurrencyPresenter extends BaseMvpPresenter { 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/FrHomePresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import com.qzs.wanandroid.base.BaseMvpPresenter; 4 | import com.qzs.wanandroid.base.OnLoadDatasListener; 5 | import com.qzs.wanandroid.mvp.model.IBannerModel; 6 | import com.qzs.wanandroid.mvp.model.impl.BannerModelImpl; 7 | import com.qzs.wanandroid.mvp.view.IFragmentHomeView; 8 | import com.qzs.wanandroid.ui.information.bean.BannerBean; 9 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 10 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 11 | import com.qzs.wanandroid.mvp.model.impl.FrHomeModelImpl; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @author qinzishuai 17 | * 描述: 首页fragment 的P层 18 | * 创建日期:2019/7/20 19 | * 20 | */ 21 | public class FrHomePresenter extends BaseMvpPresenter { 22 | 23 | private IFrHomeModel iFrHomeModel; 24 | 25 | private IBannerModel iBannerModel; 26 | 27 | 28 | 29 | public FrHomePresenter() { 30 | 31 | this.iFrHomeModel = new FrHomeModelImpl(); 32 | this.iBannerModel=new BannerModelImpl(); 33 | } 34 | 35 | /*** 36 | * 获取首页list 37 | */ 38 | public void getHomeList(final String type){ 39 | 40 | if (mView == null) return; 41 | 42 | iFrHomeModel.handleHomeList(mView.getPage(), new OnLoadDatasListener() { 43 | @Override 44 | public void onSuccess(MainListBean.DataBean dataBean) { 45 | 46 | mView.cancelLoadDialog(); 47 | getView().getMainListSuccess(dataBean,type); 48 | 49 | } 50 | 51 | @Override 52 | public void onFailure(String error) { 53 | if (type.equals("首次加载")){ 54 | mView.cancelLoadDialog(); 55 | } 56 | getView().getMainListFail(); 57 | 58 | } 59 | }); 60 | 61 | 62 | } 63 | 64 | 65 | public void getBanner(){ 66 | if (mView == null) return; 67 | iBannerModel.handleBanner(new OnLoadDatasListener>() { 68 | @Override 69 | public void onSuccess(List dataBeans) { 70 | mView.getBannerSuccess(dataBeans); 71 | } 72 | 73 | @Override 74 | public void onFailure(String error) { 75 | mView.getBannerFail(); 76 | 77 | } 78 | }); 79 | 80 | 81 | 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/FrPCenterPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import com.qzs.wanandroid.base.BaseMvpPresenter; 4 | import com.qzs.wanandroid.base.OnLoadDatasListener; 5 | import com.qzs.wanandroid.bean.CurrencyBean; 6 | import com.qzs.wanandroid.mvp.model.ILoginModel; 7 | import com.qzs.wanandroid.mvp.model.impl.LoginModelImpl; 8 | import com.qzs.wanandroid.mvp.view.IFragmentPCenterView; 9 | 10 | public class FrPCenterPresenter extends BaseMvpPresenter { 11 | 12 | private ILoginModel iLoginModel; 13 | 14 | 15 | 16 | public FrPCenterPresenter() { 17 | 18 | this.iLoginModel = new LoginModelImpl(); 19 | } 20 | 21 | public void loginOut(){ 22 | if (mView == null) return; 23 | getView().getLoadDialog().show(); 24 | iLoginModel.handleLoginOut(new OnLoadDatasListener() { 25 | @Override 26 | public void onSuccess(CurrencyBean.DataBean dataBean) { 27 | getView().cancelLoadDialog(); 28 | mView.loginOutSuccess(dataBean); 29 | } 30 | 31 | @Override 32 | public void onFailure(String error) { 33 | getView().cancelLoadDialog(); 34 | getView().LoginOutFail(); 35 | 36 | } 37 | }); 38 | 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/FrProjectPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import com.qzs.wanandroid.base.BaseMvpPresenter; 4 | import com.qzs.wanandroid.base.OnLoadDatasListener; 5 | import com.qzs.wanandroid.bean.CurrencyBean; 6 | import com.qzs.wanandroid.mvp.model.IFrProjectModel; 7 | import com.qzs.wanandroid.mvp.model.impl.FrHomeModelImpl; 8 | import com.qzs.wanandroid.mvp.model.impl.FrProjectModelImpl; 9 | import com.qzs.wanandroid.mvp.view.IFragmentPCenterView; 10 | import com.qzs.wanandroid.mvp.view.IFragmentProjectView; 11 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 12 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 13 | import com.qzs.wanandroid.utils.LogUtils; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * @author qinzishuai 19 | * 描述: 项目fragment -P层 20 | * 创建日期:2019/7/20 21 | * 22 | */ 23 | public class FrProjectPresenter extends BaseMvpPresenter { 24 | 25 | private IFrProjectModel iFrProjectModel; 26 | 27 | 28 | public FrProjectPresenter() { 29 | 30 | this.iFrProjectModel = new FrProjectModelImpl(); 31 | } 32 | 33 | /*** 34 | * 获取首页list 35 | */ 36 | public void getProjectTitle(){ 37 | 38 | if (mView == null) return; 39 | iFrProjectModel.handleProjectTitle(new OnLoadDatasListener>() { 40 | @Override 41 | public void onSuccess(List dataBean) { 42 | LogUtils.d("Pceng--- "+dataBean); 43 | getView().getProjectTitleSuccess(dataBean); 44 | 45 | } 46 | 47 | @Override 48 | public void onFailure(String error) { 49 | getView().cancelLoadDialog(); 50 | getView().getProjectTitleFail(); 51 | 52 | } 53 | }); 54 | 55 | 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/FrProjectSecPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import com.qzs.wanandroid.base.BaseMvpPresenter; 4 | import com.qzs.wanandroid.base.OnLoadDatasListener; 5 | import com.qzs.wanandroid.bean.CurrencyBean; 6 | import com.qzs.wanandroid.mvp.model.ICollectModel; 7 | import com.qzs.wanandroid.mvp.model.IFrProjectModel; 8 | import com.qzs.wanandroid.mvp.model.impl.CollectModelImpl; 9 | import com.qzs.wanandroid.mvp.model.impl.FrProjectModelImpl; 10 | import com.qzs.wanandroid.mvp.view.IFrProjectSecView; 11 | import com.qzs.wanandroid.mvp.view.IFragmentProjectView; 12 | import com.qzs.wanandroid.ui.information.bean.ProjectListBean; 13 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 14 | import com.qzs.wanandroid.utils.LogUtils; 15 | 16 | import java.util.List; 17 | 18 | /** 19 | * @author qinzishuai 20 | * 描述: 项目2层fragment -P层 21 | * 创建日期:2019/7/20 22 | * 23 | */ 24 | public class FrProjectSecPresenter extends BaseMvpPresenter { 25 | /*** 26 | * 获取项目list-model 27 | */ 28 | private IFrProjectModel iFrProjectModel; 29 | /*** 30 | * 收藏-model 31 | */ 32 | private ICollectModel iCollectModel; 33 | 34 | 35 | public FrProjectSecPresenter() { 36 | 37 | this.iFrProjectModel = new FrProjectModelImpl(); 38 | this.iCollectModel=new CollectModelImpl(); 39 | } 40 | 41 | public void getProjectList(final String type){ 42 | 43 | if (mView == null) return; 44 | 45 | iFrProjectModel.handleProjectList(mView.getPage(), mView.getClassifyId(), new OnLoadDatasListener() { 46 | @Override 47 | public void onSuccess(ProjectListBean.DataBean dataBean) { 48 | 49 | getView().getProjectListSuccess(dataBean,type); 50 | } 51 | 52 | @Override 53 | public void onFailure(String error) { 54 | 55 | getView().getProjectTitleFail(); 56 | 57 | } 58 | }); 59 | 60 | 61 | } 62 | 63 | /**** 64 | * 站内收藏 65 | */ 66 | public void handleCollectIn(){ 67 | if (mView == null) return; 68 | getView().getLoadDialog().show(); 69 | iCollectModel.handleCollectIn(mView.getCollectId(), new OnLoadDatasListener() { 70 | @Override 71 | public void onSuccess(CurrencyBean.DataBean dataBean) { 72 | getView().cancelLoadDialog(); 73 | getView().collectSuccess(); 74 | 75 | } 76 | 77 | @Override 78 | public void onFailure(String error) { 79 | getView().collectFail(); 80 | getView().cancelLoadDialog(); 81 | 82 | } 83 | }); 84 | 85 | } 86 | 87 | public void cancelCollect(){ 88 | if (mView == null) return; 89 | getView().getLoadDialog().show(); 90 | iCollectModel.handleCancelCollect(mView.getCollectId()+"", new OnLoadDatasListener() { 91 | @Override 92 | public void onSuccess(CurrencyBean.DataBean dataBean) { 93 | getView().cancelLoadDialog(); 94 | getView().CancelCollectSuccess(); 95 | } 96 | 97 | @Override 98 | public void onFailure(String error) { 99 | getView().cancelLoadDialog(); 100 | getView().CancelCollectFail(); 101 | } 102 | }); 103 | } 104 | 105 | 106 | } 107 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/LoginPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.qzs.wanandroid.base.BaseMvpPresenter; 6 | import com.qzs.wanandroid.base.OnLoadDatasListener; 7 | import com.qzs.wanandroid.bean.CurrencyBean; 8 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 9 | import com.qzs.wanandroid.mvp.model.ILoginModel; 10 | import com.qzs.wanandroid.mvp.model.impl.FrHomeModelImpl; 11 | import com.qzs.wanandroid.mvp.model.impl.LoginModelImpl; 12 | import com.qzs.wanandroid.mvp.view.IFragmentHomeView; 13 | import com.qzs.wanandroid.mvp.view.ILoginView; 14 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 15 | import com.qzs.wanandroid.utils.CommonUtil; 16 | import com.qzs.wanandroid.utils.LogUtils; 17 | 18 | /** 19 | * @author qinzishuai 20 | * 描述: 登录 21 | * 创建日期:2019/7/23 22 | * 23 | */ 24 | public class LoginPresenter extends BaseMvpPresenter { 25 | 26 | private ILoginModel iLoginModel; 27 | 28 | 29 | public LoginPresenter(){ 30 | this.iLoginModel=new LoginModelImpl(); 31 | 32 | } 33 | 34 | 35 | public void handleLogin(){ 36 | if (mView == null) return; 37 | 38 | if (TextUtils.isEmpty(mView.getUser()) || TextUtils.isEmpty(mView.getPassword())) { 39 | CommonUtil.showToast("用户名或密码不能为空"); 40 | return; 41 | } 42 | getView().getLoadDialog().show(); 43 | iLoginModel.handleLogin(mView.getUser(), mView.getPassword(), new OnLoadDatasListener() { 44 | @Override 45 | public void onSuccess(CurrencyBean.DataBean dataBean) { 46 | getView().cancelLoadDialog(); 47 | getView().loginSuccess(); 48 | 49 | } 50 | 51 | @Override 52 | public void onFailure(String error) { 53 | getView().cancelLoadDialog(); 54 | getView().loginFail(); 55 | } 56 | }); 57 | 58 | 59 | 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/MainPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | 4 | import com.qzs.wanandroid.base.BaseMvpPresenter; 5 | import com.qzs.wanandroid.mvp.view.IMainView; 6 | 7 | public class MainPresenter extends BaseMvpPresenter { 8 | 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/MyCollectPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import com.qzs.wanandroid.base.BaseMvpPresenter; 4 | import com.qzs.wanandroid.base.OnLoadDatasListener; 5 | import com.qzs.wanandroid.bean.CurrencyBean; 6 | import com.qzs.wanandroid.mvp.model.ICollectModel; 7 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 8 | import com.qzs.wanandroid.mvp.model.IMyCollectModel; 9 | import com.qzs.wanandroid.mvp.model.impl.CollectModelImpl; 10 | import com.qzs.wanandroid.mvp.model.impl.FrHomeModelImpl; 11 | import com.qzs.wanandroid.mvp.model.impl.MyCollectModelImpl; 12 | import com.qzs.wanandroid.mvp.view.IFragmentHomeView; 13 | import com.qzs.wanandroid.mvp.view.IMyCollectView; 14 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 15 | import com.qzs.wanandroid.ui.information.bean.MyCollectBean; 16 | 17 | /** 18 | * @author qinzishuai 19 | * 描述: 我的收藏-p层 20 | * 创建日期:2019/7/31 21 | * 22 | */ 23 | public class MyCollectPresenter extends BaseMvpPresenter { 24 | 25 | private IMyCollectModel iMyCollectModel; 26 | 27 | private ICollectModel iCollectModel; 28 | 29 | public MyCollectPresenter(){ 30 | this.iMyCollectModel=new MyCollectModelImpl(); 31 | this.iCollectModel=new CollectModelImpl(); 32 | } 33 | 34 | public void getMyCollectList(final String type){ 35 | if (mView == null) return; 36 | iMyCollectModel.handleMyCollectList(mView.getPage(), new OnLoadDatasListener() { 37 | @Override 38 | public void onSuccess(MyCollectBean.DataBean dataBean) { 39 | mView.cancelLoadDialog(); 40 | getView().getMainListSuccess(dataBean,type); 41 | } 42 | 43 | @Override 44 | public void onFailure(String error) { 45 | if (type.equals("首次加载")){ 46 | mView.cancelLoadDialog(); 47 | } 48 | getView().getMainListFail(); 49 | } 50 | }); 51 | 52 | } 53 | 54 | public void cancelCollect(){ 55 | 56 | if (mView == null) return; 57 | getView().getLoadDialog().show(); 58 | iCollectModel.handleCancelCollect(mView.getCollectId()+"", new OnLoadDatasListener() { 59 | @Override 60 | public void onSuccess(CurrencyBean.DataBean dataBean) { 61 | getView().cancelLoadDialog(); 62 | getView().CancelCollectSuccess(); 63 | } 64 | 65 | @Override 66 | public void onFailure(String error) { 67 | getView().cancelLoadDialog(); 68 | getView().CancelCollectFail(); 69 | } 70 | }); 71 | } 72 | 73 | 74 | } 75 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/NavigatePresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.qzs.wanandroid.base.BaseMvpPresenter; 6 | import com.qzs.wanandroid.base.OnLoadDatasListener; 7 | import com.qzs.wanandroid.bean.CurrencyBean; 8 | import com.qzs.wanandroid.mvp.model.INavigateModel; 9 | import com.qzs.wanandroid.mvp.model.IRegisterModel; 10 | import com.qzs.wanandroid.mvp.model.impl.NavigateImpl; 11 | import com.qzs.wanandroid.mvp.model.impl.RegisterModelImpl; 12 | import com.qzs.wanandroid.mvp.view.INavigateView; 13 | import com.qzs.wanandroid.mvp.view.IRegisterView; 14 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 15 | import com.qzs.wanandroid.utils.CommonUtil; 16 | 17 | import java.util.List; 18 | 19 | /** 20 | * @author qinzishuai 21 | * 描述: 导航-P层 22 | * 创建日期:2019/7/25 23 | * 24 | */ 25 | public class NavigatePresenter extends BaseMvpPresenter { 26 | 27 | private INavigateModel iNavigateModel; 28 | 29 | public NavigatePresenter(){ 30 | this.iNavigateModel=new NavigateImpl(); 31 | 32 | } 33 | 34 | public void getNavigateList(){ 35 | 36 | if (mView == null) return; 37 | iNavigateModel.handleNavigate(new OnLoadDatasListener>() { 38 | @Override 39 | public void onSuccess(List dataBean) { 40 | getView().navigateListSuccess(dataBean); 41 | 42 | } 43 | 44 | @Override 45 | public void onFailure(String error) { 46 | getView().navigateListFail(); 47 | 48 | } 49 | }); 50 | 51 | } 52 | 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/RegisterPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import android.text.TextUtils; 4 | 5 | import com.qzs.wanandroid.base.BaseMvpPresenter; 6 | import com.qzs.wanandroid.base.OnLoadDatasListener; 7 | import com.qzs.wanandroid.bean.CurrencyBean; 8 | import com.qzs.wanandroid.mvp.model.ILoginModel; 9 | import com.qzs.wanandroid.mvp.model.IRegisterModel; 10 | import com.qzs.wanandroid.mvp.model.impl.LoginModelImpl; 11 | import com.qzs.wanandroid.mvp.model.impl.RegisterModelImpl; 12 | import com.qzs.wanandroid.mvp.view.ILoginView; 13 | import com.qzs.wanandroid.mvp.view.IRegisterView; 14 | import com.qzs.wanandroid.utils.CommonUtil; 15 | import com.qzs.wanandroid.utils.LogUtils; 16 | 17 | /** 18 | * @author qinzishuai 19 | * 描述: 注册 20 | * 创建日期:2019/7/23 21 | * 22 | */ 23 | public class RegisterPresenter extends BaseMvpPresenter { 24 | 25 | private IRegisterModel iRegisterModel; 26 | public RegisterPresenter(){ 27 | this.iRegisterModel=new RegisterModelImpl(); 28 | 29 | } 30 | 31 | 32 | public void handleRegister(){ 33 | if (mView == null) return; 34 | 35 | if (TextUtils.isEmpty(mView.getUser()) || TextUtils.isEmpty(mView.getPassword())) { 36 | CommonUtil.showToast("用户名或密码不能为空"); 37 | return; 38 | } 39 | 40 | getView().getLoadDialog().show(); 41 | iRegisterModel.handleRegister(mView.getUser(), mView.getPassword(), mView.getPasswordAgain(), new OnLoadDatasListener() { 42 | @Override 43 | public void onSuccess(CurrencyBean.DataBean dataBean) { 44 | getView().cancelLoadDialog(); 45 | getView().registerSuccess(); 46 | 47 | } 48 | 49 | @Override 50 | public void onFailure(String error) { 51 | getView().cancelLoadDialog(); 52 | getView().registerFail(); 53 | } 54 | }); 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/presenter/SearchDetailPresenter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.presenter; 2 | 3 | import com.qzs.wanandroid.base.BaseMvpPresenter; 4 | import com.qzs.wanandroid.base.OnLoadDatasListener; 5 | import com.qzs.wanandroid.mvp.model.IFrHomeModel; 6 | import com.qzs.wanandroid.mvp.model.ISearchDetailModel; 7 | import com.qzs.wanandroid.mvp.model.impl.FrHomeModelImpl; 8 | import com.qzs.wanandroid.mvp.model.impl.SearchDetailModelImpl; 9 | import com.qzs.wanandroid.mvp.view.IFragmentHomeView; 10 | import com.qzs.wanandroid.mvp.view.ISearchDetailView; 11 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * @author qinzishuai 17 | * 描述: 首页搜索详情 18 | * 创建日期:2019/7/24 19 | * 20 | */ 21 | public class SearchDetailPresenter extends BaseMvpPresenter { 22 | /*** 23 | * 首页-fragment model 24 | */ 25 | private ISearchDetailModel iSearchDetailModel; 26 | 27 | public SearchDetailPresenter() { 28 | 29 | this.iSearchDetailModel = new SearchDetailModelImpl(); 30 | } 31 | 32 | public void getSearchDetial(final String type){ 33 | 34 | if (mView == null) return; 35 | 36 | getView().getLoadDialog().show(); 37 | iSearchDetailModel.handleSearchDetail(mView.getPage(), mView.getK(), new OnLoadDatasListener() { 38 | @Override 39 | public void onSuccess(MainListBean.DataBean dataBean) { 40 | getView().cancelLoadDialog(); 41 | getView().getMainListSuccess(dataBean,type); 42 | } 43 | 44 | @Override 45 | public void onFailure(String error) { 46 | getView().getMainListFail(); 47 | 48 | } 49 | }); 50 | 51 | 52 | 53 | 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/CurrencyView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | 5 | /** 6 | * @author qinzishuai 7 | * 描述: 通用 8 | * 创建日期:2019/7/23 9 | * 10 | */ 11 | public interface CurrencyView extends IBaseMvpView { 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/IArticleDetailView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | /** 5 | * @author qinzishuai 6 | * 描述: 文章详情 7 | * 创建日期:2019/7/19 8 | * 9 | */ 10 | public interface IArticleDetailView extends IBaseMvpView { 11 | 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/IFrProjectSecView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | import com.qzs.wanandroid.ui.information.bean.ProjectListBean; 5 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 6 | 7 | import java.util.List; 8 | 9 | public interface IFrProjectSecView extends IBaseMvpView { 10 | 11 | 12 | /*** 13 | * 获取项目list成功 14 | */ 15 | void getProjectListSuccess(ProjectListBean.DataBean dataBeanList,String type); 16 | 17 | /*** 18 | * 获取项目list失败 19 | */ 20 | void getProjectTitleFail(); 21 | 22 | /*** 23 | * 获取当前页 24 | */ 25 | int getPage(); 26 | 27 | /*** 28 | * 获取分类ID 29 | */ 30 | 31 | String getClassifyId(); 32 | 33 | 34 | 35 | /*** 36 | * 收藏成功 37 | */ 38 | void collectSuccess(); 39 | 40 | /*** 41 | * 收藏失败 42 | */ 43 | void collectFail(); 44 | 45 | 46 | /*** 47 | * 获取收藏的ID 48 | */ 49 | String getCollectId(); 50 | 51 | 52 | 53 | /*** 54 | * 取消收藏成功 55 | */ 56 | void CancelCollectSuccess(); 57 | 58 | /*** 59 | * 取消收藏失败 60 | */ 61 | void CancelCollectFail(); 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/IFragmentHomeView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | import com.qzs.wanandroid.ui.information.bean.BannerBean; 5 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 6 | 7 | import java.util.List; 8 | 9 | public interface IFragmentHomeView extends IBaseMvpView { 10 | 11 | 12 | 13 | /*** 14 | * 获取首页list成功 15 | */ 16 | void getMainListSuccess(MainListBean.DataBean dataBean, String type); 17 | 18 | /*** 19 | * 获取首页list失败 20 | */ 21 | void getMainListFail(); 22 | 23 | 24 | /*** 25 | * 获取当前加载页数 26 | */ 27 | int getPage(); 28 | 29 | 30 | /*** 31 | * 获取首页banner成功 32 | */ 33 | void getBannerSuccess(List dataBean); 34 | 35 | /*** 36 | * 获取首页banner失败 37 | */ 38 | void getBannerFail(); 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/IFragmentPCenterView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.ui.information.bean.BannerBean; 6 | 7 | import java.util.List; 8 | 9 | public interface IFragmentPCenterView extends IBaseMvpView { 10 | 11 | /*** 12 | * 登出成功 13 | */ 14 | void loginOutSuccess(CurrencyBean.DataBean dataBean); 15 | 16 | /*** 17 | * 登出失败 18 | */ 19 | void LoginOutFail(); 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/IFragmentProjectView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | import com.qzs.wanandroid.bean.CurrencyBean; 5 | import com.qzs.wanandroid.ui.information.bean.ProjectTitleBean; 6 | 7 | import java.util.List; 8 | 9 | public interface IFragmentProjectView extends IBaseMvpView { 10 | 11 | 12 | /*** 13 | * 获取项目title成功 14 | */ 15 | void getProjectTitleSuccess(List dataBeanList); 16 | 17 | /*** 18 | * 获取项目title失败 19 | */ 20 | void getProjectTitleFail(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/ILoginView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 5 | /** 6 | * @author qinzishuai 7 | * 描述: 登录 8 | * 创建日期:2019/7/23 9 | * 10 | */ 11 | public interface ILoginView extends IBaseMvpView { 12 | 13 | 14 | /*** 15 | * 登录成功 16 | */ 17 | void loginSuccess(); 18 | 19 | /*** 20 | * 登录失败 21 | */ 22 | void loginFail(); 23 | 24 | 25 | /*** 26 | * 获取用户名 27 | */ 28 | String getUser(); 29 | 30 | /*** 31 | * 获取密码 32 | * @return 33 | */ 34 | String getPassword(); 35 | 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/IMainView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | 5 | public interface IMainView extends IBaseMvpView { 6 | 7 | 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/IMyCollectView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 5 | import com.qzs.wanandroid.ui.information.bean.MyCollectBean; 6 | 7 | public interface IMyCollectView extends IBaseMvpView { 8 | 9 | 10 | 11 | /*** 12 | * 获取收藏list成功 13 | */ 14 | void getMainListSuccess(MyCollectBean.DataBean dataBean, String type); 15 | 16 | /*** 17 | * 获取收藏list失败 18 | */ 19 | void getMainListFail(); 20 | 21 | 22 | /*** 23 | * 获取当前加载页数 24 | */ 25 | int getPage(); 26 | 27 | 28 | 29 | /*** 30 | * 获取ID 31 | */ 32 | String getCollectId(); 33 | 34 | /*** 35 | * 取消收藏成功 36 | */ 37 | void CancelCollectSuccess(); 38 | 39 | /*** 40 | * 取消收藏失败 41 | */ 42 | void CancelCollectFail(); 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/INavigateView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author qinzishuai 10 | * 描述: 导航view 11 | * 创建日期:2019/7/25 12 | * 13 | */ 14 | public interface INavigateView extends IBaseMvpView { 15 | 16 | 17 | /*** 18 | * 获取导航list成功的回调 19 | */ 20 | void navigateListSuccess(List dataBean); 21 | 22 | /*** 23 | * 获取导航list失败的回调 24 | */ 25 | void navigateListFail(); 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/IRegisterView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | 5 | /** 6 | * @author qinzishuai 7 | * 描述: 注册 8 | * 创建日期:2019/7/23 9 | * 10 | */ 11 | public interface IRegisterView extends IBaseMvpView { 12 | 13 | 14 | /*** 15 | * 注册成功 16 | */ 17 | void registerSuccess(); 18 | 19 | /*** 20 | * 登录失败 21 | */ 22 | void registerFail(); 23 | 24 | 25 | /*** 26 | * 获取用户名 27 | */ 28 | String getUser(); 29 | 30 | /*** 31 | * 获取密码 32 | * @return 33 | */ 34 | String getPassword(); 35 | 36 | /*** 37 | * 获取再次输入的密码 38 | * @return 39 | */ 40 | String getPasswordAgain(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/mvp/view/ISearchDetailView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.mvp.view; 2 | 3 | import com.qzs.wanandroid.base.IBaseMvpView; 4 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 5 | 6 | import java.util.List; 7 | 8 | public interface ISearchDetailView extends IBaseMvpView { 9 | 10 | 11 | 12 | /*** 13 | * 获取首页list成功 14 | */ 15 | void getMainListSuccess(MainListBean.DataBean dataBeans, String type); 16 | 17 | /*** 18 | * 获取首页list失败 19 | */ 20 | void getMainListFail(); 21 | 22 | 23 | /*** 24 | * 获取当前加载页数 25 | */ 26 | int getPage(); 27 | 28 | /*** 29 | * 获取关键词 30 | * @return 31 | */ 32 | String getK(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/activity/LoginActivity.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.activity; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.content.Intent; 6 | import android.os.Bundle; 7 | import android.support.v7.widget.AppCompatTextView; 8 | import android.view.View; 9 | import android.widget.Button; 10 | import android.widget.EditText; 11 | 12 | import com.qzs.wanandroid.R; 13 | import com.qzs.wanandroid.base.BaseMvpActivity; 14 | import com.qzs.wanandroid.common.MainActivity; 15 | import com.qzs.wanandroid.mvp.presenter.LoginPresenter; 16 | import com.qzs.wanandroid.mvp.view.ILoginView; 17 | import com.qzs.wanandroid.utils.SpUtils; 18 | 19 | /** 20 | * @author qinzishuai 21 | * 描述: 登录 22 | * 创建日期:2019/7/23 23 | * 24 | */ 25 | public class LoginActivity extends BaseMvpActivity implements ILoginView{ 26 | 27 | private EditText etUsername; 28 | private EditText etPassword; 29 | private Button btnLogin; 30 | private AppCompatTextView tvRegister; 31 | 32 | 33 | 34 | @Override 35 | protected LoginPresenter createPresenter() { 36 | 37 | return new LoginPresenter(); 38 | } 39 | 40 | @Override 41 | public void onClick(View v) { 42 | if (v.getId()==R.id.btn_login){ 43 | mPresenter.handleLogin(); 44 | } 45 | else if (v.getId()==R.id.tv_register){ 46 | LoginActivity.startRegister(this); 47 | } 48 | 49 | } 50 | 51 | @Override 52 | public int getLayout() { 53 | 54 | return R.layout.activity_login; 55 | } 56 | 57 | @Override 58 | public void initView() { 59 | etUsername = findViewById(R.id.et_username); 60 | etPassword = findViewById(R.id.et_password); 61 | btnLogin = findViewById(R.id.btn_login); 62 | tvRegister = findViewById(R.id.tv_register); 63 | btnLogin.setOnClickListener(this); 64 | tvRegister.setOnClickListener(this); 65 | } 66 | 67 | @Override 68 | public void initData(Bundle savedInstanceState) { 69 | 70 | } 71 | 72 | @Override 73 | public Dialog getLoadDialog() { 74 | return dialog; 75 | } 76 | 77 | @Override 78 | public void cancelLoadDialog() { 79 | if (dialog!=null&&dialog.isShowing()){ 80 | dialog.dismiss(); 81 | } 82 | 83 | } 84 | 85 | @Override 86 | public void loginSuccess() { 87 | SpUtils.SetConfigString("username",etUsername.getText().toString()); 88 | LoginActivity.startMain(this); 89 | 90 | } 91 | 92 | @Override 93 | public void loginFail() { 94 | 95 | } 96 | 97 | @Override 98 | public String getUser() { 99 | return etUsername.getText().toString().trim(); 100 | } 101 | 102 | @Override 103 | public String getPassword() { 104 | return etPassword.getText().toString().trim(); 105 | } 106 | 107 | public static void startMain(Context context){ 108 | Intent intent=new Intent(context, MainActivity.class); 109 | context.startActivity(intent); 110 | 111 | } 112 | 113 | public static void startRegister(Context context){ 114 | Intent intent=new Intent(context, RegisterActivity.class); 115 | context.startActivity(intent); 116 | 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/activity/QzsActivity.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.activity; 2 | 3 | import android.app.Dialog; 4 | import android.os.Bundle; 5 | import android.support.v7.widget.AppCompatTextView; 6 | import android.view.View; 7 | import android.widget.ImageView; 8 | 9 | import com.gyf.immersionbar.ImmersionBar; 10 | import com.qzs.wanandroid.R; 11 | import com.qzs.wanandroid.base.BaseMvpActivity; 12 | import com.qzs.wanandroid.mvp.presenter.CurrencyPresenter; 13 | import com.qzs.wanandroid.mvp.view.CurrencyView; 14 | 15 | public class QzsActivity extends BaseMvpActivity { 16 | private ImageView ivToolbarLeft; 17 | private AppCompatTextView tvTitle; 18 | 19 | 20 | @Override 21 | protected CurrencyPresenter createPresenter() { 22 | return new CurrencyPresenter(); 23 | } 24 | 25 | @Override 26 | public void onClick(View v) { 27 | if (v.getId()==R.id.iv_toolbar_left){ 28 | finish(); 29 | } 30 | 31 | } 32 | 33 | @Override 34 | public int getLayout() { 35 | return R.layout.activity_qzs; 36 | } 37 | 38 | @Override 39 | public void initView() { 40 | 41 | ivToolbarLeft = findViewById(R.id.iv_toolbar_left); 42 | tvTitle = findViewById(R.id.tv_title); 43 | ivToolbarLeft.setOnClickListener(this); 44 | tvTitle.setText("关于我"); 45 | } 46 | 47 | @Override 48 | public void initData(Bundle savedInstanceState) { 49 | ImmersionBar.with(this).titleBar(R.id.toolbar).init(); 50 | } 51 | 52 | @Override 53 | public Dialog getLoadDialog() { 54 | return null; 55 | } 56 | 57 | @Override 58 | public void cancelLoadDialog() { 59 | 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/activity/RegisterActivity.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.activity; 2 | 3 | import android.app.Dialog; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.Button; 7 | import android.widget.EditText; 8 | import android.widget.LinearLayout; 9 | 10 | import com.qzs.wanandroid.R; 11 | import com.qzs.wanandroid.base.BaseMvpActivity; 12 | import com.qzs.wanandroid.mvp.presenter.CurrencyPresenter; 13 | import com.qzs.wanandroid.mvp.presenter.RegisterPresenter; 14 | import com.qzs.wanandroid.mvp.view.CurrencyView; 15 | import com.qzs.wanandroid.mvp.view.IRegisterView; 16 | import com.qzs.wanandroid.utils.SpUtils; 17 | 18 | /** 19 | * @author qinzishuai 20 | * 描述: 注册 21 | * 创建日期:2019/7/23 22 | * 23 | */ 24 | public class RegisterActivity extends BaseMvpActivity implements IRegisterView { 25 | private EditText etUsername; 26 | private EditText etPassword; 27 | private EditText etPasswordAgain; 28 | private Button btnRegister; 29 | private LinearLayout llLogin; 30 | 31 | 32 | 33 | @Override 34 | protected RegisterPresenter createPresenter() { 35 | return new RegisterPresenter(); 36 | } 37 | 38 | @Override 39 | public void onClick(View v) { 40 | if (v.getId()==R.id.ll_login){ 41 | finish(); 42 | } 43 | 44 | else if (v.getId()==R.id.btn_register){ 45 | mPresenter.handleRegister(); 46 | 47 | } 48 | 49 | } 50 | 51 | @Override 52 | public int getLayout() { 53 | return R.layout.activity_register; 54 | } 55 | 56 | @Override 57 | public void initView() { 58 | etUsername = findViewById(R.id.et_username); 59 | etPassword = findViewById(R.id.et_password); 60 | etPasswordAgain = findViewById(R.id.et_password_again); 61 | btnRegister = findViewById(R.id.btn_register); 62 | llLogin = findViewById(R.id.ll_login); 63 | 64 | llLogin.setOnClickListener(this); 65 | btnRegister.setOnClickListener(this); 66 | } 67 | 68 | @Override 69 | public void initData(Bundle savedInstanceState) { 70 | 71 | } 72 | 73 | @Override 74 | public Dialog getLoadDialog() { 75 | return dialog; 76 | } 77 | 78 | @Override 79 | public void cancelLoadDialog() { 80 | if (dialog!=null&&dialog.isShowing()){ 81 | dialog.dismiss(); 82 | } 83 | 84 | } 85 | 86 | @Override 87 | public void registerSuccess() { 88 | SpUtils.SetConfigString("username",etUsername.getText().toString()); 89 | LoginActivity.startMain(this); 90 | 91 | } 92 | 93 | @Override 94 | public void registerFail() { 95 | 96 | } 97 | 98 | @Override 99 | public String getUser() { 100 | return etUsername.getText().toString().trim(); 101 | } 102 | 103 | @Override 104 | public String getPassword() { 105 | return etPassword.getText().toString().trim(); 106 | } 107 | 108 | @Override 109 | public String getPasswordAgain() { 110 | return etPasswordAgain.getText().toString().trim(); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/adapter/HomeAdapter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | 6 | import com.chad.library.adapter.base.BaseQuickAdapter; 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | import com.qzs.wanandroid.R; 9 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 10 | 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | public class HomeAdapter extends BaseQuickAdapter { 16 | 17 | 18 | List data; 19 | /** 20 | * 上下文 21 | */ 22 | private Context context; 23 | 24 | public HomeAdapter(Context context, int layoutResId, @Nullable List data) { 25 | super(layoutResId, data); 26 | this.context=context; 27 | this.data=data; 28 | 29 | } 30 | 31 | 32 | @Override 33 | protected void convert(BaseViewHolder helper,MainListBean.DataBean.DatasBean item) { 34 | 35 | helper.setText(R.id.item_tv_name,item.getAuthor()+""); 36 | helper.setText(R.id.item_tv_time,item.getNiceDate()+""); 37 | helper.setText(R.id.item_tv_title,item.getTitle()+""); 38 | helper.setText(R.id.item_tv_label,item.getSuperChapterName()+""); 39 | 40 | 41 | } 42 | 43 | 44 | @Override 45 | public long getItemId(int position) { 46 | return position; 47 | } 48 | 49 | /** 50 | * 下拉刷新 51 | */ 52 | public void refresh(MainListBean.DataBean bean) { 53 | 54 | //刷新数据 55 | if (data==null){ 56 | data=new ArrayList<>(); 57 | }data.clear(); 58 | data.addAll(bean.getDatas()); 59 | notifyDataSetChanged(); 60 | } 61 | 62 | 63 | /** 64 | * 上拉加载 65 | */ 66 | public void Load(List loadList) { 67 | //刷新数据 68 | if (data==null){ 69 | data=new ArrayList<>(); 70 | } 71 | 72 | //增加数据 73 | int position = data.size(); 74 | data.addAll(position, loadList); 75 | 76 | notifyItemInserted(position); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/adapter/LeftAdapter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | import com.qzs.wanandroid.R; 6 | import com.qzs.wanandroid.base.SimpleRecyclerAdapter; 7 | import com.qzs.wanandroid.base.SimpleViewHolder; 8 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 9 | import com.qzs.wanandroid.ui.information.viewholder.LeftViewHolder; 10 | 11 | 12 | public class LeftAdapter extends SimpleRecyclerAdapter { 13 | 14 | private int mSelectedPosition; 15 | 16 | @Override 17 | public SimpleViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 18 | return new LeftViewHolder(LayoutInflater.from(parent.getContext()) 19 | .inflate(R.layout.recyclerview_item_search_sort_left, parent, false), this); 20 | } 21 | 22 | public void setSelectedPosition(int position) { 23 | mListData.get(mSelectedPosition).isSelected = false; 24 | notifyItemChanged(mSelectedPosition); 25 | mListData.get(position).isSelected = true; 26 | notifyItemChanged(position); 27 | mSelectedPosition = position; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/adapter/MyCollectAdapter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | 6 | import com.chad.library.adapter.base.BaseQuickAdapter; 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | import com.qzs.wanandroid.R; 9 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 10 | import com.qzs.wanandroid.ui.information.bean.MyCollectBean; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | public class MyCollectAdapter extends BaseQuickAdapter { 16 | 17 | public interface onDeleteListtener { 18 | void delete(int position); 19 | } 20 | 21 | private onDeleteListtener onDelete; 22 | 23 | public void setOnDelete(onDeleteListtener onDelete) { 24 | this.onDelete = onDelete; 25 | } 26 | 27 | 28 | List data; 29 | /** 30 | * 上下文 31 | */ 32 | private Context context; 33 | 34 | public MyCollectAdapter(Context context, int layoutResId, @Nullable List data) { 35 | super(layoutResId, data); 36 | this.context=context; 37 | this.data=data; 38 | 39 | } 40 | 41 | 42 | @Override 43 | protected void convert(BaseViewHolder helper,MyCollectBean.DataBean.DatasBean item) { 44 | 45 | helper.setText(R.id.item_tv_name,item.getAuthor()+""); 46 | helper.setText(R.id.item_tv_time,item.getNiceDate()+""); 47 | helper.setText(R.id.item_tv_title,item.getTitle()+""); 48 | helper.setText(R.id.item_tv_label,"完整项目"); 49 | helper.addOnClickListener(R.id.btnDelete); 50 | 51 | 52 | 53 | } 54 | 55 | 56 | @Override 57 | public long getItemId(int position) { 58 | return position; 59 | } 60 | 61 | /** 62 | * 下拉刷新 63 | */ 64 | public void refresh(MyCollectBean.DataBean bean) { 65 | 66 | //刷新数据 67 | if (data==null){ 68 | data=new ArrayList<>(); 69 | }data.clear(); 70 | data.addAll(bean.getDatas()); 71 | notifyDataSetChanged(); 72 | } 73 | 74 | 75 | /** 76 | * 上拉加载 77 | */ 78 | public void Load(List loadList) { 79 | //刷新数据 80 | if (data==null){ 81 | data=new ArrayList<>(); 82 | } 83 | 84 | //增加数据 85 | int position = data.size(); 86 | data.addAll(position, loadList); 87 | 88 | notifyItemInserted(position); 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/adapter/ProjectAdapter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.widget.ImageView; 6 | 7 | import com.chad.library.adapter.base.BaseQuickAdapter; 8 | import com.chad.library.adapter.base.BaseViewHolder; 9 | import com.qzs.wanandroid.R; 10 | import com.qzs.wanandroid.imageloader.GlideUtils; 11 | import com.qzs.wanandroid.ui.information.bean.MainListBean; 12 | import com.qzs.wanandroid.ui.information.bean.ProjectListBean; 13 | 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | /** 17 | * @author qinzishuai 18 | * 描述: 项目模块adapter 19 | * 创建日期:2019/7/22 20 | * 21 | */ 22 | public class ProjectAdapter extends BaseQuickAdapter { 23 | 24 | 25 | List data; 26 | /** 27 | * 上下文 28 | */ 29 | private Context context; 30 | 31 | public ProjectAdapter(Context context, int layoutResId, @Nullable List data) { 32 | super(layoutResId, data); 33 | this.context=context; 34 | this.data=data; 35 | 36 | } 37 | 38 | 39 | @Override 40 | protected void convert(BaseViewHolder helper,ProjectListBean.DataBean.DatasBean item) { 41 | 42 | helper.setText(R.id.item_tv_name,item.getAuthor()+""); 43 | helper.setText(R.id.item_tv_title,item.getTitle()+""); 44 | helper.setText(R.id.item_tv_time,item.getNiceDate()+""); 45 | helper.setText(R.id.item_tv_desc,item.getDesc()+""); 46 | 47 | //头像 48 | GlideUtils.loadImage(mContext, item.getEnvelopePic(), (ImageView) helper.getView(R.id.item_iv_img)); 49 | helper.addOnClickListener(R.id.item_iv_collect); 50 | if (item.isCollect()){ 51 | helper.setImageResource(R.id.item_iv_collect,R.mipmap.ic_star_select); 52 | }else { 53 | helper.setImageResource(R.id.item_iv_collect,R.mipmap.ic_star_normal); 54 | } 55 | 56 | 57 | } 58 | 59 | 60 | @Override 61 | public long getItemId(int position) { 62 | return position; 63 | } 64 | 65 | /** 66 | * 下拉刷新 67 | */ 68 | public void refresh(ProjectListBean.DataBean bean) { 69 | 70 | //刷新数据 71 | if (data==null){ 72 | data=new ArrayList<>(); 73 | }data.clear(); 74 | data.addAll(bean.getDatas()); 75 | notifyDataSetChanged(); 76 | } 77 | 78 | 79 | /** 80 | * 上拉加载 81 | */ 82 | public void Load(List loadList) { 83 | //刷新数据 84 | if (data==null){ 85 | data=new ArrayList<>(); 86 | } 87 | 88 | //增加数据 89 | int position = data.size(); 90 | data.addAll(position, loadList); 91 | 92 | notifyItemInserted(position); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/adapter/RightAdapter.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.adapter; 2 | 3 | import android.view.LayoutInflater; 4 | import android.view.ViewGroup; 5 | 6 | import com.qzs.wanandroid.R; 7 | import com.qzs.wanandroid.base.SimpleRecyclerAdapter; 8 | import com.qzs.wanandroid.base.SimpleViewHolder; 9 | import com.qzs.wanandroid.common.ItemType; 10 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 11 | import com.qzs.wanandroid.ui.information.viewholder.RightBigSortViewHolder; 12 | import com.qzs.wanandroid.ui.information.viewholder.RightSmallSortViewHolder; 13 | import com.qzs.wanandroid.utils.LogUtils; 14 | 15 | 16 | public class RightAdapter extends SimpleRecyclerAdapter { 17 | 18 | 19 | @Override 20 | public SimpleViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 21 | if (viewType == ItemType.BIG_SORT) { 22 | LogUtils.d("111111111111111111111"); 23 | return new RightBigSortViewHolder(LayoutInflater.from(parent.getContext()) 24 | .inflate(R.layout.recyclerview_item_right_big_sort, parent, false), this); 25 | } else { 26 | 27 | LogUtils.d("22222222222222222222"); 28 | return new RightSmallSortViewHolder(LayoutInflater.from(parent.getContext()) 29 | .inflate(R.layout.recyclerview_item_right_small_sort, parent, false), this); 30 | } 31 | } 32 | 33 | @Override 34 | public int getItemViewType(int position) { 35 | return mListData.get(position).viewType; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/bean/BannerBean.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.bean; 2 | 3 | import java.util.List; 4 | 5 | public class BannerBean { 6 | 7 | 8 | /** 9 | * data : [{"desc":"Android高级进阶直播课免费学习","id":24,"imagePath":"https://www.wanandroid.com/blogimgs/bb4937de-b6f3-4c7e-b7d0-66d02f54abee.jpeg","isVisible":1,"order":10,"title":"Android高级进阶直播课免费学习\t","type":0,"url":"https://url.163.com/4bj"},{"desc":"一起来做个App吧","id":10,"imagePath":"https://www.wanandroid.com/blogimgs/50c115c2-cf6c-4802-aa7b-a4334de444cd.png","isVisible":1,"order":0,"title":"一起来做个App吧","type":1,"url":"http://www.wanandroid.com/blog/show/2"},{"desc":"","id":6,"imagePath":"https://www.wanandroid.com/blogimgs/62c1bd68-b5f3-4a3c-a649-7ca8c7dfabe6.png","isVisible":1,"order":1,"title":"我们新增了一个常用导航Tab~","type":1,"url":"http://www.wanandroid.com/navi"},{"desc":"","id":20,"imagePath":"https://www.wanandroid.com/blogimgs/90c6cc12-742e-4c9f-b318-b912f163b8d0.png","isVisible":1,"order":2,"title":"flutter 中文社区 ","type":1,"url":"https://flutter.cn/"}] 10 | * errorCode : 0 11 | * errorMsg : 12 | */ 13 | 14 | private int errorCode; 15 | private String errorMsg; 16 | private List data; 17 | 18 | public int getErrorCode() { 19 | return errorCode; 20 | } 21 | 22 | public void setErrorCode(int errorCode) { 23 | this.errorCode = errorCode; 24 | } 25 | 26 | public String getErrorMsg() { 27 | return errorMsg; 28 | } 29 | 30 | public void setErrorMsg(String errorMsg) { 31 | this.errorMsg = errorMsg; 32 | } 33 | 34 | public List getData() { 35 | return data; 36 | } 37 | 38 | public void setData(List data) { 39 | this.data = data; 40 | } 41 | 42 | public static class DataBean { 43 | /** 44 | * desc : Android高级进阶直播课免费学习 45 | * id : 24 46 | * imagePath : https://www.wanandroid.com/blogimgs/bb4937de-b6f3-4c7e-b7d0-66d02f54abee.jpeg 47 | * isVisible : 1 48 | * order : 10 49 | * title : Android高级进阶直播课免费学习 50 | * type : 0 51 | * url : https://url.163.com/4bj 52 | */ 53 | 54 | private String desc; 55 | private int id; 56 | private String imagePath; 57 | private int isVisible; 58 | private int order; 59 | private String title; 60 | private int type; 61 | private String url; 62 | 63 | public String getDesc() { 64 | return desc; 65 | } 66 | 67 | public void setDesc(String desc) { 68 | this.desc = desc; 69 | } 70 | 71 | public int getId() { 72 | return id; 73 | } 74 | 75 | public void setId(int id) { 76 | this.id = id; 77 | } 78 | 79 | public String getImagePath() { 80 | return imagePath; 81 | } 82 | 83 | public void setImagePath(String imagePath) { 84 | this.imagePath = imagePath; 85 | } 86 | 87 | public int getIsVisible() { 88 | return isVisible; 89 | } 90 | 91 | public void setIsVisible(int isVisible) { 92 | this.isVisible = isVisible; 93 | } 94 | 95 | public int getOrder() { 96 | return order; 97 | } 98 | 99 | public void setOrder(int order) { 100 | this.order = order; 101 | } 102 | 103 | public String getTitle() { 104 | return title; 105 | } 106 | 107 | public void setTitle(String title) { 108 | this.title = title; 109 | } 110 | 111 | public int getType() { 112 | return type; 113 | } 114 | 115 | public void setType(int type) { 116 | this.type = type; 117 | } 118 | 119 | public String getUrl() { 120 | return url; 121 | } 122 | 123 | public void setUrl(String url) { 124 | this.url = url; 125 | } 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/viewholder/LeftViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.viewholder; 2 | 3 | import android.support.annotation.Nullable; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | 7 | 8 | import com.qzs.wanandroid.R; 9 | import com.qzs.wanandroid.base.SimpleRecyclerAdapter; 10 | import com.qzs.wanandroid.base.SimpleViewHolder; 11 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 12 | 13 | 14 | public class LeftViewHolder extends SimpleViewHolder { 15 | 16 | /** 17 | * tvName显示大类名称,view是显示被选中的黄色标记 18 | */ 19 | private TextView tvName; 20 | private View view; 21 | 22 | public LeftViewHolder(View itemView, @Nullable SimpleRecyclerAdapter adapter) { 23 | super(itemView, adapter); 24 | tvName = (TextView) itemView.findViewById(R.id.tv_left); 25 | view = itemView.findViewById(R.id.view); 26 | } 27 | 28 | @Override 29 | protected void refreshView(NavigateBean.DataBean data) { 30 | tvName.setText(data.getName()); 31 | //item点击后背景的变化 32 | if (data.isSelected) { 33 | view.setVisibility(View.VISIBLE); 34 | tvName.setBackgroundResource(R.color.color_107); 35 | tvName.setTextColor(getContext().getResources().getColor(R.color.color_1002)); 36 | } else { 37 | view.setVisibility(View.GONE); 38 | tvName.setBackgroundResource(R.color.color_109); 39 | tvName.setTextColor(getContext().getResources().getColor(R.color.color_100)); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/viewholder/RightBigSortViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.viewholder; 2 | 3 | import android.support.annotation.Nullable; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | import com.qzs.wanandroid.R; 7 | import com.qzs.wanandroid.base.SimpleRecyclerAdapter; 8 | import com.qzs.wanandroid.base.SimpleViewHolder; 9 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 10 | 11 | 12 | public class RightBigSortViewHolder extends SimpleViewHolder { 13 | 14 | TextView tvTitle; 15 | 16 | public RightBigSortViewHolder(View itemView, @Nullable SimpleRecyclerAdapter adapter) { 17 | super(itemView, adapter); 18 | tvTitle = (TextView) itemView.findViewById(R.id.tv_title); 19 | } 20 | 21 | @Override 22 | protected void refreshView(NavigateBean.DataBean.ArticlesBean data) { 23 | tvTitle.setText(data.header); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/ui/information/viewholder/RightSmallSortViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.ui.information.viewholder; 2 | 3 | import android.graphics.Color; 4 | import android.support.annotation.Nullable; 5 | import android.view.View; 6 | import android.widget.TextView; 7 | 8 | 9 | import com.qzs.wanandroid.R; 10 | import com.qzs.wanandroid.base.SimpleRecyclerAdapter; 11 | import com.qzs.wanandroid.base.SimpleViewHolder; 12 | import com.qzs.wanandroid.ui.information.bean.NavigateBean; 13 | 14 | 15 | public class RightSmallSortViewHolder extends SimpleViewHolder { 16 | 17 | private TextView textView; 18 | 19 | public RightSmallSortViewHolder(View itemView, @Nullable SimpleRecyclerAdapter adapter) { 20 | super(itemView, adapter); 21 | textView = itemView.findViewById(R.id.tv_small); 22 | } 23 | 24 | @Override 25 | protected void refreshView(NavigateBean.DataBean.ArticlesBean data) { 26 | textView.setText(data.getTitle()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/utils/CommonUtil.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.utils; 2 | 3 | import android.widget.Toast; 4 | 5 | import com.qzs.wanandroid.common.MyApplication; 6 | 7 | 8 | /*** 9 | * toast 10 | */ 11 | public class CommonUtil { 12 | private static Toast toast; 13 | 14 | public static void showToast( 15 | String content) { 16 | if (toast == null) { 17 | toast = Toast.makeText(MyApplication.getContext(), 18 | content, 19 | Toast.LENGTH_SHORT); 20 | } else { 21 | toast.setText(content); 22 | } 23 | toast.show(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/utils/DensityUtil.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.utils; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * @author geyifeng 7 | * @date 2019/4/19 3:56 PM 8 | */ 9 | public class DensityUtil { 10 | public static int dip2px(Context c, float dpValue) { 11 | final float scale = c.getResources().getDisplayMetrics().density; 12 | return (int) (dpValue * scale + 0.5f); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/utils/DialogUtils.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.utils; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.util.DisplayMetrics; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.TextView; 10 | 11 | import com.qzs.wanandroid.R; 12 | 13 | 14 | public class DialogUtils { 15 | 16 | /** 17 | * 获取一个类似加载的对话框 18 | * 19 | * @param context 上下文 20 | * @param msg 文字说明 21 | * @return 对话框的对象 22 | */ 23 | public static Dialog createLoadingDialog(Context context, String msg) { 24 | /* 25 | * 获得view填充器对象 26 | */ 27 | LayoutInflater inflater = LayoutInflater.from(context); 28 | /* 29 | * 得到加载view 30 | */ 31 | View v = inflater.inflate(R.layout.loading_dialog, null); 32 | TextView tipTextView = v.findViewById(R.id.tipTextView);// 提示文字 33 | if (msg != null && !msg.equals("")) { 34 | tipTextView.setText(msg);// 设置加载信息 35 | } 36 | 37 | Dialog loadingDialog = new Dialog(context, R.style.loading_dialog);// 创建自定义样式dialog 38 | loadingDialog.setCancelable(true);// 可以用“返回键”取消 39 | loadingDialog.setCanceledOnTouchOutside(false);// 40 | loadingDialog.setContentView(v);// 设置布局 41 | 42 | DisplayMetrics dm = context.getResources().getDisplayMetrics(); 43 | int width = (int) (dm.widthPixels*0.3); 44 | int height = ViewGroup.LayoutParams.WRAP_CONTENT; 45 | loadingDialog.getWindow().setLayout(width ,height); 46 | 47 | return loadingDialog; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/utils/MyUtils.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.utils; 2 | 3 | import android.support.v7.widget.LinearLayoutManager; 4 | import android.support.v7.widget.RecyclerView; 5 | 6 | 7 | public class MyUtils { 8 | 9 | public static void moveToMiddle(RecyclerView recyclerView, int position) { 10 | //先从RecyclerView的LayoutManager中获取当前第一项和最后一项的Position 11 | int firstItem = ((LinearLayoutManager) recyclerView.getLayoutManager()).findFirstVisibleItemPosition(); 12 | int lastItem = ((LinearLayoutManager) recyclerView.getLayoutManager()).findLastVisibleItemPosition(); 13 | //中间位置 14 | int middle = (firstItem + lastItem)/2; 15 | // 取绝对值,index下标是当前的位置和中间位置的差,下标为index的view的top就是需要滑动的距离 16 | int index = (position - middle) >= 0 ? position - middle : -(position - middle); 17 | //左侧列表一共有getChildCount个Item,如果>这个值会返回null,程序崩溃,如果>getChildCount直接滑到指定位置,或者,都一样啦 18 | if (index >= recyclerView.getChildCount()) { 19 | recyclerView.scrollToPosition(position); 20 | } else { 21 | //如果当前位置在中间位置上面,往下移动,这里为了防止越界 22 | if(position < middle) { 23 | recyclerView.scrollBy(0, -recyclerView.getChildAt(index).getTop()); 24 | // 在中间位置的下面,往上移动 25 | } else { 26 | recyclerView.scrollBy(0, recyclerView.getChildAt(index).getTop()); 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/utils/RecycleViewAnimationUtils.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.utils; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.animation.AnimationUtils; 6 | import android.view.animation.LayoutAnimationController; 7 | 8 | import com.qzs.wanandroid.R; 9 | 10 | public class RecycleViewAnimationUtils { 11 | 12 | 13 | public static void runLayoutAnimation(final RecyclerView recyclerView) { 14 | final Context context = recyclerView.getContext(); 15 | final LayoutAnimationController controller = 16 | AnimationUtils.loadLayoutAnimation(context, R.anim.layout_animation_fall_down); 17 | 18 | recyclerView.setLayoutAnimation(controller); 19 | recyclerView.getAdapter().notifyDataSetChanged(); 20 | recyclerView.scheduleLayoutAnimation(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/utils/Utils.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.utils; 2 | 3 | import android.content.Context; 4 | import android.net.ConnectivityManager; 5 | import android.net.NetworkInfo; 6 | 7 | 8 | 9 | public class Utils { 10 | 11 | 12 | 13 | public static boolean isNetworkConnected(Context context) { 14 | if (context != null) { 15 | ConnectivityManager manager = (ConnectivityManager) context 16 | .getSystemService(Context.CONNECTIVITY_SERVICE); 17 | NetworkInfo mNetworkInfo = manager.getActiveNetworkInfo(); 18 | if (mNetworkInfo != null) { 19 | return mNetworkInfo.isAvailable(); 20 | } 21 | } 22 | return false; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/qzs/wanandroid/widget/ProgressWebView.java: -------------------------------------------------------------------------------- 1 | package com.qzs.wanandroid.widget; 2 | 3 | import android.content.Context; 4 | import android.graphics.drawable.Drawable; 5 | import android.util.AttributeSet; 6 | import android.widget.LinearLayout; 7 | import android.widget.ProgressBar; 8 | 9 | import com.qzs.wanandroid.R; 10 | import com.tencent.smtt.sdk.WebChromeClient; 11 | import com.tencent.smtt.sdk.WebView; 12 | 13 | 14 | public class ProgressWebView extends WebView { 15 | 16 | private ProgressBar mProgressBar; 17 | public ProgressWebView(Context context) { 18 | super(context); 19 | } 20 | 21 | public ProgressWebView(Context context, AttributeSet attributeSet) { 22 | super(context, attributeSet); 23 | mProgressBar = new ProgressBar(context, null, 24 | android.R.attr.progressBarStyleHorizontal); 25 | LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams( 26 | LinearLayout.LayoutParams.MATCH_PARENT, 8); 27 | mProgressBar.setLayoutParams(layoutParams); 28 | 29 | Drawable drawable = context.getResources().getDrawable( 30 | R.color.label1); 31 | mProgressBar.setProgressDrawable(drawable); 32 | addView(mProgressBar); 33 | setWebChromeClient(new WebChromeClient()); 34 | } 35 | 36 | public ProgressWebView(Context context, AttributeSet attributeSet, int i) { 37 | super(context, attributeSet, i); 38 | } 39 | 40 | public class WebChromeClient extends com.tencent.smtt.sdk.WebChromeClient { 41 | @Override 42 | public void onProgressChanged(WebView view, int newProgress) { 43 | if (newProgress == 100) { 44 | mProgressBar.setVisibility(GONE); 45 | } else { 46 | if (mProgressBar.getVisibility() == GONE) 47 | mProgressBar.setVisibility(VISIBLE); 48 | mProgressBar.setProgress(newProgress); 49 | } 50 | super.onProgressChanged(view, newProgress); 51 | } 52 | } 53 | 54 | @Override 55 | protected void onScrollChanged(int l, int t, int oldl, int oldt) { 56 | LayoutParams lp = (LayoutParams) mProgressBar.getLayoutParams(); 57 | lp.width = l; 58 | lp.height = t; 59 | mProgressBar.setLayoutParams(lp); 60 | super.onScrollChanged(l, t, oldl, oldt); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /app/src/main/res/anim/item_animation_fall_down.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 10 | 15 | 16 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/anim/layout_animation_fall_down.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | -------------------------------------------------------------------------------- /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/banner_pot1.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | /> 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/banner_pot2.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | /> 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_card.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_addfriend_search_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_complete_person_head_back2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_home_label1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_home_label2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_load_error_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_login_btn.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_my_collect_delete_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawable_personal_center_bg1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/foreground_cardview.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_login_btn1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaexception/QzsWanAndroid/d3805a0f3316b364aba6239cde8c74af77e0bb82/app/src/main/res/drawable/ic_login_btn1.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_login_btn2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/javaexception/QzsWanAndroid/d3805a0f3316b364aba6239cde8c74af77e0bb82/app/src/main/res/drawable/ic_login_btn2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_bg_white_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_toobar.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_article_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 24 | 33 | 40 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 66 | 67 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 22 | 23 | 31 | 32 | 41 | 42 | 43 | 44 | 45 | 53 | 54 | 63 | 64 | 65 | 66 |