├── .gitignore
├── .idea
├── caches
│ └── build_file_checksums.ser
├── codeStyles
│ └── Project.xml
├── gradle.xml
├── misc.xml
└── runConfigurations.xml
├── README.md
├── app
├── .gitignore
├── build.gradle
├── libs
│ └── exo-2.0.4.jar
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── dawn
│ │ └── bannerimageandvideo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ ├── danmu.json
│ │ └── tv.txt
│ ├── java
│ │ └── com
│ │ │ └── dawn
│ │ │ └── bannerimageandvideo
│ │ │ ├── BannerActivity.java
│ │ │ ├── EightActivity.java
│ │ │ ├── FiveActivity.java
│ │ │ ├── FourActivity.java
│ │ │ ├── MainActivity.java
│ │ │ ├── SevenActivity.java
│ │ │ ├── SharePreferenceSaveListActivity.java
│ │ │ ├── SixActivity.java
│ │ │ ├── ThreeActivity.java
│ │ │ ├── TwoActivity.java
│ │ │ ├── adapter
│ │ │ ├── BannerAdapter.java
│ │ │ ├── BannerViewAdapter.java
│ │ │ └── MyPagerAdapter.java
│ │ │ ├── bean
│ │ │ └── BannerModel.java
│ │ │ ├── model
│ │ │ └── Userbean.java
│ │ │ ├── qsvideo
│ │ │ ├── RecyVideoActivity.java
│ │ │ ├── danmaku
│ │ │ │ ├── DanmakuConfig.java
│ │ │ │ ├── DanmakuControl.java
│ │ │ │ └── QSDanmakuParser.java
│ │ │ ├── io
│ │ │ │ ├── FileUtil.java
│ │ │ │ ├── IProgress.java
│ │ │ │ ├── ReadHelp.java
│ │ │ │ └── WriteHelp.java
│ │ │ ├── listvideo
│ │ │ │ ├── CallBack.java
│ │ │ │ ├── Getter.java
│ │ │ │ ├── ListCalculator.java
│ │ │ │ ├── ListViewGetter.java
│ │ │ │ └── RecyclerViewGetter.java
│ │ │ └── media
│ │ │ │ └── ExoMedia.java
│ │ │ ├── utils
│ │ │ └── ListDataSave.java
│ │ │ └── widget
│ │ │ └── MyListView.java
│ └── res
│ │ ├── drawable
│ │ ├── ic_launcher_background.xml
│ │ ├── radiu_blue.xml
│ │ ├── radiu_gray.xml
│ │ ├── red_dot.png
│ │ └── red_dot_night.png
│ │ ├── layout
│ │ ├── activity_banner.xml
│ │ ├── activity_eight.xml
│ │ ├── activity_five.xml
│ │ ├── activity_four.xml
│ │ ├── activity_main.xml
│ │ ├── activity_recy_video.xml
│ │ ├── activity_seven.xml
│ │ ├── activity_share_preference_save_list.xml
│ │ ├── activity_three.xml
│ │ ├── activity_two.xml
│ │ └── item_video.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── cover.jpg
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── dawn
│ └── bannerimageandvideo
│ └── ExampleUnitTest.java
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── images
├── one.png
├── three.png
└── two.png
├── nicevideoplayer
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── dawn
│ │ └── nicevideoplayer
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── dawn
│ │ │ └── nicevideoplayer
│ │ │ ├── ChangeClarityDialog.java
│ │ │ ├── Clarity.java
│ │ │ ├── INiceVideoPlayer.java
│ │ │ ├── LogUtil.java
│ │ │ ├── NiceTextureView.java
│ │ │ ├── NiceUtil.java
│ │ │ ├── NiceVideoPlayer.java
│ │ │ ├── NiceVideoPlayerController.java
│ │ │ ├── NiceVideoPlayerManager.java
│ │ │ └── TxVideoPlayerController.java
│ └── res
│ │ ├── color
│ │ └── select_change_clarity_color.xml
│ │ ├── drawable-xhdpi
│ │ ├── battery_10.png
│ │ ├── battery_100.png
│ │ ├── battery_20.png
│ │ ├── battery_50.png
│ │ ├── battery_80.png
│ │ ├── battery_charging.png
│ │ ├── battery_full.png
│ │ ├── ic_palyer_brightness.png
│ │ ├── ic_palyer_share.png
│ │ ├── ic_palyer_volume.png
│ │ ├── ic_player_back.png
│ │ ├── ic_player_center_start.png
│ │ ├── ic_player_enlarge.png
│ │ ├── ic_player_pause.png
│ │ ├── ic_player_replay.png
│ │ ├── ic_player_shrink.png
│ │ ├── ic_player_start.png
│ │ ├── img_default.png
│ │ ├── loading00.png
│ │ ├── loading01.png
│ │ ├── loading02.png
│ │ ├── loading03.png
│ │ ├── loading04.png
│ │ ├── loading05.png
│ │ ├── loading06.png
│ │ ├── loading07.png
│ │ ├── loading08.png
│ │ ├── loading09.png
│ │ ├── loading10.png
│ │ ├── loading11.png
│ │ ├── loading12.png
│ │ ├── loading13.png
│ │ ├── loading14.png
│ │ ├── loading15.png
│ │ ├── loading16.png
│ │ ├── loading17.png
│ │ ├── loading18.png
│ │ ├── loading19.png
│ │ ├── loading20.png
│ │ ├── loading21.png
│ │ ├── loading22.png
│ │ ├── loading23.png
│ │ ├── loading24.png
│ │ ├── loading25.png
│ │ ├── loading26.png
│ │ ├── loading27.png
│ │ ├── loading28.png
│ │ ├── loading29.png
│ │ ├── player_mask_bottom.png
│ │ └── player_mask_top.png
│ │ ├── drawable
│ │ ├── bg_change_clarity_checked.xml
│ │ ├── bg_change_clarity_normal.xml
│ │ ├── bg_radius_4.xml
│ │ ├── bg_retry.xml
│ │ ├── loading.xml
│ │ ├── pb_change.xml
│ │ ├── seek_progress.xml
│ │ ├── seek_thumb.xml
│ │ ├── seek_thumb_normal.xml
│ │ ├── seek_thumb_pressed.xml
│ │ └── select_change_clarity.xml
│ │ ├── layout
│ │ ├── item_change_clarity.xml
│ │ └── tx_video_palyer_controller.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── dawn
│ └── nicevideoplayer
│ └── ExampleUnitTest.java
├── qsvideoplayer
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── dawn
│ │ └── qsvideoplayer
│ │ ├── ConfigManage.java
│ │ ├── DemoQSVideoView.java
│ │ ├── HandlePlayListener.java
│ │ ├── HandleTouchEvent.java
│ │ ├── IVideoPlayer.java
│ │ ├── PlayListener.java
│ │ ├── QSVideoView.java
│ │ ├── QSVideoViewHelp.java
│ │ ├── Util.java
│ │ ├── floatwindow
│ │ ├── FloatMoveView.java
│ │ ├── FloatParams.java
│ │ ├── FloatWindowHelp.java
│ │ ├── TextureVideoViewOutlineProvider.java
│ │ └── WindowManage.java
│ │ ├── media
│ │ ├── AndroidMedia.java
│ │ ├── BaseMedia.java
│ │ ├── IMediaCallback.java
│ │ ├── IMediaControl.java
│ │ ├── IjkBaseMedia.java
│ │ ├── IjkExoMedia.java
│ │ └── IjkMedia.java
│ │ └── rederview
│ │ ├── IRenderView.java
│ │ ├── MeasureHelper.java
│ │ ├── SufaceRenderView.java
│ │ └── TextureRenderView.java
│ └── res
│ ├── drawable-xhdpi
│ ├── jc_back.png
│ ├── jc_back_tiny_normal.png
│ ├── jc_back_tiny_pressed.png
│ ├── jc_backward_icon.png
│ ├── jc_brightness_video.png
│ ├── jc_enlarge.png
│ ├── jc_error_normal.png
│ ├── jc_error_pressed.png
│ ├── jc_forward_icon.png
│ ├── jc_loading_bg.png
│ ├── jc_pause_normal.png
│ ├── jc_pause_pressed.png
│ ├── jc_play_normal.png
│ ├── jc_play_pressed.png
│ ├── jc_shrink.png
│ ├── jc_volume_icon.png
│ └── qs_goback.png
│ ├── drawable-xxhdpi
│ ├── mute_black.png
│ └── voice_black.png
│ ├── drawable
│ ├── bottom_backgroud.xml
│ ├── jc_click_back_tiny_selector.xml
│ ├── jc_click_error_selector.xml
│ ├── jc_click_pause_selector.xml
│ ├── jc_click_play_selector.xml
│ ├── jc_dialog_progress.xml
│ ├── jc_dialog_progress_bg.xml
│ ├── jc_loading.xml
│ ├── jc_progress.xml
│ ├── jc_seek_progress.xml
│ ├── jc_seek_thumb.xml
│ ├── jc_seek_thumb_normal.xml
│ ├── jc_seek_thumb_pressed.xml
│ ├── jc_volume_progress_bg.xml
│ └── top_backgroud.xml
│ ├── layout
│ ├── jc_dialog_brightness.xml
│ ├── jc_dialog_progress.xml
│ ├── jc_dialog_volume.xml
│ └── video_view.xml
│ ├── values-pt
│ └── strings.xml
│ ├── values-tr
│ └── strings.xml
│ ├── values-zh
│ └── strings.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── ids.xml
│ ├── strings.xml
│ └── styles.xml
├── settings.gradle
└── videoplayerlibrary
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── com
│ └── dawn
│ └── videoplayerlibrary
│ └── ExampleInstrumentedTest.java
├── main
├── AndroidManifest.xml
├── java
│ └── com
│ │ └── dawn
│ │ └── videoplayerlibrary
│ │ ├── CustomView
│ │ ├── JZVideoPlayerStandardAutoCompleteAfterFullscreen.java
│ │ ├── JZVideoPlayerStandardFresco.java
│ │ ├── JZVideoPlayerStandardShowShareButtonAfterFullscreen.java
│ │ ├── JZVideoPlayerStandardShowTextureViewAfterAutoComplete.java
│ │ ├── JZVideoPlayerStandardShowTitleAfterFullscreen.java
│ │ ├── JZVideoPlayerStandardVolumeAfterFullscreen.java
│ │ └── MyJZVideoPlayerStandard.java
│ │ ├── JZMediaInterface.java
│ │ ├── JZMediaManager.java
│ │ ├── JZMediaSystem.java
│ │ ├── JZResizeTextureView.java
│ │ ├── JZUserAction.java
│ │ ├── JZUserActionStandard.java
│ │ ├── JZUtils.java
│ │ ├── JZVideoPlayer.java
│ │ ├── JZVideoPlayerManager.java
│ │ └── JZVideoPlayerStandard.java
└── res
│ ├── anim
│ ├── quit_fullscreen.xml
│ └── start_fullscreen.xml
│ ├── drawable-xhdpi
│ ├── jz_add_volume.png
│ ├── jz_back_normal.png
│ ├── jz_back_pressed.png
│ ├── jz_back_tiny_normal.png
│ ├── jz_back_tiny_pressed.png
│ ├── jz_backward_icon.png
│ ├── jz_battery_level_10.png
│ ├── jz_battery_level_100.png
│ ├── jz_battery_level_30.png
│ ├── jz_battery_level_50.png
│ ├── jz_battery_level_70.png
│ ├── jz_battery_level_90.png
│ ├── jz_brightness_video.png
│ ├── jz_clarity_popwindow_bg.9.png
│ ├── jz_close_volume.png
│ ├── jz_enlarge.png
│ ├── jz_forward_icon.png
│ ├── jz_loading_bg.png
│ ├── jz_pause_normal.png
│ ├── jz_pause_pressed.png
│ ├── jz_play_normal.png
│ ├── jz_play_pressed.png
│ ├── jz_restart_normal.png
│ ├── jz_restart_pressed.png
│ ├── jz_share_normal.png
│ ├── jz_share_pressed.png
│ ├── jz_shrink.png
│ └── jz_volume_icon.png
│ ├── drawable-xxhdpi
│ └── jz_clarity_popwindow_bg.9.png
│ ├── drawable
│ ├── jz_bottom_bg.9.png
│ ├── jz_bottom_progress.xml
│ ├── jz_bottom_seek_progress.xml
│ ├── jz_bottom_seek_thumb.xml
│ ├── jz_click_back_selector.xml
│ ├── jz_click_back_tiny_selector.xml
│ ├── jz_click_pause_selector.xml
│ ├── jz_click_play_selector.xml
│ ├── jz_click_replay_selector.xml
│ ├── jz_click_share_selector.xml
│ ├── jz_dialog_progress.xml
│ ├── jz_dialog_progress_bg.xml
│ ├── jz_loading.xml
│ ├── jz_seek_thumb_normal.xml
│ ├── jz_seek_thumb_pressed.xml
│ ├── jz_title_bg.9.png
│ ├── jz_volume_progress_bg.xml
│ ├── retry_bg.xml
│ └── share_selector.xml
│ ├── layout
│ ├── jz_dialog_brightness.xml
│ ├── jz_dialog_progress.xml
│ ├── jz_dialog_volume.xml
│ ├── jz_layout_clarity.xml
│ ├── jz_layout_clarity_item.xml
│ ├── jz_layout_standard.xml
│ ├── layout_standard_fresco.xml
│ └── layout_standard_with_share_button.xml
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ ├── share_normal.png
│ └── share_pressed.png
│ ├── values-es
│ └── strings.xml
│ ├── values-pt
│ └── strings.xml
│ ├── values-tr
│ └── strings.xml
│ ├── values-zh
│ └── strings.xml
│ └── values
│ ├── dimens.xml
│ ├── ids.xml
│ ├── strings.xml
│ └── styles.xml
└── test
└── java
└── com
└── dawn
└── videoplayerlibrary
└── ExampleUnitTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/libraries
5 | /.idea/modules.xml
6 | /.idea/workspace.xml
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 |
--------------------------------------------------------------------------------
/.idea/caches/build_file_checksums.ser:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DawenZeng/BannerImageAndVideo/6aa42e59fd8d7aa1e4799c3cad9fd757c8aa8f5d/.idea/caches/build_file_checksums.ser
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
20 |
21 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # BannerImageAndVideo
2 | 图片和视频左右滑动切换混播,添加导航点,视频添加静音;这里有多种图片和视频左右滑动切换方法,有多种添加导航点,多种控制视频静音的方法。
3 | 下面是一些功能的截取图片:
4 |
5 | 
6 | 
7 | 
8 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 27
5 | defaultConfig {
6 | applicationId "com.dawn.bannerimageandvideo"
7 | minSdkVersion 16
8 | targetSdkVersion 27
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 |
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | implementation fileTree(include: ['*.jar'], dir: 'libs')
24 | implementation 'com.android.support:appcompat-v7:27.1.1'
25 | implementation 'com.android.support.constraint:constraint-layout:1.1.0'
26 | testImplementation 'junit:junit:4.12'
27 | implementation 'com.github.bumptech.glide:glide:3.7.0'
28 | implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
29 | // // 饺子视频播放器
30 | // implementation 'cn.jzvd:jiaozivideoplayer:6.2.7'
31 | implementation project(':videoplayerlibrary')
32 | implementation project(':nicevideoplayer')
33 | //start**************用于qsvideoplayer的视频播放*************end
34 | implementation project(':qsvideoplayer')
35 | implementation 'com.android.support:recyclerview-v7:27.1.1'
36 | implementation 'com.github.ctiao:DanmakuFlameMaster:0.9.25'
37 | //弹幕
38 | implementation 'com.github.ctiao:ndkbitmap-armv7a:0.9.21'
39 | implementation files('libs/exo-2.0.4.jar')
40 | //end***********用于qsvideoplayer的视频播放*****************end
41 |
42 | implementation 'com.google.code.gson:gson:2.8.2'
43 | }
44 |
--------------------------------------------------------------------------------
/app/libs/exo-2.0.4.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DawenZeng/BannerImageAndVideo/6aa42e59fd8d7aa1e4799c3cad9fd757c8aa8f5d/app/libs/exo-2.0.4.jar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/dawn/bannerimageandvideo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.dawn.bannerimageandvideo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.dawn.bannerimageandvideo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
29 |
32 |
35 |
38 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/app/src/main/assets/tv.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DawenZeng/BannerImageAndVideo/6aa42e59fd8d7aa1e4799c3cad9fd757c8aa8f5d/app/src/main/assets/tv.txt
--------------------------------------------------------------------------------
/app/src/main/java/com/dawn/bannerimageandvideo/BannerActivity.java:
--------------------------------------------------------------------------------
1 | package com.dawn.bannerimageandvideo;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.support.v7.app.AppCompatActivity;
6 |
7 | import com.dawn.bannerimageandvideo.adapter.BannerAdapter;
8 |
9 | import java.util.ArrayList;
10 | import java.util.List;
11 |
12 | public class BannerActivity extends AppCompatActivity {
13 |
14 |
15 | private List bannerList = new ArrayList<>();
16 | private ViewPager banner;
17 | BannerAdapter bannerAdapter;
18 |
19 |
20 | @Override
21 | protected void onCreate(Bundle savedInstanceState) {
22 | super.onCreate(savedInstanceState);
23 | setContentView(R.layout.activity_banner);
24 |
25 | bannerList = (List) getIntent().getStringArrayListExtra("list");
26 | banner = findViewById(R.id.banner);
27 | // banner.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
28 |
29 | bannerAdapter = new BannerAdapter(this);
30 | bannerAdapter.update(bannerList);
31 | banner.setAdapter(bannerAdapter);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dawn/bannerimageandvideo/FiveActivity.java:
--------------------------------------------------------------------------------
1 | package com.dawn.bannerimageandvideo;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.view.ViewPager;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.widget.ArrayAdapter;
7 | import android.widget.ImageView;
8 | import android.widget.LinearLayout;
9 | import android.widget.ListView;
10 |
11 | import com.dawn.bannerimageandvideo.adapter.BannerAdapter;
12 |
13 | import java.util.ArrayList;
14 | import java.util.List;
15 |
16 | public class FiveActivity extends AppCompatActivity implements ViewPager.OnPageChangeListener {
17 |
18 | private List bannerList = new ArrayList<>();
19 | private ViewPager banner;
20 | private LinearLayout group;
21 | BannerAdapter bannerAdapter;
22 | private ListView listview;
23 | private String[] presidents = {"北京", "深圳", "济南", "广州", "海南", "香港", "澳门", "aa", "北京", "深圳", "济南", "广州", "海南", "香港", "澳门", "aa", "北京", "深圳", "济南", "广州", "海南", "香港", "澳门", "aa", "北京", "深圳", "济南", "广州", "海南", "香港", "澳门", "aa"};
24 |
25 | private int mIndicatorSelectedResId = R.drawable.radiu_blue;//蓝色导航点
26 | private int mIndicatorUnselectedResId = R.drawable.radiu_gray;//灰色导航点
27 | /**
28 | * 装点点的ImageView数组
29 | */
30 | private ImageView[] tips;
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_five);
36 |
37 | bannerList = (List) getIntent().getStringArrayListExtra("list");
38 | banner = findViewById(R.id.vp_main);
39 | group = findViewById(R.id.ll_main_dot);
40 | listview = findViewById(R.id.list);
41 | // 设置LinearLayout的子控件的宽高,这里单位是像素。
42 | LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(15, 15);
43 | params.rightMargin = 20;
44 | // 将点点加入到ViewGroup中
45 | tips = new ImageView[bannerList.size()];
46 | for (int i = 0; i < bannerList.size(); i++) {
47 | ImageView imageView = new ImageView(this);
48 | imageView.setLayoutParams(params);
49 | if (i == 0) {
50 | imageView.setImageResource(mIndicatorSelectedResId);
51 | } else {
52 | imageView.setImageResource(mIndicatorUnselectedResId);
53 | }
54 | tips[i] = imageView;
55 | group.addView(imageView);
56 | }
57 |
58 | bannerAdapter = new BannerAdapter(this);
59 | bannerAdapter.update(bannerList);
60 | banner.setAdapter(bannerAdapter);
61 | // 设置ViewPager的默认项, 设置为长度的100倍,这样子开始就能往左滑动
62 | // viewPager.setCurrentItem((mImageViews.length) * 100);
63 | // 一开始不能往滑,但没有图片是默认图片一开始就显示
64 | banner.setCurrentItem(0);
65 | // 设置监听,主要是设置点点的背景
66 | banner.setOnPageChangeListener(this);
67 |
68 | listview.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, presidents));
69 | listview.setFocusable(false);
70 | }
71 |
72 | @Override
73 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
74 |
75 | }
76 |
77 | @Override
78 | public void onPageSelected(int position) {
79 | setImageBackground(position % bannerList.size());
80 | }
81 |
82 | @Override
83 | public void onPageScrollStateChanged(int state) {
84 | }
85 |
86 | /**
87 | * 设置选中的tip的背景
88 | *
89 | * @param selectItems
90 | */
91 | private void setImageBackground(int selectItems) {
92 | for (int i = 0; i < tips.length; i++) {
93 | if (i == selectItems) {
94 | tips[i].setImageResource(mIndicatorSelectedResId);
95 | } else {
96 | tips[i].setImageResource(mIndicatorUnselectedResId);
97 | }
98 | }
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dawn/bannerimageandvideo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.dawn.bannerimageandvideo;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import java.util.ArrayList;
9 |
10 | //实现视频+图片轮播
11 | public class MainActivity extends AppCompatActivity {
12 |
13 | private Intent it;
14 | private int index;//获取视频的下标
15 |
16 | @Override
17 | protected void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.activity_main);
20 |
21 | ArrayList bannerList = new ArrayList<>();
22 | bannerList.add("https://erp.vipstation.com.hk/images/itemimg/Q6053406.jpg");
23 | bannerList.add("https://erp.vipstation.com.hk/upload/image/20160527/20160527150822_4183.jpg");
24 | bannerList.add("https://erp.vipstation.com.hk/upload/image/20160527/20160527150824_3404.jpg");
25 | bannerList.add("https://erp.vipstation.com.hk/upload/image/20160527/20160527150825_1275.jpg");
26 | bannerList.add("https://erp.vipstation.com.hk/images/IC/IC0002851/IC0002851_180419124311770_iOS.mp4");
27 | // bannerList.add("http://videos.kpie.com.cn/videos/20170526/037DCE54-EECE-4520-AA92-E4002B1F29B0.mp4");
28 |
29 | for (int i = 0; i < bannerList.size(); i++) {
30 | if (bannerList.get(i).contains(".mp4"))
31 | index = i;
32 | }
33 | bannerList.add(0, bannerList.remove(index));//把视频放在第一个位置
34 |
35 | it = new Intent();
36 | it.putStringArrayListExtra("list", bannerList);
37 | }
38 |
39 | public void btn1(View view) {
40 | it.setClass(this, BannerActivity.class);
41 | startActivity(it);
42 | }
43 |
44 | public void btn2(View view) {
45 | it.setClass(this, TwoActivity.class);
46 | startActivity(it);
47 | }
48 |
49 | public void btn3(View view) {
50 | it.setClass(this, ThreeActivity.class);
51 | startActivity(it);
52 | }
53 |
54 | public void btn4(View view) {
55 | it.setClass(this, FourActivity.class);
56 | startActivity(it);
57 | }
58 |
59 | public void btn5(View view) {
60 | it.setClass(this, FiveActivity.class);
61 | startActivity(it);
62 | }
63 |
64 | public void btn6(View view) {
65 | it.setClass(this, SixActivity.class);
66 | startActivity(it);
67 | }
68 |
69 | public void btn7(View view) {
70 | it.setClass(this, SevenActivity.class);
71 | startActivity(it);
72 | }
73 |
74 | public void btn8(View view) {
75 | it.setClass(this, EightActivity.class);
76 | startActivity(it);
77 | }
78 |
79 | public void btn9(View view) {
80 | it.setClass(this, SharePreferenceSaveListActivity.class);
81 | startActivity(it);
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/app/src/main/java/com/dawn/bannerimageandvideo/SharePreferenceSaveListActivity.java:
--------------------------------------------------------------------------------
1 | package com.dawn.bannerimageandvideo;
2 |
3 | import android.content.Context;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 | import android.widget.Toast;
8 |
9 | import com.dawn.bannerimageandvideo.model.Userbean;
10 | import com.dawn.bannerimageandvideo.utils.ListDataSave;
11 |
12 | import java.util.ArrayList;
13 | import java.util.HashMap;
14 | import java.util.List;
15 | import java.util.Map;
16 |
17 | public class SharePreferenceSaveListActivity extends AppCompatActivity implements View.OnClickListener {
18 |
19 | Context mContext;
20 | ListDataSave dataSave;
21 | private List listBean;
22 | private ArrayList listString;
23 | private ArrayList