Skip to content

Commit

Permalink
修改可以规制
Browse files Browse the repository at this point in the history
  • Loading branch information
geyifeng committed Aug 19, 2019
1 parent 07b85a0 commit df2193d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand All @@ -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)
Expand All @@ -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);
}
}

Expand All @@ -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();
}
Expand Down

0 comments on commit df2193d

Please sign in to comment.