Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: set up JDK 1.8
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Build project
run: .github/scripts/gradlew_recursive.sh assembleDebug
- name: Zip artifacts
Expand Down
10 changes: 4 additions & 6 deletions FileProvider/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileSdkVersion 31

defaultConfig {
applicationId "com.example.graygallery"
minSdkVersion 21
targetSdkVersion 29
targetSdkVersion 31
versionCode 1
versionName "1.0"

Expand Down Expand Up @@ -63,7 +61,7 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.fragment:fragment-ktx:1.4.0-alpha07'
implementation 'androidx.fragment:fragment-ktx:1.4.0-alpha09'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
Expand All @@ -73,7 +71,7 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.7.2'
implementation 'io.coil-kt:coil:0.11.0'

testImplementation 'junit:junit:4.13'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

Expand Down
3 changes: 2 additions & 1 deletion FileProvider/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@

<activity
android:name=".MainActivity"
android:label="@string/app_name">
android:label="@string/app_name"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
4 changes: 2 additions & 2 deletions FileProvider/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.3.72"
ext.kotlin_version = "1.5.30"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.1'
classpath 'com.android.tools.build:gradle:7.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
Expand Down
7 changes: 6 additions & 1 deletion ScopedStorage/.gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
*.iml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nc

.gradle
/local.properties
.idea
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
Expand Down
3 changes: 0 additions & 3 deletions ScopedStorage/README.md

This file was deleted.

72 changes: 33 additions & 39 deletions ScopedStorage/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,41 +1,23 @@
/*
* Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-parcelize'
id "org.jetbrains.kotlin.plugin.parcelize"
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdk 31

defaultConfig {
applicationId "com.samples.storage"
minSdkVersion 21
targetSdkVersion 30
applicationId "com.samples.storage.scopedstorage"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildFeatures {
viewBinding true
vectorDrawables {
useSupportLibrary true
}
}

buildTypes {
Expand All @@ -50,28 +32,40 @@ android {
}
kotlinOptions {
jvmTarget = '1.8'
useIR = true
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.activity:activity-ktx:1.3.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
implementation 'androidx.fragment:fragment-ktx:1.3.6'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation "androidx.compose.material:material-icons-extended:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-compose:1.3.1'

implementation "androidx.navigation:navigation-compose:2.4.0-alpha08"
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
implementation "com.github.skydoves:landscapist-glide:1.3.6"

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
}
35 changes: 13 additions & 22 deletions ScopedStorage/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,38 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2020 The Android Open Source Project
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.samples.storage">
package="com.samples.storage.scopedstorage">

<!-- Use to download content in the MediaStore demo -->
<uses-permission android:name="android.permission.INTERNET" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.StorageAPIs"
android:requestLegacyExternalStorage="true">
<activity android:name=".MainActivity">
android:theme="@style/Theme.ScopedStorage">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.ScopedStorage.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Binary file added ScopedStorage/app/src/main/assets/sample.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ScopedStorage/app/src/main/assets/sample.mp4
Binary file not shown.
Binary file added ScopedStorage/app/src/main/assets/sample.pdf
Binary file not shown.
Binary file added ScopedStorage/app/src/main/assets/sample.zip
Binary file not shown.

This file was deleted.

This file was deleted.

Loading