├── .gitignore
├── .idea
├── .name
├── compiler.xml
├── copyright
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── markdown-navigator.xml
├── markdown-navigator
│ └── profiles_settings.xml
├── misc.xml
├── modules.xml
└── runConfigurations.xml
├── README.md
├── activitydemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── activitydemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── activitydemo
│ │ │ ├── MainActivity.java
│ │ │ ├── SecondActivity.java
│ │ │ ├── affinity
│ │ │ ├── ActivityA.java
│ │ │ └── ActivityB.java
│ │ │ └── launchMode
│ │ │ ├── ActivityA.java
│ │ │ ├── ActivityB.java
│ │ │ ├── ActivityC.java
│ │ │ └── ActivityD.java
│ └── res
│ │ ├── layout
│ │ ├── activity_a.xml
│ │ ├── activity_aa.xml
│ │ ├── activity_b.xml
│ │ ├── activity_bb.xml
│ │ ├── activity_c.xml
│ │ ├── activity_d.xml
│ │ ├── activity_main.xml
│ │ ├── activity_second.xml
│ │ └── content_second.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-v21
│ │ └── styles.xml
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── activitydemo
│ └── ExampleUnitTest.java
├── activitydemo2
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── activitydemo2
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── activitydemo2
│ │ │ ├── ActivityX.java
│ │ │ └── ActivityY.java
│ └── res
│ │ ├── layout
│ │ ├── activity_x.xml
│ │ └── activity_y.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── activitydemo2
│ └── ExampleUnitTest.java
├── app
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── blogdemo
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── blogdemo
│ │ │ ├── MainActivity.java
│ │ │ └── SimpleXMLPullApp.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── blogdemo
│ └── ExampleUnitTest.java
├── build.gradle
├── camera2
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── camera2
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── camera2
│ │ │ ├── CameraPreview.java
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── camera2
│ └── ExampleUnitTest.java
├── downloadmanager
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── downloadmanager
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── downloadmanager
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── downloadmanager
│ └── ExampleUnitTest.java
├── filedemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── filedemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── filedemo
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── filedemo
│ └── ExampleUnitTest.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── handlerdemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── handlerdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── handlerdemo
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── handlerdemo
│ └── ExampleUnitTest.java
├── listviewdemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── listviewdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── listviewdemo
│ │ │ ├── DynamicBgActionbar.java
│ │ │ ├── MainActivity.java
│ │ │ └── QQZoneListView.java
│ └── res
│ │ ├── drawable-hdpi
│ │ ├── ic_action_add.png
│ │ └── ic_action_back.png
│ │ ├── drawable-mdpi
│ │ ├── ic_action_add.png
│ │ └── ic_action_back.png
│ │ ├── drawable-xhdpi
│ │ ├── ic_action_add.png
│ │ └── ic_action_back.png
│ │ ├── drawable-xxhdpi
│ │ ├── ic_action_add.png
│ │ └── ic_action_back.png
│ │ ├── drawable
│ │ ├── header.jpg
│ │ └── no_border_bg.xml
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── layout_dynamic_bg_actionbar.xml
│ │ └── layout_header_view.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── listviewdemo
│ └── ExampleUnitTest.java
├── loaderdemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── loaderdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── loaderdemo
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── loaderdemo
│ └── ExampleUnitTest.java
├── okhttpdemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── okhttpdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── okhttpdemo
│ │ │ ├── GZipRequestInterceptor.java
│ │ │ ├── LogConnectionInterceptor.java
│ │ │ ├── LogInterceptor.java
│ │ │ ├── MainActivity.java
│ │ │ ├── OkHttpTest.java
│ │ │ └── OkioTest.java
│ └── res
│ │ ├── layout
│ │ └── activity_main.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── okhttpdemo
│ └── ExampleUnitTest.java
├── servicedemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── binderdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── aidl
│ │ └── com
│ │ │ └── xks
│ │ │ └── binderdemo
│ │ │ ├── Book.aidl
│ │ │ ├── BookManager.aidl
│ │ │ └── IRemoteService.aidl
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── binderdemo
│ │ │ ├── AddService.java
│ │ │ ├── AidlService.java
│ │ │ ├── Book.java
│ │ │ ├── BookActivity.java
│ │ │ ├── BookService.java
│ │ │ ├── IntentServiceActivity.java
│ │ │ ├── LeficycleActivity.java
│ │ │ ├── LoggerService.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MessengerService.java
│ │ │ ├── MyIntentService.java
│ │ │ ├── PlayMusicActivity.java
│ │ │ └── PlayMusicService.java
│ └── res
│ │ ├── layout
│ │ ├── activity_book.xml
│ │ ├── activity_intent_service.xml
│ │ ├── activity_leficycle.xml
│ │ ├── activity_main.xml
│ │ └── activity_play_music.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
│ │ ├── raw
│ │ └── Diamonds.mp3
│ │ ├── values-w820dp
│ │ └── dimens.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── binderdemo
│ └── ExampleUnitTest.java
├── settings.gradle
├── snackbardemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── snackbardemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── snackbardemo
│ │ │ ├── Main2Activity.java
│ │ │ └── MainActivity.java
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── activity_main2.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── snackbardemo
│ └── ExampleUnitTest.java
├── textspan
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── textspan
│ │ └── ApplicationTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── textspan
│ │ │ ├── MainActivity.java
│ │ │ ├── OrderSpan.java
│ │ │ ├── ParagraphActivity.java
│ │ │ └── TextReplacementSpan.java
│ └── res
│ │ ├── drawable
│ │ └── smail.png
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── activity_paragraph.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── textspan
│ └── ExampleUnitTest.java
├── toolbardemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── toolbardemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── toolbardemo
│ │ │ ├── BottomSheetActivity.java
│ │ │ ├── CustomeBehaviorActivity.java
│ │ │ ├── DependentBehavior.java
│ │ │ ├── FloatingBehavior.java
│ │ │ ├── MainActivity.java
│ │ │ ├── ScrollBehavior.java
│ │ │ ├── ScrollingActivity.java
│ │ │ ├── SwipeDismissActivity.java
│ │ │ ├── ToolbarHelper.java
│ │ │ ├── TwinBehavior.java
│ │ │ └── TwinBehaviorActivity.java
│ └── res
│ │ ├── drawable-hdpi
│ │ ├── header.jpg
│ │ ├── ic_action_add.png
│ │ ├── ic_action_search.png
│ │ └── ic_action_settings.png
│ │ ├── drawable-mdpi
│ │ ├── ic_action_add.png
│ │ ├── ic_action_search.png
│ │ └── ic_action_settings.png
│ │ ├── drawable-xhdpi
│ │ ├── ic_action_add.png
│ │ ├── ic_action_search.png
│ │ └── ic_action_settings.png
│ │ ├── drawable-xxhdpi
│ │ ├── ic_action_add.png
│ │ ├── ic_action_search.png
│ │ └── ic_action_settings.png
│ │ ├── layout
│ │ ├── activity_bottom_sheet.xml
│ │ ├── activity_custome_behavior.xml
│ │ ├── activity_main2.xml
│ │ ├── activity_scrolling.xml
│ │ ├── activity_swipe_dismiss.xml
│ │ ├── activity_twin_behavior.xml
│ │ ├── content_bottom_sheet.xml
│ │ ├── content_main2.xml
│ │ └── content_scrolling.xml
│ │ ├── menu
│ │ ├── main_menu.xml
│ │ └── menu_scrolling.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
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── toolbardemo
│ └── ExampleUnitTest.java
├── touchgesturedemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── touchgesturedemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── touchgesturedemo
│ │ │ ├── DetectGestureActivity.java
│ │ │ ├── DragableImageView.java
│ │ │ ├── InteractiveLineGraphView.java
│ │ │ ├── MainActivity.java
│ │ │ ├── MultiTouchActivity.java
│ │ │ ├── OverScrollerCompat.java
│ │ │ ├── ScaleGestureDetectorCompat.java
│ │ │ ├── VelocityActivity.java
│ │ │ ├── ZoomImageView.java
│ │ │ ├── ZoomImageViewActivity.java
│ │ │ └── Zoomer.java
│ └── res
│ │ ├── drawable
│ │ ├── ic_action_pan_down.png
│ │ ├── ic_action_pan_left.png
│ │ ├── ic_action_pan_right.png
│ │ ├── ic_action_pan_up.png
│ │ ├── ic_action_zoom_in.png
│ │ ├── ic_action_zoom_out.png
│ │ └── pic.jpg
│ │ ├── layout
│ │ ├── activity_detect_gesture.xml
│ │ ├── activity_main.xml
│ │ ├── activity_multi_touch.xml
│ │ ├── activity_photo_view.xml
│ │ └── activity_velocity.xml
│ │ ├── menu
│ │ └── main.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
│ │ ├── attrs.xml
│ │ ├── colors.xml
│ │ ├── dimens.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── touchgesturedemo
│ └── ExampleUnitTest.java
├── viewdemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xks
│ │ └── viewgroupdemo
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── xks
│ │ │ └── viewgroupdemo
│ │ │ ├── CircleView.java
│ │ │ ├── MainActivity.java
│ │ │ ├── TabBar.java
│ │ │ ├── TagLayout.java
│ │ │ └── scroll
│ │ │ ├── ScrollableImageView.java
│ │ │ ├── ScrollerDemoActivity.java
│ │ │ └── ViewScrollActivity.java
│ └── res
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ ├── activity_scroller_demo.xml
│ │ ├── activity_view_scroll.xml
│ │ └── tabbar_layout.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
│ └── test
│ └── java
│ └── com
│ └── xks
│ └── viewgroupdemo
│ └── ExampleUnitTest.java
└── webviewdemo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
├── androidTest
└── java
│ └── com
│ └── xks
│ └── webviewdemo
│ └── ApplicationTest.java
├── main
├── AndroidManifest.xml
├── java
│ └── com
│ │ └── xks
│ │ └── webviewdemo
│ │ ├── Cal.java
│ │ └── MainActivity.java
└── res
│ ├── layout
│ └── activity_main.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
└── test
└── java
└── com
└── xks
└── webviewdemo
├── CalTest.java
└── ExampleUnitTest.java
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | BlogDemo
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/markdown-navigator/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/activitydemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/activitydemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.activitydemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | compile 'com.android.support:design:24.2.1'
32 | testCompile 'junit:junit:4.12'
33 | }
34 |
--------------------------------------------------------------------------------
/activitydemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/activitydemo/src/androidTest/java/com/xks/activitydemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.activitydemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/activitydemo/src/main/java/com/xks/activitydemo/SecondActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.FloatingActionButton;
5 | import android.support.design.widget.Snackbar;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.View;
9 |
10 | public class SecondActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_second);
16 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
17 | setSupportActionBar(toolbar);
18 |
19 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
20 | fab.setOnClickListener(new View.OnClickListener() {
21 | @Override
22 | public void onClick(View view) {
23 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
24 | .setAction("Action", null).show();
25 | }
26 | });
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/activitydemo/src/main/java/com/xks/activitydemo/affinity/ActivityA.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo.affinity;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import com.xks.activitydemo.R;
9 |
10 | public class ActivityA extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_aa);
16 | }
17 |
18 | public void startActivityB(View view) {
19 | Intent intent = new Intent(this, ActivityB.class);
20 | intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
21 | startActivity(intent);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/activitydemo/src/main/java/com/xks/activitydemo/affinity/ActivityB.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo.affinity;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 |
6 | import com.xks.activitydemo.R;
7 |
8 | public class ActivityB extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_bb);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/activitydemo/src/main/java/com/xks/activitydemo/launchMode/ActivityA.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo.launchMode;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import com.xks.activitydemo.R;
9 |
10 | public class ActivityA extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_a);
16 | }
17 |
18 | //standard模式启动A
19 | public void standardStartA(View view) {
20 | startActivity(new Intent(this, ActivityA.class));
21 | }
22 |
23 | //singleTop模式启动B
24 | public void singleTopStartB(View view) {
25 | startActivity(new Intent(this, ActivityB.class));
26 | }
27 |
28 | //singleTask模式启动C
29 | public void singleTaskStartC(View view) {
30 | startActivity(new Intent(this, ActivityC.class));
31 | }
32 |
33 | //singleInstance模式启动D
34 | public void singleInstanceStartD(View view) {
35 | startActivity(new Intent(this, ActivityD.class));
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/activitydemo/src/main/java/com/xks/activitydemo/launchMode/ActivityB.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo.launchMode;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import com.xks.activitydemo.R;
9 |
10 | public class ActivityB extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_b);
16 | }
17 |
18 | //singleTop模式启动B
19 | public void singleTopStartB(View view) {
20 | startActivity(new Intent(this, ActivityB.class));
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/activitydemo/src/main/java/com/xks/activitydemo/launchMode/ActivityC.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo.launchMode;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import com.xks.activitydemo.R;
9 |
10 | public class ActivityC extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_c);
16 | }
17 |
18 | //standard模式启动A
19 | public void standardStartA(View view) {
20 | startActivity(new Intent(this, ActivityA.class));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/activitydemo/src/main/java/com/xks/activitydemo/launchMode/ActivityD.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo.launchMode;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.v7.app.AppCompatActivity;
6 | import android.view.View;
7 |
8 | import com.xks.activitydemo.R;
9 |
10 | public class ActivityD extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_d);
16 | }
17 |
18 | //standard模式启动A
19 | public void standardStartA(View view) {
20 | startActivity(new Intent(this, ActivityA.class));
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/layout/activity_aa.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/layout/activity_b.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/layout/activity_bb.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/layout/activity_c.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/layout/activity_d.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/layout/content_second.xml:
--------------------------------------------------------------------------------
1 |
2 |
15 |
16 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | activitydemo
3 | SecondActivity
4 |
5 |
--------------------------------------------------------------------------------
/activitydemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/activitydemo/src/test/java/com/xks/activitydemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/activitydemo2/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/activitydemo2/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion "24.0.1"
6 |
7 | defaultConfig {
8 | applicationId "com.xks.activitydemo2"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/activitydemo2/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/activitydemo2/src/androidTest/java/com/xks/activitydemo2/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo2;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.activitydemo2", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/java/com/xks/activitydemo2/ActivityX.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo2;
2 |
3 | import android.content.Intent;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | public class ActivityX extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_x);
14 | }
15 |
16 | public void standardStartY(View view){
17 | startActivity(new Intent(this,ActivityY.class));
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/java/com/xks/activitydemo2/ActivityY.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo2;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class ActivityY extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_y);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/layout/activity_x.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/layout/activity_y.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo2/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo2/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo2/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo2/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/activitydemo2/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | activitydemo2
3 |
4 |
--------------------------------------------------------------------------------
/activitydemo2/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/activitydemo2/src/test/java/com/xks/activitydemo2/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.activitydemo2;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/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.xks.blogdemo"
9 | minSdkVersion 14
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(include: ['*.jar'], dir: 'libs')
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.2.1'
26 | }
27 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/xks/blogdemo/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.blogdemo;
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 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xks/blogdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.blogdemo;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class MainActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_main);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BlogDemo
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/test/java/com/xks/blogdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.blogdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 |
12 | @Test
13 | public void addition_isCorrect() throws Exception {
14 | assertEquals(4, 2 + 2);
15 | }
16 | }
--------------------------------------------------------------------------------
/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.0'
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 |
--------------------------------------------------------------------------------
/camera2/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/camera2/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.camera2"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/camera2/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/camera2/src/androidTest/java/com/xks/camera2/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.camera2;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.camera2", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/camera2/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/camera2/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
18 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/camera2/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/camera2/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/camera2/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/camera2/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/camera2/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/camera2/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/camera2/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/camera2/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/camera2/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/camera2/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/camera2/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/camera2/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/camera2/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/camera2/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | camera2
3 |
4 |
--------------------------------------------------------------------------------
/camera2/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/camera2/src/test/java/com/xks/camera2/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.camera2;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/downloadmanager/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/downloadmanager/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.downloadmanager"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/downloadmanager/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/downloadmanager/src/androidTest/java/com/xks/downloadmanager/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.downloadmanager;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.downloadmanager", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/downloadmanager/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/downloadmanager/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/downloadmanager/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/downloadmanager/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/downloadmanager/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/downloadmanager/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | downloadmanager
3 |
4 |
--------------------------------------------------------------------------------
/downloadmanager/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/downloadmanager/src/test/java/com/xks/downloadmanager/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.downloadmanager;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/filedemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/filedemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.filedemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/filedemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/filedemo/src/androidTest/java/com/xks/filedemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.filedemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.filedemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/filedemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/filedemo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
--------------------------------------------------------------------------------
/filedemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/filedemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/filedemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/filedemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/filedemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/filedemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/filedemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/filedemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/filedemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/filedemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/filedemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/filedemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/filedemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/filedemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | filedemo
3 |
4 |
--------------------------------------------------------------------------------
/filedemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/filedemo/src/test/java/com/xks/filedemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.filedemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/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 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sun Mar 19 13:27:15 CST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
7 |
--------------------------------------------------------------------------------
/handlerdemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/handlerdemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.handlerdemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/handlerdemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/handlerdemo/src/androidTest/java/com/xks/handlerdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.handlerdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.handlerdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/handlerdemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/handlerdemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/handlerdemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/handlerdemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/handlerdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/handlerdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | handlerdemo
3 |
4 |
--------------------------------------------------------------------------------
/handlerdemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/handlerdemo/src/test/java/com/xks/handlerdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.handlerdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/listviewdemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/listviewdemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.listviewdemo"
9 | minSdkVersion 14
10 | targetSdkVersion 25
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:25.2.0'
31 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
32 | compile 'com.android.support:design:25.2.0'
33 | testCompile 'junit:junit:4.12'
34 | }
35 |
--------------------------------------------------------------------------------
/listviewdemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/listviewdemo/src/androidTest/java/com/xks/listviewdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.listviewdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.listviewdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable-hdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable-hdpi/ic_action_add.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable-hdpi/ic_action_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable-hdpi/ic_action_back.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable-mdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable-mdpi/ic_action_add.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable-mdpi/ic_action_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable-mdpi/ic_action_back.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable-xhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable-xhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable-xhdpi/ic_action_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable-xhdpi/ic_action_back.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable-xxhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable-xxhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable-xxhdpi/ic_action_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable-xxhdpi/ic_action_back.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/drawable/header.jpg
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/drawable/no_border_bg.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/layout/layout_header_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/listviewdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 |
7 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | listviewdemo
3 | Main2Activity
4 | MainActivity
5 |
6 |
--------------------------------------------------------------------------------
/listviewdemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/listviewdemo/src/test/java/com/xks/listviewdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.listviewdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/loaderdemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/loaderdemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.loaderdemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/loaderdemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/loaderdemo/src/androidTest/java/com/xks/loaderdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.loaderdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.loaderdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/loaderdemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/loaderdemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/loaderdemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/loaderdemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/loaderdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/loaderdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | loaderdemo
3 |
4 |
--------------------------------------------------------------------------------
/loaderdemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/loaderdemo/src/test/java/com/xks/loaderdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.loaderdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/okhttpdemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/okhttpdemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.okhttpdemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(include: ['*.jar'], dir: 'libs')
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | compile 'com.squareup.okhttp3:okhttp:3.4.1'
33 | }
34 |
--------------------------------------------------------------------------------
/okhttpdemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/okhttpdemo/src/androidTest/java/com/xks/okhttpdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.okhttpdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.okhttpdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/java/com/xks/okhttpdemo/LogConnectionInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.xks.okhttpdemo;
2 |
3 | import java.io.IOException;
4 |
5 | import okhttp3.Interceptor;
6 | import okhttp3.Response;
7 | import okhttp3.internal.connection.RealConnection;
8 | import okhttp3.internal.http.RealInterceptorChain;
9 |
10 | /**
11 | * Created by Xingfeng on 2016-10-26.
12 | */
13 |
14 | public class LogConnectionInterceptor implements Interceptor {
15 | @Override
16 | public Response intercept(Chain chain) throws IOException {
17 |
18 | RealInterceptorChain realChain = (RealInterceptorChain) chain;
19 |
20 | RealConnection connection = (RealConnection) realChain.connection();
21 |
22 | System.out.println("URL:"+chain.request().url().toString()+" Connection地址:" + connection.toString());
23 |
24 | return chain.proceed(chain.request());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/java/com/xks/okhttpdemo/LogInterceptor.java:
--------------------------------------------------------------------------------
1 | package com.xks.okhttpdemo;
2 |
3 | import java.io.IOException;
4 |
5 | import okhttp3.Interceptor;
6 | import okhttp3.Request;
7 | import okhttp3.Response;
8 |
9 | /**
10 | * Created by Xingfeng on 2016-10-21.
11 | */
12 |
13 | public class LogInterceptor implements Interceptor {
14 |
15 | @Override
16 | public Response intercept(Chain chain) throws IOException {
17 |
18 | Request request = chain.request();
19 |
20 | System.out.println(request.toString());
21 |
22 | Response response = chain.proceed(request);
23 |
24 | System.out.println(response);
25 |
26 | return response;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/java/com/xks/okhttpdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.okhttpdemo;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class MainActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_main);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
13 |
14 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/okhttpdemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/okhttpdemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/okhttpdemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/okhttpdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/okhttpdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | okhttpdemo
3 |
4 |
--------------------------------------------------------------------------------
/okhttpdemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/okhttpdemo/src/test/java/com/xks/okhttpdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.okhttpdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/servicedemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/servicedemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.binderdemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/servicedemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/servicedemo/src/androidTest/java/com/xks/binderdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.binderdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.binderdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/servicedemo/src/main/aidl/com/xks/binderdemo/Book.aidl:
--------------------------------------------------------------------------------
1 | // Book.aidl
2 | package com.xks.binderdemo;
3 |
4 | parcelable Book;
5 |
--------------------------------------------------------------------------------
/servicedemo/src/main/aidl/com/xks/binderdemo/BookManager.aidl:
--------------------------------------------------------------------------------
1 | // IMyAidlInterface.aidl
2 | package com.xks.binderdemo;
3 |
4 | // Declare any non-default types here with import statements
5 |
6 | import com.xks.binderdemo.Book;
7 |
8 | interface BookManager {
9 |
10 | /**
11 | * 打印书籍
12 | */
13 | String printBook(in Book book);
14 |
15 | /**
16 | * 添加书籍
17 | */
18 | void addBook(in Book book);
19 |
20 | /**
21 | *得到书籍数量
22 | */
23 | int getBookSize();
24 |
25 | /**
26 | * 根据索引取书
27 | */
28 | Book get(int index);
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/servicedemo/src/main/aidl/com/xks/binderdemo/IRemoteService.aidl:
--------------------------------------------------------------------------------
1 | // IRemoteService.aidl
2 | package com.xks.binderdemo;
3 |
4 | // Declare any non-default types here with import statements
5 |
6 | interface IRemoteService {
7 |
8 | int add(int a,int b);
9 |
10 | /**
11 | * Demonstrates some basic types that you can use as parameters
12 | * and return values in AIDL.
13 | */
14 | void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat,
15 | double aDouble, String aString);
16 | }
17 |
--------------------------------------------------------------------------------
/servicedemo/src/main/java/com/xks/binderdemo/AddService.java:
--------------------------------------------------------------------------------
1 | package com.xks.binderdemo;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.Binder;
6 | import android.os.IBinder;
7 |
8 | /**
9 | * 服务中扩展Binder类,适合于应用与服务在同一个进程中
10 | */
11 | public class AddService extends Service {
12 |
13 | static class MyBinder extends Binder {
14 | public int add(int a, int b) {
15 | return a + b;
16 | }
17 | }
18 |
19 | public AddService() {
20 | }
21 |
22 | @Override
23 | public IBinder onBind(Intent intent) {
24 | return new MyBinder();
25 | }
26 |
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/servicedemo/src/main/java/com/xks/binderdemo/AidlService.java:
--------------------------------------------------------------------------------
1 | package com.xks.binderdemo;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.IBinder;
6 | import android.os.RemoteException;
7 |
8 | public class AidlService extends Service {
9 |
10 | static class AidlBinder extends IRemoteService.Stub {
11 | @Override
12 | public int add(int a, int b) throws RemoteException {
13 | return a + b;
14 | }
15 |
16 | @Override
17 | public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {
18 |
19 | }
20 | }
21 |
22 | public AidlService() {
23 | }
24 |
25 | private AidlBinder aidlBinder = new AidlBinder();
26 |
27 | @Override
28 | public IBinder onBind(Intent intent) {
29 | return aidlBinder;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/servicedemo/src/main/java/com/xks/binderdemo/BookService.java:
--------------------------------------------------------------------------------
1 | package com.xks.binderdemo;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.IBinder;
6 | import android.os.RemoteException;
7 |
8 | import java.util.ArrayList;
9 | import java.util.List;
10 |
11 | public class BookService extends Service {
12 |
13 | private List bookList = new ArrayList<>();
14 |
15 | public class BookBinder extends BookManager.Stub {
16 | @Override
17 | public String printBook(Book book) throws RemoteException {
18 | return book.toString();
19 | }
20 |
21 | @Override
22 | public void addBook(Book book) throws RemoteException {
23 | bookList.add(book);
24 | }
25 |
26 | @Override
27 | public int getBookSize() throws RemoteException {
28 | return bookList.size();
29 | }
30 |
31 | @Override
32 | public Book get(int index) throws RemoteException {
33 | return bookList.get(index);
34 | }
35 | }
36 |
37 | private BookBinder bookBinder = new BookBinder();
38 |
39 |
40 | public BookService() {
41 | }
42 |
43 | @Override
44 | public IBinder onBind(Intent intent) {
45 | return bookBinder;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/servicedemo/src/main/java/com/xks/binderdemo/IntentServiceActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.binderdemo;
2 |
3 | import android.content.Intent;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | public class IntentServiceActivity extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_intent_service);
14 | }
15 |
16 | public void startIntentService(View view) {
17 |
18 | Intent intent = new Intent(this, MyIntentService.class);
19 | for (int i = 0; i < 10; i++) {
20 | intent.putExtra("num", i);
21 | startService(intent);
22 | }
23 |
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/servicedemo/src/main/java/com/xks/binderdemo/LoggerService.java:
--------------------------------------------------------------------------------
1 | package com.xks.binderdemo;
2 |
3 | import android.app.Service;
4 | import android.content.Intent;
5 | import android.os.IBinder;
6 | import android.util.Log;
7 |
8 | public class LoggerService extends Service {
9 |
10 | public static final String TAG = "LoggerService";
11 |
12 | public LoggerService() {
13 | }
14 |
15 | @Override
16 | public void onCreate() {
17 | super.onCreate();
18 | Log.i(TAG, "onCreate");
19 | }
20 |
21 | @Override
22 | public int onStartCommand(Intent intent, int flags, int startId) {
23 | Log.i(TAG, "onStartCommand");
24 | return super.onStartCommand(intent, flags, startId);
25 | }
26 |
27 | @Override
28 | public IBinder onBind(Intent intent) {
29 | Log.i(TAG, "onBind");
30 | return null;
31 | }
32 |
33 | @Override
34 | public boolean onUnbind(Intent intent) {
35 | Log.i(TAG, "onUnbind");
36 | return super.onUnbind(intent);
37 | }
38 |
39 | @Override
40 | public void onDestroy() {
41 | super.onDestroy();
42 | Log.i(TAG, "onDestory");
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/servicedemo/src/main/java/com/xks/binderdemo/MyIntentService.java:
--------------------------------------------------------------------------------
1 | package com.xks.binderdemo;
2 |
3 | import android.app.IntentService;
4 | import android.content.Intent;
5 | import android.util.Log;
6 |
7 | import java.util.concurrent.TimeUnit;
8 |
9 | /**
10 | * Created by Xingfeng on 2016-12-23.
11 | */
12 |
13 | public class MyIntentService extends IntentService {
14 |
15 | public static final String TAG = "MyIntentService";
16 |
17 | public MyIntentService() {
18 | super(TAG);
19 | }
20 |
21 | @Override
22 | protected void onHandleIntent(Intent intent) {
23 |
24 | //模拟耗时任务
25 | try {
26 | TimeUnit.SECONDS.sleep(10);
27 | } catch (InterruptedException e) {
28 | e.printStackTrace();
29 | }
30 | Log.i(TAG, "Num:" + intent.getIntExtra("num", 0));
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/servicedemo/src/main/res/layout/activity_intent_service.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/servicedemo/src/main/res/layout/activity_play_music.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
19 |
20 |
25 |
26 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/servicedemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/servicedemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/servicedemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/servicedemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/servicedemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/servicedemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/servicedemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/servicedemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/servicedemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/servicedemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/servicedemo/src/main/res/raw/Diamonds.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/servicedemo/src/main/res/raw/Diamonds.mp3
--------------------------------------------------------------------------------
/servicedemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/servicedemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/servicedemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/servicedemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | BinderDemo
3 |
4 |
--------------------------------------------------------------------------------
/servicedemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/servicedemo/src/test/java/com/xks/binderdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.binderdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':webviewdemo', ':textspan', ':camera2', ':downloadmanager', ':filedemo', ':snackbardemo', ':viewdemo', ':okhttpdemo', ':handlerdemo', ':servicedemo', ':touchgesturedemo', ':activitydemo', ':loaderdemo', ':listviewdemo', ':toolbardemo'
2 |
--------------------------------------------------------------------------------
/snackbardemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/snackbardemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.snackbardemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(include: ['*.jar'], dir: 'libs')
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | compile 'com.android.support:design:24.2.1'
33 | }
34 |
--------------------------------------------------------------------------------
/snackbardemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/snackbardemo/src/androidTest/java/com/xks/snackbardemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.snackbardemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.snackbardemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/snackbardemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/layout/activity_main2.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
18 |
19 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/snackbardemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/snackbardemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/snackbardemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/snackbardemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/snackbardemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | snackbardemo
3 |
4 |
--------------------------------------------------------------------------------
/snackbardemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/snackbardemo/src/test/java/com/xks/snackbardemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.snackbardemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/textspan/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/textspan/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.xks.textspan"
9 | minSdkVersion 14
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | testCompile 'junit:junit:4.12'
28 | compile 'com.android.support:appcompat-v7:23.2.1'
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/textspan/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/textspan/src/androidTest/java/com/xks/textspan/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.textspan;
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 | }
--------------------------------------------------------------------------------
/textspan/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/textspan/src/main/res/drawable/smail.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/textspan/src/main/res/drawable/smail.png
--------------------------------------------------------------------------------
/textspan/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
17 |
18 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/textspan/src/main/res/layout/activity_paragraph.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
18 |
19 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/textspan/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/textspan/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/textspan/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/textspan/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/textspan/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/textspan/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/textspan/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/textspan/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/textspan/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/textspan/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/textspan/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/textspan/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/textspan/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/textspan/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | textspan
3 | text2: This is some other text, with a link specified via an <a> tag. Use a \\\"tel:\\\" URL to dial a phone number]]>
4 | 百度 http://www.baidu.com
5 | tel:13007147721
6 |
7 |
--------------------------------------------------------------------------------
/textspan/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
14 |
15 |
--------------------------------------------------------------------------------
/textspan/src/test/java/com/xks/textspan/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.textspan;
2 |
3 | import org.junit.Test;
4 |
5 | /**
6 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
7 | */
8 | public class ExampleUnitTest {
9 |
10 | @Test
11 | public void addition_isCorrect() throws Exception {
12 | }
13 | }
--------------------------------------------------------------------------------
/toolbardemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/toolbardemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 25
5 | buildToolsVersion "25.0.2"
6 |
7 | defaultConfig {
8 | applicationId "com.xks.toolbardemo"
9 | minSdkVersion 14
10 | targetSdkVersion 25
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:25.2.0'
31 | compile 'com.android.support.constraint:constraint-layout:1.0.2'
32 | compile 'com.android.support:design:25.2.0'
33 | testCompile 'junit:junit:4.12'
34 | }
35 |
--------------------------------------------------------------------------------
/toolbardemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/toolbardemo/src/androidTest/java/com/xks/toolbardemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.toolbardemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.toolbardemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/java/com/xks/toolbardemo/CustomeBehaviorActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.toolbardemo;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.FloatingActionButton;
5 | import android.support.design.widget.Snackbar;
6 | import android.support.v4.view.ViewCompat;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.support.v7.widget.Toolbar;
9 | import android.view.View;
10 |
11 | public class CustomeBehaviorActivity extends AppCompatActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_custome_behavior);
17 | }
18 |
19 | public void scroll(View view) {
20 | ViewCompat.offsetTopAndBottom(view, 5);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/java/com/xks/toolbardemo/DependentBehavior.java:
--------------------------------------------------------------------------------
1 | package com.xks.toolbardemo;
2 |
3 | import android.content.Context;
4 | import android.support.design.widget.CoordinatorLayout;
5 | import android.support.v4.view.ViewCompat;
6 | import android.util.AttributeSet;
7 | import android.view.View;
8 | import android.widget.TextView;
9 |
10 | /**
11 | * Created by Xingfeng on 2017-03-22.
12 | */
13 |
14 | public class DependentBehavior extends CoordinatorLayout.Behavior {
15 |
16 | public DependentBehavior() {
17 | super();
18 | }
19 |
20 | public DependentBehavior(Context context, AttributeSet attrs) {
21 | super(context, attrs);
22 | }
23 |
24 | @Override
25 | public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) {
26 | return dependency instanceof TextView;
27 | }
28 |
29 | @Override
30 | public boolean onDependentViewChanged(CoordinatorLayout parent, View child, View dependency) {
31 |
32 | int offset = dependency.getTop() - child.getTop();
33 | ViewCompat.offsetTopAndBottom(child, offset);
34 | return true;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/java/com/xks/toolbardemo/ScrollingActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.toolbardemo;
2 |
3 | import android.os.Bundle;
4 | import android.support.design.widget.FloatingActionButton;
5 | import android.support.design.widget.Snackbar;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.view.View;
9 |
10 | public class ScrollingActivity extends AppCompatActivity {
11 |
12 | @Override
13 | protected void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.activity_scrolling);
16 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
17 | setSupportActionBar(toolbar);
18 |
19 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
20 | fab.setOnClickListener(new View.OnClickListener() {
21 | @Override
22 | public void onClick(View view) {
23 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
24 | .setAction("Action", null).show();
25 | }
26 | });
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/java/com/xks/toolbardemo/SwipeDismissActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.toolbardemo;
2 |
3 | import android.content.res.Resources;
4 | import android.os.Bundle;
5 | import android.support.design.widget.FloatingActionButton;
6 | import android.support.design.widget.Snackbar;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.support.v7.widget.Toolbar;
9 | import android.view.View;
10 |
11 | public class SwipeDismissActivity extends AppCompatActivity {
12 |
13 | @Override
14 | protected void onCreate(Bundle savedInstanceState) {
15 | super.onCreate(savedInstanceState);
16 | setContentView(R.layout.activity_swipe_dismiss);
17 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
18 | setSupportActionBar(toolbar);
19 |
20 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
21 | fab.setOnClickListener(new View.OnClickListener() {
22 | @Override
23 | public void onClick(View view) {
24 | Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
25 | .setAction("Action", null).show();
26 | }
27 | });
28 |
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/java/com/xks/toolbardemo/ToolbarHelper.java:
--------------------------------------------------------------------------------
1 | package com.xks.toolbardemo;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.Toolbar;
5 | import android.view.Gravity;
6 | import android.widget.TextView;
7 |
8 | /**
9 | * Created by Xingfeng on 2017-03-20.
10 | */
11 |
12 | public class ToolbarHelper {
13 |
14 | public static void addMiddleTitle(Context context, CharSequence title, Toolbar toolbar) {
15 |
16 | TextView textView = new TextView(context);
17 | textView.setText(title);
18 |
19 | Toolbar.LayoutParams params = new Toolbar.LayoutParams(Toolbar.LayoutParams.WRAP_CONTENT, Toolbar.LayoutParams.WRAP_CONTENT);
20 | params.gravity = Gravity.CENTER_HORIZONTAL;
21 | toolbar.addView(textView, params);
22 |
23 | }
24 |
25 | }
26 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-hdpi/header.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-hdpi/header.jpg
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-hdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-hdpi/ic_action_add.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-hdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-hdpi/ic_action_search.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-hdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-hdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-mdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-mdpi/ic_action_add.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-mdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-mdpi/ic_action_search.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-mdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-mdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-xhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-xhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-xhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-xhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-xhdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-xhdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-xxhdpi/ic_action_add.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-xxhdpi/ic_action_add.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-xxhdpi/ic_action_search.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-xxhdpi/ic_action_search.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/drawable-xxhdpi/ic_action_settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/drawable-xxhdpi/ic_action_settings.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/layout/content_main2.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/layout/content_scrolling.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/menu/main_menu.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/menu/menu_scrolling.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/toolbardemo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 | 180dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/toolbardemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/toolbardemo/src/test/java/com/xks/toolbardemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.toolbardemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/touchgesturedemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/touchgesturedemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.touchgesturedemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/touchgesturedemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/androidTest/java/com/xks/touchgesturedemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.touchgesturedemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.touchgesturedemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/java/com/xks/touchgesturedemo/ZoomImageViewActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.touchgesturedemo;
2 |
3 | import android.support.v7.app.AppCompatActivity;
4 | import android.os.Bundle;
5 |
6 | public class ZoomImageViewActivity extends AppCompatActivity {
7 |
8 | @Override
9 | protected void onCreate(Bundle savedInstanceState) {
10 | super.onCreate(savedInstanceState);
11 | setContentView(R.layout.activity_photo_view);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/drawable/ic_action_pan_down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/drawable/ic_action_pan_down.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/drawable/ic_action_pan_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/drawable/ic_action_pan_left.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/drawable/ic_action_pan_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/drawable/ic_action_pan_right.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/drawable/ic_action_pan_up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/drawable/ic_action_pan_up.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/drawable/ic_action_zoom_in.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/drawable/ic_action_zoom_in.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/drawable/ic_action_zoom_out.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/drawable/ic_action_zoom_out.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/drawable/pic.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/drawable/pic.jpg
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/layout/activity_detect_gesture.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
19 |
20 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/layout/activity_multi_touch.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/layout/activity_photo_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/layout/activity_velocity.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/touchgesturedemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 | 16dp
7 | 100dp
8 |
9 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 100dp
7 |
8 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | touchgesturedemo
3 | Demo zoom in
4 | Demo zoom out
5 | Demo pan left
6 | Demo pan right
7 | Demo pan up
8 | Demo pan down
9 |
10 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/touchgesturedemo/src/test/java/com/xks/touchgesturedemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.touchgesturedemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/viewdemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/viewdemo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 24
5 | buildToolsVersion '25.0.0'
6 |
7 | defaultConfig {
8 | applicationId "com.xks.viewgroupdemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
11 | versionCode 1
12 | versionName "1.0"
13 |
14 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
15 |
16 | }
17 | buildTypes {
18 | release {
19 | minifyEnabled false
20 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 | }
22 | }
23 | }
24 |
25 | dependencies {
26 | compile fileTree(dir: 'libs', include: ['*.jar'])
27 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
28 | exclude group: 'com.android.support', module: 'support-annotations'
29 | })
30 | compile 'com.android.support:appcompat-v7:24.2.1'
31 | testCompile 'junit:junit:4.12'
32 | }
33 |
--------------------------------------------------------------------------------
/viewdemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/viewdemo/src/androidTest/java/com/xks/viewgroupdemo/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.viewgroupdemo;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.xks.viewgroupdemo", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/viewdemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/viewdemo/src/main/java/com/xks/viewgroupdemo/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.viewgroupdemo;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 | import android.widget.TextView;
6 |
7 | public class MainActivity extends AppCompatActivity {
8 |
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_main);
14 |
15 | TagLayout tagLayout = (TagLayout) findViewById(R.id.activity_main);
16 | TextView textView = new TextView(this);
17 | textView.setText("Android");
18 | textView.setTextSize(40);
19 | tagLayout.addView(textView);
20 |
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/viewdemo/src/main/java/com/xks/viewgroupdemo/scroll/ScrollerDemoActivity.java:
--------------------------------------------------------------------------------
1 | package com.xks.viewgroupdemo.scroll;
2 |
3 | import android.os.Bundle;
4 | import android.support.v7.app.AppCompatActivity;
5 |
6 | import com.xks.viewgroupdemo.R;
7 |
8 | public class ScrollerDemoActivity extends AppCompatActivity {
9 |
10 | @Override
11 | protected void onCreate(Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | setContentView(R.layout.activity_scroller_demo);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/viewdemo/src/main/res/layout/activity_scroller_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/viewdemo/src/main/res/layout/tabbar_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
14 |
22 |
23 |
29 |
30 |
--------------------------------------------------------------------------------
/viewdemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/viewdemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/viewdemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/viewdemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/viewdemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/viewdemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/viewdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/viewdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/viewdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/viewdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/viewdemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/viewdemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/viewdemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/viewdemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | viewgroupdemo
3 |
4 |
--------------------------------------------------------------------------------
/viewdemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/viewdemo/src/test/java/com/xks/viewgroupdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.viewgroupdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/webviewdemo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/webviewdemo/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.xks.webviewdemo"
9 | minSdkVersion 14
10 | targetSdkVersion 24
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(include: ['*.jar'], dir: 'libs')
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:24.0.0'
26 | }
27 |
--------------------------------------------------------------------------------
/webviewdemo/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 D:\SDK\Xingfeng\AppData\Local\Android\sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/webviewdemo/src/androidTest/java/com/xks/webviewdemo/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.webviewdemo;
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 | }
--------------------------------------------------------------------------------
/webviewdemo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/webviewdemo/src/main/java/com/xks/webviewdemo/Cal.java:
--------------------------------------------------------------------------------
1 | package com.xks.webviewdemo;
2 |
3 | /**
4 | * Created by Xingfeng on 2016/8/29.
5 | */
6 | public class Cal {
7 |
8 | public int add(int a, int b) {
9 | return a + b;
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
16 |
17 |
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/webviewdemo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/webviewdemo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/webviewdemo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/webviewdemo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wangli135/BlogDemo/52387649ebb53ee00659ecd60ca6dd69d776d998/webviewdemo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | WebViewDemo
3 |
4 |
--------------------------------------------------------------------------------
/webviewdemo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/webviewdemo/src/test/java/com/xks/webviewdemo/CalTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.webviewdemo;
2 |
3 | import org.junit.Assert;
4 | import org.junit.Test;
5 |
6 | /**
7 | * Created by Xingfeng on 2016/8/29.
8 | */
9 | public class CalTest{
10 |
11 | @Test
12 | public void testAdd() {
13 | Assert.assertEquals(2, 3, 4);
14 | }
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/webviewdemo/src/test/java/com/xks/webviewdemo/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.xks.webviewdemo;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------