Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

升级AndroidX,适配Android Q #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
137 changes: 112 additions & 25 deletions .idea/codeStyles/Project.xml

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

5 changes: 0 additions & 5 deletions .idea/copyright/Ess.xml

This file was deleted.

2 changes: 2 additions & 0 deletions .idea/gradle.xml

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

27 changes: 3 additions & 24 deletions .idea/misc.xml

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

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

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

2 changes: 1 addition & 1 deletion .idea/vcs.xml

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

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### 介绍

# 由于暂时没有更多的精力在此项目上,现将此项目转让给其他人,谁来认领一下,一起把这个库搞下去,加我微信bo_744172447,谢谢!
# 将原项目升级为AndroidX版本,并适配Andeoid Q

---

Expand Down Expand Up @@ -28,7 +28,7 @@


```
implementation 'cn.imlibo:FilePicker:v0.0.5_alpha'
implementation project(':filepicker')
```


Expand Down
30 changes: 17 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 27
compileSdkVersion 29
defaultConfig {
applicationId "com.imlibo.essfilepicker"
minSdkVersion 17
targetSdkVersion 26
minSdkVersion 24
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -25,22 +25,26 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8

}

}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:27.1.0'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5.4'
releaseCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.4'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.yanzhenjie:permission:2.0.0-rc2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
//debugImplementation group: 'com.squareup.leakcanary', name: 'leakcanary-android', version: '2.4'
// releaseImplementation group: 'com.squareup.leakcanary', name: 'leakcanary-android-no-op', version: '1.6.3'
implementation group: 'com.jakewharton', name: 'butterknife', version: '10.2.1'
annotationProcessor group: 'com.jakewharton', name: 'butterknife-compiler', version: '10.2.1'
implementation 'com.yanzhenjie:permission:2.0.3'
// implementation 'cn.imlibo:FilePicker:v0.0.1_alpha'
implementation project(':filepicker')
}
Expand Down
9 changes: 8 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ess.essfilepicker">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

<application
android:name=".LApplication"
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/AppTheme">
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.ess.essfilepicker;

import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.FrameLayout;

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentTransaction;

import butterknife.BindView;
import butterknife.ButterKnife;

Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/ess/essfilepicker/LApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import android.app.Application;

import com.squareup.leakcanary.LeakCanary;

/**
* LApplication
Expand All @@ -22,6 +21,5 @@ public class LApplication extends Application{
@Override
public void onCreate() {
super.onCreate();
LeakCanary.install(this);
}
}
33 changes: 22 additions & 11 deletions app/src/main/java/com/ess/essfilepicker/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.ess.essfilepicker;

import android.content.Intent;
import android.support.v4.app.Fragment;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;

import com.ess.filepicker.FilePicker;
import com.ess.filepicker.SelectCreator;
import com.ess.filepicker.SelectOptions;
Expand All @@ -18,7 +19,7 @@
import com.ess.filepicker.util.DialogUtil;
import com.yanzhenjie.permission.Action;
import com.yanzhenjie.permission.AndPermission;
import com.yanzhenjie.permission.Permission;
import com.yanzhenjie.permission.runtime.Permission;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -89,16 +90,26 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
AndPermission
.with(this)
.permission(Permission.READ_EXTERNAL_STORAGE,Permission.WRITE_EXTERNAL_STORAGE)
.onDenied(new Action() {
AndPermission.with(this)
.runtime()
.permission(
Permission.CAMERA,
Permission.READ_EXTERNAL_STORAGE,
Permission.WRITE_EXTERNAL_STORAGE)
.onGranted(new Action() {
@Override
public void onAction(List<String> permissions) {
//拒绝权限
DialogUtil.showPermissionDialog(MainActivity.this,Permission.transformText(MainActivity.this, permissions).get(0));
public void onAction(Object data) {

}
})
}).onDenied(new Action<List<String>>() {
@Override
public void onAction(@NonNull List<String> permissions) {
if (AndPermission.hasAlwaysDeniedPermission(MainActivity.this, permissions)) {
}


}
})
.start();

}
Expand Down
Loading