├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── ic_launcher-web.png
│ │ ├── res
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── bar_icon.png
│ │ │ │ ├── screen.png
│ │ │ │ ├── bar_icon_2.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── default_avatar.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── bg_video_title_shadow.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── values
│ │ │ │ ├── ids.xml
│ │ │ │ ├── ic_launcher_background.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── styles.xml
│ │ │ │ └── attrs.xml
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ └── ic_launcher_foreground.png
│ │ │ ├── xml
│ │ │ │ ├── network_security_config.xml
│ │ │ │ ├── main_scene.xml
│ │ │ │ └── main_appbar_child_scene.xml
│ │ │ ├── anim
│ │ │ │ ├── decelerate_anim_1_5.xml
│ │ │ │ ├── fade_anim.xml
│ │ │ │ ├── bottomtop_enter.xml
│ │ │ │ └── bottomtop_exit.xml
│ │ │ ├── values-v19
│ │ │ │ └── styles.xml
│ │ │ ├── drawable
│ │ │ │ ├── bg_video_title_shadow.xml
│ │ │ │ ├── ripple_click.xml
│ │ │ │ ├── ic_add_16dp.xml
│ │ │ │ ├── ic_file_download_black_32dp.xml
│ │ │ │ ├── ic_arrow_down_black_24dp.xml
│ │ │ │ ├── rotate_drawable_arrow_black.xml
│ │ │ │ ├── ic_close_16dp.xml
│ │ │ │ ├── ic_subtitles_12dp.xml
│ │ │ │ ├── ic_error_outline.xml
│ │ │ │ ├── ic_add_to_black_24dp.xml
│ │ │ │ ├── ic_favorite_12dp.xml
│ │ │ │ ├── ic_favorite_black_16dp.xml
│ │ │ │ ├── ic_favorite_black_24dp.xml
│ │ │ │ ├── ic_favorite_black_32dp.xml
│ │ │ │ ├── ic_favorite_white_24dp.xml
│ │ │ │ ├── ic_eye_12dp.xml
│ │ │ │ ├── ic_share_black_32dp.xml
│ │ │ │ └── ic_comment_12dp.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── ripple_click_pople.xml
│ │ │ │ ├── ic_fullscreen_black_24dp.xml
│ │ │ │ └── ic_fullscreen_exit_black_24dp.xml
│ │ │ ├── values-v21
│ │ │ │ └── styles.xml
│ │ │ ├── animator
│ │ │ │ └── card_button_floating_anim.xml
│ │ │ ├── layout
│ │ │ │ ├── fragment_gallery.xml
│ │ │ │ ├── activity_launch.xml
│ │ │ │ ├── view_video_corr.xml
│ │ │ │ ├── view_switchbutton.xml
│ │ │ │ ├── toast.xml
│ │ │ │ ├── view_comment.xml
│ │ │ │ ├── view_video_recomm.xml
│ │ │ │ ├── view_gallery_bar.xml
│ │ │ │ ├── view_refresh_group.xml
│ │ │ │ ├── view_loadmore.xml
│ │ │ │ └── activity_main.xml
│ │ │ ├── values-en
│ │ │ │ └── strings.xml
│ │ │ └── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── zhkrb
│ │ │ │ └── iwara
│ │ │ │ ├── netowrk
│ │ │ │ ├── NetworkCallback.java
│ │ │ │ ├── retrofit
│ │ │ │ │ ├── manager
│ │ │ │ │ │ ├── IRequestManager.java
│ │ │ │ │ │ └── RequestManager.java
│ │ │ │ │ ├── model
│ │ │ │ │ │ ├── GetModel.java
│ │ │ │ │ │ └── PostModel.java
│ │ │ │ │ ├── JsonBean.java
│ │ │ │ │ ├── bean
│ │ │ │ │ │ ├── GetBean.java
│ │ │ │ │ │ └── PostBean.java
│ │ │ │ │ ├── SchedulerProvider.java
│ │ │ │ │ ├── HttpUtil.java
│ │ │ │ │ └── RetrofitCallback.java
│ │ │ │ ├── jsoup
│ │ │ │ │ ├── JsoupClient.java
│ │ │ │ │ └── JsoupCallback.java
│ │ │ │ └── ExceptionUtil.java
│ │ │ │ ├── utils
│ │ │ │ ├── SystemUtil.java
│ │ │ │ ├── HttpConstsUtil.java
│ │ │ │ ├── DpUtil.java
│ │ │ │ ├── L.java
│ │ │ │ ├── RegexUtil.java
│ │ │ │ ├── ToastUtil.java
│ │ │ │ ├── VibrateUtil.java
│ │ │ │ ├── WordUtil.java
│ │ │ │ ├── ContextLocalWrapper.java
│ │ │ │ ├── TimeUtil.java
│ │ │ │ └── VideoNetWorkUtil.java
│ │ │ │ ├── fragment
│ │ │ │ ├── SingleTopFragment.java
│ │ │ │ ├── SingleTaskFragment.java
│ │ │ │ └── StandFragment.java
│ │ │ │ ├── base
│ │ │ │ ├── TransitionHelper.java
│ │ │ │ └── FragmentFrame.java
│ │ │ │ ├── adapter
│ │ │ │ └── CommentAdapter.java
│ │ │ │ ├── bean
│ │ │ │ └── UpdateInfoBean.java
│ │ │ │ ├── custom
│ │ │ │ ├── AnimLinearLayoutManager.java
│ │ │ │ └── RateImageView.java
│ │ │ │ ├── dialog
│ │ │ │ └── AbsDialogFragment.java
│ │ │ │ └── activity
│ │ │ │ └── LaunchActivity.java
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── zhkrb
│ │ │ └── iwara
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── zhkrb
│ │ └── iwara
│ │ └── ExampleInstrumentedTest.java
└── proguard-rules.pro
├── dragvideo
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── refs.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ ├── attrs.xml
│ │ │ │ ├── style.xml
│ │ │ │ └── dimens.xml
│ │ │ ├── anim
│ │ │ │ ├── explode_enter.xml
│ │ │ │ ├── anim_show.xml
│ │ │ │ ├── anim_hide.xml
│ │ │ │ ├── anim_scale_hide.xml
│ │ │ │ ├── anim_scale_show.xml
│ │ │ │ ├── bottom_to_top_exit.xml
│ │ │ │ ├── bottom_to_top_enter.xml
│ │ │ │ ├── top_to_bottom_enter.xml
│ │ │ │ ├── top_to_bottom_exit.xml
│ │ │ │ ├── seekbar_thumb_pressed_to_unpressed_thumb_animation.xml
│ │ │ │ └── seekbar_thumb_unpressed_to_pressed_thumb_0_animation.xml
│ │ │ ├── transition
│ │ │ │ └── explode.xml
│ │ │ ├── drawable
│ │ │ │ ├── ripple_click.xml
│ │ │ │ ├── ripple_click_pople.xml
│ │ │ │ ├── ic_play_arrow_24dp.xml
│ │ │ │ ├── ic_pause_24dp.xml
│ │ │ │ ├── ic_arrow_down_24dp.xml
│ │ │ │ ├── ic_check_white_24dp.xml
│ │ │ │ ├── ic_close_24dp.xml
│ │ │ │ ├── seekbar_thumb_pressed_to_unpressed_animation.xml
│ │ │ │ ├── seekbar_thumb_unpressed_to_pressed_animation.xml
│ │ │ │ ├── ic_replay_24dp.xml
│ │ │ │ ├── ic_fullscreen_black_24dp.xml
│ │ │ │ ├── ic_fullscreen_exit_black_24dp.xml
│ │ │ │ ├── ic_error_outline_24dp.xml
│ │ │ │ ├── ic_more_vert_24dp.xml
│ │ │ │ ├── ic_share_24dp.xml
│ │ │ │ ├── ic_slow_motion_video_white_24dp.xml
│ │ │ │ ├── ic_settings_white_24dp.xml
│ │ │ │ ├── scale_progress_drawable.xml
│ │ │ │ ├── seekbar_thumb_unpressed_to_pressed.xml
│ │ │ │ ├── seekbar_thumb_pressed_to_unpressed.xml
│ │ │ │ ├── seekbar_thumb_unpressed_to_unenable.xml
│ │ │ │ └── seekbar_thumb.xml
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── ic_fullscreen_black_24dp.xml
│ │ │ │ └── ic_fullscreen_exit_black_24dp.xml
│ │ │ ├── layout
│ │ │ │ ├── view_content_loading.xml
│ │ │ │ ├── view_fail.xml
│ │ │ │ ├── dialog_setting_list.xml
│ │ │ │ ├── toast.xml
│ │ │ │ ├── view_content_loadfail.xml
│ │ │ │ ├── view_video_progress_dialog.xml
│ │ │ │ ├── view_video_play.xml
│ │ │ │ └── item_setting.xml
│ │ │ └── layout-v23
│ │ │ │ ├── view_content_loadfail.xml
│ │ │ │ └── item_setting.xml
│ │ ├── AndroidManifest.xml
│ │ └── java
│ │ │ └── com
│ │ │ └── zhkrb
│ │ │ └── dragvideo
│ │ │ ├── contentViewBase
│ │ │ ├── ReloadListener.java
│ │ │ ├── ContentTransHelper.java
│ │ │ └── ContentFrame.java
│ │ │ ├── videoPlayer
│ │ │ ├── gsyvideoplayer
│ │ │ │ └── GSYVideoExManager.java
│ │ │ ├── PlayerStateListener.java
│ │ │ └── IVideoPlayer.java
│ │ │ ├── mainView
│ │ │ └── ScaleViewListener.java
│ │ │ ├── widget
│ │ │ ├── ImgLoader.java
│ │ │ ├── advRecyclerView.java
│ │ │ └── AbsDialogFragment.java
│ │ │ ├── bean
│ │ │ ├── UrlBean.java
│ │ │ ├── ValueSelectBean.java
│ │ │ └── SettingBean.java
│ │ │ ├── utils
│ │ │ ├── ToastUtil.java
│ │ │ └── DnsUtil.java
│ │ │ └── NetworkUtil.java
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── zhkrb
│ │ │ └── dragvideo
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── zhkrb
│ │ └── dragvideo
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── art
├── Screenshot_3.png
├── screenshot_1.png
└── screenshot_2_1.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── encodings.xml
├── dictionaries
│ └── fiyba.xml
├── vcs.xml
├── misc.xml
├── runConfigurations.xml
└── gradle.xml
├── .gitignore
├── Change_log.md
├── gradle.properties
├── .travis.yml
├── README.md
└── gradlew.bat
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/dragvideo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':dragvideo'
2 |
--------------------------------------------------------------------------------
/art/Screenshot_3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/art/Screenshot_3.png
--------------------------------------------------------------------------------
/art/screenshot_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/art/screenshot_1.png
--------------------------------------------------------------------------------
/art/screenshot_2_1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/art/screenshot_2_1.png
--------------------------------------------------------------------------------
/dragvideo/src/main/res/values/refs.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/bar_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxhdpi/bar_icon.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/screen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxhdpi/screen.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/bar_icon_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxhdpi/bar_icon_2.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/default_avatar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxhdpi/default_avatar.png
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/explode_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/bg_video_title_shadow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxhdpi/bg_video_title_shadow.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhkrb/Iwara-android-client/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #E20074
4 |
--------------------------------------------------------------------------------
/.idea/dictionaries/fiyba.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | zhkrb
5 |
6 |
7 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/transition/explode.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/decelerate_anim_1_5.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/anim_show.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .idea
15 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Aug 21 22:48:17 CST 2019
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
--------------------------------------------------------------------------------
/app/src/main/res/drawable/bg_video_title_shadow.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/NetworkCallback.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk;
2 |
3 | public interface NetworkCallback {
4 |
5 | void onStart();
6 |
7 | void onSuccess(int code,String msg,String info);
8 |
9 | void onFinish();
10 |
11 | void onError(int code,String msg);
12 |
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ripple_click.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ripple_click.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ripple_click_pople.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/anim_hide.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ripple_click_pople.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | -
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/bottomtop_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/bottomtop_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/anim_scale_hide.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/anim_scale_show.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_play_arrow_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add_16dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_pause_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_file_download_black_32dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/bottom_to_top_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_arrow_down_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/bottom_to_top_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/top_to_bottom_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/top_to_bottom_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_arrow_down_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/manager/IRequestManager.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit.manager;
2 |
3 |
4 | import io.reactivex.disposables.Disposable;
5 |
6 | public interface IRequestManager {
7 |
8 | void add(T tag, Disposable subscription);
9 |
10 | void remove(T tag);
11 |
12 | void cancel(T tag);
13 |
14 | void cancelAll();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_check_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/rotate_drawable_arrow_black.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_close_16dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_close_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/seekbar_thumb_pressed_to_unpressed_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/seekbar_thumb_unpressed_to_pressed_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_replay_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_fullscreen_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_fullscreen_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_fullscreen_exit_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/ic_fullscreen_exit_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable-xxhdpi/ic_fullscreen_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable-xxhdpi/ic_fullscreen_exit_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_subtitles_12dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/test/java/com/zhkrb/iwara/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_error_outline.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_add_to_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_favorite_12dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_favorite_black_16dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_favorite_black_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_favorite_black_32dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_favorite_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_error_outline_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/test/java/com/zhkrb/dragvideo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.dragvideo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_more_vert_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_eye_12dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/model/GetModel.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit.model;
2 |
3 | import java.util.Map;
4 |
5 | import io.reactivex.Observable;
6 | import okhttp3.ResponseBody;
7 | import retrofit2.http.GET;
8 | import retrofit2.http.HeaderMap;
9 | import retrofit2.http.Url;
10 |
11 | public interface GetModel {
12 |
13 | @GET
14 | Observable get(@Url String url);
15 |
16 | @GET
17 | Observable get(@HeaderMap Map headers, @Url String url);
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/SystemUtil.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.utils;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 |
7 |
8 |
9 | import io.reactivex.annotations.NonNull;
10 |
11 |
12 | public class SystemUtil {
13 |
14 | public static void openUrl(@NonNull Activity activity, String url){
15 | Uri uri = Uri.parse(url);
16 | Intent intent = new Intent();
17 | intent.setAction(Intent.ACTION_VIEW);
18 | intent.setData(uri);
19 | activity.startActivity(intent);
20 | }
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/Change_log.md:
--------------------------------------------------------------------------------
1 | ### 2021.3.4
2 | #### 版本号: 0.0.4
3 |
4 | 内容:
5 | 1. 修复播放失败问题
6 | 2. 添加视频播放详情展示
7 |
8 |
9 | ### 2019.9.18
10 | #### 版本号: 0.0.3
11 |
12 | 内容:
13 | 1. 更改视频重新加载逻辑,现在当播放错误时会重新请求接口以防止服务器返回403错误
14 | 2. 添加竖屏视频支持,现在当播放竖屏视频时会以裁剪形式播放。
15 | 底部详情栏可以向上滑动,同时播放器会缩小直到最小高度。
16 | 只有当点击全屏时才会完整的显示视频。
17 | 3. 添加播放器请求头,UA和Referer。
18 | UA为固定的chrome UA,Referer则为Appconfig中选择的HOST
19 | 4. 修复了一些bug,具体是啥我忘了=、=
20 | 5. 添加自动版本号
21 |
22 | ------
23 | ### 2019.9.12
24 | #### 版本号: 0.0.2
25 |
26 | 内容:
27 | 1. 添加更新检查
28 | 2. Theme更改为Material.Light
29 |
30 | ------
31 | ### 2019.9.9
32 | #### 版本号: 0.0.1
33 |
34 | 内容:
35 | 第一次Commit,完成播放器和视频列表
--------------------------------------------------------------------------------
/dragvideo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/model/PostModel.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit.model;
2 |
3 | import java.util.Map;
4 |
5 | import io.reactivex.Observable;
6 | import okhttp3.RequestBody;
7 | import okhttp3.ResponseBody;
8 | import retrofit2.http.Body;
9 | import retrofit2.http.HeaderMap;
10 | import retrofit2.http.POST;
11 | import retrofit2.http.Url;
12 |
13 | public interface PostModel {
14 |
15 | @POST
16 | Observable post(@Url String url, @Body RequestBody body);
17 |
18 | @POST
19 | Observable post(@HeaderMap Map header, @Url String url, @Body RequestBody body);
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/JsonBean.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit;
2 |
3 | public class JsonBean {
4 |
5 | private int ret;
6 | private String msg;
7 | private String data;
8 |
9 | public int getRet() {
10 | return ret;
11 | }
12 |
13 | public void setRet(int ret) {
14 | this.ret = ret;
15 | }
16 |
17 | public String getMsg() {
18 | return msg;
19 | }
20 |
21 | public void setMsg(String msg) {
22 | this.msg = msg;
23 | }
24 |
25 | public String getData() {
26 | return data;
27 | }
28 |
29 | public void setData(String data) {
30 | this.data = data;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_share_black_32dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_share_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/seekbar_thumb_pressed_to_unpressed_thumb_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/anim/seekbar_thumb_unpressed_to_pressed_thumb_0_animation.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
11 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_comment_12dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/fragment/SingleTopFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/4 10:51
17 | */
18 |
19 | package com.zhkrb.iwara.fragment;
20 |
21 | public class SingleTopFragment {
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/fragment/SingleTaskFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/4 10:52
17 | */
18 |
19 | package com.zhkrb.iwara.fragment;
20 |
21 | public class SingleTaskFragment {
22 | }
23 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx1536m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | android.useAndroidX=true
15 | android.enableJetifier=true
16 |
17 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/dragvideo/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/zhkrb/iwara/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.zhkrb.iwara", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout/view_content_loading.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
--------------------------------------------------------------------------------
/dragvideo/src/androidTest/java/com/zhkrb/dragvideo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.dragvideo;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.test.InstrumentationRegistry;
6 | import androidx.test.runner.AndroidJUnit4;
7 |
8 | import org.junit.Test;
9 | import org.junit.runner.RunWith;
10 |
11 | import static org.junit.Assert.*;
12 |
13 | /**
14 | * Instrumented test, which will execute on an Android device.
15 | *
16 | * @see Testing documentation
17 | */
18 | @RunWith(AndroidJUnit4.class)
19 | public class ExampleInstrumentedTest {
20 | @Test
21 | public void useAppContext() {
22 | // Context of the app under test.
23 | Context appContext = InstrumentationRegistry.getTargetContext();
24 |
25 | assertEquals("com.zhkrb.dragvideo2.test", appContext.getPackageName());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/contentViewBase/ReloadListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/22 20:12
17 | */
18 |
19 | package com.zhkrb.dragvideo.contentViewBase;
20 |
21 | public interface ReloadListener {
22 |
23 | void needReload();
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/res/animator/card_button_floating_anim.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
9 |
10 | -
11 |
17 |
18 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_slow_motion_video_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/videoPlayer/gsyvideoplayer/GSYVideoExManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/31 10:03
17 | */
18 |
19 | package com.zhkrb.dragvideo.videoPlayer.gsyvideoplayer;
20 |
21 | import com.shuyu.gsyvideoplayer.GSYVideoManager;
22 |
23 | public class GSYVideoExManager{
24 |
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/ic_settings_white_24dp.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_gallery.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout/view_fail.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
15 |
16 |
26 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | com.zhkrb.dragvideo.ScaleVideoBehavior
3 | 分享
4 | 播放失败,错误码: %d
5 | 您当前正在使用移动网络,继续播放将消耗流量
6 | 停止播放
7 | 继续播放
8 | ·
9 | 画质
10 | 播放速度
11 | 正常
12 | %1$f 倍
13 | %1$s 倍
14 | 获取视频链接失败
15 | 获取视频链接失败\n或者当前版本不支持Youtube外链播放
16 | 00:00
17 | 加载失败
18 | 重新加载
19 | 获取DNS信息错误
20 |
21 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/contentViewBase/ContentTransHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/2 21:42
17 | */
18 |
19 | package com.zhkrb.dragvideo.contentViewBase;
20 |
21 | import android.content.Context;
22 | import android.view.View;
23 |
24 | public interface ContentTransHelper {
25 |
26 | boolean onTransition(Context context,boolean isEnter, View firstView,View secView);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout/dialog_setting_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 |
26 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 |
3 | language: android
4 | jdk: oraclejdk8
5 |
6 | env:
7 | global:
8 | - ANDROID_API=28
9 | - ANDROID_BUILD_TOOLS=30.0.1
10 | - EMAIL=fiybad1@gmail.com
11 |
12 | notifications:
13 | email:
14 | recipients:
15 | - ${EMAIL}
16 | on_success: change
17 | on_failure: always
18 |
19 | before_cache:
20 | - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
21 | - rm -rf $HOME/.gradle/caches/*/plugin-resolution/
22 |
23 |
24 | before_install:
25 | - chmod +x gradlew
26 | - echo yes | sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}"
27 | - echo yes | sdkmanager "platforms;android-${ANDROID_API}"
28 |
29 | cache:
30 | directories:
31 | - $HOME/.gradle/caches/
32 | - $HOME/.gradle/wrapper/
33 | - $HOME/.android/build-cache
34 |
35 | android:
36 | components:
37 | - platform-tools
38 | - build-tools-${ANDROID_BUILD_TOOLS}
39 | - tools
40 | - android-${ANDROID_API}
41 | - extra-android-m2repository
42 | - extra-android-support
43 |
44 | script:
45 | - ./gradlew clean test build
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/jsoup/JsoupClient.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.jsoup;
2 |
3 | import com.zhkrb.iwara.netowrk.retrofit.HttpUtil;
4 |
5 | import io.reactivex.Observable;
6 | import io.reactivex.Observer;
7 | import okhttp3.ResponseBody;
8 |
9 | public class JsoupClient {
10 |
11 | private static String mUrl;
12 | private static JsoupClient mUtil;
13 |
14 | private JsoupClient(){
15 | }
16 |
17 | static JsoupClient getInstance(){
18 | if (mUtil==null){
19 | synchronized (JsoupClient.class){
20 | if (mUtil == null){
21 | mUtil = new JsoupClient();
22 | }
23 | }
24 | }
25 | return mUtil;
26 | }
27 |
28 | void init(String url){
29 | mUrl = url;
30 | }
31 |
32 | Observable getObservable(final String url){
33 | return HttpUtil.getBody(url);
34 | }
35 |
36 | Observable getObservableWithoutHost(final String url){
37 | return HttpUtil.getBodyWithoutHost(url);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/base/TransitionHelper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.base;
20 |
21 | import android.content.Context;
22 |
23 | import androidx.fragment.app.Fragment;
24 | import androidx.fragment.app.FragmentTransaction;
25 |
26 | public interface TransitionHelper {
27 | boolean onTransition(Context context, FragmentTransaction fragmentTransaction, Fragment enterFragment, Fragment exitFragment);
28 | }
29 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/mainView/ScaleViewListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.dragvideo.mainView;
20 |
21 | public interface ScaleViewListener {
22 |
23 |
24 | void onVideoFirstPrepared(int width, int height);
25 |
26 | void onBtnViewDown();
27 |
28 | void onBtnMore();
29 |
30 | void onClickViewToNom();
31 |
32 | void onClickViewClose();
33 |
34 |
35 | void onVideoAutoComplete();
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_launch.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
18 |
19 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/HttpConstsUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/9 13:23
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | public class HttpConstsUtil {
22 |
23 | public static final String GET_VIDEO_URL_LIST = "get_video_url_list";
24 |
25 | public static final String CHECK_UPDATE = "check_update";
26 | public static final String GET_VIDEO_INFO = "get_video_info";
27 | public static final String GET_VIDEO_LIST = "get_video_list";
28 | public static final String GET_HOST_DNS = "get_host_dns";
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/fragment/StandFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/4 10:52
17 | */
18 |
19 | package com.zhkrb.iwara.fragment;
20 |
21 | import android.os.Bundle;
22 |
23 | import com.zhkrb.iwara.base.AbsFragment;
24 |
25 | public class StandFragment extends AbsFragment {
26 |
27 | @Override
28 | protected void main(Bundle savedInstanceState) {
29 |
30 | }
31 |
32 | @Override
33 | protected int getLayoutId() {
34 | return 0;
35 | }
36 |
37 | @Override
38 | public void onNewArguments(Bundle args) {
39 |
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/DpUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | import android.util.TypedValue;
22 | import com.zhkrb.iwara.AppContext;
23 |
24 | public class DpUtil {
25 |
26 | public static int dp2px(int dpVal) {
27 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpVal,
28 | AppContext.sInstance.getResources().getDisplayMetrics());
29 | }
30 |
31 | public static int getScreenWidth(){
32 | return AppContext.sInstance.getResources().getDisplayMetrics().widthPixels;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/videoPlayer/PlayerStateListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.dragvideo.videoPlayer;
20 |
21 | public interface PlayerStateListener {
22 |
23 | int PLAY = 0x00011;
24 | int PAUSE = 0x00012;
25 | int LOADING = 0x00014;
26 |
27 | void onStateChange(int state);
28 |
29 | void onVideoFirstPrepared(int width,int height);
30 |
31 | void onBtnViewDown();
32 |
33 | void onProgressUpdate(int progress,int secProgress);
34 |
35 | void onBtnMore();
36 |
37 | void onClickViewToNom();
38 |
39 | void onReload();
40 |
41 | void onVideoAutoComplete();
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_video_corr.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
18 |
19 |
28 |
29 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_switchbutton.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
30 |
31 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #7b1fa2
4 | #9C27B0
5 | #49008C
6 | #9A57B0
7 | #5677fc
8 | #259b24
9 | #FF4081
10 | #9c27b0
11 | #e51c23
12 | #F3E4F5
13 | #CD8ED8
14 | #fff
15 | #F0F0F0
16 | #E6E6E6
17 | #D7222222
18 | #52CFCFCF
19 | #1DFFFFFF
20 |
21 | #fff
22 | #ABFFFFFF
23 | #61FFFFFF
24 | #DE000000
25 | #99000000
26 | #4D000000
27 |
28 | @color/colorAccent
29 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/bean/GetBean.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit.bean;
2 |
3 | import com.alibaba.fastjson.JSONException;
4 |
5 | import java.util.HashMap;
6 | import java.util.Map;
7 |
8 | public class GetBean {
9 |
10 | private Map mArgs;
11 |
12 | public GetBean() {
13 | mArgs = new HashMap<>();
14 | }
15 |
16 | public GetBean param(String key, String value){
17 | try {
18 | mArgs.put(key,value);
19 | }catch (Exception e){
20 | e.printStackTrace();
21 | }
22 | return this;
23 | }
24 |
25 | public GetBean param(String key, int value){
26 | try {
27 | mArgs.put(key,value);
28 | }catch (JSONException e){
29 | e.printStackTrace();
30 | }
31 | return this;
32 | }
33 |
34 | public String create(){
35 | if (mArgs.size()==0){
36 | return "";
37 | }
38 | StringBuilder builder = new StringBuilder();
39 | builder.append("?");
40 | for (String key:mArgs.keySet()){
41 | builder.append(key);
42 | builder.append("=");
43 | builder.append(mArgs.get(key));
44 | }
45 | builder.deleteCharAt(builder.length()-1);
46 | return mArgs.toString();
47 | }
48 |
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/widget/ImgLoader.java:
--------------------------------------------------------------------------------
1 | //Copyright zhkrb
2 | //
3 | //Licensed under the Apache License, Version 2.0 (the "License");
4 | //you may not use this file except in compliance with the License.
5 | //You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | //Unless required by applicable law or agreed to in writing, software
10 | //distributed under the License is distributed on an "AS IS" BASIS,
11 | //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | //See the License for the specific language governing permissions and
13 | //limitations under the License.
14 |
15 | //Create by zhkrb on 2019/9/7 22:12
16 |
17 | package com.zhkrb.dragvideo.widget;
18 |
19 | import android.content.Context;
20 | import android.widget.ImageView;
21 |
22 | import com.bumptech.glide.Glide;
23 | import com.bumptech.glide.load.engine.DiskCacheStrategy;
24 | import com.bumptech.glide.request.RequestOptions;
25 | public class ImgLoader {
26 |
27 | private static RequestOptions options;
28 |
29 | static {
30 | options = new RequestOptions().diskCacheStrategy(DiskCacheStrategy.RESOURCE);
31 | }
32 |
33 | //TODO 加载失败时占位图
34 | public static void display(Context context,String url, ImageView imageView) {
35 | Glide.with(context).load(url).apply(options).into(imageView);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/SchedulerProvider.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit;
2 |
3 | import io.reactivex.ObservableTransformer;
4 | import io.reactivex.Scheduler;
5 | import io.reactivex.android.schedulers.AndroidSchedulers;
6 | import io.reactivex.annotations.NonNull;
7 | import io.reactivex.schedulers.Schedulers;
8 |
9 | public class SchedulerProvider implements BaseSchedulerProvider {
10 |
11 | @NonNull
12 | private static SchedulerProvider sInstance;
13 |
14 | public SchedulerProvider() {
15 | }
16 |
17 | public static synchronized SchedulerProvider getInstance(){
18 | if (sInstance == null){
19 | synchronized (SchedulerProvider.class){
20 | if (sInstance == null){
21 | sInstance = new SchedulerProvider();
22 | }
23 | }
24 | }
25 | return sInstance;
26 | }
27 |
28 | @Override
29 | public Scheduler ui() {
30 | return AndroidSchedulers.mainThread();
31 | }
32 |
33 | @Override
34 | public Scheduler io() {
35 | return Schedulers.io();
36 | }
37 |
38 | public ObservableTransformer applaySchedulers(){
39 | return observable -> observable.subscribeOn(io())
40 | .observeOn(ui());
41 | }
42 |
43 | }
44 |
45 | interface BaseSchedulerProvider {
46 |
47 | Scheduler ui();
48 |
49 | Scheduler io();
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | #9C27B0
5 | #7B1FA2
6 | #E1BEE7
7 | #7C4DFF
8 |
9 | #fff
10 | #ABFFFFFF
11 | #61FFFFFF
12 | #212121
13 | #99000000
14 | #4D000000
15 | #757575
16 |
17 | #BDBDBD
18 | #D8D8D8
19 |
20 | #F3E5F5
21 | #fff
22 | #CD8ED8
23 |
24 | @color/text
25 | #f5f5f5
26 |
27 | #E91E63
28 | #9C27B0
29 | #4CAF50
30 | #FF1744
31 | #3F51B5
32 |
33 | #9C27B0
34 | #7B1FA2
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/L.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | import android.util.Log;
22 |
23 | import com.zhkrb.iwara.AppContext;
24 |
25 | /**
26 | * Created by cxf on 2017/8/3.
27 | */
28 |
29 | public class L {
30 | private final static String TAG = "log--->";
31 |
32 | public static void e(String s) {
33 | e(TAG, s);
34 | }
35 |
36 | public static void e(String tag, String s) {
37 | if (AppContext.sDeBug) {
38 | Log.e(tag, s);
39 | }
40 | }
41 |
42 | public static void i(String s) {
43 | i(TAG, s);
44 | }
45 |
46 | public static void i(String tag, String s) {
47 | if (AppContext.sDeBug) {
48 | Log.i(tag, s);
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/bean/UrlBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/8 21:16
17 | */
18 |
19 | package com.zhkrb.dragvideo.bean;
20 |
21 | public class UrlBean {
22 |
23 | private String resolution;
24 | private String uri;
25 | private String mime;
26 |
27 | public String getResolution() {
28 | return resolution;
29 | }
30 |
31 | public void setResolution(String resolution) {
32 | this.resolution = resolution;
33 | }
34 |
35 | public String getUri() {
36 | return "https:"+uri;
37 | }
38 |
39 | public void setUri(String uri) {
40 | this.uri = uri;
41 | }
42 |
43 | public String getMime() {
44 | return mime;
45 | }
46 |
47 | public void setMime(String mime) {
48 | this.mime = mime;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toast.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
18 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_comment.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
22 |
23 |
33 |
34 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout/toast.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
17 |
18 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/bean/PostBean.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit.bean;
2 |
3 |
4 | import com.alibaba.fastjson.JSONArray;
5 | import com.alibaba.fastjson.JSONException;
6 | import com.alibaba.fastjson.JSONObject;
7 |
8 | public class PostBean {
9 |
10 | private JSONObject mArgs;
11 |
12 |
13 | public PostBean() {
14 | mArgs = new JSONObject();
15 | }
16 |
17 | public void param(String key,String value){
18 | try {
19 | mArgs.put(key,value);
20 | }catch (JSONException e){
21 | e.printStackTrace();
22 | }
23 | }
24 |
25 | public void param(String key,int value){
26 | try {
27 | mArgs.put(key,value);
28 | }catch (JSONException e){
29 | e.printStackTrace();
30 | }
31 | }
32 |
33 | public void param(String key, JSONObject value){
34 | try {
35 | mArgs.put(key,value);
36 | }catch (JSONException e){
37 | e.printStackTrace();
38 | }
39 | }
40 |
41 | public void param(String key, JSONArray value){
42 | try {
43 | mArgs.put(key,value);
44 | }catch (JSONException e){
45 | e.printStackTrace();
46 | }
47 | }
48 |
49 | public boolean isEmpry(){
50 | return mArgs == null || mArgs.size() == 0;
51 | }
52 |
53 | public String create(){
54 | return mArgs.toJSONString();
55 | }
56 |
57 |
58 |
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/scale_progress_drawable.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | -
5 |
6 |
7 |
8 |
9 |
10 | -
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | -
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/bean/ValueSelectBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/9 9:28
17 | */
18 |
19 | package com.zhkrb.dragvideo.bean;
20 |
21 | public class ValueSelectBean {
22 |
23 | private String value;
24 | private String valueText;
25 | private boolean Selected = false;
26 |
27 | public String getValue() {
28 | return value;
29 | }
30 |
31 | public void setValue(String value) {
32 | this.value = value;
33 | }
34 |
35 | public String getValueText() {
36 | return valueText;
37 | }
38 |
39 | public void setValueText(String valueText) {
40 | this.valueText = valueText;
41 | }
42 |
43 |
44 | public boolean isSelected() {
45 | return Selected;
46 | }
47 |
48 | public void setSelected(boolean selected) {
49 | Selected = selected;
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/RegexUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/24 23:16
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | import android.util.Log;
22 |
23 | import java.util.ArrayList;
24 | import java.util.List;
25 | import java.util.regex.Matcher;
26 | import java.util.regex.Pattern;
27 |
28 | public class RegexUtil {
29 |
30 | public static List regex(String text, String pattern){
31 | try {
32 | Pattern pt = Pattern.compile(pattern);
33 | Matcher mt = pt.matcher(text);
34 | List group = new ArrayList<>();
35 | while (mt.find()) {
36 | group.add(mt.group());
37 | }
38 | return group;
39 | }catch (NullPointerException e){
40 | Log.i("MATCH","null");
41 | }
42 | return null;
43 | }
44 |
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_video_recomm.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
18 |
19 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/bean/SettingBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/8 16:40
17 | */
18 |
19 | package com.zhkrb.dragvideo.bean;
20 |
21 | public class SettingBean {
22 |
23 | private int id;
24 | private int thumb;
25 | private String title;
26 | private String value;
27 |
28 | public int getId() {
29 | return id;
30 | }
31 |
32 | public void setId(int id) {
33 | this.id = id;
34 | }
35 |
36 | public String getTitle() {
37 | return title;
38 | }
39 |
40 | public void setTitle(String title) {
41 | this.title = title;
42 | }
43 |
44 | public String getValue() {
45 | return value;
46 | }
47 |
48 | public void setValue(String value) {
49 | this.value = value;
50 | }
51 |
52 | public int getThumb() {
53 | return thumb;
54 | }
55 |
56 | public void setThumb(int thumb) {
57 | this.thumb = thumb;
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/seekbar_thumb_unpressed_to_pressed.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
26 |
31 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/seekbar_thumb_pressed_to_unpressed.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
26 |
32 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/main_scene.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
15 |
16 |
17 |
27 |
28 |
33 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/seekbar_thumb_unpressed_to_unenable.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
26 |
33 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/ToastUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | import android.annotation.SuppressLint;
22 | import android.view.LayoutInflater;
23 | import android.view.View;
24 | import android.widget.TextView;
25 | import android.widget.Toast;
26 |
27 |
28 | import com.zhkrb.iwara.AppContext;
29 | import com.zhkrb.iwara.R;
30 |
31 | /**
32 | * Created by cxf on 2017/8/3.
33 | */
34 |
35 | public class ToastUtil {
36 |
37 | private static Toast sToast;
38 |
39 | static {
40 | sToast = Toast.makeText(AppContext.sInstance, "", Toast.LENGTH_SHORT);
41 | }
42 |
43 | public static void show(int res){
44 | show(WordUtil.getString(res));
45 | }
46 |
47 | public static void show(String s) {
48 | View view = LayoutInflater.from(AppContext.sInstance).inflate(R.layout.toast,null,false);
49 | ((TextView)view.findViewById(com.zhkrb.dragvideo.R.id.text)).setText(s);
50 | sToast.setView(view);
51 | sToast.show();
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/ExceptionUtil.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk;
2 |
3 | import org.jsoup.SerializationException;
4 | import org.jsoup.UncheckedIOException;
5 | import org.jsoup.UnsupportedMimeTypeException;
6 |
7 | import java.net.SocketTimeoutException;
8 |
9 | import retrofit2.HttpException;
10 |
11 | public class ExceptionUtil {
12 |
13 | public static msg getException(Throwable throwable){
14 | if (throwable instanceof HttpException){
15 | return new msg(((HttpException) throwable).code(),throwable.getMessage());//网络错误码异常
16 | }
17 | if (throwable instanceof SerializationException){
18 | return new msg(-998,throwable.getMessage());//序列化异常
19 | }
20 | if (throwable instanceof UncheckedIOException){
21 | return new msg(-997,throwable.getMessage());//未检查异常
22 | }
23 | if (throwable instanceof UnsupportedMimeTypeException){
24 | return new msg(-996,((UnsupportedMimeTypeException) throwable).getMimeType()+" "+throwable.getMessage());
25 | }
26 | if (throwable instanceof SocketTimeoutException){
27 | return new msg(-995,((SocketTimeoutException) throwable).getMessage());
28 | }
29 | return new msg(-999,"unknow exception");
30 | }
31 |
32 | public static class msg {
33 | int code;
34 | String msg;
35 |
36 | public msg(int code, String msg) {
37 | this.code = code;
38 | this.msg = msg;
39 | }
40 |
41 | public int getCode() {
42 | return code;
43 | }
44 |
45 | public String getMsg() {
46 | return msg;
47 | }
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout/view_content_loadfail.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
20 |
21 |
37 |
38 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/values/style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
13 |
16 |
26 |
27 |
31 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | //elevation 阴影
4 | 0dp
5 | 1dp
6 | 2dp
7 | 3dp
8 | 4dp
9 | 5dp
10 | 8dp
11 | 9dp
12 | 12dp
13 | 16dp
14 | 24dp
15 |
16 | //cut dimens 切角大小
17 | 4dp
18 | 8dp
19 | 12dp
20 | 16dp
21 | 28dp
22 |
23 | //文字大小
24 | 24.29sp
25 | 20.2sp
26 | 16.19sp
27 | 14.2sp
28 | 16.16sp
29 | 14.17sp
30 | 14.14sp
31 | 12.12sp
32 | @dimen/caption
33 |
34 | //文字间距
35 | 0
36 | 0.25
37 | 0.5
38 | 0.25
39 | 0.15
40 | 0.1
41 | 1.25
42 | 0.1
43 | 2
44 |
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Iwara
3 | 多语言切换
4 | 安全模式关闭
5 | 加载失败
6 | 次观看
7 | 无更多结果
8 | RUA! 空空如也
9 | JSON序列化异常
10 | IO异常
11 | 不支持的mime类型
12 | 未知错误
13 | 连接超时
14 | URL为空
15 | 再按一次返回键返回到桌面
16 | 获取更新信息出错
17 | 当前已是最新版本
18 | 更新
19 | 版本号: %1$s\n大小: %2$s\n\n更新详情:\n%3$s
20 | 忽略
21 | 确定
22 | 取消
23 | 获取关注总人数
24 | 关注
25 | 取消关注
26 | 已关注
27 | 喜欢
28 | 分享
29 | 下载
30 | 保存
31 | 用户相关:
32 | 相关推荐:
33 | 请自觉维护社区环境,理性发言
34 | 上传日期:%1$s
35 | 功能当前不可用
36 |
37 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/utils/ToastUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.dragvideo.utils;
20 |
21 | import android.content.Context;
22 | import android.view.LayoutInflater;
23 | import android.view.View;
24 | import android.widget.TextView;
25 | import android.widget.Toast;
26 |
27 | import com.zhkrb.dragvideo.R;
28 |
29 |
30 | public class ToastUtil {
31 |
32 |
33 | public static void show(Context context ,int res){
34 | Toast toast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
35 | View view = LayoutInflater.from(context).inflate(R.layout.toast,null,false);
36 | ((TextView)view.findViewById(R.id.text)).setText(res);
37 | toast.setView(view);
38 | toast.show();
39 | }
40 |
41 | public static void show(Context context ,String s) {
42 | Toast toast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
43 | View view = LayoutInflater.from(context).inflate(R.layout.toast,null,false);
44 | ((TextView)view.findViewById(R.id.text)).setText(s);
45 | toast.setView(view);
46 | toast.show();
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
16 |
17 |
20 |
24 |
25 |
29 |
33 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/adapter/CommentAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/20 19:36
17 | */
18 |
19 | package com.zhkrb.iwara.adapter;
20 |
21 | import android.content.Context;
22 | import android.view.ViewGroup;
23 |
24 | import androidx.annotation.NonNull;
25 | import androidx.recyclerview.widget.RecyclerView;
26 |
27 | import com.zhkrb.iwara.bean.UpdateInfoBean;
28 | import com.zhkrb.iwara.custom.refreshView.RefreshAdapter;
29 |
30 | import java.util.List;
31 |
32 | public class CommentAdapter extends RefreshAdapter {
33 |
34 | public CommentAdapter(Context context) {
35 | super(context);
36 | }
37 |
38 | public CommentAdapter(Context context, List list) {
39 | super(context, list);
40 | }
41 |
42 | @Override
43 | protected RecyclerView.ViewHolder onViewHolderCreate(@NonNull ViewGroup parent, int viewType) {
44 | return null;
45 | }
46 |
47 | @Override
48 | protected void onViewHolderBind(@NonNull RecyclerView.ViewHolder holder, int position) {
49 |
50 | }
51 |
52 | @Override
53 | protected int getViewType(int pos) {
54 | return 0;
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout-v23/view_content_loadfail.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
20 |
21 |
38 |
39 |
--------------------------------------------------------------------------------
/dragvideo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 | buildToolsVersion "30.0.1"
6 | defaultConfig {
7 | minSdkVersion 21
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "0.0.2"
11 |
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 |
14 | }
15 |
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | compileOptions {
23 | sourceCompatibility = 1.8
24 | targetCompatibility = 1.8
25 | }
26 |
27 | }
28 |
29 | dependencies {
30 | implementation fileTree(dir: 'libs', include: ['*.jar'])
31 | implementation('com.android.support:appcompat-v7:28.0.0')
32 | implementation 'androidx.appcompat:appcompat:1.0.2'
33 | testImplementation 'junit:junit:4.12'
34 | androidTestImplementation 'androidx.test:runner:1.1.1'
35 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
36 | implementation 'com.google.android.material:material:1.1.0-alpha10'
37 | api "android.arch.lifecycle:common-java8:1.1.1"
38 | implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'
39 |
40 | //glide
41 | implementation 'com.github.bumptech.glide:glide:4.8.0'
42 |
43 | //rxjava
44 | implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
45 | implementation 'io.reactivex.rxjava2:rxjava:2.2.6'
46 |
47 | //gsyVideo
48 | api 'com.shuyu:gsyVideoPlayer-java:7.0.2'
49 | api 'com.shuyu:gsyVideoPlayer-armv7a:7.0.2'
50 | api 'com.shuyu:gsyVideoPlayer-x86:7.0.2'
51 | api 'com.shuyu:gsyVideoPlayer-arm64:7.0.2'
52 | // implementation 'com.shuyu:gsyVideoPlayer-ex_so:7.0.1'
53 | }
54 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/bean/UpdateInfoBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/11 20:55
17 | */
18 |
19 | package com.zhkrb.iwara.bean;
20 |
21 | public class UpdateInfoBean {
22 |
23 | private String info;
24 | private int version;
25 | private String version_name;
26 | private String size;
27 | private String url;
28 |
29 | public String getInfo() {
30 | return info;
31 | }
32 |
33 | public void setInfo(String info) {
34 | this.info = info;
35 | }
36 |
37 | public int getVersion() {
38 | return version;
39 | }
40 |
41 | public void setVersion(int version) {
42 | this.version = version;
43 | }
44 |
45 | public String getSize() {
46 | return size;
47 | }
48 |
49 | public void setSize(String size) {
50 | this.size = size;
51 | }
52 |
53 | public String getUrl() {
54 | return url;
55 | }
56 |
57 | public void setUrl(String url) {
58 | this.url = url;
59 | }
60 |
61 | public String getVersion_name() {
62 | return version_name;
63 | }
64 |
65 | public void setVersion_name(String version_name) {
66 | this.version_name = version_name;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/VibrateUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | import android.content.Context;
22 | import android.os.Build;
23 | import android.os.VibrationEffect;
24 | import android.os.Vibrator;
25 |
26 | import com.zhkrb.iwara.AppContext;
27 |
28 | public class VibrateUtil {
29 |
30 | private static Vibrator vibrator;
31 | private static VibrationEffect vibrationEffect;
32 |
33 | static {
34 | vibrator = (Vibrator) AppContext.sInstance.getSystemService(Context.VIBRATOR_SERVICE);
35 | }
36 |
37 |
38 | public static void Short(){
39 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
40 | vibrationEffect = VibrationEffect.createOneShot(100,100);
41 | vibrator.vibrate(vibrationEffect);
42 | }else {
43 | vibrator.vibrate(100);
44 | }
45 | }
46 |
47 | public static void Long(){
48 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
49 | vibrationEffect = VibrationEffect.createOneShot(500,100);
50 | vibrator.vibrate(vibrationEffect);
51 | }else {
52 | vibrator.vibrate(500);
53 | }
54 | }
55 |
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/WordUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | import android.content.res.Resources;
22 |
23 | import com.zhkrb.iwara.AppContext;
24 | import com.zhkrb.iwara.R;
25 |
26 | /**
27 | * 获取string.xml中的字
28 | */
29 |
30 | public class WordUtil {
31 |
32 | private static Resources sResources;
33 |
34 | static {
35 | sResources = AppContext.sInstance.getResources();
36 | }
37 |
38 | public static String getString(int res) {
39 | return sResources.getString(res);
40 | }
41 |
42 |
43 | public static String getErrorMsg(int code,String msg){
44 | switch (code){
45 | case -998:
46 | return getString(R.string.serializationerror);
47 | case -997:
48 | return getString(R.string.uncheckedioerror);
49 | case -996:
50 | return getString(R.string.unsupported_mime_type);
51 | case -995:
52 | return getString(R.string.socket_time_out);
53 | case -999:
54 | return getString(R.string.unknow_error);
55 | default:
56 | return msg;
57 | }
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/drawable/seekbar_thumb.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
17 |
18 | -
24 |
25 |
29 |
34 |
38 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/custom/AnimLinearLayoutManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/29 13:40
17 | */
18 |
19 | package com.zhkrb.iwara.custom;
20 |
21 | import android.content.Context;
22 | import android.util.AttributeSet;
23 |
24 | import androidx.recyclerview.widget.LinearLayoutManager;
25 | import androidx.recyclerview.widget.RecyclerView;
26 |
27 | public class AnimLinearLayoutManager extends LinearLayoutManager {
28 |
29 | private boolean isAnim = false;
30 |
31 | public AnimLinearLayoutManager(Context context) {
32 | super(context);
33 | }
34 |
35 | public AnimLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
36 | super(context, orientation, reverseLayout);
37 | }
38 |
39 | public AnimLinearLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
40 | super(context, attrs, defStyleAttr, defStyleRes);
41 | }
42 |
43 | public void setAnim(boolean anim) {
44 | isAnim = anim;
45 | }
46 |
47 | @Override
48 | public void onLayoutChildren(RecyclerView.Recycler recycler, RecyclerView.State state) {
49 | if (isAnim){
50 | return;
51 | }
52 | super.onLayoutChildren(recycler, state);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/res/values-en/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Iwara
4 | Switch language
5 | Safe mode off
6 | load failure
7 | views
8 | no more results
9 | nothing in there
10 | serialization fails
11 | IO error
12 | supported mime
13 | unknow error
14 | Time out
15 | URL is empty
16 | Press button again to return
17 | Get update info failed
18 | Currently the latest version
19 | 更新
20 | 版本号: %1$s\\n大小: %2$s\\n\\n更新详情:\\n%3$s
21 | 忽略
22 | 确定
23 | 取消
24 | 获取关注总人数
25 | 关注
26 | 取消关注
27 | 已关注
28 | 喜欢
29 | 分享
30 | 下载
31 | 保存
32 | 用户相关:
33 | 相关推荐:
34 | 上传日期:%1$s
35 | 功能当前不可用
36 | 请自觉维护社区环境,理性发言
37 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/utils/DnsUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/11/1 14:57
17 | */
18 |
19 | package com.zhkrb.dragvideo.utils;
20 |
21 | import android.net.Uri;
22 | import android.text.TextUtils;
23 | import android.util.Log;
24 |
25 | import com.bumptech.glide.RequestManager;
26 |
27 | import java.net.InetAddress;
28 | import java.net.UnknownHostException;
29 | import java.util.List;
30 |
31 | import io.reactivex.Observable;
32 | import io.reactivex.ObservableEmitter;
33 | import io.reactivex.ObservableOnSubscribe;
34 | import io.reactivex.Observer;
35 | import io.reactivex.Scheduler;
36 | import io.reactivex.android.schedulers.AndroidSchedulers;
37 | import io.reactivex.disposables.Disposable;
38 | import io.reactivex.schedulers.Schedulers;
39 |
40 | public class DnsUtil {
41 |
42 | protected String host;
43 | protected DnsUtilCallback mCallback;
44 |
45 | public DnsUtil() {
46 | }
47 |
48 | public void getHostDns(String url){
49 |
50 | }
51 |
52 | public void cancel(){
53 |
54 | }
55 |
56 | public void setCallback(DnsUtilCallback callback) {
57 | mCallback = callback;
58 | }
59 |
60 | public interface DnsUtilCallback{
61 |
62 | void onSuccess(String host,String url);
63 | void onFail();
64 |
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/HttpUtil.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit;
2 |
3 | import com.zhkrb.iwara.AppConfig;
4 | import com.zhkrb.iwara.netowrk.retrofit.bean.GetBean;
5 | import com.zhkrb.iwara.netowrk.retrofit.manager.RequestManager;
6 | import com.zhkrb.iwara.utils.HttpConstsUtil;
7 |
8 | import io.reactivex.Observable;
9 | import io.reactivex.annotations.NonNull;
10 | import okhttp3.ResponseBody;
11 |
12 | public class HttpUtil {
13 |
14 | public static void init(String url){
15 | HttpClient.getInstance().init(url);
16 | }
17 |
18 | public static void reSetUrl(String url){
19 | HttpClient.getInstance().reSet(url);
20 | }
21 |
22 | public static void cancel(String tag){
23 | RequestManager.getInstance().cancel(tag);
24 | }
25 |
26 | public static void cancelAll(){
27 | RequestManager.getInstance().cancelAll();
28 | }
29 |
30 | public static Observable getBody(String api){
31 | return HttpClient.getInstance().get(api,null);
32 | }
33 |
34 | public static Observable getBodyWithoutHost(String url){
35 | return HttpClient.getInstance().getFullUrl(url,null);
36 | }
37 |
38 | public static void testSend(String tag,@NonNull RetrofitCallback callback){
39 | HttpClient.getInstance().get("aa",
40 | new GetBean()
41 | .param("test",1)
42 | .param("cc",2)
43 | ).subscribe(callback.addTag(tag));
44 | }
45 |
46 | public static void getVideoUrlList(String url,String tag,@NonNull RetrofitCallback callback){
47 | HttpClient.getInstance().get(url,null).
48 | subscribe(callback.addTag(tag));
49 | }
50 |
51 | public static void getUpdateInfo(@NonNull RetrofitCallback callback) {
52 | HttpClient.getInstance().getFullUrl(AppConfig.UPDATE_URL,null).
53 | subscribe(callback.addTag(HttpConstsUtil.CHECK_UPDATE));
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout/view_video_progress_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
25 |
26 |
36 |
37 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/contentViewBase/ContentFrame.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/2 21:34
17 | */
18 |
19 | package com.zhkrb.dragvideo.contentViewBase;
20 |
21 | import android.os.Bundle;
22 |
23 | public class ContentFrame {
24 |
25 | private Class> Clazz;
26 | private Bundle args;
27 | private ContentTransHelper mHelper;
28 | private AbsContent requestContent;
29 | private int requestCode;
30 |
31 | public ContentFrame(Class> clazz) {
32 | Clazz = clazz;
33 | }
34 |
35 | public Class> getClazz() {
36 | return Clazz;
37 | }
38 |
39 | public Bundle getArgs() {
40 | return args;
41 | }
42 |
43 | public ContentFrame setArgs(Bundle args) {
44 | this.args = args;
45 | return this;
46 | }
47 |
48 | public ContentTransHelper getHelper() {
49 | return mHelper;
50 | }
51 |
52 | public void setHelper(ContentTransHelper helper) {
53 | mHelper = helper;
54 | }
55 |
56 | public AbsContent getRequestFragment() {
57 | return requestContent;
58 | }
59 |
60 | public void setRequest (AbsContent requestContent, int requestCode) {
61 | this.requestContent = requestContent;
62 | this.requestCode = requestCode;
63 | }
64 |
65 | public int getRequestCode() {
66 | return requestCode;
67 | }
68 |
69 |
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/RetrofitCallback.java:
--------------------------------------------------------------------------------
1 | package com.zhkrb.iwara.netowrk.retrofit;
2 |
3 | import android.text.TextUtils;
4 | import android.util.Log;
5 |
6 | import com.zhkrb.iwara.netowrk.ExceptionUtil;
7 | import com.zhkrb.iwara.netowrk.NetworkCallback;
8 | import com.zhkrb.iwara.netowrk.retrofit.manager.RequestManager;
9 |
10 | import java.io.IOException;
11 | import java.net.HttpURLConnection;
12 |
13 | import io.reactivex.Observer;
14 | import io.reactivex.disposables.Disposable;
15 | import okhttp3.ResponseBody;
16 |
17 | public abstract class RetrofitCallback implements Observer,NetworkCallback {
18 |
19 | private String mTag;
20 |
21 | public RetrofitCallback addTag(String tag){
22 | mTag = tag;
23 | return this;
24 | }
25 |
26 | @Override
27 | public void onSubscribe(Disposable d) {
28 | RequestManager.getInstance().add(mTag,d);
29 | onStart();
30 | }
31 |
32 | @Override
33 | public void onNext(ResponseBody responseBody) {
34 | String string = null;
35 | try {
36 | string = responseBody.string();
37 | } catch (IOException e) {
38 | e.printStackTrace();
39 | onSuccess(HttpURLConnection.HTTP_OK,"can't cast","");
40 | }
41 | if (TextUtils.isEmpty(string)){
42 | onSuccess(HttpURLConnection.HTTP_OK,"empty body","");
43 | return;
44 | }
45 | onSuccess(HttpURLConnection.HTTP_OK,"success",string);
46 | }
47 |
48 | @Override
49 | public void onError(Throwable t) {
50 | t.printStackTrace();
51 | ExceptionUtil.msg msg1 = ExceptionUtil.getException(t);
52 | Log.e("jsoup exception",msg1.getCode()+": "+msg1.getMsg());
53 | onError(msg1.getCode(),msg1.getMsg());
54 | RequestManager.getInstance().remove(mTag);
55 | onFinish();
56 | }
57 |
58 | @Override
59 | public void onComplete() {
60 | RequestManager.getInstance().remove(mTag);
61 | onFinish();
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | //elevation 阴影
4 | 0dp
5 | 1dp
6 | 2dp
7 | 3dp
8 | 4dp
9 | 5dp
10 | 8dp
11 | 9dp
12 | 12dp
13 | 16dp
14 | 24dp
15 |
16 | //cut dimens 切角大小
17 | 4dp
18 | 8dp
19 | 12dp
20 | 16dp
21 |
22 | //文字大小
23 | 24.29sp
24 | 20.2sp
25 | 16.19sp
26 | 14.2sp
27 | 16.16sp
28 | 14.17sp
29 | 14.14sp
30 | 12.12sp
31 | @dimen/caption
32 |
33 | //文字间距
34 | 0
35 | 0.25
36 | 0.5
37 | 0.25
38 | 0.15
39 | 0.1
40 | 1.25
41 | 0.1
42 | 2
43 |
44 | //dialog
45 | 20dp
46 | 48dp
47 | 20dp
48 | 40dp
49 | 16dp
50 | 12dp
51 |
52 |
53 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/widget/advRecyclerView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/8 15:24
17 | */
18 |
19 | package com.zhkrb.dragvideo.widget;
20 |
21 | import android.content.Context;
22 | import android.content.res.TypedArray;
23 | import android.util.AttributeSet;
24 |
25 | import androidx.annotation.NonNull;
26 | import androidx.annotation.Nullable;
27 | import androidx.recyclerview.widget.RecyclerView;
28 |
29 | import com.zhkrb.dragvideo.R;
30 |
31 | public class advRecyclerView extends RecyclerView {
32 |
33 | private float mMaxHeight;
34 |
35 | public advRecyclerView(@NonNull Context context) {
36 | this(context,null);
37 | }
38 |
39 | public advRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) {
40 | this(context, attrs,0);
41 | }
42 |
43 | public advRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyle) {
44 | super(context, attrs, defStyle);
45 | TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.advRecyclerView);
46 | mMaxHeight = ta.getDimension(R.styleable.advRecyclerView_maxHeight1, 0f);
47 | ta.recycle();
48 | }
49 |
50 | @Override
51 | protected void onMeasure(int widthSpec, int heightSpec) {
52 | if (mMaxHeight>0){
53 | heightSpec = MeasureSpec.makeMeasureSpec((int) mMaxHeight,heightSpec);
54 | }
55 | super.onMeasure(widthSpec, heightSpec);
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/base/FragmentFrame.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.base;
20 |
21 | import android.bluetooth.BluetoothHeadset;
22 | import android.os.Bundle;
23 | import android.os.Parcel;
24 | import android.os.Parcelable;
25 |
26 | import androidx.annotation.NonNull;
27 |
28 | public final class FragmentFrame {
29 |
30 | private Class> Clazz;
31 | private Bundle args;
32 | private TransitionHelper mHelper;
33 | private AbsFragment requestFragment;
34 | private int requestCode;
35 |
36 | public FragmentFrame(Class> clazz) {
37 | Clazz = clazz;
38 | }
39 |
40 | public Class> getClazz() {
41 | return Clazz;
42 | }
43 |
44 | public Bundle getArgs() {
45 | return args;
46 | }
47 |
48 | public FragmentFrame setArgs(Bundle args) {
49 | this.args = args;
50 | return this;
51 | }
52 |
53 | public TransitionHelper getHelper() {
54 | return mHelper;
55 | }
56 |
57 | public void setHelper(TransitionHelper helper) {
58 | mHelper = helper;
59 | }
60 |
61 | public AbsFragment getRequestFragment() {
62 | return requestFragment;
63 | }
64 |
65 | public void setRequest (AbsFragment requestFragment, int requestCode) {
66 | this.requestFragment = requestFragment;
67 | this.requestCode = requestCode;
68 | }
69 |
70 | public int getRequestCode() {
71 | return requestCode;
72 | }
73 |
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_gallery_bar.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
20 |
25 |
37 |
42 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/dialog/AbsDialogFragment.java:
--------------------------------------------------------------------------------
1 | //Copyright zhkrb
2 | //
3 | //Licensed under the Apache License, Version 2.0 (the "License");
4 | //you may not use this file except in compliance with the License.
5 | //You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | //Unless required by applicable law or agreed to in writing, software
10 | //distributed under the License is distributed on an "AS IS" BASIS,
11 | //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | //See the License for the specific language governing permissions and
13 | //limitations under the License.
14 |
15 | //Create by zhkrb on 2019/9/7 22:12
16 |
17 | package com.zhkrb.iwara.dialog;
18 |
19 | import android.app.Dialog;
20 | import android.content.Context;
21 | import android.os.Bundle;
22 | import android.view.LayoutInflater;
23 | import android.view.View;
24 | import android.view.Window;
25 |
26 | import androidx.annotation.NonNull;
27 | import androidx.annotation.Nullable;
28 | import androidx.fragment.app.DialogFragment;
29 |
30 | public abstract class AbsDialogFragment extends DialogFragment {
31 |
32 | protected Context mContext;
33 | protected View mRootView;
34 |
35 | @NonNull
36 | @Override
37 | public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
38 | mContext = getActivity();
39 | Dialog dialog = new Dialog(mContext,getDialogStyle());
40 | mRootView = LayoutInflater.from(mContext).inflate(getLayoutId(), null);
41 | dialog.setContentView(mRootView);
42 | dialog.setCancelable(canCancel());
43 | dialog.setCanceledOnTouchOutside(canCancel());
44 | setWindowAttributes(dialog.getWindow());
45 | return dialog;
46 | }
47 |
48 | protected abstract void setWindowAttributes(Window window);
49 |
50 | protected abstract boolean canCancel();
51 |
52 | protected abstract int getDialogStyle();
53 |
54 | protected abstract int getLayoutId();
55 |
56 | @Override
57 | public void onActivityCreated(@Nullable Bundle savedInstanceState) {
58 | super.onActivityCreated(savedInstanceState);
59 | main();
60 | }
61 |
62 | protected abstract void main();
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/ContextLocalWrapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2018 Hippo Seven
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 |
17 | package com.zhkrb.iwara.utils;
18 |
19 | /*
20 | * Created by Hippo on 2018/3/27.
21 | */
22 |
23 | import android.content.Context;
24 | import android.content.ContextWrapper;
25 | import android.content.res.Configuration;
26 | import android.content.res.Resources;
27 | import android.os.Build;
28 | import android.os.LocaleList;
29 |
30 | import java.util.Locale;
31 |
32 | public class ContextLocalWrapper extends ContextWrapper {
33 |
34 | public ContextLocalWrapper(Context base) {
35 | super(base);
36 | }
37 |
38 | public static ContextLocalWrapper wrap(Context context, Locale newLocale) {
39 | Resources res = context.getResources();
40 | Configuration configuration = res.getConfiguration();
41 |
42 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
43 | configuration.setLocale(newLocale);
44 | LocaleList localeList = new LocaleList(newLocale);
45 | LocaleList.setDefault(localeList);
46 | configuration.setLocales(localeList);
47 | context = context.createConfigurationContext(configuration);
48 |
49 | } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
50 | configuration.setLocale(newLocale);
51 | context = context.createConfigurationContext(configuration);
52 |
53 | } else {
54 | configuration.locale = newLocale;
55 | res.updateConfiguration(configuration, res.getDisplayMetrics());
56 | }
57 |
58 | return new ContextLocalWrapper(context);
59 | }
60 | }
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/widget/AbsDialogFragment.java:
--------------------------------------------------------------------------------
1 | //Copyright zhkrb
2 | //
3 | //Licensed under the Apache License, Version 2.0 (the "License");
4 | //you may not use this file except in compliance with the License.
5 | //You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | //Unless required by applicable law or agreed to in writing, software
10 | //distributed under the License is distributed on an "AS IS" BASIS,
11 | //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | //See the License for the specific language governing permissions and
13 | //limitations under the License.
14 |
15 | //Create by zhkrb on 2019/9/7 22:12
16 |
17 | package com.zhkrb.dragvideo.widget;
18 |
19 | import android.app.Dialog;
20 | import android.content.Context;
21 | import android.os.Bundle;
22 | import android.view.LayoutInflater;
23 | import android.view.View;
24 | import android.view.Window;
25 |
26 | import androidx.annotation.NonNull;
27 | import androidx.annotation.Nullable;
28 | import androidx.fragment.app.DialogFragment;
29 |
30 | public abstract class AbsDialogFragment extends DialogFragment {
31 |
32 | protected Context mContext;
33 | protected View mRootView;
34 |
35 | @NonNull
36 | @Override
37 | public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
38 | mContext = getActivity();
39 | Dialog dialog = new Dialog(mContext,getDialogStyle());
40 | mRootView = LayoutInflater.from(mContext).inflate(getLayoutId(), null);
41 | dialog.setContentView(mRootView);
42 | dialog.setCancelable(canCancel());
43 | dialog.setCanceledOnTouchOutside(canCancel());
44 | setWindowAttributes(dialog.getWindow());
45 | return dialog;
46 | }
47 |
48 | protected abstract void setWindowAttributes(Window window);
49 |
50 | protected abstract boolean canCancel();
51 |
52 | protected abstract int getDialogStyle();
53 |
54 | protected abstract int getLayoutId();
55 |
56 | @Override
57 | public void onActivityCreated(@Nullable Bundle savedInstanceState) {
58 | super.onActivityCreated(savedInstanceState);
59 | main();
60 | }
61 |
62 | protected abstract void main();
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/TimeUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/25 14:30
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | import java.text.ParseException;
22 | import java.text.SimpleDateFormat;
23 | import java.util.Date;
24 | import java.util.Locale;
25 |
26 | public class TimeUtil {
27 |
28 | /**
29 | * 获取系统时间戳
30 | * @return
31 | */
32 | public long getCurTimeLong(){
33 | return System.currentTimeMillis();
34 | }
35 | /**
36 | * 获取当前时间
37 | * @param pattern
38 | * @return
39 | */
40 | public static String getCurDate(String pattern){
41 | SimpleDateFormat sDateFormat = new SimpleDateFormat(pattern, Locale.getDefault());
42 | return sDateFormat.format(new java.util.Date());
43 | }
44 |
45 | /**
46 | * 时间戳转换成字符窜
47 | * @param milSecond
48 | * @param pattern
49 | * @return
50 | */
51 | public static String getDateToString(long milSecond, String pattern) {
52 | Date date = new Date(milSecond);
53 | SimpleDateFormat format = new SimpleDateFormat(pattern, Locale.getDefault());
54 | return format.format(date);
55 | }
56 |
57 | /**
58 | * 将字符串转为时间戳
59 | * @param dateString
60 | * @param pattern
61 | * @return
62 | */
63 | public static long getStringToDate(String dateString, String pattern) {
64 | SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, Locale.getDefault());
65 | Date date = new Date();
66 | try{
67 | date = dateFormat.parse(dateString);
68 | } catch(ParseException e) {
69 | e.printStackTrace();
70 | }
71 | return date.getTime();
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/NetworkUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/8 21:34
17 | */
18 |
19 | package com.zhkrb.dragvideo;
20 |
21 | import com.zhkrb.dragvideo.bean.UrlBean;
22 | import com.zhkrb.dragvideo.mainView.VideoPlayerView;
23 |
24 | import java.util.List;
25 |
26 | public class NetworkUtil implements Cloneable {
27 |
28 | protected GetPlayUrlCallback mCallback;
29 |
30 | public NetworkUtil() {
31 | }
32 |
33 | public void setGetPlayUrlCallback(GetPlayUrlCallback callback) {
34 | mCallback = callback;
35 | }
36 |
37 | public void getUrlList(String mainUrl){
38 |
39 | }
40 |
41 | public void cancel(){
42 |
43 | }
44 |
45 | public NetworkUtil clone()
46 | {
47 | NetworkUtil o = null;
48 | try
49 | {
50 | o = (NetworkUtil) super.clone();
51 | }
52 | catch(CloneNotSupportedException e)
53 | {
54 | System.out.println(e.toString());
55 | }
56 | assert o != null;
57 | o.setGetPlayUrlCallback(mCallback.clone());
58 | return o;
59 | }
60 |
61 |
62 | public abstract static class GetPlayUrlCallback implements Cloneable{
63 | public abstract void onSuccess(List list);
64 | public abstract void onFailed(String result);
65 |
66 | public GetPlayUrlCallback clone()
67 | {
68 | GetPlayUrlCallback o = null;
69 | try
70 | {
71 | o = (GetPlayUrlCallback) super.clone();
72 | }
73 | catch(CloneNotSupportedException e)
74 | {
75 | System.out.println(e.toString());
76 | }
77 | return o;
78 | }
79 | }
80 | }
81 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout/view_video_play.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
25 |
26 |
39 |
40 |
56 |
57 |
--------------------------------------------------------------------------------
/dragvideo/src/main/java/com/zhkrb/dragvideo/videoPlayer/IVideoPlayer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.dragvideo.videoPlayer;
20 |
21 | import android.os.Bundle;
22 | import android.widget.ImageView;
23 | import android.widget.SeekBar;
24 |
25 | import java.util.Map;
26 |
27 | public interface IVideoPlayer {
28 |
29 | int VIEW_STATE_NOM = 0x00010; //正常
30 | int VIEW_STATE_SMILL= 0x00011; //拖动
31 | int VIEW_STATE_DOWN = 0x00012; //下滑隐藏
32 |
33 | //画面缩放
34 | int SCALE_DEFAULT = 0x000020;
35 | int SACLE_CROP = 0x000021;
36 |
37 |
38 | /**
39 | * 释放
40 | */
41 | void releasePlayer();
42 |
43 | /**
44 | * 加载
45 | */
46 | void load(String shareUrl,String title,String thumb);
47 |
48 | /**
49 | * 播放 带开始时间
50 | */
51 | void playUrl(String host,String url,long startTime);
52 |
53 |
54 |
55 | /**
56 | * 播放/暂停以及按钮 监听
57 | */
58 | void setPlayerStateListener(PlayerStateListener listener);
59 |
60 | /**
61 | * 设置控件拖动状态
62 | */
63 | void setViewState(int state);
64 |
65 | /**
66 | * 暂停
67 | */
68 | void pause();
69 |
70 | /**
71 | * 恢复暂停
72 | */
73 | void resume();
74 |
75 | void setSeekbar(SeekBar seekbar);
76 |
77 | int getViewState();
78 |
79 | float getPlaySpeed();
80 |
81 | void setPlaySpeed(float speed);
82 |
83 | long getPlayingPos();
84 |
85 | void setHeader(Map header);
86 |
87 | boolean isFullScreen();
88 |
89 | void exitFullScreen();
90 |
91 | void setLoading(boolean b);
92 |
93 | void setFailed(String text);
94 |
95 | void setscaleType(int scaleDefault);
96 |
97 | boolean isNeedReload();
98 | }
99 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
22 |
23 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
45 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Iwara-android-client
2 |
3 | 
4 | 
5 | 
6 |
7 | 
8 |
9 |
10 | ## 说明
11 | Iwara非官方安卓客户端,完全使用Material Design设计,Youtube like播放器,目前仅完成视频列表和播放器以及一些简单的功能。
12 |
13 | 当前整体重构中,因为设计苦手所以进度缓慢,如果您愿意指点一二或有兴趣参与项目请务必联系我
14 |
15 | ## 下载
16 |
17 | 获取编译好的APK文件,请移步[Release](https://github.com/zhkrb/Iwara-android-client/releases)
18 |
19 | ## 截图
20 | Appbar目前仅为测试用,并非最终设计
21 |
22 | 
23 | 
24 | 
25 |
26 | ## 进度
27 |
28 | 查看更新日志请移步[Change_log](Change_log.md)
29 |
30 | ### 已完成
31 | - [x] 单页框架
32 | - [x] 视频列表
33 | - [x] 视频列表手势缩放
34 | - [x] YouTube like播放器
35 | - [x] 一些简单的播放器设置
36 | - [x] 版本管理
37 |
38 | ### TODO
39 | - [ ] 重新修改Appbar
40 | - [ ] 播放器底部视频详情页
41 | - [ ] 用户详情页
42 | - [ ] 帐号相关功能
43 | - [ ] 侧边栏内容
44 | - [ ] 设置
45 | - [ ] 搜索以及自定义筛选
46 | - [ ] 下载管理
47 | - [ ] 隐私设置
48 | - [ ] ...
49 |
50 | ## 依赖
51 |
52 | - [jsoup](https://github.com/jhy/jsoup)
53 | - [retrofit](https://github.com/square/retrofit)
54 | - [GSYVideoPlayer](https://github.com/CarGuo/GSYVideoPlayer)
55 | - [ijkplayer](https://github.com/bilibili/ijkplayer)
56 | - [RxJava](https://github.com/ReactiveX/RxJava)
57 | - [fastjson](https://github.com/alibaba/fastjson)
58 | - [glide](https://github.com/bumptech/glide)
59 |
60 |
61 | 以及参考了许多[EhViewer](https://github.com/seven332/EhViewer)在基础框架上的实现
62 |
63 | ## Issues
64 | 如果您发现任何问题,请尝试再次复现以及排除网络相关原因后反馈,这样可以使我尽快修改它。
65 | 当然如果您有关于功能和设计相关以及使用体验上的反馈,也欢迎您提交issue。
66 |
67 | ## License
68 |
69 |
70 | ```
71 | Copyright zhkrb
72 |
73 | Licensed under the Apache License, Version 2.0 (the "License");
74 | you may not use this file except in compliance with the License.
75 | You may obtain a copy of the License at
76 |
77 | http://www.apache.org/licenses/LICENSE-2.0
78 |
79 | Unless required by applicable law or agreed to in writing, software
80 | distributed under the License is distributed on an "AS IS" BASIS,
81 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
82 | See the License for the specific language governing permissions and limitations under the License.
83 |
84 | ```
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_refresh_group.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
15 |
16 |
25 |
26 |
31 |
32 |
33 |
44 |
45 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/custom/RateImageView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.custom;
20 |
21 | import android.content.Context;
22 | import android.content.res.TypedArray;
23 | import android.util.AttributeSet;
24 | import android.widget.ImageView;
25 |
26 | import com.zhkrb.iwara.R;
27 |
28 | import androidx.annotation.Nullable;
29 |
30 | public class RateImageView extends androidx.appcompat.widget.AppCompatImageView {
31 |
32 | private float mRate;
33 | private boolean isWidthRate;
34 |
35 | public RateImageView(Context context) {
36 | this(context,null);
37 | }
38 |
39 | public RateImageView(Context context, @Nullable AttributeSet attrs) {
40 | this(context, attrs,0);
41 | }
42 |
43 | public RateImageView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
44 | super(context, attrs, defStyleAttr);
45 | TypedArray ta = context.obtainStyledAttributes(attrs, R.styleable.RateImageView);
46 | mRate = ta.getFloat(R.styleable.RateImageView_rate, 1);
47 | isWidthRate = ta.getBoolean(R.styleable.RateImageView_isWidthRate,true);
48 | ta.recycle();
49 | }
50 |
51 | @Override
52 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
53 | if (isWidthRate){
54 | int widthSize = MeasureSpec.getSize(widthMeasureSpec);
55 | heightMeasureSpec = MeasureSpec.makeMeasureSpec((int) (widthSize * mRate), MeasureSpec.EXACTLY);
56 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
57 | }else {
58 | int heightSize = MeasureSpec.getSize(heightMeasureSpec);
59 | widthMeasureSpec = MeasureSpec.makeMeasureSpec((int) (heightSize * mRate), MeasureSpec.EXACTLY);
60 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
61 | }
62 |
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/view_loadmore.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
19 |
20 |
21 |
27 |
35 |
36 |
37 |
43 |
49 |
54 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/utils/VideoNetWorkUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/9 11:12
17 | */
18 |
19 | package com.zhkrb.iwara.utils;
20 |
21 | import com.alibaba.fastjson.JSON;
22 | import com.zhkrb.dragvideo.NetworkUtil;
23 | import com.zhkrb.dragvideo.bean.UrlBean;
24 | import com.zhkrb.iwara.AppConfig;
25 | import com.zhkrb.iwara.netowrk.retrofit.HttpUtil;
26 | import com.zhkrb.iwara.netowrk.retrofit.RetrofitCallback;
27 |
28 | import java.util.List;
29 |
30 | public class VideoNetWorkUtil extends NetworkUtil {
31 |
32 | @Override
33 | public void getUrlList(String mainUrl) {
34 | String[] sp = mainUrl.split("/");
35 | String url = AppConfig.GET_VIDEO_API+sp[sp.length-1];
36 | HttpUtil.getVideoUrlList(url,HttpConstsUtil.GET_VIDEO_URL_LIST,mUrlCallback);
37 | }
38 |
39 | @Override
40 | public void cancel() {
41 | HttpUtil.cancel(HttpConstsUtil.GET_VIDEO_URL_LIST);
42 | }
43 |
44 | private RetrofitCallback mUrlCallback = new RetrofitCallback() {
45 | @Override
46 | public void onStart() {
47 |
48 | }
49 |
50 | @Override
51 | public void onSuccess(int code, String msg, String info) {
52 | if (mCallback == null){
53 | return;
54 | }
55 | if (!msg.equals("success")){
56 | mCallback.onFailed(msg);
57 | return;
58 | }
59 | List list = JSON.parseArray(info,UrlBean.class);
60 | if (list!=null&&list.size()>0){
61 | mCallback.onSuccess(list);
62 | }else {
63 | mCallback.onFailed("empty");
64 | }
65 | }
66 |
67 | @Override
68 | public void onFinish() {
69 |
70 | }
71 |
72 | @Override
73 | public void onError(int code, String msg) {
74 | if (mCallback!=null){
75 | mCallback.onFailed(msg);
76 | }
77 | }
78 | };
79 |
80 | }
81 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/jsoup/JsoupCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/10/27 0:29
17 | */
18 |
19 | package com.zhkrb.iwara.netowrk.jsoup;
20 |
21 | import android.util.Log;
22 |
23 | import com.zhkrb.iwara.netowrk.ExceptionUtil;
24 | import com.zhkrb.iwara.netowrk.NetworkCallback;
25 | import com.zhkrb.iwara.netowrk.retrofit.manager.RequestManager;
26 |
27 | import java.io.IOException;
28 |
29 | import io.reactivex.Observer;
30 | import io.reactivex.disposables.Disposable;
31 | import okhttp3.ResponseBody;
32 |
33 | public abstract class JsoupCallback implements Observer, NetworkCallback {
34 |
35 | private String mTag;
36 | private formater mFormater;
37 |
38 | public JsoupCallback addTag(String tag){
39 | mTag = tag;
40 | return this;
41 | }
42 |
43 | @Override
44 | public void onSubscribe(Disposable d) {
45 | RequestManager.getInstance().add(mTag,d);
46 | onStart();
47 | }
48 |
49 | @Override
50 | public void onNext(ResponseBody responseBody) {
51 | try {
52 | if (mFormater != null){
53 | mFormater.format(responseBody);
54 | }
55 | } catch (Exception e) {
56 | e.printStackTrace();
57 | onError(e);
58 | }
59 | }
60 |
61 | @Override
62 | public void onError(Throwable e) {
63 | e.printStackTrace();
64 | ExceptionUtil.msg msg1 = ExceptionUtil.getException(e);
65 | Log.e("jsoup exception",msg1.getCode()+": "+msg1.getMsg());
66 | onError(msg1.getCode(),msg1.getMsg());
67 | RequestManager.getInstance().remove(mTag);
68 | onFinish();
69 | }
70 |
71 | @Override
72 | public void onComplete() {
73 | RequestManager.getInstance().remove(mTag);
74 | onFinish();
75 | }
76 |
77 | public void setFormater(formater formater) {
78 | mFormater = formater;
79 | }
80 |
81 | interface formater{
82 | void format(ResponseBody responseBody) throws Exception;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout/item_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
21 |
22 |
35 |
49 |
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/netowrk/retrofit/manager/RequestManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/9 12:23
17 | */
18 |
19 | package com.zhkrb.iwara.netowrk.retrofit.manager;
20 |
21 | import android.util.ArrayMap;
22 |
23 | import java.util.Objects;
24 | import java.util.Set;
25 |
26 | import io.reactivex.disposables.Disposable;
27 |
28 |
29 | public class RequestManager implements IRequestManager {
30 |
31 | private static RequestManager sInstance;
32 | private ArrayMap mMap;
33 |
34 | public static RequestManager getInstance(){
35 | if (sInstance == null){
36 | synchronized (RequestManager.class){
37 | if (sInstance == null){
38 | sInstance = new RequestManager();
39 | }
40 | }
41 | }
42 | return sInstance;
43 | }
44 |
45 | public RequestManager() {
46 | mMap = new ArrayMap<>(0);
47 | }
48 |
49 | @Override
50 | public synchronized void add(String tag, Disposable subscription) {
51 | mMap.put(tag,subscription);
52 | }
53 |
54 | @Override
55 | public void remove(String tag) {
56 | if (!mMap.isEmpty()){
57 | mMap.remove(tag);
58 | }
59 | }
60 |
61 | public void removeAll(){
62 | if (!mMap.isEmpty()){
63 | mMap.clear();
64 | }
65 | }
66 |
67 | @Override
68 | public synchronized void cancel(String tag) {
69 | if (mMap.isEmpty()){
70 | return;
71 | }
72 | if (mMap.get(tag) != null){
73 | if (!Objects.requireNonNull(mMap.get(tag)).isDisposed()){
74 | Objects.requireNonNull(mMap.get(tag)).dispose();
75 | remove(tag);
76 | }
77 | }
78 |
79 | }
80 |
81 | @Override
82 | public void cancelAll() {
83 | if (mMap.isEmpty()) {
84 | return;
85 | }
86 | Set keys = mMap.keySet();
87 | for (String apiKey : keys) {
88 | cancel(apiKey);
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/app/src/main/java/com/zhkrb/iwara/activity/LaunchActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright zhkrb
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 | * Create by zhkrb on 2019/9/7 22:12
17 | */
18 |
19 | package com.zhkrb.iwara.activity;
20 |
21 | import android.content.Context;
22 | import android.content.Intent;
23 | import android.os.Handler;
24 | import android.os.Bundle;
25 | import android.view.View;
26 |
27 | import com.zhkrb.iwara.R;
28 | import com.zhkrb.iwara.utils.SpUtil;
29 | import com.zhkrb.iwara.utils.ToastUtil;
30 |
31 | import androidx.appcompat.app.AppCompatActivity;
32 |
33 | public class LaunchActivity extends AppCompatActivity implements View.OnClickListener {
34 |
35 | private Context mContext;
36 | private boolean mSafeMode;
37 | private int i = 0;
38 |
39 |
40 | @Override
41 | protected void onCreate(Bundle savedInstanceState) {
42 | super.onCreate(savedInstanceState);
43 | setContentView(R.layout.activity_launch);
44 | mContext = this;
45 | findViewById(R.id.btn_launcher_1).setOnClickListener(this);
46 | mSafeMode = SpUtil.getInstance().getBooleanValue(SpUtil.SAFEMODE);
47 | Handler handler = new Handler();
48 | handler.postDelayed(this::forward,1000);
49 | }
50 |
51 |
52 | @Override
53 | public void onClick(View view) {
54 | switch (view.getId()){
55 | case R.id.btn_launcher_1:
56 | if (mSafeMode){
57 | return;
58 | }
59 | i++;
60 | if (i==2){
61 | ToastUtil.show(R.string.safe_mode_off);
62 | }
63 | break;
64 | }
65 | }
66 |
67 | private void forward(){
68 | Intent intent = getIntent();
69 | if (intent != null ){
70 | if (Intent.ACTION_MAIN.equals(intent.getAction())){
71 | mContext.startActivity(new Intent(mContext,MainActivity.class).setAction(Intent.ACTION_MAIN));
72 | }else {
73 | mContext.startActivity(intent.setClass(mContext,MainActivity.class));
74 | }
75 | }
76 | finish();
77 | }
78 |
79 | }
80 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
21 |
32 |
38 |
46 |
47 |
48 |
49 |
50 |
51 |
60 |
61 |
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/dragvideo/src/main/res/layout-v23/item_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
23 |
24 |
37 |
51 |
63 |
64 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/main_appbar_child_scene.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
14 |
18 |
19 |
28 |
32 |
33 |
34 |
36 |
44 |
48 |
49 |
57 |
61 |
62 |
63 |
67 |
--------------------------------------------------------------------------------