├── .gitignore
├── README.md
├── Screenshots
├── Screenshot_20200224-101306.jpg
├── Screenshot_20200224-101312.jpg
├── Screenshot_20200224-101410.jpg
├── Screenshot_20200224-101418.jpg
├── Screenshot_20200224-101438.jpg
└── Screenshot_20210330-115141_副本.jpg
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-web.png
│ ├── java
│ └── my
│ │ └── project
│ │ └── silisili
│ │ ├── adapter
│ │ ├── AnimeDescDetailsAdapter.java
│ │ ├── AnimeDescDramaAdapter.java
│ │ ├── AnimeDescRecommendAdapter.java
│ │ ├── AnimeListAdapter.java
│ │ ├── FavoriteListAdapter.java
│ │ ├── FragmentAdapter.java
│ │ ├── LogAdapter.java
│ │ ├── SourceAdapter.java
│ │ ├── TagAdapter.java
│ │ └── WeekAdapter.java
│ │ ├── api
│ │ └── Api.java
│ │ ├── application
│ │ └── Silisili.java
│ │ ├── bean
│ │ ├── AnimeDescBean.java
│ │ ├── AnimeDescDetailsBean.java
│ │ ├── AnimeDescHeaderBean.java
│ │ ├── AnimeDescRecommendBean.java
│ │ ├── AnimeHeaderBean.java
│ │ ├── AnimeTagBean.java
│ │ ├── ApiBean.java
│ │ ├── DownBean.java
│ │ ├── Event.java
│ │ ├── HomeWekBean.java
│ │ ├── LogBean.java
│ │ ├── RecommendBean.java
│ │ ├── RecommendHeaderBean.java
│ │ ├── Refresh.java
│ │ ├── SearchBean.java
│ │ ├── SourceBean.java
│ │ ├── TagBean.java
│ │ ├── TagHeaderBean.java
│ │ └── WebviewBean.java
│ │ ├── cling
│ │ ├── Config.java
│ │ ├── Intents.java
│ │ ├── adapter
│ │ │ └── DevicesAdapter.java
│ │ ├── control
│ │ │ ├── ClingPlayControl.java
│ │ │ ├── IPlayControl.java
│ │ │ ├── ISubscriptionControl.java
│ │ │ ├── SubscriptionControl.java
│ │ │ └── callback
│ │ │ │ ├── ControlCallback.java
│ │ │ │ └── ControlReceiveCallback.java
│ │ ├── entity
│ │ │ ├── BaseClingResponse.java
│ │ │ ├── ClingControlPoint.java
│ │ │ ├── ClingDevice.java
│ │ │ ├── ClingDeviceList.java
│ │ │ ├── ClingPositionResponse.java
│ │ │ ├── ClingResponse.java
│ │ │ ├── ClingVolumeResponse.java
│ │ │ ├── DLANPlayState.java
│ │ │ ├── IControlPoint.java
│ │ │ ├── IDevice.java
│ │ │ └── IResponse.java
│ │ ├── listener
│ │ │ ├── BrowseRegistryListener.java
│ │ │ └── DeviceListChangedListener.java
│ │ ├── service
│ │ │ ├── ClingUpnpService.java
│ │ │ ├── SystemService.java
│ │ │ ├── callback
│ │ │ │ ├── AVTransportSubscriptionCallback.java
│ │ │ │ ├── BaseSubscriptionCallback.java
│ │ │ │ └── RenderingControlSubscriptionCallback.java
│ │ │ └── manager
│ │ │ │ ├── ClingManager.java
│ │ │ │ ├── DeviceManager.java
│ │ │ │ ├── IClingManager.java
│ │ │ │ ├── IDLNAManager.java
│ │ │ │ ├── IDeviceManager.java
│ │ │ │ └── IUpnpServiceManager.java
│ │ ├── ui
│ │ │ └── DLNAActivity.java
│ │ ├── upnp
│ │ │ └── AndroidJettyServletContainer.java
│ │ └── util
│ │ │ ├── ClingUtils.java
│ │ │ ├── ListUtils.java
│ │ │ └── OtherUtils.java
│ │ ├── config
│ │ ├── AnimeType.java
│ │ └── RecommendType.java
│ │ ├── custom
│ │ ├── CircleImageView.java
│ │ ├── CustomLoadMoreView.java
│ │ ├── InsideScrollView.java
│ │ ├── MySwipeRefreshLayout.java
│ │ ├── MyTextView.java
│ │ ├── ScrollAwareBehavior.java
│ │ └── VpSwipeRefreshLayout.java
│ │ ├── database
│ │ └── DatabaseUtil.java
│ │ ├── main
│ │ ├── about
│ │ │ ├── AboutActivity.java
│ │ │ └── OpenSourceActivity.java
│ │ ├── animelist
│ │ │ ├── AnimeListActivity.java
│ │ │ ├── AnimeListContract.java
│ │ │ ├── AnimeListModel.java
│ │ │ └── AnimeListPresenter.java
│ │ ├── base
│ │ │ ├── BaseActivity.java
│ │ │ ├── BaseLoadDataCallback.java
│ │ │ ├── BasePresenter.java
│ │ │ ├── BaseView.java
│ │ │ ├── LazyFragment.java
│ │ │ └── Presenter.java
│ │ ├── desc
│ │ │ ├── DescActivity.java
│ │ │ ├── DescContract.java
│ │ │ ├── DescModel.java
│ │ │ └── DescPresenter.java
│ │ ├── favorite
│ │ │ ├── FavoriteActivity.java
│ │ │ ├── FavoriteContract.java
│ │ │ ├── FavoriteModel.java
│ │ │ └── FavoritePresenter.java
│ │ ├── home
│ │ │ ├── HomeActivity.java
│ │ │ ├── HomeContract.java
│ │ │ ├── HomeModel.java
│ │ │ ├── HomePresenter.java
│ │ │ └── WeekFragment.java
│ │ ├── player
│ │ │ ├── JZExoPlayer.java
│ │ │ ├── JZPlayer.java
│ │ │ └── PlayerActivity.java
│ │ ├── search
│ │ │ ├── SearchActivity.java
│ │ │ ├── SearchContract.java
│ │ │ ├── SearchModel.java
│ │ │ └── SearchPresenter.java
│ │ ├── setting
│ │ │ └── SettingActivity.java
│ │ ├── start
│ │ │ └── StartActivity.java
│ │ ├── tag
│ │ │ ├── TagActivity.java
│ │ │ ├── TagContract.java
│ │ │ ├── TagModel.java
│ │ │ └── TagPresenter.java
│ │ ├── video
│ │ │ ├── VideoContract.java
│ │ │ ├── VideoModel.java
│ │ │ └── VideoPresenter.java
│ │ └── webview
│ │ │ ├── normal
│ │ │ ├── DefaultNormalWebActivity.java
│ │ │ └── NormalWebView.java
│ │ │ └── x5
│ │ │ ├── DefaultX5WebActivity.java
│ │ │ └── X5WebView.java
│ │ ├── net
│ │ ├── DownloadUtil.java
│ │ ├── HttpGet.java
│ │ └── HttpPost.java
│ │ ├── services
│ │ └── ClearVideoCacheService.java
│ │ └── util
│ │ ├── SharedPreferencesUtils.java
│ │ ├── StatusBarUtil.java
│ │ ├── SwipeBackLayoutUtil.java
│ │ ├── Utils.java
│ │ └── VideoUtils.java
│ ├── jniLibs
│ └── armeabi
│ │ └── libtbs.so
│ └── res
│ ├── anim
│ ├── activity_in.xml
│ ├── activity_out.xml
│ ├── fab_in.xml
│ ├── fab_out.xml
│ ├── fade_in.xml
│ └── fade_out.xml
│ ├── color
│ ├── mtrl_btn_stroke_color_selector.xml
│ └── mtrl_navigation_item_background_color.xml
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable-xhdpi
│ ├── baseline_adb_white_48dp.png
│ ├── baseline_airplay_white_48dp.png
│ ├── baseline_all_inclusive_black_48dp.png
│ ├── baseline_all_inclusive_white_48dp.png
│ ├── baseline_arrow_back_white_48dp.png
│ ├── baseline_bug_report_white_48dp.png
│ ├── baseline_clear_all_white_48dp.png
│ ├── baseline_close_white_48dp.png
│ ├── baseline_cloud_download_white_48dp.png
│ ├── baseline_code_white_48dp.png
│ ├── baseline_dashboard_white_48dp.png
│ ├── baseline_down_white_48dp.png
│ ├── baseline_error_white_48dp.png
│ ├── baseline_explore_white_48dp.png
│ ├── baseline_fast_forward_white_48dp.png
│ ├── baseline_fast_rewind_white_48dp.png
│ ├── baseline_favorite_border_white_48dp.png
│ ├── baseline_favorite_white_48dp.png
│ ├── baseline_filter_white_48dp.png
│ ├── baseline_first_page_white_48dp.png
│ ├── baseline_insert_chart_outlined_black_48dp.png
│ ├── baseline_insert_chart_outlined_white_48dp.png
│ ├── baseline_keyboard_arrow_right_white_48dp.png
│ ├── baseline_language_white_48dp.png
│ ├── baseline_last_page_white_48dp.png
│ ├── baseline_open_in_new_white_48dp.png
│ ├── baseline_pause_white_48dp.png
│ ├── baseline_phonelink_setup_white_48dp.png
│ ├── baseline_picture_in_picture_alt_white_48dp.png
│ ├── baseline_play_arrow_white_48dp.png
│ ├── baseline_play_circle_filled_white_48dp.png
│ ├── baseline_play_disabled_white_48dp.png
│ ├── baseline_replay_white_48dp.png
│ ├── baseline_search_white_48dp.png
│ ├── baseline_star_border_white_48dp.png
│ ├── baseline_star_white_48dp.png
│ ├── baseline_style_white_48dp.png
│ ├── baseline_view_selections_white_48dp.png
│ ├── baseline_visibility_black_48dp.png
│ ├── default_bg.jpg
│ ├── error.9.png
│ ├── github.png
│ ├── ic_action_dock.png
│ ├── ic_bubble_chart_white_48dp.png
│ ├── ic_keyboard_arrow_down_white_48dp.png
│ ├── ic_loyalty_white_48dp.png
│ ├── ic_new_feature_pink_dot.png
│ ├── ic_ondemand_video_white_48dp.png
│ ├── ic_settings_white_48dp.png
│ ├── ic_shortcut_dashboard.png
│ ├── ic_shortcut_favorite.png
│ ├── ic_shortcut_search.png
│ ├── light_img.jpg
│ ├── list_selector.png
│ ├── loading_light.png
│ ├── loading_night.png
│ ├── night_img.jpg
│ ├── parsing_error_bg.9.png
│ ├── player_btn_locking.png
│ ├── player_btn_locking_pre.png
│ └── start_img.jpg
│ ├── drawable
│ ├── change_drama_bg.xml
│ ├── coll_toolbar_image_gradient.xml
│ ├── desc_gradient.xml
│ ├── ic_launcher_background.xml
│ ├── pg.xml
│ ├── sniffer_bg.xml
│ ├── text_view_new.xml
│ └── week_item_gradient.xml
│ ├── layout
│ ├── activity_about.xml
│ ├── activity_anime.xml
│ ├── activity_default_webview_normal.xml
│ ├── activity_default_webview_x5.xml
│ ├── activity_desc.xml
│ ├── activity_dlna.xml
│ ├── activity_home.xml
│ ├── activity_play.xml
│ ├── activity_setting.xml
│ ├── activity_source.xml
│ ├── activity_start.xml
│ ├── activity_tag.xml
│ ├── base_emnty_view.xml
│ ├── base_error_view.xml
│ ├── content_home.xml
│ ├── custom_load_more_view.xml
│ ├── dialog_domain.xml
│ ├── dialog_drama.xml
│ ├── dialog_proress.xml
│ ├── dialog_tag.xml
│ ├── dialog_update_log.xml
│ ├── dialog_webview.xml
│ ├── fragment_week.xml
│ ├── item_anime.xml
│ ├── item_desc_details.xml
│ ├── item_desc_drama.xml
│ ├── item_desc_recommend.xml
│ ├── item_device.xml
│ ├── item_favorite.xml
│ ├── item_head.xml
│ ├── item_home_week.xml
│ ├── item_log.xml
│ ├── item_source.xml
│ ├── item_tag_head.xml
│ ├── item_tag_item.xml
│ ├── item_week.xml
│ ├── jz_layout_std.xml
│ ├── nav_header_home.xml
│ └── toolbar.xml
│ ├── menu
│ ├── about_menu.xml
│ ├── activity_home_drawer.xml
│ ├── desc_menu.xml
│ ├── favorite_menu.xml
│ └── home_menu.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ ├── ic_launcher_foreground.png
│ └── ic_launcher_round.png
│ ├── values-night
│ └── colors.xml
│ ├── values-v21
│ └── styles.xml
│ ├── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── ids.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ ├── file_path.xml
│ └── shortcuts.xml
├── build.gradle
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.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 | .cxx
15 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 嘶哩嘶哩
2 | 
3 | [](../../releases)
4 | 
5 | 使用[jsoup](https://github.com/jhy/jsoup)爬取[嘶哩嘶哩](http://www.silisili.in/)部分内容编写的第三方客户端。
6 |
7 | #### 应用截图
8 |
9 |
--------------------------------------------------------------------------------
/Screenshots/Screenshot_20200224-101306.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/Screenshots/Screenshot_20200224-101306.jpg
--------------------------------------------------------------------------------
/Screenshots/Screenshot_20200224-101312.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/Screenshots/Screenshot_20200224-101312.jpg
--------------------------------------------------------------------------------
/Screenshots/Screenshot_20200224-101410.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/Screenshots/Screenshot_20200224-101410.jpg
--------------------------------------------------------------------------------
/Screenshots/Screenshot_20200224-101418.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/Screenshots/Screenshot_20200224-101418.jpg
--------------------------------------------------------------------------------
/Screenshots/Screenshot_20200224-101438.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/Screenshots/Screenshot_20200224-101438.jpg
--------------------------------------------------------------------------------
/Screenshots/Screenshot_20210330-115141_副本.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/Screenshots/Screenshot_20210330-115141_副本.jpg
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 30
5 | buildToolsVersion "29.0.2"
6 | defaultConfig {
7 | applicationId "my.project.silisili"
8 | minSdkVersion 21
9 | targetSdkVersion 30
10 | versionCode 16
11 | versionName "1.0-beta16"
12 | ndk { abiFilters "armeabi", "x86" }
13 | resConfigs "zh"
14 | }
15 | compileOptions {
16 | sourceCompatibility JavaVersion.VERSION_1_8
17 | targetCompatibility JavaVersion.VERSION_1_8
18 | }
19 | buildTypes {
20 | release {
21 | minifyEnabled true
22 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | packagingOptions {
26 | exclude 'META-INF/LICENSE.txt'
27 | exclude 'META-INF/beans.xml'
28 | }
29 | }
30 |
31 | allprojects {
32 | repositories {
33 | mavenCentral()
34 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
35 | maven { url "https://jitpack.io" }
36 | }
37 | }
38 |
39 | dependencies {
40 | implementation fileTree(dir: 'libs', include: ['*.jar'])
41 | implementation fileTree(dir: 'libs', include: ['*.jar'])
42 | implementation 'androidx.appcompat:appcompat:1.2.0'
43 | implementation 'androidx.palette:palette:1.0.0'
44 | implementation 'com.google.android.material:material:1.4.0-alpha01'
45 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
46 | implementation 'androidx.cardview:cardview:1.0.0'
47 | implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30'
48 | implementation 'pub.devrel:easypermissions:3.0.0'
49 | implementation 'com.rengwuxian.materialedittext:library:2.1.4'
50 | implementation 'com.r0adkll:slidableactivity:2.0.5'
51 | implementation 'com.jakewharton:butterknife:10.0.0'
52 | implementation 'androidx.preference:preference:1.1.0-alpha05'
53 | annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'
54 | implementation 'com.squareup.okhttp3:okhttp:3.12.0'
55 | implementation 'cn.jzvd:jiaozivideoplayer:7.2.0'
56 | implementation 'com.google.android.exoplayer:exoplayer:2.11.1'
57 | implementation 'com.github.bumptech.glide:glide:4.11.0'
58 | annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
59 | implementation 'jp.wasabeef:glide-transformations:4.3.0'
60 | implementation "androidx.browser:browser:1.3.0"
61 | implementation 'com.github.fanchen001:Sniffing:1.0.5'
62 | implementation 'com.github.GrenderG:Toasty:1.4.2'
63 | implementation 'co.lujun:androidtagview:1.1.7'
64 | // Cling library
65 | implementation 'org.fourthline.cling:cling-core:2.1.1'
66 | implementation 'org.fourthline.cling:cling-support:2.1.1'
67 | // Jetty library
68 | implementation 'org.eclipse.jetty:jetty-server:8.1.22.v20160922'
69 | implementation 'org.eclipse.jetty:jetty-servlet:8.1.22.v20160922'
70 | implementation 'org.eclipse.jetty:jetty-client:8.1.22.v20160922'
71 | implementation 'com.wuyr:rippleanimation:1.0.0'
72 | implementation 'com.github.MZCretin:ExpandableTextView:v1.6.1-x'
73 | implementation 'org.greenrobot:eventbus:3.2.0'
74 | }
75 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/AnimeDescDetailsAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.annotation.Nullable;
6 |
7 | import com.chad.library.adapter.base.BaseQuickAdapter;
8 | import com.chad.library.adapter.base.BaseViewHolder;
9 | import com.google.android.material.button.MaterialButton;
10 |
11 | import java.util.List;
12 |
13 | import my.project.silisili.R;
14 | import my.project.silisili.bean.AnimeDescDetailsBean;
15 |
16 | /**
17 | * 播放列表适配器
18 | */
19 | public class AnimeDescDetailsAdapter extends BaseQuickAdapter {
20 | private Context context;
21 |
22 | public AnimeDescDetailsAdapter(Context context, @Nullable List data) {
23 | super(R.layout.item_desc_details, data);
24 | this.context = context;
25 | }
26 |
27 | @Override
28 | protected void convert(final BaseViewHolder helper, AnimeDescDetailsBean item) {
29 | MaterialButton materialButton = helper.getView(R.id.tag_group);
30 | helper.setText(R.id.tag_group, item.getTitle());
31 | if (item.isSelected())
32 | materialButton.setTextColor(context.getResources().getColor(R.color.tabSelectedTextColor));
33 | else
34 | materialButton.setTextColor(context.getResources().getColor(R.color.text_color_primary));
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/AnimeDescDramaAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.annotation.Nullable;
6 |
7 | import com.chad.library.adapter.base.BaseQuickAdapter;
8 | import com.chad.library.adapter.base.BaseViewHolder;
9 | import com.google.android.material.button.MaterialButton;
10 |
11 | import java.util.List;
12 |
13 | import my.project.silisili.R;
14 | import my.project.silisili.bean.AnimeDescDetailsBean;
15 |
16 | /**
17 | * 展开播放列表适配器
18 | */
19 | public class AnimeDescDramaAdapter extends BaseQuickAdapter {
20 | private Context context;
21 |
22 | public AnimeDescDramaAdapter(Context context, @Nullable List data) {
23 | super(R.layout.item_desc_drama, data);
24 | this.context = context;
25 | }
26 |
27 | @Override
28 | protected void convert(final BaseViewHolder helper, AnimeDescDetailsBean item) {
29 | MaterialButton materialButton = helper.getView(R.id.tag_group);
30 | helper.setText(R.id.tag_group, item.getTitle());
31 | if (item.isSelected())
32 | materialButton.setTextColor(context.getResources().getColor(R.color.tabSelectedTextColor));
33 | else
34 | materialButton.setTextColor(context.getResources().getColor(R.color.text_color_primary));
35 | }
36 | }
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/AnimeDescRecommendAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.annotation.Nullable;
6 |
7 | import com.chad.library.adapter.base.BaseQuickAdapter;
8 | import com.chad.library.adapter.base.BaseViewHolder;
9 |
10 | import java.util.List;
11 |
12 | import my.project.silisili.R;
13 | import my.project.silisili.bean.AnimeDescRecommendBean;
14 | import my.project.silisili.util.Utils;
15 |
16 | /**
17 | * 相关推荐适配器
18 | */
19 | public class AnimeDescRecommendAdapter extends BaseQuickAdapter {
20 | private Context context;
21 |
22 | public AnimeDescRecommendAdapter(Context context, @Nullable List data) {
23 | super(R.layout.item_desc_recommend, data);
24 | this.context = context;
25 | }
26 |
27 | @Override
28 | protected void convert(final BaseViewHolder helper, AnimeDescRecommendBean item) {
29 | Utils.setCardDefaultBg(context, helper.getView(R.id.card_view), helper.getView(R.id.title));
30 | helper.setText(R.id.title, item.getTitle());
31 | Utils.setDefaultImage(context, item.getImg(), helper.getView(R.id.img), true, helper.getView(R.id.card_view), helper.getView(R.id.title));
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/AnimeListAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.chad.library.adapter.base.BaseQuickAdapter;
6 | import com.chad.library.adapter.base.BaseViewHolder;
7 |
8 | import java.util.List;
9 |
10 | import my.project.silisili.R;
11 | import my.project.silisili.bean.AnimeDescHeaderBean;
12 | import my.project.silisili.util.Utils;
13 |
14 | /**
15 | * 番剧列表适配器
16 | */
17 | public class AnimeListAdapter extends BaseQuickAdapter {
18 | private Context context;
19 |
20 | public AnimeListAdapter(Context context, List list) {
21 | super(R.layout.item_favorite, list);
22 | this.context = context;
23 | }
24 |
25 | @Override
26 | protected void convert(BaseViewHolder helper, AnimeDescHeaderBean item) {
27 | Utils.setCardDefaultBg(context, helper.getView(R.id.card_view), helper.getView(R.id.title));
28 | Utils.setDefaultImage(context, item.getImg(), helper.getView(R.id.img), true, helper.getView(R.id.card_view), helper.getView(R.id.title));
29 | helper.setText(R.id.title, item.getName());
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/FavoriteListAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.chad.library.adapter.base.BaseQuickAdapter;
6 | import com.chad.library.adapter.base.BaseViewHolder;
7 |
8 | import java.util.List;
9 |
10 | import my.project.silisili.R;
11 | import my.project.silisili.application.Silisili;
12 | import my.project.silisili.bean.AnimeDescHeaderBean;
13 | import my.project.silisili.util.Utils;
14 |
15 | /**
16 | * 收藏列表适配器
17 | */
18 | public class FavoriteListAdapter extends BaseQuickAdapter {
19 | private Context context;
20 |
21 | public FavoriteListAdapter(Context context, List list) {
22 | super(R.layout.item_favorite, list);
23 | this.context = context;
24 | }
25 |
26 | @Override
27 | protected void convert(BaseViewHolder helper, AnimeDescHeaderBean item) {
28 | String img = item.getImg();
29 | Utils.setCardDefaultBg(context, helper.getView(R.id.card_view), helper.getView(R.id.title));
30 | Utils.setDefaultImage(context, img.contains("http") ? img : Silisili.DOMAIN + img, helper.getView(R.id.img), true, helper.getView(R.id.card_view), helper.getView(R.id.title));
31 | helper.setText(R.id.title, item.getName());
32 |
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/FragmentAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.chad.library.adapter.base.BaseQuickAdapter;
6 | import com.chad.library.adapter.base.BaseViewHolder;
7 |
8 | import java.util.List;
9 |
10 | import my.project.silisili.R;
11 | import my.project.silisili.application.Silisili;
12 | import my.project.silisili.bean.HomeWekBean;
13 | import my.project.silisili.util.Utils;
14 |
15 | public class FragmentAdapter extends BaseQuickAdapter {
16 | private Context context;
17 |
18 | public FragmentAdapter(Context context, List data) {
19 | super(R.layout.item_week, data);
20 | this.context = context;
21 | }
22 |
23 | @Override
24 | protected void convert(BaseViewHolder helper, HomeWekBean item) {
25 | Utils.setDefaultImage(context, item.getImg().startsWith("http") ? item.getImg() : Silisili.DOMAIN + item.getImg(),helper.getView(R.id.img), true, helper.getView(R.id.card_view), helper.getView(R.id.title));
26 | helper.setText(R.id.title, item.getTitle());
27 | helper.setText(R.id.drama, item.getDrama());
28 | if (item.isHasNew()) helper.setVisible(R.id.new_view, true);
29 | else helper.setVisible(R.id.new_view, false);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/LogAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import com.chad.library.adapter.base.BaseQuickAdapter;
4 | import com.chad.library.adapter.base.BaseViewHolder;
5 |
6 | import java.util.List;
7 |
8 | import my.project.silisili.R;
9 | import my.project.silisili.bean.LogBean;
10 |
11 | public class LogAdapter extends BaseQuickAdapter {
12 | public LogAdapter(List list) {
13 | super(R.layout.item_log, list);
14 | }
15 |
16 | @Override
17 | protected void convert(BaseViewHolder helper, LogBean item) {
18 | helper.setText(R.id.title, item.getTitle());
19 | helper.setText(R.id.dateTime, item.getDateTime());
20 | helper.setText(R.id.desc, item.getDesc());
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/SourceAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import com.chad.library.adapter.base.BaseQuickAdapter;
4 | import com.chad.library.adapter.base.BaseViewHolder;
5 |
6 | import java.util.List;
7 |
8 | import my.project.silisili.R;
9 | import my.project.silisili.bean.SourceBean;
10 |
11 |
12 | public class SourceAdapter extends BaseQuickAdapter {
13 |
14 | public SourceAdapter(List list) {
15 | super(R.layout.item_source, list);
16 | }
17 |
18 | @Override
19 | protected void convert(BaseViewHolder helper, SourceBean item) {
20 | helper.setText(R.id.title,item.getTitle());
21 | helper.setText(R.id.author,item.getAuthor());
22 | helper.setText(R.id.desc,item.getDesc());
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/TagAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import android.content.Context;
4 |
5 | import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
6 | import com.chad.library.adapter.base.BaseViewHolder;
7 | import com.chad.library.adapter.base.entity.MultiItemEntity;
8 |
9 | import java.util.List;
10 |
11 | import my.project.silisili.R;
12 | import my.project.silisili.bean.TagBean;
13 | import my.project.silisili.bean.TagHeaderBean;
14 |
15 | public class TagAdapter extends BaseMultiItemQuickAdapter {
16 | public static final int TYPE_LEVEL_0 = 0;
17 | public static final int TYPE_LEVEL_1 = 1;
18 | private Context context;
19 |
20 | public TagAdapter(Context context, List data) {
21 | super(data);
22 | this.context = context;
23 | addItemType(TYPE_LEVEL_0, R.layout.item_tag_head);
24 | addItemType(TYPE_LEVEL_1, R.layout.item_tag_item);
25 | }
26 |
27 | @Override
28 | protected void convert(final BaseViewHolder helper, MultiItemEntity item) {
29 | switch (helper.getItemViewType()){
30 | case TYPE_LEVEL_0:
31 | final TagHeaderBean homeHeaderBean = (TagHeaderBean) item;
32 | helper.setText(R.id.header, homeHeaderBean.getTitle());
33 | // helper.setText(R.id.light_img, homeHeaderBean.getTitle()).setImageResource(R.id.arrow, homeHeaderBean.isExpanded() ? R.drawable.ic_keyboard_arrow_down_white_48dp : R.drawable.baseline_keyboard_arrow_right_white_48dp);
34 | helper.itemView.setOnClickListener(v -> {
35 | /*int pos = helper.getAdapterPosition();
36 | if (homeHeaderBean.isExpanded()) {
37 | collapse(pos);
38 | } else {
39 | expand(pos);
40 | }*/
41 | });
42 | break;
43 | case TYPE_LEVEL_1:
44 | TagBean tagBean = (TagBean) item;
45 | helper.setText(R.id.tag_group, tagBean.getTitle());
46 | helper.setTextColor(R.id.tag_group, tagBean.isSelected() ? context.getResources().getColor(R.color.colorAccent) : context.getResources().getColor(R.color.text_color_primary));
47 | break;
48 | }
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/adapter/WeekAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.adapter;
2 |
3 | import android.view.ViewGroup;
4 |
5 | import androidx.annotation.NonNull;
6 | import androidx.fragment.app.Fragment;
7 | import androidx.fragment.app.FragmentManager;
8 | import androidx.fragment.app.FragmentStatePagerAdapter;
9 |
10 | import java.util.HashMap;
11 |
12 | import my.project.silisili.R;
13 | import my.project.silisili.main.home.WeekFragment;
14 | import my.project.silisili.util.Utils;
15 |
16 | public class WeekAdapter extends FragmentStatePagerAdapter {
17 | private static final String[] TABS = Utils.getArray(R.array.week_array);
18 | private int num;
19 | private HashMap mFragmentHashMap = new HashMap<>();
20 |
21 | public WeekAdapter(FragmentManager fm, int num) {
22 | super(fm);
23 | this.num = num;
24 | }
25 |
26 | @Override
27 | public int getItemPosition(Object object) {
28 | return POSITION_NONE;
29 | }
30 |
31 | @Override
32 | public Fragment getItem(int position) {
33 | return createFragment(position);
34 | }
35 |
36 | @Override
37 | public int getCount() {
38 | return num;
39 | }
40 |
41 | private Fragment createFragment(int pos) {
42 | Fragment fragment = mFragmentHashMap.get(pos);
43 |
44 | if (fragment == null) {
45 | switch (pos) {
46 | case 0:
47 | fragment = new WeekFragment(TABS[0]);
48 | break;
49 | case 1:
50 | fragment = new WeekFragment(TABS[1]);
51 | break;
52 | case 2:
53 | fragment = new WeekFragment(TABS[2]);
54 | break;
55 | case 3:
56 | fragment = new WeekFragment(TABS[3]);
57 | break;
58 | case 4:
59 | fragment = new WeekFragment(TABS[4]);
60 | break;
61 | case 5:
62 | fragment = new WeekFragment(TABS[5]);
63 | break;
64 | case 6:
65 | fragment = new WeekFragment(TABS[6]);
66 | break;
67 | }
68 | mFragmentHashMap.put(pos, fragment);
69 | }
70 | return fragment;
71 | }
72 |
73 | @Override
74 | public void destroyItem(@NonNull ViewGroup container, int position, @NonNull Object object) {
75 | // super.destroyItem(container, position, object);
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/api/Api.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.api;
2 |
3 | import my.project.silisili.application.Silisili;
4 |
5 | public class Api {
6 | //搜索
7 | public static String SEARCH_API = Silisili.DOMAIN + "/e/search/index.php";
8 | public static String SEARCH_GET_API = Silisili.DOMAIN + "/e/search/result/index.php?searchid=%s&page=%s";
9 | //检测更新
10 | public final static String CHECK_UPDATE = "https://api.github.com/repos/670848654/Silisili/releases/latest";
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/AnimeDescBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | import java.io.Serializable;
4 | import java.util.ArrayList;
5 | import java.util.List;
6 |
7 | public class AnimeDescBean implements Serializable {
8 | // 播放列表集合
9 | private List animeDescDetailsBeans = new ArrayList<>();
10 | // 番剧推荐集合
11 | private List animeDescRecommendBeans = new ArrayList<>();
12 |
13 | public List getAnimeDescDetailsBeans() {
14 | return animeDescDetailsBeans;
15 | }
16 |
17 | public void setAnimeDescDetailsBeans(List animeDescDetailsBeans) {
18 | this.animeDescDetailsBeans = animeDescDetailsBeans;
19 | }
20 |
21 | public List getAnimeDescRecommendBeans() {
22 | return animeDescRecommendBeans;
23 | }
24 |
25 | public void setAnimeDescRecommendBeans(List animeDescRecommendBeans) {
26 | this.animeDescRecommendBeans = animeDescRecommendBeans;
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/AnimeDescDetailsBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | import java.io.Serializable;
4 |
5 | public class AnimeDescDetailsBean implements Serializable {
6 | // 标题
7 | private String title;
8 | // 链接
9 | private String url;
10 | // 是否选中
11 | private boolean selected;
12 |
13 | public AnimeDescDetailsBean(String title, String url, boolean selected) {
14 | this.title = title;
15 | this.url = url;
16 | this.selected = selected;
17 | }
18 |
19 | public String getTitle() {
20 | return title;
21 | }
22 |
23 | public void setTitle(String title) {
24 | this.title = title;
25 | }
26 |
27 | public String getUrl() {
28 | return url;
29 | }
30 |
31 | public void setUrl(String url) {
32 | this.url = url;
33 | }
34 |
35 | public boolean isSelected() {
36 | return selected;
37 | }
38 |
39 | public void setSelected(boolean selected) {
40 | this.selected = selected;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/AnimeDescHeaderBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | import java.util.List;
4 |
5 | public class AnimeDescHeaderBean {
6 | // 名称
7 | private String name;
8 | // 图片
9 | private String img;
10 | // 地址
11 | private String url;
12 | // 详情
13 | private String region = "";
14 | private String year = "";
15 | private String tag = "";
16 | private String state = "";
17 | private String show = "";
18 |
19 | private String desc = "";
20 | private List tagTitles;
21 | private List tagUrls;
22 |
23 | public List getTagTitles() {
24 | return tagTitles;
25 | }
26 |
27 | public void setTagTitles(List tagTitles) {
28 | this.tagTitles = tagTitles;
29 | }
30 |
31 | public List getTagUrls() {
32 | return tagUrls;
33 | }
34 |
35 | public void setTagUrls(List tagUrls) {
36 | this.tagUrls = tagUrls;
37 | }
38 |
39 | public String getName() {
40 | return name;
41 | }
42 |
43 | public void setName(String name) {
44 | this.name = name;
45 | }
46 |
47 | public String getImg() {
48 | return img;
49 | }
50 |
51 | public void setImg(String img) {
52 | this.img = img;
53 | }
54 |
55 | public String getUrl() {
56 | return url;
57 | }
58 |
59 | public void setUrl(String url) {
60 | this.url = url;
61 | }
62 |
63 | public String getRegion() {
64 | return region;
65 | }
66 |
67 | public void setRegion(String region) {
68 | this.region = region;
69 | }
70 |
71 | public String getYear() {
72 | return year;
73 | }
74 |
75 | public void setYear(String year) {
76 | this.year = year;
77 | }
78 |
79 | public String getTag() {
80 | return tag;
81 | }
82 |
83 | public void setTag(String tag) {
84 | this.tag = tag;
85 | }
86 |
87 | public String getShow() {
88 | return show;
89 | }
90 |
91 | public void setShow(String show) {
92 | this.show = show;
93 | }
94 |
95 | public String getState() {
96 | return state;
97 | }
98 |
99 | public void setState(String state) {
100 | this.state = state;
101 | }
102 |
103 | public String getDesc() {
104 | return desc;
105 | }
106 |
107 | public void setDesc(String desc) {
108 | this.desc = desc;
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/AnimeDescRecommendBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 | public class AnimeDescRecommendBean {
3 | // 标题
4 | private String title;
5 | // 图片
6 | private String img;
7 | // 链接
8 | private String url;
9 |
10 | public AnimeDescRecommendBean(String title, String img, String url) {
11 | this.title = title;
12 | this.img = img;
13 | this.url = url;
14 | }
15 |
16 | public String getTitle() {
17 | return title;
18 | }
19 |
20 | public void setTitle(String title) {
21 | this.title = title;
22 | }
23 |
24 | public String getImg() {
25 | return img;
26 | }
27 |
28 | public void setImg(String img) {
29 | this.img = img;
30 | }
31 |
32 | public String getUrl() {
33 | return url;
34 | }
35 |
36 | public void setUrl(String url) {
37 | this.url = url;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/AnimeHeaderBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | import com.chad.library.adapter.base.entity.AbstractExpandableItem;
4 | import com.chad.library.adapter.base.entity.MultiItemEntity;
5 |
6 | import java.io.Serializable;
7 |
8 | import my.project.silisili.config.AnimeType;
9 |
10 | public class AnimeHeaderBean extends AbstractExpandableItem implements MultiItemEntity,Serializable {
11 | private String title;
12 |
13 | public String getTitle() {
14 | return title;
15 | }
16 |
17 | public void setTitle(String title) {
18 | this.title = title;
19 | }
20 |
21 | public AnimeHeaderBean(String title){
22 | this.title = title;
23 | }
24 |
25 | public AnimeHeaderBean() {}
26 |
27 | @Override
28 | public int getLevel() {
29 | return AnimeType.TYPE_LEVEL_0;
30 | }
31 |
32 | @Override
33 | public int getItemType() {
34 | return AnimeType.TYPE_LEVEL_0;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/AnimeTagBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class AnimeTagBean {
4 | private String name;
5 | private String year;
6 |
7 | public AnimeTagBean(String name, String year) {
8 | this.name = name;
9 | this.year = year;
10 | }
11 |
12 | public String getName() {
13 | return name;
14 | }
15 |
16 | public void setName(String name) {
17 | this.name = name;
18 | }
19 |
20 | public String getYear() {
21 | return year;
22 | }
23 |
24 | public void setYear(String year) {
25 | this.year = year;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/ApiBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class ApiBean {
4 | private String id;
5 | private String title;
6 | private String url;
7 |
8 | public ApiBean(){}
9 |
10 | public ApiBean(String id, String title, String url){
11 | this.id = id;
12 | this.title = title;
13 | this.url = url;
14 | }
15 |
16 | public String getId() {
17 | return id;
18 | }
19 |
20 | public void setId(String id) {
21 | this.id = id;
22 | }
23 |
24 | public String getTitle() {
25 | return title;
26 | }
27 |
28 | public void setTitle(String title) {
29 | this.title = title;
30 | }
31 |
32 | public String getUrl() {
33 | return url;
34 | }
35 |
36 | public void setUrl(String url) {
37 | this.url = url;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/DownBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class DownBean {
4 | private String title;
5 | private String url;
6 |
7 | public DownBean(String title, String url) {
8 | this.title = title;
9 | this.url = url;
10 | }
11 |
12 | public String getTitle() {
13 | return title;
14 | }
15 |
16 | public void setTitle(String title) {
17 | this.title = title;
18 | }
19 |
20 | public String getUrl() {
21 | return url;
22 | }
23 |
24 | public void setUrl(String url) {
25 | this.url = url;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/Event.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class Event {
4 | private int clickIndex;
5 |
6 | public Event() {}
7 |
8 | public Event(int clickIndex) {
9 | this.clickIndex = clickIndex;
10 | }
11 |
12 | public int getClickIndex() {
13 | return clickIndex;
14 | }
15 |
16 | public void setClickIndex(int clickIndex) {
17 | this.clickIndex = clickIndex;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/HomeWekBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class HomeWekBean {
4 | private String title;
5 | private String img;
6 | private String url;
7 | private String drama;
8 | private boolean hasNew;
9 |
10 | public HomeWekBean(String title, String img, String url, String drama, boolean hasNew){
11 | this.title = title;
12 | this.img = img;
13 | this.url = url;
14 | this.drama = drama;
15 | this.hasNew = hasNew;
16 | }
17 |
18 | public String getTitle() {
19 | return title;
20 | }
21 |
22 | public void setTitle(String title) {
23 | this.title = title;
24 | }
25 |
26 | public String getImg() {
27 | return img;
28 | }
29 |
30 | public void setImg(String img) {
31 | this.img = img;
32 | }
33 |
34 | public String getUrl() {
35 | return url;
36 | }
37 |
38 | public void setUrl(String url) {
39 | this.url = url;
40 | }
41 |
42 | public String getDrama() {
43 | return drama;
44 | }
45 |
46 | public void setDrama(String drama) {
47 | this.drama = drama;
48 | }
49 |
50 | public boolean isHasNew() {
51 | return hasNew;
52 | }
53 |
54 | public void setHasNew(boolean hasNew) {
55 | this.hasNew = hasNew;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/LogBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class LogBean {
4 | private String title;
5 | private String dateTime;
6 | private String desc;
7 |
8 | public LogBean(){}
9 |
10 | public LogBean(String title, String dateTime, String desc){
11 | this.title = title;
12 | this.dateTime = dateTime;
13 | this.desc = desc;
14 | }
15 |
16 | public String getTitle() {
17 | return title;
18 | }
19 |
20 | public void setTitle(String title) {
21 | this.title = title;
22 | }
23 |
24 | public String getDesc() {
25 | return desc;
26 | }
27 |
28 | public void setDesc(String desc) {
29 | this.desc = desc;
30 | }
31 |
32 | public String getDateTime() {
33 | return dateTime;
34 | }
35 |
36 | public void setDateTime(String dateTime) {
37 | this.dateTime = dateTime;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/RecommendBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | import com.chad.library.adapter.base.entity.MultiItemEntity;
4 |
5 | import my.project.silisili.config.RecommendType;
6 |
7 | public class RecommendBean implements MultiItemEntity {
8 | private String title;
9 | private String img;
10 | private String url;
11 |
12 | public String getTitle() {
13 | return title;
14 | }
15 |
16 | public void setTitle(String title) {
17 | this.title = title;
18 | }
19 |
20 | public String getImg() {
21 | return img;
22 | }
23 |
24 | public void setImg(String img) {
25 | this.img = img;
26 | }
27 |
28 | public String getUrl() {
29 | return url;
30 | }
31 |
32 | public void setUrl(String url) {
33 | this.url = url;
34 | }
35 |
36 | public RecommendBean(String title, String img, String url){
37 | this.title = title;
38 | this.img = img;
39 | this.url = url;
40 | }
41 |
42 | @Override
43 | public int getItemType() {
44 | return RecommendType.TYPE_LEVEL_1;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/RecommendHeaderBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | import com.chad.library.adapter.base.entity.AbstractExpandableItem;
4 | import com.chad.library.adapter.base.entity.MultiItemEntity;
5 |
6 | import my.project.silisili.config.RecommendType;
7 |
8 | public class RecommendHeaderBean extends AbstractExpandableItem implements MultiItemEntity {
9 | private String title;
10 |
11 | public String getTitle() {
12 | return title;
13 | }
14 |
15 | public void setTitle(String title) {
16 | this.title = title;
17 | }
18 |
19 | public RecommendHeaderBean(String title){
20 | this.title = title;
21 | }
22 |
23 | @Override
24 | public int getLevel() {
25 | return RecommendType.TYPE_LEVEL_0;
26 | }
27 |
28 | @Override
29 | public int getItemType() {
30 | return RecommendType.TYPE_LEVEL_0;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/Refresh.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class Refresh {
4 | private int index; // 0 首页 1 刷新收藏
5 |
6 | public Refresh(int index) {
7 | this.index = index;
8 | }
9 |
10 | public int getIndex() {
11 | return index;
12 | }
13 |
14 | public void setIndex(int index) {
15 | this.index = index;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/SearchBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class SearchBean {
4 | private String title;
5 | private String url;
6 | private String img;
7 | private String tags;
8 | private String desc;
9 | private String state;
10 |
11 | public SearchBean(){
12 |
13 | }
14 |
15 | public SearchBean(String title,String url,String img,String desc){
16 | this.title = title;
17 | this.url = url;
18 | this.img = img;
19 | this.desc = desc;
20 | }
21 |
22 | public SearchBean(String title, String url, String desc){
23 | this.title = title;
24 | this.url = url;
25 | this.desc = desc;
26 | }
27 |
28 | public String getImg() {
29 | return img;
30 | }
31 |
32 | public void setImg(String img) {
33 | this.img = img;
34 | }
35 |
36 | public String getTags() {
37 | return tags;
38 | }
39 |
40 | public void setTags(String tags) {
41 | this.tags = tags;
42 | }
43 |
44 | public String getDesc() {
45 | return desc;
46 | }
47 |
48 | public void setDesc(String desc) {
49 | this.desc = desc;
50 | }
51 |
52 | public String getState() {
53 | return state;
54 | }
55 |
56 | public void setState(String state) {
57 | this.state = state;
58 | }
59 |
60 | public String getTitle() {
61 | return title;
62 | }
63 |
64 | public void setTitle(String title) {
65 | this.title = title;
66 | }
67 |
68 | public String getUrl() {
69 | return url;
70 | }
71 |
72 | public void setUrl(String url) {
73 | this.url = url;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/SourceBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class SourceBean {
4 | private String title;
5 | private String author;
6 | private String desc;
7 | private String url;
8 |
9 | public SourceBean(String title, String author, String desc, String url){
10 | this.title = title;
11 | this.author = author;
12 | this.desc = desc;
13 | this.url = url;
14 | }
15 |
16 | public String getTitle() {
17 | return title;
18 | }
19 |
20 | public void setTitle(String title) {
21 | this.title = title;
22 | }
23 |
24 | public String getAuthor() {
25 | return author;
26 | }
27 |
28 | public void setAuthor(String author) {
29 | this.author = author;
30 | }
31 |
32 | public String getDesc() {
33 | return desc;
34 | }
35 |
36 | public void setDesc(String desc) {
37 | this.desc = desc;
38 | }
39 |
40 | public String getUrl() {
41 | return url;
42 | }
43 |
44 | public void setUrl(String url) {
45 | this.url = url;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/TagBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | import com.chad.library.adapter.base.entity.MultiItemEntity;
4 |
5 | import my.project.silisili.adapter.TagAdapter;
6 |
7 | public class TagBean implements MultiItemEntity {
8 | private String title;
9 | private String url;
10 | private String desc;
11 | private boolean selected;
12 |
13 | public TagBean(String title, String url, String desc) {
14 | this.title = title;
15 | this.url = url;
16 | this.desc = desc;
17 | }
18 |
19 | public String getTitle() {
20 | return title;
21 | }
22 |
23 | public void setTitle(String title) {
24 | this.title = title;
25 | }
26 |
27 | public String getUrl() {
28 | return url;
29 | }
30 |
31 | public void setUrl(String url) {
32 | this.url = url;
33 | }
34 |
35 | public String getDesc() {
36 | return desc;
37 | }
38 |
39 | public void setDesc(String desc) {
40 | this.desc = desc;
41 | }
42 |
43 | public boolean isSelected() {
44 | return selected;
45 | }
46 |
47 | public void setSelected(boolean selected) {
48 | this.selected = selected;
49 | }
50 |
51 | @Override
52 | public int getItemType() {
53 | return TagAdapter.TYPE_LEVEL_1;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/TagHeaderBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | import com.chad.library.adapter.base.entity.AbstractExpandableItem;
4 | import com.chad.library.adapter.base.entity.MultiItemEntity;
5 |
6 | import my.project.silisili.adapter.TagAdapter;
7 |
8 | public class TagHeaderBean extends AbstractExpandableItem implements MultiItemEntity {
9 | private String title;
10 |
11 | public String getTitle() {
12 | return title;
13 | }
14 |
15 | public void setTitle(String title) {
16 | this.title = title;
17 | }
18 |
19 | public TagHeaderBean(String title){
20 | this.title = title;
21 | }
22 |
23 | @Override
24 | public int getLevel() {
25 | return TagAdapter.TYPE_LEVEL_0;
26 | }
27 |
28 | @Override
29 | public int getItemType() {
30 | return 0;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/bean/WebviewBean.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.bean;
2 |
3 | public class WebviewBean {
4 | private String title;
5 | private String url;
6 | private boolean select;
7 | private boolean originalPage;
8 | private boolean originalAddress;
9 |
10 | public WebviewBean(String title, String url, boolean select, boolean originalPage, boolean originalAddress){
11 | this.title = title;
12 | this.url = url;
13 | this.select = select;
14 | this.originalPage = originalPage;
15 | this.originalAddress = originalAddress;
16 | }
17 |
18 | public boolean isOriginalPage() {
19 | return originalPage;
20 | }
21 |
22 | public void setOriginalPage(boolean originalPage) {
23 | this.originalPage = originalPage;
24 | }
25 |
26 | public boolean isOriginalAddress() {
27 | return originalAddress;
28 | }
29 |
30 | public void setOriginalAddress(boolean originalAddress) {
31 | this.originalAddress = originalAddress;
32 | }
33 |
34 | public String getTitle() {
35 | return title;
36 | }
37 |
38 | public void setTitle(String title) {
39 | this.title = title;
40 | }
41 |
42 | public String getUrl() {
43 | return url;
44 | }
45 |
46 | public void setUrl(String url) {
47 | this.url = url;
48 | }
49 |
50 | public boolean isSelect() {
51 | return select;
52 | }
53 |
54 | public void setSelect(boolean select) {
55 | this.select = select;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/Config.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling;
2 |
3 | /**
4 | * 说明:
5 | * 作者:zhouzhan
6 | * 日期:17/7/6 11:32
7 | */
8 |
9 | public class Config {
10 |
11 | // mp4 格式
12 | //http://mp4.res.hunantv.com/video/1155/79c71f27a58042b23776691d206d23bf.mp4
13 | // ts 格式
14 | // public static String TEST_URL = "http://ottvideows.hifuntv.com/b36ea6f167c7b5785f3aa46c47b6d983/595f51c1/internettv/c1/2017/03/29/41E0B7C03C15AD472DB008A5FF4566EB.ts?uuid=0c18530ecda4454db49665b178396ff7";
15 | // m3u8 格式
16 | public static String TEST_URL = "https://https-play-g3proxy.lecloud.com/vod/v2/MjYwLzM5LzEwNy9iY2xvdWQvMTAwMDAxL3Zlcl8wMF8yMi0xMTAwMzg4MTg5LWF2Yy00MTg4NTgtYWFjLTQ4MDAwLTU1MzYwLTMzMTk4MDYtMjUzY2MwODk0ODgyZDE3OGRiM2VjMjc3OTliMzc5ODYtMTQ5NDM4MzI2NTkzOC5tcDQ=?b=479&mmsid=234064503&tm=1496913122&pip=cbfbd2fac71c5662777858b9b5e8b611&key=d15f73e306619c49145da43a477197e2&platid=2&splatid=209&payff=0&cuid=100001&vtype=13&dur=55&p1=3&p2=31&p3=311&cf=h5-ios&p=101&playid=0&tss=ios&tag=mobile&sign=bcloud_100001&termid=2&pay=0&ostype=ios&hwtype=un&ajax=1";
17 |
18 | /*** 因为后台给的地址是固定的,如果不测试投屏,请设置为 false*/
19 | public static final boolean DLAN_DEBUG = false;
20 | /*** 轮询获取播放位置时间间隔(单位毫秒)*/
21 | public static final long REQUEST_GET_INFO_INTERVAL = 2000;
22 | /** 投屏设备支持进度回传 */
23 | private boolean hasRelTimePosCallback;
24 | private static Config mInstance;
25 |
26 | public static Config getInstance() {
27 | if (null == mInstance) {
28 | mInstance = new Config();
29 | }
30 | return mInstance;
31 | }
32 |
33 | public boolean getHasRelTimePosCallback() {
34 | return hasRelTimePosCallback;
35 | }
36 |
37 | public void setHasRelTimePosCallback(boolean hasRelTimePosCallback) {
38 | this.hasRelTimePosCallback = hasRelTimePosCallback;
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/adapter/DevicesAdapter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.ArrayAdapter;
8 | import android.widget.TextView;
9 |
10 | import org.fourthline.cling.model.meta.Device;
11 |
12 | import my.project.silisili.R;
13 | import my.project.silisili.cling.entity.ClingDevice;
14 |
15 |
16 | /**
17 | * 说明:
18 | * 作者:zhouzhan
19 | * 日期:17/6/28 15:50
20 | */
21 |
22 | public class DevicesAdapter extends ArrayAdapter {
23 | private LayoutInflater mInflater;
24 |
25 | public DevicesAdapter(Context context) {
26 | super(context, 0);
27 | mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
28 | }
29 |
30 | @Override
31 | public View getView(int position, View convertView, ViewGroup parent) {
32 | if (convertView == null)
33 | convertView = mInflater.inflate(R.layout.item_device, null);
34 |
35 | ClingDevice item = getItem(position);
36 | if (item == null || item.getDevice() == null) {
37 | return convertView;
38 | }
39 |
40 | Device device = item.getDevice();
41 |
42 | // ImageView imageView = (ImageView)convertView.findViewById(R.id.img);
43 | // imageView.setBackgroundResource(R.drawable.ic_action_dock);
44 |
45 | TextView textView = convertView.findViewById(R.id.title);
46 | textView.setText(device.getDetails().getFriendlyName());
47 | return convertView;
48 | }
49 | }
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/control/IPlayControl.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.control;
2 |
3 | import androidx.annotation.Nullable;
4 |
5 | import my.project.silisili.cling.control.callback.ControlCallback;
6 | import my.project.silisili.cling.control.callback.ControlReceiveCallback;
7 |
8 | /**
9 | * 说明:对视频的控制操作定义
10 | * 作者:zhouzhan
11 | * 日期:17/6/27 17:13
12 | */
13 | public interface IPlayControl {
14 |
15 | /**
16 | * 播放一个新片源
17 | *
18 | * @param url 片源地址
19 | */
20 | void playNew(String url, @Nullable ControlCallback callback);
21 |
22 | /**
23 | * 播放
24 | */
25 | void play(@Nullable ControlCallback callback);
26 |
27 | /**
28 | * 暂停
29 | */
30 | void pause(@Nullable ControlCallback callback);
31 |
32 | /**
33 | * 停止
34 | */
35 | void stop(@Nullable ControlCallback callback);
36 |
37 | /**
38 | * 视频 seek
39 | *
40 | * @param pos seek到的位置(单位:毫秒)
41 | */
42 | void seek(int pos, @Nullable ControlCallback callback);
43 |
44 | /**
45 | * 设置音量
46 | *
47 | * @param pos 音量值,最大为 100,最小为 0
48 | */
49 | void setVolume(int pos, @Nullable ControlCallback callback);
50 |
51 | /**
52 | * 设置静音
53 | *
54 | * @param desiredMute 是否静音
55 | */
56 | void setMute(boolean desiredMute, @Nullable ControlCallback callback);
57 |
58 | /**
59 | * 获取tv进度
60 | */
61 | void getPositionInfo(@Nullable ControlReceiveCallback callback);
62 |
63 | /**
64 | * 获取音量
65 | */
66 | void getVolume(@Nullable ControlReceiveCallback callback);
67 | }
68 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/control/ISubscriptionControl.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.control;
2 |
3 | import android.content.Context;
4 |
5 | import my.project.silisili.cling.entity.IDevice;
6 |
7 |
8 | /**
9 | * 说明:tv端回调
10 | * 作者:zhouzhan
11 | * 日期:17/7/21 16:38
12 | */
13 |
14 | public interface ISubscriptionControl {
15 |
16 | /**
17 | * 监听投屏端 AVTransport 回调
18 | */
19 | void registerAVTransport(IDevice device, Context context);
20 |
21 | /**
22 | * 监听投屏端 RenderingControl 回调
23 | */
24 | void registerRenderingControl(IDevice device, Context context);
25 |
26 | /**
27 | * 销毁: 释放资源
28 | */
29 | void destroy();
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/control/SubscriptionControl.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.control;
2 |
3 | import android.content.Context;
4 |
5 | import androidx.annotation.NonNull;
6 |
7 | import org.fourthline.cling.controlpoint.ControlPoint;
8 | import org.fourthline.cling.model.meta.Device;
9 |
10 | import my.project.silisili.cling.entity.IDevice;
11 | import my.project.silisili.cling.service.callback.AVTransportSubscriptionCallback;
12 | import my.project.silisili.cling.service.callback.RenderingControlSubscriptionCallback;
13 | import my.project.silisili.cling.service.manager.ClingManager;
14 | import my.project.silisili.cling.util.ClingUtils;
15 | import my.project.silisili.cling.util.OtherUtils;
16 |
17 | /**
18 | * 说明:
19 | * 作者:zhouzhan
20 | * 日期:17/7/21 16:43
21 | */
22 |
23 | public class SubscriptionControl implements ISubscriptionControl {
24 |
25 | private AVTransportSubscriptionCallback mAVTransportSubscriptionCallback;
26 | private RenderingControlSubscriptionCallback mRenderingControlSubscriptionCallback;
27 |
28 | public SubscriptionControl() {
29 | }
30 |
31 | @Override
32 | public void registerAVTransport(@NonNull IDevice device, @NonNull Context context) {
33 | if (OtherUtils.isNotNull(mAVTransportSubscriptionCallback)) {
34 | mAVTransportSubscriptionCallback.end();
35 | }
36 | final ControlPoint controlPointImpl = ClingUtils.getControlPoint();
37 | if (OtherUtils.isNull(controlPointImpl)) {
38 | return;
39 | }
40 |
41 | mAVTransportSubscriptionCallback = new AVTransportSubscriptionCallback(device.getDevice().findService(ClingManager.AV_TRANSPORT_SERVICE), context);
42 | controlPointImpl.execute(mAVTransportSubscriptionCallback);
43 | }
44 |
45 | @Override
46 | public void registerRenderingControl(@NonNull IDevice device, @NonNull Context context) {
47 | if (OtherUtils.isNotNull(mRenderingControlSubscriptionCallback)) {
48 | mRenderingControlSubscriptionCallback.end();
49 | }
50 | final ControlPoint controlPointImpl = ClingUtils.getControlPoint();
51 | if (OtherUtils.isNull(controlPointImpl)) {
52 | return;
53 | }
54 | mRenderingControlSubscriptionCallback = new RenderingControlSubscriptionCallback(device.getDevice().findService(ClingManager
55 | .RENDERING_CONTROL_SERVICE), context);
56 | controlPointImpl.execute(mRenderingControlSubscriptionCallback);
57 | }
58 |
59 | @Override
60 | public void destroy() {
61 | if (OtherUtils.isNotNull(mAVTransportSubscriptionCallback)) {
62 | mAVTransportSubscriptionCallback.end();
63 | }
64 | if (OtherUtils.isNotNull(mRenderingControlSubscriptionCallback)) {
65 | mRenderingControlSubscriptionCallback.end();
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/control/callback/ControlCallback.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.control.callback;
2 |
3 | import my.project.silisili.cling.entity.IResponse;
4 |
5 | /**
6 | * 说明:设备控制操作 回调
7 | * 作者:zhouzhan
8 | * 日期:17/7/4 10:56
9 | */
10 |
11 | public interface ControlCallback {
12 |
13 | void success(IResponse response);
14 |
15 | void fail(IResponse response);
16 | }
17 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/control/callback/ControlReceiveCallback.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.control.callback;
2 |
3 | import my.project.silisili.cling.entity.IResponse;
4 |
5 | /**
6 | * 说明:手机端接收投屏端信息回调
7 | * 作者:zhouzhan
8 | * 日期:17/7/19 11:13
9 | */
10 |
11 | public interface ControlReceiveCallback extends ControlCallback{
12 |
13 | void receive(IResponse response);
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/BaseClingResponse.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | import org.fourthline.cling.model.action.ActionInvocation;
4 | import org.fourthline.cling.model.message.UpnpResponse;
5 |
6 | /**
7 | * 说明:Cling 服务回调基类
8 | * 作者:zhouzhan
9 | * 日期:17/7/19 16:25
10 | */
11 |
12 | public class BaseClingResponse implements IResponse {
13 |
14 | protected ActionInvocation mActionInvocation;
15 | protected UpnpResponse operation;
16 | protected String defaultMsg;
17 | protected T info;
18 |
19 | /**
20 | * 控制操作成功 构造器
21 | *
22 | * @param actionInvocation cling action 调用
23 | */
24 | public BaseClingResponse(ActionInvocation actionInvocation) {
25 | mActionInvocation = actionInvocation;
26 | }
27 |
28 | /**
29 | * 控制操作失败 构造器
30 | *
31 | * @param actionInvocation cling action 调用
32 | * @param operation 执行状态
33 | * @param defaultMsg 错误信息
34 | */
35 | public BaseClingResponse(ActionInvocation actionInvocation, UpnpResponse operation, String defaultMsg) {
36 | mActionInvocation = actionInvocation;
37 | this.operation = operation;
38 | this.defaultMsg = defaultMsg;
39 | }
40 |
41 | /**
42 | * 接收时的回调
43 | *
44 | * @param actionInvocation cling action 调用
45 | * @param info 回调的对象
46 | */
47 | public BaseClingResponse(ActionInvocation actionInvocation, T info) {
48 | mActionInvocation = actionInvocation;
49 | this.info = info;
50 | }
51 |
52 | @Override
53 | public T getResponse() {
54 | return info;
55 | }
56 |
57 | @Override
58 | public void setResponse(T response) {
59 | info = response;
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/ClingControlPoint.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | import org.fourthline.cling.controlpoint.ControlPoint;
4 |
5 | /**
6 | * 说明:cling 控制点实现类
7 | * 作者:zhouzhan
8 | * 日期:17/6/28 17:03
9 | */
10 |
11 | public class ClingControlPoint implements IControlPoint {
12 |
13 | private static ClingControlPoint INSTANCE = null;
14 | private ControlPoint mControlPoint;
15 |
16 | private ClingControlPoint() {
17 | }
18 |
19 | public static ClingControlPoint getInstance() {
20 | if (INSTANCE == null) {
21 | INSTANCE = new ClingControlPoint();
22 | }
23 | return INSTANCE;
24 | }
25 |
26 | @Override
27 | public ControlPoint getControlPoint() {
28 | return mControlPoint;
29 | }
30 |
31 | @Override
32 | public void setControlPoint(ControlPoint controlPoint) {
33 | mControlPoint = controlPoint;
34 | }
35 |
36 | @Override
37 | public void destroy() {
38 | mControlPoint = null;
39 | INSTANCE = null;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/ClingDevice.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | import org.fourthline.cling.model.meta.Device;
4 |
5 | /**
6 | * 说明:
7 | * 作者:zhouzhan
8 | * 日期:17/6/27 17:47
9 | */
10 |
11 | public class ClingDevice implements IDevice {
12 |
13 | private Device mDevice;
14 | /** 是否已选中 */
15 | private boolean isSelected;
16 |
17 | public ClingDevice(Device device) {
18 | this.mDevice = device;
19 | }
20 |
21 | @Override
22 | public Device getDevice() {
23 | return mDevice;
24 | }
25 |
26 | public boolean isSelected() {
27 | return isSelected;
28 | }
29 |
30 | public void setSelected(boolean selected) {
31 | isSelected = selected;
32 | }
33 | }
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/ClingDeviceList.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | import androidx.annotation.Nullable;
4 |
5 | import org.fourthline.cling.model.meta.Device;
6 |
7 | import java.util.ArrayList;
8 | import java.util.Collection;
9 |
10 | import my.project.silisili.cling.util.OtherUtils;
11 |
12 | /**
13 | * 说明:单例设备列表, 保证全局只有一个设备列表
14 | * 作者:zhouzhan
15 | * 日期:17/6/30 11:25
16 | */
17 |
18 | public class ClingDeviceList {
19 |
20 | private static ClingDeviceList INSTANCE = null;
21 |
22 | /**
23 | * 投屏设备列表 都是引用该 list
24 | */
25 | private Collection mClingDeviceList;
26 |
27 | private ClingDeviceList(){
28 | mClingDeviceList = new ArrayList<>();
29 | }
30 |
31 | public static ClingDeviceList getInstance() {
32 | if (OtherUtils.isNull(INSTANCE)) {
33 | INSTANCE = new ClingDeviceList();
34 | }
35 | return INSTANCE;
36 | }
37 |
38 | public void removeDevice(ClingDevice device){
39 | mClingDeviceList.remove(device);
40 | }
41 |
42 | public void addDevice(ClingDevice device){
43 | mClingDeviceList.add(device);
44 | }
45 |
46 | @Nullable
47 | public ClingDevice getClingDevice(Device device){
48 | for (ClingDevice clingDevice : mClingDeviceList){
49 | Device deviceTemp = clingDevice.getDevice();
50 | if (deviceTemp != null && deviceTemp.equals(device)){
51 | return clingDevice;
52 | }
53 | }
54 | return null;
55 | }
56 |
57 | public boolean contain(Device device){
58 | for (ClingDevice clingDevice : mClingDeviceList){
59 | Device deviceTemp = clingDevice.getDevice();
60 | if (deviceTemp != null && deviceTemp.equals(device)){
61 | return true;
62 | }
63 | }
64 | return false;
65 | }
66 |
67 | @Nullable
68 | public Collection getClingDeviceList(){
69 | return mClingDeviceList;
70 | }
71 |
72 | public void setClingDeviceList(Collection clingDeviceList) {
73 | mClingDeviceList = clingDeviceList;
74 | }
75 |
76 | public void destroy(){
77 | mClingDeviceList = null;
78 | INSTANCE = null;
79 | }
80 | }
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/ClingPositionResponse.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | import org.fourthline.cling.model.action.ActionInvocation;
4 | import org.fourthline.cling.model.message.UpnpResponse;
5 | import org.fourthline.cling.support.model.PositionInfo;
6 |
7 | /**
8 | * 说明:获取播放进度回调结果
9 | * 作者:zhouzhan
10 | * 日期:17/7/19 12:26
11 | */
12 |
13 | public class ClingPositionResponse extends BaseClingResponse implements IResponse {
14 |
15 |
16 | public ClingPositionResponse(ActionInvocation actionInvocation) {
17 | super(actionInvocation);
18 | }
19 |
20 | public ClingPositionResponse(ActionInvocation actionInvocation, UpnpResponse operation, String defaultMsg) {
21 | super(actionInvocation, operation, defaultMsg);
22 | }
23 |
24 | public ClingPositionResponse(ActionInvocation actionInvocation, PositionInfo info) {
25 | super(actionInvocation, info);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/ClingResponse.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | import org.fourthline.cling.model.action.ActionInvocation;
4 | import org.fourthline.cling.model.message.UpnpResponse;
5 |
6 | /**
7 | * 说明:Cling 库中,控制操作返回结果
8 | * 作者:zhouzhan
9 | * 日期:17/7/4 10:50
10 | */
11 |
12 | public class ClingResponse implements IResponse {
13 |
14 | private ActionInvocation mActionInvocation;
15 | private UpnpResponse operation;
16 | private String defaultMsg;
17 |
18 | /**
19 | * 控制操作成功 构造器
20 | *
21 | * @param actionInvocation cling action 调用
22 | */
23 | public ClingResponse(ActionInvocation actionInvocation) {
24 | mActionInvocation = actionInvocation;
25 | }
26 |
27 | /**
28 | * 控制操作失败 构造器
29 | *
30 | * @param actionInvocation cling action 调用
31 | * @param operation 执行状态
32 | * @param defaultMsg 错误信息
33 | */
34 | public ClingResponse(ActionInvocation actionInvocation, UpnpResponse operation, String defaultMsg) {
35 | mActionInvocation = actionInvocation;
36 | this.operation = operation;
37 | this.defaultMsg = defaultMsg;
38 | }
39 |
40 | @Override
41 | public ActionInvocation getResponse() {
42 | return null;
43 | }
44 |
45 | @Override
46 | public void setResponse(ActionInvocation response) {
47 | mActionInvocation = response;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/ClingVolumeResponse.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | import org.fourthline.cling.model.action.ActionInvocation;
4 | import org.fourthline.cling.model.message.UpnpResponse;
5 |
6 | /**
7 | * 说明:
8 | * 作者:zhouzhan
9 | * 日期:17/7/19 16:22
10 | */
11 |
12 | public class ClingVolumeResponse extends BaseClingResponse {
13 |
14 |
15 | public ClingVolumeResponse(ActionInvocation actionInvocation, UpnpResponse operation, String defaultMsg) {
16 | super(actionInvocation, operation, defaultMsg);
17 | }
18 |
19 | public ClingVolumeResponse(ActionInvocation actionInvocation, Integer info) {
20 | super(actionInvocation, info);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/DLANPlayState.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | import androidx.annotation.IntDef;
4 |
5 | import java.lang.annotation.Retention;
6 | import java.lang.annotation.RetentionPolicy;
7 |
8 | /**
9 | * 说明:连接设备状态
10 | * 作者:zhouzhan
11 | * 日期:17/7/10 17:21
12 | */
13 |
14 | public class DLANPlayState {
15 | /** 播放状态 */
16 | public static final int PLAY = 1;
17 | /** 暂停状态 */
18 | public static final int PAUSE = 2;
19 | /** 停止状态 */
20 | public static final int STOP = 3;
21 | /** 转菊花状态 */
22 | public static final int BUFFER = 4;
23 | /** 投放失败 */
24 | public static final int ERROR = 5;
25 |
26 | /** 设备状态 */
27 | @IntDef({PLAY, PAUSE,STOP, BUFFER, ERROR})
28 | @Retention(RetentionPolicy.SOURCE)
29 | public @interface DLANPlayStates {}
30 |
31 |
32 | // 以下不算设备状态, 只是常量
33 | /** 主动轮询获取播放进度(在远程设备不支持播放进度回传时使用) */
34 | public static final int GET_POSITION_POLING = 6;
35 | /** 远程设备播放进度回传 */
36 | public static final int POSITION_CALLBACK = 7;
37 | /** 投屏端播放完成 */
38 | public static final int PLAY_COMPLETE = 8;
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/IControlPoint.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | /**
4 | * 说明:控制点
5 | * 作者:zhouzhan
6 | * 日期:17/6/27 17:47
7 | */
8 |
9 | public interface IControlPoint {
10 |
11 | /**
12 | * @return 返回控制点
13 | */
14 | T getControlPoint();
15 |
16 | /**
17 | * 设置控制点
18 | * @param controlPoint 控制点
19 | */
20 | void setControlPoint(T controlPoint);
21 |
22 | /**
23 | * 销毁 清空缓存
24 | */
25 | void destroy();
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/IDevice.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | /**
4 | * 说明:
5 | * 作者:zhouzhan
6 | * 日期:17/6/27 17:47
7 | */
8 |
9 | public interface IDevice {
10 |
11 | T getDevice();
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/entity/IResponse.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.entity;
2 |
3 | /**
4 | * 说明:设备控制 返回结果
5 | * 作者:zhouzhan
6 | * 日期:17/7/4 10:50
7 | */
8 |
9 | public interface IResponse {
10 |
11 | T getResponse();
12 |
13 | void setResponse(T response);
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/listener/DeviceListChangedListener.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.listener;
2 |
3 | import my.project.silisili.cling.entity.IDevice;
4 |
5 | /**
6 | * 说明:设备状态改变监听接口
7 | * 作者:zhouzhan
8 | * 日期:17/6/30 11:09
9 | */
10 |
11 | public interface DeviceListChangedListener {
12 |
13 | /**
14 | * 某设备被发现之后回调该方法
15 | * @param device 被发现的设备
16 | */
17 | void onDeviceAdded(IDevice device);
18 |
19 | /**
20 | * 在已发现设备中 移除了某设备之后回调该接口
21 | * @param device 被移除的设备
22 | */
23 | void onDeviceRemoved(IDevice device);
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/service/ClingUpnpService.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.service;
2 |
3 | import android.content.Intent;
4 | import android.os.IBinder;
5 |
6 | import org.fourthline.cling.UpnpServiceConfiguration;
7 | import org.fourthline.cling.android.AndroidUpnpServiceImpl;
8 | import org.fourthline.cling.controlpoint.ControlPoint;
9 | import org.fourthline.cling.model.meta.LocalDevice;
10 | import org.fourthline.cling.registry.Registry;
11 |
12 | /**
13 | * 说明:
14 | * 作者:zhouzhan
15 | * 日期:17/6/28 16:11
16 | */
17 |
18 | public class ClingUpnpService extends AndroidUpnpServiceImpl {
19 | private LocalDevice mLocalDevice = null;
20 |
21 | @Override
22 | public void onCreate() {
23 | super.onCreate();
24 |
25 | //LocalBinder instead of binder
26 | binder = new LocalBinder();
27 | }
28 |
29 | @Override
30 | public void onDestroy() {
31 | super.onDestroy();
32 | }
33 |
34 | @Override
35 | public IBinder onBind(Intent intent) {
36 | return binder;
37 | }
38 |
39 | public LocalDevice getLocalDevice() {
40 | return mLocalDevice;
41 | }
42 |
43 | public UpnpServiceConfiguration getConfiguration() {
44 | return upnpService.getConfiguration();
45 | }
46 |
47 | public Registry getRegistry() {
48 | return upnpService.getRegistry();
49 | }
50 |
51 | public ControlPoint getControlPoint() {
52 | return upnpService.getControlPoint();
53 | }
54 |
55 | public class LocalBinder extends Binder {
56 | public ClingUpnpService getService() {
57 | return ClingUpnpService.this;
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/service/callback/BaseSubscriptionCallback.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.service.callback;
2 |
3 | import android.content.Context;
4 | import android.util.Log;
5 |
6 | import org.fourthline.cling.controlpoint.SubscriptionCallback;
7 | import org.fourthline.cling.model.gena.CancelReason;
8 | import org.fourthline.cling.model.gena.GENASubscription;
9 | import org.fourthline.cling.model.message.UpnpResponse;
10 | import org.fourthline.cling.model.meta.Service;
11 |
12 | /**
13 | * 说明:
14 | * 作者:zhouzhan
15 | * 日期:17/7/20 15:48
16 | */
17 |
18 | public abstract class BaseSubscriptionCallback extends SubscriptionCallback {
19 |
20 | private static final int SUBSCRIPTION_DURATION_SECONDS = 3600 * 3;
21 | private static final String TAG = BaseSubscriptionCallback.class.getSimpleName();
22 | protected Context mContext;
23 |
24 | protected BaseSubscriptionCallback(Service service, Context context) {
25 | super(service, SUBSCRIPTION_DURATION_SECONDS);
26 | mContext = context;
27 | }
28 |
29 | @Override
30 | protected void failed(GENASubscription subscription, UpnpResponse responseStatus, Exception exception, String defaultMsg) {
31 | Log.e(TAG, "AVTransportSubscriptionCallback failed.");
32 | }
33 |
34 | @Override
35 | protected void established(GENASubscription subscription) {
36 | }
37 |
38 | @Override
39 | protected void eventsMissed(GENASubscription subscription, int numberOfMissedEvents) {
40 | }
41 |
42 | @Override
43 | protected void ended(GENASubscription subscription, CancelReason reason, UpnpResponse responseStatus) {
44 | mContext = null;
45 | Log.e(TAG, "ended");
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/service/callback/RenderingControlSubscriptionCallback.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.service.callback;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.util.Log;
6 |
7 | import org.fourthline.cling.model.gena.GENASubscription;
8 | import org.fourthline.cling.model.meta.Service;
9 | import org.fourthline.cling.model.state.StateVariableValue;
10 | import org.fourthline.cling.support.lastchange.LastChange;
11 | import org.fourthline.cling.support.renderingcontrol.lastchange.RenderingControlLastChangeParser;
12 | import org.fourthline.cling.support.renderingcontrol.lastchange.RenderingControlVariable;
13 |
14 | import java.util.Map;
15 |
16 | import my.project.silisili.cling.Intents;
17 | import my.project.silisili.cling.util.OtherUtils;
18 |
19 | /**
20 | * 说明:RenderingControl 事件回传
21 | * 作者:zhouzhan
22 | * 日期:17/7/18 18:54
23 | */
24 |
25 | public class RenderingControlSubscriptionCallback extends BaseSubscriptionCallback {
26 |
27 | private static final String TAG = RenderingControlSubscriptionCallback.class.getSimpleName();
28 |
29 | public RenderingControlSubscriptionCallback(Service service, Context context) {
30 | super(service, context);
31 | }
32 |
33 | @Override
34 | protected void eventReceived(GENASubscription subscription) {
35 | Map values = subscription.getCurrentValues();
36 | if (OtherUtils.isNull(values)) {
37 | return;
38 | }
39 | if (OtherUtils.isNull(mContext)) {
40 | return;
41 | }
42 | if (!values.containsKey("LastChange")) {
43 | return;
44 | }
45 |
46 | String lastChangeValue = values.get("LastChange").toString();
47 | Log.i(TAG, "LastChange:" + lastChangeValue);
48 | LastChange lastChange;
49 | try {
50 | lastChange = new LastChange(new RenderingControlLastChangeParser(), lastChangeValue);
51 | //获取音量 volume
52 | int volume = 0;
53 | if (lastChange.getEventedValue(0, RenderingControlVariable.Volume.class) != null) {
54 |
55 | volume = lastChange.getEventedValue(0, RenderingControlVariable.Volume.class).getValue().getVolume();
56 |
57 | Log.e(TAG, "onVolumeChange volume: " + volume);
58 | Intent intent = new Intent(Intents.ACTION_VOLUME_CALLBACK);
59 | intent.putExtra(Intents.EXTRA_VOLUME, volume);
60 | mContext.sendBroadcast(intent);
61 |
62 | }
63 | } catch (Exception e) {
64 | e.printStackTrace();
65 | }
66 |
67 | }
68 |
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/service/manager/DeviceManager.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.service.manager;
2 |
3 |
4 | import android.content.Context;
5 | import android.util.Log;
6 |
7 | import java.util.Collection;
8 |
9 | import my.project.silisili.cling.Config;
10 | import my.project.silisili.cling.control.SubscriptionControl;
11 | import my.project.silisili.cling.entity.ClingDevice;
12 | import my.project.silisili.cling.entity.ClingDeviceList;
13 | import my.project.silisili.cling.entity.IDevice;
14 | import my.project.silisili.cling.util.OtherUtils;
15 |
16 | /**
17 | * 说明:
18 | * 作者:zhouzhan
19 | * 日期:17/7/21 16:33
20 | */
21 |
22 | public class DeviceManager implements IDeviceManager {
23 | private static final String TAG = DeviceManager.class.getSimpleName();
24 | /**
25 | * 已选中的设备, 它也是 ClingDeviceList 中的一员
26 | */
27 | private ClingDevice mSelectedDevice;
28 | private SubscriptionControl mSubscriptionControl;
29 |
30 | public DeviceManager() {
31 | mSubscriptionControl = new SubscriptionControl();
32 | }
33 |
34 | @Override
35 | public IDevice getSelectedDevice() {
36 | return mSelectedDevice;
37 | }
38 |
39 | @Override
40 | public void setSelectedDevice(IDevice selectedDevice) {
41 | // if (selectedDevice != mSelectedDevice){
42 | // Intent intent = new Intent(Intents.ACTION_CHANGE_DEVICE);
43 | // sendBroadcast(intent);
44 | // }
45 |
46 | Log.i(TAG, "Change selected device.");
47 | mSelectedDevice = (ClingDevice) selectedDevice;
48 |
49 | // 重置选中状态
50 | Collection clingDeviceList = ClingDeviceList.getInstance().getClingDeviceList();
51 | if (OtherUtils.isNotNull(clingDeviceList)){
52 | for (ClingDevice device : clingDeviceList){
53 | device.setSelected(false);
54 | }
55 | }
56 | // 设置选中状态
57 | mSelectedDevice.setSelected(true);
58 | // 清空状态
59 | Config.getInstance().setHasRelTimePosCallback(false);
60 | }
61 |
62 | @Override
63 | public void cleanSelectedDevice() {
64 | if (OtherUtils.isNull(mSelectedDevice))
65 | return;
66 |
67 | mSelectedDevice.setSelected(false);
68 | }
69 |
70 | @Override
71 | public void registerAVTransport(Context context) {
72 | if (OtherUtils.isNull(mSelectedDevice))
73 | return;
74 |
75 | mSubscriptionControl.registerAVTransport(mSelectedDevice, context);
76 | }
77 |
78 | @Override
79 | public void registerRenderingControl(Context context) {
80 | if (OtherUtils.isNull(mSelectedDevice))
81 | return;
82 |
83 | mSubscriptionControl.registerRenderingControl(mSelectedDevice, context);
84 | }
85 |
86 | @Override
87 | public void destroy() {
88 | if (OtherUtils.isNotNull(mSubscriptionControl)){
89 | mSubscriptionControl.destroy();
90 | }
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/service/manager/IClingManager.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.service.manager;
2 |
3 |
4 | import org.fourthline.cling.registry.Registry;
5 |
6 | import my.project.silisili.cling.service.ClingUpnpService;
7 |
8 | /**
9 | * 说明:
10 | * 作者:zhouzhan
11 | * 日期:17/6/28 16:30
12 | */
13 |
14 | public interface IClingManager extends IDLNAManager {
15 |
16 | void setUpnpService(ClingUpnpService upnpService);
17 |
18 | void setDeviceManager(IDeviceManager deviceManager);
19 |
20 | Registry getRegistry();
21 | }
22 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/service/manager/IDLNAManager.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.service.manager;
2 |
3 |
4 | import android.content.Context;
5 |
6 | import java.util.Collection;
7 |
8 | import my.project.silisili.cling.entity.IControlPoint;
9 | import my.project.silisili.cling.entity.IDevice;
10 |
11 | /**
12 | * 说明:
13 | * 作者:zhouzhan
14 | * 日期:17/6/27 17:41
15 | */
16 |
17 | public interface IDLNAManager {
18 |
19 | /**
20 | * 搜索所有的设备
21 | */
22 | void searchDevices();
23 |
24 | /**
25 | * 获取支持 Media 类型的设备
26 | *
27 | * @return 设备列表
28 | */
29 | Collection extends IDevice> getDmrDevices();
30 |
31 | /**
32 | * 获取控制点
33 | *
34 | * @return 控制点
35 | */
36 | IControlPoint getControlPoint();
37 |
38 | /**
39 | * 获取选中的设备
40 | *
41 | * @return 选中的设备
42 | */
43 | IDevice getSelectedDevice();
44 |
45 | /**
46 | * 取消选中的设备
47 | */
48 | void cleanSelectedDevice();
49 |
50 | /**
51 | * 设置选中的设备
52 | * @param device 已选中设备
53 | */
54 | void setSelectedDevice(IDevice device);
55 |
56 | /**
57 | * 监听投屏端 AVTransport 回调
58 | * @param context 用于接收到消息发广播
59 | */
60 | void registerAVTransport(Context context);
61 |
62 | /**
63 | * 监听投屏端 RenderingControl 回调
64 | * @param context 用于接收到消息发广播
65 | */
66 | void registerRenderingControl(Context context);
67 |
68 | /**
69 | * 销毁
70 | */
71 | void destroy();
72 | }
73 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/service/manager/IDeviceManager.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.service.manager;
2 |
3 | import android.content.Context;
4 |
5 | import my.project.silisili.cling.entity.IDevice;
6 |
7 |
8 | /**
9 | * 说明:
10 | * 作者:zhouzhan
11 | * 日期:17/7/21 16:34
12 | */
13 |
14 | public interface IDeviceManager {
15 |
16 | /**
17 | * 获取选中设备
18 | */
19 | IDevice getSelectedDevice();
20 |
21 | /**
22 | * 设置选中设备
23 | */
24 | void setSelectedDevice(IDevice selectedDevice);
25 |
26 | /**
27 | * 取消选中设备
28 | */
29 | void cleanSelectedDevice();
30 |
31 | /**
32 | * 监听投屏端 AVTransport 回调
33 | * @param context 用于接收到消息发广播
34 | */
35 | void registerAVTransport(Context context);
36 |
37 | /**
38 | * 监听投屏端 RenderingControl 回调
39 | * @param context 用于接收到消息发广播
40 | */
41 | void registerRenderingControl(Context context);
42 |
43 | /**
44 | * 销毁
45 | */
46 | void destroy();
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/service/manager/IUpnpServiceManager.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.service.manager;
2 |
3 | import java.util.Collection;
4 |
5 | import my.project.silisili.cling.entity.IControlPoint;
6 | import my.project.silisili.cling.entity.IDevice;
7 |
8 | /**
9 | * 说明:
10 | * 作者:zhouzhan
11 | * 日期:17/6/27 17:41
12 | */
13 |
14 | public interface IUpnpServiceManager {
15 |
16 | /**
17 | * 搜索所有的设备
18 | */
19 | void searchDevices();
20 |
21 | /**
22 | * 获取支持 Media 类型的设备
23 | *
24 | * @return 设备列表
25 | */
26 | Collection extends IDevice> getDmrDevices();
27 |
28 | /**
29 | * 获取控制点
30 | *
31 | * @return 控制点
32 | */
33 | IControlPoint getControlPoint();
34 |
35 | /**
36 | * 获取选中的设备
37 | *
38 | * @return 选中的设备
39 | */
40 | IDevice getSelectedDevice();
41 |
42 | /**
43 | * 设置选中的设备
44 | * @param device 已选中设备
45 | */
46 | void setSelectedDevice(IDevice device);
47 |
48 | /**
49 | * 销毁
50 | */
51 | void destroy();
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/util/ClingUtils.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.util;
2 |
3 | import androidx.annotation.Nullable;
4 |
5 | import org.fourthline.cling.controlpoint.ControlPoint;
6 | import org.fourthline.cling.model.meta.Device;
7 | import org.fourthline.cling.model.meta.Service;
8 | import org.fourthline.cling.model.types.ServiceType;
9 |
10 | import my.project.silisili.cling.entity.IControlPoint;
11 | import my.project.silisili.cling.entity.IDevice;
12 | import my.project.silisili.cling.service.manager.ClingManager;
13 |
14 | /**
15 | * 说明:Cling 库使用工具类
16 | * 作者:zhouzhan
17 | * 日期:17/7/4 10:27
18 | */
19 |
20 | public class ClingUtils {
21 |
22 |
23 | /**
24 | * 通过 ServiceType 获取已选择设备的服务
25 | *
26 | * @param serviceType 服务类型
27 | * @return 服务
28 | */
29 | @Nullable
30 | public static Service findServiceFromSelectedDevice(ServiceType serviceType) {
31 | IDevice selectedDevice = ClingManager.getInstance().getSelectedDevice();
32 | if (OtherUtils.isNull(selectedDevice)) {
33 | return null;
34 | }
35 |
36 | Device device = (Device) selectedDevice.getDevice();
37 | return device.findService(serviceType);
38 | }
39 |
40 | /**
41 | * 获取 device 的 avt 服务
42 | *
43 | * @param device 设备
44 | * @return 服务
45 | */
46 | @Nullable
47 | public static Service findAVTServiceByDevice(Device device) {
48 | return device.findService(ClingManager.AV_TRANSPORT_SERVICE);
49 | }
50 |
51 | /**
52 | * 获取控制点
53 | *
54 | * @return 控制点
55 | */
56 | @Nullable
57 | public static ControlPoint getControlPoint() {
58 | IControlPoint controlPoint = ClingManager.getInstance().getControlPoint();
59 | if (OtherUtils.isNull(controlPoint)) {
60 | return null;
61 | }
62 |
63 | return (ControlPoint) controlPoint.getControlPoint();
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/util/ListUtils.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.util;
2 |
3 | import java.util.Collection;
4 |
5 | /**
6 | * 说明:
7 | * 作者:zhouzhan
8 | * 日期:17/6/28 16:54
9 | */
10 |
11 | public class ListUtils {
12 |
13 | public static boolean isEmpty(Collection list){
14 | return !(list != null && list.size() != 0);
15 | }
16 |
17 | }
18 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/cling/util/OtherUtils.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.cling.util;
2 |
3 | import java.util.Formatter;
4 | import java.util.Locale;
5 |
6 | /**
7 | * 说明:
8 | * 作者:zhouzhan
9 | * 日期:17/6/29 10:47
10 | */
11 |
12 | public class OtherUtils {
13 |
14 | public static boolean isNull(Object obj) {
15 | return obj == null;
16 | }
17 |
18 | public static boolean isNotNull(Object obj) {
19 | return !isNull(obj);
20 | }
21 |
22 | /**
23 | * 把时间戳转换成 00:00:00 格式
24 | * @param timeMs 时间戳
25 | * @return 00:00:00 时间格式
26 | */
27 | public static String getStringTime(int timeMs) {
28 | StringBuilder formatBuilder = new StringBuilder();
29 | Formatter formatter = new Formatter(formatBuilder, Locale.getDefault());
30 |
31 | int totalSeconds = timeMs / 1000;
32 | int seconds = totalSeconds % 60;
33 | int minutes = (totalSeconds / 60) % 60;
34 | int hours = totalSeconds / 3600;
35 |
36 | formatBuilder.setLength(0);
37 | return formatter.format("%02d:%02d:%02d", hours, minutes, seconds).toString();
38 | }
39 |
40 | /**
41 | * 把 00:00:00 格式转成时间戳
42 | * @param formatTime 00:00:00 时间格式
43 | * @return 时间戳(毫秒)
44 | */
45 | public static int getIntTime(String formatTime) {
46 | if (isNull(formatTime)) {
47 | return 0;
48 | }
49 |
50 | String[] tmp = formatTime.split(":");
51 | if (tmp.length < 3) {
52 | return 0;
53 | }
54 | int second = Integer.valueOf(tmp[0]) * 3600 + Integer.valueOf(tmp[1]) * 60 + Integer.valueOf(tmp[2]);
55 |
56 | return second * 1000;
57 | }
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/config/AnimeType.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.config;
2 |
3 | public class AnimeType {
4 | //tile
5 | public final static int TYPE_LEVEL_0 = 0;
6 | //按钮
7 | public final static int TYPE_LEVEL_1 = 1;
8 | //推荐
9 | public final static int TYPE_LEVEL_2 = 2;
10 | //番剧相关
11 | public final static int TYPE_LEVEL_3 = 3;
12 | }
13 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/config/RecommendType.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.config;
2 |
3 | public class RecommendType {
4 | public final static int TYPE_LEVEL_0 = 0;
5 | public final static int TYPE_LEVEL_1 = 1;
6 | }
7 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/custom/CustomLoadMoreView.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.custom;
2 |
3 | import com.chad.library.adapter.base.loadmore.LoadMoreView;
4 |
5 | import my.project.silisili.R;
6 |
7 | public class CustomLoadMoreView extends LoadMoreView {
8 | @Override
9 | public int getLayoutId() {
10 | return R.layout.custom_load_more_view;
11 | }
12 |
13 | @Override
14 | protected int getLoadingViewId() {
15 | return R.id.load_more_loading_view;
16 | }
17 |
18 | @Override
19 | protected int getLoadFailViewId() {
20 | return R.id.load_more_load_fail_view;
21 | }
22 |
23 | @Override
24 | protected int getLoadEndViewId() { return R.id.load_more_load_end_view; }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/custom/InsideScrollView.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.custom;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.widget.ScrollView;
7 |
8 | import androidx.annotation.NonNull;
9 | import androidx.annotation.Nullable;
10 |
11 | public class InsideScrollView extends ScrollView {
12 | public InsideScrollView(@NonNull Context context) {
13 | super(context);
14 | }
15 |
16 | public InsideScrollView(@NonNull Context context, @Nullable AttributeSet attrs) {
17 | super(context, attrs);
18 | }
19 |
20 | public InsideScrollView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
21 | super(context, attrs, defStyleAttr);
22 | }
23 |
24 | @Override
25 | public boolean onInterceptTouchEvent(MotionEvent ev) {
26 | //关键点在这
27 | getParent().requestDisallowInterceptTouchEvent(true);
28 | return super.onInterceptTouchEvent(ev);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/custom/MySwipeRefreshLayout.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.custom;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.view.ViewConfiguration;
7 |
8 | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
9 |
10 | public class MySwipeRefreshLayout extends SwipeRefreshLayout {
11 | private float startX;
12 | private float startY;
13 | private float mTouchSlop;
14 |
15 | public MySwipeRefreshLayout(Context context) {
16 | super(context);
17 |
18 | mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
19 | }
20 |
21 | public MySwipeRefreshLayout(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 |
24 | mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
25 | }
26 |
27 | @Override
28 | public boolean onInterceptTouchEvent(MotionEvent ev) {
29 |
30 | switch (ev.getAction()){
31 | case MotionEvent.ACTION_DOWN:
32 | startX = ev.getX();
33 | startY = ev.getY();
34 | break;
35 | case MotionEvent.ACTION_MOVE:
36 | float distanceX = Math.abs(ev.getX() - startX);
37 | float distanceY = Math.abs(ev.getY() - startY);
38 | if(distanceX > mTouchSlop && distanceX > distanceY){ //判断为横向滑动
39 | return false;
40 | }
41 |
42 | break;
43 | }
44 |
45 | return super.onInterceptTouchEvent(ev);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/custom/MyTextView.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.custom;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 |
6 | import androidx.annotation.Nullable;
7 | import androidx.appcompat.widget.AppCompatTextView;
8 |
9 | public class MyTextView extends AppCompatTextView {
10 | public MyTextView(Context context) {
11 | super(context);
12 | }
13 |
14 | public MyTextView(Context context, @Nullable AttributeSet attrs) {
15 | super(context, attrs);
16 | }
17 |
18 | public MyTextView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
19 | super(context, attrs, defStyleAttr);
20 | }
21 |
22 | @Override
23 | public boolean isFocused() {
24 | return true;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/custom/VpSwipeRefreshLayout.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.custom;
2 |
3 | import android.content.Context;
4 | import android.util.AttributeSet;
5 | import android.view.MotionEvent;
6 | import android.view.ViewConfiguration;
7 |
8 | import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
9 |
10 | public class VpSwipeRefreshLayout extends SwipeRefreshLayout {
11 |
12 | private float startY;
13 | private float startX;
14 | // 记录viewPager是否拖拽的标记
15 | private boolean mIsVpDragger;
16 | private final int mTouchSlop;
17 |
18 | public VpSwipeRefreshLayout(Context context, AttributeSet attrs) {
19 | super(context, attrs);
20 | mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
21 | }
22 |
23 | @Override
24 | public boolean onInterceptTouchEvent(MotionEvent ev) {
25 | int action = ev.getAction();
26 | switch (action) {
27 | case MotionEvent.ACTION_DOWN:
28 | // 记录手指按下的位置
29 | startY = ev.getY();
30 | startX = ev.getX();
31 | // 初始化标记
32 | mIsVpDragger = false;
33 | break;
34 | case MotionEvent.ACTION_MOVE:
35 | // 如果viewpager正在拖拽中,那么不拦截它的事件,直接return false;
36 | if(mIsVpDragger) {
37 | return false;
38 | }
39 |
40 | // 获取当前手指位置
41 | float endY = ev.getY();
42 | float endX = ev.getX();
43 | float distanceX = Math.abs(endX - startX);
44 | float distanceY = Math.abs(endY - startY);
45 | // 如果X轴位移大于Y轴位移,那么将事件交给viewPager处理。
46 | if(distanceX > mTouchSlop && distanceX > distanceY) {
47 | mIsVpDragger = true;
48 | return false;
49 | }
50 | break;
51 | case MotionEvent.ACTION_UP:
52 | case MotionEvent.ACTION_CANCEL:
53 | // 初始化标记
54 | mIsVpDragger = false;
55 | break;
56 | }
57 | // 如果是Y轴位移大于X轴,事件交给swipeRefreshLayout处理。
58 | return super.onInterceptTouchEvent(ev);
59 | }
60 | }
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/animelist/AnimeListContract.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.animelist;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.bean.AnimeDescHeaderBean;
6 | import my.project.silisili.main.base.BaseLoadDataCallback;
7 | import my.project.silisili.main.base.BaseView;
8 |
9 | public interface AnimeListContract {
10 | interface Model{
11 | void getData( String url, int page, boolean isMain, LoadDataCallback callback);
12 | }
13 |
14 | interface View extends BaseView {
15 | void showSuccessView(boolean isMain, List list);
16 |
17 | void showErrorView(boolean isMain, String msg);
18 |
19 | void getPageCountSuccessView(int count);
20 | }
21 |
22 | interface LoadDataCallback extends BaseLoadDataCallback {
23 | void success(boolean isMain, List list);
24 |
25 | void error(boolean isMain, String msg);
26 |
27 | void pageCount(int count);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/animelist/AnimeListPresenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.animelist;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.bean.AnimeDescHeaderBean;
6 | import my.project.silisili.main.base.BasePresenter;
7 | import my.project.silisili.main.base.Presenter;
8 |
9 | public class AnimeListPresenter extends Presenter implements BasePresenter,AnimeListContract.LoadDataCallback {
10 | private String url;
11 | private int page;
12 | private AnimeListContract.View view;
13 | private AnimeListModel model;
14 |
15 | public AnimeListPresenter(String url, int page, AnimeListContract.View view){
16 | super(view);
17 | this.url = url;
18 | this.view = view;
19 | this.page = page;
20 | model = new AnimeListModel();
21 | }
22 |
23 | @Override
24 | public void loadData(boolean isMain) {
25 | if (isMain)
26 | view.showLoadingView();
27 | view.showEmptyVIew();
28 | model.getData(url, page, isMain,this);
29 | }
30 |
31 | @Override
32 | public void success(boolean isMain, List list) {
33 | view.showSuccessView(isMain, list);
34 | }
35 |
36 | @Override
37 | public void error(boolean isMain, String msg) {
38 | view.showErrorView(isMain, msg);
39 | }
40 |
41 | @Override
42 | public void pageCount(int count) {
43 | view.getPageCountSuccessView(count);
44 | }
45 |
46 | @Override
47 | public void error(String msg) {
48 | view.showLoadErrorView(msg);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/base/BaseLoadDataCallback.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.base;
2 |
3 | public interface BaseLoadDataCallback {
4 | void error(String msg);
5 | }
6 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/base/BasePresenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.base;
2 |
3 | public interface BasePresenter {
4 | void loadData(boolean isMain);
5 | }
6 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/base/BaseView.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.base;
2 |
3 | public interface BaseView {
4 | //显示加载中视图
5 | void showLoadingView();
6 | //显示加载失败视图
7 | void showLoadErrorView(String msg);
8 | //空布局
9 | void showEmptyVIew();
10 | }
11 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/base/LazyFragment.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.base;
2 |
3 | import android.os.Bundle;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 |
8 | import androidx.fragment.app.Fragment;
9 |
10 | public abstract class LazyFragment extends Fragment {
11 | private boolean isFragmentVisible;
12 |
13 | private boolean isPrepared;
14 |
15 | private boolean isFirstLoad = true;
16 |
17 | private boolean forceLoad = false;
18 |
19 | @Override
20 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
21 | isFirstLoad = true;
22 | View view = initViews(inflater, container, savedInstanceState);
23 | isPrepared = true;
24 | lazyLoad();
25 | return view;
26 | }
27 |
28 | @Override
29 | public void setUserVisibleHint(boolean isVisibleToUser) {
30 | super.setUserVisibleHint(isVisibleToUser);
31 | if (getUserVisibleHint()) {
32 | onVisible();
33 | } else {
34 | onInvisible();
35 | }
36 | }
37 |
38 | @Override
39 | public void onHiddenChanged(boolean hidden) {
40 | super.onHiddenChanged(hidden);
41 | if (!hidden) {
42 | onVisible();
43 | } else {
44 | onInvisible();
45 | }
46 | }
47 |
48 | protected void onVisible() {
49 | isFragmentVisible = true;
50 | lazyLoad();
51 | }
52 |
53 | protected void onInvisible() {
54 | isFragmentVisible = false;
55 | }
56 |
57 | protected void lazyLoad() {
58 | if (isPrepared() && isFragmentVisible()) {
59 | if (forceLoad || isFirstLoad()) {
60 | forceLoad = false;
61 | isFirstLoad = false;
62 | initData();
63 | }
64 | }
65 | }
66 |
67 | @Override
68 | public void onDestroyView() {
69 | super.onDestroyView();
70 | isPrepared = false;
71 | }
72 |
73 | protected abstract View initViews(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState);
74 |
75 | protected abstract void initData();
76 |
77 | public boolean isPrepared() {
78 | return isPrepared;
79 | }
80 |
81 |
82 | public boolean isFirstLoad() {
83 | return isFirstLoad;
84 | }
85 |
86 | public boolean isFragmentVisible() {
87 | return isFragmentVisible;
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/base/Presenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.base;
2 |
3 | import java.lang.ref.WeakReference;
4 |
5 | public class Presenter {
6 | //View的弱引用
7 | protected WeakReference mViewRef;
8 |
9 | /**
10 | * 构造函数
11 | *
12 | * @param view 需要关联的View
13 | */
14 | public Presenter(V view) {
15 | //关联View
16 | attachView(view);
17 | }
18 |
19 | /**
20 | * 关联View
21 | *
22 | * @param view 需要关联的View
23 | */
24 | public void attachView(V view) {
25 | mViewRef = new WeakReference<>(view);
26 | }
27 |
28 | /**
29 | * 取消关联的View
30 | */
31 | public void detachView() {
32 | if (null != mViewRef) {
33 | mViewRef.clear();
34 | }
35 | }
36 |
37 | /**
38 | * 获取将当前关联的View
39 | *
40 | * @return 当前关联的View
41 | */
42 | public V getView() {
43 | if (null != mViewRef) {
44 | return mViewRef.get();
45 | }
46 | return null;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/desc/DescContract.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.desc;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.bean.AnimeDescBean;
6 | import my.project.silisili.bean.AnimeDescHeaderBean;
7 | import my.project.silisili.bean.DownBean;
8 | import my.project.silisili.main.base.BaseLoadDataCallback;
9 | import my.project.silisili.main.base.BaseView;
10 |
11 | public interface DescContract {
12 | interface Model {
13 | void getData(String url, LoadDataCallback callback);
14 | }
15 |
16 | interface View extends BaseView {
17 | void showSuccessMainView(AnimeDescBean bean);
18 | void showSuccessDescView(AnimeDescHeaderBean bean);
19 | void showSuccessFavorite(boolean favorite);
20 | void showDownView(List list);
21 | }
22 |
23 | interface LoadDataCallback extends BaseLoadDataCallback {
24 | void successMain(AnimeDescBean bean);
25 | void successDesc(AnimeDescHeaderBean bean);
26 | void isFavorite(boolean favorite);
27 | void hasDown(List list);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/desc/DescPresenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.desc;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.bean.AnimeDescBean;
6 | import my.project.silisili.bean.AnimeDescHeaderBean;
7 | import my.project.silisili.bean.DownBean;
8 | import my.project.silisili.main.base.BasePresenter;
9 | import my.project.silisili.main.base.Presenter;
10 |
11 | public class DescPresenter extends Presenter implements BasePresenter,DescContract.LoadDataCallback {
12 | private String url;
13 | private DescContract.View view;
14 | private DescModel model;
15 |
16 | public DescPresenter(String url,DescContract.View view){
17 | super(view);
18 | this.url = url;
19 | this.view = view;
20 | model = new DescModel();
21 | }
22 |
23 | @Override
24 | public void loadData(boolean isMain) {
25 | if (isMain)
26 | view.showLoadingView();
27 | model.getData(url, this);
28 | }
29 |
30 | @Override
31 | public void successMain(AnimeDescBean bean) {
32 | view.showSuccessMainView(bean);
33 | }
34 |
35 | @Override
36 | public void successDesc(AnimeDescHeaderBean bean) {
37 | view.showSuccessDescView(bean);
38 | }
39 |
40 | @Override
41 | public void isFavorite(boolean favorite) {
42 | view.showSuccessFavorite(favorite);
43 | }
44 |
45 | @Override
46 | public void hasDown(List list) {
47 | view.showDownView(list);
48 | }
49 |
50 | @Override
51 | public void error(String msg) {
52 | view.showLoadErrorView(msg);
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/favorite/FavoriteContract.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.favorite;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.bean.AnimeDescHeaderBean;
6 | import my.project.silisili.main.base.BaseLoadDataCallback;
7 | import my.project.silisili.main.base.BaseView;
8 |
9 | public interface FavoriteContract {
10 | interface Model{
11 | void getData(int offset, int limit, LoadDataCallback callback);
12 | }
13 |
14 | interface View extends BaseView {
15 | void showSuccessView(List list);
16 | }
17 |
18 | interface LoadDataCallback extends BaseLoadDataCallback {
19 | void success(List list);
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/favorite/FavoriteModel.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.favorite;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.R;
6 | import my.project.silisili.bean.AnimeDescHeaderBean;
7 | import my.project.silisili.database.DatabaseUtil;
8 | import my.project.silisili.util.Utils;
9 |
10 | public class FavoriteModel implements FavoriteContract.Model{
11 |
12 | @Override
13 | public void getData(int offset, int limit, FavoriteContract.LoadDataCallback callback) {
14 | List list = DatabaseUtil.queryFavoriteByLimit(offset, limit);
15 | if (list.size() > 0)
16 | callback.success(list);
17 | else
18 | callback.error(Utils.getString(R.string.empty_favorite));
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/favorite/FavoritePresenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.favorite;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.bean.AnimeDescHeaderBean;
6 | import my.project.silisili.main.base.BasePresenter;
7 | import my.project.silisili.main.base.Presenter;
8 |
9 | public class FavoritePresenter extends Presenter implements BasePresenter,FavoriteContract.LoadDataCallback {
10 | private FavoriteContract.View view;
11 | private FavoriteModel model;
12 | private int offset;
13 | private int limit;
14 |
15 | public FavoritePresenter(int offset, int limit, FavoriteContract.View view){
16 | super(view);
17 | this.view = view;
18 | this.offset = offset;
19 | this.limit = limit;
20 | model = new FavoriteModel();
21 | }
22 |
23 | @Override
24 | public void loadData(boolean isMain) {
25 | if (isMain){
26 | view.showLoadingView();
27 | view.showEmptyVIew();
28 | }
29 | model.getData(offset, limit, this);
30 | }
31 |
32 | @Override
33 | public void success(List list) {
34 | view.showSuccessView(list);
35 | }
36 |
37 | @Override
38 | public void error(String msg) {
39 | view.showLoadErrorView(msg);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/home/HomeContract.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.home;
2 |
3 | import java.util.LinkedHashMap;
4 |
5 | import my.project.silisili.main.base.BaseLoadDataCallback;
6 | import my.project.silisili.main.base.BaseView;
7 |
8 | public interface HomeContract {
9 | interface Model{
10 | void getData(LoadDataCallback callback);
11 | }
12 |
13 | interface View extends BaseView {
14 | void showLoadSuccess(LinkedHashMap map);
15 | }
16 |
17 | interface LoadDataCallback extends BaseLoadDataCallback {
18 | void success(LinkedHashMap map);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/home/HomePresenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.home;
2 |
3 | import java.util.LinkedHashMap;
4 |
5 | import my.project.silisili.main.base.BasePresenter;
6 | import my.project.silisili.main.base.Presenter;
7 |
8 | public class HomePresenter extends Presenter implements BasePresenter,HomeContract.LoadDataCallback {
9 | private HomeContract.View view;
10 | private HomeModel model;
11 |
12 | public HomePresenter(HomeContract.View view){
13 | super(view);
14 | this.view = view;
15 | model = new HomeModel();
16 | }
17 |
18 | @Override
19 | public void loadData(boolean isMain) {
20 | if (isMain)
21 | view.showLoadingView();
22 | model.getData(this);
23 | }
24 |
25 | @Override
26 | public void success(LinkedHashMap map) {
27 | view.showLoadSuccess(map);
28 | }
29 |
30 | @Override
31 | public void error(String msg) {
32 | view.showLoadErrorView(msg);
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/search/SearchContract.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.search;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.bean.AnimeDescHeaderBean;
6 | import my.project.silisili.main.base.BaseLoadDataCallback;
7 | import my.project.silisili.main.base.BaseView;
8 |
9 | public interface SearchContract {
10 | interface Model{
11 | void getData(String title, String searchUrl, int page, boolean isMain, LoadDataCallback callback);
12 | }
13 |
14 | interface View extends BaseView {
15 | void showSuccessView(boolean isMain, List list);
16 | void showErrorView(boolean isMain, String msg);
17 | void getPageCount(int pageCount);
18 | void getSearchID(String searchID);
19 | }
20 |
21 | interface LoadDataCallback extends BaseLoadDataCallback {
22 | void success(boolean isMain, List list);
23 | void error(boolean isMain, String msg);
24 | void pageCount(int pageCount);
25 | void searchID(String searchID);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/search/SearchPresenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.search;
2 |
3 | import java.util.List;
4 |
5 | import my.project.silisili.bean.AnimeDescHeaderBean;
6 | import my.project.silisili.main.base.BasePresenter;
7 | import my.project.silisili.main.base.Presenter;
8 |
9 | public class SearchPresenter extends Presenter implements BasePresenter,SearchContract.LoadDataCallback {
10 | private String title;
11 | private String searchID;
12 | private int page;
13 | private SearchContract.View view;
14 | private SearchModel model;
15 |
16 | public SearchPresenter(String title, String searchID, int page, SearchContract.View view){
17 | super(view);
18 | this.title = title;
19 | this.searchID = searchID;
20 | this.page = page;
21 | this.view = view;
22 | model = new SearchModel();
23 | }
24 |
25 | @Override
26 | public void loadData(boolean isMain) {
27 | if (isMain)
28 | {
29 | view.showLoadingView();
30 | view.showEmptyVIew();
31 | }
32 | model.getData(title, searchID, page, isMain, this);
33 | }
34 |
35 | @Override
36 | public void success(boolean isMain, List list) {
37 | view.showSuccessView(isMain, list);
38 | }
39 |
40 | @Override
41 | public void error(boolean isMain, String msg) {
42 | view.showErrorView(isMain, msg);
43 | }
44 |
45 | @Override
46 | public void pageCount(int pageCount) {
47 | view.getPageCount(pageCount);
48 | }
49 |
50 | @Override
51 | public void searchID(String searchID) {
52 | view.getSearchID(searchID);
53 | }
54 |
55 | @Override
56 | public void error(String msg) {
57 |
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/tag/TagContract.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.tag;
2 |
3 | import com.chad.library.adapter.base.entity.MultiItemEntity;
4 |
5 | import java.util.List;
6 |
7 | import my.project.silisili.main.base.BaseLoadDataCallback;
8 | import my.project.silisili.main.base.BaseView;
9 |
10 | public interface TagContract {
11 | interface Model{
12 | void getData(LoadDataCallback callback);
13 | }
14 |
15 | interface View extends BaseView {
16 | void showSuccessView(List list);
17 | }
18 |
19 | interface LoadDataCallback extends BaseLoadDataCallback {
20 | void success(List list);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/tag/TagPresenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.tag;
2 |
3 | import com.chad.library.adapter.base.entity.MultiItemEntity;
4 |
5 | import java.util.List;
6 |
7 | import my.project.silisili.main.base.BasePresenter;
8 | import my.project.silisili.main.base.Presenter;
9 |
10 | public class TagPresenter extends Presenter implements BasePresenter,TagContract.LoadDataCallback {
11 | private TagContract.View view;
12 | private TagModel model;
13 |
14 | public TagPresenter(TagContract.View view){
15 | super(view);
16 | this.view = view;
17 | model = new TagModel();
18 | }
19 |
20 | @Override
21 | public void loadData(boolean isMain) {
22 | if (isMain){
23 | view.showLoadingView();
24 | view.showEmptyVIew();
25 | }
26 | model.getData(this);
27 | }
28 |
29 | @Override
30 | public void success(List list) {
31 | view.showSuccessView(list);
32 | }
33 |
34 | @Override
35 | public void error(String msg) {
36 | view.showLoadErrorView(msg);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/video/VideoContract.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.video;
2 |
3 | import my.project.silisili.main.base.BaseLoadDataCallback;
4 |
5 | public interface VideoContract {
6 | interface Model{
7 | void getData(String title, String url, LoadDataCallback callback);
8 | }
9 |
10 | interface View {
11 | void cancelDialog();
12 | void getVideoSuccess(String url);
13 | void getIframeUrl(String iframeUrl);
14 | void getVideoEmpty();
15 | void getVideoError();
16 | }
17 |
18 | interface LoadDataCallback extends BaseLoadDataCallback {
19 | void success(String url);
20 | void sendIframeUrl(String iframeUrl);
21 | void error();
22 | void empty();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/video/VideoPresenter.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.video;
2 |
3 | import my.project.silisili.main.base.BasePresenter;
4 | import my.project.silisili.main.base.Presenter;
5 |
6 | public class VideoPresenter extends Presenter implements BasePresenter,VideoContract.LoadDataCallback {
7 | private VideoContract.View view;
8 | private VideoModel playModel;
9 | private String title;
10 | private String url;
11 |
12 | public VideoPresenter(String title, String url, VideoContract.View view){
13 | super(view);
14 | this.title = title;
15 | this.url = url;
16 | this.view = view;
17 | playModel = new VideoModel();
18 | }
19 |
20 | @Override
21 | public void loadData(boolean isMain) {
22 | playModel.getData(title, url, this);
23 | }
24 |
25 | @Override
26 | public void success(String url) {
27 | view.getVideoSuccess(url);
28 | }
29 |
30 | @Override
31 | public void sendIframeUrl(String iframeUrl) {
32 | view.getIframeUrl(iframeUrl);
33 | }
34 |
35 | @Override
36 | public void error() {
37 | view.cancelDialog();
38 | view.getVideoError();
39 | }
40 |
41 | @Override
42 | public void empty() {
43 | // view.cancelDialog();
44 | view.getVideoEmpty();
45 | }
46 |
47 | @Override
48 | public void error(String msg) {
49 |
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/webview/normal/NormalWebView.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.webview.normal;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.util.AttributeSet;
6 | import android.webkit.WebSettings;
7 | import android.webkit.WebView;
8 | import android.webkit.WebViewClient;
9 |
10 |
11 | public class NormalWebView extends WebView {
12 | public final static String PC_USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36";
13 | public final static String PHONE_USER_AGENT = "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6010 Build/PKQ1.180716.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.158 Mobile Safari/537.36";
14 | private WebViewClient client = new WebViewClient() {
15 | // 防止加载网页时调起系统浏览器
16 | public boolean shouldOverrideUrlLoading(WebView view, String url) {
17 | view.loadUrl(url);
18 | return true;
19 | }
20 | };
21 |
22 | public NormalWebView(Context arg0) {
23 | super(arg0);
24 | setBackgroundColor(85621);
25 | }
26 | @SuppressLint("SetJavaScriptEnabled")
27 | public NormalWebView(Context arg0, AttributeSet arg1) {
28 | super(arg0, arg1);
29 | this.setWebViewClient(client);
30 | // this.setWebChromeClient(chromeClient);
31 | // WebStorage webStorage = WebStorage.getInstance();
32 | initWebViewSettings();
33 | this.setClickable(true);
34 | }
35 |
36 | private void initWebViewSettings() {
37 | WebSettings webSetting = this.getSettings();
38 | webSetting.setJavaScriptEnabled(true);
39 | webSetting.setJavaScriptCanOpenWindowsAutomatically(true);
40 | webSetting.setAllowFileAccess(false);
41 | webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
42 | webSetting.setSupportZoom(false);
43 | webSetting.setBuiltInZoomControls(false);
44 | webSetting.setUseWideViewPort(true);
45 | webSetting.setSupportMultipleWindows(true);
46 | // webSetting.setLoadWithOverviewMode(true);
47 | webSetting.setAppCacheEnabled(true);
48 | //是否调节内容 是否全屏
49 | webSetting.setLoadWithOverviewMode(true);
50 | // webSetting.setDatabaseEnabled(true);
51 | webSetting.setDomStorageEnabled(true);
52 | webSetting.setGeolocationEnabled(false);
53 | webSetting.setAppCacheMaxSize(Long.MAX_VALUE);
54 | // webSetting.setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY);
55 | webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND);
56 | // webSetting.setRenderPriority(WebSettings.RenderPriority.HIGH);
57 | webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE);
58 | webSetting.setUserAgentString(PC_USER_AGENT);
59 | }
60 |
61 | }
62 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/main/webview/x5/X5WebView.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.main.webview.x5;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.util.AttributeSet;
6 |
7 | import com.tencent.smtt.sdk.WebSettings;
8 | import com.tencent.smtt.sdk.WebView;
9 | import com.tencent.smtt.sdk.WebViewClient;
10 |
11 | public class X5WebView extends WebView {
12 | public final static String PC_USER_AGENT = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36";
13 | public final static String PHONE_USER_AGENT = "Mozilla/5.0 (Linux; Android 9; ONEPLUS A6010 Build/PKQ1.180716.001; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/66.0.3359.158 Mobile Safari/537.36";
14 | private WebViewClient client = new WebViewClient() {
15 | // 防止加载网页时调起系统浏览器
16 | public boolean shouldOverrideUrlLoading(WebView view, String url) {
17 | view.loadUrl(url);
18 | return true;
19 | }
20 | };
21 |
22 | public X5WebView(Context arg0) {
23 | super(arg0);
24 | setBackgroundColor(85621);
25 | }
26 |
27 | @SuppressLint("SetJavaScriptEnabled")
28 | public X5WebView(Context arg0, AttributeSet arg1) {
29 | super(arg0, arg1);
30 |
31 | this.setWebViewClient(client);
32 | // this.setWebChromeClient(chromeClient);
33 | // WebStorage webStorage = WebStorage.getInstance();
34 | initWebViewSettings();
35 | this.getView().setClickable(true);
36 | }
37 |
38 | private void initWebViewSettings() {
39 | WebSettings webSetting = this.getSettings();
40 | webSetting.setJavaScriptEnabled(true);
41 | webSetting.setJavaScriptCanOpenWindowsAutomatically(true);
42 | webSetting.setAllowFileAccess(false);
43 | webSetting.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
44 | webSetting.setSupportZoom(false);
45 | webSetting.setBuiltInZoomControls(false);
46 | webSetting.setUseWideViewPort(true);
47 | webSetting.setSupportMultipleWindows(true);
48 | // webSetting.setLoadWithOverviewMode(true);
49 | webSetting.setAppCacheEnabled(true);
50 | //是否调节内容 是否全屏
51 | webSetting.setLoadWithOverviewMode(true);
52 | // webSetting.setDatabaseEnabled(true);
53 | webSetting.setDomStorageEnabled(true);
54 | webSetting.setGeolocationEnabled(false);
55 | webSetting.setAppCacheMaxSize(Long.MAX_VALUE);
56 | // webSetting.setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY);
57 | webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND);
58 | // webSetting.setRenderPriority(WebSettings.RenderPriority.HIGH);
59 | webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE);
60 | webSetting.setUserAgent(PC_USER_AGENT);
61 | }
62 |
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/net/HttpGet.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.net;
2 |
3 | import java.util.concurrent.TimeUnit;
4 |
5 | import okhttp3.Call;
6 | import okhttp3.Callback;
7 | import okhttp3.OkHttpClient;
8 | import okhttp3.Request;
9 |
10 | public class HttpGet {
11 | private final static int connectTimeout = 10;
12 | private final static int readTimeout = 20;
13 |
14 | public HttpGet(String url, Callback callback) {
15 | OkHttpClient client = new OkHttpClient.Builder()
16 | .connectTimeout(connectTimeout, TimeUnit.SECONDS)
17 | .readTimeout(readTimeout, TimeUnit.SECONDS)
18 | .build();
19 | Request request = new Request.Builder()
20 | .url(url)
21 | .get()
22 | .build();
23 | Call call = client.newCall(request);
24 | call.enqueue(callback);
25 | }
26 |
27 | public HttpGet(String url, String host, Callback callback) {
28 | OkHttpClient client = new OkHttpClient.Builder()
29 | .connectTimeout(connectTimeout, TimeUnit.SECONDS)
30 | .readTimeout(readTimeout, TimeUnit.SECONDS)
31 | .build();
32 | Request request = new Request.Builder()
33 | .url(url)
34 | .addHeader("Host", host)
35 | .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36")
36 | .get()
37 | .build();
38 | Call call = client.newCall(request);
39 | call.enqueue(callback);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/net/HttpPost.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.net;
2 |
3 | import java.util.concurrent.TimeUnit;
4 |
5 | import okhttp3.Call;
6 | import okhttp3.Callback;
7 | import okhttp3.FormBody;
8 | import okhttp3.MediaType;
9 | import okhttp3.OkHttpClient;
10 | import okhttp3.Request;
11 | import okhttp3.RequestBody;
12 |
13 | public class HttpPost {
14 | private final static int connectTimeout = 10;
15 | private final static int readTimeout = 20;
16 |
17 | public HttpPost(String url, FormBody body, Callback callback) {
18 | OkHttpClient client = new OkHttpClient.Builder().connectTimeout(connectTimeout, TimeUnit.SECONDS).readTimeout(readTimeout, TimeUnit.SECONDS).build();
19 | Request request = new Request.Builder()
20 | .url(url)
21 | .post(body)
22 | .build();
23 | Call call = client.newCall(request);
24 | call.enqueue(callback);
25 | }
26 |
27 | public HttpPost(String url, String paramsStr, Callback callback) {
28 | OkHttpClient client = new OkHttpClient.Builder().connectTimeout(connectTimeout, TimeUnit.SECONDS).readTimeout(readTimeout, TimeUnit.SECONDS).build();
29 | MediaType MEDIA_TYPE_NORAML_FORM = MediaType.parse("application/x-www-form-urlencoded;charset=utf-8");
30 | RequestBody requestBody = RequestBody.create(MEDIA_TYPE_NORAML_FORM, paramsStr);
31 | Request request = new Request.Builder()
32 | .url(url)
33 | .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36")
34 | .post(requestBody)
35 | .build();
36 | Call call = client.newCall(request);
37 | call.enqueue(callback);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/services/ClearVideoCacheService.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.services;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.IBinder;
6 |
7 | import androidx.annotation.Nullable;
8 |
9 | import java.io.File;
10 |
11 | import my.project.silisili.util.Utils;
12 |
13 | public class ClearVideoCacheService extends Service {
14 | @Nullable
15 | @Override
16 | public IBinder onBind(Intent intent) {
17 | return null;
18 | }
19 |
20 | @Override
21 | public void onCreate() {
22 | super.onCreate();
23 | }
24 |
25 | @Override
26 | public int onStartCommand(Intent intent, int flags, int startId) {
27 | new Thread(){
28 | @Override
29 | public void run() {
30 | Utils.deleteAllFiles(new File(android.os.Environment.getExternalStorageDirectory() + "/Android/data/my.project.silisili/cache"));
31 | Utils.deleteAllFiles(new File(android.os.Environment.getExternalStorageDirectory() + "/Android/data/my.project.silisili/files/VideoCache/main"));
32 | onDestroy();
33 | }
34 | }.start();
35 | return super.onStartCommand(intent, flags, startId);
36 | }
37 |
38 | @Override
39 | public void onDestroy() {
40 | super.onDestroy();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/my/project/silisili/util/SharedPreferencesUtils.java:
--------------------------------------------------------------------------------
1 | package my.project.silisili.util;
2 |
3 | import android.content.Context;
4 | import android.content.SharedPreferences;
5 |
6 | public class SharedPreferencesUtils {
7 | private static final String FILE_NAME = "DiliData";
8 |
9 | /**
10 | * 保存数据的方法,我们需要拿到保存数据的具体类型,然后根据类型调用不同的保存方法
11 | *
12 | * @param context
13 | * @param key
14 | * @param object
15 | */
16 | public static void setParam(Context context, String key, Object object) {
17 |
18 | String type = object.getClass().getSimpleName();
19 | SharedPreferences sp = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);
20 | SharedPreferences.Editor editor = sp.edit();
21 |
22 | if ("String".equals(type)) {
23 | editor.putString(key, (String) object);
24 | } else if ("Integer".equals(type)) {
25 | editor.putInt(key, (Integer) object);
26 | } else if ("Boolean".equals(type)) {
27 | editor.putBoolean(key, (Boolean) object);
28 | } else if ("Float".equals(type)) {
29 | editor.putFloat(key, (Float) object);
30 | } else if ("Long".equals(type)) {
31 | editor.putLong(key, (Long) object);
32 | }
33 |
34 | editor.commit();
35 | }
36 |
37 |
38 | /**
39 | * 得到保存数据的方法,我们根据默认值得到保存的数据的具体类型,然后调用相对于的方法获取值
40 | *
41 | * @param context
42 | * @param key
43 | * @param defaultObject
44 | * @return
45 | */
46 | public static Object getParam(Context context, String key, Object defaultObject) {
47 | String type = defaultObject.getClass().getSimpleName();
48 | SharedPreferences sp = context.getSharedPreferences(FILE_NAME, Context.MODE_PRIVATE);
49 |
50 | if ("String".equals(type)) {
51 | return sp.getString(key, (String) defaultObject);
52 | } else if ("Integer".equals(type)) {
53 | return sp.getInt(key, (Integer) defaultObject);
54 | } else if ("Boolean".equals(type)) {
55 | return sp.getBoolean(key, (Boolean) defaultObject);
56 | } else if ("Float".equals(type)) {
57 | return sp.getFloat(key, (Float) defaultObject);
58 | } else if ("Long".equals(type)) {
59 | return sp.getLong(key, (Long) defaultObject);
60 | }
61 | return null;
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/app/src/main/jniLibs/armeabi/libtbs.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/jniLibs/armeabi/libtbs.so
--------------------------------------------------------------------------------
/app/src/main/res/anim/activity_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/activity_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
13 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fab_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
9 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fab_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/fade_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/color/mtrl_btn_stroke_color_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/color/mtrl_navigation_item_background_color.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_adb_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_adb_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_airplay_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_airplay_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_all_inclusive_black_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_all_inclusive_black_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_all_inclusive_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_all_inclusive_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_arrow_back_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_arrow_back_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_bug_report_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_bug_report_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_clear_all_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_clear_all_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_close_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_close_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_cloud_download_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_cloud_download_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_code_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_code_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_dashboard_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_dashboard_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_down_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_down_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_error_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_error_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_explore_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_explore_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_fast_forward_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_fast_forward_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_fast_rewind_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_fast_rewind_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_favorite_border_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_favorite_border_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_favorite_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_favorite_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_filter_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_filter_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_first_page_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_first_page_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_insert_chart_outlined_black_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_insert_chart_outlined_black_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_insert_chart_outlined_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_insert_chart_outlined_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_keyboard_arrow_right_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_keyboard_arrow_right_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_language_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_language_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_last_page_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_last_page_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_open_in_new_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_open_in_new_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_pause_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_pause_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_phonelink_setup_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_phonelink_setup_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_picture_in_picture_alt_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_picture_in_picture_alt_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_play_arrow_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_play_arrow_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_play_circle_filled_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_play_circle_filled_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_play_disabled_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_play_disabled_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_replay_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_replay_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_search_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_search_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_star_border_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_star_border_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_star_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_star_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_style_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_style_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_view_selections_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_view_selections_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/baseline_visibility_black_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/baseline_visibility_black_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/default_bg.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/default_bg.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/error.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/error.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/github.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_action_dock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_action_dock.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_bubble_chart_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_bubble_chart_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_keyboard_arrow_down_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_keyboard_arrow_down_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_loyalty_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_loyalty_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_new_feature_pink_dot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_new_feature_pink_dot.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_ondemand_video_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_ondemand_video_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_settings_white_48dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_settings_white_48dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_shortcut_dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_shortcut_dashboard.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_shortcut_favorite.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_shortcut_favorite.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_shortcut_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/ic_shortcut_search.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/light_img.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/light_img.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/list_selector.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/list_selector.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/loading_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/loading_light.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/loading_night.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/loading_night.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/night_img.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/night_img.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/parsing_error_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/parsing_error_bg.9.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/player_btn_locking.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/player_btn_locking.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/player_btn_locking_pre.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/player_btn_locking_pre.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/start_img.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/drawable-xhdpi/start_img.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/change_drama_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/coll_toolbar_image_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
10 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/desc_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
10 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/pg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
4 |
5 |
6 |
11 |
12 |
13 | -
14 |
15 |
16 |
17 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/sniffer_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/text_view_new.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/week_item_gradient.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
10 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_anime.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
25 |
26 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_default_webview_normal.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
18 |
26 |
27 |
35 |
36 |
37 |
38 |
43 |
44 |
51 |
52 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_default_webview_x5.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
18 |
26 |
27 |
35 |
36 |
37 |
38 |
43 |
44 |
51 |
52 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_source.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_start.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
15 |
18 |
23 |
30 |
34 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_tag.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
26 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/base_emnty_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/base_error_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_home.xml:
--------------------------------------------------------------------------------
1 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_load_more_view.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
14 |
15 |
21 |
22 |
30 |
31 |
32 |
37 |
38 |
45 |
46 |
47 |
48 |
53 |
54 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_domain.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
15 |
16 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_drama.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
21 |
22 |
31 |
32 |
33 |
39 |
40 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_proress.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
15 |
16 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_tag.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_update_log.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/dialog_webview.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
21 |
22 |
25 |
26 |
30 |
31 |
40 |
41 |
47 |
48 |
58 |
59 |
65 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_week.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_desc_details.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_desc_drama.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_desc_recommend.xml:
--------------------------------------------------------------------------------
1 |
2 |
19 |
20 |
24 |
25 |
31 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_device.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
28 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_favorite.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 |
26 |
27 |
37 |
38 |
39 |
40 |
50 |
51 |
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_head.xml:
--------------------------------------------------------------------------------
1 |
14 |
15 |
16 |
20 |
21 |
29 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_log.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
14 |
15 |
22 |
23 |
32 |
33 |
34 |
35 |
43 |
44 |
49 |
50 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_tag_head.xml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
17 |
18 |
26 |
27 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_tag_item.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/nav_header_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/toolbar.xml:
--------------------------------------------------------------------------------
1 |
7 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/about_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/activity_home_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
39 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/desc_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/favorite_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/menu/home_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/670848654/Silisili/52a95122aa363478cd774ad2c767854212e13a7b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 8dp
6 | 150dp
7 | 16dp
8 | 8dp
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/file_path.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/xml/shortcuts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
15 |
16 |
17 |
18 |
25 |
26 |
30 |
31 |
32 |
39 |
40 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | google()
6 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
7 | mavenCentral()
8 | maven {
9 | url 'http://4thline.org/m2'
10 | }
11 | }
12 | dependencies {
13 | classpath 'com.android.tools.build:gradle:4.1.2'
14 | classpath 'com.jakewharton:butterknife-gradle-plugin:10.0.0'
15 | // NOTE: Do not place your application dependencies here; they belong
16 | // in the individual module build.gradle files
17 | }
18 | }
19 |
20 | allprojects {
21 | repositories {
22 | google()
23 | maven { url 'https://maven.aliyun.com/repository/jcenter' }
24 | mavenCentral()
25 | maven {
26 | url 'http://4thline.org/m2'
27 | }
28 | }
29 | }
30 |
31 | task clean(type: Delete) {
32 | delete rootProject.buildDir
33 | }
34 |
--------------------------------------------------------------------------------
/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 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | Android.useDeprecatedNdk=true
18 | android.useAndroidX=true
19 | android.enableJetifier=true
20 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name='Silisili'
3 |
--------------------------------------------------------------------------------