Skip to content

Commit

Permalink
android 13 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DmcSDK committed Nov 14, 2023
1 parent 7fcc891 commit ccb4add
Show file tree
Hide file tree
Showing 27 changed files with 251 additions and 148 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
*.iml
.gradle
/local.properties
/.idea/*
.idea/
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.idea
.externalNativeBuild
3 changes: 3 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 1 addition & 54 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '25.0.1'
compileSdkVersion 33
buildToolsVersion '29.0.3'
defaultConfig {
applicationId "dmc.mediapickerpoject"
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
Expand All @@ -21,11 +25,11 @@ android {

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
androidTestCompile('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'androidx.appcompat:appcompat:1.0.0'
compile 'androidx.constraintlayout:constraintlayout:1.1.3'
testCompile 'junit:junit:4.12'
compile project(':mediapicker')
}
9 changes: 6 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
package="dmc.mediapickerpoject">


<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="24" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-sdk android:targetSdkVersion="24" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" android:minSdkVersion = "33"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" android:minSdkVersion = "33"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" android:minSdkVersion = "33"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>

<application
android:allowBackup="true"
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/dmc/mediapickerpoject/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import androidx.appcompat.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.ImageView;
Expand Down Expand Up @@ -43,7 +43,7 @@ public void onClick(View v) {
ArrayList<Media> select;
void go(){
Intent intent =new Intent(MainActivity.this, PickerActivity.class);
intent.putExtra(PickerConfig.SELECT_MODE,PickerConfig.PICKER_IMAGE_VIDEO);//default image and video (Optional)
intent.putExtra(PickerConfig.SELECT_MODE,PickerConfig.PICKER_IMAGE);//default image and video (Optional)
long maxSize=188743680L;//long long long
intent.putExtra(PickerConfig.MAX_SELECT_SIZE,maxSize); //default 180MB (Optional)
intent.putExtra(PickerConfig.MAX_SELECT_COUNT,15); //default 40 (Optional)
Expand Down
24 changes: 22 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,21 @@

buildscript {
repositories {
maven { url 'https://jitpack.io' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand All @@ -16,6 +26,16 @@ buildscript {

allprojects {
repositories {
maven { url 'https://jitpack.io' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jun 06 17:46:03 CST 2017
#Wed Jul 07 10:40:41 CST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
25 changes: 15 additions & 10 deletions mediapicker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,23 @@ properties.load(project.rootProject.file('local.properties').newDataInputStream(
version = "3.3" //发布版本号
group = "com.dmcBig" //最终引用形式,如compile 'com.**;
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileSdkVersion 33
buildToolsVersion '29.0.3'

defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion 29
versionCode 1
versionName "3.3"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

buildTypes {
release {
minifyEnabled false
Expand All @@ -30,16 +35,16 @@ android {
}
}


dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.github.bumptech.glide:glide:4.0.0'
compile 'com.android.support:support-v4:25.3.1'
implementation 'com.github.bumptech.glide:glide:4.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
compile 'pub.devrel:easypermissions:1.0.0'
compile 'com.github.chrisbanes.photoview:library:1.2.4'
implementation 'pub.devrel:easypermissions:3.0.0'
implementation 'com.github.chrisbanes.photoview:library:1.2.4'
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.activity:activity:1.6.1"
}

bintray {
Expand Down
8 changes: 5 additions & 3 deletions mediapicker/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dmcbig.mediapicker">
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" android:minSdkVersion = "33"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" android:minSdkVersion = "33"/>
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" android:minSdkVersion = "33"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>

<application android:allowBackup="true"
android:supportsRtl="true">
Expand Down
Loading

0 comments on commit ccb4add

Please sign in to comment.