Skip to content

Commit

Permalink
降级到support
Browse files Browse the repository at this point in the history
  • Loading branch information
hss01248 committed Oct 13, 2020
1 parent f65105f commit 39303ce
Show file tree
Hide file tree
Showing 19 changed files with 48 additions and 181 deletions.
7 changes: 2 additions & 5 deletions activityresult/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ android {
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}

Expand All @@ -27,9 +26,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support:appcompat-v7:28.0.0'

api project (':transfrag')
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

import android.app.Activity;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.util.Log;

import androidx.annotation.Nullable;


/**
* time:2020/4/30
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.hss01248.activityresult;

import android.content.Intent;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;

import com.hss01248.transfrag.BaseTransFragment;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package com.hss01248.activityresult;

import android.content.Intent;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.util.Log;

import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;


import com.hss01248.transfrag.BaseTransFragment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentActivity;




Expand Down Expand Up @@ -45,7 +47,7 @@ private static boolean isAppDebugable(Application application) {
}

@SuppressLint("CheckResult")
public static void goOutAppForResult(@NonNull Activity activity, @NonNull Intent intent,
public static void goOutAppForResult(@NonNull AppCompatActivity activity, @NonNull Intent intent,
@NonNull final ActivityResultListener listener){
init(activity.getApplication());
new GoOutOfAppForResultFragment((FragmentActivity) activity,intent).goOutApp(listener);
Expand All @@ -59,11 +61,11 @@ public static void goOutAppForResult(@NonNull Activity activity, @NonNull Inten
* @param listener
*/
@SuppressLint("CheckResult")
public static <T extends Activity> void startActivity(@NonNull final Activity activity,
@Nullable Class<T> targetClazz,
@Nullable Intent intent,
boolean needResult,
@NonNull final TheActivityListener<T> listener) {
public static <T extends AppCompatActivity> void startActivity(@NonNull final AppCompatActivity activity,
@Nullable Class<T> targetClazz,
@Nullable Intent intent,
boolean needResult,
@NonNull final TheActivityListener<T> listener) {
init(activity.getApplication());
if(targetClazz == null && intent == null){
listener.onActivityNotFound(new Throwable("targetClazz and intent can not be null at same time"));
Expand Down Expand Up @@ -93,8 +95,8 @@ public static <T extends Activity> void startActivity(@NonNull final Activity ac
}
}

private static <T extends Activity> void registerCallback(final Application application, final Class<T> targetClazz,
final TheActivityListener<T> listener) {
private static <T extends AppCompatActivity> void registerCallback(final Application application, final Class<T> targetClazz,
final TheActivityListener<T> listener) {

application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
boolean hasonActivityCreated;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/**
* time:2020/4/30
* author:hss
* desription:
*/
public class TheActivityListener<T extends Activity> implements ActivityResultListener {
public class TheActivityListener<T extends AppCompatActivity> implements ActivityResultListener {



Expand Down

This file was deleted.

9 changes: 3 additions & 6 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}
buildTypes {
release {
Expand All @@ -21,10 +21,7 @@ android {

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support:appcompat-v7:28.0.0'

implementation project (':activityresult')
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;

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


/**
* time:2020/4/30
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package com.hss01248.transfragmentdemo;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationManagerCompat;


import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.NotificationManagerCompat;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.hss01248.transfragmentdemo;

import androidx.fragment.app.FragmentActivity;


import android.support.v4.app.FragmentActivity;

import com.hss01248.transfrag.BaseTransFragment;

Expand Down

This file was deleted.

4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ org.gradle.jvmargs=-Xmx1536m
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true


7 changes: 2 additions & 5 deletions transfrag/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

consumerProguardFiles 'consumer-rules.pro'
}

Expand All @@ -27,10 +27,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
//implementation 'com.github.VictorAlbertos:RxActivityResult:0.5.0-2.x'
//implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.util.Log;


import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;


import java.util.UUID;

Expand Down

This file was deleted.

0 comments on commit 39303ce

Please sign in to comment.