├── settings.gradle ├── app ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── example │ │ └── android │ │ └── contentproviderpaging │ │ ├── ImageViewHolder.java │ │ ├── MainActivity.java │ │ ├── ImageContract.java │ │ ├── ImageAdapter.java │ │ ├── ImageClientFragment.java │ │ └── ImageProvider.java │ └── AndroidManifest.xml ├── kotlinApp ├── settings.gradle ├── app │ ├── build.gradle │ └── src │ │ └── main │ │ ├── kotlin │ │ └── com.example.android.contentproviderpaging │ │ │ ├── ImageViewHolder.kt │ │ │ ├── MainActivity.kt │ │ │ ├── ImageContract.kt │ │ │ ├── ImageAdapter.kt │ │ │ ├── ImageClientFragment.kt │ │ │ └── ImageProvider.kt │ │ └── AndroidManifest.xml ├── resources │ ├── src │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ └── res │ │ │ ├── raw │ │ │ ├── cat_1.jpg │ │ │ ├── cat_2.jpg │ │ │ ├── cat_3.jpg │ │ │ ├── cat_4.jpg │ │ │ ├── cat_5.jpg │ │ │ ├── cat_6.jpg │ │ │ ├── cat_7.jpg │ │ │ ├── cat_8.jpg │ │ │ ├── cat_9.jpg │ │ │ ├── cat_10.jpg │ │ │ ├── cat_11.jpg │ │ │ ├── cat_12.jpg │ │ │ └── cat_13.jpg │ │ │ ├── drawable │ │ │ └── cat_placeholder.png │ │ │ ├── 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 │ │ │ ├── styles.xml │ │ │ ├── strings.xml │ │ │ └── arrays.xml │ │ │ └── layout │ │ │ ├── activity_main.xml │ │ │ ├── viewholder_image.xml │ │ │ └── fragment_image_client.xml │ ├── build.gradle │ └── proguard-rules.pro ├── screenshots │ ├── icon-web.png │ └── screenshot-1.png ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── common.gradle ├── .google │ └── packaging.yaml ├── NOTICE ├── CONTRIBUTING.md ├── gradlew.bat ├── README.md ├── gradlew └── LICENSE ├── resources ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── res │ │ ├── raw │ │ ├── cat_1.jpg │ │ ├── cat_2.jpg │ │ ├── cat_3.jpg │ │ ├── cat_4.jpg │ │ ├── cat_5.jpg │ │ ├── cat_6.jpg │ │ ├── cat_7.jpg │ │ ├── cat_8.jpg │ │ ├── cat_9.jpg │ │ ├── cat_10.jpg │ │ ├── cat_11.jpg │ │ ├── cat_12.jpg │ │ └── cat_13.jpg │ │ ├── drawable │ │ └── cat_placeholder.png │ │ ├── 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 │ │ ├── styles.xml │ │ ├── strings.xml │ │ └── arrays.xml │ │ └── layout │ │ ├── activity_main.xml │ │ ├── viewholder_image.xml │ │ └── fragment_image_client.xml ├── build.gradle └── proguard-rules.pro ├── screenshots ├── icon-web.png └── screenshot-1.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── README.md ├── common.gradle ├── .google └── packaging.yaml ├── NOTICE ├── CONTRIBUTING.md ├── gradlew.bat ├── gradlew └── LICENSE /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':resources' 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: '../common.gradle' 2 | -------------------------------------------------------------------------------- /kotlinApp/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':resources' 2 | -------------------------------------------------------------------------------- /kotlinApp/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply from: '../common.gradle' 2 | -------------------------------------------------------------------------------- /resources/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /screenshots/icon-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/screenshots/icon-web.png -------------------------------------------------------------------------------- /screenshots/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/screenshots/screenshot-1.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /kotlinApp/screenshots/icon-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/screenshots/icon-web.png -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_1.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_2.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_3.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_4.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_5.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_6.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_7.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_8.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_9.jpg -------------------------------------------------------------------------------- /kotlinApp/screenshots/screenshot-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/screenshots/screenshot-1.png -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_10.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_11.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_12.jpg -------------------------------------------------------------------------------- /resources/src/main/res/raw/cat_13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/raw/cat_13.jpg -------------------------------------------------------------------------------- /kotlinApp/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_1.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_2.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_3.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_4.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_5.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_6.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_7.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_8.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_9.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_10.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_11.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_12.jpg -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/raw/cat_13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/raw/cat_13.jpg -------------------------------------------------------------------------------- /resources/src/main/res/drawable/cat_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/drawable/cat_placeholder.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/drawable/cat_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/drawable/cat_placeholder.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /resources/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/resources/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-ContentProviderPaging/master/kotlinApp/resources/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /kotlinApp/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Oct 17 16:40:13 PDT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Oct 17 16:40:13 PDT 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip 7 | >>>>>>> ContentProviderPaging: Make kotlinApp module self-contained 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | Android ContentProviderPaging Sample 3 | ==================================== 4 | 5 | This sample has been deprecated/archived meaning it's read-only and it's no longer actively maintained (more details on archiving can be found [here][1]). 6 | 7 | For other related samples, check out the new [github.com/android/storage-samples][2] repo. Thank you! 8 | 9 | [1]: https://help.github.com/en/articles/about-archiving-repositories 10 | [2]: https://github.com/android/storage-samples 11 | -------------------------------------------------------------------------------- /kotlinApp/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | ext.kotlin_version = '1.1.2-4' 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.0.0' 9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 10 | } 11 | } 12 | 13 | allprojects { 14 | repositories { 15 | jcenter() 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /common.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.1" 6 | 7 | defaultConfig { 8 | applicationId "com.example.android.contentproviderpaging" 9 | minSdkVersion 26 10 | targetSdkVersion 26 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | 20 | dependencies { 21 | compile project(':resources') 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /kotlinApp/common.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion "26.0.1" 6 | 7 | defaultConfig { 8 | applicationId "com.example.android.contentproviderpaging" 9 | minSdkVersion 26 10 | targetSdkVersion 26 11 | } 12 | 13 | buildTypes { 14 | release { 15 | minifyEnabled false 16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 17 | } 18 | } 19 | 20 | dependencies { 21 | compile project(':resources') 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.google/packaging.yaml: -------------------------------------------------------------------------------- 1 | 2 | # GOOGLE SAMPLE PACKAGING DATA 3 | # 4 | # This file is used by Google as part of our samples packaging process. 5 | # End users may safely ignore this file. It has no relevance to other systems. 6 | --- 7 | status: PUBLISHED 8 | technologies: [Android] 9 | categories: [Content, Android O Preview] 10 | languages: [Java] 11 | solutions: [Mobile] 12 | github: android-ContentProviderPaging 13 | level: INTERMEDIATE 14 | icon: screenshots/icon-web.png 15 | apiRefs: 16 | - android:android.content.ContentProvider 17 | - android:android.provider.DocumentsProvider 18 | license: apache2 19 | -------------------------------------------------------------------------------- /kotlinApp/.google/packaging.yaml: -------------------------------------------------------------------------------- 1 | 2 | # GOOGLE SAMPLE PACKAGING DATA 3 | # 4 | # This file is used by Google as part of our samples packaging process. 5 | # End users may safely ignore this file. It has no relevance to other systems. 6 | --- 7 | status: PUBLISHED 8 | technologies: [Android] 9 | categories: [Content, Android O Preview] 10 | languages: [Java] 11 | solutions: [Mobile] 12 | github: android-ContentProviderPaging 13 | level: INTERMEDIATE 14 | icon: screenshots/icon-web.png 15 | apiRefs: 16 | - android:android.content.ContentProvider 17 | - android:android.provider.DocumentsProvider 18 | license: apache2 19 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | 2 | This sample uses the following software: 3 | 4 | Copyright 2018 The Android Open Source Project 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | -------------------------------------------------------------------------------- /kotlinApp/NOTICE: -------------------------------------------------------------------------------- 1 | 2 | This sample uses the following software: 3 | 4 | Copyright 2017 The Android Open Source Project 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software 13 | distributed under the License is distributed on an "AS IS" BASIS, 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | See the License for the specific language governing permissions and 16 | limitations under the License. 17 | -------------------------------------------------------------------------------- /resources/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | compile 'com.android.support:appcompat-v7:25.3.1' 26 | compile 'com.android.support:recyclerview-v7:25.3.1' 27 | compile 'com.github.bumptech.glide:glide:3.7.0' 28 | testCompile 'junit:junit:4.12' 29 | } 30 | -------------------------------------------------------------------------------- /kotlinApp/resources/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | compile 'com.android.support:appcompat-v7:25.3.1' 26 | compile 'com.android.support:recyclerview-v7:25.3.1' 27 | compile 'com.github.bumptech.glide:glide:3.7.0' 28 | testCompile 'junit:junit:4.12' 29 | } 30 | -------------------------------------------------------------------------------- /resources/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | #3F51B5 19 | #303F9F 20 | #FF4081 21 | 22 | -------------------------------------------------------------------------------- /resources/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | #3F51B5 19 | #303F9F 20 | #FF4081 21 | 22 | -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 16 | 20 | -------------------------------------------------------------------------------- /resources/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 4dp 20 | 4dp 21 | 22 | 16dp 23 | 24 | -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 4dp 20 | 4dp 21 | 22 | 16dp 23 | 24 | -------------------------------------------------------------------------------- /resources/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 /usr/local/google/home/thagikura/android-sdk_o_release_3855523/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 | -------------------------------------------------------------------------------- /kotlinApp/resources/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 /usr/local/google/home/thagikura/android-sdk_o_release_3855523/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 | -------------------------------------------------------------------------------- /resources/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 15 | 16 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /resources/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | ContentProvider Paging sample 19 | The root directory of the documents 20 | 21 | Fetched from %1$d to %2$d images out of %3$d in total. 22 | A cat image 23 | Show images 24 | 25 | -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | ContentProvider Paging sample 19 | The root directory of the documents 20 | 21 | Fetched from %1$d to %2$d images out of %3$d in total. 22 | A cat image 23 | Show images 24 | 25 | -------------------------------------------------------------------------------- /resources/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | @raw/cat_1 20 | @raw/cat_2 21 | @raw/cat_3 22 | @raw/cat_4 23 | @raw/cat_5 24 | @raw/cat_6 25 | @raw/cat_7 26 | @raw/cat_8 27 | @raw/cat_9 28 | @raw/cat_10 29 | @raw/cat_11 30 | @raw/cat_12 31 | @raw/cat_13 32 | 33 | 34 | -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | @raw/cat_1 20 | @raw/cat_2 21 | @raw/cat_3 22 | @raw/cat_4 23 | @raw/cat_5 24 | @raw/cat_6 25 | @raw/cat_7 26 | @raw/cat_8 27 | @raw/cat_9 28 | @raw/cat_10 29 | @raw/cat_11 30 | @raw/cat_12 31 | @raw/cat_13 32 | 33 | 34 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/kotlin/com.example.android.contentproviderpaging/ImageViewHolder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.android.contentproviderpaging 18 | 19 | import android.support.v7.widget.RecyclerView 20 | import android.view.View 21 | import android.widget.ImageView 22 | import android.widget.TextView 23 | 24 | /** 25 | * ViewHolder that represents an image. 26 | */ 27 | internal class ImageViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { 28 | 29 | var mImageView: ImageView = itemView.findViewById(R.id.imageview) 30 | var mTextView: TextView = itemView.findViewById(R.id.textview_image_label) 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/android/contentproviderpaging/ImageViewHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.android.contentproviderpaging; 18 | 19 | import android.support.v7.widget.RecyclerView; 20 | import android.view.View; 21 | import android.widget.ImageView; 22 | import android.widget.TextView; 23 | 24 | /** 25 | * ViewHolder that represents an image. 26 | */ 27 | class ImageViewHolder extends RecyclerView.ViewHolder { 28 | 29 | ImageView mImageView; 30 | TextView mTextView; 31 | 32 | ImageViewHolder(View itemView) { 33 | super(itemView); 34 | 35 | mImageView = itemView.findViewById(R.id.imageview); 36 | mTextView = itemView.findViewById(R.id.textview_image_label); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/kotlin/com.example.android.contentproviderpaging/MainActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.android.contentproviderpaging 18 | 19 | import android.os.Bundle 20 | import android.support.v7.app.AppCompatActivity 21 | 22 | /** 23 | * The launcher Activity. 24 | */ 25 | class MainActivity : AppCompatActivity() { 26 | 27 | override fun onCreate(savedInstanceState: Bundle?) { 28 | super.onCreate(savedInstanceState) 29 | setContentView(R.layout.activity_main) 30 | 31 | if (savedInstanceState == null) { 32 | supportFragmentManager.beginTransaction() 33 | .add(R.id.container, ImageClientFragment.newInstance()) 34 | .commit() 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/android/contentproviderpaging/MainActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.android.contentproviderpaging; 18 | 19 | import android.os.Bundle; 20 | import android.support.v7.app.AppCompatActivity; 21 | 22 | /** 23 | * The launcher Activity. 24 | */ 25 | public class MainActivity extends AppCompatActivity { 26 | 27 | @Override 28 | protected void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.activity_main); 31 | 32 | if (savedInstanceState == null) { 33 | getSupportFragmentManager().beginTransaction() 34 | .add(R.id.container, ImageClientFragment.newInstance()) 35 | .commit(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /kotlinApp/app/src/main/kotlin/com.example.android.contentproviderpaging/ImageContract.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.android.contentproviderpaging 18 | 19 | import android.net.Uri 20 | import android.provider.BaseColumns 21 | 22 | /** 23 | * The contract for the [ImageProvider]. 24 | */ 25 | internal object ImageContract { 26 | 27 | val AUTHORITY = "com.example.android.contentproviderpaging.documents" 28 | 29 | val CONTENT_URI = Uri.parse("content://$AUTHORITY/images")!! 30 | 31 | internal interface Columns : BaseColumns { 32 | companion object { 33 | 34 | val DISPLAY_NAME = "display_name" 35 | 36 | val ABSOLUTE_PATH = "absolute_path" 37 | 38 | val SIZE = "size" 39 | } 40 | } 41 | 42 | val PROJECTION_ALL = arrayOf(BaseColumns._ID, Columns.DISPLAY_NAME, Columns.ABSOLUTE_PATH, Columns.SIZE) 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/android/contentproviderpaging/ImageContract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2017 The Android Open Source Project 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.example.android.contentproviderpaging; 18 | 19 | import android.net.Uri; 20 | import android.provider.BaseColumns; 21 | 22 | /** 23 | * The contract for the {@link ImageProvider}. 24 | */ 25 | class ImageContract { 26 | 27 | static final String AUTHORITY = "com.example.android.contentproviderpaging.documents"; 28 | 29 | static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/images"); 30 | 31 | interface Columns extends BaseColumns { 32 | 33 | String DISPLAY_NAME = "display_name"; 34 | 35 | String ABSOLUTE_PATH = "absolute_path"; 36 | 37 | String SIZE = "size"; 38 | } 39 | 40 | static final String[] PROJECTION_ALL = new String[]{ 41 | Columns._ID, 42 | Columns.DISPLAY_NAME, 43 | Columns.ABSOLUTE_PATH, 44 | Columns.SIZE 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /resources/src/main/res/layout/viewholder_image.xml: -------------------------------------------------------------------------------- 1 | 16 | 19 | 20 | 27 | 28 | 39 | 40 | -------------------------------------------------------------------------------- /kotlinApp/resources/src/main/res/layout/viewholder_image.xml: -------------------------------------------------------------------------------- 1 | 16 | 19 | 20 | 27 | 28 | 39 | 40 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to become a contributor and submit your own code 2 | 3 | ## Contributor License Agreements 4 | 5 | We'd love to accept your sample apps and patches! Before we can take them, we 6 | have to jump a couple of legal hurdles. 7 | 8 | Please fill out either the individual or corporate Contributor License Agreement (CLA). 9 | 10 | * If you are an individual writing original source code and you're sure you 11 | own the intellectual property, then you'll need to sign an [individual CLA] 12 | (https://cla.developers.google.com). 13 | * If you work for a company that wants to allow you to contribute your work, 14 | then you'll need to sign a [corporate CLA] 15 | (https://cla.developers.google.com). 16 | 17 | Follow either of the two links above to access the appropriate CLA and 18 | instructions for how to sign and return it. Once we receive it, we'll be able to 19 | accept your pull requests. 20 | 21 | ## Contributing A Patch 22 | 23 | 1. Submit an issue describing your proposed change to the repo in question. 24 | 1. The repo owner will respond to your issue promptly. 25 | 1. If your proposed change is accepted, and you haven't already done so, sign a 26 | Contributor License Agreement (see details above). 27 | 1. Fork the desired repo, develop and test your code changes. 28 | 1. Ensure that your code adheres to the existing style in the sample to which 29 | you are contributing. Refer to the 30 | [Android Code Style Guide] 31 | (https://source.android.com/source/code-style.html) for the 32 | recommended coding standards for this organization. 33 | 1. Ensure that your code has an appropriate set of unit tests which all pass. 34 | 1. Submit a pull request. 35 | 36 | -------------------------------------------------------------------------------- /kotlinApp/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to become a contributor and submit your own code 2 | 3 | ## Contributor License Agreements 4 | 5 | We'd love to accept your sample apps and patches! Before we can take them, we 6 | have to jump a couple of legal hurdles. 7 | 8 | Please fill out either the individual or corporate Contributor License Agreement (CLA). 9 | 10 | * If you are an individual writing original source code and you're sure you 11 | own the intellectual property, then you'll need to sign an [individual CLA] 12 | (https://cla.developers.google.com). 13 | * If you work for a company that wants to allow you to contribute your work, 14 | then you'll need to sign a [corporate CLA] 15 | (https://cla.developers.google.com). 16 | 17 | Follow either of the two links above to access the appropriate CLA and 18 | instructions for how to sign and return it. Once we receive it, we'll be able to 19 | accept your pull requests. 20 | 21 | ## Contributing A Patch 22 | 23 | 1. Submit an issue describing your proposed change to the repo in question. 24 | 1. The repo owner will respond to your issue promptly. 25 | 1. If your proposed change is accepted, and you haven't already done so, sign a 26 | Contributor License Agreement (see details above). 27 | 1. Fork the desired repo, develop and test your code changes. 28 | 1. Ensure that your code adheres to the existing style in the sample to which 29 | you are contributing. Refer to the 30 | [Android Code Style Guide] 31 | (https://source.android.com/source/code-style.html) for the 32 | recommended coding standards for this organization. 33 | 1. Ensure that your code has an appropriate set of unit tests which all pass. 34 | 1. Submit a pull request. 35 | 36 | -------------------------------------------------------------------------------- /resources/src/main/res/layout/fragment_image_client.xml: -------------------------------------------------------------------------------- 1 | 16 | 25 | 26 |