├── .gitignore ├── README.md ├── app ├── .gitignore ├── build.gradle ├── libs │ ├── ObservableScrollView-release.aar │ └── SildeMenulibrary-release.aar ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── github │ │ └── baby │ │ └── owspace │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── assets │ │ ├── fonts │ │ │ └── PMingLiU.ttf │ │ └── welcome_default.jpg │ ├── java │ │ └── com │ │ │ └── github │ │ │ └── baby │ │ │ └── owspace │ │ │ ├── app │ │ │ ├── OwpaceAppGlideModule.java │ │ │ └── OwspaceApplication.java │ │ │ ├── di │ │ │ ├── components │ │ │ │ ├── ApplicationComponent.java │ │ │ │ ├── ArtComponent.java │ │ │ │ ├── DBComponent.java │ │ │ │ ├── DailyComponent.java │ │ │ │ ├── DetailComponent.java │ │ │ │ ├── MainComponent.java │ │ │ │ ├── NetComponent.java │ │ │ │ └── SplashComponent.java │ │ │ ├── modules │ │ │ │ ├── ApplicationModule.java │ │ │ │ ├── ArtModule.java │ │ │ │ ├── DailyModule.java │ │ │ │ ├── DbModule.java │ │ │ │ ├── DetailModule.java │ │ │ │ ├── MainModule.java │ │ │ │ ├── NetModule.java │ │ │ │ └── SplashModule.java │ │ │ └── scopes │ │ │ │ ├── DBScope.java │ │ │ │ └── UserScope.java │ │ │ ├── model │ │ │ ├── api │ │ │ │ ├── ApiClient.java │ │ │ │ ├── ApiService.java │ │ │ │ ├── StringConverter.java │ │ │ │ └── StringConverterFactory.java │ │ │ ├── cache │ │ │ │ └── DiskLruCache.java │ │ │ ├── db │ │ │ │ └── DbOpenHelper.java │ │ │ ├── entity │ │ │ │ ├── CommentEntity.java │ │ │ │ ├── DetailEntity.java │ │ │ │ ├── Event.java │ │ │ │ ├── Item.java │ │ │ │ ├── LikeEntity.java │ │ │ │ ├── Recommend.java │ │ │ │ ├── Result.java │ │ │ │ └── SplashEntity.java │ │ │ └── util │ │ │ │ ├── DateTimeTypeAdapter.java │ │ │ │ ├── EntityUtils.java │ │ │ │ └── HttpUtils.java │ │ │ ├── player │ │ │ ├── IPlayback.java │ │ │ ├── MediaPlayController.java │ │ │ ├── PlayState.java │ │ │ ├── PlaybackService.java │ │ │ └── Player.java │ │ │ ├── presenter │ │ │ ├── ArticalContract.java │ │ │ ├── ArticalPresenter.java │ │ │ ├── DetailContract.java │ │ │ ├── DetailPresenter.java │ │ │ ├── MainContract.java │ │ │ ├── MainPresenter.java │ │ │ ├── SplashContract.java │ │ │ └── SplashPresenter.java │ │ │ ├── util │ │ │ ├── AppUtil.java │ │ │ ├── FileUtil.java │ │ │ ├── NetUtil.java │ │ │ ├── OkHttpImageDownloader.java │ │ │ ├── PaintViewUtil.java │ │ │ ├── PreferenceUtils.java │ │ │ ├── TimeUtil.java │ │ │ ├── TimeUtils.java │ │ │ └── tool │ │ │ │ ├── AnalysisHTML.java │ │ │ │ └── RxBus.java │ │ │ └── view │ │ │ ├── activity │ │ │ ├── ArtActivity.java │ │ │ ├── AudioDetailActivity.java │ │ │ ├── BaseActivity.java │ │ │ ├── DailyActivity.java │ │ │ ├── DetailActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── SettingsActivity.java │ │ │ ├── SplashActivity.java │ │ │ └── VideoDetailActivity.java │ │ │ ├── adapter │ │ │ ├── ArtRecycleViewAdapter.java │ │ │ ├── DailyViewPagerAdapter.java │ │ │ ├── VerticalPagerAdapter.java │ │ │ └── VerticalRecycleViewAdapter.java │ │ │ ├── fragment │ │ │ ├── DailyItemFragment.java │ │ │ ├── LeftMenuFragment.java │ │ │ ├── MainFragment.java │ │ │ └── RightMenuFragment.java │ │ │ └── widget │ │ │ ├── CustomPtrHeader.java │ │ │ ├── CustomScrollView.java │ │ │ ├── DividerItemDecoration.java │ │ │ ├── FixedImageView.java │ │ │ ├── LunarDialog.java │ │ │ ├── SelectTextView.java │ │ │ ├── VerticalViewPager.java │ │ │ └── recycleView │ │ │ ├── RecyclerViewPager.java │ │ │ ├── RecyclerViewPagerAdapter.java │ │ │ └── ViewUtils.java │ └── res │ │ ├── drawable-480dpi │ │ ├── app_logo.png │ │ ├── arrow_left.png │ │ ├── arrow_right_grey.png │ │ ├── arrow_top.png │ │ ├── avater_arrow_down.png │ │ ├── avater_arrow_up.png │ │ ├── avater_default.png │ │ ├── column.png │ │ ├── comment.png │ │ ├── comment_like.png │ │ ├── comment_like_big.png │ │ ├── comment_like_p.png │ │ ├── cursor_end.png │ │ ├── cursor_start.png │ │ ├── delete_icon.png │ │ ├── dialog_shadow_bg.9.png │ │ ├── dot_normal.png │ │ ├── dot_selected.png │ │ ├── download_cb_checked.png │ │ ├── download_cb_unchecked.png │ │ ├── download_pause.png │ │ ├── download_start.png │ │ ├── download_start_white.png │ │ ├── favorite_normal.png │ │ ├── favorite_selected.png │ │ ├── fork.png │ │ ├── gou.png │ │ ├── ic_back.png │ │ ├── ic_launcher.png │ │ ├── icon_sogo_welcome.png │ │ ├── icon_tecent_welcome.png │ │ ├── icon_xiaomi_welcome.png │ │ ├── library_login_del_normal.png │ │ ├── library_login_del_normal_night.png │ │ ├── library_login_del_press.png │ │ ├── library_login_eye_open.png │ │ ├── library_login_eye_open_night.png │ │ ├── library_login_sina.png │ │ ├── library_login_weixin.png │ │ ├── library_video_mediacontroller_pause.png │ │ ├── library_video_mediacontroller_play.png │ │ ├── library_video_mediacontroller_share.png │ │ ├── library_video_mediacontroller_to_full.png │ │ ├── library_video_mediacontroller_to_half.png │ │ ├── library_video_play_symbol.png │ │ ├── library_video_seekbar_thumb_normal.png │ │ ├── library_voice_ground_glass.png │ │ ├── library_voice_mediacontroller_decelerate.png │ │ ├── library_voice_mediacontroller_pause.png │ │ ├── library_voice_mediacontroller_play.png │ │ ├── library_voice_mediacontroller_speed.png │ │ ├── library_voice_play_symbol.png │ │ ├── loading_news.gif │ │ ├── logo_owspace.png │ │ ├── more.png │ │ ├── news_share_copy.png │ │ ├── news_share_email.png │ │ ├── news_share_evernote.png │ │ ├── news_share_sinaweibo.png │ │ ├── news_share_wechat.png │ │ ├── news_share_wechatmoments.png │ │ ├── paper_comment.png │ │ ├── paper_comment_night.png │ │ ├── paper_like.png │ │ ├── paper_like_big.png │ │ ├── paper_like_big_selected.png │ │ ├── paper_like_night.png │ │ ├── paper_like_selected.png │ │ ├── person.png │ │ ├── pull_down_note_edit.png │ │ ├── pull_up_note_edit.png │ │ ├── pulltorefresh_default_ptr_rotate.png │ │ ├── refresh_drop.gif │ │ ├── refresh_loading.gif │ │ ├── right_arrow.png │ │ ├── search_logo.png │ │ ├── search_white.png │ │ ├── send_s.png │ │ ├── setting.png │ │ ├── share.png │ │ ├── umeng_fb_feedback_edit_bg.9.png │ │ ├── umeng_fb_feedback_send_button.png │ │ ├── version.png │ │ ├── video_play_symbol.png │ │ ├── voice_logo.png │ │ ├── voice_play_symbol.png │ │ ├── welcome_default2.png │ │ ├── welcome_weread.png │ │ ├── weread_horizontal.png │ │ ├── weread_signature.png │ │ ├── white_shadow_bg.9.png │ │ └── write.png │ │ ├── drawable-hdpi │ │ └── iconfont_downgrey.png │ │ ├── drawable │ │ ├── common_divider_xlarge_horizontal.xml │ │ ├── ic_pause.xml │ │ ├── ic_play.xml │ │ ├── ic_play_last.xml │ │ ├── ic_play_next.xml │ │ ├── ic_remote_view_close.xml │ │ ├── ic_remote_view_pause.xml │ │ ├── ic_remote_view_play.xml │ │ ├── ic_remote_view_play_last.xml │ │ ├── ic_remote_view_play_next.xml │ │ ├── selector_remote_views_action_background.xml │ │ └── shadow.xml │ │ ├── layout │ │ ├── activity_art_detail.xml │ │ ├── activity_audio.xml │ │ ├── activity_daily.xml │ │ ├── activity_list_layout.xml │ │ ├── activity_main.xml │ │ ├── activity_settings.xml │ │ ├── activity_splash.xml │ │ ├── activity_video_detail.xml │ │ ├── dialog_lunar.xml │ │ ├── fragment_left_menu.xml │ │ ├── fragment_right_menu.xml │ │ ├── item_art.xml │ │ ├── item_daily.xml │ │ ├── item_image_view.xml │ │ ├── item_main_page.xml │ │ ├── left_menu.xml │ │ ├── recycleview_footer.xml │ │ ├── refresh_header.xml │ │ ├── remote_view_music_player.xml │ │ ├── remote_view_music_player_small.xml │ │ └── right_menu.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-v21 │ │ └── styles.xml │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── github │ └── baby │ └── owspace │ └── ExampleUnitTest.java ├── art ├── show.gif ├── show1.png ├── show2.png ├── show3.png ├── show4.png ├── show5.png ├── show6.png ├── show7.png └── show8.png ├── build.gradle ├── gradle.properties ├── gradlew ├── gradlew.bat └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | /SildeMenulibrary 10 | /xrecyclerview 11 | /.idea 12 | /gradle 13 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # owspace 2 | owspace是基于MVP+Dagger2+Retrofit2.0+Rxjava的APP 3 | 4 | # 简介 5 | owspace是一款高仿单读的APP,API接口通过非法手段获取。
6 | 7 | # 你能学到 8 | * MVP模式 9 | * Retrofit2.0 + rxjava 10 | * Dagger2 11 | * jsoup解析DOM 12 | * sqldelight SqlBrite 13 | * 音视频播放等 14 | * some fucking source code 15 | 16 | # 里程碑列表 17 | ### 2018/3/27 升级API Level到27,各种依赖包全部升级 18 | ### 2017/11/27 更新gradle、更新相关dependencies版本 19 | ### 2016/11/25 添加音频播放 20 | ### 2016/11/8 添加视频播放功能 21 | ### 2016/11/4 添加新细明字体 22 | ### 2016/10/28 Dagger2改造 23 | ### 2016/7/21 初始化 24 | 25 | # demo 26 | 27 | [最新DEMO点击下载](https://beta.bugly.qq.com/5rik) 28 | 29 | 30 | # 展示 31 | ![image](art/show1.png) ![image](art/show2.png) 32 | 33 | ![image](art/show3.png) ![image](art/show4.png) 34 | 35 | ![image](art/show5.png) ![image](art/show6.png) 36 | 37 | ![image](art/show7.png) ![image](art/show8.png) 38 | 39 | ![image](art/show.gif) 40 | 41 | # TODO LIST 42 | * sqldelight SqlBrite 缓存 43 | * 字体 44 | * 评论列表 45 | * some fucking features 46 | 47 | # 声明 48 | 单读这个文艺的APP本人比较喜欢,一时冲动就抓取了数据,反编译了APP。so,API接口是通过非法手段获取,严禁商用,违者后果自负。
49 | 50 | # thanks 51 | ``` 52 | implementation fileTree(include: ['*.jar'], dir: 'libs') 53 | implementation 'com.android.support:appcompat-v7:27.1.0' 54 | implementation 'com.android.support:recyclerview-v7:27.1.0' 55 | implementation 'com.android.support:design:27.1.0' 56 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 57 | testImplementation 'junit:junit:4.12' 58 | implementation(name: 'SildeMenulibrary-release', ext: 'aar') 59 | implementation(name: 'ObservableScrollView-release', ext: 'aar') 60 | implementation 'com.jakewharton:butterknife:8.8.1' 61 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' 62 | implementation 'com.google.code.gson:gson:2.8.0' 63 | implementation 'net.danlew:android.joda:2.9.3' 64 | implementation 'com.squareup.okhttp3:okhttp:3.9.1' 65 | implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1' 66 | implementation 'com.squareup.retrofit2:retrofit:2.3.0' 67 | implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0' 68 | implementation 'com.squareup.retrofit2:converter-gson:2.1.0' 69 | implementation 'com.squareup.sqlbrite:sqlbrite:0.7.0' 70 | implementation 'io.reactivex:rxandroid:1.2.1' 71 | implementation 'io.reactivex:rxjava:1.2.1' 72 | implementation 'com.github.bumptech.glide:glide:4.6.1' 73 | annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1' 74 | implementation 'com.orhanobut:logger:2.1.1' 75 | implementation 'com.elyeproj.libraries:loaderviewlibrary:1.2.1' 76 | implementation 'in.srain.cube:ultra-ptr:1.0.11' 77 | implementation 'org.jsoup:jsoup:1.11.1' 78 | implementation 'pub.devrel:easypermissions:0.3.0' 79 | implementation 'com.wang.avi:library:2.1.3' 80 | implementation 'fm.jiecao:jiecaovideoplayer:4.8.2' 81 | implementation 'com.google.dagger:dagger:2.14.1' 82 | annotationProcessor 'com.google.dagger:dagger-compiler:2.14.1' 83 | //java注解 84 | implementation 'org.glassfish:javax.annotation:10.0-b28' 85 | //字体 86 | implementation 'uk.co.chrisjenx:calligraphy:2.2.0' 87 | 88 | ``` 89 | 90 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | // Apply plugin 3 | //apply plugin: 'com.neenbedankt.android-apt' 4 | // 根据日期自动生成build号 5 | def calendar = Calendar.getInstance(); 6 | def version = String.format("%d%02d%02d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DAY_OF_MONTH)); 7 | def time = String.format("%d%02d%02d%d%d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DAY_OF_MONTH),calendar.get(Calendar.HOUR_OF_DAY),calendar.get(Calendar.MINUTE)); 8 | def name = time+"build"; 9 | android { 10 | compileSdkVersion 27 11 | buildToolsVersion '27.0.3' 12 | defaultConfig { 13 | applicationId "com.github.baby.owspace" 14 | minSdkVersion 16 15 | targetSdkVersion 27 16 | versionCode Integer.parseInt(version) 17 | versionName name 18 | // signingConfig signingConfigs.config 19 | vectorDrawables.useSupportLibrary = true 20 | } 21 | buildTypes { 22 | release { 23 | buildConfigField("boolean","API_ENV","true") 24 | minifyEnabled false 25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 26 | // signingConfig signingConfigs.config 27 | } 28 | debug { 29 | buildConfigField("boolean","API_ENV","false") 30 | minifyEnabled false 31 | // signingConfig signingConfigs.config 32 | } 33 | } 34 | productFlavors { 35 | } 36 | } 37 | repositories{ 38 | flatDir{ 39 | dirs 'libs' 40 | } 41 | } 42 | 43 | dependencies { 44 | implementation fileTree(include: ['*.jar'], dir: 'libs') 45 | implementation 'com.android.support:appcompat-v7:27.1.0' 46 | implementation 'com.android.support:recyclerview-v7:27.1.0' 47 | implementation 'com.android.support:design:27.1.0' 48 | implementation 'com.android.support.constraint:constraint-layout:1.0.2' 49 | testImplementation 'junit:junit:4.12' 50 | implementation(name: 'SildeMenulibrary-release', ext: 'aar') 51 | implementation(name: 'ObservableScrollView-release', ext: 'aar') 52 | implementation 'com.jakewharton:butterknife:8.8.1' 53 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1' 54 | implementation 'com.google.code.gson:gson:2.8.0' 55 | implementation 'net.danlew:android.joda:2.9.3' 56 | implementation 'com.squareup.okhttp3:okhttp:3.9.1' 57 | implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1' 58 | implementation 'com.squareup.retrofit2:retrofit:2.3.0' 59 | implementation 'com.squareup.retrofit2:adapter-rxjava:2.1.0' 60 | implementation 'com.squareup.retrofit2:converter-gson:2.1.0' 61 | implementation 'com.squareup.sqlbrite:sqlbrite:0.7.0' 62 | implementation 'io.reactivex:rxandroid:1.2.1' 63 | implementation 'io.reactivex:rxjava:1.2.1' 64 | implementation 'com.github.bumptech.glide:glide:4.6.1' 65 | annotationProcessor 'com.github.bumptech.glide:compiler:4.6.1' 66 | implementation 'com.orhanobut:logger:2.1.1' 67 | implementation 'com.elyeproj.libraries:loaderviewlibrary:1.2.1' 68 | implementation 'in.srain.cube:ultra-ptr:1.0.11' 69 | implementation 'org.jsoup:jsoup:1.11.1' 70 | implementation 'pub.devrel:easypermissions:0.3.0' 71 | implementation 'com.wang.avi:library:2.1.3' 72 | implementation 'fm.jiecao:jiecaovideoplayer:4.8.2' 73 | implementation 'com.google.dagger:dagger:2.14.1' 74 | annotationProcessor 'com.google.dagger:dagger-compiler:2.14.1' 75 | //java注解 76 | implementation 'org.glassfish:javax.annotation:10.0-b28' 77 | //字体 78 | implementation 'uk.co.chrisjenx:calligraphy:2.2.0' 79 | 80 | } 81 | -------------------------------------------------------------------------------- /app/libs/ObservableScrollView-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/libs/ObservableScrollView-release.aar -------------------------------------------------------------------------------- /app/libs/SildeMenulibrary-release.aar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/libs/SildeMenulibrary-release.aar -------------------------------------------------------------------------------- /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 D:\android_env\android\AndroidSdk/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 | -keep class tv.danmaku.ijk.** { *; } 19 | -dontwarn tv.danmaku.ijk.** -------------------------------------------------------------------------------- /app/src/androidTest/java/com/github/baby/owspace/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 16 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 32 | 35 | 38 | 41 | 44 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /app/src/main/assets/fonts/PMingLiU.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/assets/fonts/PMingLiU.ttf -------------------------------------------------------------------------------- /app/src/main/assets/welcome_default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/assets/welcome_default.jpg -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/app/OwpaceAppGlideModule.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.app; 2 | 3 | import com.bumptech.glide.annotation.GlideModule; 4 | import com.bumptech.glide.module.AppGlideModule; 5 | 6 | /** 7 | * Created by Mr.Yangxiufeng 8 | * DATE 2018/3/27 9 | * owspace 10 | */ 11 | @GlideModule 12 | public final class OwpaceAppGlideModule extends AppGlideModule{ 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/app/OwspaceApplication.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.app; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | 6 | import com.github.baby.owspace.BuildConfig; 7 | import com.github.baby.owspace.R; 8 | import com.github.baby.owspace.di.components.DaggerNetComponent; 9 | import com.github.baby.owspace.di.components.NetComponent; 10 | import com.github.baby.owspace.di.modules.NetModule; 11 | import com.orhanobut.logger.AndroidLogAdapter; 12 | import com.orhanobut.logger.Logger; 13 | 14 | import uk.co.chrisjenx.calligraphy.CalligraphyConfig; 15 | 16 | /** 17 | * Created by Mr.Yangxiufeng 18 | * DATE 2016/7/21 19 | * Owspace 20 | */ 21 | public class OwspaceApplication extends Application{ 22 | 23 | private static OwspaceApplication instance; 24 | 25 | public static OwspaceApplication get(Context context){ 26 | return (OwspaceApplication)context.getApplicationContext(); 27 | } 28 | 29 | private NetComponent netComponent; 30 | 31 | @Override 32 | public void onCreate() { 33 | super.onCreate(); 34 | instance = this; 35 | initLogger(); 36 | initNet(); 37 | initDatabase(); 38 | initTypeFace(); 39 | } 40 | private void initTypeFace() { 41 | CalligraphyConfig calligraphyConfig =new CalligraphyConfig.Builder() 42 | .setDefaultFontPath("fonts/PMingLiU.ttf") 43 | .setFontAttrId(R.attr.fontPath) 44 | .build(); 45 | CalligraphyConfig.initDefault(calligraphyConfig); 46 | } 47 | 48 | private void initLogger(){ 49 | Logger.addLogAdapter(new AndroidLogAdapter()); 50 | // LogLevel logLevel; 51 | // if (!BuildConfig.API_ENV){ 52 | // logLevel = LogLevel.FULL; 53 | // }else{ 54 | // logLevel = LogLevel.NONE; 55 | // } 56 | // Logger.addLogAdapter(); 57 | // Logger.init("GithubOwspace") // default PRETTYLOGGER or use just init() 58 | // .methodCount(3) // default 2 59 | // .logLevel(logLevel) ; // default LogLevel.FULL 60 | } 61 | private void initNet(){ 62 | netComponent = DaggerNetComponent.builder() 63 | .netModule(new NetModule()) 64 | .build(); 65 | } 66 | private void initDatabase(){ 67 | 68 | } 69 | 70 | public NetComponent getNetComponent() { 71 | return netComponent; 72 | } 73 | 74 | public static OwspaceApplication getInstance() { 75 | return instance; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/components/ApplicationComponent.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.components; 2 | 3 | 4 | import com.github.baby.owspace.di.modules.ApplicationModule; 5 | import com.github.baby.owspace.model.api.ApiService; 6 | 7 | import dagger.Component; 8 | 9 | /** 10 | * Created by Mr.Yangxiufeng 11 | * DATE 2016/10/22 12 | * owspace 13 | */ 14 | @Component(modules = ApplicationModule.class) 15 | public interface ApplicationComponent { 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/components/ArtComponent.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.components; 2 | 3 | import com.github.baby.owspace.di.modules.ArtModule; 4 | import com.github.baby.owspace.di.scopes.UserScope; 5 | import com.github.baby.owspace.view.activity.ArtActivity; 6 | 7 | import dagger.Component; 8 | 9 | /** 10 | * Created by Mr.Yangxiufeng 11 | * DATE 2016/10/22 12 | * owspace 13 | */ 14 | @UserScope 15 | @Component(modules = ArtModule.class,dependencies = NetComponent.class) 16 | public interface ArtComponent { 17 | void inject(ArtActivity artActivity); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/components/DBComponent.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.components; 2 | 3 | import android.database.sqlite.SQLiteOpenHelper; 4 | 5 | import com.github.baby.owspace.di.modules.DbModule; 6 | import com.squareup.sqlbrite.BriteDatabase; 7 | import com.squareup.sqlbrite.SqlBrite; 8 | 9 | import javax.inject.Singleton; 10 | 11 | import dagger.Component; 12 | 13 | /** 14 | * Created by Mr.Yangxiufeng 15 | * DATE 2016/11/7 16 | * owspace 17 | */ 18 | @Component(modules = DbModule.class) 19 | @Singleton 20 | public interface DBComponent { 21 | SQLiteOpenHelper getSQLiteOpenHelper(); 22 | SqlBrite getSqlBrite(); 23 | BriteDatabase getBriteDatabase(); 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/components/DailyComponent.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.components; 2 | 3 | import com.github.baby.owspace.di.modules.DailyModule; 4 | import com.github.baby.owspace.di.scopes.UserScope; 5 | import com.github.baby.owspace.view.activity.DailyActivity; 6 | 7 | import dagger.Component; 8 | 9 | /** 10 | * Created by Mr.Yangxiufeng 11 | * DATE 2016/10/22 12 | * owspace 13 | */ 14 | @UserScope 15 | @Component(modules = DailyModule.class,dependencies = NetComponent.class) 16 | public interface DailyComponent { 17 | void inject(DailyActivity activity); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/components/DetailComponent.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.components; 2 | 3 | import com.github.baby.owspace.di.modules.DetailModule; 4 | import com.github.baby.owspace.di.scopes.UserScope; 5 | import com.github.baby.owspace.view.activity.AudioDetailActivity; 6 | import com.github.baby.owspace.view.activity.DetailActivity; 7 | import com.github.baby.owspace.view.activity.VideoDetailActivity; 8 | 9 | import dagger.Component; 10 | 11 | /** 12 | * Created by Mr.Yangxiufeng 13 | * DATE 2016/10/22 14 | * owspace 15 | */ 16 | @UserScope 17 | @Component(modules = DetailModule.class,dependencies = NetComponent.class) 18 | public interface DetailComponent { 19 | void inject(DetailActivity activity); 20 | void inject(VideoDetailActivity activity); 21 | void inject(AudioDetailActivity activity); 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/components/MainComponent.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.components; 2 | 3 | import com.github.baby.owspace.di.modules.MainModule; 4 | import com.github.baby.owspace.di.scopes.UserScope; 5 | import com.github.baby.owspace.view.activity.MainActivity; 6 | 7 | import dagger.Component; 8 | 9 | /** 10 | * Created by Mr.Yangxiufeng 11 | * DATE 2016/10/22 12 | * owspace 13 | */ 14 | @UserScope 15 | @Component(modules = MainModule.class,dependencies = NetComponent.class) 16 | public interface MainComponent { 17 | void inject(MainActivity activity); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/components/NetComponent.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.components; 2 | 3 | import com.github.baby.owspace.di.modules.NetModule; 4 | import com.github.baby.owspace.model.api.ApiService; 5 | 6 | import javax.inject.Singleton; 7 | 8 | import dagger.Component; 9 | import okhttp3.OkHttpClient; 10 | import retrofit2.Retrofit; 11 | 12 | /** 13 | * Created by Mr.Yangxiufeng 14 | * DATE 2016/10/27 15 | * owspace 16 | */ 17 | @Component(modules = NetModule.class) 18 | @Singleton 19 | public interface NetComponent { 20 | ApiService getApiService(); 21 | OkHttpClient getOkHttp(); 22 | Retrofit getRetrofit(); 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/components/SplashComponent.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.components; 2 | 3 | import com.github.baby.owspace.di.modules.SplashModule; 4 | import com.github.baby.owspace.di.scopes.UserScope; 5 | import com.github.baby.owspace.view.activity.SplashActivity; 6 | 7 | import dagger.Component; 8 | 9 | /** 10 | * Created by Mr.Yangxiufeng 11 | * DATE 2016/10/25 12 | * owspace 13 | */ 14 | @UserScope 15 | @Component(modules = SplashModule.class,dependencies = NetComponent.class) 16 | public interface SplashComponent { 17 | void inject(SplashActivity splashActivity); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/modules/ApplicationModule.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.modules; 2 | 3 | import android.content.Context; 4 | 5 | import javax.inject.Singleton; 6 | 7 | import dagger.Module; 8 | import dagger.Provides; 9 | 10 | /** 11 | * Created by Mr.Yangxiufeng 12 | * DATE 2016/10/22 13 | * owspace 14 | */ 15 | @Module 16 | public class ApplicationModule { 17 | private Context context; 18 | 19 | public ApplicationModule(Context context) { 20 | this.context = context; 21 | } 22 | 23 | @Provides 24 | @Singleton 25 | public Context providerContext(){ 26 | return context; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/modules/ArtModule.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.modules; 2 | 3 | import com.github.baby.owspace.presenter.ArticalContract; 4 | 5 | import dagger.Module; 6 | import dagger.Provides; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/10/22 11 | * owspace 12 | */ 13 | @Module 14 | public class ArtModule { 15 | private ArticalContract.View mView; 16 | 17 | public ArtModule(ArticalContract.View mView) { 18 | this.mView = mView; 19 | } 20 | @Provides 21 | public ArticalContract.View provideView(){ 22 | return mView; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/modules/DailyModule.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.modules; 2 | 3 | import com.github.baby.owspace.presenter.ArticalContract; 4 | 5 | import dagger.Module; 6 | import dagger.Provides; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/10/22 11 | * owspace 12 | */ 13 | @Module 14 | public class DailyModule { 15 | private ArticalContract.View mView; 16 | 17 | public DailyModule(ArticalContract.View mView) { 18 | this.mView = mView; 19 | } 20 | @Provides 21 | public ArticalContract.View provideView(){ 22 | return mView; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/modules/DbModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Square, Inc. 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.github.baby.owspace.di.modules; 17 | 18 | import android.app.Application; 19 | import android.database.sqlite.SQLiteOpenHelper; 20 | 21 | import com.github.baby.owspace.model.db.DbOpenHelper; 22 | import com.orhanobut.logger.Logger; 23 | import com.squareup.sqlbrite.BriteDatabase; 24 | import com.squareup.sqlbrite.SqlBrite; 25 | 26 | import javax.inject.Singleton; 27 | 28 | import dagger.Module; 29 | import dagger.Provides; 30 | import rx.schedulers.Schedulers; 31 | 32 | @Module 33 | public class DbModule { 34 | private Application application; 35 | 36 | public DbModule(Application application) { 37 | this.application = application; 38 | } 39 | @Provides @Singleton Application provideApplication() { 40 | return application; 41 | } 42 | @Provides 43 | @Singleton SQLiteOpenHelper provideOpenHelper(Application application) { 44 | return new DbOpenHelper(application); 45 | } 46 | 47 | @Provides 48 | @Singleton 49 | SqlBrite provideSqlBrite() { 50 | return SqlBrite.create(new SqlBrite.Logger() { 51 | @Override public void log(String message) { 52 | Logger.d(message); 53 | } 54 | }); 55 | } 56 | 57 | @Provides 58 | @Singleton 59 | BriteDatabase provideDatabase(SqlBrite sqlBrite, SQLiteOpenHelper helper) { 60 | BriteDatabase db = sqlBrite.wrapDatabaseHelper(helper, Schedulers.io()); 61 | db.setLoggingEnabled(true); 62 | return db; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/modules/DetailModule.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.modules; 2 | 3 | import com.github.baby.owspace.presenter.DetailContract; 4 | 5 | import dagger.Module; 6 | import dagger.Provides; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/10/22 11 | * owspace 12 | */ 13 | @Module 14 | public class DetailModule { 15 | private DetailContract.View mView; 16 | 17 | public DetailModule(DetailContract.View mView) { 18 | this.mView = mView; 19 | } 20 | @Provides 21 | public DetailContract.View provideView(){ 22 | return mView; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/modules/MainModule.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.modules; 2 | 3 | import com.github.baby.owspace.presenter.MainContract; 4 | 5 | import dagger.Module; 6 | import dagger.Provides; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/10/22 11 | * owspace 12 | */ 13 | @Module 14 | public class MainModule { 15 | private final MainContract.View mView; 16 | 17 | public MainModule(MainContract.View mView) { 18 | this.mView = mView; 19 | } 20 | @Provides 21 | public MainContract.View provideMainView(){ 22 | return mView; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/modules/NetModule.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.modules; 2 | 3 | import com.github.baby.owspace.BuildConfig; 4 | import com.github.baby.owspace.model.api.ApiService; 5 | import com.github.baby.owspace.model.api.StringConverterFactory; 6 | import com.github.baby.owspace.model.util.EntityUtils; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | import javax.inject.Singleton; 11 | 12 | import dagger.Module; 13 | import dagger.Provides; 14 | import okhttp3.OkHttpClient; 15 | import okhttp3.logging.HttpLoggingInterceptor; 16 | import retrofit2.Retrofit; 17 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 18 | import retrofit2.converter.gson.GsonConverterFactory; 19 | 20 | /** 21 | * Created by Mr.Yangxiufeng 22 | * DATE 2016/10/27 23 | * owspace 24 | */ 25 | @Module 26 | public class NetModule { 27 | @Provides 28 | @Singleton 29 | public OkHttpClient provideOkHttpClient() { 30 | HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(); 31 | loggingInterceptor.setLevel(BuildConfig.DEBUG ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE); 32 | OkHttpClient okhttpClient = new OkHttpClient.Builder() 33 | .connectTimeout(30, TimeUnit.SECONDS) 34 | .connectTimeout(20, TimeUnit.SECONDS) 35 | .readTimeout(20,TimeUnit.SECONDS) 36 | .addInterceptor(loggingInterceptor) 37 | .build(); 38 | return okhttpClient; 39 | } 40 | @Provides 41 | @Singleton 42 | public Retrofit provideRetrofit(OkHttpClient okhttpClient) { 43 | Retrofit retrofit = new Retrofit.Builder() 44 | .client(okhttpClient) 45 | .baseUrl("http://static.owspace.com/") 46 | .addConverterFactory(StringConverterFactory.create()) 47 | .addConverterFactory(GsonConverterFactory.create(EntityUtils.gson))// 48 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) 49 | .build(); 50 | return retrofit; 51 | } 52 | @Provides 53 | @Singleton 54 | public ApiService provideApiService(Retrofit retrofit){ 55 | return retrofit.create(ApiService.class); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/modules/SplashModule.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.modules; 2 | 3 | import com.github.baby.owspace.presenter.SplashContract; 4 | 5 | import dagger.Module; 6 | import dagger.Provides; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/10/22 11 | * owspace 12 | */ 13 | @Module 14 | public class SplashModule { 15 | private SplashContract.View view; 16 | 17 | public SplashModule(SplashContract.View view) { 18 | this.view = view; 19 | } 20 | @Provides 21 | public SplashContract.View provideView(){ 22 | return view; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/scopes/DBScope.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.scopes; 2 | 3 | import javax.inject.Scope; 4 | 5 | /** 6 | * Created by Mr.Yangxiufeng 7 | * DATE 2016/10/28 8 | * owspace 9 | */ 10 | @Scope 11 | public @interface DBScope { 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/di/scopes/UserScope.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.di.scopes; 2 | 3 | import javax.inject.Scope; 4 | 5 | /** 6 | * Created by Mr.Yangxiufeng 7 | * DATE 2016/10/27 8 | * owspace 9 | */ 10 | @Scope 11 | public @interface UserScope { 12 | } 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/api/ApiClient.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.api; 2 | 3 | import com.github.baby.owspace.model.util.EntityUtils; 4 | import com.github.baby.owspace.model.util.HttpUtils; 5 | 6 | import java.text.StringCharacterIterator; 7 | 8 | import retrofit2.Retrofit; 9 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 10 | import retrofit2.converter.gson.GsonConverterFactory; 11 | 12 | /** 13 | * Created by Mr.Yangxiufeng 14 | * DATE 2016/7/21 15 | * Owspace 16 | */ 17 | public final class ApiClient { 18 | private ApiClient(){} 19 | // public static final String API_BASE_URL = "http://static.owspace.com/"; 20 | //converters 被添加的顺序将是它们被Retrofit尝试的顺序 21 | // public static final ApiService service = new Retrofit.Builder() 22 | // .baseUrl(API_BASE_URL) 23 | // .client(HttpUtils.client) 24 | // .addConverterFactory(StringConverterFactory.create()) 25 | // .addConverterFactory(GsonConverterFactory.create(EntityUtils.gson))// 26 | // .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) 27 | // .build() 28 | // .create(ApiService.class); 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/api/ApiService.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.api; 2 | 3 | import com.github.baby.owspace.model.entity.DetailEntity; 4 | import com.github.baby.owspace.model.entity.Item; 5 | import com.github.baby.owspace.model.entity.Result; 6 | import com.github.baby.owspace.model.entity.SplashEntity; 7 | 8 | import java.util.List; 9 | import retrofit2.http.GET; 10 | import retrofit2.http.Query; 11 | import rx.Observable; 12 | 13 | /** 14 | * Created by Mr.Yangxiufeng 15 | * DATE 2016/7/21 16 | * Owspace 17 | */ 18 | public interface ApiService { 19 | /** 20 | *

http://static.owspace.com/static/picture_list.txt?client=android&version=1.3.0&time=1467864021&device_id=866963027059338

21 | * 22 | * @param client 23 | * @param version 24 | * @param time 25 | * @param deviceId 26 | * @return 27 | */ 28 | @GET("static/picture_list.txt") 29 | Observable getSplash(@Query("client") String client, @Query("version") String version, @Query("time") Long time, @Query("device_id") String deviceId); 30 | 31 | /** 32 | * http://static.owspace.com/?c=api&a=getPost&post_id=292296&show_sdv=1 33 | *

详情页

34 | * 35 | * @param c 36 | * @param a 37 | * @param post_id 38 | * @param show_sdv 39 | * @return 40 | */ 41 | @GET("/") 42 | Observable> getDetail(@Query("c") String c, @Query("a") String a, @Query("post_id") String post_id, @Query("show_sdv") int show_sdv); 43 | 44 | /** 45 | *

分类列表

46 | *

http://static.owspace.com/?c=api&a=getList&p=1&model=1&page_id=0&create_time=0&client=android&version=1.3.0&time=1467867330&device_id=866963027059338&show_sdv=1

47 | * 48 | * @param c 49 | * @param a 50 | * @param page 51 | * @param model(0:首页,1:文字,2:声音,3:影像,4:单向历) 52 | * @param pageId 53 | * @param time 54 | * @param deviceId 55 | * @param show_sdv 56 | * @return 57 | */ 58 | @GET("/") 59 | Observable>> getList(@Query("c") String c, @Query("a") String a, @Query("p") int page, @Query("model") int model, @Query("page_id") String pageId, @Query("create_time") String createTime, @Query("client") String client, @Query("version") String version, @Query("time") long time, @Query("device_id") String deviceId, @Query("show_sdv") int show_sdv); 60 | 61 | /** 62 | * http://static.owspace.com/index.php?m=Home&c=Api&a=getLunar&client=android&device_id=866963027059338&version=866963027059338 63 | * @return 64 | */ 65 | @GET("index.php") 66 | Observable getRecommend(@Query("m") String m,@Query("c") String api,@Query("a") String a,@Query("client") String client,@Query("version") String version, @Query("device_id") String deviceId); 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/api/StringConverter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.api; 2 | 3 | import java.io.IOException; 4 | 5 | import okhttp3.ResponseBody; 6 | import retrofit2.Converter; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/9/1 11 | * owspace 12 | */ 13 | public class StringConverter implements Converter { 14 | 15 | @Override 16 | public String convert(ResponseBody value) throws IOException { 17 | return value.string(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/api/StringConverterFactory.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.api; 2 | 3 | import java.lang.annotation.Annotation; 4 | import java.lang.reflect.Type; 5 | 6 | import okhttp3.ResponseBody; 7 | import retrofit2.Converter; 8 | import retrofit2.Retrofit; 9 | 10 | /** 11 | * Created by Mr.Yangxiufeng 12 | * DATE 2016/9/1 13 | * owspace 14 | */ 15 | public class StringConverterFactory extends Converter.Factory { 16 | 17 | public static StringConverterFactory create(){ 18 | return new StringConverterFactory(); 19 | } 20 | 21 | @Override 22 | public Converter responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { 23 | if (type == String.class) { 24 | return new StringConverter(); 25 | } 26 | //其它类型我们不处理,返回null就行 27 | return null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/db/DbOpenHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2015 Square, Inc. 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.github.baby.owspace.model.db; 17 | 18 | import android.content.Context; 19 | import android.database.sqlite.SQLiteDatabase; 20 | import android.database.sqlite.SQLiteOpenHelper; 21 | 22 | public class DbOpenHelper extends SQLiteOpenHelper { 23 | private static final int VERSION = 1; 24 | 25 | private static final String CREATE_LIST = ""; 26 | private static final String CREATE_ITEM = ""; 27 | private static final String CREATE_ITEM_LIST_ID_INDEX =""; 28 | 29 | public DbOpenHelper(Context context) { 30 | super(context, "owspace.db", null, VERSION); 31 | } 32 | 33 | @Override public void onCreate(SQLiteDatabase db) { 34 | db.execSQL(CREATE_LIST); 35 | db.execSQL(CREATE_ITEM); 36 | db.execSQL(CREATE_ITEM_LIST_ID_INDEX); 37 | } 38 | 39 | @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/entity/Event.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.entity; 2 | 3 | /** 4 | * Created by Mr.Yangxiufeng 5 | * DATE 2016/8/22 6 | * owspace 7 | */ 8 | public class Event { 9 | long id; 10 | String name; 11 | 12 | public Event(long id, String name) { 13 | this.id = id; 14 | this.name = name; 15 | } 16 | 17 | public long getId() { 18 | return id; 19 | } 20 | 21 | public void setId(long id) { 22 | this.id = id; 23 | } 24 | 25 | public String getName() { 26 | return name; 27 | } 28 | 29 | public void setName(String name) { 30 | this.name = name; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/entity/LikeEntity.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.entity; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by Mr.Yangxiufeng 7 | * DATE 2016/8/9 8 | * owspace 9 | */ 10 | public class LikeEntity { 11 | 12 | /** 13 | * status : ok 14 | * datas : [{"uid":"320188","avatar":"http://img.owspace.com//@/avatar/2016-08-09/63ebc0de7eb81c64ac5ddae0346cf2adf3"},{"uid":"3153","avatar":"http://img.owspace.com/Public/uploads/2016/03/3153_1459391408424.jpg"},{"uid":"282014","avatar":"http://img.owspace.com//@/avatar/2016-07-11/7571d8e085644231481e31b65fda613fea"},{"uid":"214817","avatar":"http://img.owspace.com//@/avatar/2016-04-15/51344eaacc21bae049402cc6daf01a7eed"},{"uid":"46352","avatar":"http://img.owspace.com/Public/uploads/2016/08/46352_1470703221233.jpg"},{"uid":"319400","avatar":"http://img.owspace.com//@/avatar/2016-08-08/72ca00f8e357d31426d07047a479a361cd"}] 15 | * msg : 16 | * code : 0 17 | */ 18 | 19 | private String status; 20 | private String msg; 21 | private int code; 22 | /** 23 | * uid : 320188 24 | * avatar : http://img.owspace.com//@/avatar/2016-08-09/63ebc0de7eb81c64ac5ddae0346cf2adf3 25 | */ 26 | 27 | private List datas; 28 | 29 | public String getStatus() { 30 | return status; 31 | } 32 | 33 | public void setStatus(String status) { 34 | this.status = status; 35 | } 36 | 37 | public String getMsg() { 38 | return msg; 39 | } 40 | 41 | public void setMsg(String msg) { 42 | this.msg = msg; 43 | } 44 | 45 | public int getCode() { 46 | return code; 47 | } 48 | 49 | public void setCode(int code) { 50 | this.code = code; 51 | } 52 | 53 | public List getDatas() { 54 | return datas; 55 | } 56 | 57 | public void setDatas(List datas) { 58 | this.datas = datas; 59 | } 60 | 61 | public static class DatasBean { 62 | private String uid; 63 | private String avatar; 64 | 65 | public String getUid() { 66 | return uid; 67 | } 68 | 69 | public void setUid(String uid) { 70 | this.uid = uid; 71 | } 72 | 73 | public String getAvatar() { 74 | return avatar; 75 | } 76 | 77 | public void setAvatar(String avatar) { 78 | this.avatar = avatar; 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/entity/Recommend.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.entity; 2 | 3 | /** 4 | * Created by Mr.Yangxiufeng 5 | * DATE 2016/8/26 6 | * owspace 7 | */ 8 | public class Recommend { 9 | 10 | /** 11 | * id : 292607 12 | * uid : 282018 13 | * thumbnail : http://img.owspace.com/Public/uploads/Picture/2016-08-25/57beba52b6c42.jpg 14 | * status : 1 15 | * share : http://static.owspace.com/wap/292607.html 16 | * html : http://static.owspace.com/wap/292607.html 17 | */ 18 | private String id; 19 | private String uid; 20 | private String thumbnail; 21 | private String status; 22 | private String share; 23 | private String html; 24 | 25 | public String getId() { 26 | return id; 27 | } 28 | 29 | public void setId(String id) { 30 | this.id = id; 31 | } 32 | 33 | public String getUid() { 34 | return uid; 35 | } 36 | 37 | public void setUid(String uid) { 38 | this.uid = uid; 39 | } 40 | 41 | public String getThumbnail() { 42 | return thumbnail; 43 | } 44 | 45 | public void setThumbnail(String thumbnail) { 46 | this.thumbnail = thumbnail; 47 | } 48 | 49 | public String getStatus() { 50 | return status; 51 | } 52 | 53 | public void setStatus(String status) { 54 | this.status = status; 55 | } 56 | 57 | public String getShare() { 58 | return share; 59 | } 60 | 61 | public void setShare(String share) { 62 | this.share = share; 63 | } 64 | 65 | public String getHtml() { 66 | return html; 67 | } 68 | 69 | public void setHtml(String html) { 70 | this.html = html; 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/entity/Result.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.entity; 2 | 3 | /** 4 | * Created by Mr.Yangxiufeng 5 | * DATE 2016/7/21 6 | * owspace 7 | */ 8 | public class Result { 9 | 10 | /** 11 | * status : ok 12 | * datas : {"id":"292296","uid":"2132","name":"","title":"一位演员也是\r\n一个世界","excerpt":"耀眼的光环总让我们以为明星都是空洞的,而姚晨却以某种平民精神,试图理解世界、观察自身。本期\u201c十三邀\u201d,许知远专访姚晨。","lead":"腾讯新闻和单向空间联合出品的谈话节目《十三邀》,是许知远对这个时代所做的新思考。这是第二期。在这一期,姚晨来到位于北京花家地的单向空间,用她自己的话说,这是许知远的\u201c地盘\u201d。长达四个小时的对话,他们都聊了什么?","model":"2","position":"0","thumbnail":"http://img.owspace.com/Public/uploads/Picture/2016-07-13/5785d02bd885f.jpg","create_time":"1468388678","update_time":"2016/07/13","video":"http://img.owspace.com/V_poa248777_1468383459.0986272.mp4","fm":"","link_url":"","view":"7.6w","share":"http://static.owspace.com/wap/292296.html","comment":"89","good":"161","bookmark":"0","fm_play":"","content":"

\u201c我觉得我们都挺容易去概念化地理解一个人。\u201d许知远在采访后回忆。他以对娱乐明星\u201c空洞\u201d的代入感开始,到同姚晨共话黑泽明笔下的\u201c蛤蟆油\u201d;以姚晨穿着的那双小白鞋为初印象,到头脑中反复回旋着曾经小镇姑娘式的生活,可以说,他在头脑中已经重新透视了姚晨所代表的文化符号。这一过程,也许你认为是许知远的偏见,其实,是我们每个人的偏见。
<\/p>

主持人:<\/h2>

许知远,作家,单向空间联合创始人。2000 年毕业于北京大学计算机系。曾任《经济观察报》主笔、《商业周刊/中文版》执行主编。已出版作品《那些忧伤的年轻人》《一个游荡者的世界》《祖国的陌生人》等。<\/p>

<\/p>

第二期嘉宾:<\/h2>

姚晨,中国内地女演员,联合国难民署中国亲善大使。第 2 届华鼎奖电视剧盛典最佳女主角,第 18 届北京大学生电影节最受欢迎女演员,代表作有《武林外传》《潜伏》《离婚律师》等。2013 年、2014 年入围美国《时代》周刊\u201c全球 100 位最具影响力人物\u201d,2014 年当选;2015 年入围该杂志评选的\u201c全球 30 位最具网络影响力人物\u201d;倍耐力年历首位华人封面。2016 年世界经济论坛水晶奖获得者,也是首位获得该奖项的华人女性; 2016 年世界经济论坛\u201c全球青年领袖\u201d中国唯一入选女星。<\/p>

<\/p>

\u201c过去十年,还有一个重要的问题是平民的兴起,平民从来没有获得过这样的一次表达机会,而姚晨身上具有某种平民精神,同时她又理解自己是怎么回事。\u201c许知远在第二期《十三邀》中这样总结。的确,在被科技引领的今天,每一个人都有可能在下一秒被千万人聆听,这是属于普通人的特别时代。<\/p>

许知远说,他是一个不太靠谱的作家,试图捕捉时代的精神,却又常常厌恶时代的流行情绪;他也是一个勉强的创业者,努力获得商业上的成功,却又不完全相信商业的逻辑。这个时代在他眼中,有着过分娱乐化和浅薄的一面,所以,他试图寻找一种方式,打破大家思维中的惯性,同时,他也希望了解这个时代中,新的动力、情绪和人们的内心世界。<\/p>

于是,腾讯新闻联合单向空间,寻找了 13 位在一定意义上来说具有模板作用的个人,向他们发出邀请,希望通过访谈的形式,观察他们的行为,分享他们的经验和心得。从正在发生的样本出发,探求中国发展的切片。<\/p>

<\/p>

<\/p>","template":"","link_id":"0","extend":null,"parseXML":1,"html5":"http://static.owspace.com/wap/292296.html","author":"单读视频","tpl":2,"avatar":"http://img.owspace.com/Public/static/avatar/4.png","category":"TO WATCH","hot_comments":[]} 13 | * msg : 14 | * code : 0 15 | */ 16 | 17 | private String status; 18 | private String msg; 19 | private int code; 20 | 21 | public static class Data extends Result{ 22 | private T datas; 23 | 24 | public T getDatas() { 25 | return datas; 26 | } 27 | 28 | public void setDatas(T datas) { 29 | this.datas = datas; 30 | } 31 | } 32 | 33 | public String getStatus() { 34 | return status; 35 | } 36 | 37 | public void setStatus(String status) { 38 | this.status = status; 39 | } 40 | 41 | public String getMsg() { 42 | return msg; 43 | } 44 | 45 | public void setMsg(String msg) { 46 | this.msg = msg; 47 | } 48 | 49 | public int getCode() { 50 | return code; 51 | } 52 | 53 | public void setCode(int code) { 54 | this.code = code; 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/entity/SplashEntity.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.entity; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by Mr.Yangxiufeng 7 | * DATE 2016/7/21 8 | * owspace 9 | */ 10 | public class SplashEntity { 11 | 12 | /** 13 | * status : ok 14 | * time : 1468154610 15 | * images : ["http://img.owspace.com/Public/uploads/Picture/2016-07-10/578242d91d113.jpg","http://img.owspace.com/Public/uploads/Picture/2016-07-10/578242d62ce5f.jpg","http://img.owspace.com/Public/uploads/Picture/2016-07-10/578242d2e6e61.jpg","http://img.owspace.com/Public/uploads/Picture/2016-07-10/578242d0468b1.jpg","http://img.owspace.com/Public/uploads/Picture/2016-07-10/578242cada2b5.jpg","http://img.owspace.com/Public/uploads/Picture/2016-07-10/578242c7198d2.jpg","http://img.owspace.com/Public/uploads/Picture/2016-07-07/577dbb32d1ca9.jpg","http://img.owspace.com/Public/uploads/Picture/2016-07-05/577b1fcd65e2a.jpg"] 16 | * count : 8 17 | */ 18 | 19 | private String status; 20 | private int time; 21 | private int count; 22 | private List images; 23 | 24 | public String getStatus() { 25 | return status; 26 | } 27 | 28 | public void setStatus(String status) { 29 | this.status = status; 30 | } 31 | 32 | public int getTime() { 33 | return time; 34 | } 35 | 36 | public void setTime(int time) { 37 | this.time = time; 38 | } 39 | 40 | public int getCount() { 41 | return count; 42 | } 43 | 44 | public void setCount(int count) { 45 | this.count = count; 46 | } 47 | 48 | public List getImages() { 49 | return images; 50 | } 51 | 52 | public void setImages(List images) { 53 | this.images = images; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/util/DateTimeTypeAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.util; 2 | 3 | import com.google.gson.JsonDeserializationContext; 4 | import com.google.gson.JsonDeserializer; 5 | import com.google.gson.JsonElement; 6 | import com.google.gson.JsonParseException; 7 | import com.google.gson.JsonPrimitive; 8 | import com.google.gson.JsonSerializationContext; 9 | import com.google.gson.JsonSerializer; 10 | 11 | import org.joda.time.DateTime; 12 | 13 | import java.lang.reflect.Type; 14 | 15 | public class DateTimeTypeAdapter implements JsonSerializer, JsonDeserializer { 16 | 17 | @Override 18 | public JsonElement serialize(DateTime src, Type typeOfSrc, JsonSerializationContext context) { 19 | return new JsonPrimitive(src.toString()); 20 | } 21 | 22 | @Override 23 | public DateTime deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { 24 | return new DateTime(json.getAsString()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/util/EntityUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.util; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.GsonBuilder; 5 | 6 | import org.joda.time.DateTime; 7 | 8 | public final class EntityUtils { 9 | 10 | private EntityUtils() {} 11 | 12 | public static final Gson gson = new GsonBuilder() 13 | .registerTypeAdapter(DateTime.class, new DateTimeTypeAdapter()) 14 | .create(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/model/util/HttpUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.model.util; 2 | 3 | import com.github.baby.owspace.BuildConfig; 4 | 5 | import java.util.concurrent.TimeUnit; 6 | 7 | import okhttp3.OkHttpClient; 8 | import okhttp3.logging.HttpLoggingInterceptor; 9 | 10 | /** 11 | * Created by Mr.Yangxiufeng 12 | * DATE 2016/7/21 13 | * Owspace 14 | */ 15 | public class HttpUtils { 16 | private HttpUtils() {} 17 | public static final OkHttpClient client = new OkHttpClient.Builder() 18 | .connectTimeout(20, TimeUnit.SECONDS) 19 | .readTimeout(20,TimeUnit.SECONDS) 20 | .addInterceptor(createHttpLoggingInterceptor()) 21 | .build(); 22 | 23 | private static HttpLoggingInterceptor createHttpLoggingInterceptor() { 24 | HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor(); 25 | loggingInterceptor.setLevel(BuildConfig.DEBUG ? HttpLoggingInterceptor.Level.BODY : HttpLoggingInterceptor.Level.NONE); 26 | return loggingInterceptor; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/player/IPlayback.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.player; 2 | 3 | import android.support.annotation.Nullable; 4 | 5 | /** 6 | * Created by Mr.Yangxiufeng 7 | * DATE 2016/11/14 8 | * owspace 9 | */ 10 | 11 | public interface IPlayback { 12 | 13 | boolean play(); 14 | 15 | boolean play(String song); 16 | 17 | boolean pause(); 18 | 19 | boolean isPlaying(); 20 | 21 | int getProgress(); 22 | 23 | int getDuration(); 24 | 25 | boolean seekTo(int progress); 26 | 27 | void registerCallback(Callback callback); 28 | 29 | void unregisterCallback(Callback callback); 30 | 31 | void removeCallbacks(); 32 | 33 | void releasePlayer(); 34 | 35 | interface Callback { 36 | 37 | void onComplete(PlayState state); 38 | 39 | void onPlayStatusChanged(PlayState status); 40 | 41 | void onPosition(int position); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/player/MediaPlayController.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.player; 2 | 3 | /** 4 | * Created by Mr.Yangxiufeng 5 | * DATE 2016/11/24 6 | * owspace 7 | */ 8 | 9 | public class MediaPlayController { 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/player/PlayState.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.player; 2 | 3 | /** 4 | * Created by Mr.Yangxiufeng 5 | * DATE 2016/11/24 6 | * owspace 7 | */ 8 | 9 | public enum PlayState { 10 | INIT, 11 | PREPARE, 12 | PLAYING, 13 | PAUSE, 14 | COMPLETE, 15 | ERROR 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/player/Player.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.player; 2 | 3 | import android.media.MediaPlayer; 4 | import android.os.Handler; 5 | import android.os.Message; 6 | 7 | import com.orhanobut.logger.Logger; 8 | 9 | import java.io.IOException; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | import java.util.TimerTask; 13 | 14 | /** 15 | * Created by Mr.Yangxiufeng 16 | * DATE 2016/11/14 17 | * owspace 18 | */ 19 | 20 | public class Player implements IPlayback,MediaPlayer.OnCompletionListener,MediaPlayer.OnBufferingUpdateListener,MediaPlayer.OnPreparedListener,MediaPlayer.OnErrorListener{ 21 | 22 | private static volatile Player sInstance; 23 | private MediaPlayer mPlayer; 24 | private List mCallbacks = new ArrayList<>(2); 25 | private boolean isPaused; 26 | private String song; 27 | 28 | private Player() { 29 | mPlayer = new MediaPlayer(); 30 | mPlayer.setOnCompletionListener(this); 31 | mPlayer.setOnPreparedListener(this); 32 | mPlayer.setOnBufferingUpdateListener(this); 33 | } 34 | 35 | public static Player getInstance() { 36 | if (sInstance == null) { 37 | synchronized (Player.class) { 38 | if (sInstance == null) { 39 | sInstance = new Player(); 40 | } 41 | } 42 | } 43 | return sInstance; 44 | } 45 | @Override 46 | public boolean play() { 47 | if (isPaused){ 48 | mPlayer.start(); 49 | notifyPlayStatusChanged(PlayState.PLAYING); 50 | return true; 51 | } 52 | return false; 53 | } 54 | 55 | @Override 56 | public boolean play(String song) { 57 | try { 58 | mPlayer.reset(); 59 | mPlayer.setDataSource(song); 60 | mPlayer.prepare(); 61 | this.song = song; 62 | notifyPlayStatusChanged(PlayState.PLAYING); 63 | return true; 64 | } catch (IOException e) { 65 | notifyPlayStatusChanged(PlayState.ERROR); 66 | e.printStackTrace(); 67 | } 68 | return false; 69 | } 70 | 71 | @Override 72 | public boolean pause() { 73 | if (mPlayer.isPlaying()) { 74 | mPlayer.pause(); 75 | isPaused = true; 76 | notifyPlayStatusChanged(PlayState.PAUSE); 77 | return true; 78 | } 79 | return false; 80 | } 81 | 82 | @Override 83 | public boolean isPlaying() { 84 | return mPlayer.isPlaying(); 85 | } 86 | 87 | @Override 88 | public int getProgress() { 89 | return mPlayer.getCurrentPosition(); 90 | } 91 | 92 | @Override 93 | public int getDuration() { 94 | return mPlayer.getDuration(); 95 | } 96 | 97 | @Override 98 | public boolean seekTo(int progress) { 99 | try { 100 | mPlayer.seekTo(progress); 101 | } catch (IllegalStateException e) { 102 | e.printStackTrace(); 103 | } 104 | return true; 105 | } 106 | 107 | @Override 108 | public void registerCallback(Callback callback) { 109 | mCallbacks.add(callback); 110 | } 111 | 112 | @Override 113 | public void unregisterCallback(Callback callback) { 114 | mCallbacks.remove(callback); 115 | } 116 | 117 | @Override 118 | public void removeCallbacks() { 119 | mCallbacks.clear(); 120 | } 121 | 122 | @Override 123 | public void releasePlayer() { 124 | mPlayer.reset(); 125 | mPlayer.release(); 126 | mPlayer = null; 127 | sInstance = null; 128 | song = null; 129 | } 130 | 131 | private void notifyPlayStatusChanged(PlayState status) { 132 | for (Callback callback : mCallbacks) { 133 | callback.onPlayStatusChanged(status); 134 | } 135 | } 136 | private void notifyComplete(PlayState state) { 137 | for (Callback callback : mCallbacks) { 138 | callback.onComplete(state); 139 | } 140 | } 141 | 142 | public String getSong() { 143 | return song; 144 | } 145 | 146 | @Override 147 | public void onBufferingUpdate(MediaPlayer mp, int percent) { 148 | // Logger.d("onBufferingUpdate"); 149 | } 150 | 151 | @Override 152 | public void onPrepared(MediaPlayer mp) { 153 | Logger.d("onPrepared"); 154 | mPlayer.start(); 155 | notifyPlayStatusChanged(PlayState.PLAYING); 156 | } 157 | @Override 158 | public void onCompletion(MediaPlayer mp) { 159 | Logger.d("onCompletion"); 160 | mPlayer.reset(); 161 | notifyComplete(PlayState.COMPLETE); 162 | } 163 | 164 | @Override 165 | public boolean onError(MediaPlayer mp, int what, int extra) { 166 | notifyPlayStatusChanged(PlayState.ERROR); 167 | return false; 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/presenter/ArticalContract.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.presenter; 2 | 3 | import com.github.baby.owspace.model.entity.Item; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by Mr.Yangxiufeng 9 | * DATE 2016/8/2 10 | * owspace 11 | */ 12 | public interface ArticalContract { 13 | interface Presenter{ 14 | void getListByPage(int page, int model, String pageId,String deviceId,String createTime); 15 | } 16 | interface View{ 17 | void showLoading(); 18 | void dismissLoading(); 19 | void showNoData(); 20 | void showNoMore(); 21 | void updateListUI(List itemList); 22 | void showOnFailure(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/presenter/ArticalPresenter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.presenter; 2 | 3 | import com.github.baby.owspace.model.api.ApiService; 4 | import com.github.baby.owspace.model.entity.Item; 5 | import com.github.baby.owspace.model.entity.Result; 6 | import com.github.baby.owspace.util.TimeUtil; 7 | 8 | import java.util.List; 9 | 10 | import javax.inject.Inject; 11 | 12 | import rx.Subscriber; 13 | import rx.android.schedulers.AndroidSchedulers; 14 | import rx.schedulers.Schedulers; 15 | 16 | /** 17 | * Created by Mr.Yangxiufeng 18 | * DATE 2016/8/3 19 | * owspace 20 | */ 21 | public class ArticalPresenter implements ArticalContract.Presenter{ 22 | 23 | private ArticalContract.View view; 24 | private ApiService apiService; 25 | @Inject 26 | public ArticalPresenter(ArticalContract.View view,ApiService apiService) { 27 | this.view = view; 28 | this.apiService = apiService; 29 | } 30 | 31 | @Override 32 | public void getListByPage(int page, int model, String pageId, String deviceId, String createTime) { 33 | apiService.getList("api","getList",page,model,pageId,createTime,"android","1.3.0", TimeUtil.getCurrentSeconds(), deviceId,1) 34 | .subscribeOn(Schedulers.io()) 35 | .observeOn(AndroidSchedulers.mainThread()) 36 | .subscribe(new Subscriber>>() { 37 | @Override 38 | public void onCompleted() { 39 | 40 | } 41 | 42 | @Override 43 | public void onError(Throwable e) { 44 | view.showOnFailure(); 45 | } 46 | 47 | @Override 48 | public void onNext(Result.Data> listData) { 49 | int size = listData.getDatas().size(); 50 | if(size>0){ 51 | view.updateListUI(listData.getDatas()); 52 | }else { 53 | view.showNoMore(); 54 | } 55 | } 56 | }); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/presenter/DetailContract.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.presenter; 2 | 3 | import com.github.baby.owspace.model.entity.DetailEntity; 4 | 5 | /** 6 | * Created by Mr.Yangxiufeng 7 | * DATE 2016/8/9 8 | * owspace 9 | */ 10 | public interface DetailContract { 11 | interface Presenter{ 12 | void getDetail(String itemId); 13 | } 14 | interface View{ 15 | void showLoading(); 16 | void dismissLoading(); 17 | void updateListUI(DetailEntity detailEntity); 18 | void showOnFailure(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/presenter/DetailPresenter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.presenter; 2 | 3 | 4 | import com.github.baby.owspace.model.api.ApiService; 5 | import com.github.baby.owspace.model.entity.DetailEntity; 6 | import com.github.baby.owspace.model.entity.Result; 7 | 8 | import javax.inject.Inject; 9 | 10 | import rx.Subscriber; 11 | import rx.android.schedulers.AndroidSchedulers; 12 | import rx.schedulers.Schedulers; 13 | 14 | /** 15 | * Created by Mr.Yangxiufeng 16 | * DATE 2016/8/9 17 | * owspace 18 | */ 19 | public class DetailPresenter implements DetailContract.Presenter { 20 | private DetailContract.View view; 21 | private ApiService apiService; 22 | 23 | @Inject 24 | public DetailPresenter(DetailContract.View view, ApiService apiService) { 25 | this.view = view; 26 | this.apiService = apiService; 27 | } 28 | 29 | @Override 30 | public void getDetail(String itemId) { 31 | apiService.getDetail("api", "getPost", itemId, 1) 32 | .subscribeOn(Schedulers.io()) 33 | .observeOn(AndroidSchedulers.mainThread()) 34 | .subscribe(new Subscriber>() { 35 | @Override 36 | public void onCompleted() { 37 | 38 | } 39 | 40 | @Override 41 | public void onError(Throwable e) { 42 | view.showOnFailure(); 43 | } 44 | 45 | @Override 46 | public void onNext(Result.Data detailEntityData) { 47 | view.updateListUI(detailEntityData.getDatas()); 48 | } 49 | }); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/presenter/MainContract.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.presenter; 2 | 3 | import com.github.baby.owspace.model.entity.Item; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by Mr.Yangxiufeng 9 | * DATE 2016/8/2 10 | * owspace 11 | */ 12 | public interface MainContract { 13 | interface Presenter{ 14 | void getListByPage(int page, int model, String pageId,String deviceId,String createTime); 15 | void getRecommend(String deviceId); 16 | } 17 | interface View{ 18 | void showLoading(); 19 | void dismissLoading(); 20 | void showNoData(); 21 | void showNoMore(); 22 | void updateListUI(List itemList); 23 | void showOnFailure(); 24 | void showLunar(String content); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/presenter/MainPresenter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.presenter; 2 | 3 | import com.github.baby.owspace.model.api.ApiService; 4 | import com.github.baby.owspace.model.entity.Item; 5 | import com.github.baby.owspace.model.entity.Result; 6 | import com.github.baby.owspace.util.TimeUtil; 7 | import com.google.gson.JsonElement; 8 | import com.google.gson.JsonObject; 9 | import com.google.gson.JsonParser; 10 | import com.orhanobut.logger.Logger; 11 | 12 | import java.util.List; 13 | 14 | import javax.inject.Inject; 15 | 16 | import rx.Subscriber; 17 | import rx.android.schedulers.AndroidSchedulers; 18 | import rx.schedulers.Schedulers; 19 | 20 | /** 21 | * Created by Mr.Yangxiufeng 22 | * DATE 2016/8/2 23 | * owspace 24 | */ 25 | public class MainPresenter implements MainContract.Presenter { 26 | private MainContract.View view; 27 | private ApiService apiService; 28 | 29 | @Inject 30 | public MainPresenter(MainContract.View view,ApiService apiService) { 31 | this.view = view; 32 | this.apiService = apiService; 33 | Logger.d("apppp:"+apiService); 34 | } 35 | 36 | @Override 37 | public void getListByPage(int page, int model, String pageId, String deviceId, String createTime) { 38 | apiService.getList("api", "getList", page, model, pageId, createTime, "android", "1.3.0", TimeUtil.getCurrentSeconds(), deviceId, 1) 39 | .subscribeOn(Schedulers.io()) 40 | .observeOn(AndroidSchedulers.mainThread()) 41 | .subscribe(new Subscriber>>() { 42 | @Override 43 | public void onCompleted() { 44 | 45 | } 46 | 47 | @Override 48 | public void onError(Throwable e) { 49 | e.printStackTrace(); 50 | view.showOnFailure(); 51 | } 52 | 53 | @Override 54 | public void onNext(Result.Data> listData) { 55 | int size = listData.getDatas().size(); 56 | if (size > 0) { 57 | view.updateListUI(listData.getDatas()); 58 | } else { 59 | view.showNoMore(); 60 | } 61 | } 62 | }); 63 | } 64 | 65 | @Override 66 | public void getRecommend(String deviceId) { 67 | String key = TimeUtil.getDate("yyyyMMdd"); 68 | Logger.e("getRecommend key:"+key); 69 | apiService.getRecommend("home","Api","getLunar","android",deviceId,deviceId) 70 | .subscribeOn(Schedulers.io()) 71 | .observeOn(AndroidSchedulers.mainThread()) 72 | .subscribe(new Subscriber() { 73 | @Override 74 | public void onCompleted() { 75 | 76 | } 77 | 78 | @Override 79 | public void onError(Throwable e) { 80 | Logger.e("onError:"); 81 | e.printStackTrace(); 82 | } 83 | 84 | @Override 85 | public void onNext(String s) { 86 | String key = TimeUtil.getDate("yyyyMMdd"); 87 | try { 88 | JsonParser jsonParser = new JsonParser(); 89 | JsonElement jel = jsonParser.parse(s); 90 | JsonObject jsonObject = jel.getAsJsonObject(); 91 | jsonObject = jsonObject.getAsJsonObject("datas"); 92 | jsonObject = jsonObject.getAsJsonObject(key); 93 | view.showLunar(jsonObject.get("thumbnail").getAsString()); 94 | }catch (Exception e){ 95 | e.printStackTrace(); 96 | } 97 | } 98 | }); 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/presenter/SplashContract.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.presenter; 2 | 3 | 4 | /** 5 | * Created by Mr.Yangxiufeng 6 | * DATE 2016/7/22 7 | * owspace 8 | */ 9 | public interface SplashContract { 10 | interface Presenter { 11 | void getSplash(String deviceId); 12 | } 13 | interface View { 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/presenter/SplashPresenter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.presenter; 2 | 3 | 4 | import com.github.baby.owspace.app.OwspaceApplication; 5 | import com.github.baby.owspace.model.api.ApiService; 6 | import com.github.baby.owspace.model.entity.SplashEntity; 7 | import com.github.baby.owspace.util.NetUtil; 8 | import com.github.baby.owspace.util.OkHttpImageDownloader; 9 | import com.github.baby.owspace.util.TimeUtil; 10 | import com.orhanobut.logger.Logger; 11 | 12 | import java.util.List; 13 | 14 | import javax.inject.Inject; 15 | 16 | import rx.Subscriber; 17 | import rx.schedulers.Schedulers; 18 | 19 | /** 20 | * Created by Mr.Yangxiufeng 21 | * DATE 2016/7/22 22 | * owspace 23 | */ 24 | public class SplashPresenter implements SplashContract.Presenter{ 25 | private SplashContract.View view; 26 | private ApiService apiService; 27 | @Inject 28 | public SplashPresenter(SplashContract.View view, ApiService apiService) { 29 | this.view = view; 30 | this.apiService = apiService; 31 | Logger.d("apppp:"+apiService); 32 | } 33 | @Override 34 | public void getSplash(String deviceId ) { 35 | String client = "android"; 36 | String version = "1.3.0"; 37 | Long time = TimeUtil.getCurrentSeconds(); 38 | apiService.getSplash(client,version,time,deviceId) 39 | .subscribeOn(Schedulers.io()) 40 | .observeOn(Schedulers.io()) 41 | .subscribe(new Subscriber() { 42 | @Override 43 | public void onCompleted() { 44 | Logger.e("load splash onCompleted"); 45 | } 46 | 47 | @Override 48 | public void onError(Throwable e) { 49 | Logger.e(e,"load splash failed:"); 50 | } 51 | @Override 52 | public void onNext(SplashEntity splashEntity) { 53 | if (NetUtil.isWifi(OwspaceApplication.getInstance().getApplicationContext())){ 54 | if (splashEntity != null){ 55 | List imgs = splashEntity.getImages(); 56 | for (String url:imgs) { 57 | OkHttpImageDownloader.download(url); 58 | } 59 | } 60 | }else{ 61 | Logger.i("不是WIFI环境,就不去下载图片了"); 62 | } 63 | } 64 | }); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/util/AppUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.util; 2 | 3 | import android.content.Context; 4 | import android.content.pm.PackageInfo; 5 | import android.content.pm.PackageManager; 6 | import android.telephony.TelephonyManager; 7 | import android.view.WindowManager; 8 | 9 | /** 10 | * Created by Mr.Yangxiufeng 11 | * DATE 2016/7/21 12 | * owspace 13 | */ 14 | public class AppUtil { 15 | /** 16 | * 获取app版本名 17 | */ 18 | public static String getAppVersionName(Context context){ 19 | PackageManager pm = context.getPackageManager(); 20 | PackageInfo pi; 21 | try { 22 | pi = pm.getPackageInfo(context.getPackageName(),0); 23 | return pi.versionName; 24 | } catch (PackageManager.NameNotFoundException e) { 25 | e.printStackTrace(); 26 | } 27 | return ""; 28 | } 29 | 30 | /** 31 | * 获取应用程序版本名称信息 32 | */ 33 | public static String getVersionName(Context context) 34 | { 35 | try{ 36 | PackageManager packageManager = context.getPackageManager(); 37 | PackageInfo packageInfo = packageManager.getPackageInfo( 38 | context.getPackageName(), 0); 39 | return packageInfo.versionName; 40 | }catch (PackageManager.NameNotFoundException e) { 41 | e.printStackTrace(); 42 | } 43 | return null; 44 | } 45 | 46 | /** 47 | * 获取app版本号 48 | */ 49 | public static int getAppVersionCode(Context context){ 50 | PackageManager pm = context.getPackageManager(); 51 | PackageInfo pi; 52 | try { 53 | pi = pm.getPackageInfo(context.getPackageName(),0); 54 | return pi.versionCode; 55 | } catch (PackageManager.NameNotFoundException e) { 56 | e.printStackTrace(); 57 | } 58 | return 0; 59 | } 60 | public static String getDeviceId(Context context){ 61 | TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); 62 | return tm.getDeviceId(); 63 | } 64 | public static int dp2px(Context paramContext, float paramFloat) 65 | { 66 | float scale = paramContext.getResources().getDisplayMetrics().density; 67 | return (int)(0.5F + paramFloat * scale); 68 | } 69 | public static int getWindowWidth(Context paramContext) 70 | { 71 | return getWindowManager(paramContext).getDefaultDisplay().getWidth(); 72 | } 73 | public static WindowManager getWindowManager(Context paramContext) 74 | { 75 | return (WindowManager)paramContext.getSystemService(Context.WINDOW_SERVICE); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/util/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.util; 2 | 3 | import android.os.Environment; 4 | 5 | import com.orhanobut.logger.Logger; 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | 13 | /** 14 | * Created by Mr.Yangxiufeng 15 | * DATE 2016/7/25 16 | * owspace 17 | */ 18 | public class FileUtil { 19 | public static final String SDPATH = Environment.getExternalStorageDirectory().getAbsolutePath(); 20 | 21 | public static final String ADPATH = FileUtil.SDPATH + "/Owspace"; 22 | 23 | public static void createSdDir() { 24 | File file = new File(FileUtil.ADPATH); 25 | if (!file.exists()) { 26 | boolean create = file.mkdirs(); 27 | Logger.d("create = " + create); 28 | } else { 29 | if (!file.isDirectory()) { 30 | file.delete(); 31 | file.mkdir(); 32 | } 33 | } 34 | } 35 | public static boolean isFileExist(String paramString) { 36 | if (paramString == null) 37 | return false; 38 | File localFile = new File(ADPATH + "/" + paramString); 39 | if (localFile.exists()) { 40 | return true; 41 | } 42 | return false; 43 | } 44 | public static File createFile(String fileName) throws IOException{ 45 | File file = new File(ADPATH,fileName); 46 | file.createNewFile(); 47 | return file; 48 | } 49 | public static List getAllAD(){ 50 | File file = new File(FileUtil.ADPATH); 51 | File[] fileList = file.listFiles(); 52 | List list = new ArrayList<>(); 53 | if(null != fileList){ 54 | for (File f:fileList) { 55 | list.add(f.getAbsolutePath()); 56 | } 57 | } 58 | return list; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/util/NetUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.util; 2 | 3 | import android.app.Activity; 4 | import android.content.ComponentName; 5 | import android.content.Context; 6 | import android.content.Intent; 7 | import android.net.ConnectivityManager; 8 | import android.net.NetworkInfo; 9 | 10 | /** 11 | * Created by Mr.Yangxiufeng 12 | * DATE 2016/7/21 13 | * owspace 14 | */ 15 | public class NetUtil { 16 | /** 17 | * 判断网络是否连接 18 | * 19 | * @param context 20 | * @return 21 | */ 22 | public static boolean isConnected(Context context) 23 | { 24 | 25 | ConnectivityManager connectivity = (ConnectivityManager) context 26 | .getSystemService(Context.CONNECTIVITY_SERVICE); 27 | 28 | if (null != connectivity) 29 | { 30 | 31 | NetworkInfo info = connectivity.getActiveNetworkInfo(); 32 | if (null != info && info.isConnected()) 33 | { 34 | if (info.getState() == NetworkInfo.State.CONNECTED) 35 | { 36 | return true; 37 | } 38 | } 39 | } 40 | return false; 41 | } 42 | 43 | /** 44 | * 判断是否是wifi连接 45 | */ 46 | public static boolean isWifi(Context context) 47 | { 48 | ConnectivityManager cm = (ConnectivityManager) context 49 | .getSystemService(Context.CONNECTIVITY_SERVICE); 50 | 51 | if (cm == null) 52 | return false; 53 | return cm.getActiveNetworkInfo().getType() == ConnectivityManager.TYPE_WIFI; 54 | 55 | } 56 | 57 | /** 58 | * 打开网络设置界面 59 | */ 60 | public static void openSetting(Activity activity) 61 | { 62 | Intent intent = new Intent("/"); 63 | ComponentName cm = new ComponentName("com.android.settings", 64 | "com.android.settings.WirelessSettings"); 65 | intent.setComponent(cm); 66 | intent.setAction("android.intent.action.VIEW"); 67 | activity.startActivityForResult(intent, 0); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/util/OkHttpImageDownloader.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.util; 2 | 3 | import com.github.baby.owspace.model.util.HttpUtils; 4 | import com.orhanobut.logger.Logger; 5 | 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | 10 | import okhttp3.Request; 11 | 12 | /** 13 | * Created by Mr.Yangxiufeng 14 | * DATE 2016/7/25 15 | * owspace 16 | */ 17 | public class OkHttpImageDownloader { 18 | public static void download(String url){ 19 | final Request request = new Request.Builder().url(url).build(); 20 | HttpUtils.client.newCall(request).enqueue(new okhttp3.Callback() { 21 | @Override 22 | public void onFailure(okhttp3.Call call, IOException e) { 23 | Logger.d(e); 24 | } 25 | 26 | @Override 27 | public void onResponse(okhttp3.Call call, okhttp3.Response response) throws IOException { 28 | 29 | FileUtil.createSdDir(); 30 | String url = response.request().url().toString(); 31 | int index = url.lastIndexOf("/"); 32 | String pictureName = url.substring(index+1); 33 | if(FileUtil.isFileExist(pictureName)){ 34 | return; 35 | } 36 | Logger.i("pictureName="+pictureName); 37 | FileOutputStream fos = new FileOutputStream(FileUtil.createFile(pictureName)); 38 | InputStream in = response.body().byteStream(); 39 | byte[] buf = new byte[1024]; 40 | int len = 0; 41 | while ((len = in.read(buf))!=-1){ 42 | fos.write(buf,0,len); 43 | } 44 | fos.flush(); 45 | in.close(); 46 | fos.close(); 47 | } 48 | }); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/util/PreferenceUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.util; 2 | 3 | import android.content.Context; 4 | import android.content.SharedPreferences; 5 | import android.preference.PreferenceManager; 6 | 7 | /** 8 | * Created by Mr.Yangxiufeng 9 | * DATE 2016/8/2 10 | * owspace 11 | */ 12 | public class PreferenceUtils { 13 | public static String getPrefString(Context context, String key, 14 | final String defaultValue) { 15 | final SharedPreferences settings = PreferenceManager 16 | .getDefaultSharedPreferences(context); 17 | return settings.getString(key, defaultValue); 18 | } 19 | 20 | public static void setPrefString(Context context, final String key, 21 | final String value) { 22 | final SharedPreferences settings = PreferenceManager 23 | .getDefaultSharedPreferences(context); 24 | settings.edit().putString(key, value).apply(); 25 | } 26 | 27 | public static boolean getPrefBoolean(Context context, final String key, 28 | final boolean defaultValue) { 29 | final SharedPreferences settings = PreferenceManager 30 | .getDefaultSharedPreferences(context); 31 | return settings.getBoolean(key, defaultValue); 32 | } 33 | 34 | public static boolean hasKey(Context context, final String key) { 35 | return PreferenceManager.getDefaultSharedPreferences(context).contains( 36 | key); 37 | } 38 | 39 | public static void setPrefBoolean(Context context, final String key, 40 | final boolean value) { 41 | final SharedPreferences settings = PreferenceManager 42 | .getDefaultSharedPreferences(context); 43 | settings.edit().putBoolean(key, value).apply(); 44 | } 45 | 46 | public static void setPrefInt(Context context, final String key, 47 | final int value) { 48 | final SharedPreferences settings = PreferenceManager 49 | .getDefaultSharedPreferences(context); 50 | settings.edit().putInt(key, value).apply(); 51 | } 52 | 53 | public static int getPrefInt(Context context, final String key, 54 | final int defaultValue) { 55 | final SharedPreferences settings = PreferenceManager 56 | .getDefaultSharedPreferences(context); 57 | return settings.getInt(key, defaultValue); 58 | } 59 | 60 | public static void setPrefFloat(Context context, final String key, 61 | final float value) { 62 | final SharedPreferences settings = PreferenceManager 63 | .getDefaultSharedPreferences(context); 64 | settings.edit().putFloat(key, value).apply(); 65 | } 66 | 67 | public static float getPrefFloat(Context context, final String key, 68 | final float defaultValue) { 69 | final SharedPreferences settings = PreferenceManager 70 | .getDefaultSharedPreferences(context); 71 | return settings.getFloat(key, defaultValue); 72 | } 73 | 74 | public static void setSettingLong(Context context, final String key, 75 | final long value) { 76 | final SharedPreferences settings = PreferenceManager 77 | .getDefaultSharedPreferences(context); 78 | settings.edit().putLong(key, value).apply(); 79 | } 80 | 81 | public static long getPrefLong(Context context, final String key, 82 | final long defaultValue) { 83 | final SharedPreferences settings = PreferenceManager 84 | .getDefaultSharedPreferences(context); 85 | return settings.getLong(key, defaultValue); 86 | } 87 | 88 | public static void clearPreference(Context context, 89 | final SharedPreferences p) { 90 | final SharedPreferences.Editor editor = p.edit(); 91 | editor.clear(); 92 | editor.apply(); 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/util/TimeUtil.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.util; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.Calendar; 5 | import java.util.Date; 6 | import java.util.Locale; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/7/21 11 | * owspace 12 | */ 13 | public class TimeUtil { 14 | public static long getCurrentSeconds(){ 15 | long ls = System.currentTimeMillis()/1000; 16 | return ls; 17 | } 18 | public static String[] getCalendarShowTime(long paramLong) 19 | { 20 | String[] localObject; 21 | String str = new SimpleDateFormat("yyyy:MMM:d", Locale.ENGLISH).format(new Date(paramLong)); 22 | try 23 | { 24 | String[] arrayOfString = str.split(":"); 25 | localObject = arrayOfString; 26 | if ((localObject != null) && (localObject.length == 3)); 27 | return localObject; 28 | } 29 | catch (Exception localException) 30 | { 31 | while (true) 32 | localException.printStackTrace(); 33 | } 34 | } 35 | 36 | public static String[] getCalendarShowTime(String paramString) 37 | { 38 | try { 39 | long l = Long.valueOf(paramString); 40 | Calendar localCalendar = Calendar.getInstance(); 41 | localCalendar.setTimeInMillis(1000L * l); 42 | return getCalendarShowTime(localCalendar.getTimeInMillis()); 43 | } catch (NumberFormatException e) { 44 | e.printStackTrace(); 45 | } 46 | return null; 47 | } 48 | public static String getDate(String formate){ 49 | String str = new SimpleDateFormat(formate, Locale.ENGLISH).format(new Date()); 50 | return str; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/util/TimeUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.util; 2 | 3 | import android.annotation.SuppressLint; 4 | 5 | /** 6 | * Created by Mr.Yangxiufeng 7 | * DATE 2016/11/24 8 | * owspace 9 | */ 10 | 11 | public class TimeUtils { 12 | /** 13 | * Parse the time in milliseconds into String with the format: hh:mm:ss or mm:ss 14 | * 15 | * @param duration The time needs to be parsed. 16 | */ 17 | @SuppressLint("DefaultLocale") 18 | public static String formatDuration(int duration) { 19 | duration /= 1000; // milliseconds into seconds 20 | int minute = duration / 60; 21 | int hour = minute / 60; 22 | minute %= 60; 23 | int second = duration % 60; 24 | if (hour != 0) 25 | return String.format("%2d:%02d:%02d", hour, minute, second); 26 | else 27 | return String.format("%02d:%02d", minute, second); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/util/tool/RxBus.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.util.tool; 2 | 3 | import rx.Observable; 4 | import rx.subjects.PublishSubject; 5 | import rx.subjects.SerializedSubject; 6 | import rx.subjects.Subject; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/8/22 11 | * owspace 12 | */ 13 | public class RxBus { 14 | private static volatile RxBus instance; 15 | 16 | private final Subject bus; 17 | 18 | private RxBus(){ 19 | bus = new SerializedSubject<>(PublishSubject.create()); 20 | } 21 | 22 | public static RxBus getInstance() { 23 | if (instance == null){ 24 | synchronized (RxBus.class){ 25 | if (instance == null){ 26 | instance = new RxBus(); 27 | } 28 | } 29 | } 30 | return instance; 31 | } 32 | public void postEvent(Object event){ 33 | bus.onNext(event); 34 | } 35 | public Observable toObservable(Class eventype){ 36 | return bus.ofType(eventype); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/activity/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.activity; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v7.app.AppCompatActivity; 7 | 8 | import uk.co.chrisjenx.calligraphy.CalligraphyContextWrapper; 9 | 10 | /** 11 | * Created by Mr.Yangxiufeng 12 | * DATE 2016/10/27 13 | * owspace 14 | */ 15 | 16 | public abstract class BaseActivity extends AppCompatActivity{ 17 | 18 | @Override 19 | protected void onCreate(@Nullable Bundle savedInstanceState) { 20 | super.onCreate(savedInstanceState); 21 | } 22 | @Override 23 | protected void attachBaseContext(Context newBase) { 24 | super.attachBaseContext(CalligraphyContextWrapper.wrap(newBase)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/activity/DailyActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.view.ViewPager; 6 | import android.support.v7.app.ActionBar; 7 | import android.support.v7.widget.Toolbar; 8 | import android.view.View; 9 | import android.widget.TextView; 10 | import android.widget.Toast; 11 | 12 | import com.github.baby.owspace.R; 13 | import com.github.baby.owspace.app.OwspaceApplication; 14 | import com.github.baby.owspace.di.components.DaggerDailyComponent; 15 | import com.github.baby.owspace.di.modules.DailyModule; 16 | import com.github.baby.owspace.model.entity.Item; 17 | import com.github.baby.owspace.presenter.ArticalContract; 18 | import com.github.baby.owspace.presenter.ArticalPresenter; 19 | import com.github.baby.owspace.util.AppUtil; 20 | import com.github.baby.owspace.view.adapter.DailyViewPagerAdapter; 21 | import com.github.baby.owspace.view.widget.VerticalViewPager; 22 | import com.orhanobut.logger.Logger; 23 | 24 | import java.util.List; 25 | 26 | import javax.inject.Inject; 27 | 28 | import butterknife.BindView; 29 | import butterknife.ButterKnife; 30 | 31 | /** 32 | * Created by Mr.Yangxiufeng 33 | * DATE 2016/8/3 34 | * owspace 35 | */ 36 | public class DailyActivity extends BaseActivity implements ArticalContract.View{ 37 | @BindView(R.id.title) 38 | TextView title; 39 | @BindView(R.id.toolBar) 40 | Toolbar toolBar; 41 | @BindView(R.id.view_pager) 42 | VerticalViewPager viewPager; 43 | @Inject 44 | ArticalPresenter presenter; 45 | private int page=1; 46 | private static final int MODE = 4; 47 | private boolean isLoading=true; 48 | private String deviceId; 49 | private DailyViewPagerAdapter pagerAdapter; 50 | 51 | @Override 52 | protected void onCreate(@Nullable Bundle savedInstanceState) { 53 | super.onCreate(savedInstanceState); 54 | setContentView(R.layout.activity_daily); 55 | ButterKnife.bind(this); 56 | initPresenter(); 57 | initView(); 58 | deviceId = AppUtil.getDeviceId(this); 59 | presenter.getListByPage(page,MODE,"0", deviceId,"0"); 60 | } 61 | private void initPresenter(){ 62 | DaggerDailyComponent.builder() 63 | .dailyModule(new DailyModule(this)) 64 | .netComponent(OwspaceApplication.get(this).getNetComponent()) 65 | .build() 66 | .inject(this); 67 | } 68 | private void initView() { 69 | setSupportActionBar(toolBar); 70 | ActionBar actionBar = getSupportActionBar(); 71 | actionBar.setTitle(""); 72 | actionBar.setDisplayHomeAsUpEnabled(true); 73 | toolBar.setNavigationOnClickListener(new View.OnClickListener() { 74 | @Override 75 | public void onClick(View view) { 76 | onBackPressed(); 77 | } 78 | }); 79 | pagerAdapter = new DailyViewPagerAdapter(getSupportFragmentManager(),this); 80 | viewPager.setAdapter(pagerAdapter); 81 | viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { 82 | @Override 83 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { 84 | 85 | } 86 | 87 | @Override 88 | public void onPageSelected(int position) { 89 | if (pagerAdapter.getCount() <= position +2 && !isLoading){ 90 | Logger.e("page="+page+",getLastItemId="+pagerAdapter.getLastItemId()); 91 | presenter.getListByPage(page, 0, pagerAdapter.getLastItemId(),deviceId,pagerAdapter.getLastItemCreateTime()); 92 | } 93 | } 94 | 95 | @Override 96 | public void onPageScrollStateChanged(int state) { 97 | 98 | } 99 | }); 100 | } 101 | 102 | @Override 103 | public void showLoading() { 104 | 105 | } 106 | 107 | @Override 108 | public void dismissLoading() { 109 | 110 | } 111 | 112 | @Override 113 | public void showNoData() { 114 | 115 | } 116 | 117 | @Override 118 | public void showNoMore() { 119 | Toast.makeText(this,"没有更多数据了",Toast.LENGTH_SHORT).show(); 120 | } 121 | 122 | @Override 123 | public void updateListUI(List itemList) { 124 | isLoading = false; 125 | pagerAdapter.setArtList(itemList); 126 | page++; 127 | } 128 | 129 | @Override 130 | public void showOnFailure() { 131 | if (pagerAdapter.getCount()==0){ 132 | showNoData(); 133 | }else{ 134 | Toast.makeText(this,"加载数据失败,请检查您的网络",Toast.LENGTH_SHORT).show(); 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/activity/SettingsActivity.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.activity; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.ActionBar; 6 | import android.support.v7.widget.Toolbar; 7 | import android.view.View; 8 | import android.widget.RelativeLayout; 9 | import android.widget.Switch; 10 | import android.widget.TextView; 11 | 12 | import com.bumptech.glide.Glide; 13 | import com.github.baby.owspace.BuildConfig; 14 | import com.github.baby.owspace.R; 15 | 16 | import java.io.File; 17 | import java.text.DecimalFormat; 18 | 19 | import butterknife.BindView; 20 | import butterknife.ButterKnife; 21 | import butterknife.OnClick; 22 | 23 | /** 24 | * Created by Mr.Yangxiufeng 25 | * DATE 2016/8/15 26 | * owspace 27 | */ 28 | public class SettingsActivity extends BaseActivity { 29 | @BindView(R.id.toolBar) 30 | Toolbar toolBar; 31 | @BindView(R.id.push_toggle) 32 | Switch pushToggle; 33 | @BindView(R.id.cacheSize) 34 | TextView cacheSize; 35 | @BindView(R.id.cacheLayout) 36 | RelativeLayout cacheLayout; 37 | @BindView(R.id.about) 38 | RelativeLayout about; 39 | @BindView(R.id.feedback) 40 | RelativeLayout feedback; 41 | @BindView(R.id.version_tv) 42 | TextView versionTv; 43 | @BindView(R.id.checkUpgrade) 44 | RelativeLayout checkUpgrade; 45 | 46 | @Override 47 | protected void onCreate(@Nullable Bundle savedInstanceState) { 48 | super.onCreate(savedInstanceState); 49 | setContentView(R.layout.activity_settings); 50 | ButterKnife.bind(this); 51 | setSupportActionBar(toolBar); 52 | ActionBar actionBar = getSupportActionBar(); 53 | actionBar.setDisplayHomeAsUpEnabled(true); 54 | actionBar.setTitle(""); 55 | toolBar.setNavigationOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View view) { 58 | onBackPressed(); 59 | } 60 | }); 61 | versionTv.setText(BuildConfig.VERSION_NAME); 62 | File file = Glide.getPhotoCacheDir(this); 63 | DecimalFormat fnum = new DecimalFormat("##0.00"); 64 | String dd = fnum.format(getDirSize(file)); 65 | cacheSize.setText(dd + "M"); 66 | } 67 | 68 | private float getDirSize(File file) { 69 | if (file.exists()) { 70 | if (file.isDirectory()) { 71 | File[] children = file.listFiles(); 72 | float size = 0; 73 | for (File f : children) { 74 | size += getDirSize(f); 75 | } 76 | return size; 77 | } else { 78 | float size = (float) file.length() / 1024 / 1024; 79 | return size; 80 | } 81 | } else { 82 | return 0.0f; 83 | } 84 | } 85 | 86 | @OnClick(R.id.cacheLayout) 87 | public void onClick() { 88 | new Thread(new Runnable() { 89 | @Override 90 | public void run() { 91 | Glide.get(getApplication()).clearDiskCache(); 92 | } 93 | }).start(); 94 | cacheSize.setText("0.00M"); 95 | } 96 | 97 | @OnClick({R.id.push_toggle, R.id.about, R.id.feedback, R.id.checkUpgrade}) 98 | public void onClick(View view) { 99 | switch (view.getId()) { 100 | case R.id.push_toggle: 101 | break; 102 | case R.id.about: 103 | break; 104 | case R.id.feedback: 105 | break; 106 | case R.id.checkUpgrade: 107 | break; 108 | } 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/adapter/DailyViewPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v4.app.Fragment; 5 | import android.support.v4.app.FragmentManager; 6 | import android.support.v4.app.FragmentStatePagerAdapter; 7 | 8 | import com.github.baby.owspace.model.entity.Item; 9 | import com.github.baby.owspace.view.fragment.DailyItemFragment; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | /** 15 | * Created by Mr.Yangxiufeng 16 | * DATE 2016/8/4 17 | * owspace 18 | */ 19 | public class DailyViewPagerAdapter extends FragmentStatePagerAdapter{ 20 | private List artList = new ArrayList<>(); 21 | private Context context; 22 | 23 | public DailyViewPagerAdapter(FragmentManager fm, Context context) { 24 | super(fm); 25 | this.context = context; 26 | } 27 | 28 | @Override 29 | public Fragment getItem(int position) { 30 | return DailyItemFragment.getInstance(artList.get(position)); 31 | } 32 | 33 | @Override 34 | public int getCount() { 35 | return artList.size(); 36 | } 37 | public void setArtList(List artList) { 38 | int position = artList.size() - 1; 39 | this.artList.addAll(artList); 40 | notifyDataSetChanged(); 41 | } 42 | public void replaceAllData(List artList){ 43 | this.artList.clear(); 44 | this.artList.addAll(artList); 45 | notifyDataSetChanged(); 46 | } 47 | public String getLastItemId(){ 48 | if (artList.size()==0){ 49 | return "0"; 50 | } 51 | Item item = artList.get(artList.size()-1); 52 | return item.getId(); 53 | } 54 | public String getLastItemCreateTime(){ 55 | if (artList.size()==0){ 56 | return "0"; 57 | } 58 | Item item = artList.get(artList.size()-1); 59 | return item.getCreate_time(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/adapter/VerticalPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentStatePagerAdapter; 6 | 7 | import com.github.baby.owspace.model.entity.Item; 8 | import com.github.baby.owspace.view.fragment.MainFragment; 9 | import com.orhanobut.logger.Logger; 10 | 11 | import java.util.ArrayList; 12 | import java.util.List; 13 | 14 | /** 15 | * Created by Mr.Yangxiufeng 16 | * DATE 2016/8/2 17 | * owspace 18 | */ 19 | public class VerticalPagerAdapter extends FragmentStatePagerAdapter{ 20 | private List dataList=new ArrayList<>(); 21 | public VerticalPagerAdapter(FragmentManager fm) { 22 | super(fm); 23 | } 24 | 25 | @Override 26 | public Fragment getItem(int position) { 27 | return MainFragment.instance(dataList.get(position)); 28 | } 29 | 30 | @Override 31 | public int getCount() { 32 | return dataList.size(); 33 | } 34 | public void setDataList(List data){ 35 | dataList.addAll(data); 36 | notifyDataSetChanged(); 37 | } 38 | public String getLastItemId(){ 39 | if (dataList.size()==0){ 40 | return "0"; 41 | } 42 | Item item = dataList.get(dataList.size()-1); 43 | return item.getId(); 44 | } 45 | public String getLastItemCreateTime(){ 46 | if (dataList.size()==0){ 47 | return "0"; 48 | } 49 | Item item = dataList.get(dataList.size()-1); 50 | return item.getCreate_time(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/fragment/DailyItemFragment.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.RelativeLayout; 11 | import android.widget.TextView; 12 | 13 | import com.bumptech.glide.Glide; 14 | import com.github.baby.owspace.R; 15 | import com.github.baby.owspace.app.GlideApp; 16 | import com.github.baby.owspace.model.entity.Item; 17 | import com.github.baby.owspace.util.TimeUtil; 18 | 19 | import butterknife.BindView; 20 | import butterknife.ButterKnife; 21 | 22 | /** 23 | * Created by Mr.Yangxiufeng 24 | * DATE 2016/8/4 25 | * owspace 26 | */ 27 | public class DailyItemFragment extends Fragment { 28 | @BindView(R.id.month_tv) 29 | TextView monthTv; 30 | @BindView(R.id.year_tv) 31 | TextView yearTv; 32 | @BindView(R.id.date_rl) 33 | RelativeLayout dateRl; 34 | @BindView(R.id.calendar_iv) 35 | ImageView calendarIv; 36 | 37 | public static Fragment getInstance(Item item){ 38 | Fragment fragment = new DailyItemFragment(); 39 | Bundle bundle = new Bundle(); 40 | bundle.putParcelable("item",item); 41 | fragment.setArguments(bundle); 42 | return fragment; 43 | } 44 | 45 | @Nullable 46 | @Override 47 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 48 | View view = inflater.inflate(R.layout.item_daily, container, false); 49 | ButterKnife.bind(this, view); 50 | return view; 51 | } 52 | 53 | @Override 54 | public void onResume() { 55 | super.onResume(); 56 | Item item = getArguments().getParcelable("item"); 57 | GlideApp.with(getActivity()).load(item.getThumbnail()).centerCrop().into(calendarIv); 58 | String[] arrayOfString = TimeUtil.getCalendarShowTime(item.getUpdate_time()); 59 | if ((arrayOfString != null) && (arrayOfString.length == 3)) 60 | { 61 | monthTv.setText(arrayOfString[1] + " , " + arrayOfString[2]); 62 | yearTv.setText(arrayOfString[0]); 63 | } 64 | } 65 | 66 | @Override 67 | public void onDestroyView() { 68 | super.onDestroyView(); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/fragment/RightMenuFragment.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.fragment; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.annotation.Nullable; 6 | import android.support.v4.app.Fragment; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.view.animation.BounceInterpolator; 11 | import android.view.animation.ScaleAnimation; 12 | import android.view.animation.TranslateAnimation; 13 | import android.widget.ImageView; 14 | import android.widget.RelativeLayout; 15 | import android.widget.TextView; 16 | 17 | import com.github.baby.owspace.R; 18 | import com.github.baby.owspace.model.entity.Event; 19 | import com.github.baby.owspace.util.tool.RxBus; 20 | import com.github.baby.owspace.view.activity.SettingsActivity; 21 | 22 | import java.util.ArrayList; 23 | import java.util.List; 24 | 25 | import butterknife.BindView; 26 | import butterknife.ButterKnife; 27 | import butterknife.OnClick; 28 | 29 | /** 30 | * Created by Mr.Yangxiufeng 31 | * DATE 2016/7/22 32 | * owspace 33 | */ 34 | public class RightMenuFragment extends Fragment { 35 | @BindView(R.id.right_slide_close) 36 | ImageView rightSlideClose; 37 | @BindView(R.id.setting) 38 | ImageView setting; 39 | @BindView(R.id.avater_iv) 40 | ImageView avaterIv; 41 | @BindView(R.id.name_tv) 42 | TextView nameTv; 43 | @BindView(R.id.notification_tv) 44 | TextView notificationTv; 45 | @BindView(R.id.favorites_tv) 46 | TextView favoritesTv; 47 | @BindView(R.id.download_tv) 48 | TextView downloadTv; 49 | @BindView(R.id.note_tv) 50 | TextView noteTv; 51 | @BindView(R.id.title_bar) 52 | RelativeLayout titleBar; 53 | 54 | private List mViewList = new ArrayList(); 55 | 56 | @Nullable 57 | @Override 58 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 59 | View view = inflater.inflate(R.layout.fragment_right_menu, container, false); 60 | ButterKnife.bind(this, view); 61 | loadView(); 62 | return view; 63 | } 64 | private void loadView() { 65 | mViewList.add(notificationTv); 66 | mViewList.add(favoritesTv); 67 | mViewList.add(downloadTv); 68 | mViewList.add(noteTv); 69 | } 70 | @Override 71 | public void onDestroyView() { 72 | super.onDestroyView(); 73 | } 74 | 75 | @OnClick({R.id.right_slide_close, R.id.setting, R.id.notification_tv, R.id.favorites_tv, R.id.download_tv, R.id.note_tv}) 76 | public void onClick(View view) { 77 | switch (view.getId()) { 78 | case R.id.right_slide_close: 79 | RxBus.getInstance().postEvent(new Event(1000,"closeMenu")); 80 | break; 81 | case R.id.setting: 82 | Intent intent = new Intent(); 83 | intent.setClass(getActivity(), SettingsActivity.class); 84 | startActivity(intent); 85 | break; 86 | case R.id.notification_tv: 87 | break; 88 | case R.id.favorites_tv: 89 | break; 90 | case R.id.download_tv: 91 | break; 92 | case R.id.note_tv: 93 | break; 94 | } 95 | } 96 | public void startAnim() { 97 | startIconAnim(rightSlideClose); 98 | startIconAnim(setting); 99 | startColumnAnim(); 100 | } 101 | 102 | private void startColumnAnim() { 103 | TranslateAnimation localTranslateAnimation = new TranslateAnimation(0F, 0.0F, 0.0F, 0.0F); 104 | localTranslateAnimation.setDuration(700L); 105 | for (int j=0;j mOnScrollChangedListeners; 18 | private OnScrollViewScrollListener mOnScrollListener; 19 | 20 | public CustomScrollView(Context paramContext) 21 | { 22 | this(paramContext, null); 23 | } 24 | 25 | public CustomScrollView(Context paramContext, AttributeSet paramAttributeSet) 26 | { 27 | this(paramContext, paramAttributeSet, 0); 28 | } 29 | 30 | public CustomScrollView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) 31 | { 32 | super(paramContext, paramAttributeSet, paramInt); 33 | initListener(); 34 | } 35 | 36 | private void initListener() 37 | { 38 | this.mOnScrollChangedListeners = new ArrayList(); 39 | } 40 | 41 | public void addOnScrollChangedListener(OnScrollChangedListener paramOnScrollChangedListener) 42 | { 43 | this.mOnScrollChangedListeners.add(paramOnScrollChangedListener); 44 | } 45 | 46 | protected void onScrollChanged(int paramInt1, int paramInt2, int paramInt3, int paramInt4) 47 | { 48 | 49 | } 50 | 51 | public boolean onTouchEvent(MotionEvent paramMotionEvent) 52 | { 53 | if (this.mAllowScroll) 54 | return super.onTouchEvent(paramMotionEvent); 55 | return true; 56 | } 57 | 58 | public void removeOnScrollChangedListener(OnScrollChangedListener paramOnScrollChangedListener) 59 | { 60 | this.mOnScrollChangedListeners.remove(paramOnScrollChangedListener); 61 | } 62 | 63 | public void setAllowScroll(boolean paramBoolean) 64 | { 65 | this.mAllowScroll = paramBoolean; 66 | } 67 | 68 | public void setOnScrollViewScrollListener(OnScrollViewScrollListener paramOnScrollViewScrollListener) 69 | { 70 | this.mOnScrollListener = paramOnScrollViewScrollListener; 71 | } 72 | 73 | public static abstract interface OnScrollChangedListener 74 | { 75 | public abstract void onScrollChanged(CustomScrollView paramCustomScrollView, int paramInt1, int paramInt2, int paramInt3, int paramInt4); 76 | } 77 | 78 | public static abstract interface OnScrollViewScrollListener 79 | { 80 | public abstract void onScroll(int paramInt); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/widget/DividerItemDecoration.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.widget; 2 | 3 | import android.content.Context; 4 | import android.content.res.TypedArray; 5 | import android.graphics.Canvas; 6 | import android.graphics.drawable.Drawable; 7 | import android.support.v4.content.ContextCompat; 8 | import android.support.v7.widget.RecyclerView; 9 | import android.view.View; 10 | 11 | /** 12 | * Created by Mr.Yangxiufeng 13 | * DATE 2016/8/3 14 | * owspace 15 | */ 16 | public class DividerItemDecoration extends RecyclerView.ItemDecoration { 17 | private static final int[] ATTRS = new int[]{ 18 | android.R.attr.listDivider 19 | }; 20 | 21 | private Drawable mDivider; 22 | 23 | /** 24 | * Default divider will be used 25 | */ 26 | public DividerItemDecoration(Context context) { 27 | final TypedArray styledAttributes = context.obtainStyledAttributes(ATTRS); 28 | mDivider = styledAttributes.getDrawable(0); 29 | styledAttributes.recycle(); 30 | } 31 | 32 | /** 33 | * Custom divider will be used 34 | */ 35 | public DividerItemDecoration(Context context, int resId) { 36 | mDivider = ContextCompat.getDrawable(context, resId); 37 | } 38 | 39 | @Override 40 | public void onDraw(Canvas c, RecyclerView parent, RecyclerView.State state) { 41 | int left = parent.getPaddingLeft(); 42 | int right = parent.getWidth() - parent.getPaddingRight(); 43 | 44 | int childCount = parent.getChildCount(); 45 | for (int i = 0; i < childCount; i++) { 46 | View child = parent.getChildAt(i); 47 | 48 | RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams(); 49 | 50 | int top = child.getBottom() + params.bottomMargin; 51 | int bottom = top + mDivider.getIntrinsicHeight(); 52 | 53 | mDivider.setBounds(left, top, right, bottom); 54 | mDivider.draw(c); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/widget/FixedImageView.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.widget; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.util.AttributeSet; 6 | import android.util.DisplayMetrics; 7 | import android.view.View; 8 | import android.widget.ImageView; 9 | 10 | /** 11 | * Created by Mr.Yangxiufeng 12 | * DATE 2016/7/22 13 | * owspace 14 | */ 15 | public class FixedImageView extends ImageView { 16 | private int mScreenHeight; 17 | 18 | public FixedImageView(Context paramContext) 19 | { 20 | this(paramContext, null); 21 | } 22 | 23 | public FixedImageView(Context paramContext, AttributeSet paramAttributeSet) 24 | { 25 | this(paramContext, paramAttributeSet, 0); 26 | } 27 | 28 | public FixedImageView(Context paramContext, AttributeSet paramAttributeSet, int paramInt) 29 | { 30 | super(paramContext, paramAttributeSet, paramInt); 31 | init(paramContext, paramAttributeSet); 32 | } 33 | 34 | public static int[] getScreenWidthHeight(Context paramContext) 35 | { 36 | int[] arrayOfInt = new int[2]; 37 | if (paramContext == null) 38 | return arrayOfInt; 39 | DisplayMetrics localDisplayMetrics = new DisplayMetrics(); 40 | ((Activity)paramContext).getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics); 41 | int i = localDisplayMetrics.widthPixels; 42 | int j = localDisplayMetrics.heightPixels; 43 | arrayOfInt[0] = i; 44 | arrayOfInt[1] = j; 45 | return arrayOfInt; 46 | } 47 | 48 | private void init(Context paramContext, AttributeSet paramAttributeSet) 49 | { 50 | this.mScreenHeight = getScreenWidthHeight(paramContext)[1]; 51 | } 52 | 53 | protected void onMeasure(int paramInt1, int paramInt2) 54 | { 55 | int i = View.MeasureSpec.getSize(paramInt1); 56 | View.MeasureSpec.getSize(paramInt1); 57 | setMeasuredDimension(i, this.mScreenHeight); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/widget/LunarDialog.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.widget; 2 | 3 | import android.app.Dialog; 4 | import android.content.Context; 5 | import android.view.View; 6 | import com.github.baby.owspace.R; 7 | 8 | /** 9 | * Created by Mr.Yangxiufeng 10 | * DATE 2016/9/1 11 | * owspace 12 | */ 13 | public class LunarDialog extends Dialog{ 14 | private Context context; 15 | public LunarDialog(Context context) { 16 | super(context,R.style.LunarDialg); 17 | setCanceledOnTouchOutside(true); 18 | this.context = context; 19 | } 20 | 21 | @Override 22 | public void setContentView(View view) { 23 | super.setContentView(view); 24 | } 25 | 26 | @Override 27 | public void setContentView(int layoutResID) { 28 | super.setContentView(layoutResID); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/widget/SelectTextView.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.widget; 2 | 3 | import android.content.Context; 4 | import android.text.Selection; 5 | import android.text.Spannable; 6 | import android.util.AttributeSet; 7 | import android.view.MotionEvent; 8 | import android.widget.TextView; 9 | 10 | /** 11 | * Created by Mr.Yangxiufeng 12 | * DATE 2016/8/16 13 | * owspace 14 | */ 15 | public class SelectTextView extends TextView{ 16 | public SelectTextView(Context context) { 17 | super(context); 18 | } 19 | 20 | public SelectTextView(Context context, AttributeSet attrs) { 21 | super(context, attrs); 22 | } 23 | 24 | public SelectTextView(Context context, AttributeSet attrs, int defStyleAttr) { 25 | super(context, attrs, defStyleAttr); 26 | } 27 | @Override 28 | public boolean dispatchTouchEvent(final MotionEvent event) { 29 | // FIXME simple workaround to https://code.google.com/p/android/issues/detail?id=191430 30 | int startSelection = getSelectionStart(); 31 | int endSelection = getSelectionEnd(); 32 | if (startSelection < 0 || endSelection < 0){ 33 | Selection.setSelection((Spannable) getText(), getText().length()); 34 | } else if (startSelection != endSelection) { 35 | if (event.getActionMasked() == MotionEvent.ACTION_DOWN) { 36 | final CharSequence text = getText(); 37 | setText(null); 38 | setText(text); 39 | } 40 | } 41 | return super.dispatchTouchEvent(event); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/widget/recycleView/RecyclerViewPagerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.widget.recycleView; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | import android.view.ViewGroup; 6 | /** 7 | * Created by Mr.Yangxiufeng 8 | * DATE 2016/9/1 9 | * owspace 10 | */ 11 | public class RecyclerViewPagerAdapter extends RecyclerView.Adapter { 12 | private final RecyclerViewPager mViewPager; 13 | RecyclerView.Adapter mAdapter; 14 | 15 | 16 | public RecyclerViewPagerAdapter(RecyclerViewPager viewPager, RecyclerView.Adapter adapter) { 17 | mAdapter = adapter; 18 | mViewPager = viewPager; 19 | setHasStableIds(mAdapter.hasStableIds()); 20 | } 21 | 22 | @Override 23 | public VH onCreateViewHolder(ViewGroup parent, int viewType) { 24 | return mAdapter.onCreateViewHolder(parent, viewType); 25 | } 26 | 27 | @Override 28 | public void registerAdapterDataObserver(RecyclerView.AdapterDataObserver observer) { 29 | super.registerAdapterDataObserver(observer); 30 | mAdapter.registerAdapterDataObserver(observer); 31 | } 32 | 33 | @Override 34 | public void unregisterAdapterDataObserver(RecyclerView.AdapterDataObserver observer) { 35 | super.unregisterAdapterDataObserver(observer); 36 | mAdapter.unregisterAdapterDataObserver(observer); 37 | } 38 | 39 | @Override 40 | public void onViewRecycled(VH holder) { 41 | super.onViewRecycled(holder); 42 | mAdapter.onViewRecycled(holder); 43 | } 44 | 45 | @Override 46 | public boolean onFailedToRecycleView(VH holder) { 47 | return mAdapter.onFailedToRecycleView(holder); 48 | } 49 | 50 | @Override 51 | public void onViewAttachedToWindow(VH holder) { 52 | super.onViewAttachedToWindow(holder); 53 | mAdapter.onViewAttachedToWindow(holder); 54 | } 55 | 56 | @Override 57 | public void onViewDetachedFromWindow(VH holder) { 58 | super.onViewDetachedFromWindow(holder); 59 | mAdapter.onViewDetachedFromWindow(holder); 60 | } 61 | 62 | @Override 63 | public void onAttachedToRecyclerView(RecyclerView recyclerView) { 64 | super.onAttachedToRecyclerView(recyclerView); 65 | mAdapter.onAttachedToRecyclerView(recyclerView); 66 | } 67 | 68 | @Override 69 | public void onDetachedFromRecyclerView(RecyclerView recyclerView) { 70 | super.onDetachedFromRecyclerView(recyclerView); 71 | mAdapter.onDetachedFromRecyclerView(recyclerView); 72 | } 73 | 74 | @Override 75 | public void onBindViewHolder(VH holder, int position) { 76 | mAdapter.onBindViewHolder(holder, position); 77 | final View itemView = holder.itemView; 78 | ViewGroup.LayoutParams lp; 79 | if (itemView.getLayoutParams() == null) { 80 | lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); 81 | } else { 82 | lp = itemView.getLayoutParams(); 83 | if (mViewPager.getLayoutManager().canScrollHorizontally()) { 84 | lp.width = ViewGroup.LayoutParams.MATCH_PARENT; 85 | } else { 86 | lp.height = ViewGroup.LayoutParams.MATCH_PARENT; 87 | } 88 | } 89 | itemView.setLayoutParams(lp); 90 | } 91 | 92 | @Override 93 | public void setHasStableIds(boolean hasStableIds) { 94 | super.setHasStableIds(hasStableIds); 95 | mAdapter.setHasStableIds(hasStableIds); 96 | } 97 | 98 | @Override 99 | public int getItemCount() { 100 | return mAdapter.getItemCount(); 101 | } 102 | 103 | @Override 104 | public int getItemViewType(int position) { 105 | return mAdapter.getItemViewType(position); 106 | } 107 | 108 | @Override 109 | public long getItemId(int position) { 110 | return mAdapter.getItemId(position); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /app/src/main/java/com/github/baby/owspace/view/widget/recycleView/ViewUtils.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace.view.widget.recycleView; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.View; 5 | /** 6 | * Created by Mr.Yangxiufeng 7 | * DATE 2016/9/1 8 | * owspace 9 | */ 10 | public class ViewUtils { 11 | /** 12 | * Get center child in X Axes 13 | */ 14 | public static View getCenterXChild(RecyclerView recyclerView) { 15 | int childCount = recyclerView.getChildCount(); 16 | if (childCount > 0) { 17 | for (int i = 0; i < childCount; i++) { 18 | View child = recyclerView.getChildAt(i); 19 | if (isChildInCenterX(recyclerView, child)) { 20 | return child; 21 | } 22 | } 23 | } 24 | return null; 25 | } 26 | 27 | /** 28 | * Get position of center child in X Axes 29 | */ 30 | public static int getCenterXChildPosition(RecyclerView recyclerView) { 31 | int childCount = recyclerView.getChildCount(); 32 | if (childCount > 0) { 33 | for (int i = 0; i < childCount; i++) { 34 | View child = recyclerView.getChildAt(i); 35 | if (isChildInCenterX(recyclerView, child)) { 36 | return recyclerView.getChildAdapterPosition(child); 37 | } 38 | } 39 | } 40 | return childCount; 41 | } 42 | 43 | /** 44 | * Get center child in Y Axes 45 | */ 46 | public static View getCenterYChild(RecyclerView recyclerView) { 47 | int childCount = recyclerView.getChildCount(); 48 | if (childCount > 0) { 49 | for (int i = 0; i < childCount; i++) { 50 | View child = recyclerView.getChildAt(i); 51 | if (isChildInCenterY(recyclerView, child)) { 52 | return child; 53 | } 54 | } 55 | } 56 | return null; 57 | } 58 | 59 | /** 60 | * Get position of center child in Y Axes 61 | */ 62 | public static int getCenterYChildPosition(RecyclerView recyclerView) { 63 | int childCount = recyclerView.getChildCount(); 64 | if (childCount > 0) { 65 | for (int i = 0; i < childCount; i++) { 66 | View child = recyclerView.getChildAt(i); 67 | if (isChildInCenterY(recyclerView, child)) { 68 | return recyclerView.getChildAdapterPosition(child); 69 | } 70 | } 71 | } 72 | return childCount; 73 | } 74 | 75 | public static boolean isChildInCenterX(RecyclerView recyclerView, View view) { 76 | int childCount = recyclerView.getChildCount(); 77 | int[] lvLocationOnScreen = new int[2]; 78 | int[] vLocationOnScreen = new int[2]; 79 | recyclerView.getLocationOnScreen(lvLocationOnScreen); 80 | int middleX = lvLocationOnScreen[0] + recyclerView.getWidth() / 2; 81 | if (childCount > 0) { 82 | view.getLocationOnScreen(vLocationOnScreen); 83 | if (vLocationOnScreen[0] <= middleX && vLocationOnScreen[0] + view.getWidth() >= middleX) { 84 | return true; 85 | } 86 | } 87 | return false; 88 | } 89 | 90 | public static boolean isChildInCenterY(RecyclerView recyclerView, View view) { 91 | int childCount = recyclerView.getChildCount(); 92 | int[] lvLocationOnScreen = new int[2]; 93 | int[] vLocationOnScreen = new int[2]; 94 | recyclerView.getLocationOnScreen(lvLocationOnScreen); 95 | int middleY = lvLocationOnScreen[1] + recyclerView.getHeight() / 2; 96 | if (childCount > 0) { 97 | view.getLocationOnScreen(vLocationOnScreen); 98 | if (vLocationOnScreen[1] <= middleY && vLocationOnScreen[1] + view.getHeight() >= middleY) { 99 | return true; 100 | } 101 | } 102 | return false; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/app_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/app_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/arrow_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/arrow_left.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/arrow_right_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/arrow_right_grey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/arrow_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/arrow_top.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/avater_arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/avater_arrow_down.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/avater_arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/avater_arrow_up.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/avater_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/avater_default.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/column.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/column.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/comment.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/comment_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/comment_like.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/comment_like_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/comment_like_big.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/comment_like_p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/comment_like_p.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/cursor_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/cursor_end.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/cursor_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/cursor_start.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/delete_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/delete_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/dialog_shadow_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/dialog_shadow_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/dot_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/dot_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/dot_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/dot_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/download_cb_checked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/download_cb_checked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/download_cb_unchecked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/download_cb_unchecked.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/download_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/download_pause.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/download_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/download_start.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/download_start_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/download_start_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/favorite_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/favorite_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/favorite_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/favorite_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/fork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/fork.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/gou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/gou.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/ic_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/ic_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/icon_sogo_welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/icon_sogo_welcome.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/icon_tecent_welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/icon_tecent_welcome.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/icon_xiaomi_welcome.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/icon_xiaomi_welcome.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_login_del_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_login_del_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_login_del_normal_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_login_del_normal_night.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_login_del_press.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_login_del_press.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_login_eye_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_login_eye_open.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_login_eye_open_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_login_eye_open_night.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_login_sina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_login_sina.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_login_weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_login_weixin.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_video_mediacontroller_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_video_mediacontroller_pause.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_video_mediacontroller_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_video_mediacontroller_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_video_mediacontroller_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_video_mediacontroller_share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_video_mediacontroller_to_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_video_mediacontroller_to_full.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_video_mediacontroller_to_half.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_video_mediacontroller_to_half.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_video_play_symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_video_play_symbol.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_video_seekbar_thumb_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_video_seekbar_thumb_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_voice_ground_glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_voice_ground_glass.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_voice_mediacontroller_decelerate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_voice_mediacontroller_decelerate.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_voice_mediacontroller_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_voice_mediacontroller_pause.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_voice_mediacontroller_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_voice_mediacontroller_play.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_voice_mediacontroller_speed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_voice_mediacontroller_speed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/library_voice_play_symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/library_voice_play_symbol.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/loading_news.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/loading_news.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/logo_owspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/logo_owspace.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/more.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/more.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/news_share_copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/news_share_copy.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/news_share_email.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/news_share_email.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/news_share_evernote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/news_share_evernote.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/news_share_sinaweibo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/news_share_sinaweibo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/news_share_wechat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/news_share_wechat.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/news_share_wechatmoments.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/news_share_wechatmoments.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/paper_comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/paper_comment.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/paper_comment_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/paper_comment_night.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/paper_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/paper_like.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/paper_like_big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/paper_like_big.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/paper_like_big_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/paper_like_big_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/paper_like_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/paper_like_night.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/paper_like_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/paper_like_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/person.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/person.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/pull_down_note_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/pull_down_note_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/pull_up_note_edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/pull_up_note_edit.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/pulltorefresh_default_ptr_rotate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/pulltorefresh_default_ptr_rotate.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/refresh_drop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/refresh_drop.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/refresh_loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/refresh_loading.gif -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/right_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/right_arrow.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/search_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/search_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/search_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/search_white.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/send_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/send_s.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/setting.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/umeng_fb_feedback_edit_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/umeng_fb_feedback_edit_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/umeng_fb_feedback_send_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/umeng_fb_feedback_send_button.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/version.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/video_play_symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/video_play_symbol.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/voice_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/voice_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/voice_play_symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/voice_play_symbol.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/welcome_default2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/welcome_default2.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/welcome_weread.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/welcome_weread.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/weread_horizontal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/weread_horizontal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/weread_signature.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/weread_signature.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/white_shadow_bg.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/white_shadow_bg.9.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-480dpi/write.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-480dpi/write.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/iconfont_downgrey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/drawable-hdpi/iconfont_downgrey.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/common_divider_xlarge_horizontal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_pause.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 16 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_play.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 17 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_play_last.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 17 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_play_next.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 17 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_remote_view_close.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_remote_view_pause.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 17 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_remote_view_play.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 17 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_remote_view_play_last.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 17 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_remote_view_play_next.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 11 | 14 | 17 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_remote_views_action_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shadow.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_daily.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 13 | 14 | 19 | 20 | 28 | 29 | 30 | 31 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_list_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 21 | 22 | 30 | 31 | 32 | 33 | 44 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 19 | 20 | 28 | 29 | 38 | 39 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 15 | 16 | 17 | 25 | 26 | 34 | 35 | 45 | 46 | 54 | 55 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_lunar.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_left_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 10 | 18 | 25 | 26 | 27 | 36 | 37 | 43 | 44 | 49 | 50 | 56 | 57 | 63 | 64 | 65 | 74 | 75 | 79 | 80 | 85 | 86 | 91 | 92 | 97 | 98 | 103 | 104 | 105 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_right_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 19 | 26 | 27 | 28 | 36 | 37 | 42 | 43 | 50 | 51 | 52 | 61 | 62 | 71 | 72 | 81 | 82 | 91 | 92 | 107 | 108 | 118 | 119 | 127 | 128 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_art.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 23 | 39 | 40 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_daily.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | 21 | 22 | 31 | 32 | 39 | 40 | 41 | 49 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_image_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/layout/left_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/recycleview_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 17 | 18 | 28 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/refresh_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/remote_view_music_player_small.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 23 | 24 | 25 | 33 | 34 | 44 | 45 | 54 | 55 | 56 | 63 | 64 | 71 | 72 | 80 | 81 | 82 | 89 | 90 | 98 | 99 | 100 | 107 | 108 | 116 | 117 | 125 | 126 | 133 | 134 | 135 | -------------------------------------------------------------------------------- /app/src/main/res/layout/right_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ff313131 4 | #ff030303 5 | #FF4081 6 | #00000000 7 | 8 | #ff313131 9 | #ff030303 10 | #ff9b9b9b 11 | #fff8f7f5 12 | #ff000000 13 | #ff000000 14 | #ffc0c0c0 15 | 16 | #ff990000 17 | #ff009900 18 | #ff000099 19 | #ffffffff 20 | #ff000000 21 | #ff212324 22 | 23 | #ffc6c5c4 24 | #ff727272 25 | #ffd4d4d4 26 | #ffffffff 27 | 28 | #ff000000 29 | #ff000000 30 | #ffc3c3c3 31 | #ff000000 32 | #ffebe1c4 33 | #ff000000 34 | #ffad8a5a 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 45.0dip 7 | 8 | 230dp 9 | 10 | 42.0dp 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 单读 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 12 | 18 | 22 | 31 | 38 | 44 | 45 | -------------------------------------------------------------------------------- /app/src/test/java/com/github/baby/owspace/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.github.baby.owspace; 2 | 3 | import org.junit.Test; 4 | 5 | import java.util.Calendar; 6 | 7 | import static org.junit.Assert.*; 8 | 9 | /** 10 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | @Test 18 | public void addition1() throws Exception { 19 | Calendar calendar = Calendar.getInstance(); 20 | String time = String.format("%d%02d%02d%d%d", calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DAY_OF_MONTH),calendar.get(Calendar.HOUR_OF_DAY),calendar.get(Calendar.MINUTE)); 21 | System.out.println(time); 22 | System.out.println(calendar.get(Calendar.HOUR_OF_DAY)); 23 | System.out.println(calendar.get(Calendar.MINUTE)); 24 | System.out.println(calendar.get(Calendar.MILLISECOND)); 25 | 26 | } 27 | } -------------------------------------------------------------------------------- /art/show.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show.gif -------------------------------------------------------------------------------- /art/show1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show1.png -------------------------------------------------------------------------------- /art/show2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show2.png -------------------------------------------------------------------------------- /art/show3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show3.png -------------------------------------------------------------------------------- /art/show4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show4.png -------------------------------------------------------------------------------- /art/show5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show5.png -------------------------------------------------------------------------------- /art/show6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show6.png -------------------------------------------------------------------------------- /art/show7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show7.png -------------------------------------------------------------------------------- /art/show8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yangxiufeng666/owspace/899d63e83fd842ff45055466c19f0e1620b3536f/art/show8.png -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | maven { 7 | url 'https://maven.google.com/' 8 | name 'Google' 9 | } 10 | google() 11 | mavenCentral() 12 | } 13 | dependencies { 14 | classpath 'com.android.tools.build:gradle:3.1.0' 15 | classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1' 16 | // classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | jcenter() 25 | maven { 26 | url 'https://maven.google.com/' 27 | name 'Google' 28 | } 29 | } 30 | } 31 | 32 | task clean(type: Delete) { 33 | delete rootProject.buildDir 34 | } 35 | -------------------------------------------------------------------------------- /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 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------