Skip to content

Commit

Permalink
升级一些配置信息
Browse files Browse the repository at this point in the history
  • Loading branch information
lcyluo committed Dec 25, 2024
1 parent e19f785 commit 0b183da
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 92 deletions.
5 changes: 1 addition & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
maven { url 'https://maven.google.com' }
maven { url "https://maven.aliyun.com/nexus/content/groups/public" }
}
dependencies {
//noinspection GradleDependency
classpath 'com.android.tools.build:gradle:3.4.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.android.tools.build:gradle:8.0.2'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://jitpack.io" }
maven { url "https://maven.aliyun.com/nexus/content/groups/public" }
Expand Down
17 changes: 9 additions & 8 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 33
compileSdkVersion 34

defaultConfig {
applicationId "com.huantansheng.easyphotos.demo"
minSdkVersion 19
minSdkVersion 23
//noinspection OldTargetApi
targetSdkVersion 33
versionCode 8
versionName "1.1.8"
versionCode 123
versionName "1.2.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -17,6 +18,8 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

namespace 'com.huantansheng.easyphotos.demo'
}

dependencies {
Expand All @@ -27,7 +30,7 @@ dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'

Expand All @@ -37,7 +40,5 @@ dependencies {
exclude group: "com.android.support"
}
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
//检测内存泄漏
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
}

41 changes: 10 additions & 31 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.huantansheng.easyphotos.demo">
xmlns:tools="http://schemas.android.com/tools">

<application
android:name="com.huantansheng.easyphotos.demo.MyApplication"
android:allowBackup="true"
android:name=".MyApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name="com.huantansheng.easyphotos.demo.SampleActivity"
android:label="@string/app_name"
android:name=".SampleActivity"
android:exported="true"
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand All @@ -27,36 +24,18 @@
android:name="androidx.core.content.FileProvider"
android:authorities="com.huantansheng.easyphotos.demo.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
android:grantUriPermissions="true"
tools:replace="android:exported">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths_public" />
</provider>

<!-- <activity -->
<!-- android:name="com.huantansheng.easyphotos.ui.EasyPhotosActivity" -->
<!-- android:screenOrientation="unspecified" -->
<!-- tools:replace="android:screenOrientation"/> -->


<!-- <activity -->
<!-- android:name="com.huantansheng.easyphotos.ui.PreviewActivity" -->
<!-- android:screenOrientation="unspecified" -->
<!-- tools:replace="android:screenOrientation" /> -->


<!-- <activity -->
<!-- android:name="com.huantansheng.easyphotos.ui.PuzzleActivity" -->
<!-- android:screenOrientation="unspecified" -->
<!-- tools:replace="android:screenOrientation" /> -->


<!-- <activity -->
<!-- android:name="com.huantansheng.easyphotos.ui.PuzzleSelectorActivity" -->
<!-- android:screenOrientation="unspecified" -->
<!-- tools:replace="android:screenOrientation" /> -->
<activity
android:name="com.huantansheng.easyphotos.demo.SampleFragments"
android:exported="false"
tools:replace="android:exported" />

<activity android:name="com.huantansheng.easyphotos.demo.SampleFragments" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import android.app.Application;

import com.squareup.leakcanary.LeakCanary;

/**
* 主要用于检测内存泄漏
* Created by huan on 2018/1/30.
Expand All @@ -13,11 +11,5 @@ public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
LeakCanary.install(this);
}
}
37 changes: 11 additions & 26 deletions easyPhotos/build.gradle
Original file line number Diff line number Diff line change
@@ -1,49 +1,34 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 33
compileSdkVersion 34

defaultConfig {
minSdkVersion 19
minSdkVersion 23
//noinspection OldTargetApi
targetSdkVersion 33
versionCode 122
versionName "1.2.2.1"
versionCode 123
versionName "1.2.3"
vectorDrawables.useSupportLibrary = true
}

lintOptions {
abortOnError false
}

namespace 'com.huantansheng.easyphotos'
}

dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
//noinspection GradleDependency
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
//noinspection GradleDependency
implementation 'androidx.appcompat:appcompat:1.2.0'
//noinspection GradleDependency
implementation 'com.google.android.material:material:1.2.1'
//noinspection GradleDependency
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
}

tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
task javadoc(type: Javadoc) {
failOnError false
source = android.sourceSets.main.java.sourceFiles
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
27 changes: 17 additions & 10 deletions easyPhotos/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?xml version="1.0" encoding="utf-8"?><!--suppress AndroidUnknownAttribute -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.huantansheng.easyphotos">

xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission
Expand All @@ -12,42 +10,51 @@
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="32"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
<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.MOUNT_UNMOUNT_FILESYSTEMS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<!-- android14前台常住服务权限-->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_CAMERA" />

<application
android:allowBackup="true"
android:supportsRtl="true">
<application tools:ignore="DiscouragedApi">
<activity
android:name=".ui.EasyPhotosActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/EasyPhotosTheme" />
<activity
android:name=".ui.PreviewActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/EasyPhotosFullscreenTheme" />
<activity
android:name=".ui.PuzzleActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/EasyPhotosTheme"
android:windowSoftInputMode="adjustPan" />

<activity
android:name=".ui.PuzzleSelectorActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false"
android:screenOrientation="portrait"
android:theme="@style/EasyPhotosTheme" />
<!--防止拍照被回收-->
<service
android:name=".utils.BackgroundCallService"
android:foregroundServiceType="camera" />
android:exported="false"
android:foregroundServiceType="camera"
tools:replace="android:exported" />
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static AlbumModel getInstance() {

public void query(Context context, final CallBack callBack) {
final Context appCxt = context.getApplicationContext();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && appCxt.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.TIRAMISU) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if ((Setting.isOnlyImage() && PermissionChecker.checkSelfPermission(context, Manifest.permission.READ_MEDIA_IMAGES) != PermissionChecker.PERMISSION_GRANTED)
|| (Setting.isOnlyVideo() && PermissionChecker.checkSelfPermission(context, Manifest.permission.READ_MEDIA_VIDEO) != PermissionChecker.PERMISSION_GRANTED)) {
if (null != callBack) callBack.onAlbumWorkedCallBack();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public void run() {
}

protected String[] getNeedPermissions() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.TIRAMISU) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
return new String[]{Manifest.permission.READ_MEDIA_IMAGES};
}
return new String[]{Manifest.permission.READ_EXTERNAL_STORAGE};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static void progressNoPermission(Activity cxt, PermissionCallBack listen
}

public static String[] getNeedPermissions(Activity cxt) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && cxt.getApplicationInfo().targetSdkVersion >= Build.VERSION_CODES.TIRAMISU) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
if (Setting.isOnlyImage()) {
return new String[]{Manifest.permission.READ_MEDIA_IMAGES};
}
Expand Down
6 changes: 6 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.suppressUnsupportedCompileSdk=34
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

# R
android.nonTransitiveRClass=false
org.gradle.configureondemand=true
android.nonFinalResIds=false

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
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 @@
#Fri Nov 29 10:01:32 CST 2024
#Wed Dec 25 16:26:32 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 0b183da

Please sign in to comment.