Skip to content

Commit

Permalink
fix:
Browse files Browse the repository at this point in the history
1.修复zhihu#812
  • Loading branch information
luketang3 committed Feb 23, 2022
1 parent 21591ae commit c7c4584
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion matisse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.appcompat:appcompat:1.3.1"
implementation "androidx.annotation:annotation:1.1.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation 'it.sephiroth.android.library.imagezoom:library:1.0.4'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.loader.app.LoaderManager;
import androidx.loader.content.Loader;
Expand Down Expand Up @@ -75,9 +76,15 @@ public void onLoaderReset(Loader<Cursor> loader) {
}

public void onCreate(@NonNull FragmentActivity context, @NonNull AlbumMediaCallbacks callbacks) {
mContext = new WeakReference<Context>(context);
mLoaderManager = context.getSupportLoaderManager();
mCallbacks = callbacks;
mContext = new WeakReference<Context>(context);
mLoaderManager = LoaderManager.getInstance(context);
mCallbacks = callbacks;
}

public void onCreate(@NonNull Fragment fragment, @NonNull AlbumMediaCallbacks callbacks) {
mContext = new WeakReference<Context>(fragment.getContext());
mLoaderManager = LoaderManager.getInstance(fragment);
mCallbacks = callbacks;
}

public void onDestroy() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void onActivityCreated(@Nullable Bundle savedInstanceState) {
int spacing = getResources().getDimensionPixelSize(R.dimen.media_grid_spacing);
mRecyclerView.addItemDecoration(new MediaGridInset(spanCount, spacing, false));
mRecyclerView.setAdapter(mAdapter);
mAlbumMediaCollection.onCreate(getActivity(), this);
mAlbumMediaCollection.onCreate(this, this);
mAlbumMediaCollection.load(album, selectionSpec.capture);
}

Expand Down
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ dependencies {
// implementation 'com.zhihu.android:matisse:0.5.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.appcompat:appcompat:1.3.1"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.5@aar'
implementation 'io.reactivex.rxjava2:rxjava:2.2.12'
Expand Down

0 comments on commit c7c4584

Please sign in to comment.