From df2193d3dba11ae3e81b35bd5feafb1b53e61df5 Mon Sep 17 00:00:00 2001 From: geyifeng Date: Mon, 19 Aug 2019 09:39:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=AF=E4=BB=A5=E8=A7=84?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 6 +++--- .../immersionbar/RequestManagerRetriever.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 6cfb822..d95cff1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,15 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.31' - ext.immersionbar_version = '3.0.0-beta05' + ext.kotlin_version = '1.3.41' + ext.immersionbar_version = '3.0.0-beta06' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' + classpath 'com.android.tools.build:gradle:3.4.2' classpath 'com.novoda:bintray-release:0.9.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong diff --git a/immersionbar/src/main/java/com/gyf/immersionbar/RequestManagerRetriever.java b/immersionbar/src/main/java/com/gyf/immersionbar/RequestManagerRetriever.java index 6e44afb..a900225 100644 --- a/immersionbar/src/main/java/com/gyf/immersionbar/RequestManagerRetriever.java +++ b/immersionbar/src/main/java/com/gyf/immersionbar/RequestManagerRetriever.java @@ -48,9 +48,9 @@ private RequestManagerRetriever() { public ImmersionBar get(Activity activity) { checkNotNull(activity, "activity is null"); if (activity instanceof FragmentActivity) { - return getSupportFragment(((FragmentActivity) activity).getSupportFragmentManager(), mTag + activity.toString()).get(activity); + return getSupportFragment(((FragmentActivity) activity).getSupportFragmentManager(), mTag + System.identityHashCode(activity)).get(activity); } else { - return getFragment(activity.getFragmentManager(), mTag + activity.toString()).get(activity); + return getFragment(activity.getFragmentManager(), mTag + System.identityHashCode(activity)).get(activity); } } @@ -60,7 +60,7 @@ public ImmersionBar get(Fragment fragment) { if (fragment instanceof DialogFragment) { checkNotNull(((DialogFragment) fragment).getDialog(), "fragment.getDialog() is null"); } - return getSupportFragment(fragment.getChildFragmentManager(), mTag + fragment.toString()).get(fragment); + return getSupportFragment(fragment.getChildFragmentManager(), mTag + System.identityHashCode(fragment)).get(fragment); } @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1) @@ -70,16 +70,16 @@ public ImmersionBar get(android.app.Fragment fragment) { if (fragment instanceof android.app.DialogFragment) { checkNotNull(((android.app.DialogFragment) fragment).getDialog(), "fragment.getDialog() is null"); } - return getFragment(fragment.getChildFragmentManager(), mTag + fragment.toString()).get(fragment); + return getFragment(fragment.getChildFragmentManager(), mTag + System.identityHashCode(fragment)).get(fragment); } public ImmersionBar get(Activity activity, Dialog dialog) { checkNotNull(activity, "activity is null"); checkNotNull(dialog, "dialog is null"); if (activity instanceof FragmentActivity) { - return getSupportFragment(((FragmentActivity) activity).getSupportFragmentManager(), mTag + dialog.toString()).get(activity, dialog); + return getSupportFragment(((FragmentActivity) activity).getSupportFragmentManager(), mTag + System.identityHashCode(dialog)).get(activity, dialog); } else { - return getFragment(activity.getFragmentManager(), mTag + dialog.toString()).get(activity, dialog); + return getFragment(activity.getFragmentManager(), mTag + System.identityHashCode(dialog)).get(activity, dialog); } } @@ -88,12 +88,12 @@ public void destroy(Activity activity, Dialog dialog) { return; } if (activity instanceof FragmentActivity) { - SupportRequestManagerFragment fragment = getSupportFragment(((FragmentActivity) activity).getSupportFragmentManager(), mTag + dialog.toString(), true); + SupportRequestManagerFragment fragment = getSupportFragment(((FragmentActivity) activity).getSupportFragmentManager(), mTag + System.identityHashCode(dialog), true); if (fragment != null) { fragment.get(activity, dialog).onDestroy(); } } else { - RequestManagerFragment fragment = getFragment(activity.getFragmentManager(), mTag + dialog.toString(), true); + RequestManagerFragment fragment = getFragment(activity.getFragmentManager(), mTag + System.identityHashCode(dialog), true); if (fragment != null) { fragment.get(activity, dialog).onDestroy(); }