├── .gitignore
├── APTTest
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── apttest
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── apt_annotation
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── ljf
│ │ └── apt_annotation
│ │ └── BindView.java
├── apt_library
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── apt_library
│ │ │ └── BindViewTools.java
│ │ └── res
│ │ └── values
│ │ └── strings.xml
├── apt_processor
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ └── java
│ │ └── com
│ │ └── ljf
│ │ └── apt_processor
│ │ ├── BindViewProcessor.java
│ │ └── ClassCreatorProxy.java
├── build.gradle
└── settings.gradle
├── ContentProvider
├── .gitignore
├── build.gradle
├── gradle.properties
├── provider
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── contentprovider
│ │ │ ├── Animal.kt
│ │ │ ├── App.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── MyContentProvider.kt
│ │ │ ├── OpenHelper.kt
│ │ │ └── User.kt
│ │ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── resolver
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── contentresolver
│ │ │ └── MainActivity.kt
│ │ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
└── settings.gradle
├── EXOPlayer
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── exoplayer
│ │ │ ├── MainActivity.java
│ │ │ └── video
│ │ │ ├── EventLogger.java
│ │ │ └── PlayerActivity.java
│ │ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── list_divider.xml
│ │ ├── player_activity.xml
│ │ └── track_selection_dialog.xml
│ │ ├── menu
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── bg.png
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── preview1.gif
├── preview2.gif
└── settings.gradle
├── GestureDetector
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── lin
│ │ │ └── gesturedetector
│ │ │ ├── BottomFragment.java
│ │ │ ├── MyViewGroup.java
│ │ │ └── SecondActivity.java
│ │ └── res
│ │ ├── layout
│ │ ├── activity_second.xml
│ │ ├── view_bottom.xml
│ │ ├── view_fragment.xml
│ │ └── view_top.xml
│ │ ├── mipmap-hdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-mdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxhdpi
│ │ └── ic_launcher.png
│ │ ├── mipmap-xxxhdpi
│ │ └── ic_launcher.png
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── preview.gif
└── settings.gradle
├── GreenDao
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── greendao
│ │ │ ├── Animal.java
│ │ │ ├── App.kt
│ │ │ ├── DaoOpenHelper.kt
│ │ │ ├── DataBaseManager.kt
│ │ │ ├── MainActivity.kt
│ │ │ ├── MigrationHelper.java
│ │ │ ├── OpenHelper.kt
│ │ │ └── greendao
│ │ │ ├── AnimalDao.java
│ │ │ ├── DaoMaster.java
│ │ │ └── DaoSession.java
│ │ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
└── settings.gradle
├── GuideRecyclerView
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── guiderecyclerview
│ │ │ ├── FragmentAdapter.java
│ │ │ ├── GuideRecyclerView.java
│ │ │ ├── GuideSlideView.java
│ │ │ ├── GuideSlideView2.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MineFragment.java
│ │ │ └── RecyclerViewAdapter.java
│ │ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── fragment_mine.xml
│ │ ├── view_guiderecyclerview.xml
│ │ ├── view_guideslide.xml
│ │ ├── view_lineview.xml
│ │ ├── viewholder_guide.xml
│ │ └── viewholder_guide2.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── preview.gif
└── settings.gradle
├── Indicator
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── indicator
│ │ │ ├── Indicator.java
│ │ │ ├── LoopAdapter.java
│ │ │ ├── LoopOnPageChangeListener.java
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── layout
│ │ └── activity_main.xml
│ │ ├── menu
│ │ └── menu_main.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_app_guide_white_point.png
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── preview.gif
└── settings.gradle
├── Paging
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── paging
│ │ │ ├── BookPageContainer.java
│ │ │ ├── BookPageView.java
│ │ │ └── MainActivity.java
│ │ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ └── ic_launcher_background.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── view_bookpage_container.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── bg_pager.jpeg
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── raw
│ │ └── a.txt
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── preview1.gif
├── preview2.gif
├── preview3.gif
└── settings.gradle
├── README.md
├── ScrollScale
├── .gitignore
├── app
│ ├── .gitignore
│ ├── build.gradle
│ └── src
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ └── com
│ │ │ └── ljf
│ │ │ └── scrollscale
│ │ │ ├── MainActivity.java
│ │ │ ├── fragment
│ │ │ └── RainbowFragment.java
│ │ │ └── views
│ │ │ ├── ScaleScrollView.java
│ │ │ ├── TabView.java
│ │ │ └── ViewPagerInScroll.java
│ │ └── res
│ │ ├── drawable
│ │ └── bg_select.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── fragment_listview.xml
│ │ ├── fragment_rainbow.xml
│ │ └── item.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── bg2.png
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── preview.gif
└── settings.gradle
└── ijkPlayer
├── .gitignore
├── app
├── .gitignore
├── build.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── ljf
│ │ └── ijkplayer
│ │ ├── IjkPlayerListener.java
│ │ ├── MyActivity.java
│ │ ├── SimpleIjkPlayerListener.java
│ │ └── VideoViewIjk.java
│ ├── jniLibs
│ ├── arm64-v8a
│ │ ├── libijkffmpeg.so
│ │ ├── libijkplayer.so
│ │ └── libijksdl.so
│ ├── armeabi-v7a
│ │ ├── libijkffmpeg.so
│ │ ├── libijkplayer.so
│ │ └── libijksdl.so
│ └── armeabi
│ │ ├── libijkffmpeg.so
│ │ ├── libijkplayer.so
│ │ └── libijksdl.so
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ └── ic_launcher_background.xml
│ ├── layout
│ └── activity_my.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── values-v19
│ └── styles.xml
│ └── values
│ ├── attrs.xml
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── ijkplayer-java
├── .gitignore
├── build.gradle
├── gradle.properties
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── tv
│ │ └── danmaku
│ │ └── ijk
│ │ └── media
│ │ └── player
│ │ └── ApplicationTest.java
│ └── main
│ ├── .classpath
│ ├── .project
│ ├── .settings
│ └── org.eclipse.jdt.core.prefs
│ ├── AndroidManifest.xml
│ ├── java
│ └── tv
│ │ └── danmaku
│ │ └── ijk
│ │ └── media
│ │ └── player
│ │ ├── AbstractMediaPlayer.java
│ │ ├── AndroidMediaPlayer.java
│ │ ├── IMediaPlayer.java
│ │ ├── ISurfaceTextureHolder.java
│ │ ├── ISurfaceTextureHost.java
│ │ ├── IjkLibLoader.java
│ │ ├── IjkMediaCodecInfo.java
│ │ ├── IjkMediaMeta.java
│ │ ├── IjkMediaPlayer.java
│ │ ├── IjkTimedText.java
│ │ ├── MediaInfo.java
│ │ ├── MediaPlayerProxy.java
│ │ ├── TextureMediaPlayer.java
│ │ ├── annotations
│ │ ├── AccessedByNative.java
│ │ └── CalledByNative.java
│ │ ├── exceptions
│ │ └── IjkMediaException.java
│ │ ├── ffmpeg
│ │ └── FFmpegApi.java
│ │ ├── misc
│ │ ├── AndroidMediaFormat.java
│ │ ├── AndroidTrackInfo.java
│ │ ├── IAndroidIO.java
│ │ ├── IMediaDataSource.java
│ │ ├── IMediaFormat.java
│ │ ├── ITrackInfo.java
│ │ ├── IjkMediaFormat.java
│ │ └── IjkTrackInfo.java
│ │ └── pragma
│ │ ├── DebugLog.java
│ │ └── Pragma.java
│ ├── project.properties
│ └── res
│ └── values
│ └── strings.xml
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | */.idea/*
3 | */app/proguard-rules.pro
4 | */app/src/androidTest/*
5 | */app/src/test/*
6 | */app/build/*
7 | */app/*.iml
8 | */.gradle
9 | */gradle.properties
10 | */gradle/wrapper/gradle-wrapper.jar
11 | */gradle/wrapper/gradle-wrapper.properties
12 | */gradlew
13 | */gradlew.bat
14 | .DS_Store
15 |
--------------------------------------------------------------------------------
/APTTest/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | .idea
3 | *.iml
4 | apt_library/build
5 | local.properties
6 |
--------------------------------------------------------------------------------
/APTTest/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 28
5 | defaultConfig {
6 | applicationId "com.ljf.apttest"
7 | minSdkVersion 19
8 | targetSdkVersion 28
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(include: ['*.jar'], dir: 'libs')
23 | implementation 'com.android.support.constraint:constraint-layout:1.1.3'
24 | testImplementation 'junit:junit:4.12'
25 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
26 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
27 | implementation project(':apt_library')
28 | implementation project(':apt_annotation')
29 | annotationProcessor project(':apt_processor')
30 | }
31 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/java/com/ljf/apttest/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.ljf.apttest;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.TextView;
7 |
8 | import com.ljf.apt_annotation.BindView;
9 | import com.ljf.apt_library.BindViewTools;
10 |
11 | public class MainActivity extends Activity {
12 |
13 | @BindView(R.id.textView)
14 | TextView textview;
15 | @BindView(R.id.button)
16 | TextView button;
17 |
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | super.onCreate(savedInstanceState);
21 | setContentView(R.layout.activity_main);
22 | BindViewTools.bind(this);
23 |
24 | textview.setText("ok");
25 | button.setOnClickListener(new View.OnClickListener() {
26 | @Override
27 | public void onClick(View v) {
28 | textview.setText("onclick");
29 | }
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
23 |
24 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/APTTest/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | APTTest
3 |
4 |
--------------------------------------------------------------------------------
/APTTest/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/APTTest/apt_annotation/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java-library'
2 |
3 | dependencies {
4 | implementation fileTree(dir: 'libs', include: ['*.jar'])
5 | }
6 |
7 | sourceCompatibility = "7"
8 | targetCompatibility = "7"
9 |
--------------------------------------------------------------------------------
/APTTest/apt_annotation/src/main/java/com/ljf/apt_annotation/BindView.java:
--------------------------------------------------------------------------------
1 | package com.ljf.apt_annotation;
2 |
3 | import java.lang.annotation.ElementType;
4 | import java.lang.annotation.Retention;
5 | import java.lang.annotation.RetentionPolicy;
6 | import java.lang.annotation.Target;
7 |
8 | /**
9 | * Created by mr.lin on 2019/3/5
10 | */
11 | @Retention(RetentionPolicy.CLASS)
12 | @Target(ElementType.FIELD)
13 | public @interface BindView {
14 | int value();
15 | }
16 |
--------------------------------------------------------------------------------
/APTTest/apt_library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 28
5 |
6 |
7 |
8 | defaultConfig {
9 | minSdkVersion 19
10 | targetSdkVersion 28
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 |
25 | }
26 |
27 | dependencies {
28 | implementation fileTree(include: ['*.jar'], dir: 'libs')
29 | implementation 'com.android.support:appcompat-v7:28.0.0'
30 | testImplementation 'junit:junit:4.12'
31 | androidTestImplementation 'com.android.support.test:runner:1.0.2'
32 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
33 | implementation project(':apt_annotation')
34 | }
35 |
--------------------------------------------------------------------------------
/APTTest/apt_library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
--------------------------------------------------------------------------------
/APTTest/apt_library/src/main/java/com/ljf/apt_library/BindViewTools.java:
--------------------------------------------------------------------------------
1 | package com.ljf.apt_library;
2 |
3 | import android.app.Activity;
4 |
5 | import java.lang.reflect.InvocationTargetException;
6 | import java.lang.reflect.Method;
7 |
8 | /**
9 | * Created by mr.lin on 2019/3/6
10 | */
11 | public class BindViewTools {
12 | public static void bind(Activity activity) {
13 | Class clazz = activity.getClass();
14 | try {
15 | Class bindViewClass = Class.forName(clazz.getName() + "_ViewBinding");
16 | Method method = bindViewClass.getMethod("bind", activity.getClass());
17 | method.invoke(bindViewClass.newInstance(), activity);
18 | } catch (ClassNotFoundException e) {
19 | e.printStackTrace();
20 | } catch (IllegalAccessException e) {
21 | e.printStackTrace();
22 | } catch (InstantiationException e) {
23 | e.printStackTrace();
24 | } catch (NoSuchMethodException e) {
25 | e.printStackTrace();
26 | } catch (InvocationTargetException e) {
27 | e.printStackTrace();
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/APTTest/apt_library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | apt_library
3 |
4 |
--------------------------------------------------------------------------------
/APTTest/apt_processor/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'java-library'
2 |
3 | dependencies {
4 | implementation fileTree(include: ['*.jar'], dir: 'libs')
5 | implementation project(':apt_annotation')
6 | implementation 'com.google.auto.service:auto-service:1.0-rc4'
7 | implementation 'com.squareup:javapoet:1.10.0'
8 | }
9 |
10 | sourceCompatibility = "7"
11 | targetCompatibility = "7"
12 |
--------------------------------------------------------------------------------
/APTTest/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.2.1'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/APTTest/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':apt_annotation', ':apt_processor', ':apt_library'
2 |
--------------------------------------------------------------------------------
/ContentProvider/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea
5 | .DS_Store
6 | /build
7 | /captures
8 | .externalNativeBuild
9 |
10 | /provider/build
11 | /provider/proguard-rules.pro
12 | /provider/*.iml
13 | /provider/src/androidTest
14 | /provider/src/test
15 |
16 | /resolver/build
17 | /resolver/proguard-rules.pro
18 | /resolver/*.iml
19 | /resolver/src/androidTest
20 | /resolver/src/test
--------------------------------------------------------------------------------
/ContentProvider/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.1.51'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.0.1'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/ContentProvider/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 |
--------------------------------------------------------------------------------
/ContentProvider/provider/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ContentProvider/provider/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 |
7 | android {
8 | compileSdkVersion 26
9 | defaultConfig {
10 | applicationId "com.ljf.contentprovider"
11 | minSdkVersion 19
12 | targetSdkVersion 26
13 | versionCode 1
14 | versionName "1.0"
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | implementation fileTree(dir: 'libs', include: ['*.jar'])
26 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
27 | }
28 |
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
26 |
27 |
28 |
29 |
32 |
33 |
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/java/com/ljf/contentprovider/Animal.kt:
--------------------------------------------------------------------------------
1 | package com.ljf.contentprovider
2 |
3 | /**
4 | * Created by mr.lin on 2018/5/30.
5 | */
6 | class Animal(var name: String, var type: String)
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/java/com/ljf/contentprovider/App.kt:
--------------------------------------------------------------------------------
1 | package com.ljf.contentprovider
2 |
3 | /**
4 | * Created by mr.lin on 2018/5/30.
5 | */
6 | import android.app.Application
7 |
8 | /**
9 | * Created by mr.lin on 2018/5/28.
10 | */
11 | class App : Application() {
12 |
13 | companion object {
14 | private var instance: Application? = null
15 | fun instance(): Application {
16 | return instance!!
17 | }
18 | }
19 |
20 | override fun onCreate() {
21 | super.onCreate()
22 | instance = this
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/java/com/ljf/contentprovider/MyContentProvider.kt:
--------------------------------------------------------------------------------
1 | package com.ljf.contentprovider
2 |
3 | import android.content.ContentProvider
4 | import android.content.ContentValues
5 | import android.content.UriMatcher
6 | import android.content.UriMatcher.NO_MATCH
7 | import android.database.Cursor
8 | import android.database.sqlite.SQLiteDatabase
9 | import android.database.sqlite.SQLiteOpenHelper
10 | import android.net.Uri
11 |
12 | /**
13 | * Created by mr.lin on 2018/5/30.
14 | *
15 | * MyContentProvider
16 | */
17 | class MyContentProvider : ContentProvider() {
18 |
19 | companion object {
20 | val AUTHORITY = "com.ljf.contentprovider.MyContentProvider"
21 | val TABLE_USER = 1
22 | val TABLE_ANIMAL = 2
23 | }
24 |
25 | lateinit var dbHelper: SQLiteOpenHelper
26 | lateinit var db: SQLiteDatabase
27 | lateinit var match: UriMatcher
28 |
29 | override fun insert(uri: Uri, values: ContentValues?): Uri {
30 | db.insert(getTableName(uri), null, values)
31 | return uri
32 | }
33 |
34 | override fun query(uri: Uri, projection: Array?, selection: String?, selectionArgs: Array?, sortOrder: String?): Cursor {
35 | return db.query(getTableName(uri), projection, selection, selectionArgs, null, null, sortOrder)
36 | }
37 |
38 | override fun onCreate(): Boolean {
39 | dbHelper = OpenHelper(context)
40 | db = dbHelper.writableDatabase
41 | match = UriMatcher(NO_MATCH)
42 | match.addURI(AUTHORITY, "user", TABLE_USER)
43 | match.addURI(AUTHORITY, "animal", TABLE_ANIMAL)
44 | return true
45 | }
46 |
47 | override fun update(uri: Uri, values: ContentValues?, selection: String?, selectionArgs: Array?): Int {
48 | return db.update(getTableName(uri), values, selection, selectionArgs)
49 | }
50 |
51 | override fun delete(uri: Uri, selection: String?, selectionArgs: Array?): Int {
52 | return db.delete(getTableName(uri), selection, selectionArgs)
53 | }
54 |
55 | override fun getType(uri: Uri?): String {
56 | return ""
57 | }
58 |
59 | private fun getTableName(uri: Uri): String {
60 | when (match.match(uri)) {
61 | TABLE_USER -> return "User"
62 | TABLE_ANIMAL -> return "Animal"
63 | }
64 | return ""
65 | }
66 | }
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/java/com/ljf/contentprovider/OpenHelper.kt:
--------------------------------------------------------------------------------
1 | package com.ljf.contentprovider
2 |
3 | import android.content.Context
4 | import android.database.sqlite.SQLiteDatabase
5 | import android.database.sqlite.SQLiteOpenHelper
6 |
7 | /**
8 | * Created by mr.lin on 2018/5/28.
9 | */
10 | class OpenHelper(context: Context?) : SQLiteOpenHelper(context, "provider.db", null, 1) {
11 | override fun onCreate(db: SQLiteDatabase?) {
12 | db?.execSQL("create table User (name text,age integer)")
13 | db?.execSQL("create table Animal (name text,type text)")
14 | }
15 |
16 | override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
17 | }
18 | }
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/java/com/ljf/contentprovider/User.kt:
--------------------------------------------------------------------------------
1 | package com.ljf.contentprovider
2 |
3 | /**
4 | * Created by mr.lin on 2018/5/30.
5 | */
6 | class User(var name: String, var age: Int)
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
22 |
23 |
28 |
29 |
34 |
35 |
40 |
41 |
46 |
47 |
53 |
54 |
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/provider/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ContentProvider
3 |
4 |
--------------------------------------------------------------------------------
/ContentProvider/provider/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | android {
5 | compileSdkVersion 26
6 |
7 |
8 |
9 | defaultConfig {
10 | applicationId "com.ljf.contentresolver"
11 | minSdkVersion 19
12 | targetSdkVersion 26
13 | versionCode 1
14 | versionName "1.0"
15 |
16 | }
17 |
18 | buildTypes {
19 | release {
20 | minifyEnabled false
21 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22 | }
23 | }
24 |
25 | }
26 |
27 | dependencies {
28 | implementation fileTree(dir: 'libs', include: ['*.jar'])
29 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
30 | }
31 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
22 |
23 |
28 |
29 |
34 |
35 |
40 |
41 |
46 |
47 |
53 |
54 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ContentProvider/resolver/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ContentResolver
3 |
4 |
--------------------------------------------------------------------------------
/ContentProvider/resolver/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ContentProvider/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':provider', ':resolver'
2 |
--------------------------------------------------------------------------------
/EXOPlayer/.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 |
--------------------------------------------------------------------------------
/EXOPlayer/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/EXOPlayer/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "26.0.0"
6 | defaultConfig {
7 | applicationId "com.ljf.exoplayer"
8 | minSdkVersion 15
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:25.3.1'
28 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
29 | compile 'com.android.support:design:25.3.1'
30 | testCompile 'junit:junit:4.12'
31 | compile 'com.google.android.exoplayer:exoplayer:r2.0.0'
32 | }
33 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/java/com/ljf/exoplayer/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.ljf.exoplayer;
2 |
3 | import android.app.ActivityOptions;
4 | import android.content.Intent;
5 | import android.net.Uri;
6 | import android.os.Build;
7 | import android.os.Bundle;
8 | import android.support.v7.app.AppCompatActivity;
9 | import android.view.View;
10 | import android.widget.ImageView;
11 |
12 | import com.ljf.exoplayer.video.PlayerActivity;
13 |
14 | public class MainActivity extends AppCompatActivity {
15 |
16 | ImageView imageView;
17 |
18 | String mp4 = "https://healthstation.blob.core.chinacloudapi.cn/video/sample.mp4";
19 | String hls = "http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8";
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_main);
25 | initVideoView();
26 | }
27 |
28 | private void initVideoView() {
29 | imageView = (ImageView) findViewById(R.id.imageview);
30 | findViewById(R.id.mp4).setOnClickListener(new View.OnClickListener() {
31 | public void onClick(View v) {
32 | goActivity(mp4);
33 | }
34 | });
35 | findViewById(R.id.hls).setOnClickListener(new View.OnClickListener() {
36 | public void onClick(View v) {
37 | goActivity(hls);
38 | }
39 | });
40 | }
41 |
42 | private void goActivity(String url) {
43 | Intent intent = new Intent(MainActivity.this, PlayerActivity.class);
44 | intent.setData(Uri.parse(url)); //传入视频地址 在PlayerActivity内会根据后缀的不同区分不同的资源
45 | intent.setAction(PlayerActivity.ACTION_VIEW);
46 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { //ShareElement 效果
47 | startActivity(intent, ActivityOptions.makeSceneTransitionAnimation(MainActivity.this, imageView, "shareImage").toBundle());
48 | } else {
49 | startActivity(intent);
50 | }
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/layout/list_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
20 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/layout/player_activity.xml:
--------------------------------------------------------------------------------
1 |
15 |
22 |
23 |
31 |
32 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/layout/track_selection_dialog.xml:
--------------------------------------------------------------------------------
1 |
2 |
16 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-xxhdpi/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-xxhdpi/bg.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | EXOPlayer
3 | Settings
4 |
5 |
6 | Permission to access storage was denied
7 | Protected content not supported on API levels below 18
8 |
9 | This device does not support the required DRM scheme
10 |
11 | An unknown DRM error occurred
12 | Unexpected intent action: %1$s
13 | Unable to query device decoders
14 | This device does not provide a decoder for %1$s
15 |
16 | This device does not provide a secure decoder for %1$s
17 | Unable to instantiate decoder %1$s
18 |
19 | Media includes video tracks, but none are playable by this device
20 |
21 | Media includes audio tracks, but none are playable by this device
22 | Video
23 |
24 | Audio
25 |
26 | Text
27 | Retry
28 | Disabled
29 |
30 | Default
31 | Default (none)
32 | Enable random adaptation
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/EXOPlayer/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/EXOPlayer/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/EXOPlayer/preview1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/preview1.gif
--------------------------------------------------------------------------------
/EXOPlayer/preview2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/EXOPlayer/preview2.gif
--------------------------------------------------------------------------------
/EXOPlayer/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/GestureDetector/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/GestureDetector/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/GestureDetector/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.lin.gesturedetector"
9 | minSdkVersion 9
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.1.1'
26 | }
27 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/java/com/lin/gesturedetector/BottomFragment.java:
--------------------------------------------------------------------------------
1 | package com.lin.gesturedetector;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ArrayAdapter;
10 | import android.widget.ListView;
11 |
12 | import com.lin.gesturedetector.R;
13 |
14 | import java.util.ArrayList;
15 |
16 | /**
17 | * Created by ljf on 2016-04-11.
18 | */
19 | public class BottomFragment extends Fragment {
20 |
21 | private ListView listView;
22 | private ArrayAdapter arrayAdapter;
23 | private ArrayList list;
24 |
25 | @Override
26 | public void onCreate(Bundle savedInstanceState) {
27 | super.onCreate(savedInstanceState);
28 | }
29 |
30 | @Nullable
31 | @Override
32 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
33 | View view = LayoutInflater.from(getContext()).inflate(R.layout.view_fragment, null);
34 | listView = (ListView) view.findViewById(R.id.fragment_listview);
35 | list = new ArrayList();
36 | for (int i = 0; i < 15; i++) {
37 | list.add(i);
38 | }
39 | arrayAdapter = new ArrayAdapter(getContext(), android.R.layout.simple_expandable_list_item_1, list);
40 | listView.setAdapter(arrayAdapter);
41 | return view;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/java/com/lin/gesturedetector/SecondActivity.java:
--------------------------------------------------------------------------------
1 | package com.lin.gesturedetector;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 | import android.support.v4.view.PagerAdapter;
7 | import android.support.v4.view.ViewPager;
8 | import android.support.v7.app.AppCompatActivity;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import java.util.ArrayList;
13 | import java.util.List;
14 |
15 | /**
16 | * Created by ljf on 2016-04-11.
17 | */
18 | public class SecondActivity extends AppCompatActivity {
19 |
20 | private ViewGroup viewGroup;
21 | private View topView;
22 | private View bottomView;
23 |
24 | private ViewPager viewPager;
25 | private PagerAdapter pagerAdapter;
26 | private List fragments;
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.activity_second);
32 | viewGroup = (ViewGroup) findViewById(R.id.view_group);
33 | topView = findViewById(R.id.group_top);
34 | bottomView = findViewById(R.id.group_bottom);
35 |
36 | initView();
37 | }
38 |
39 | private void initView() {
40 | BottomFragment bottomFragment1 = new BottomFragment();
41 | BottomFragment bottomFragment2 = new BottomFragment();
42 | fragments = new ArrayList<>();
43 | fragments.add(bottomFragment1);
44 | fragments.add(bottomFragment2);
45 | pagerAdapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
46 | @Override
47 | public Fragment getItem(int position) {
48 | return fragments.get(position);
49 | }
50 |
51 | @Override
52 | public int getCount() {
53 | return fragments.size();
54 | }
55 | };
56 | viewPager = (ViewPager) bottomView.findViewById(R.id.bottom_viewpager);
57 | viewPager.setAdapter(pagerAdapter);
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/layout/activity_second.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
15 |
16 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/layout/view_bottom.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/layout/view_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/layout/view_top.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GestureDetector/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GestureDetector/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GestureDetector/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GestureDetector/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GestureDetector/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | GestureDetector
3 |
4 |
--------------------------------------------------------------------------------
/GestureDetector/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/GestureDetector/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.2'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/GestureDetector/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GestureDetector/preview.gif
--------------------------------------------------------------------------------
/GestureDetector/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/GreenDao/.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 |
--------------------------------------------------------------------------------
/GreenDao/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/GreenDao/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | apply plugin: 'kotlin-android'
4 |
5 | apply plugin: 'kotlin-android-extensions'
6 |
7 | apply plugin: 'org.greenrobot.greendao'
8 |
9 | android {
10 | compileSdkVersion 26
11 | defaultConfig {
12 | applicationId "com.ljf.greendao"
13 | minSdkVersion 15
14 | targetSdkVersion 26
15 | versionCode 1
16 | versionName "1.0"
17 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
18 | }
19 | buildTypes {
20 | release {
21 | minifyEnabled false
22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
23 | }
24 | }
25 | }
26 |
27 | greendao {
28 | schemaVersion 26//数据库版本号
29 | daoPackage 'com.ljf.greendao.greendao'//设置DaoMaster、DaoSession、Dao包名
30 | targetGenDir 'src/main/java'//设置DaoMaster、DaoSession、Dao目录
31 |
32 | }
33 |
34 | dependencies {
35 | implementation fileTree(dir: 'libs', include: ['*.jar'])
36 | implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
37 | implementation 'com.android.support:appcompat-v7:26.1.0'
38 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
39 | testImplementation 'junit:junit:4.12'
40 | implementation 'org.greenrobot:greendao:3.2.2'
41 | }
42 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/java/com/ljf/greendao/Animal.java:
--------------------------------------------------------------------------------
1 | package com.ljf.greendao;
2 |
3 | import org.greenrobot.greendao.annotation.Entity;
4 | import org.greenrobot.greendao.annotation.Generated;
5 |
6 | /**
7 | * Created by mr.lin on 2018/5/28.
8 | */
9 |
10 | @Entity
11 | public class Animal {
12 |
13 | private String name;
14 | private int age;
15 | private String gender;
16 | @Generated(hash = 119755903)
17 | public Animal(String name, int age, String gender) {
18 | this.name = name;
19 | this.age = age;
20 | this.gender = gender;
21 | }
22 | @Generated(hash = 308569294)
23 | public Animal() {
24 | }
25 |
26 | public Animal(String name, int age) {
27 | this.name = name;
28 | this.age = age;
29 | }
30 |
31 | public String getName() {
32 | return this.name;
33 | }
34 | public void setName(String name) {
35 | this.name = name;
36 | }
37 | public int getAge() {
38 | return this.age;
39 | }
40 | public void setAge(int age) {
41 | this.age = age;
42 | }
43 | public String getGender() {
44 | return this.gender;
45 | }
46 | public void setGender(String gender) {
47 | this.gender = gender;
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/java/com/ljf/greendao/App.kt:
--------------------------------------------------------------------------------
1 | package com.ljf.greendao
2 |
3 | import android.app.Application
4 |
5 | /**
6 | * Created by mr.lin on 2018/5/28.
7 | */
8 | class App : Application() {
9 |
10 | companion object {
11 | private var instance: Application? = null
12 | fun instance(): Application {
13 | return instance!!
14 | }
15 | }
16 |
17 | override fun onCreate() {
18 | super.onCreate()
19 | instance = this
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/GreenDao/app/src/main/java/com/ljf/greendao/DaoOpenHelper.kt:
--------------------------------------------------------------------------------
1 | package com.ljf.greendao
2 |
3 | import android.content.Context
4 | import android.database.sqlite.SQLiteDatabase
5 | import com.ljf.greendao.greendao.AnimalDao
6 | import com.ljf.greendao.greendao.DaoMaster
7 | import org.greenrobot.greendao.database.Database
8 |
9 | /**
10 | * Created by mr.lin on 2018/5/29.
11 | */
12 | class DaoOpenHelper(context: Context?, name: String?, factory: SQLiteDatabase.CursorFactory?) : DaoMaster.OpenHelper(context, name, factory) {
13 |
14 | override fun onUpgrade(db: Database?, oldVersion: Int, newVersion: Int) {
15 | if (oldVersion DataBaseManager.isGreenDao(isChecked) }
34 |
35 | }
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/java/com/ljf/greendao/OpenHelper.kt:
--------------------------------------------------------------------------------
1 | package com.ljf.greendao
2 |
3 | import android.content.Context
4 | import android.database.sqlite.SQLiteDatabase
5 | import android.database.sqlite.SQLiteOpenHelper
6 |
7 | /**
8 | * Created by mr.lin on 2018/5/28.
9 | */
10 | class OpenHelper(context: Context?, var name: String?, factory: SQLiteDatabase.CursorFactory?, version: Int) : SQLiteOpenHelper(context, name, factory, version) {
11 | override fun onCreate(db: SQLiteDatabase?) {
12 | db?.execSQL("create table Animal (id integer primary key,name text,age integer)")
13 | }
14 |
15 | override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) {
16 | if (newVersion == 2) {
17 | db?.execSQL("alert table Animal add gender integer")
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/GreenDao/app/src/main/java/com/ljf/greendao/greendao/DaoSession.java:
--------------------------------------------------------------------------------
1 | package com.ljf.greendao.greendao;
2 |
3 | import java.util.Map;
4 |
5 | import org.greenrobot.greendao.AbstractDao;
6 | import org.greenrobot.greendao.AbstractDaoSession;
7 | import org.greenrobot.greendao.database.Database;
8 | import org.greenrobot.greendao.identityscope.IdentityScopeType;
9 | import org.greenrobot.greendao.internal.DaoConfig;
10 |
11 | import com.ljf.greendao.Animal;
12 |
13 | import com.ljf.greendao.greendao.AnimalDao;
14 |
15 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
16 |
17 | /**
18 | * {@inheritDoc}
19 | *
20 | * @see org.greenrobot.greendao.AbstractDaoSession
21 | */
22 | public class DaoSession extends AbstractDaoSession {
23 |
24 | private final DaoConfig animalDaoConfig;
25 |
26 | private final AnimalDao animalDao;
27 |
28 | public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig>
29 | daoConfigMap) {
30 | super(db);
31 |
32 | animalDaoConfig = daoConfigMap.get(AnimalDao.class).clone();
33 | animalDaoConfig.initIdentityScope(type);
34 |
35 | animalDao = new AnimalDao(animalDaoConfig, this);
36 |
37 | registerDao(Animal.class, animalDao);
38 | }
39 |
40 | public void clear() {
41 | animalDaoConfig.clearIdentityScope();
42 | }
43 |
44 | public AnimalDao getAnimalDao() {
45 | return animalDao;
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
18 |
19 |
25 |
26 |
31 |
32 |
37 |
38 |
43 |
44 |
49 |
50 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GreenDao/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | GreenDao
3 |
4 |
--------------------------------------------------------------------------------
/GreenDao/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/GreenDao/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.1.51'
5 | repositories {
6 | mavenCentral()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.0.1'
11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
12 | classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2'
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | mavenCentral()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/GreenDao/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/GuideRecyclerView/.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 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | defaultConfig {
6 | applicationId "com.ljf.guiderecyclerview"
7 | minSdkVersion 15
8 | targetSdkVersion 26
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(dir: 'libs', include: ['*.jar'])
23 | implementation 'com.android.support:appcompat-v7:26.1.0'
24 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
25 | testImplementation 'junit:junit:4.12'
26 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
28 | implementation 'com.android.support:recyclerview-v7:26.1.0'
29 | }
30 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/java/com/ljf/guiderecyclerview/FragmentAdapter.java:
--------------------------------------------------------------------------------
1 | package com.ljf.guiderecyclerview;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by mr.lin on 2018/1/22.
11 | */
12 |
13 | public class FragmentAdapter extends FragmentPagerAdapter {
14 |
15 | private List fragments;
16 |
17 | public FragmentAdapter(FragmentManager fm, List fragments) {
18 | super(fm);
19 | this.fragments = fragments;
20 | }
21 |
22 | @Override
23 | public Fragment getItem(int position) {
24 | return fragments.get(position);
25 | }
26 |
27 | @Override
28 | public int getCount() {
29 | return fragments.size();
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/java/com/ljf/guiderecyclerview/MineFragment.java:
--------------------------------------------------------------------------------
1 | package com.ljf.guiderecyclerview;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.TextView;
10 |
11 | /**
12 | * Created by mr.lin on 2018/1/22.
13 | */
14 |
15 | public class MineFragment extends Fragment {
16 |
17 | private String title;
18 |
19 | private TextView name;
20 |
21 | @Override
22 | public void onCreate(@Nullable Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | title = getArguments().getString("data");
25 | }
26 |
27 | @Nullable
28 | @Override
29 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
30 | return inflater.inflate(R.layout.fragment_mine, container, false);
31 | }
32 |
33 | @Override
34 | public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
35 | super.onViewCreated(view, savedInstanceState);
36 | name = view.findViewById(R.id.name);
37 | name.setText(title);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/java/com/ljf/guiderecyclerview/RecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.ljf.guiderecyclerview;
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.TextView;
9 |
10 | import java.util.List;
11 |
12 | /**
13 | * Created by mr.lin on 2018/1/22.
14 | */
15 |
16 | public class RecyclerViewAdapter extends RecyclerView.Adapter {
17 |
18 | private Context context;
19 | private List datas;
20 |
21 | public RecyclerViewAdapter(Context context, List datas) {
22 | this.context = context;
23 | this.datas = datas;
24 | }
25 |
26 | @Override
27 | public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
28 | View view = LayoutInflater.from(context).inflate(R.layout.viewholder_guide, parent, false);
29 | return new ViewHolder(view);
30 | }
31 |
32 | @Override
33 | public void onBindViewHolder(ViewHolder holder, int position) {
34 | holder.textView.setText(datas.get(position));
35 | }
36 |
37 | @Override
38 | public int getItemCount() {
39 | return datas.size();
40 | }
41 |
42 | class ViewHolder extends RecyclerView.ViewHolder {
43 |
44 | TextView textView;
45 | View lineView;
46 |
47 | public ViewHolder(View itemView) {
48 | super(itemView);
49 | textView = itemView.findViewById(R.id.nameTv);
50 | lineView = itemView.findViewById(R.id.lineView);
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
12 |
13 |
17 |
18 |
22 |
23 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/layout/fragment_mine.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/layout/view_guiderecyclerview.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
18 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/layout/view_guideslide.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
16 |
17 |
22 |
23 |
24 |
31 |
32 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/layout/view_lineview.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
12 |
13 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/layout/viewholder_guide.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
27 |
28 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/layout/viewholder_guide2.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | GuideRecyclerView
3 |
4 |
--------------------------------------------------------------------------------
/GuideRecyclerView/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/GuideRecyclerView/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.0.0'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/GuideRecyclerView/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/GuideRecyclerView/preview.gif
--------------------------------------------------------------------------------
/GuideRecyclerView/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Indicator/.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
11 | .idea/copyright/profiles_settings.xml
12 | .idea/gradle.xml
13 | .idea/misc.xml
14 | .idea/modules.xml
15 | .idea/runConfigurations.xml
16 | .idea/vcs.xml
17 | app/proguard-rules.pro
18 | app/src/androidTest/java/com/example/indicator/ExampleInstrumentedTest.java
19 | app/src/test/java/com/example/indicator/ExampleUnitTest.java
20 | gradle.properties
21 | gradle/wrapper/gradle-wrapper.jar
22 | gradle/wrapper/gradle-wrapper.properties
23 | gradlew
24 | gradlew.bat
25 |
--------------------------------------------------------------------------------
/Indicator/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Indicator/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "26.0.0"
6 | defaultConfig {
7 | applicationId "com.example.indicator"
8 | minSdkVersion 15
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:25.3.1'
28 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
29 | compile 'com.android.support:design:25.3.1'
30 | testCompile 'junit:junit:4.12'
31 | }
32 |
--------------------------------------------------------------------------------
/Indicator/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Indicator/app/src/main/java/com/example/indicator/LoopAdapter.java:
--------------------------------------------------------------------------------
1 | package com.example.indicator;
2 |
3 | import android.support.v4.view.PagerAdapter;
4 | import android.view.View;
5 | import android.view.ViewGroup;
6 |
7 | import java.util.List;
8 |
9 | /**
10 | * Created by ljf on 2017/8/15.
11 | * viewpager 无限循环adapter
12 | */
13 |
14 | public class LoopAdapter extends PagerAdapter {
15 |
16 | private List views;
17 |
18 | public LoopAdapter(List views) {
19 | this.views = views;
20 | }
21 |
22 | @Override
23 | public int getCount() {
24 | return views.size();
25 | }
26 |
27 | @Override
28 | public boolean isViewFromObject(View view, Object object) {
29 | return view == object;
30 | }
31 |
32 | // index 0 1 2 3 4 5
33 | // view 3 0 1 2 3 0
34 | // 如果debug你会发现PagerAdapter加载视图的顺序 例如首次显示view 0
35 | // instantiateItem 加载顺序为 view0 view3 view1
36 | // 手势左滑会触发 destroyItem view3 instantiateItem view2 以此类推
37 | @Override
38 | public Object instantiateItem(ViewGroup container, int position) {
39 | View view = views.get(position);
40 | ViewGroup viewGroup = (ViewGroup) view.getParent();
41 | if (viewGroup != null) {//由于无限循环采用首位添加冗余的方式
42 | // 例如本例一共4个view,但是列表里有6个。当滑动index5完全显示时会控制viewPager跳到index1
43 | // 如果此处不判断view.getParent()的话,会发生java.lang.IllegalStateException: The specified child already has a parent. You must call removeView() on the child's parent first.
44 | // 因为list里index5和index1的对象是同一个因此不能够重复addview();
45 | viewGroup.removeView(view);
46 | }
47 | container.addView(view);
48 | return view;
49 | }
50 |
51 | @Override
52 | public void destroyItem(ViewGroup container, int position, Object object) {
53 | //在instantiateItem里面处理
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Indicator/app/src/main/java/com/example/indicator/LoopOnPageChangeListener.java:
--------------------------------------------------------------------------------
1 | package com.example.indicator;
2 |
3 | import android.support.v4.view.ViewPager;
4 |
5 | /**
6 | * Created by ljf on 2017/8/15.
7 | * viewpager 无限循环且不卡顿监听
8 | * viewpager添加此方法后 将无限滑动
9 | */
10 |
11 | public class LoopOnPageChangeListener implements ViewPager.OnPageChangeListener {
12 |
13 | private ViewPager viewPager;
14 | //all of adapter items even the duplicates
15 | private int size;
16 |
17 | private int currentPosition = 1;
18 | private int targetPosition = 1;
19 |
20 | public LoopOnPageChangeListener(ViewPager viewPager, int size) {
21 | this.viewPager = viewPager;
22 | this.size = size;
23 | }
24 |
25 | @Override
26 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
27 |
28 | }
29 |
30 | @Override
31 | public void onPageSelected(int position) {
32 | targetPosition = position;
33 | }
34 |
35 | @Override
36 | public void onPageScrollStateChanged(int state) {
37 | // 不在onPageSelected 里处理
38 | // 是因为onPageSelected回调时界面可能还没有停止滑动
39 | // 因此会产生闪烁
40 | if (state == ViewPager.SCROLL_STATE_IDLE && targetPosition != currentPosition) {
41 | int index = targetPosition;
42 | if (targetPosition == size - 1) {
43 | index = 1;
44 | } else if (targetPosition == 0) {
45 | index = size - 2;
46 | }
47 | viewPager.setCurrentItem(index, false);
48 | currentPosition = targetPosition;
49 | }
50 | }
51 |
52 | }
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
18 |
19 |
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-xhdpi/ic_app_guide_white_point.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-xhdpi/ic_app_guide_white_point.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Indicator
3 | Settings
4 |
5 |
--------------------------------------------------------------------------------
/Indicator/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Indicator/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/Indicator/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Indicator/preview.gif
--------------------------------------------------------------------------------
/Indicator/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/Paging/.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 |
--------------------------------------------------------------------------------
/Paging/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/Paging/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | defaultConfig {
6 | applicationId "com.ljf.paging"
7 | minSdkVersion 19
8 | targetSdkVersion 26
9 | versionCode 1
10 | versionName "a.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(include: ['*.jar'], dir: 'libs')
23 | }
24 |
--------------------------------------------------------------------------------
/Paging/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Paging/app/src/main/java/com/ljf/paging/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.ljf.paging;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 |
6 | public class MainActivity extends Activity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_main);
12 | }
13 |
14 | }
15 |
--------------------------------------------------------------------------------
/Paging/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/Paging/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Paging/app/src/main/res/layout/view_bookpage_container.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
10 |
11 |
16 |
17 |
22 |
23 |
28 |
29 |
30 |
35 |
36 |
41 |
42 |
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-xhdpi/bg_pager.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-xhdpi/bg_pager.jpeg
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/Paging/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/Paging/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Paging
3 |
4 |
--------------------------------------------------------------------------------
/Paging/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Paging/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.0.1'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/Paging/preview1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/preview1.gif
--------------------------------------------------------------------------------
/Paging/preview2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/preview2.gif
--------------------------------------------------------------------------------
/Paging/preview3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/Paging/preview3.gif
--------------------------------------------------------------------------------
/Paging/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/ScrollScale/.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 |
--------------------------------------------------------------------------------
/ScrollScale/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ScrollScale/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "26.0.0"
6 | defaultConfig {
7 | applicationId "com.ljf.scrollscale"
8 | minSdkVersion 15
9 | targetSdkVersion 25
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
25 | exclude group: 'com.android.support', module: 'support-annotations'
26 | })
27 | compile 'com.android.support:appcompat-v7:25.3.1'
28 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
29 | compile 'com.android.support:design:25.3.1'
30 | }
31 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/java/com/ljf/scrollscale/fragment/RainbowFragment.java:
--------------------------------------------------------------------------------
1 | package com.ljf.scrollscale.fragment;
2 |
3 | import android.os.Bundle;
4 | import android.support.annotation.Nullable;
5 | import android.support.v4.app.Fragment;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 |
10 | import com.ljf.scrollscale.R;
11 |
12 | /**
13 | * Created by ljf on 2017/8/17.
14 | * 彩虹fragment
15 | */
16 |
17 | public class RainbowFragment extends Fragment {
18 |
19 | @Nullable
20 | @Override
21 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
22 | View view = inflater.inflate(R.layout.fragment_rainbow, container, false);
23 | return view;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/java/com/ljf/scrollscale/views/TabView.java:
--------------------------------------------------------------------------------
1 | package com.ljf.scrollscale.views;
2 |
3 | import android.content.Context;
4 | import android.content.res.TypedArray;
5 | import android.support.annotation.Nullable;
6 | import android.util.AttributeSet;
7 | import android.util.Log;
8 | import android.view.Gravity;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 | import android.widget.LinearLayout;
12 | import android.widget.ScrollView;
13 | import android.widget.TextView;
14 |
15 | import com.ljf.scrollscale.R;
16 |
17 | import java.util.ArrayList;
18 | import java.util.List;
19 |
20 | /**
21 | * Created by ljf on 2017/8/22.
22 | * 自定义吸附tab
23 | */
24 |
25 | public class TabView extends LinearLayout {
26 |
27 | private CharSequence[] datas;
28 | private List textViews;
29 |
30 | public TabView(Context context) {
31 | this(context, null);
32 | }
33 |
34 | public TabView(Context context, @Nullable AttributeSet attrs) {
35 | this(context, attrs, 0);
36 | }
37 |
38 | public TabView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
39 | super(context, attrs, defStyleAttr);
40 | textViews = new ArrayList<>();
41 | TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.TabView);
42 | datas = typedArray.getTextArray(R.styleable.TabView_datas);
43 | initView();
44 | typedArray.recycle();
45 | }
46 |
47 | private void initView() {
48 | LayoutParams layoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
49 | layoutParams.weight = 1;
50 | for (CharSequence item : datas) {
51 | TextView textView = new TextView(getContext());
52 | textView.setLayoutParams(layoutParams);
53 | textView.setText(item);
54 | textView.setGravity(Gravity.CENTER);
55 | textView.setBackgroundResource(R.drawable.bg_select);
56 | addView(textView);
57 | textViews.add(textView);
58 | }
59 | }
60 |
61 | public void select(int position) {
62 | for (TextView textView : textViews) {
63 | textView.setSelected(false);
64 | }
65 | textViews.get(position).setSelected(true);
66 | }
67 |
68 | }
69 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/java/com/ljf/scrollscale/views/ViewPagerInScroll.java:
--------------------------------------------------------------------------------
1 | package com.ljf.scrollscale.views;
2 |
3 | import android.content.Context;
4 | import android.support.v4.view.ViewPager;
5 | import android.util.AttributeSet;
6 | import android.view.GestureDetector;
7 | import android.view.MotionEvent;
8 | import android.view.View;
9 |
10 | /**
11 | * Created by ljf on 2017/8/17.
12 | * 在ScrollView中的ViewPager
13 | */
14 |
15 | public class ViewPagerInScroll extends ViewPager {
16 |
17 | private GestureDetector gestureDetector;
18 |
19 | public ViewPagerInScroll(Context context) {
20 | this(context, null);
21 | }
22 |
23 | public ViewPagerInScroll(Context context, AttributeSet attrs) {
24 | super(context, attrs);
25 | gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {
26 | @Override
27 | public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) {
28 | if (Math.abs(distanceY) >= Math.abs(distanceX)) {
29 | return true;
30 | }
31 | return false;
32 | }
33 | });
34 | }
35 |
36 | @Override
37 | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
38 | int height = 0;
39 |
40 | /**
41 | * 这里是取viewpager里高度最大的一个作为父控件的高度
42 | */
43 | // for (int i = 0; i < getChildCount(); i++) {
44 | // View child = getChildAt(i);
45 | // child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));//这里如果是ListViewFragment,会初始化全部ListView里全部的item 非常消耗性能
46 | // int h = child.getMeasuredHeight();
47 | // if (h > height)
48 | // height = h;
49 | // }
50 |
51 | /**
52 | * 本例是取第一的高度
53 | */
54 | if (getChildCount() > 0) {
55 | View child = getChildAt(0);
56 | child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
57 | height = child.getMeasuredHeight();
58 | }
59 | heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
60 | super.onMeasure(widthMeasureSpec, heightMeasureSpec);
61 | }
62 |
63 | @Override
64 | public boolean onInterceptTouchEvent(MotionEvent ev) {
65 | return super.onInterceptTouchEvent(ev)
66 | && gestureDetector.onTouchEvent(ev);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/drawable/bg_select.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
18 |
19 |
26 |
27 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/layout/fragment_listview.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/layout/fragment_rainbow.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
19 |
20 |
24 |
25 |
29 |
30 |
34 |
35 |
39 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/layout/item.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-mdpi/bg2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-mdpi/bg2.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 | #FFFFFF
7 |
8 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ScrollScale
3 | Settings
4 |
5 |
6 | - tab1
7 | - tab2
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ScrollScale/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ScrollScale/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.3.1'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/ScrollScale/preview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ScrollScale/preview.gif
--------------------------------------------------------------------------------
/ScrollScale/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/ijkPlayer/.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 |
--------------------------------------------------------------------------------
/ijkPlayer/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ijkPlayer/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 26
5 | defaultConfig {
6 | applicationId "com.ljf.ijkplayer"
7 | minSdkVersion 15
8 | targetSdkVersion 26
9 | versionCode 1
10 | versionName "1.0"
11 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled false
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(include: ['*.jar'], dir: 'libs')
23 | implementation 'com.android.support:appcompat-v7:26.1.0'
24 | implementation 'com.android.support.constraint:constraint-layout:1.0.2'
25 | testImplementation 'junit:junit:4.12'
26 | androidTestImplementation 'com.android.support.test:runner:1.0.1'
27 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
28 | implementation project(':ijkplayer-java')
29 | }
30 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
21 |
22 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/java/com/ljf/ijkplayer/IjkPlayerListener.java:
--------------------------------------------------------------------------------
1 | package com.ljf.ijkplayer;
2 |
3 | import tv.danmaku.ijk.media.player.IMediaPlayer;
4 |
5 | /**
6 | * Created by mr.lin on 2017/12/20.
7 | * ijkPlayer监听
8 | */
9 |
10 | public interface IjkPlayerListener extends IMediaPlayer.OnBufferingUpdateListener, IMediaPlayer.OnCompletionListener, IMediaPlayer.OnPreparedListener, IMediaPlayer.OnInfoListener, IMediaPlayer.OnVideoSizeChangedListener, IMediaPlayer.OnErrorListener, IMediaPlayer.OnSeekCompleteListener {
11 | }
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/java/com/ljf/ijkplayer/MyActivity.java:
--------------------------------------------------------------------------------
1 | package com.ljf.ijkplayer;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.view.View;
6 | import android.widget.Button;
7 | import android.widget.EditText;
8 |
9 | import tv.danmaku.ijk.media.player.IMediaPlayer;
10 |
11 | /**
12 | * Created by mr.lin on 2017/12/20.
13 | */
14 |
15 | public class MyActivity extends AppCompatActivity {
16 |
17 | VideoViewIjk videoViewIjk;
18 | EditText editText;
19 | Button button;
20 |
21 | @Override
22 | protected void onCreate(Bundle savedInstanceState) {
23 | super.onCreate(savedInstanceState);
24 | setContentView(R.layout.activity_my);
25 |
26 | videoViewIjk = findViewById(R.id.surfaceView);
27 | editText = findViewById(R.id.editText);
28 | button = findViewById(R.id.button);
29 | button.setOnClickListener(new View.OnClickListener() {
30 | @Override
31 | public void onClick(View v) {
32 | go();
33 | }
34 | });
35 | videoViewIjk.setVideoViewIjkListener(new SimpleIjkPlayerListener() {
36 | @Override
37 | public void onPrepared(IMediaPlayer mp) {
38 | mp.start();
39 | }
40 | });
41 | }
42 |
43 | private void go() {
44 | videoViewIjk.setDataSource(editText.getText().toString().trim());
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/java/com/ljf/ijkplayer/SimpleIjkPlayerListener.java:
--------------------------------------------------------------------------------
1 | package com.ljf.ijkplayer;
2 |
3 | import tv.danmaku.ijk.media.player.IMediaPlayer;
4 |
5 | /**
6 | * Created by mr.lin on 2017/12/20.
7 | */
8 |
9 | public class SimpleIjkPlayerListener implements IjkPlayerListener {
10 | @Override
11 | public void onPrepared(IMediaPlayer mp) {
12 |
13 | }
14 |
15 | @Override
16 | public void onCompletion(IMediaPlayer mp) {
17 |
18 | }
19 |
20 | @Override
21 | public void onBufferingUpdate(IMediaPlayer mp, int percent) {
22 |
23 | }
24 |
25 | @Override
26 | public void onSeekComplete(IMediaPlayer mp) {
27 |
28 | }
29 |
30 | @Override
31 | public void onVideoSizeChanged(IMediaPlayer mp, int width, int height, int sar_num, int sar_den) {
32 |
33 | }
34 |
35 | @Override
36 | public boolean onError(IMediaPlayer mp, int what, int extra) {
37 | return false;
38 | }
39 |
40 | @Override
41 | public boolean onInfo(IMediaPlayer mp, int what, int extra) {
42 | return false;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/arm64-v8a/libijkffmpeg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/arm64-v8a/libijkffmpeg.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/arm64-v8a/libijkplayer.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/arm64-v8a/libijkplayer.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/arm64-v8a/libijksdl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/arm64-v8a/libijksdl.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/armeabi-v7a/libijkffmpeg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/armeabi-v7a/libijkffmpeg.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/armeabi-v7a/libijkplayer.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/armeabi-v7a/libijkplayer.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/armeabi-v7a/libijksdl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/armeabi-v7a/libijksdl.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/armeabi/libijkffmpeg.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/armeabi/libijkffmpeg.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/armeabi/libijkplayer.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/armeabi/libijkplayer.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/jniLibs/armeabi/libijksdl.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/jniLibs/armeabi/libijksdl.so
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/layout/activity_my.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
17 |
22 |
23 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/s1991721/Android/1e9a12fcdda5812ca3b2a3ca5333ef2f91f416e0/ijkPlayer/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/values-v19/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | ijkPlayer
3 |
4 |
--------------------------------------------------------------------------------
/ijkPlayer/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ijkPlayer/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:3.0.0'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | // http://tools.android.com/tech-docs/new-build-system/tips
5 | //noinspection GroovyAssignabilityCheck
6 | compileSdkVersion 26
7 | //noinspection GroovyAssignabilityCheck
8 |
9 | lintOptions {
10 | abortOnError false
11 | }
12 | defaultConfig {
13 | minSdkVersion 15
14 | targetSdkVersion 26
15 | }
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20 | }
21 | }
22 | }
23 |
24 | dependencies {
25 | compile fileTree(dir: 'libs', include: ['*.jar'])
26 | }
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/gradle.properties:
--------------------------------------------------------------------------------
1 | POM_NAME=ijkplayer-java
2 | POM_ARTIFACT_ID=ijkplayer-java
3 | POM_PACKAGING=aar
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/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 /opt/android/ADK/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 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/androidTest/java/tv/danmaku/ijk/media/player/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package tv.danmaku.ijk.media.player;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | ijkplayer-java
4 |
5 |
6 |
7 |
8 |
9 | com.android.ide.eclipse.adt.ResourceManagerBuilder
10 |
11 |
12 |
13 |
14 | com.android.ide.eclipse.adt.PreCompilerBuilder
15 |
16 |
17 |
18 |
19 | org.eclipse.jdt.core.javabuilder
20 |
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 | com.android.ide.eclipse.adt.AndroidNature
31 | org.eclipse.jdt.core.javanature
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
3 | org.eclipse.jdt.core.compiler.compliance=1.6
4 | org.eclipse.jdt.core.compiler.source=1.6
5 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
6 |
7 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/ISurfaceTextureHolder.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Bilibili
3 | * Copyright (C) 2015 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player;
19 |
20 | import android.graphics.SurfaceTexture;
21 |
22 | public interface ISurfaceTextureHolder {
23 | void setSurfaceTexture(SurfaceTexture surfaceTexture);
24 |
25 | SurfaceTexture getSurfaceTexture();
26 |
27 | void setSurfaceTextureHost(ISurfaceTextureHost surfaceTextureHost);
28 | }
29 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/ISurfaceTextureHost.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Bilibili
3 | * Copyright (C) 2015 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player;
19 |
20 | import android.graphics.SurfaceTexture;
21 |
22 | public interface ISurfaceTextureHost {
23 | void releaseSurfaceTexture(SurfaceTexture surfaceTexture);
24 | }
25 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/IjkLibLoader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013-2014 Bilibili
3 | * Copyright (C) 2013-2014 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player;
19 |
20 | public interface IjkLibLoader {
21 | void loadLibrary(String libName) throws UnsatisfiedLinkError,
22 | SecurityException;
23 | }
24 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/IjkTimedText.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Zheng Yuan
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package tv.danmaku.ijk.media.player;
18 |
19 | import android.graphics.Rect;
20 | import java.lang.String;
21 |
22 | public final class IjkTimedText {
23 |
24 | private Rect mTextBounds = null;
25 | private String mTextChars = null;
26 |
27 | public IjkTimedText(Rect bounds, String text) {
28 | mTextBounds = bounds;
29 | mTextChars = text;
30 | }
31 |
32 | public Rect getBounds() {
33 | return mTextBounds;
34 | }
35 |
36 | public String getText() {
37 | return mTextChars;
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/MediaInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013-2014 Bilibili
3 | * Copyright (C) 2013-2014 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player;
19 |
20 | public class MediaInfo {
21 | public String mMediaPlayerName;
22 |
23 | public String mVideoDecoder;
24 | public String mVideoDecoderImpl;
25 |
26 | public String mAudioDecoder;
27 | public String mAudioDecoderImpl;
28 |
29 | public IjkMediaMeta mMeta;
30 | }
31 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/annotations/AccessedByNative.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013-2014 Bilibili
3 | * Copyright (C) 2013-2014 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player.annotations;
19 |
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.RetentionPolicy;
23 | import java.lang.annotation.Target;
24 |
25 | /**
26 | * is used by the JNI generator to create the necessary JNI
27 | * bindings and expose this method to native code.
28 | */
29 | @Target(ElementType.FIELD)
30 | @Retention(RetentionPolicy.CLASS)
31 | public @interface AccessedByNative {
32 | }
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/annotations/CalledByNative.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013-2014 Bilibili
3 | * Copyright (C) 2013-2014 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player.annotations;
19 |
20 | import java.lang.annotation.ElementType;
21 | import java.lang.annotation.Retention;
22 | import java.lang.annotation.RetentionPolicy;
23 | import java.lang.annotation.Target;
24 |
25 | /**
26 | * is used by the JNI generator to create the necessary JNI
27 | * bindings and expose this method to native code.
28 | */
29 | @Target(ElementType.METHOD)
30 | @Retention(RetentionPolicy.CLASS)
31 | public @interface CalledByNative {
32 | /*
33 | * If present, tells which inner class the method belongs to.
34 | */
35 | String value() default "";
36 | }
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/exceptions/IjkMediaException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013-2014 Bilibili
3 | * Copyright (C) 2013-2014 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player.exceptions;
19 |
20 | public class IjkMediaException extends Exception {
21 | private static final long serialVersionUID = 7234796519009099506L;
22 | }
23 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/ffmpeg/FFmpegApi.java:
--------------------------------------------------------------------------------
1 | package tv.danmaku.ijk.media.player.ffmpeg;
2 |
3 | public class FFmpegApi {
4 | public static native String av_base64_encode(byte in[]);
5 | }
6 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/AndroidMediaFormat.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Bilibili
3 | * Copyright (C) 2015 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player.misc;
19 |
20 | import android.annotation.TargetApi;
21 | import android.media.MediaFormat;
22 | import android.os.Build;
23 |
24 | public class AndroidMediaFormat implements IMediaFormat {
25 | private final MediaFormat mMediaFormat;
26 |
27 | public AndroidMediaFormat(MediaFormat mediaFormat) {
28 | mMediaFormat = mediaFormat;
29 | }
30 |
31 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
32 | @Override
33 | public int getInteger(String name) {
34 | if (mMediaFormat == null)
35 | return 0;
36 |
37 | return mMediaFormat.getInteger(name);
38 | }
39 |
40 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
41 | @Override
42 | public String getString(String name) {
43 | if (mMediaFormat == null)
44 | return null;
45 |
46 | return mMediaFormat.getString(name);
47 | }
48 |
49 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN)
50 | @Override
51 | public String toString() {
52 | StringBuilder out = new StringBuilder(128);
53 | out.append(getClass().getName());
54 | out.append('{');
55 | if (mMediaFormat != null) {
56 | out.append(mMediaFormat.toString());
57 | } else {
58 | out.append("null");
59 | }
60 | out.append('}');
61 | return out.toString();
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/IAndroidIO.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2016 Bilibili
3 | * Copyright (C) 2016 Raymond Zheng
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player.misc;
19 |
20 | import java.io.IOException;
21 |
22 | @SuppressWarnings("RedundantThrows")
23 | public interface IAndroidIO {
24 | int open(String url) throws IOException;
25 | int read(byte[] buffer, int size) throws IOException;
26 | long seek(long offset, int whence) throws IOException;
27 | int close() throws IOException;
28 | }
29 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/IMediaDataSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Bilibili
3 | * Copyright (C) 2015 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player.misc;
19 |
20 | import java.io.IOException;
21 |
22 | @SuppressWarnings("RedundantThrows")
23 | public interface IMediaDataSource {
24 | int readAt(long position, byte[] buffer, int offset, int size) throws IOException;
25 |
26 | long getSize() throws IOException;
27 |
28 | void close() throws IOException;
29 | }
30 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/IMediaFormat.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Bilibili
3 | * Copyright (C) 2015 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player.misc;
19 |
20 | public interface IMediaFormat {
21 | // Common keys
22 | String KEY_MIME = "mime";
23 |
24 | // Video Keys
25 | String KEY_WIDTH = "width";
26 | String KEY_HEIGHT = "height";
27 |
28 | String getString(String name);
29 |
30 | int getInteger(String name);
31 | }
32 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/misc/ITrackInfo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2015 Bilibili
3 | * Copyright (C) 2015 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package tv.danmaku.ijk.media.player.misc;
19 |
20 | public interface ITrackInfo {
21 | int MEDIA_TRACK_TYPE_AUDIO = 2;
22 | int MEDIA_TRACK_TYPE_METADATA = 5;
23 | int MEDIA_TRACK_TYPE_SUBTITLE = 4;
24 | int MEDIA_TRACK_TYPE_TIMEDTEXT = 3;
25 | int MEDIA_TRACK_TYPE_UNKNOWN = 0;
26 | int MEDIA_TRACK_TYPE_VIDEO = 1;
27 |
28 | IMediaFormat getFormat();
29 |
30 | String getLanguage();
31 |
32 | int getTrackType();
33 |
34 | String getInfoInline();
35 | }
36 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/pragma/Pragma.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (C) 2013 Bilibili
3 | * Copyright (C) 2013 Zhang Rui
4 | *
5 | * Licensed under the Apache License, Version 2.0 (the "License");
6 | * you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 | package tv.danmaku.ijk.media.player.pragma;
18 |
19 | /*-
20 | * configurated by app project
21 | */
22 | public class Pragma {
23 | public static final boolean ENABLE_VERBOSE = true;
24 | }
25 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-22
15 | android.library=true
16 |
--------------------------------------------------------------------------------
/ijkPlayer/ijkplayer-java/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ijkPlayer/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':ijkplayer-java'
2 |
--------------------------------------------------------------------------------