├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── values │ │ │ ├── strings.xml │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── drawable │ │ │ ├── headimg.jpg │ │ │ ├── icon_progressbar.png │ │ │ ├── iconfont_downgrey.png │ │ │ └── divider_sample.xml │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ ├── icon_jpg.png │ │ │ ├── icon_pdf.png │ │ │ ├── icon_ppt.png │ │ │ ├── icon_word.png │ │ │ ├── icon_wzlx.png │ │ │ ├── icon_zip.png │ │ │ ├── ic_launcher.png │ │ │ └── icon_execl.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── layout │ │ │ ├── recyclerview_header.xml │ │ │ ├── item_view.xml │ │ │ ├── recycler_item_view.xml │ │ │ ├── activity_toolbar.xml │ │ │ ├── activity_main.xml │ │ │ ├── ok_http_activity.xml │ │ │ └── activity_home.xml │ │ └── menu │ │ │ └── search_toolbar.xml │ │ ├── java │ │ └── com │ │ │ └── example │ │ │ └── niko │ │ │ └── framemodel │ │ │ ├── config │ │ │ └── Config.java │ │ │ ├── model │ │ │ ├── RealmString.java │ │ │ ├── ResultModel.java │ │ │ ├── MusicModel.java │ │ │ ├── HMusicBean.java │ │ │ ├── LMusicBean.java │ │ │ ├── BMusicBean.java │ │ │ ├── MMusicBean.java │ │ │ ├── ArtistBean.java │ │ │ ├── ArtistsBean.java │ │ │ ├── ArtistsBeanX.java │ │ │ ├── AlbumBean.java │ │ │ └── CreatorBean.java │ │ │ ├── net │ │ │ ├── HttpInterceptor.java │ │ │ ├── ProgressBean.java │ │ │ ├── NullStringToEmptyAdapterFactory.java │ │ │ ├── StringNullAdapter.java │ │ │ ├── ProgressListener.java │ │ │ ├── ApiService.java │ │ │ ├── CallObserver.java │ │ │ ├── ProgressResponseBody.java │ │ │ └── RetrofitClient.java │ │ │ ├── adapter │ │ │ ├── ImageRecyclerViewAdapter.java │ │ │ └── RecyclerViewAdapter.java │ │ │ ├── application │ │ │ └── BaseApplication.java │ │ │ └── activity │ │ │ ├── HomeActitvity.java │ │ │ ├── ToolBarActivity.java │ │ │ ├── RxjavaAndRetrofitActivity.java │ │ │ └── MainActivity.java │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── framelib ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── styles.xml │ │ │ │ └── colors.xml │ │ │ ├── drawable │ │ │ │ ├── icon_progressbar.png │ │ │ │ ├── shape_white.xml │ │ │ │ └── shape_rotate_progress.xml │ │ │ ├── anim │ │ │ │ ├── basepopup_fade_in.xml │ │ │ │ └── basepopup_fade_out.xml │ │ │ └── layout │ │ │ │ ├── pop_progress_dialg.xml │ │ │ │ └── pop_download_progress.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── framelib │ │ │ │ ├── basepopup │ │ │ │ ├── PopupController.java │ │ │ │ ├── BasePopup.java │ │ │ │ └── PopupWindowProxy.java │ │ │ │ ├── utils │ │ │ │ ├── bitmap │ │ │ │ │ ├── model │ │ │ │ │ │ └── ImageSize.java │ │ │ │ │ └── helper │ │ │ │ │ │ └── StorageHelper.java │ │ │ │ ├── permission │ │ │ │ │ ├── PermissionFail.java │ │ │ │ │ ├── PermissionSucceed.java │ │ │ │ │ ├── PermissionUtils.java │ │ │ │ │ └── PermissionHelper.java │ │ │ │ ├── Tools │ │ │ │ │ ├── constant │ │ │ │ │ │ ├── MemoryConstants.java │ │ │ │ │ │ ├── TimeConstants.java │ │ │ │ │ │ └── RegexConstants.java │ │ │ │ │ ├── CloseUtils.java │ │ │ │ │ ├── InputMethodUtils.java │ │ │ │ │ ├── MD5.java │ │ │ │ │ ├── RxNetUtils.java │ │ │ │ │ ├── StringUtil.java │ │ │ │ │ └── SDCardUtils.java │ │ │ │ ├── anim │ │ │ │ │ └── SimpleAnimUtil.java │ │ │ │ └── dialog │ │ │ │ │ └── DialogTool.java │ │ │ │ ├── adapter │ │ │ │ ├── BaseViewHandle.java │ │ │ │ └── BaseRecyclerViewAdapter.java │ │ │ │ ├── pop │ │ │ │ ├── PopProgressDialog.java │ │ │ │ └── PopDownLoadProgress.java │ │ │ │ ├── fragment │ │ │ │ └── BaseFragment.java │ │ │ │ └── activtiy │ │ │ │ └── BaseActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── framelib │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── framelib │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .gitignore ├── image ├── Screenshot_2017-08-10-15-25-20-162_com.westarsoft.png ├── Screenshot_2017-08-10-15-25-48-794_com.westarsoft.png ├── Screenshot_2017-08-10-15-26-00-174_com.westarsoft.png ├── Screenshot_2017-08-10-15-26-57-053_com.westarsoft.png ├── Screenshot_2017-08-10-15-27-02-736_com.westarsoft.png ├── Screenshot_2017-08-15-11-44-44-985_com.westarsoft.png ├── Screenshot_2017-08-15-20-04-35-533_com.westarsoft.png ├── Screenshot_2017-08-15-20-04-42-274_com.westarsoft.png ├── Screenshot_2017-08-15-20-04-49-041_com.westarsoft.png ├── Screenshot_2017-08-21-09-37-09-607_com.westarsoft.png └── Screenshot_2017-09-08-16-29-54-586_com.westarsoft.png ├── .idea ├── vcs.xml ├── modules.xml ├── runConfigurations.xml ├── gradle.xml └── misc.xml ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /framelib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':framelib' 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | FrameModel 3 | 4 | -------------------------------------------------------------------------------- /framelib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | FrameLib 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/headimg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/drawable/headimg.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_jpg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxhdpi/icon_jpg.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_pdf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxhdpi/icon_pdf.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_ppt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxhdpi/icon_ppt.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_word.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxhdpi/icon_word.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_wzlx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxhdpi/icon_wzlx.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_zip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxhdpi/icon_zip.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon_progressbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/drawable/icon_progressbar.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/iconfont_downgrey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/drawable/iconfont_downgrey.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_execl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxhdpi/icon_execl.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /framelib/src/main/res/drawable/icon_progressbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/framelib/src/main/res/drawable/icon_progressbar.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /image/Screenshot_2017-08-10-15-25-20-162_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-10-15-25-20-162_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-10-15-25-48-794_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-10-15-25-48-794_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-10-15-26-00-174_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-10-15-26-00-174_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-10-15-26-57-053_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-10-15-26-57-053_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-10-15-27-02-736_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-10-15-27-02-736_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-15-11-44-44-985_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-15-11-44-44-985_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-15-20-04-35-533_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-15-20-04-35-533_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-15-20-04-42-274_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-15-20-04-42-274_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-15-20-04-49-041_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-15-20-04-49-041_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-08-21-09-37-09-607_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-08-21-09-37-09-607_com.westarsoft.png -------------------------------------------------------------------------------- /image/Screenshot_2017-09-08-16-29-54-586_com.westarsoft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NikoSoftware/FrameModel/HEAD/image/Screenshot_2017-09-08-16-29-54-586_com.westarsoft.png -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /framelib/src/main/res/drawable/shape_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/divider_sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Feb 08 15:56:53 CST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 15dp 6 | 7 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/basepopup/PopupController.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.basepopup; 2 | 3 | /** 4 | * Created by niko on 2017/1/13. 5 | */ 6 | 7 | interface PopupController { 8 | 9 | 10 | boolean onBeforeDismiss(); 11 | 12 | boolean callDismissAtOnce(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /framelib/src/main/res/anim/basepopup_fade_in.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /framelib/src/main/res/anim/basepopup_fade_out.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /framelib/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /framelib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | #00000000 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /framelib/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | #00000000 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recyclerview_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/search_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/utils/bitmap/model/ImageSize.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.utils.bitmap.model; 2 | 3 | /** 4 | * Created by koudejian on 15-2-6. 5 | */ 6 | public class ImageSize { 7 | public int width = 0; 8 | public int height = 0; 9 | 10 | public ImageSize() { 11 | } 12 | 13 | public ImageSize(int width, int height) { 14 | this.width = width; 15 | this.height = height; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /framelib/src/test/java/com/example/framelib/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/utils/permission/PermissionFail.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.utils.permission; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | *Created by Niko on 2016/4/27. 10 | */ 11 | @Target(ElementType.METHOD)// 放在什么位置 ElementType.METHOD 方法上面 12 | @Retention(RetentionPolicy.RUNTIME)// 是编译时检测 还是 运行时检测 13 | public @interface PermissionFail { 14 | public int requestCode();// 请求码 15 | } 16 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/utils/permission/PermissionSucceed.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.utils.permission; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * Created by Niko on 2016/4/27. 10 | */ 11 | @Target(ElementType.METHOD)// 放在什么位置 ElementType.METHOD 方法上面 12 | @Retention(RetentionPolicy.RUNTIME)// 是编译时检测 还是 运行时检测 13 | public @interface PermissionSucceed { 14 | public int requestCode();// 请求码 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/config/Config.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.config; 2 | 3 | import android.os.Environment; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | * Created by niko on 2018/2/27. 9 | */ 10 | 11 | public class Config { 12 | 13 | 14 | /** 15 | * SD卡地址 16 | */ 17 | public static final String SD_PATH = Environment.getExternalStorageDirectory().getAbsolutePath(); 18 | 19 | /** 20 | * 文件储存路径 21 | */ 22 | public static final String DOC_PATH = SD_PATH+File.separator+"doc"; 23 | 24 | 25 | 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/model/RealmString.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.model; 2 | 3 | import io.realm.RealmObject; 4 | 5 | /** 6 | * Created by niko on 2017/5/1. 7 | */ 8 | 9 | public class RealmString extends RealmObject { 10 | private String string; 11 | 12 | public String getString() { 13 | return string; 14 | } 15 | 16 | public void setString(String string) { 17 | this.string = string; 18 | } 19 | 20 | @Override 21 | public String toString() { 22 | return "RealmString{" + 23 | "string='" + string + '\'' + 24 | '}'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/net/HttpInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.net; 2 | 3 | import android.util.Log; 4 | 5 | import java.io.IOException; 6 | 7 | import okhttp3.Interceptor; 8 | import okhttp3.Response; 9 | 10 | /** 11 | * Created by niko on 2017/5/1. 12 | */ 13 | 14 | public class HttpInterceptor implements Interceptor { 15 | @Override 16 | public Response intercept(Chain chain) throws IOException { 17 | 18 | ; 19 | Response response =chain.proceed(chain.request()); 20 | 21 | Log.e("response: ",response.body().toString()); 22 | 23 | 24 | return response; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recycler_item_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in E:\Android\AndroidStudioSdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/adapter/BaseViewHandle.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.adapter; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.util.SparseArray; 5 | import android.view.View; 6 | 7 | /** 8 | * Created by Niko on 2016/4/27. 9 | */ 10 | public class BaseViewHandle extends RecyclerView.ViewHolder { 11 | 12 | private SparseArray views = new SparseArray(); 13 | public BaseViewHandle(View itemView,Integer[] widgetIds) { 14 | super(itemView); 15 | for(Integer widgetId : widgetIds){ 16 | 17 | views.put(widgetId, itemView.findViewById(widgetId)); 18 | } 19 | } 20 | 21 | public View getView(Integer id){ 22 | return views.get(id); 23 | } 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /framelib/src/main/res/drawable/shape_rotate_progress.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 12 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/net/ProgressBean.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.net; 2 | 3 | /** 4 | * Created by niko on 2017/11/6. 5 | */ 6 | 7 | public class ProgressBean { 8 | 9 | private Long mTotal; 10 | private Long mProgress; 11 | 12 | 13 | public Long getmTotal() { 14 | return mTotal; 15 | } 16 | 17 | public void setmTotal(Long mTotal) { 18 | this.mTotal = mTotal; 19 | } 20 | 21 | public Long getmProgress() { 22 | return mProgress; 23 | } 24 | 25 | public void setmProgress(Long mProgress) { 26 | this.mProgress = mProgress; 27 | } 28 | 29 | @Override 30 | public String toString() { 31 | return "ProcessBean{" + 32 | "mTotal=" + mTotal + 33 | ", mProgress=" + mProgress + 34 | '}'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/net/NullStringToEmptyAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.net; 2 | 3 | 4 | import android.util.Log; 5 | 6 | import com.google.gson.Gson; 7 | import com.google.gson.TypeAdapter; 8 | import com.google.gson.TypeAdapterFactory; 9 | import com.google.gson.reflect.TypeToken; 10 | 11 | /** 12 | * 转换 null 为 "" 或者 “” 为 null 13 | * Created by niko on 2017/5/1. 14 | */ 15 | 16 | public class NullStringToEmptyAdapterFactory implements TypeAdapterFactory { 17 | 18 | @Override 19 | public TypeAdapter create(Gson gson, TypeToken type) { 20 | Class rawType = (Class) type.getRawType(); 21 | Log.e("TAG==>",rawType.toString()); 22 | if (rawType != String.class) { 23 | return null; 24 | } 25 | return (TypeAdapter) new StringNullAdapter(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 16 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/utils/Tools/constant/MemoryConstants.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.utils.Tools.constant; 2 | 3 | import android.support.annotation.IntDef; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /** 9 | * Created by niko on 2018/2/2. 10 | * 存储相关常量 11 | */ 12 | public final class MemoryConstants { 13 | 14 | /** 15 | * Byte与Byte的倍数 16 | */ 17 | public static final int BYTE = 1; 18 | /** 19 | * KB与Byte的倍数 20 | */ 21 | public static final int KB = 1024; 22 | /** 23 | * MB与Byte的倍数 24 | */ 25 | public static final int MB = 1048576; 26 | /** 27 | * GB与Byte的倍数 28 | */ 29 | public static final int GB = 1073741824; 30 | 31 | @IntDef({BYTE, KB, MB, GB}) 32 | @Retention(RetentionPolicy.SOURCE) 33 | public @interface Unit { 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /framelib/src/androidTest/java/com/example/framelib/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.example.framelib.test", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | ANDROID_BUILD_MIN_SDK_VERSION=16 19 | ANDROID_BUILD_TARGET_SDK_VERSION=25 20 | ANDROID_BUILD_SDK_VERSION=25 21 | ANDROID_BUILD_TOOLS_VERSION=25.0.3 -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/utils/Tools/constant/TimeConstants.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.utils.Tools.constant; 2 | 3 | import android.support.annotation.IntDef; 4 | 5 | import java.lang.annotation.Retention; 6 | import java.lang.annotation.RetentionPolicy; 7 | 8 | /** 9 | * Created by niko on 2018/2/2. 10 | * 时间相关常量 11 | */ 12 | public final class TimeConstants { 13 | 14 | /** 15 | * 毫秒与毫秒的倍数 16 | */ 17 | public static final int MSEC = 1; 18 | /** 19 | * 秒与毫秒的倍数 20 | */ 21 | public static final int SEC = 1000; 22 | /** 23 | * 分与毫秒的倍数 24 | */ 25 | public static final int MIN = 60000; 26 | /** 27 | * 时与毫秒的倍数 28 | */ 29 | public static final int HOUR = 3600000; 30 | /** 31 | * 天与毫秒的倍数 32 | */ 33 | public static final int DAY = 86400000; 34 | 35 | @IntDef({MSEC, SEC, MIN, HOUR, DAY}) 36 | @Retention(RetentionPolicy.SOURCE) 37 | public @interface Unit { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/model/ResultModel.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.model; 2 | 3 | /** 4 | * Created by niko on 2017/7/13. 5 | */ 6 | 7 | public class ResultModel { 8 | 9 | private int code; 10 | private String msg; 11 | private T data; 12 | 13 | public int getCode() { 14 | return code; 15 | } 16 | 17 | public void setCode(int code) { 18 | this.code = code; 19 | } 20 | 21 | public String getMsg() { 22 | return msg; 23 | } 24 | 25 | public void setMsg(String msg) { 26 | this.msg = msg; 27 | } 28 | 29 | public T getData() { 30 | return data; 31 | } 32 | 33 | public void setData(T data) { 34 | this.data = data; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "ResultModel{" + 40 | "code=" + code + 41 | ", msg='" + msg + '\'' + 42 | ", data=" + data + 43 | '}'; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FrameModel 2 | ### niko个人开发工具框架 3 | ***包括内容:*** 4 | 1. Rxjava2.0+Retrofit2.0最新网络请求框架; 5 | 2. 图片处理,运行时权限; 6 | 3. 通用RecyclerVIewAdapter封装; 7 | 4. activity和fragment封装; 8 | 5. basePopWindow 封装。 9 | 6. Realm 数据库 10 | 11 | ### 运用项目 《青岛地铁电子检察平台》 12 | ***部分界面图展示*** 13 | 14 | ![登陆](https://github.com/NikoSoftware/FrameModel/raw/master/image/Screenshot_2017-08-10-15-25-20-162_com.westarsoft.png) 15 | 16 | ![](https://github.com/NikoSoftware/FrameModel/raw/master/image/Screenshot_2017-08-10-15-26-57-053_com.westarsoft.png) 17 | 18 | ![](https://github.com/NikoSoftware/FrameModel/raw/master/image/Screenshot_2017-08-10-15-27-02-736_com.westarsoft.png) 19 | 20 | ![](https://github.com/NikoSoftware/FrameModel/raw/master/image/Screenshot_2017-08-15-20-04-35-533_com.westarsoft.png) 21 | 22 | ![](https://github.com/NikoSoftware/FrameModel/raw/master/image/Screenshot_2017-08-15-20-04-42-274_com.westarsoft.png) 23 | 24 | ![](https://github.com/NikoSoftware/FrameModel/raw/master/image/Screenshot_2017-08-15-20-04-49-041_com.westarsoft.png) 25 | -------------------------------------------------------------------------------- /framelib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in F:\android\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/net/StringNullAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.net; 2 | 3 | import com.google.gson.TypeAdapter; 4 | import com.google.gson.stream.JsonReader; 5 | import com.google.gson.stream.JsonToken; 6 | import com.google.gson.stream.JsonWriter; 7 | 8 | import java.io.IOException; 9 | 10 | /** 11 | * 转换 null 为 "" 或者 “” 为 null 12 | * Created by niko on 2017/5/1. 13 | */ 14 | 15 | public class StringNullAdapter extends TypeAdapter { 16 | @Override 17 | public void write(JsonWriter writer, String value) throws IOException { 18 | // TODO Auto-generated method stub 19 | if (value == null) { 20 | writer.nullValue(); 21 | return; 22 | } 23 | writer.value(value); 24 | 25 | } 26 | 27 | @Override 28 | public String read(JsonReader reader) throws IOException { 29 | // TODO Auto-generated method stub 30 | if (reader.peek() == JsonToken.NULL) { 31 | reader.nextNull(); 32 | return ""; 33 | } 34 | return reader.nextString(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/net/ProgressListener.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.net; 2 | 3 | 4 | import android.app.Activity; 5 | import android.content.Context; 6 | 7 | import java.io.InputStream; 8 | 9 | import io.reactivex.Observable; 10 | import io.reactivex.ObservableOnSubscribe; 11 | import io.reactivex.internal.operators.observable.ObservableCreate; 12 | 13 | /** 14 | * Created by niko on 2017/11/6. 15 | */ 16 | 17 | public abstract class ProgressListener { 18 | 19 | private Context mContext; 20 | public ProgressListener(Context context) { 21 | mContext = context; 22 | } 23 | 24 | /** 25 | * 26 | * @param progress 已经下载或上传字节数 27 | * @param total 总字节数 28 | * @param done 是否完成 29 | */ 30 | public abstract void onProgress(long progress, long total, boolean done); 31 | 32 | 33 | 34 | public void onAsyMainProgress(final long progress, final long total, final boolean done){ 35 | 36 | ((Activity) mContext).runOnUiThread(new Runnable() { 37 | @Override 38 | public void run() { 39 | onProgress(progress,total,done); 40 | } 41 | }); 42 | } 43 | 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/pop/PopProgressDialog.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.pop; 2 | 3 | import android.app.Activity; 4 | import android.view.View; 5 | import android.view.animation.Animation; 6 | import android.widget.TextView; 7 | 8 | import com.example.framelib.R; 9 | import com.example.framelib.basepopup.BasePopupWindow; 10 | 11 | /** 12 | * Created by niko on 2017/7/22. 13 | */ 14 | 15 | public class PopProgressDialog extends BasePopupWindow { 16 | private TextView tvIntro; 17 | 18 | public PopProgressDialog(Activity context) { 19 | super(context); 20 | tvIntro = (TextView)findViewById(R.id.tv_intro); 21 | 22 | } 23 | 24 | @Override 25 | public View onCreatePopupView() { 26 | return createPopupById(R.layout.pop_progress_dialg); 27 | } 28 | 29 | @Override 30 | public View initAnimaView() { 31 | return null; 32 | } 33 | 34 | @Override 35 | protected Animation initShowAnimation() { 36 | return null; 37 | } 38 | 39 | @Override 40 | public View getClickToDismissView() { 41 | return null; 42 | } 43 | 44 | /** 45 | * 设置说明 46 | * @param msg 47 | */ 48 | public void setMsg(String msg){ 49 | 50 | tvIntro.setText(msg); 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/adapter/ImageRecyclerViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.adapter; 2 | 3 | import android.content.Context; 4 | 5 | import com.example.framelib.adapter.BaseRecyclerViewAdapter; 6 | import com.example.framelib.adapter.BaseViewHandle; 7 | import com.example.niko.framemodel.R; 8 | import com.example.niko.framemodel.model.TracksBean; 9 | import com.facebook.drawee.view.SimpleDraweeView; 10 | 11 | import java.util.Map; 12 | 13 | /** 14 | * Created by niko on 2017/5/3. 15 | */ 16 | 17 | public class ImageRecyclerViewAdapter extends BaseRecyclerViewAdapter { 18 | public ImageRecyclerViewAdapter(Context context) { 19 | super(context); 20 | } 21 | 22 | @Override 23 | public void setViewMap(Map map) { 24 | map.put( R.layout.recycler_item_view,new Integer[]{ 25 | R.id.imageview 26 | }); 27 | } 28 | 29 | @Override 30 | public void onBind(BaseViewHandle holder, int position, TracksBean model, int viewType) { 31 | ((SimpleDraweeView) holder.getView(R.id.imageview)).setImageURI(model.getAlbum().getBlurPicUrl()); 32 | } 33 | 34 | @Override 35 | public int getItemViewsType(int position) { 36 | return R.layout.recycler_item_view; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/net/ApiService.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.net; 2 | 3 | 4 | import com.example.niko.framemodel.model.MusicModel; 5 | 6 | import io.reactivex.Observable; 7 | import okhttp3.ResponseBody; 8 | import retrofit2.Call; 9 | import retrofit2.Response; 10 | import retrofit2.http.GET; 11 | import retrofit2.http.Headers; 12 | import retrofit2.http.Query; 13 | import retrofit2.http.Streaming; 14 | import retrofit2.http.Url; 15 | 16 | /** 17 | * Created by niko on 2017/3/18. 18 | */ 19 | 20 | public interface ApiService { 21 | 22 | 23 | /** 24 | * 获取链接信息 25 | * @param id 26 | * @return 27 | */ 28 | //58451795 29 | @Headers("Cache-Control: max-age=640000") 30 | @GET("/api/playlist/detail") 31 | public Observable> getMusic(@Query("id") String id); 32 | 33 | 34 | /** 35 | * 获取音乐数据 36 | * @param id 37 | * @return 38 | */ 39 | @Headers("Cache-Control: max-age=640000") 40 | @GET("/api/playlist/detail") 41 | public Call getCallMusic(@Query("id") String id); 42 | 43 | 44 | /** 45 | * 文件下载 46 | * @param url 文件下载地址 47 | * @return 48 | */ 49 | @Streaming 50 | @GET 51 | Call downloadFile(@Url String url); 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/application/BaseApplication.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.application; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import android.util.Log; 6 | 7 | import com.example.framelib.BuildConfig; 8 | import com.facebook.drawee.backends.pipeline.Fresco; 9 | 10 | import io.realm.Realm; 11 | import io.realm.RealmConfiguration; 12 | 13 | 14 | /** 15 | 16 | * Created by niko on 2017/1/11. 17 | */ 18 | 19 | public class BaseApplication extends Application { 20 | 21 | private Context mContext; 22 | 23 | @Override 24 | public void onCreate() { 25 | super.onCreate(); 26 | mContext = getApplicationContext(); 27 | init(); 28 | } 29 | 30 | /** 31 | * 初始化数据 32 | */ 33 | private void init() { 34 | 35 | Fresco.initialize(mContext); 36 | if (BuildConfig.LOG_DEBUG) { 37 | // LogUtil.init(true, Log.VERBOSE); 38 | } else { 39 | // LogUtil.init(false); 40 | } 41 | 42 | Realm.init(this); 43 | RealmConfiguration config = new RealmConfiguration.Builder() 44 | .name("myrealm.realm") 45 | .schemaVersion(1) 46 | .build(); 47 | Realm.setDefaultConfiguration(config); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/utils/Tools/CloseUtils.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.utils.Tools; 2 | 3 | import java.io.Closeable; 4 | import java.io.IOException; 5 | 6 | /** 7 | * Created by niko on 2018/2/2. 8 | * 关闭相关工具类 9 | */ 10 | public final class CloseUtils { 11 | 12 | private CloseUtils() { 13 | throw new UnsupportedOperationException("u can't instantiate me..."); 14 | } 15 | 16 | /** 17 | * 关闭IO 18 | * 19 | * @param closeables closeables 20 | */ 21 | public static void closeIO(final Closeable... closeables) { 22 | if (closeables == null) return; 23 | for (Closeable closeable : closeables) { 24 | if (closeable != null) { 25 | try { 26 | closeable.close(); 27 | } catch (IOException e) { 28 | e.printStackTrace(); 29 | } 30 | } 31 | } 32 | } 33 | 34 | /** 35 | * 安静关闭IO 36 | * 37 | * @param closeables closeables 38 | */ 39 | public static void closeIOQuietly(final Closeable... closeables) { 40 | if (closeables == null) return; 41 | for (Closeable closeable : closeables) { 42 | if (closeable != null) { 43 | try { 44 | closeable.close(); 45 | } catch (IOException ignored) { 46 | } 47 | } 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/utils/Tools/InputMethodUtils.java: -------------------------------------------------------------------------------- 1 | package com.example.framelib.utils.Tools; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | import android.view.inputmethod.InputMethodManager; 6 | 7 | /** 8 | * Created by niko on 2016/1/14. 9 | * 显示键盘d工具类 10 | */ 11 | public class InputMethodUtils { 12 | /** 显示软键盘 */ 13 | public static void showInputMethod(View view) { 14 | InputMethodManager imm = (InputMethodManager) view.getContext() 15 | .getSystemService(Context.INPUT_METHOD_SERVICE); 16 | if (imm != null) { 17 | imm.showSoftInput(view, InputMethodManager.SHOW_IMPLICIT); 18 | } 19 | } 20 | 21 | /** 显示软键盘 */ 22 | public static void showInputMethod(Context context) { 23 | InputMethodManager imm = (InputMethodManager) context 24 | .getSystemService(Context.INPUT_METHOD_SERVICE); 25 | imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS); 26 | } 27 | 28 | /** 多少时间后显示软键盘 */ 29 | public static void showInputMethod(final View view, long delayMillis) { 30 | if (view==null)return; 31 | // 显示输入法 32 | view.postDelayed(new Runnable() { 33 | 34 | @Override 35 | public void run() { 36 | InputMethodUtils.showInputMethod(view); 37 | } 38 | }, delayMillis); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/adapter/RecyclerViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.adapter; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | import android.widget.TextView; 6 | 7 | import com.example.framelib.adapter.BaseRecyclerViewAdapter; 8 | import com.example.framelib.adapter.BaseViewHandle; 9 | import com.example.niko.framemodel.R; 10 | 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | * 赋值测试 16 | * Created by Niko on 2016/4/27. 17 | */ 18 | public class RecyclerViewAdapter extends BaseRecyclerViewAdapter { 19 | 20 | 21 | public RecyclerViewAdapter(Context context){ 22 | super(context); 23 | 24 | } 25 | 26 | @Override 27 | public void setViewMap(Map map) { 28 | map.put( R.layout.item_view,new Integer[]{ 29 | R.id.imageview,R.id.textview 30 | }); 31 | 32 | } 33 | 34 | 35 | 36 | @Override 37 | public int getItemViewsType(int position) { 38 | return R.layout.item_view; 39 | } 40 | 41 | @Override 42 | public void onBind(BaseViewHandle holder, int position, String obj, int viewType) { 43 | ImageView imageView = (ImageView) holder.getView(R.id.imageview); 44 | TextView textView = (TextView) holder.getView(R.id.textview); 45 | imageView.setImageResource(R.mipmap.ic_launcher); 46 | textView.setText(obj); 47 | } 48 | 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /framelib/src/main/java/com/example/framelib/basepopup/BasePopup.java: -------------------------------------------------------------------------------- 1 | /* 2 | * The MIT License (MIT) 3 | * 4 | * Copyright (c) 2016 razerdp 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | package com.example.framelib.basepopup; 25 | 26 | import android.view.View; 27 | 28 | /** 29 | * Created by niko on 2016/1/14. 30 | * 31 | */ 32 | public interface BasePopup { 33 | View onCreatePopupView(); 34 | View initAnimaView(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/niko/framemodel/net/CallObserver.java: -------------------------------------------------------------------------------- 1 | package com.example.niko.framemodel.net; 2 | 3 | import android.util.Log; 4 | 5 | import com.example.niko.framemodel.model.ResultModel; 6 | 7 | import io.reactivex.Observer; 8 | import io.reactivex.disposables.Disposable; 9 | import retrofit2.Response; 10 | 11 | /** 12 | * 网络请求回调方法 13 | * Created by niko on 2017/7/14. 14 | */ 15 | 16 | public abstract class CallObserver implements Observer>> { 17 | 18 | 19 | @Override 20 | public void onSubscribe(Disposable d) { 21 | 22 | } 23 | 24 | @Override 25 | public void onNext(Response> value) { 26 | 27 | if(value!=null&&value.body()!=null) { 28 | Log.e("TAG==>",value.body().toString() + ""); 29 | }else{ 30 | Log.e("TAG==>",value + ""); 31 | } 32 | 33 | /** 34 | * code 由项目后台协定,暂时默认0为网络请求正确 35 | */ 36 | if(value.body().getCode()==0){ 37 | onSuccess(value.body().getData()); 38 | }else{ 39 | onFailure(value.body().getMsg()); 40 | } 41 | } 42 | 43 | 44 | @Override 45 | public void onError(Throwable e) { 46 | e.printStackTrace(); 47 | onFailure("网络异常"); 48 | } 49 | 50 | @Override 51 | public void onComplete() { 52 | 53 | } 54 | 55 | /** 56 | * 网络请求成功 57 | * @param t 58 | */ 59 | public abstract void onSuccess(T t); 60 | 61 | /** 62 | * 网络请求失败 63 | * @param msg 64 | */ 65 | public abstract void onFailure(String msg); 66 | 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 21 |