├── .gitignore
├── .idea
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── gradle.xml
├── misc.xml
├── modules.xml
├── runConfigurations.xml
└── vcs.xml
├── README.md
├── UPDATE_VERSION.md
├── app
├── .gitignore
├── build.gradle
├── libs
│ └── hpplay-link.aar
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── example
│ │ └── dev
│ │ ├── activity
│ │ ├── AppbarLayActivity.java
│ │ ├── BMImgClickActivity.java
│ │ ├── BlankActivity.java
│ │ ├── CBannerActivity.java
│ │ ├── CityPickerActivity.java
│ │ ├── CoverFlowDemoActivity.java
│ │ ├── GSYPlayerActivity.java
│ │ ├── GSYPlayerRVDisActivity.java
│ │ ├── GSYPlayerRVMiniActivity.java
│ │ ├── GSYVideoActivity.java
│ │ ├── GalleryActivity.java
│ │ ├── HpplayActivity.java
│ │ ├── LikeIosDialogActivity.java
│ │ ├── MDGoodsDtlActivity.java
│ │ ├── MainActivity.java
│ │ ├── MaterialDialogActivity.java
│ │ ├── SettingActivity.java
│ │ ├── TabLayDemoActivity.java
│ │ ├── TextDemoActivity.java
│ │ ├── TextInputLayActivity.java
│ │ └── recycler
│ │ │ ├── RvMultiFuncActivity.java
│ │ │ └── SwipeRVDemoActivity.java
│ │ ├── adapter
│ │ ├── CoverFlowAdapter.java
│ │ ├── MainWidgetAdapter.java
│ │ ├── RvVideoDisAdapter.java
│ │ ├── RvVideoMiniAdapter.java
│ │ ├── SwipeRVAdapter.java
│ │ └── TaskTypeAdapter.java
│ │ ├── application
│ │ └── MyApplication.java
│ │ ├── bean
│ │ ├── ChannelBean.java
│ │ ├── ListItemInfo.java
│ │ ├── SwitchVideoModel.java
│ │ ├── TaskTypeBean.java
│ │ └── VideoModel.java
│ │ ├── fragment
│ │ ├── BlankFragment.java
│ │ ├── DemoFragment.java
│ │ ├── HomeFragment.java
│ │ ├── MeFragment.java
│ │ └── TabLayFragment.java
│ │ ├── listener
│ │ ├── OnItemClickListener.java
│ │ ├── OnTransitionListener.java
│ │ └── SampleVideoListener.java
│ │ ├── utils
│ │ ├── ConstUtil.java
│ │ ├── MyGlideLoadUtil.java
│ │ └── MyGlideModule.java
│ │ ├── video
│ │ └── SampleVideo.java
│ │ └── view
│ │ ├── ListViewDecoration.java
│ │ ├── NoticeMF.java
│ │ ├── SwitchVideoTypeDialog.java
│ │ └── cbview
│ │ ├── LocalImageHolderView.java
│ │ └── NetworkImageHolderView.java
│ └── res
│ ├── anim
│ ├── bottom_out.xml
│ ├── left_in.xml
│ ├── left_out.xml
│ ├── right_in.xml
│ ├── right_out.xml
│ └── top_in.xml
│ ├── drawable-hdpi
│ ├── bg_dlg_cus1.png
│ ├── bg_dlg_cus2.png
│ ├── ic_eye_grey_24dp.png
│ ├── ic_ns1.jpg
│ ├── ic_ns2.jpg
│ ├── ic_ns3.jpg
│ ├── ic_ns4.jpg
│ ├── ic_ns5.jpg
│ ├── ic_tab_book_white_24dp.png
│ ├── ic_tab_home_white_24dp.png
│ ├── ic_tab_tv_white_24dp.png
│ └── img_wk.jpg
│ ├── drawable-xhdpi
│ ├── ic_book_list.png
│ ├── ic_page_indicator.png
│ ├── ic_page_indicator_focused.png
│ ├── ic_test_0.jpg
│ ├── ic_test_1.jpg
│ ├── ic_test_2.jpg
│ ├── ic_test_3.jpg
│ ├── ic_test_4.jpg
│ ├── ic_test_5.jpg
│ └── ic_test_6.jpg
│ ├── drawable
│ └── divider_recycler.xml
│ ├── layout
│ ├── activity_appbar_lay.xml
│ ├── activity_base_tab_bottom.xml
│ ├── activity_blank.xml
│ ├── activity_bm_img_click.xml
│ ├── activity_cbanner.xml
│ ├── activity_city_picker.xml
│ ├── activity_coverflow.xml
│ ├── activity_gallery.xml
│ ├── activity_gsy_player.xml
│ ├── activity_gsy_player_rv_dis.xml
│ ├── activity_gsy_player_rv_mini.xml
│ ├── activity_gsy_video.xml
│ ├── activity_hpplay.xml
│ ├── activity_like_ios_dialog.xml
│ ├── activity_material_dlg.xml
│ ├── activity_md_goods_dtl.xml
│ ├── activity_rv_demo.xml
│ ├── activity_setting.xml
│ ├── activity_srv_demo.xml
│ ├── activity_tab_lay_demo.xml
│ ├── activity_text_demo.xml
│ ├── activity_text_input_lay.xml
│ ├── adapter_transformer.xml
│ ├── coverflow_item_view.xml
│ ├── custom_message_content.xml
│ ├── fg_demo.xml
│ ├── fg_home.xml
│ ├── fragment_blank.xml
│ ├── fragment_me.xml
│ ├── item_main.xml
│ ├── item_notice_marquee.xml
│ ├── list_item_task_type.xml
│ ├── list_video_item_dis.xml
│ ├── list_video_item_mini.xml
│ ├── progressbar_item.xml
│ ├── sample_video.xml
│ ├── srv_item_demo.xml
│ ├── switch_video_dialog.xml
│ └── switch_video_dialog_item.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_logo_a_collect.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── array.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── strings.xml
│ └── styles.xml
├── base-android-dev
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ └── fonts
│ │ └── digital-7.ttf
│ ├── java
│ └── com
│ │ └── base
│ │ └── adev
│ │ ├── activity
│ │ ├── BaseActivity.java
│ │ ├── BaseRecyclerActivity.java
│ │ ├── BaseTabBottomActivity.java
│ │ └── BaseTabLayActivity.java
│ │ ├── adapter
│ │ └── BaseFragmentStatePagerAdapter.java
│ │ ├── application
│ │ └── BaseApplication.java
│ │ ├── fragment
│ │ ├── BaseFragment.java
│ │ └── BaseRecyclerFragment.java
│ │ ├── utils
│ │ ├── ClickUtil.java
│ │ ├── CommonUtils.java
│ │ ├── DataCleanManager.java
│ │ ├── DateUtil.java
│ │ ├── GetFolderSizeManager.java
│ │ ├── MyBitmapImageViewTarget.java
│ │ ├── ScreenUtil.java
│ │ ├── StatusBarUtils.java
│ │ ├── SystemBarTintManager.java
│ │ └── ToastUtils.java
│ │ └── view
│ │ ├── ActionSheetDialog.java
│ │ ├── IosAlertDialog.java
│ │ ├── LedTextView.java
│ │ ├── MarqueeTextView.java
│ │ ├── NoticeView.java
│ │ └── ToastView.java
│ └── res
│ ├── anim
│ ├── actionsheet_dialog_in.xml
│ ├── actionsheet_dialog_out.xml
│ ├── m_switcher_vertical_in.xml
│ └── m_switcher_vertical_out.xml
│ ├── drawable-hdpi
│ ├── actionsheet_bottom_normal.9.png
│ ├── actionsheet_bottom_pressed.9.png
│ ├── actionsheet_middle_normal.9.png
│ ├── actionsheet_middle_pressed.9.png
│ ├── actionsheet_single_normal.9.png
│ ├── actionsheet_single_pressed.9.png
│ ├── actionsheet_top_normal.9.png
│ ├── actionsheet_top_pressed.9.png
│ ├── alert_bg.9.png
│ ├── alert_btn_left_pressed.9.png
│ ├── alert_btn_right_pressed.9.png
│ ├── alert_btn_single_pressed.9.png
│ ├── ic_back.png
│ ├── ic_default_adimage.jpg
│ └── trans_bg.png
│ ├── drawable
│ ├── actionsheet_bottom_selector.xml
│ ├── actionsheet_middle_selector.xml
│ ├── actionsheet_single_selector.xml
│ ├── actionsheet_top_selector.xml
│ ├── alertdialog_left_selector.xml
│ ├── alertdialog_right_selector.xml
│ ├── alertdialog_single_selector.xml
│ └── toast_bg.xml
│ ├── layout
│ ├── base_activity_tab_layout.xml
│ ├── layout_toolbar.xml
│ ├── toast_view.xml
│ ├── view_actionsheet.xml
│ └── view_alertdialog.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── navigation_back_white.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ ├── values-w820dp
│ └── dimens.xml
│ └── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── ids.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── dependencies.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .externalNativeBuild
10 |
--------------------------------------------------------------------------------
/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
19 |
20 |
--------------------------------------------------------------------------------
/.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 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/UPDATE_VERSION.md:
--------------------------------------------------------------------------------
1 | ## 下方各个版本说明,可以当做简单的 wiki 使用~,效果可参考 DEMO。
2 |
3 | ### 1.0.7
4 | * 日常维护,版本更新
5 |
6 | ### 1.0.5
7 | * 升级 supportLibraryVersion,lib 中取消 support Library 的引用
8 |
9 | ### 1.0.4
10 | * 升级部分开源库版本
11 | * 将无需进行 base 类封装的第三方开源库依赖移入 App simple 的 module 中,减少 BaseAndroidDev 库的体积,减少无必要的依赖,同时尊重开源库原作的成果。
12 |
13 | ### 1.0.3
14 | * 重构底部 Tab 的基础 Activity,增加更多设置 Tab 风格的方法
15 |
16 | ```java
17 | addItem(new HomeFragment(), R.drawable.ic_tab_home_white_24dp, R.string.tab1, R.color.colorPrimary);
18 | setNavBarStyle(BottomNavigationBar.MODE_FIXED, BottomNavigationBar.BACKGROUND_STYLE_STATIC);
19 | initialise(R.id.ll_content);
20 | ```
21 |
22 | ### 1.0.1
23 | * 增加了 BaseRecyclerActivity 和 BaseRecyclerFragment。
24 |
25 | ### 1.0.0
26 | * 封装了 BaseActivity、BaseTabBottomActivity、BaseTabLayActivity、BaseFragment 及部分工具类和自定义 view。
27 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | def globalConfiguration = rootProject.extensions.getByName("ext")
5 | compileSdkVersion globalConfiguration.androidCompileSdkVersion
6 | buildToolsVersion globalConfiguration.androidBuildToolsVersion
7 | defaultConfig {
8 | applicationId globalConfiguration.applicationId
9 | minSdkVersion globalConfiguration.androidMinSdkVersion
10 | targetSdkVersion globalConfiguration.androidTargetSdkVersion
11 | versionCode globalConfiguration.versionCode
12 | versionName globalConfiguration.versionName
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 |
15 | ndk {
16 | //设置支持的SO库架构
17 | abiFilters 'armeabi', 'armeabi-v7a', 'x86'
18 | }
19 | }
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
24 | }
25 |
26 | debug {
27 | minifyEnabled false
28 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
29 | }
30 | }
31 | sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/drawable'] } }
32 | }
33 |
34 | repositories {
35 | flatDir {
36 | dirs 'libs'
37 | }
38 | }
39 |
40 | dependencies {
41 | compile fileTree(include: ['*.jar'], dir: 'libs')
42 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
43 | exclude group: 'com.android.support', module: 'support-annotations'
44 | })
45 | testCompile 'junit:junit:4.12'
46 | // 乐播投屏 aar
47 | compile(name: 'hpplay-link', ext: 'aar')
48 | def androidDps = rootProject.ext.androidDependencies
49 | def viewDps = rootProject.ext.viewDependencies
50 | def dataDps = rootProject.ext.dataDependencies
51 | compile androidDps.appcompat_v7
52 | compile androidDps.support_v4
53 | compile androidDps.design
54 | compile androidDps.cardview_v7
55 | compile androidDps.constraintLayout
56 | compile project(path: ':base-android-dev')
57 | compile project(':base-android-dev')
58 |
59 | // Glide 和 gson 已在 base-android-dev 的 module 中添加,此 module 中不再重复添加。
60 | // //图片加载库 Glide
61 | // compile dataDps.glide
62 | // // gson
63 | // compile dataDps.gson
64 | // // Volley 网络请求框架
65 | // compile dataDps.volley
66 | //省市区三级联动
67 | compile viewDps.citypickerview
68 | //图片/视频文件选择器
69 | compile viewDps.rxgalleryfinal
70 | //Material Design 风格的自定义 Dialog
71 | compile viewDps.materialdialog
72 | //A circular ImageView for Android
73 | compile viewDps.circleimageview
74 | //精仿 iOS 的提示库 SVProgressHUD
75 | compile viewDps.svprogresshud
76 | //图片浏览缩放控件
77 | compile viewDps.photoview
78 | //banner
79 | compile viewDps.convenientbanner
80 | compile viewDps.vptransforms
81 | //GSYVideoPlayer 视频播放器
82 | compile viewDps.GSYVideoPlayer
83 | // CoverFlow
84 | compile viewDps.lsdImgCoverFlow
85 | //跑马灯
86 | compile viewDps.gwMarqueeLib
87 | }
88 |
--------------------------------------------------------------------------------
/app/libs/hpplay-link.aar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/libs/hpplay-link.aar
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
19 |
20 |
28 |
31 |
32 |
37 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
52 |
55 |
58 |
59 |
60 |
61 |
62 |
66 |
67 |
68 |
69 |
70 |
71 |
74 |
78 |
83 |
87 |
91 |
94 |
95 |
96 |
97 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/BMImgClickActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 | import android.widget.ImageView;
6 | import android.widget.RadioGroup;
7 |
8 | import com.base.adev.activity.BaseActivity;
9 | import com.bm.library.Info;
10 | import com.bm.library.PhotoView;
11 | import com.example.dev.R;
12 |
13 | public class BMImgClickActivity extends BaseActivity implements RadioGroup.OnCheckedChangeListener {
14 | private String title;
15 |
16 | Info mRectF;
17 |
18 | PhotoView mImg1;
19 | PhotoView mImg2;
20 |
21 | @Override
22 | protected void initContentView(Bundle bundle) {
23 | setContentView(R.layout.activity_bm_img_click);
24 | }
25 |
26 | @Override
27 | protected void initView() {
28 | ((RadioGroup) findViewById(R.id.group)).setOnCheckedChangeListener(this);
29 |
30 | mImg1 = (PhotoView) findViewById(R.id.img1);
31 | mImg2 = (PhotoView) findViewById(R.id.img2);
32 | }
33 |
34 | @Override
35 | protected void initLogic() {
36 | mToolbar.setTitle(title);
37 |
38 | //设置不可以双指缩放移动放大等操作,跟普通的image一模一样,默认情况下就是disenable()状态
39 | mImg1.disenable();
40 | mImg1.setOnClickListener(new View.OnClickListener() {
41 | @Override
42 | public void onClick(View v) {
43 | mImg1.setVisibility(View.GONE);
44 | mImg2.setVisibility(View.VISIBLE);
45 |
46 | //获取img1的信息
47 | mRectF = mImg1.getInfo();
48 | //让img2从img1的位置变换到他本身的位置
49 | mImg2.animaFrom(mRectF);
50 | }
51 | });
52 |
53 | // 需要启动缩放需要手动开启
54 | mImg2.enable();
55 | mImg2.setOnClickListener(new View.OnClickListener() {
56 | @Override
57 | public void onClick(View v) {
58 | // 让img2从自身位置变换到原来img1图片的位置大小
59 | mImg2.animaTo(mRectF, new Runnable() {
60 | @Override
61 | public void run() {
62 | mImg2.setVisibility(View.GONE);
63 | mImg1.setVisibility(View.VISIBLE);
64 | }
65 | });
66 | }
67 | });
68 | }
69 |
70 | @Override
71 | protected void getBundleExtras(Bundle extras) {
72 | title = extras.getString("title");
73 | }
74 |
75 | @Override
76 | public void onBackPressed() {
77 | if (mImg2.getVisibility() == View.VISIBLE) {
78 | mImg2.animaTo(mRectF, new Runnable() {
79 | @Override
80 | public void run() {
81 | mImg2.setVisibility(View.GONE);
82 | mImg1.setVisibility(View.VISIBLE);
83 | }
84 | });
85 | } else {
86 | super.onBackPressed();
87 | }
88 | }
89 |
90 | @Override
91 | public void onCheckedChanged(RadioGroup group, int checkedId) {
92 | switch (checkedId) {
93 | case R.id.center:
94 | mImg1.setScaleType(ImageView.ScaleType.CENTER);
95 | break;
96 | case R.id.center_crop:
97 | mImg1.setScaleType(ImageView.ScaleType.CENTER_CROP);
98 | break;
99 | case R.id.center_inside:
100 | mImg1.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
101 | break;
102 | case R.id.fit_center:
103 | mImg1.setScaleType(ImageView.ScaleType.FIT_CENTER);
104 | break;
105 | // 建议用了fit_xy,fit_end,fit_start就不要使用缩放或者animaFrom或animaTo
106 | case R.id.fit_end:
107 | mImg1.setScaleType(ImageView.ScaleType.FIT_END);
108 | break;
109 | case R.id.fit_start:
110 | mImg1.setScaleType(ImageView.ScaleType.FIT_START);
111 | break;
112 | case R.id.fit_xy:
113 | mImg1.setScaleType(ImageView.ScaleType.FIT_XY);
114 | break;
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/BlankActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.base.adev.activity.BaseActivity;
6 | import com.example.dev.R;
7 |
8 | public class BlankActivity extends BaseActivity {
9 |
10 | @Override
11 | protected void initContentView(Bundle bundle) {
12 | setContentView(R.layout.activity_blank);
13 | }
14 |
15 | @Override
16 | protected void initView() {
17 |
18 | }
19 |
20 | @Override
21 | protected void initLogic() {
22 |
23 | }
24 |
25 | @Override
26 | protected void getBundleExtras(Bundle extras) {
27 |
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/CityPickerActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.graphics.Color;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.Button;
7 | import android.widget.TextView;
8 |
9 | import com.base.adev.activity.BaseActivity;
10 | import com.example.dev.R;
11 | import com.lljjcoder.citypickerview.widget.CityPicker;
12 |
13 | public class CityPickerActivity extends BaseActivity {
14 |
15 | private String title;
16 |
17 | private Button btnPicker;
18 | private TextView tvResult;
19 | private String defProvinceName = "辽宁省";
20 | private String defCityName = "大连市";
21 | private String defDistrictName = "中山区";
22 |
23 | @Override
24 | protected void initContentView(Bundle bundle) {
25 | setContentView(R.layout.activity_city_picker);
26 | }
27 |
28 | @Override
29 | protected void initView() {
30 | btnPicker = (Button) findViewById(R.id.btn_picker);
31 | tvResult = (TextView) findViewById(R.id.tv_result);
32 | }
33 |
34 | @Override
35 | protected void initLogic() {
36 | mToolbar.setTitle(title);
37 |
38 | btnPicker.setOnClickListener(new View.OnClickListener() {
39 | @Override
40 | public void onClick(View v) {
41 |
42 | CityPicker cityPicker = new CityPicker.Builder(context).textSize(20)
43 | .title("选择地区")
44 | .titleTextColor("#ffffff")
45 | .backgroundPop(0xa0000000)
46 | .titleBackgroundColor("#3F51B5")
47 | .confirTextColor("#ffffff")
48 | .cancelTextColor("#ffffff")
49 | .province(defProvinceName)
50 | .city(defCityName)
51 | .district(defDistrictName)
52 | .textColor(Color.parseColor("#000000"))
53 | .provinceCyclic(true)
54 | .cityCyclic(false)
55 | .districtCyclic(false)
56 | .visibleItemsCount(7)
57 | .itemPadding(10)
58 | .build();
59 |
60 | cityPicker.show();
61 | cityPicker.setOnCityItemClickListener(new CityPicker.OnCityItemClickListener() {
62 | @Override
63 | public void onSelected(String... citySelected) {
64 | tvResult.setText("选择结果:\n省:" + citySelected[0]
65 | + "\n市:" + citySelected[1]
66 | + "\n区:" + citySelected[2]
67 | + "\n邮编:" + citySelected[3]);
68 | }
69 |
70 | @Override
71 | public void onCancel() {
72 | showShortToast("已取消");
73 | }
74 | });
75 | }
76 | });
77 | }
78 |
79 | @Override
80 | protected void getBundleExtras(Bundle extras) {
81 | title = extras.getString("title");
82 | }
83 |
84 | }
85 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/CoverFlowDemoActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 | import android.widget.Button;
6 |
7 | import com.base.adev.activity.BaseActivity;
8 | import com.example.dev.R;
9 | import com.example.dev.adapter.CoverFlowAdapter;
10 | import com.example.dev.bean.ChannelBean;
11 | import com.img.coverflow.widget.CoverFlowView;
12 |
13 | import java.util.ArrayList;
14 | import java.util.List;
15 |
16 | public class CoverFlowDemoActivity extends BaseActivity implements View.OnClickListener {
17 | private String title;
18 |
19 | private CoverFlowView coverFlowView;
20 | private Button btnPrevious;
21 | private Button btnForward;
22 | private Button btnGetTop;
23 | private Button btnGetTopView;
24 |
25 | private List channelBeanList;
26 | public static final int[] channelImgs = {R.drawable.ic_ns1, R.drawable.ic_ns2,
27 | R.drawable.ic_ns3, R.drawable.ic_ns4, R.drawable.ic_ns5};
28 | public static final String[] channelNames = {"图片1", "图片2", "图片3", "图片4", "图片5"};
29 |
30 | @Override
31 | protected void initContentView(Bundle bundle) {
32 | setContentView(R.layout.activity_coverflow);
33 |
34 | }
35 |
36 | @Override
37 | protected void initView() {
38 | coverFlowView = (CoverFlowView) findViewById(R.id.coverflow);
39 | btnPrevious = (Button) findViewById(R.id.btn_previous);
40 | btnForward = (Button) findViewById(R.id.btn_forward);
41 | btnGetTop = (Button) findViewById(R.id.btn_get_top);
42 | btnGetTopView = (Button) findViewById(R.id.btn_get_top_view);
43 | btnPrevious.setOnClickListener(this);
44 | btnForward.setOnClickListener(this);
45 | btnGetTop.setOnClickListener(this);
46 | btnGetTopView.setOnClickListener(this);
47 | }
48 |
49 | @Override
50 | protected void initLogic() {
51 | mToolbar.setTitle(title);
52 | initListDataAndAction();
53 |
54 | }
55 |
56 | @Override
57 | protected void getBundleExtras(Bundle extras) {
58 | title = extras.getString("title");
59 | }
60 |
61 | private void initListDataAndAction() {
62 | channelBeanList = new ArrayList<>();
63 | for (int i = 0; i < channelNames.length; i++) {
64 | ChannelBean channelBean = new ChannelBean();
65 | channelBean.setImg(channelImgs[i]);
66 | channelBean.setName(channelNames[i]);
67 | channelBeanList.add(channelBean);
68 | }
69 |
70 | CoverFlowAdapter coverFlowAdapter = new CoverFlowAdapter(context, channelBeanList);
71 | coverFlowView.setAdapter(coverFlowAdapter);
72 |
73 | // 给coverFlowView的TOPView 添加点击事件监听
74 | coverFlowView.setOnTopViewClickLister(new CoverFlowView.OnTopViewClickLister() {
75 | @Override
76 | public void onClick(int position, View itemView) {
77 | ChannelBean channelBean = channelBeanList.get(position);
78 |
79 | showShortToast("点击事件 position:" + position + ", text:" + channelBean.getName());
80 | }
81 | });
82 | }
83 |
84 | @Override
85 | public void onClick(View v) {
86 | switch (v.getId()) {
87 | case R.id.btn_previous:
88 | coverFlowView.gotoPrevious();//向前一页
89 | break;
90 | case R.id.btn_forward:
91 | coverFlowView.gotoForward();//向后一页
92 | break;
93 | case R.id.btn_get_top://获取最上面Item的position
94 | int position = coverFlowView.getTopViewPosition();
95 | showShortToast("" + position);
96 | break;
97 | case R.id.btn_get_top_view://获取最上面Item的View
98 | CoverFlowAdapter.Holder holder = (CoverFlowAdapter.Holder) coverFlowView.getTopView().getTag();
99 | showShortToast(holder.tv.getText() + "");
100 | break;
101 | default:
102 | break;
103 | }
104 | }
105 |
106 | }
107 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/GSYVideoActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v4.app.ActivityCompat;
6 | import android.support.v4.app.ActivityOptionsCompat;
7 | import android.support.v4.util.Pair;
8 | import android.view.View;
9 | import android.widget.Button;
10 |
11 | import com.base.adev.activity.BaseActivity;
12 | import com.example.dev.R;
13 |
14 | public class GSYVideoActivity extends BaseActivity implements View.OnClickListener {
15 | private String title;
16 |
17 | private Button mBtnOpenVideo;
18 | private Button mBtnRvPlayer;
19 | private Button mBtnRvPlayerMini;
20 |
21 | @Override
22 | protected void initContentView(Bundle bundle) {
23 | setContentView(R.layout.activity_gsy_video);
24 | }
25 |
26 | @Override
27 | protected void initView() {
28 | mBtnOpenVideo = (Button) findViewById(R.id.btn_open_video);
29 | mBtnRvPlayer = (Button) findViewById(R.id.btn_rv_player);
30 | mBtnRvPlayerMini = (Button) findViewById(R.id.btn_rv_player_mini);
31 |
32 | }
33 |
34 | @Override
35 | protected void initLogic() {
36 | mToolbar.setTitle(title);
37 | mBtnOpenVideo.setOnClickListener(this);
38 | mBtnRvPlayer.setOnClickListener(this);
39 | mBtnRvPlayerMini.setOnClickListener(this);
40 | }
41 |
42 | @Override
43 | protected void getBundleExtras(Bundle extras) {
44 | title = extras.getString("title");
45 | }
46 |
47 | @Override
48 | public void onClick(View v) {
49 | Intent intent;
50 | ActivityOptionsCompat activityOptions;
51 | switch (v.getId()) {
52 | case R.id.btn_open_video: //直接一个页面播放的
53 | intent = new Intent(context, GSYPlayerActivity.class);
54 | intent.putExtra(GSYPlayerActivity.TRANSITION, true);
55 | if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
56 | Pair pair = new Pair<>(mBtnOpenVideo, GSYPlayerActivity.IMG_TRANSITION);
57 | activityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(
58 | context, pair);
59 | ActivityCompat.startActivity(context, intent, activityOptions.toBundle());
60 | } else {
61 | context.startActivity(intent);
62 | context.overridePendingTransition(R.anim.abc_fade_in, R.anim.abc_fade_out);
63 | }
64 | break;
65 | case R.id.btn_rv_player: //普通列表播放,只支持全屏,但是不支持屏幕重力旋转,滑出后不持有
66 | intent = new Intent(context, GSYPlayerRVDisActivity.class);
67 | intent.putExtra("title", getString(R.string.text_rv_player));
68 | activityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(context);
69 | ActivityCompat.startActivity(context, intent, activityOptions.toBundle());
70 | break;
71 | case R.id.btn_rv_player_mini: //支持全屏重力旋转的列表播放,滑动后不会被销毁
72 | intent = new Intent(context, GSYPlayerRVMiniActivity.class);
73 | intent.putExtra("title", getString(R.string.text_rv_player_mini));
74 | activityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(context);
75 | ActivityCompat.startActivity(context, intent, activityOptions.toBundle());
76 | break;
77 | default:
78 | break;
79 | }
80 | }
81 | }
82 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/GalleryActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.os.Bundle;
4 | import android.view.View;
5 | import android.widget.Button;
6 | import android.widget.RadioButton;
7 | import android.widget.TextView;
8 |
9 | import com.base.adev.activity.BaseActivity;
10 | import com.example.dev.R;
11 |
12 | import cn.finalteam.rxgalleryfinal.RxGalleryFinal;
13 | import cn.finalteam.rxgalleryfinal.bean.MediaBean;
14 | import cn.finalteam.rxgalleryfinal.imageloader.ImageLoaderType;
15 | import cn.finalteam.rxgalleryfinal.rxbus.RxBusResultSubscriber;
16 | import cn.finalteam.rxgalleryfinal.rxbus.event.ImageMultipleResultEvent;
17 | import cn.finalteam.rxgalleryfinal.rxbus.event.ImageRadioResultEvent;
18 |
19 | public class GalleryActivity extends BaseActivity {
20 | private String title;
21 |
22 | private Button mBtnOpen;
23 | private RadioButton mRbRadio;
24 | private RadioButton mRbMulti;
25 | private TextView tvPicResEvent;
26 |
27 | @Override
28 | protected void initContentView(Bundle bundle) {
29 | setContentView(R.layout.activity_gallery);
30 | }
31 |
32 | @Override
33 | protected void initView() {
34 | mBtnOpen = (Button) findViewById(R.id.btn_open);
35 | mRbRadio = (RadioButton) findViewById(R.id.rb_radio);
36 | mRbMulti = (RadioButton) findViewById(R.id.rb_multi);
37 | tvPicResEvent = (TextView) findViewById(R.id.tv_picResEvent);
38 | }
39 |
40 | @Override
41 | protected void initLogic() {
42 | mToolbar.setTitle(title);
43 |
44 | mBtnOpen.setOnClickListener(new View.OnClickListener() {
45 | @Override
46 | public void onClick(View v) {
47 | if (mRbRadio.isChecked()) {
48 | RxGalleryFinal
49 | .with(GalleryActivity.this)
50 | .image()
51 | .radio()
52 | .crop()
53 | .imageLoader(ImageLoaderType.GLIDE)
54 | .subscribe(new RxBusResultSubscriber() {
55 | @Override
56 | protected void onEvent(ImageRadioResultEvent imageRadioResultEvent)
57 | throws Exception {
58 | tvPicResEvent.setText("原始路径:\n"
59 | + imageRadioResultEvent.getResult().getOriginalPath()
60 | + "");
61 | }
62 | })
63 | .openGallery();
64 | } else {
65 | RxGalleryFinal
66 | .with(GalleryActivity.this)
67 | .image()
68 | .multiple()
69 | .maxSize(8)
70 | .imageLoader(ImageLoaderType.GLIDE)
71 | .subscribe(new RxBusResultSubscriber() {
72 | @Override
73 | protected void onEvent(ImageMultipleResultEvent imageMultipleResultEvent)
74 | throws Exception {
75 | /**
76 | * 这里使用foreach获取了所有图片的原始路径,
77 | * 根据项目需求分别获取单个图片路径。
78 | */
79 | String multiOriPath = "";
80 | for (MediaBean mediaBean : imageMultipleResultEvent.getResult()) {
81 | multiOriPath += mediaBean.getOriginalPath() + ";\n";
82 | }
83 | tvPicResEvent.setText("已选择"
84 | + imageMultipleResultEvent.getResult().size()
85 | + "张图片,原始路径分别为:\n" + multiOriPath);
86 | }
87 | })
88 | .openGallery();
89 | }
90 | }
91 | });
92 |
93 | }
94 |
95 | @Override
96 | protected void getBundleExtras(Bundle extras) {
97 | title = extras.getString("title");
98 | }
99 |
100 | }
101 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.ashokvarma.bottomnavigation.BottomNavigationBar;
6 | import com.base.adev.activity.BaseTabBottomActivity;
7 | import com.example.dev.R;
8 | import com.example.dev.fragment.DemoFragment;
9 | import com.example.dev.fragment.HomeFragment;
10 | import com.example.dev.fragment.MeFragment;
11 |
12 | public class MainActivity extends BaseTabBottomActivity {
13 |
14 | @Override
15 | protected void initContentView(Bundle bundle) {
16 | setContentView(R.layout.activity_base_tab_bottom);
17 | }
18 |
19 | @Override
20 | protected void initLogic() {
21 | addItem(new HomeFragment(), R.drawable.ic_tab_home_white_24dp, R.string.tab1, R.color.colorPrimary);
22 | addItem(new DemoFragment(), R.drawable.ic_tab_book_white_24dp, R.string.tab2, R.color.colorPrimaryDark);
23 | addItem(new MeFragment(), R.drawable.ic_tab_tv_white_24dp, R.string.tab_me, R.color.colorAccent);
24 |
25 | setNavBarStyle(BottomNavigationBar.MODE_FIXED, BottomNavigationBar.BACKGROUND_STYLE_STATIC);
26 | initialise(R.id.ll_content);
27 | }
28 |
29 | @Override
30 | protected void getBundleExtras(Bundle extras) {
31 |
32 | }
33 |
34 | @Override
35 | public void onTabSelected(int position) {
36 | super.onTabSelected(position);
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/SettingActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.content.DialogInterface;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AlertDialog;
6 | import android.view.View;
7 | import android.widget.LinearLayout;
8 | import android.widget.TextView;
9 |
10 | import com.base.adev.activity.BaseActivity;
11 | import com.base.adev.utils.DataCleanManager;
12 | import com.base.adev.utils.GetFolderSizeManager;
13 | import com.example.dev.R;
14 | import com.example.dev.application.MyApplication;
15 | import com.example.dev.utils.ConstUtil;
16 |
17 | import java.io.File;
18 |
19 | public class SettingActivity extends BaseActivity implements View.OnClickListener {
20 | private String title;
21 | private TextView tvAppVersion;
22 | private TextView tvCache;
23 | private LinearLayout layClearCache;
24 |
25 | @Override
26 | protected void initContentView(Bundle bundle) {
27 | setContentView(R.layout.activity_setting);
28 | }
29 |
30 | @Override
31 | protected void initView() {
32 | tvAppVersion = (TextView) findViewById(R.id.tv_app_version);
33 | layClearCache = (LinearLayout) findViewById(R.id.lay_clear_cache);
34 | layClearCache.setOnClickListener(this);
35 | tvCache = (TextView) findViewById(R.id.tv_cache);
36 | }
37 |
38 | @Override
39 | protected void initLogic() {
40 | mToolbar.setTitle(title);
41 | tvAppVersion.setText(MyApplication.getVersion());
42 |
43 | //缓存
44 | File cachePath = new File(ConstUtil.APP_FILE_PATH);
45 | tvCache.setText(getCacheSize(cachePath));
46 | }
47 |
48 | @Override
49 | protected void getBundleExtras(Bundle extras) {
50 | title = extras.getString("title");
51 | }
52 |
53 | private String getCacheSize(File cachePath) {
54 | String cacheFormatSize;
55 | if (cachePath.exists()) {
56 | long cacheSize = GetFolderSizeManager.getFolderSize(cachePath);
57 | cacheFormatSize = GetFolderSizeManager.getFormatSize(cacheSize);
58 | } else {
59 | cacheFormatSize = "0.0Byte(s)";
60 | }
61 | return cacheFormatSize;
62 | }
63 |
64 | @Override
65 | public void onClick(View view) {
66 | switch (view.getId()) {
67 | case R.id.lay_clear_cache:
68 | dlgConfirmCC();
69 | break;
70 | }
71 | }
72 |
73 | private void dlgConfirmCC() {
74 | new AlertDialog.Builder(context)
75 | .setTitle("提示")
76 | .setMessage("是否清空缓存?")
77 | .setPositiveButton("确定", new DialogInterface.OnClickListener() {
78 | @Override
79 | public void onClick(DialogInterface dialogInterface, int i) {
80 | DataCleanManager.cleanCustomCache(ConstUtil.APP_FILE_PATH);
81 | showShortToast("缓存已清理");
82 | tvCache.setText("0KB");
83 | }
84 | })
85 | .setNegativeButton("取消", null)
86 | .show();
87 | }
88 | }
89 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/TabLayDemoActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.base.adev.activity.BaseTabLayActivity;
6 | import com.example.dev.R;
7 | import com.example.dev.fragment.TabLayFragment;
8 |
9 | public class TabLayDemoActivity extends BaseTabLayActivity {
10 | private String title;
11 |
12 | @Override
13 | protected void initContentView(Bundle bundle) {
14 | setContentView(R.layout.activity_tab_lay_demo);
15 | // 把 BaseTabLayActivity 中的布局拿过来了,方便开发者修改布局样式和主题。
16 | // 直接在 activity_tab_lay_demo.xml 中修改即可,
17 | // 需要注意的是控件初始化操作(initView)已在 BaseTabLayActivity 类中完成,
18 | // 如果继承的是 BaseTabLayActivity,请保证控件 ID 一致。
19 | // 或者直接继承 BaseActivity 实现你的 TabLayout。
20 | }
21 |
22 | @Override
23 | protected void initLogic() {
24 | mToolbar.setTitle(title);
25 |
26 | for (int i = 0; i < 3; i++) {
27 | TabLayFragment fragment = new TabLayFragment();
28 | addFragment(fragment, "TAB " + i);
29 | }
30 | }
31 |
32 | @Override
33 | protected void getBundleExtras(Bundle extras) {
34 | title = extras.getString("title");
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/activity/recycler/RvMultiFuncActivity.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.activity.recycler;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.View;
6 |
7 | import com.base.adev.activity.BaseRecyclerActivity;
8 | import com.chad.library.adapter.base.BaseQuickAdapter;
9 | import com.chad.library.adapter.base.BaseViewHolder;
10 | import com.chad.library.adapter.base.listener.OnItemClickListener;
11 | import com.example.dev.R;
12 | import com.example.dev.bean.ListItemInfo;
13 |
14 | import java.util.ArrayList;
15 | import java.util.List;
16 |
17 | /**
18 | * 继承 BaseRecyclerActivity 实现列表的示例展示,只显示列表的 Activity 继承它就好了。
19 | * 实现更多功能,如侧滑菜单,Item 拖拽,滑动删除 Item 等,mSwipeMenuRecyclerView 设置更多的方法即可。
20 | * 详见与此类同包的其他 activity。
21 | */
22 | public class RvMultiFuncActivity extends BaseRecyclerActivity {
23 | private String title;
24 |
25 | @Override
26 | protected void initContentView(Bundle bundle) {
27 | setContentView(R.layout.activity_rv_demo);
28 | }
29 |
30 | @Override
31 | protected void initLogic() {
32 | mToolbar.setTitle(title);
33 |
34 | // mSwipeMenuRecyclerView.addItemDecoration(new DividerItemDecoration(this, 1));
35 | mSwipeMenuRecyclerView.addOnItemTouchListener(onItemClickListener);
36 | addData();
37 | }
38 |
39 | @Override
40 | protected void getBundleExtras(Bundle extras) {
41 | title = extras.getString("title");
42 | }
43 |
44 | @Override
45 | protected void initItemLayout() {
46 | setLayoutResId(R.layout.item_main);
47 | setListType(LINEAR_LAYOUT_MANAGER, true, false, null);
48 | }
49 |
50 | @Override
51 | protected void MyHolder(BaseViewHolder baseViewHolder, ListItemInfo listItemInfo) {
52 | baseViewHolder.setText(R.id.tv_title, listItemInfo.getTitle());
53 | baseViewHolder.setText(R.id.tv_des, listItemInfo.getSubTitle());
54 | }
55 |
56 | private void addData() {
57 | List list = new ArrayList<>();
58 | String[] titles = getResources().getStringArray(R.array.recycler_item_title);
59 | String[] titlesDes = getResources().getStringArray(R.array.recycler_item_des);
60 | for (int i = 0; i < titles.length; i++) {
61 | list.add(new ListItemInfo(titles[i], titlesDes[i]));
62 | }
63 | mAdapter.addData(list);
64 | }
65 |
66 | private RecyclerView.OnItemTouchListener onItemClickListener = new OnItemClickListener() {
67 | @Override
68 | public void onSimpleItemClick(BaseQuickAdapter adapter, View view, int position) {
69 | Bundle bundle = new Bundle();
70 | switch (position) {
71 | case 0:
72 | bundle.putString("title", mAdapter.getItem(position).getTitle());
73 | readyGo(SwipeRVDemoActivity.class, bundle);
74 | break;
75 | case 1:
76 | break;
77 | }
78 | }
79 | };
80 | }
81 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/adapter/CoverFlowAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.adapter;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 | import android.widget.ImageView;
7 | import android.widget.TextView;
8 |
9 | import com.base.adev.utils.MyBitmapImageViewTarget;
10 | import com.bumptech.glide.Glide;
11 | import com.example.dev.R;
12 | import com.example.dev.bean.ChannelBean;
13 | import com.img.coverflow.widget.ICoverFlowAdapter;
14 |
15 | import java.util.List;
16 |
17 | public class CoverFlowAdapter implements ICoverFlowAdapter {
18 | private List mArray;
19 |
20 | private Context context;
21 |
22 | public CoverFlowAdapter(Context context, List mArray) {
23 | this.context = context;
24 | this.mArray = mArray;
25 | }
26 |
27 | @Override
28 | public int getCount() {
29 | // TODO Auto-generated method stub
30 | return mArray == null ? 0 : mArray.size();
31 | }
32 |
33 | @Override
34 | public Object getItem(int position) {
35 | // TODO Auto-generated method stub
36 | return mArray.get(position);
37 | }
38 |
39 | @Override
40 | public long getItemId(int position) {
41 | // TODO Auto-generated method stub
42 | return position;
43 | }
44 |
45 | @Override
46 | public View getView(int position, View convertView, ViewGroup parent) {
47 | // TODO Auto-generated method stub
48 | Holder holder = null;
49 | if (convertView == null) {
50 | holder = new Holder();
51 | convertView = View.inflate(context, R.layout.coverflow_item_view, null);
52 | holder.ivChannelImg = (ImageView) convertView.findViewById(R.id.iv_channelImg);
53 | holder.tv = (TextView) convertView.findViewById(R.id.tv);
54 | } else {
55 | holder = (Holder) convertView.getTag();
56 | }
57 |
58 | convertView.setTag(holder);
59 | return convertView;
60 | }
61 |
62 | @Override
63 | public void getData(View view, int position) {
64 | Holder holder = (Holder) view.getTag();
65 |
66 | ChannelBean channelBean = mArray.get(position);
67 | Glide.with(context)
68 | .load(channelBean.getImg())
69 | .asBitmap()
70 | .centerCrop()
71 | .into(new MyBitmapImageViewTarget(holder.ivChannelImg));
72 |
73 | holder.tv.setText(channelBean.getName());
74 | }
75 |
76 | public static class Holder {
77 | ImageView ivChannelImg;
78 | public TextView tv;
79 | }
80 |
81 | }
82 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/adapter/MainWidgetAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.adapter;
2 |
3 | import android.support.v7.widget.RecyclerView;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.TextView;
8 |
9 | import com.example.dev.R;
10 | import com.example.dev.bean.ListItemInfo;
11 | import com.example.dev.listener.OnItemClickListener;
12 |
13 | import java.util.List;
14 |
15 | public class MainWidgetAdapter extends RecyclerView.Adapter {
16 |
17 | private List mData;
18 |
19 | private OnItemClickListener mOnItemClickListener;
20 |
21 | public MainWidgetAdapter(List data, OnItemClickListener onItemClickListener) {
22 | this.mData = data;
23 | this.mOnItemClickListener = onItemClickListener;
24 | }
25 |
26 | @Override
27 | public int getItemCount() {
28 | return mData == null ? 0 : mData.size();
29 | }
30 |
31 | @Override
32 | public DefaultViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
33 | return new DefaultViewHolder(LayoutInflater.from(parent.getContext())
34 | .inflate(R.layout.item_main, parent, false));
35 | }
36 |
37 | @Override
38 | public void onBindViewHolder(DefaultViewHolder holder, int position) {
39 | holder.setData(mData.get(position));
40 | holder.setOnItemClickListener(mOnItemClickListener);
41 | }
42 |
43 | class DefaultViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
44 | TextView tvTitle;
45 | TextView tvDescription;
46 | OnItemClickListener mOnItemClickListener;
47 |
48 | public DefaultViewHolder(View itemView) {
49 | super(itemView);
50 | itemView.setOnClickListener(this);
51 | tvTitle = (TextView) itemView.findViewById(R.id.tv_title);
52 | tvDescription = (TextView) itemView.findViewById(R.id.tv_des);
53 | }
54 |
55 | public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
56 | this.mOnItemClickListener = onItemClickListener;
57 | }
58 |
59 | public void setData(ListItemInfo listItemInfo) {
60 | this.tvTitle.setText(listItemInfo.getTitle());
61 | this.tvDescription.setText(listItemInfo.getSubTitle());
62 | }
63 |
64 | @Override
65 | public void onClick(View v) {
66 | if (mOnItemClickListener != null) {
67 | mOnItemClickListener.onItemClick(getAdapterPosition());
68 | }
69 | }
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/adapter/RvVideoMiniAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.adapter;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.FrameLayout;
9 | import android.widget.ImageView;
10 |
11 | import com.example.dev.R;
12 | import com.example.dev.bean.VideoModel;
13 | import com.shuyu.gsyvideoplayer.utils.ListVideoUtil;
14 |
15 | import java.util.List;
16 |
17 | public class RvVideoMiniAdapter extends RecyclerView.Adapter {
18 | public final static String TAG = "RvVideoMiniAdapter";
19 |
20 | private List itemDataList = null;
21 | private Context context = null;
22 | private ListVideoUtil listVideoUtil;
23 |
24 | public RvVideoMiniAdapter(Context context, List itemDataList,
25 | ListVideoUtil listVideoUtil) {
26 | this.itemDataList = itemDataList;
27 | this.context = context;
28 | this.listVideoUtil = listVideoUtil;
29 | }
30 |
31 | @Override
32 | public int getItemCount() {
33 | return itemDataList == null ? 0 : itemDataList.size();
34 | }
35 |
36 | @Override
37 | public int getItemViewType(int position) {
38 | return 1;
39 | }
40 |
41 | @Override
42 | public DefaultViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
43 | return new DefaultViewHolder(LayoutInflater.from(parent.getContext())
44 | .inflate(R.layout.list_video_item_mini, parent, false));
45 | }
46 |
47 | @Override
48 | public void onBindViewHolder(DefaultViewHolder holder, int position) {
49 | holder.setData(position, itemDataList.get(position));
50 | }
51 |
52 | class DefaultViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
53 | FrameLayout listItemContainer;
54 | ImageView listItemBtn;
55 | ImageView imageView;
56 |
57 | public DefaultViewHolder(View itemView) {
58 | super(itemView);
59 | itemView.setOnClickListener(this);
60 | imageView = new ImageView(context);
61 | listItemBtn = (ImageView) itemView.findViewById(R.id.list_item_btn);
62 | listItemContainer = (FrameLayout) itemView.findViewById(R.id.list_item_container);
63 | }
64 |
65 | public void setData(final int position, VideoModel videoModel) {
66 | //增加封面
67 | imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
68 | imageView.setImageResource(R.drawable.ic_test_2);
69 |
70 | listVideoUtil.addVideoPlayer(position, imageView, TAG, listItemContainer, listItemBtn);
71 |
72 | listItemBtn.setOnClickListener(new View.OnClickListener() {
73 | @Override
74 | public void onClick(View v) {
75 | notifyDataSetChanged();
76 | //listVideoUtil.setLoop(true);
77 | listVideoUtil.setPlayPositionAndTag(position, TAG);
78 | final String url = "http://baobab.wdjcdn.com/14564977406580.mp4";
79 | //listVideoUtil.setCachePath(new File(FileUtils.getPath()));
80 | listVideoUtil.startPlay(url);
81 | }
82 | });
83 | }
84 |
85 | @Override
86 | public void onClick(View v) {
87 | }
88 |
89 | }
90 | }
91 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/adapter/SwipeRVAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2016 Yan Zhenjie
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | package com.example.dev.adapter;
17 |
18 | import android.content.Context;
19 | import android.support.v7.widget.RecyclerView;
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.widget.TextView;
24 |
25 | import com.example.dev.R;
26 | import com.example.dev.bean.ChannelBean;
27 | import com.example.dev.listener.OnItemClickListener;
28 | import com.yanzhenjie.recyclerview.swipe.SwipeMenuAdapter;
29 |
30 | import java.util.List;
31 |
32 | public class SwipeRVAdapter extends SwipeMenuAdapter {
33 |
34 | public List mArray;
35 |
36 | private Context context;
37 |
38 | private OnItemClickListener mOnItemClickListener;
39 |
40 | public SwipeRVAdapter(Context context, List mArray) {
41 | this.context = context;
42 | this.mArray = mArray;
43 | }
44 |
45 | public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
46 | this.mOnItemClickListener = onItemClickListener;
47 | }
48 |
49 | @Override
50 | public int getItemCount() {
51 | return mArray == null ? 0 : mArray.size();
52 | }
53 |
54 | @Override
55 | public View onCreateContentView(ViewGroup parent, int viewType) {
56 | return LayoutInflater.from(parent.getContext()).inflate(R.layout.srv_item_demo, parent, false);
57 | }
58 |
59 | @Override
60 | public DefaultViewHolder onCompatCreateViewHolder(View realContentView, int viewType) {
61 | return new DefaultViewHolder(realContentView);
62 | }
63 |
64 | @Override
65 | public void onBindViewHolder(DefaultViewHolder holder, int position) {
66 | holder.setData(mArray.get(position));
67 | holder.setOnItemClickListener(mOnItemClickListener);
68 | }
69 |
70 | static class DefaultViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
71 | TextView tvTitle;
72 | OnItemClickListener mOnItemClickListener;
73 |
74 | public DefaultViewHolder(View itemView) {
75 | super(itemView);
76 | itemView.setOnClickListener(this);
77 | tvTitle = (TextView) itemView.findViewById(R.id.tv_title);
78 | }
79 |
80 | public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
81 | this.mOnItemClickListener = onItemClickListener;
82 | }
83 |
84 | public void setData(ChannelBean channelBean) {
85 | this.tvTitle.setText(channelBean.getName());
86 | }
87 |
88 | @Override
89 | public void onClick(View v) {
90 | if (mOnItemClickListener != null) {
91 | mOnItemClickListener.onItemClick(getAdapterPosition());
92 | }
93 | }
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/adapter/TaskTypeAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.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.BaseAdapter;
8 | import android.widget.TextView;
9 |
10 | import com.example.dev.R;
11 | import com.example.dev.bean.TaskTypeBean;
12 |
13 | import java.util.List;
14 |
15 | public class TaskTypeAdapter extends BaseAdapter {
16 | private Context context;
17 | public List mArray;
18 |
19 | public TaskTypeAdapter(Context context, List mArray) {
20 | this.context = context;
21 | this.mArray = mArray;
22 | }
23 |
24 | @Override
25 | public int getCount() {
26 | return mArray == null ? 0 : mArray.size();
27 | }
28 |
29 | @Override
30 | public Object getItem(int position) {
31 | return mArray.get(position);
32 | }
33 |
34 | @Override
35 | public long getItemId(int position) {
36 | return position;
37 | }
38 |
39 | @Override
40 | public View getView(final int position, View convertView, ViewGroup parent) {
41 | final ViewHolder holder;
42 |
43 | if (convertView == null) {
44 | holder = new ViewHolder();
45 | LayoutInflater inflater = LayoutInflater.from(context);
46 | convertView = inflater.inflate(R.layout.list_item_task_type, null);
47 | holder.tvChannelName = (TextView) convertView.findViewById(R.id.tv_type);
48 |
49 | convertView.setTag(holder);
50 | } else {
51 | holder = (ViewHolder) convertView.getTag();
52 | }
53 |
54 | TaskTypeBean subBean = mArray.get(position);
55 | holder.tvChannelName.setText(subBean.getName());
56 |
57 |
58 | return convertView;
59 | }
60 |
61 | class ViewHolder {
62 | TextView tvChannelName;
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/bean/ChannelBean.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.bean;
2 |
3 | public class ChannelBean {
4 |
5 | private int img;
6 | private String name;
7 |
8 | public int getImg() {
9 | return img;
10 | }
11 |
12 | public void setImg(int img) {
13 | this.img = img;
14 | }
15 |
16 | public String getName() {
17 | return name;
18 | }
19 |
20 | public void setName(String name) {
21 | this.name = name;
22 | }
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/bean/ListItemInfo.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.bean;
2 |
3 | public class ListItemInfo {
4 |
5 | private String title;
6 | private String subTitle;
7 |
8 | public ListItemInfo() {
9 | }
10 |
11 | public ListItemInfo(String title, String subTitle) {
12 | this.title = title;
13 | this.subTitle = subTitle;
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 getSubTitle() {
25 | return subTitle;
26 | }
27 |
28 | public void setSubTitle(String subTitle) {
29 | this.subTitle = subTitle;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/bean/SwitchVideoModel.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.bean;
2 |
3 | public class SwitchVideoModel {
4 | private String url;
5 | private String name;
6 |
7 | public SwitchVideoModel(String name, String url) {
8 | this.name = name;
9 | this.url = url;
10 | }
11 |
12 | public String getUrl() {
13 | return url;
14 | }
15 |
16 | public void setUrl(String url) {
17 | this.url = url;
18 | }
19 |
20 | public String getName() {
21 | return name;
22 | }
23 |
24 | public void setName(String name) {
25 | this.name = name;
26 | }
27 |
28 | @Override
29 | public String toString() {
30 | return this.name;
31 | }
32 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/bean/TaskTypeBean.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.bean;
2 |
3 | public class TaskTypeBean {
4 |
5 | private int id;
6 | private String name;
7 |
8 | public int getId() {
9 | return id;
10 | }
11 |
12 | public void setId(int id) {
13 | this.id = id;
14 | }
15 |
16 | public String getName() {
17 | return name;
18 | }
19 |
20 | public void setName(String name) {
21 | this.name = name;
22 | }
23 |
24 | }
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/bean/VideoModel.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.bean;
2 |
3 | public class VideoModel {
4 | }
5 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/fragment/BlankFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.base.adev.fragment.BaseFragment;
10 | import com.example.dev.R;
11 |
12 | public class BlankFragment extends BaseFragment {
13 | private static final String TAG = "BlankFragment";
14 |
15 | @Override
16 | protected View initContentView(LayoutInflater inflater, @Nullable ViewGroup container,
17 | @Nullable Bundle savedInstanceState) {
18 | view = inflater.inflate(R.layout.fragment_blank, container, false);
19 | return view;
20 | }
21 |
22 | @Override
23 | protected void initView(View view) {
24 |
25 | }
26 |
27 | @Override
28 | protected void initLogic() {
29 |
30 | }
31 |
32 | @Override
33 | protected void getBundleExtras(Bundle bundle) {
34 |
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/fragment/DemoFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.base.adev.fragment.BaseFragment;
10 | import com.example.dev.R;
11 |
12 | public class DemoFragment extends BaseFragment {
13 | private static final String TAG = "DemoFragment";
14 |
15 | @Override
16 | protected View initContentView(LayoutInflater inflater, @Nullable ViewGroup container,
17 | @Nullable Bundle savedInstanceState) {
18 | view = inflater.inflate(R.layout.fg_demo, container, false);
19 | return view;
20 | }
21 |
22 | @Override
23 | protected void initView(View view) {
24 |
25 | }
26 |
27 | @Override
28 | protected void initLogic() {
29 |
30 | }
31 |
32 | @Override
33 | protected void getBundleExtras(Bundle bundle) {
34 |
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/fragment/MeFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.RelativeLayout;
9 | import android.widget.TextView;
10 |
11 | import com.base.adev.fragment.BaseFragment;
12 | import com.example.dev.R;
13 | import com.example.dev.activity.SettingActivity;
14 | import com.example.dev.utils.MyGlideLoadUtil;
15 |
16 | import de.hdodenhof.circleimageview.CircleImageView;
17 |
18 | public class MeFragment extends BaseFragment implements View.OnClickListener {
19 | private static final String TAG = "MeFragment";
20 | private TextView tvMeSetting;
21 | private RelativeLayout rlHeadBg;
22 | private CircleImageView civUserHead;
23 |
24 | @Override
25 | protected View initContentView(LayoutInflater inflater, @Nullable ViewGroup container,
26 | @Nullable Bundle savedInstanceState) {
27 | view = inflater.inflate(R.layout.fragment_me, container, false);
28 | return view;
29 | }
30 |
31 | @Override
32 | protected void initView(View view) {
33 | rlHeadBg = (RelativeLayout) view.findViewById(R.id.rl_head_bg);
34 | civUserHead = (CircleImageView) view.findViewById(R.id.civ_user_head);
35 | tvMeSetting = (TextView) view.findViewById(R.id.tv_me_setting);
36 |
37 | }
38 |
39 | @Override
40 | protected void initLogic() {
41 | setCenterTitle(R.string.tab_me);
42 | tvMeSetting.setOnClickListener(this);
43 | MyGlideLoadUtil.loadCache(context, R.drawable.img_wk, civUserHead);
44 |
45 | }
46 |
47 | @Override
48 | protected void getBundleExtras(Bundle bundle) {
49 |
50 | }
51 |
52 | @Override
53 | public void onClick(View view) {
54 | Bundle bundle = new Bundle();
55 | switch (view.getId()) {
56 | case R.id.tv_me_setting:
57 | bundle.putString("title", getString(R.string.txt_setting));
58 | readyGo(SettingActivity.class, bundle);
59 | break;
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/fragment/TabLayFragment.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import com.base.adev.fragment.BaseFragment;
10 | import com.example.dev.R;
11 |
12 | public class TabLayFragment extends BaseFragment {
13 |
14 | //是否已经加载过数据
15 | private boolean isLoadData = false;
16 |
17 | @Override
18 | protected View initContentView(LayoutInflater inflater, @Nullable ViewGroup container,
19 | @Nullable Bundle savedInstanceState) {
20 | view = inflater.inflate(R.layout.fragment_blank, container, false);
21 | return view;
22 | }
23 |
24 | @Override
25 | protected void initView(View view) {
26 |
27 | }
28 |
29 | @Override
30 | protected void initLogic() {
31 |
32 | //如果没有加载过就加载,否则就不再加载了
33 | if (!isLoadData) {
34 | //加载数据操作
35 |
36 | isLoadData = true;
37 | }
38 | }
39 |
40 | @Override
41 | protected void getBundleExtras(Bundle bundle) {
42 |
43 | }
44 |
45 | @Override
46 | public void onDestroyView() {
47 | super.onDestroyView();
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/listener/OnItemClickListener.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.listener;
2 |
3 | public interface OnItemClickListener {
4 |
5 | void onItemClick(int position);
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/listener/OnTransitionListener.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.listener;
2 |
3 | import android.annotation.TargetApi;
4 | import android.os.Build;
5 | import android.transition.Transition;
6 |
7 | /**
8 | * 重载了过渡动画的方法
9 | */
10 |
11 | @TargetApi(Build.VERSION_CODES.KITKAT)
12 | public class OnTransitionListener implements Transition.TransitionListener {
13 |
14 |
15 | @Override
16 | public void onTransitionStart(Transition transition) {
17 |
18 | }
19 |
20 | @Override
21 | public void onTransitionEnd(Transition transition) {
22 |
23 | }
24 |
25 | @Override
26 | public void onTransitionCancel(Transition transition) {
27 |
28 | }
29 |
30 | @Override
31 | public void onTransitionPause(Transition transition) {
32 |
33 | }
34 |
35 | @Override
36 | public void onTransitionResume(Transition transition) {
37 |
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/listener/SampleVideoListener.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.listener;
2 |
3 | import com.shuyu.gsyvideoplayer.listener.StandardVideoAllCallBack;
4 |
5 | public class SampleVideoListener implements StandardVideoAllCallBack {
6 |
7 | @Override
8 | public void onClickStartIcon(String url, Object... objects) {
9 |
10 | }
11 |
12 | @Override
13 | public void onClickStartError(String url, Object... objects) {
14 |
15 | }
16 |
17 | @Override
18 | public void onClickStop(String url, Object... objects) {
19 |
20 | }
21 |
22 | @Override
23 | public void onClickStopFullscreen(String url, Object... objects) {
24 |
25 | }
26 |
27 | @Override
28 | public void onClickResume(String url, Object... objects) {
29 |
30 | }
31 |
32 | @Override
33 | public void onClickResumeFullscreen(String url, Object... objects) {
34 |
35 | }
36 |
37 | @Override
38 | public void onClickSeekbar(String url, Object... objects) {
39 |
40 | }
41 |
42 | @Override
43 | public void onClickSeekbarFullscreen(String url, Object... objects) {
44 |
45 | }
46 |
47 | @Override
48 | public void onAutoComplete(String url, Object... objects) {
49 |
50 | }
51 |
52 | @Override
53 | public void onEnterFullscreen(String url, Object... objects) {
54 |
55 | }
56 |
57 | @Override
58 | public void onQuitFullscreen(String url, Object... objects) {
59 |
60 | }
61 |
62 | @Override
63 | public void onQuitSmallWidget(String url, Object... objects) {
64 | }
65 |
66 | @Override
67 | public void onEnterSmallWidget(String url, Object... objects) {
68 |
69 | }
70 |
71 | @Override
72 | public void onTouchScreenSeekVolume(String url, Object... objects) {
73 |
74 | }
75 |
76 | @Override
77 | public void onTouchScreenSeekPosition(String url, Object... objects) {
78 |
79 | }
80 |
81 | @Override
82 | public void onTouchScreenSeekLight(String url, Object... objects) {
83 |
84 | }
85 |
86 | @Override
87 | public void onClickStartThumb(String url, Object... objects) {
88 |
89 | }
90 |
91 | @Override
92 | public void onClickBlank(String url, Object... objects) {
93 |
94 | }
95 |
96 | @Override
97 | public void onClickBlankFullscreen(String url, Object... objects) {
98 |
99 | }
100 |
101 | @Override
102 | public void onPrepared(String url, Object... objects) {
103 |
104 | }
105 |
106 | @Override
107 | public void onPlayError(String url, Object... objects) {
108 |
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/utils/ConstUtil.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.utils;
2 |
3 | import android.os.Environment;
4 |
5 | public class ConstUtil {
6 |
7 | public static String SD_PATH = Environment.getExternalStorageDirectory().getPath();
8 | public static String APP_FILE_PATH = SD_PATH + "/BaseDevEg/";
9 | public static String APP_CACHE_PATH = APP_FILE_PATH + "/cache/";
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/utils/MyGlideLoadUtil.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.utils;
2 |
3 | import android.content.Context;
4 | import android.widget.ImageView;
5 |
6 | import com.base.adev.utils.MyBitmapImageViewTarget;
7 | import com.bumptech.glide.Glide;
8 | import com.bumptech.glide.load.engine.DiskCacheStrategy;
9 |
10 | /**
11 | * Glide 加载图片
12 | */
13 | public class MyGlideLoadUtil {
14 |
15 | /**
16 | * 简单加载图片(1)
17 | *
18 | * @param context
19 | * @param picPath
20 | * @param imageView
21 | */
22 | public static void load(Context context, String picPath, ImageView imageView) {
23 | Glide.with(context)
24 | .load(picPath)
25 | .into(imageView);
26 | }
27 |
28 | /**
29 | * 简单加载图片(2)
30 | *
31 | * @param context
32 | * @param picPath
33 | * @param imageView
34 | */
35 | public static void load(Context context, int picPath, ImageView imageView) {
36 | Glide.with(context)
37 | .load(picPath)
38 | .into(imageView);
39 | }
40 |
41 | /**
42 | * 加载图片并设置缓存(1)
43 | *
44 | * @param context
45 | * @param picPath
46 | * @param imageView
47 | */
48 | public static void loadCache(Context context, String picPath, ImageView imageView) {
49 | Glide.with(context)
50 | .load(picPath)
51 | .diskCacheStrategy(DiskCacheStrategy.ALL)
52 | .into(imageView);
53 | }
54 |
55 | /**
56 | * 加载图片并设置缓存(2)
57 | *
58 | * @param context
59 | * @param picPath
60 | * @param imageView
61 | */
62 | public static void loadCache(Context context, int picPath, ImageView imageView) {
63 | Glide.with(context)
64 | .load(picPath)
65 | .diskCacheStrategy(DiskCacheStrategy.ALL)
66 | .into(imageView);
67 | }
68 |
69 | /**
70 | * 加载图片并设置合适大小(1)
71 | *
72 | * @param context
73 | * @param picPath
74 | * @param imageView
75 | */
76 | public static void loadWithCrop(Context context, String picPath, ImageView imageView) {
77 | Glide.with(context)
78 | .load(picPath)
79 | .asBitmap()
80 | .centerCrop()
81 | .into(new MyBitmapImageViewTarget(imageView));
82 | }
83 |
84 | /**
85 | * 加载图片并设置合适大小(2)
86 | *
87 | * @param context
88 | * @param picPath
89 | * @param imageView
90 | */
91 | public static void loadWithCrop(Context context, int picPath, ImageView imageView) {
92 | Glide.with(context)
93 | .load(picPath)
94 | .asBitmap()
95 | .centerCrop()
96 | .into(new MyBitmapImageViewTarget(imageView));
97 | }
98 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/utils/MyGlideModule.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.utils;
2 |
3 | import android.content.Context;
4 |
5 | import com.bumptech.glide.Glide;
6 | import com.bumptech.glide.GlideBuilder;
7 | import com.bumptech.glide.load.engine.cache.DiskLruCacheFactory;
8 | import com.bumptech.glide.module.GlideModule;
9 |
10 | public class MyGlideModule implements GlideModule {
11 | @Override
12 | public void applyOptions(Context context, GlideBuilder builder) {
13 |
14 | // File cacheDir = context.getExternalCacheDir();//指定的是数据的缓存地址
15 | String diskCacheFolder = ConstUtil.APP_CACHE_PATH;
16 | int diskCacheSize = 1024 * 1024 * 30;//最多可以缓存多少字节的数据
17 | //设置磁盘缓存大小和位置
18 | builder.setDiskCache(new DiskLruCacheFactory(diskCacheFolder, "glide", diskCacheSize));
19 | }
20 |
21 | @Override
22 | public void registerComponents(Context context, Glide glide) {
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/view/ListViewDecoration.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.view;
2 |
3 | import android.graphics.Canvas;
4 | import android.graphics.Rect;
5 | import android.graphics.drawable.Drawable;
6 | import android.support.v7.widget.RecyclerView;
7 | import android.view.View;
8 |
9 | import com.example.dev.R;
10 | import com.example.dev.application.MyApplication;
11 | import com.yanzhenjie.recyclerview.swipe.ResCompat;
12 |
13 | public class ListViewDecoration extends RecyclerView.ItemDecoration {
14 |
15 | private Drawable mDrawable;
16 |
17 | public ListViewDecoration() {
18 | mDrawable = ResCompat.getDrawable(MyApplication.getInstance(),R.drawable.divider_recycler);
19 | }
20 |
21 | @Override
22 | public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
23 | final int left = parent.getPaddingLeft();
24 | final int right = parent.getWidth() - parent.getPaddingRight();
25 |
26 | final int childCount = parent.getChildCount();
27 | for (int i = 0; i < childCount - 1; i++) {
28 | final View child = parent.getChildAt(i);
29 | final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
30 | // 以下计算主要用来确定绘制的位置
31 | final int top = child.getBottom() + params.bottomMargin;
32 | final int bottom = top + mDrawable.getIntrinsicHeight();
33 | mDrawable.setBounds(left, top, right, bottom);
34 | mDrawable.draw(c);
35 | }
36 | }
37 |
38 | @Override
39 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
40 | outRect.set(0, 0, 0, mDrawable.getIntrinsicHeight());
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/view/NoticeMF.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.view;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.widget.TextView;
6 |
7 | import com.example.dev.R;
8 | import com.gongwen.marqueen.MarqueeFactory;
9 |
10 | public class NoticeMF extends MarqueeFactory {
11 | private LayoutInflater inflater;
12 |
13 | public NoticeMF(Context mContext) {
14 | super(mContext);
15 | inflater = LayoutInflater.from(mContext);
16 | }
17 |
18 | @Override
19 | public TextView generateMarqueeItemView(String data) {
20 | TextView mView = (TextView) inflater.inflate(R.layout.item_notice_marquee, null);
21 | mView.setText(data);
22 | return mView;
23 | }
24 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/view/SwitchVideoTypeDialog.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.view;
2 |
3 | import android.app.Dialog;
4 | import android.content.Context;
5 | import android.os.Bundle;
6 | import android.util.DisplayMetrics;
7 | import android.view.LayoutInflater;
8 | import android.view.View;
9 | import android.view.Window;
10 | import android.view.WindowManager;
11 | import android.widget.AdapterView;
12 | import android.widget.ArrayAdapter;
13 | import android.widget.ListView;
14 |
15 | import com.example.dev.R;
16 | import com.example.dev.bean.SwitchVideoModel;
17 |
18 | import java.util.List;
19 |
20 |
21 | public class SwitchVideoTypeDialog extends Dialog {
22 |
23 | private Context mContext;
24 |
25 | private ListView listView = null;
26 |
27 | private ArrayAdapter adapter = null;
28 |
29 | private OnListItemClickListener onItemClickListener;
30 |
31 | private List data;
32 |
33 | public interface OnListItemClickListener {
34 | void onItemClick(int position);
35 | }
36 |
37 | public SwitchVideoTypeDialog(Context context) {
38 | super(context, R.style.dialog_style);
39 | this.mContext = context;
40 | }
41 |
42 | @Override
43 | protected void onCreate(Bundle savedInstanceState) {
44 | super.onCreate(savedInstanceState);
45 | }
46 |
47 | public void initList(List data, OnListItemClickListener onItemClickListener) {
48 | this.onItemClickListener = onItemClickListener;
49 | this.data = data;
50 |
51 | LayoutInflater inflater = LayoutInflater.from(mContext);
52 | View view = inflater.inflate(R.layout.switch_video_dialog, null);
53 | listView = (ListView) view.findViewById(R.id.switch_dialog_list);
54 | setContentView(view);
55 | adapter = new ArrayAdapter<>(mContext, R.layout.switch_video_dialog_item, data);
56 | listView.setAdapter(adapter);
57 | listView.setOnItemClickListener(new OnItemClickListener());
58 |
59 | Window dialogWindow = getWindow();
60 | WindowManager.LayoutParams lp = dialogWindow.getAttributes();
61 | DisplayMetrics d = mContext.getResources().getDisplayMetrics(); // 获取屏幕宽、高用
62 | lp.width = (int) (d.widthPixels * 0.8); // 高度设置为屏幕的0.6
63 | dialogWindow.setAttributes(lp);
64 | }
65 |
66 | private class OnItemClickListener implements AdapterView.OnItemClickListener {
67 |
68 | @Override
69 | public void onItemClick(AdapterView> adapterView, View view, int position, long id) {
70 | dismiss();
71 | onItemClickListener.onItemClick(position);
72 | }
73 | }
74 |
75 |
76 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/view/cbview/LocalImageHolderView.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.view.cbview;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.ImageView;
6 |
7 | import com.bigkoo.convenientbanner.holder.Holder;
8 |
9 | /**
10 | * 本地图片Holder例子
11 | */
12 | public class LocalImageHolderView implements Holder {
13 | private ImageView imageView;
14 |
15 | @Override
16 | public View createView(Context context) {
17 | imageView = new ImageView(context);
18 | imageView.setScaleType(ImageView.ScaleType.FIT_XY);
19 | return imageView;
20 | }
21 |
22 | @Override
23 | public void UpdateUI(Context context, int position, Integer data) {
24 | imageView.setImageResource(data);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/java/com/example/dev/view/cbview/NetworkImageHolderView.java:
--------------------------------------------------------------------------------
1 | package com.example.dev.view.cbview;
2 |
3 | import android.content.Context;
4 | import android.view.View;
5 | import android.widget.ImageView;
6 |
7 | import com.base.adev.R;
8 | import com.bigkoo.convenientbanner.holder.Holder;
9 | import com.bumptech.glide.Glide;
10 |
11 | /**
12 | * 网络图片加载例子
13 | */
14 | public class NetworkImageHolderView implements Holder {
15 | private ImageView imageView;
16 |
17 | @Override
18 | public View createView(Context context) {
19 | //你可以通过layout文件来创建,也可以像我一样用代码创建,不一定是Image,任何控件都可以进行翻页
20 | imageView = new ImageView(context);
21 | imageView.setScaleType(ImageView.ScaleType.FIT_XY);
22 | return imageView;
23 | }
24 |
25 | @Override
26 | public void UpdateUI(Context context, int position, String data) {
27 | //设置加载中以及加载失败的图片
28 | Glide.with(context)
29 | .load(data)
30 | .placeholder(R.drawable.ic_default_adimage)
31 | .error(R.drawable.ic_default_adimage)
32 | .into(imageView);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/bottom_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/left_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/left_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/right_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/right_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/anim/top_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/bg_dlg_cus1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/bg_dlg_cus1.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/bg_dlg_cus2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/bg_dlg_cus2.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_eye_grey_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_eye_grey_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_ns1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_ns1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_ns2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_ns2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_ns3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_ns3.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_ns4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_ns4.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_ns5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_ns5.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_tab_book_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_tab_book_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_tab_home_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_tab_home_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/ic_tab_tv_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/ic_tab_tv_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/img_wk.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-hdpi/img_wk.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_book_list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_book_list.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_page_indicator.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_page_indicator.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_page_indicator_focused.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_page_indicator_focused.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_test_0.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_test_0.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_test_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_test_1.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_test_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_test_2.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_test_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_test_3.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_test_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_test_4.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_test_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_test_5.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xhdpi/ic_test_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/drawable-xhdpi/ic_test_6.jpg
--------------------------------------------------------------------------------
/app/src/main/res/drawable/divider_recycler.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_appbar_lay.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
19 |
20 |
26 |
27 |
32 |
33 |
34 |
35 |
39 |
40 |
45 |
46 |
47 |
48 |
57 |
58 |
68 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_base_tab_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_blank.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_bm_img_click.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
13 |
14 |
23 |
24 |
31 |
32 |
37 |
38 |
44 |
45 |
50 |
51 |
56 |
57 |
62 |
63 |
68 |
69 |
74 |
75 |
76 |
77 |
85 |
86 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_cbanner.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
14 |
15 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_city_picker.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
16 |
17 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_coverflow.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
23 |
24 |
28 |
29 |
35 |
36 |
42 |
43 |
44 |
45 |
49 |
50 |
56 |
57 |
63 |
64 |
65 |
66 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_gallery.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
15 |
16 |
23 |
24 |
30 |
31 |
32 |
38 |
39 |
46 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_gsy_player.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_gsy_player_rv_dis.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_gsy_player_rv_mini.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
17 |
18 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_gsy_video.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
17 |
18 |
24 |
25 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_hpplay.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
15 |
16 |
20 |
21 |
26 |
27 |
28 |
33 |
34 |
39 |
40 |
45 |
46 |
51 |
52 |
55 |
56 |
61 |
62 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_like_ios_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
15 |
16 |
21 |
22 |
27 |
28 |
33 |
34 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_material_dlg.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
16 |
17 |
25 |
26 |
35 |
36 |
45 |
46 |
55 |
56 |
65 |
66 |
75 |
76 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_rv_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
16 |
17 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
15 |
16 |
20 |
21 |
24 |
25 |
28 |
29 |
32 |
33 |
36 |
37 |
38 |
39 |
40 |
41 |
44 |
45 |
48 |
49 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_srv_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
16 |
17 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_tab_lay_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
17 |
18 |
24 |
25 |
26 |
31 |
32 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_text_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
16 |
17 |
27 |
28 |
29 |
37 |
38 |
43 |
44 |
51 |
52 |
63 |
64 |
65 |
75 |
76 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_text_input_lay.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
18 |
19 |
20 |
27 |
28 |
32 |
33 |
38 |
39 |
42 |
43 |
50 |
51 |
52 |
53 |
59 |
60 |
70 |
71 |
72 |
73 |
81 |
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/adapter_transformer.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/coverflow_item_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/custom_message_content.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fg_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fg_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_blank.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_me.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
11 |
15 |
16 |
20 |
21 |
28 |
29 |
36 |
37 |
38 |
39 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
19 |
20 |
27 |
28 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/item_notice_marquee.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_item_task_type.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_video_item_dis.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/list_video_item_mini.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
14 |
22 |
23 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/progressbar_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
20 |
21 |
25 |
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/srv_item_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
21 |
22 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/switch_video_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/switch_video_dialog_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_logo_a_collect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/mipmap-hdpi/ic_logo_a_collect.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/array.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | - 0. 网络请求框架
6 | - 1. 多功能 RecyclerView 封装
7 | - 2. 文本类自定义控件集合
8 | - 3. GSYVideoPlayer
9 | - 4. Banner-广告栏控件
10 | - 5. CoverFlow示例
11 | - 6. 省市区三级联动
12 | - 7. 图片/视频文件选择器
13 | - 8. 图片浏览缩放控件
14 | - 9. Material Design系列之TabLayout
15 | - 10. Material Design系列之AppBar
16 | - 11. Material Design系列之TextInputLayout
17 | - 12. Material Dialog示例
18 | - 13. 仿iOS的Dialog
19 | - 14. 乐播投屏 Demo
20 | - 15. MD 商品详情界面示例
21 |
22 |
23 |
24 | - 0. Http 网络请求框架\n
25 | 详见我的 GitHub 开源项目:\n
26 | (1)NoHttpConnecter:https://github.com/lishide/NoHttpConnecter\n
27 | (2)Volley的使用及其工具类的封装:https://github.com/lishide/MyVolley
28 | - 1. RecyclerView 侧滑菜单,Item 拖拽,滑动删除 Item,自动加载更多,
29 | 和 ViewPager、DrawerLayout 结合使用,和任何下拉刷新框架结合使用。\n
30 | RecyclerView 和 Adapter 的封装,简单列表的界面直接继承 BaseRecyclerActivity,
31 | 十几行代码即可出现 List 界面。
32 | - 2. 整理文本类自定义控件
33 | - 3. 视频播放器,HTTPS支持,支持弹幕,支持基本的拖动,声音、亮度调节,支持边播边缓存,
34 | 支持视频本身自带rotation的旋转(90,270之类),重力旋转与手动旋转的同步支持,支持列表播放 ,
35 | 直接添加控件为封面,列表全屏动画,视频加载速度,列表小窗口支持拖动,5.0的过场效果,调整比例,
36 | 多分辨率切换,支持切换播放器,进度条小窗口预览,其他一些小动画效果。
37 | - 4. 通用的广告栏控件,让你轻松实现广告头效果。支持无限循环,可以设置自动翻页和时间,并且提供多种翻页特效。
38 | - 5. 参考ImageCoverFlow-master修改的,使用方法与LIST一样,设置相应的控件、修改imageCoverFlow布局的参数即可。
39 | - 6. CityPicker 高仿iOS 滚轮实现 省市区 城市选择三级联动
40 | - 7. 支持多选、单选、拍摄和裁剪,主题可自定义,无强制绑定第三方图片加载器。
41 | - 8. 支持图片点击放大缩小浏览功能,单张多张图片预览,更多使用参考原作示例。
42 | GitHub地址:https://github.com/bm-x/PhotoView
43 | - 9. Material Design 之 TabLayout 使用
44 | - 10. CoordinatorLayout、CollapsingToolbarLayout、NestedScrollView、FloatingActionButton 等新控件的使用
45 | - 11. TextInputLayout:登录、注册等页面信息验证
46 | - 12. Material Design 风格的自定义Dialog,GitHub地址:https://github.com/drakeet/MaterialDialog
47 | - 13. 仿iOS的Dialog示例
48 | - 14. 演示“乐播投屏 SDK”投屏与镜像的接入和关闭等功能
49 | - 15. MD 商品详情界面示例\n
50 | 仿某些购物 App 的商品展示界面,及多种布局交互动画的简单使用
51 |
52 |
53 |
54 |
55 | - RecyclerView(侧滑菜单和Refresh、LoadMore嵌套)
56 |
57 |
58 |
59 | - RecyclerView(侧滑菜单和下拉刷新、上拉加载嵌套)
60 |
61 |
62 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 | #546E7A
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 | 60dp
7 | 10dp
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
13 |
14 |
20 |
21 |
33 |
34 |
35 |
38 |
39 |
40 |
41 |
46 |
47 |
55 |
56 |
64 |
65 |
73 |
74 |
78 |
79 |
--------------------------------------------------------------------------------
/base-android-dev/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/base-android-dev/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 | apply plugin: 'com.github.dcendents.android-maven'
3 |
4 | group = 'com.github.lishide'
5 |
6 | android {
7 | def globalConfiguration = rootProject.extensions.getByName("ext")
8 | compileSdkVersion globalConfiguration.androidCompileSdkVersion
9 | buildToolsVersion globalConfiguration.androidBuildToolsVersion
10 | defaultConfig {
11 |
12 | minSdkVersion globalConfiguration.androidMinSdkVersion
13 | targetSdkVersion globalConfiguration.androidTargetSdkVersion
14 | versionCode globalConfiguration.versionCode
15 | versionName globalConfiguration.versionName
16 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
17 | }
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 | sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
25 | }
26 |
27 | dependencies {
28 | compile fileTree(dir: 'libs', include: ['*.jar'])
29 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
30 | exclude group: 'com.android.support', module: 'support-annotations'
31 | })
32 | testCompile 'junit:junit:4.12'
33 | def viewDps = rootProject.ext.viewDependencies
34 | def dataDps = rootProject.ext.dataDependencies
35 |
36 | //图片加载库 Glide
37 | compile dataDps.glide
38 | // gson
39 | compile dataDps.gson
40 | //BottomNavigation
41 | compile viewDps.bnb
42 | //SwipeRecyclerView
43 | compile viewDps.swipeRecyclerView
44 | //RecyclerView 的强大的 BaseAdapter
45 | compile viewDps.baservadapter
46 | }
47 |
--------------------------------------------------------------------------------
/base-android-dev/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in C:\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 | #1.support-v7-appcompat
19 | -keep public class android.support.v7.widget.** { *; }
20 | -keep public class android.support.v7.internal.widget.** { *; }
21 | -keep public class android.support.v7.internal.view.menu.** { *; }
22 |
23 | -keep public class * extends android.support.v4.view.ActionProvider {
24 | public (android.content.Context);
25 | }
26 |
27 | #2.rxjava
28 | -keep class rx.schedulers.Schedulers {
29 | public static ;
30 | }
31 | -keep class rx.schedulers.ImmediateScheduler {
32 | public ;
33 | }
34 | -keep class rx.schedulers.TestScheduler {
35 | public ;
36 | }
37 | -keep class rx.schedulers.Schedulers {
38 | public static ** test();
39 | }
40 | -dontwarn sun.misc.**
41 | -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
42 | long producerIndex;
43 | long consumerIndex;
44 | }
45 | -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
46 | rx.internal.util.atomic.LinkedQueueNode producerNode;
47 | }
48 | -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
49 | rx.internal.util.atomic.LinkedQueueNode consumerNode;
50 | }
51 |
52 | #3.retrolambda
53 | -dontwarn java.lang.invoke.*
54 |
55 | #4.support-v4
56 | -keep class android.support.v4.** { *; }
57 | -keep interface android.support.v4.** { *; }
58 |
59 | #5.ucrop
60 | -dontwarn com.yalantis.ucrop**
61 | -keep class com.yalantis.ucrop** { *; }
62 | -keep interface com.yalantis.ucrop** { *; }
63 |
64 | #6.photoview
65 | -keep class uk.co.senab.photoview** { *; }
66 | -keep interface uk.co.senab.photoview** { *; }
67 |
68 | #7.rxgalleryfinal
69 | -keep class cn.finalteam.rxgalleryfinal.ui.widget** { *; }
70 |
71 | -keepclassmembers class * extends android.app.Activity {
72 | public void *(android.view.View);
73 | }
74 | -keepclassmembers enum * {
75 | public static **[] values();
76 | public static ** valueOf(java.lang.String);
77 | }
78 | -keep class * implements android.os.Parcelable {
79 | public static final android.os.Parcelable$Creator *;
80 | }
81 | -keepclassmembers class **.R$* {
82 | public static ;
83 | }
84 |
85 | -keepattributes *Annotation*
86 | -keepclasseswithmembernames class * {
87 | native ;
88 | }
89 | -keepclassmembers public class * extends android.view.View {
90 | void set*(***);
91 | *** get*();
92 | }
93 | #8.gsyvideoplayer
94 | -keep class tv.danmaku.ijk.** { *; }
95 | -dontwarn tv.danmaku.ijk.**
96 | -keep class com.shuyu.gsyvideoplayer.** { *; }
97 | -dontwarn com.shuyu.gsyvideoplayer.**
98 | #9.BaseRecyclerViewAdapterHelper
99 | -keep class com.chad.library.adapter.** {
100 | *;
101 | }
--------------------------------------------------------------------------------
/base-android-dev/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/assets/fonts/digital-7.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/assets/fonts/digital-7.ttf
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/activity/BaseTabLayActivity.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.activity;
2 |
3 | import android.support.design.widget.TabLayout;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.view.ViewPager;
6 |
7 | import com.base.adev.R;
8 | import com.base.adev.adapter.BaseFragmentStatePagerAdapter;
9 |
10 | public abstract class BaseTabLayActivity extends BaseActivity {
11 | protected TabLayout mTabLayout;
12 | protected ViewPager mViewPager;
13 | protected BaseFragmentStatePagerAdapter mBaseFragmentStatePagerAdapter;
14 |
15 | @Override
16 | protected void initView() {
17 | mTabLayout = (TabLayout) findViewById(R.id.tl_base_tab);
18 | mViewPager = (ViewPager) findViewById(R.id.vp_base_pager);
19 | mBaseFragmentStatePagerAdapter = new BaseFragmentStatePagerAdapter(getSupportFragmentManager());
20 | mViewPager.setAdapter(mBaseFragmentStatePagerAdapter);
21 | mTabLayout.setupWithViewPager(mViewPager);
22 | }
23 |
24 | protected void addFragment(Fragment fragment, String title) {
25 | mBaseFragmentStatePagerAdapter.addFragment(fragment, title);
26 | mBaseFragmentStatePagerAdapter.notifyDataSetChanged();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/adapter/BaseFragmentStatePagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.adapter;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentStatePagerAdapter;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | /**
11 | * FragmentStatePagerAdapter 和前面的 FragmentPagerAdapter 一样,是继承自 PagerAdapter。
12 | * 但和 FragmentPagerAdapter 不一样的是,
13 | * 正如其类名中的 'State' 所表明的含义一样,该 PagerAdapter 的实现将只保留当前页面,
14 | * 当页面离开视线后,就会被消除,释放其资源;
15 | * 而在页面需要显示时,生成新的页面(就像 ListView 的实现一样)。
16 | * 这么实现的好处就是当拥有大量的页面时,不必在内存中占用大量的内存。
17 | */
18 | public class BaseFragmentStatePagerAdapter extends FragmentStatePagerAdapter {
19 | private final List mFragmentList = new ArrayList<>();
20 | private final List mTitleList = new ArrayList<>();
21 |
22 | public BaseFragmentStatePagerAdapter(FragmentManager fm) {
23 | super(fm);
24 | }
25 |
26 | public void addFragment(Fragment fragment, String title) {
27 | mFragmentList.add(fragment);
28 | mTitleList.add(title);
29 | }
30 |
31 | @Override
32 | public CharSequence getPageTitle(int position) {
33 | return mTitleList.get(position);
34 | }
35 |
36 | @Override
37 | public Fragment getItem(int position) {
38 | return mFragmentList.get(position);
39 | }
40 |
41 | @Override
42 | public int getCount() {
43 | return mFragmentList.size();
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/application/BaseApplication.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.application;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 |
6 | public class BaseApplication extends Application {
7 | public static Context context;
8 |
9 | @Override
10 | public void onCreate() {
11 | super.onCreate();
12 | context = getApplicationContext();
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/utils/ClickUtil.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.utils;
2 |
3 | import android.util.Log;
4 |
5 | public class ClickUtil {
6 |
7 | private static long lastClickTime = 0;
8 | private static long DIFF = 500;
9 | private static int lastButtonId = -1;
10 |
11 | /**
12 | * 判断两次点击的间隔,如果小于1000,则认为是多次无效点击
13 | *
14 | * @return
15 | */
16 | public static boolean isFastDoubleClick() {
17 | return isFastDoubleClick(-1, DIFF);
18 | }
19 |
20 | /**
21 | * 判断两次点击的间隔,如果小于1000,则认为是多次无效点击
22 | *
23 | * @return
24 | */
25 | public static boolean isFastDoubleClick(int buttonId) {
26 | return isFastDoubleClick(buttonId, DIFF);
27 | }
28 |
29 | /**
30 | * 判断两次点击的间隔,如果小于diff,则认为是多次无效点击
31 | *
32 | * @param diff
33 | * @return
34 | */
35 | public static boolean isFastDoubleClick(int buttonId, long diff) {
36 | long time = System.currentTimeMillis();
37 | long timeD = time - lastClickTime;
38 | Log.e("xxxx", "lastButtonId = " + lastButtonId + " buttonId = " + buttonId);
39 | if (lastButtonId == buttonId && lastClickTime > 0 && timeD < diff) {
40 | Log.e("isFastDoubleClick", "短时间内按钮多次触发");
41 | return true;
42 | }
43 |
44 | lastClickTime = time;
45 | lastButtonId = buttonId;
46 | return false;
47 | }
48 | }
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/utils/DataCleanManager.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.utils;
2 |
3 | /**
4 | * 文 件 名: DataCleanManager.java
5 | * 描 述: 主要功能有清除内/外缓存,清除数据库,清除sharedPreference,清除files和清除自定义目录
6 | */
7 |
8 | import android.content.Context;
9 | import android.os.Environment;
10 |
11 | import java.io.File;
12 |
13 | /**
14 | * 本应用数据清除管理器
15 | */
16 | public class DataCleanManager {
17 | /**
18 | * 清除本应用内部缓存(/data/data/com.xxx.xxx/cache)
19 | *
20 | * @param context
21 | */
22 | public static void cleanInternalCache(Context context) {
23 | deleteFilesByDirectory(context.getCacheDir());
24 | }
25 |
26 | /**
27 | * 清除本应用所有数据库(/data/data/com.xxx.xxx/databases)
28 | *
29 | * @param context
30 | */
31 | public static void cleanDatabases(Context context) {
32 | deleteFilesByDirectory(new File("/data/data/"
33 | + context.getPackageName() + "/databases"));
34 | }
35 |
36 | /**
37 | * * 清除本应用SharedPreference(/data/data/com.xxx.xxx/shared_prefs)
38 | *
39 | * @param context
40 | */
41 | public static void cleanSharedPreference(Context context) {
42 | deleteFilesByDirectory(new File("/data/data/"
43 | + context.getPackageName() + "/shared_prefs"));
44 | }
45 |
46 | /**
47 | * 按名字清除本应用数据库
48 | *
49 | * @param context
50 | * @param dbName
51 | */
52 | public static void cleanDatabaseByName(Context context, String dbName) {
53 | context.deleteDatabase(dbName);
54 | }
55 |
56 | /**
57 | * 清除/data/data/com.xxx.xxx/files下的内容
58 | *
59 | * @param context
60 | */
61 | public static void cleanFiles(Context context) {
62 | deleteFilesByDirectory(context.getFilesDir());
63 | }
64 |
65 | /**
66 | * * 清除外部cache下的内容(/mnt/sdcard/android/data/com.xxx.xxx/cache)
67 | *
68 | * @param context
69 | */
70 | public static void cleanExternalCache(Context context) {
71 | if (Environment.getExternalStorageState().equals(
72 | Environment.MEDIA_MOUNTED)) {
73 | deleteFilesByDirectory(context.getExternalCacheDir());
74 | }
75 | }
76 |
77 | /**
78 | * 清除自定义路径下的文件,使用需小心,请不要误删。而且只支持目录下的文件删除
79 | *
80 | * @param filePath
81 | */
82 | public static void cleanCustomCache(String filePath) {
83 | deleteFilesByDirectory(new File(filePath));
84 | }
85 |
86 | /**
87 | * 清除本应用所有的数据
88 | *
89 | * @param context
90 | * @param filepath
91 | */
92 | public static void cleanApplicationData(Context context, String... filepath) {
93 | cleanInternalCache(context);
94 | cleanExternalCache(context);
95 | cleanDatabases(context);
96 | cleanSharedPreference(context);
97 | cleanFiles(context);
98 | for (String filePath : filepath) {
99 | cleanCustomCache(filePath);
100 | }
101 | }
102 |
103 | /**
104 | * 删除方法 这里只会删除某个文件夹下的文件,如果传入的directory是个文件,将不做处理
105 | *
106 | * @param directory
107 | */
108 | private static void deleteFilesByDirectory(File directory) {
109 | if (directory != null && directory.exists() && directory.isDirectory()) {
110 | for (File item : directory.listFiles()) {
111 | item.delete();
112 | }
113 | }
114 | }
115 | }
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/utils/GetFolderSizeManager.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.utils;
2 |
3 | import android.text.TextUtils;
4 |
5 | import java.io.File;
6 | import java.math.BigDecimal;
7 |
8 | public class GetFolderSizeManager {
9 | /**
10 | * 获取文件夹大小
11 | *
12 | * @param file File实例
13 | * @return long
14 | */
15 | public static long getFolderSize(File file) {
16 | long size = 0;
17 | try {
18 | File[] fileList = file.listFiles();
19 | for (int i = 0; i < fileList.length; i++) {
20 | if (fileList[i].isDirectory()) {
21 | size = size + getFolderSize(fileList[i]);
22 |
23 | } else {
24 | size = size + fileList[i].length();
25 |
26 | }
27 | }
28 | } catch (Exception e) {
29 | // TODO Auto-generated catch block
30 | e.printStackTrace();
31 | }
32 | //return size/1048576;
33 | return size;
34 | }
35 |
36 | /**
37 | * 删除指定目录下文件及目录
38 | *
39 | * @param deleteThisPath
40 | * @param filePath
41 | * @return
42 | */
43 | public void deleteFolderFile(String filePath, boolean deleteThisPath) {
44 | if (!TextUtils.isEmpty(filePath)) {
45 | try {
46 | File file = new File(filePath);
47 | if (file.isDirectory()) {// 处理目录
48 | File files[] = file.listFiles();
49 | for (int i = 0; i < files.length; i++) {
50 | deleteFolderFile(files[i].getAbsolutePath(), true);
51 | }
52 | }
53 | if (deleteThisPath) {
54 | if (!file.isDirectory()) {// 如果是文件,删除
55 | file.delete();
56 | } else {// 目录
57 | if (file.listFiles().length == 0) {// 目录下没有文件或者目录,删除
58 | file.delete();
59 | }
60 | }
61 | }
62 | } catch (Exception e) {
63 | // TODO Auto-generated catch block
64 | e.printStackTrace();
65 | }
66 | }
67 | }
68 |
69 | /**
70 | * 格式化单位
71 | *
72 | * @param size
73 | * @return
74 | */
75 | public static String getFormatSize(double size) {
76 | double kiloByte = size / 1024;
77 | if (kiloByte < 1) {
78 | return size + "Byte(s)";
79 | }
80 |
81 | double megaByte = kiloByte / 1024;
82 | if (megaByte < 1) {
83 | BigDecimal result1 = new BigDecimal(Double.toString(kiloByte));
84 | return result1.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString() + "KB";
85 | }
86 |
87 | double gigaByte = megaByte / 1024;
88 | if (gigaByte < 1) {
89 | BigDecimal result2 = new BigDecimal(Double.toString(megaByte));
90 | return result2.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString() + "MB";
91 | }
92 |
93 | double teraBytes = gigaByte / 1024;
94 | if (teraBytes < 1) {
95 | BigDecimal result3 = new BigDecimal(Double.toString(gigaByte));
96 | return result3.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString() + "GB";
97 | }
98 | BigDecimal result4 = new BigDecimal(teraBytes);
99 | return result4.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString() + "TB";
100 | }
101 | }
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/utils/MyBitmapImageViewTarget.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.utils;
2 |
3 | import android.graphics.Bitmap;
4 | import android.graphics.drawable.Drawable;
5 | import android.widget.ImageView;
6 | import android.widget.ImageView.ScaleType;
7 |
8 | import com.bumptech.glide.request.animation.GlideAnimation;
9 | import com.bumptech.glide.request.target.BitmapImageViewTarget;
10 |
11 | /**
12 | * 为了解决Glide图片centerCrop()计算错误,导致图片显示变形,在不同的情况下把ImageView设置不同的ScaleType
13 | */
14 | public class MyBitmapImageViewTarget extends BitmapImageViewTarget {
15 |
16 | public MyBitmapImageViewTarget(ImageView view) {
17 | super(view);
18 | }
19 |
20 | @Override
21 | public void onResourceReady(Bitmap bitmap, GlideAnimation anim) {
22 | if (bitmap != null && view.getScaleType() != ScaleType.FIT_XY) {
23 | view.setScaleType(ScaleType.FIT_XY);
24 | }
25 | super.onResourceReady(bitmap, anim);
26 | }
27 |
28 | @Override
29 | protected void setResource(Bitmap resource) {
30 | super.setResource(resource);
31 | }
32 |
33 | @Override
34 | public void onLoadFailed(Exception e, Drawable errorDrawable) {
35 | if (errorDrawable != null && view != null && view.getScaleType() != ScaleType.CENTER_CROP) {
36 | view.setScaleType(ScaleType.CENTER_CROP);
37 | }
38 | super.onLoadFailed(e, errorDrawable);
39 | }
40 |
41 | @Override
42 | public void onLoadStarted(Drawable placeholder) {
43 | if (placeholder != null && placeholder != null && view != null && view.getScaleType() != ScaleType.CENTER_CROP) {
44 | view.setScaleType(ScaleType.CENTER_CROP);
45 | }
46 | super.onLoadStarted(placeholder);
47 | }
48 |
49 | @Override
50 | public void onLoadCleared(Drawable placeholder) {
51 | if (placeholder != null && placeholder != null && view != null && view.getScaleType() != ScaleType.CENTER_CROP) {
52 | view.setScaleType(ScaleType.CENTER_CROP);
53 | }
54 | super.onLoadCleared(placeholder);
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/utils/ScreenUtil.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.utils;
2 |
3 | import android.content.Context;
4 | import android.content.res.Resources;
5 | import android.util.DisplayMetrics;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.WindowManager;
9 | import android.widget.ListAdapter;
10 | import android.widget.ListView;
11 |
12 | public class ScreenUtil {
13 | /**
14 | * 获取屏幕的大小
15 | *
16 | * @param context 当前上下文
17 | * @return 屏幕尺寸对象
18 | */
19 | public static Screen getScreenPix(Context context) {
20 | DisplayMetrics dm = new DisplayMetrics();
21 | WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
22 | windowManager.getDefaultDisplay().getMetrics(dm);
23 | return new Screen(dm.widthPixels, dm.heightPixels);
24 | }
25 |
26 | /**
27 | * 获取屏幕的宽
28 | *
29 | * @param context 当前上下文
30 | * @return 屏幕宽
31 | */
32 | public static int getScreenWidthPix(Context context) {
33 | DisplayMetrics dm = new DisplayMetrics();
34 | WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
35 | windowManager.getDefaultDisplay().getMetrics(dm);
36 | return dm.widthPixels;
37 | }
38 |
39 | /**
40 | * 获取屏幕的高
41 | *
42 | * @param context 当前上下文
43 | * @return 屏幕高
44 | */
45 | public static int getScreenHeightPix(Context context) {
46 | DisplayMetrics dm = new DisplayMetrics();
47 | WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
48 | windowManager.getDefaultDisplay().getMetrics(dm);
49 | return dm.heightPixels;
50 | }
51 |
52 | /**
53 | * 屏幕信息
54 | *
55 | * @author wangyang
56 | */
57 | public static class Screen {
58 | // 屏幕宽
59 | public int widthPixels;
60 | // 屏幕高
61 | public int heightPixels;
62 |
63 | public Screen() {
64 | }
65 |
66 | public Screen(int widthPixels, int heightPixels) {
67 | this.widthPixels = widthPixels;
68 | this.heightPixels = heightPixels;
69 | }
70 | }
71 |
72 | /**
73 | * 获取屏幕密度
74 | *
75 | * @return float
76 | * @throws
77 | */
78 | public static float getDensity(Context context) {
79 | DisplayMetrics dm = new DisplayMetrics();
80 | dm = context.getResources().getDisplayMetrics();
81 | return dm.density;
82 | }
83 |
84 | /**
85 | * dp转px
86 | *
87 | * @param dpValue dp
88 | * @return int px
89 | * @throws
90 | */
91 | public static int dp2px(Context context, float dpValue) {
92 | return (int) (dpValue * getDensity(context) + 0.5f);
93 | }
94 |
95 | /**
96 | * px 转 dp
97 | *
98 | * @param pxValue px
99 | * @return int dp
100 | * @throws
101 | */
102 | public static int px2dp(Context context, float pxValue) {
103 | return (int) (pxValue / getDensity(context) + 0.5f);
104 | }
105 |
106 | /**
107 | * 获取状态栏高度
108 | *
109 | * @return int
110 | * @throws
111 | */
112 | public static int getStatusBarHeight() {
113 | return Resources.getSystem().getDimensionPixelSize(Resources.getSystem().
114 | getIdentifier("status_bar_height", "dimen", "android"));
115 | }
116 |
117 | /**
118 | * 动态设置ListView的高度
119 | *
120 | * @param listView
121 | */
122 | public static void setListViewHeightBasedOnChildren(ListView listView) {
123 | if (listView == null) return;
124 |
125 | ListAdapter listAdapter = listView.getAdapter();
126 | if (listAdapter == null) {
127 | // pre-condition
128 | return;
129 | }
130 |
131 | int totalHeight = 0;
132 | for (int i = 0; i < listAdapter.getCount(); i++) {
133 | View listItem = listAdapter.getView(i, null, listView);
134 | listItem.measure(0, 0);
135 | totalHeight += listItem.getMeasuredHeight();
136 | }
137 |
138 | ViewGroup.LayoutParams params = listView.getLayoutParams();
139 | params.height = totalHeight + (listView.getDividerHeight() * (listAdapter.getCount() - 1));
140 | listView.setLayoutParams(params);
141 | }
142 | }
143 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/view/LedTextView.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.view;
2 |
3 | import android.content.Context;
4 | import android.content.res.AssetManager;
5 | import android.graphics.Typeface;
6 | import android.util.AttributeSet;
7 | import android.widget.TextView;
8 |
9 | import java.io.File;
10 |
11 | public class LedTextView extends TextView {
12 | private static final String FONTS_FOLDER = "fonts";
13 | private static final String FONT_DIGITAL_7 = FONTS_FOLDER + File.separator
14 | + "digital-7.ttf";
15 |
16 | public LedTextView(Context context, AttributeSet attrs, int defStyle) {
17 | super(context, attrs, defStyle);
18 | init(context);
19 | }
20 |
21 | public LedTextView(Context context, AttributeSet attrs) {
22 | super(context, attrs);
23 | init(context);
24 | }
25 |
26 | public LedTextView(Context context) {
27 | super(context);
28 | init(context);
29 | }
30 |
31 | private void init(Context context) {
32 | AssetManager assets = context.getAssets();
33 | final Typeface font = Typeface.createFromAsset(assets, FONT_DIGITAL_7);
34 | setTypeface(font);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/view/MarqueeTextView.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.view;
2 |
3 | import android.content.Context;
4 | import android.graphics.Canvas;
5 | import android.os.Handler;
6 | import android.os.Message;
7 | import android.util.AttributeSet;
8 | import android.widget.TextView;
9 |
10 | public class MarqueeTextView extends TextView {
11 |
12 | private boolean mStopMarquee;//是否停止滚动
13 | private String mText;//文本内容
14 | private float mCoordinateX = 800;//当前滚动位置
15 | private float mCoordinateY = 150;//当前滚动位置
16 | private float mTextWidth;//文本宽度
17 | private int mScrollWidth = 800;//滚动区域宽度
18 | private int speed = 1;//滚动速度
19 |
20 | public float getCurrentPosition() {
21 | return mCoordinateX;
22 | }
23 |
24 | public void setCurrentPosition(float mCoordinateX) {
25 | this.mCoordinateX = mCoordinateX;
26 | }
27 |
28 | public float getCoordinateY() {
29 | return mCoordinateY;
30 | }
31 |
32 | public void setCoordinateY(float mCoordinateY) {
33 | this.mCoordinateY = mCoordinateY;
34 | }
35 |
36 | public int getScrollWidth() {
37 | return mScrollWidth;
38 | }
39 |
40 | public void setScrollWidth(int mScrollWidth) {
41 | this.mScrollWidth = mScrollWidth;
42 | }
43 |
44 | public int getSpeed() {
45 | return speed;
46 | }
47 |
48 | public void setSpeed(int speed) {
49 | this.speed = speed;
50 | }
51 |
52 | public MarqueeTextView(Context context, AttributeSet attrs) {
53 | super(context, attrs);
54 | }
55 |
56 | public void setText(String text) {
57 | this.mText = text;
58 | mTextWidth = getPaint().measureText(mText);
59 | //mTextWidth = 1280;
60 | if (mHandler.hasMessages(0))
61 | mHandler.removeMessages(0);
62 | mHandler.sendEmptyMessageDelayed(0, 10);
63 | }
64 |
65 | @Override
66 | protected void onAttachedToWindow() {
67 | mStopMarquee = false;
68 | if (!isEmpty(mText))
69 | mHandler.sendEmptyMessageDelayed(0, 2000);
70 | super.onAttachedToWindow();
71 | }
72 |
73 | public static boolean isEmpty(String str) {
74 | return str == null || str.length() == 0;
75 | }
76 |
77 | @Override
78 | protected void onDetachedFromWindow() {
79 | mStopMarquee = true;
80 | if (mHandler.hasMessages(0))
81 | mHandler.removeMessages(0);
82 | super.onDetachedFromWindow();
83 | }
84 |
85 | @Override
86 | protected void onDraw(Canvas canvas) {
87 | super.onDraw(canvas);
88 | if (!isEmpty(mText))
89 | canvas.drawText(mText, mCoordinateX, mCoordinateY, getPaint());
90 | }
91 |
92 | private Handler mHandler = new Handler() {
93 | @Override
94 | public void handleMessage(Message msg) {
95 | switch (msg.what) {
96 | case 0:
97 | if (mCoordinateX < (-mTextWidth)) {//文字滚动完了,从滚动区域的右边出来
98 | mCoordinateX = mScrollWidth;
99 | invalidate();
100 | if (!mStopMarquee) {
101 | sendEmptyMessageDelayed(0, 500);
102 | }
103 | } else {
104 | mCoordinateX -= speed;
105 | invalidate();
106 | if (!mStopMarquee) {
107 | sendEmptyMessageDelayed(0, 30);
108 | }
109 | }
110 |
111 | break;
112 | }
113 | super.handleMessage(msg);
114 | }
115 | };
116 |
117 | }
118 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/java/com/base/adev/view/ToastView.java:
--------------------------------------------------------------------------------
1 | package com.base.adev.view;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.widget.TextView;
7 | import android.widget.Toast;
8 |
9 | import com.base.adev.R;
10 |
11 | import java.util.Timer;
12 | import java.util.TimerTask;
13 |
14 | public class ToastView {
15 |
16 | public static Toast toast;
17 | private int time;
18 | private Timer timer;
19 |
20 | public ToastView(Context context, String text) {
21 | LayoutInflater inflater = LayoutInflater.from(context);
22 | View view = inflater.inflate(R.layout.toast_view, null);
23 | TextView t = (TextView) view.findViewById(R.id.toast_text);
24 | t.setText(text);
25 | if (toast != null) {
26 | toast.cancel();
27 | }
28 | toast = new Toast(context);
29 | toast.setDuration(Toast.LENGTH_SHORT);
30 | toast.setView(view);
31 | }
32 |
33 | public ToastView(Context context, int text) {
34 | LayoutInflater inflater = LayoutInflater.from(context);
35 | View view = inflater.inflate(R.layout.toast_view, null);
36 | TextView t = (TextView) view.findViewById(R.id.toast_text);
37 | t.setText(text);
38 | if (toast != null) {
39 | toast.cancel();
40 | }
41 | toast = new Toast(context);
42 | // toast.setDuration(Toast.LENGTH_LONG);
43 | toast.setView(view);
44 | }
45 |
46 | //设置toast显示位置
47 | public void setGravity(int gravity, int xOffset, int yOffset) {
48 | //toast.setGravity(Gravity.CENTER, 0, 0); //居中显示
49 | toast.setGravity(gravity, xOffset, yOffset);
50 | }
51 |
52 | //设置toast显示时间
53 | public void setDuration(int duration) {
54 | toast.setDuration(duration);
55 | }
56 |
57 | //设置toast显示时间(自定义时间)
58 | public void setLongTime(int duration) {
59 | //toast.setDuration(duration);
60 | time = duration;
61 | timer = new Timer();
62 | timer.schedule(new TimerTask() {
63 | @Override
64 | public void run() {
65 | // TODO Auto-generated method stub
66 | if (time - 1000 >= 0) {
67 | show();
68 | time = time - 1000;
69 | } else {
70 | timer.cancel();
71 | }
72 | }
73 | }, 0, 1000);
74 | }
75 |
76 | public void show() {
77 | toast.show();
78 | }
79 |
80 | public static void cancel() {
81 | if (toast != null) {
82 | toast.cancel();
83 | }
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/anim/actionsheet_dialog_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/anim/actionsheet_dialog_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/anim/m_switcher_vertical_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/anim/m_switcher_vertical_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/actionsheet_bottom_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/actionsheet_bottom_normal.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/actionsheet_bottom_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/actionsheet_bottom_pressed.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/actionsheet_middle_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/actionsheet_middle_normal.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/actionsheet_middle_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/actionsheet_middle_pressed.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/actionsheet_single_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/actionsheet_single_normal.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/actionsheet_single_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/actionsheet_single_pressed.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/actionsheet_top_normal.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/actionsheet_top_normal.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/actionsheet_top_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/actionsheet_top_pressed.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/alert_bg.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/alert_bg.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/alert_btn_left_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/alert_btn_left_pressed.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/alert_btn_right_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/alert_btn_right_pressed.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/alert_btn_single_pressed.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/alert_btn_single_pressed.9.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/ic_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/ic_back.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/ic_default_adimage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/ic_default_adimage.jpg
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable-hdpi/trans_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/drawable-hdpi/trans_bg.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable/actionsheet_bottom_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable/actionsheet_middle_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable/actionsheet_single_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable/actionsheet_top_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable/alertdialog_left_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable/alertdialog_right_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable/alertdialog_single_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/drawable/toast_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/layout/base_activity_tab_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
17 |
18 |
24 |
25 |
26 |
31 |
32 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/layout/layout_toolbar.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/layout/toast_view.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
13 |
14 |
19 |
20 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/layout/view_actionsheet.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
22 |
23 |
29 |
30 |
35 |
36 |
37 |
38 |
48 |
49 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/layout/view_alertdialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
20 |
21 |
31 |
32 |
37 |
38 |
42 |
43 |
52 |
53 |
58 |
59 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/mipmap-xhdpi/navigation_back_white.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/mipmap-xhdpi/navigation_back_white.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/base-android-dev/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 | #00000000
8 | #000000
9 | #c6c6c6
10 | #037BFF
11 | #FD4A2E
12 | #8F8F8F
13 |
14 | #FF222222
15 | #FFEEEEEE
16 |
17 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/values/ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BaseAndroidDev
3 | 网络连接失败
4 | 88:88:88
5 |
6 |
7 |
--------------------------------------------------------------------------------
/base-android-dev/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
28 |
29 |
30 |
34 |
35 |
36 |
45 |
46 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | apply from: 'dependencies.gradle'
3 |
4 | buildscript {
5 | repositories {
6 | jcenter()
7 | }
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.0.0'
10 | classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
11 | // NOTE: Do not place your application dependencies here; they belong
12 | // in the individual module build.gradle files
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | jcenter()
19 | maven { url 'https://jitpack.io' }
20 | }
21 | }
22 |
23 | task clean(type: Delete) {
24 | delete rootProject.buildDir
25 | }
26 |
--------------------------------------------------------------------------------
/dependencies.gradle:
--------------------------------------------------------------------------------
1 | ext {
2 | //Android
3 | androidBuildToolsVersion = "26.0.2"
4 | androidMinSdkVersion = 16
5 | androidTargetSdkVersion = 25
6 | androidCompileSdkVersion = 25
7 | supportLibraryVersion = '25.3.1'
8 | otherLibraryVersion = '25.3.1'
9 | applicationId = 'com.example.dev'
10 | versionCode = 1
11 | versionName = '1.0'
12 | constraintLayout = '1.0.2'
13 |
14 | //ViewLibraries
15 | bnb = '1.4.1'
16 | citypickerview = '1.0.0'
17 | rxgalleryfinal = '0.0.9'
18 | materialdialog = '1.3.1'
19 | circleimageview = '2.1.0'
20 | swipeRecyclerView = '1.0.4'
21 | svprogresshud = '1.0.6'
22 | photoview = '1.4.1'
23 | convenientbanner = '2.0.5'
24 | vptransforms = '1.2.32@aar'
25 | lsdImgCoverFlow = 'v1.0.0'
26 | GSYVideoPlayer = '2.0.8'
27 | baservadapter = '2.9.3'
28 | gwMarqueeLib = '1.0.4'
29 |
30 | //DataLibraries
31 | volley = '1.0.19'
32 | glide = '3.7.0'
33 | gson = '2.8.2'
34 |
35 | androidDependencies = [
36 | appcompat_v7 : "com.android.support:appcompat-v7:${supportLibraryVersion}",
37 | support_v4 : "com.android.support:support-v4:${supportLibraryVersion}",
38 | recyclerView : "com.android.support:recyclerview-v7:${supportLibraryVersion}",
39 | cardview_v7 : "com.android.support:cardview-v7:${supportLibraryVersion}",
40 | design : "com.android.support:design:${supportLibraryVersion}",
41 | constraintLayout: "com.android.support.constraint:constraint-layout:${constraintLayout}",
42 | ]
43 |
44 | viewDependencies = [
45 | //BottomNavigation
46 | bnb : "com.ashokvarma.android:bottom-navigation-bar:${bnb}",
47 |
48 | //省市区三级联动
49 | citypickerview : "liji.library.dev:citypickerview:${citypickerview}",
50 |
51 | //图片/视频文件选择器
52 | rxgalleryfinal : "cn.finalteam.rxgalleryfinal:library:${rxgalleryfinal}",
53 |
54 | //Material Design 风格的自定义 Dialog
55 | materialdialog : "me.drakeet.materialdialog:library:${materialdialog}",
56 |
57 | //A circular ImageView for Android
58 | circleimageview : "de.hdodenhof:circleimageview:${circleimageview}",
59 |
60 | //SwipeRecyclerView
61 | swipeRecyclerView: "com.yanzhenjie:recyclerview-swipe:${swipeRecyclerView}",
62 |
63 | //精仿 iOS 的提示库 SVProgressHUD
64 | svprogresshud : "com.bigkoo:svprogresshud:${svprogresshud}",
65 |
66 | //图片浏览缩放控件
67 | photoview : "com.bm.photoview:library:${photoview}",
68 |
69 | //banner
70 | convenientbanner : "com.bigkoo:convenientbanner:${convenientbanner}",
71 | vptransforms : "com.ToxicBakery.viewpager.transforms:view-pager-transforms:${vptransforms}",
72 |
73 | // CoverFlow
74 | lsdImgCoverFlow : "com.github.lishide:ImgCoverFlow:${lsdImgCoverFlow}",
75 |
76 | //GSYVideoPlayer 视频播放器
77 | GSYVideoPlayer : "com.shuyu:GSYVideoPlayer:${GSYVideoPlayer}",
78 |
79 | //RecyclerView 的强大的 BaseAdapter
80 | baservadapter : "com.github.CymChad:BaseRecyclerViewAdapterHelper:${baservadapter}",
81 | gwMarqueeLib : "com.gongwen:marqueelibrary:${gwMarqueeLib}",
82 | ]
83 |
84 | dataDependencies = [
85 | volley: "com.mcxiaoke.volley:library:${volley}",
86 | glide : "com.github.bumptech.glide:glide:${glide}",
87 | gson : "com.google.code.gson:gson:${gson}",
88 | ]
89 | }
90 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/lishide/BaseAndroidDev/cdd4de40b6be59fe3ae469e6f9929363751c1d74/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Oct 27 19:56:07 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':base-android-dev'
2 |
--------------------------------------------------------------------------------