Matisse: 在打开相册后,左上角切换其他相册,全部都是一片空白,只有刚进来的时候 全部相册才有内容!!!这个问题也太大了吧

Created on 19 Sep 2020  ·  9Comments  ·  Source: zhihu/Matisse

Most helpful comment

@Fudejun520 replacing implementation 'androidx.fragment:fragment:1.3.0-alpha08' with implementation 'androidx.fragment:fragment:1..3.0-alpha06' 改一下androidx fragment的版本试试

All 9 comments

将Matisse的代码下载到本地,然后修改AlbumMediaLoader类中的ORDER_BY属性,改为:

private static final String ORDER_BY = MediaStore.Images.Media.DATE_MODIFIED+ " DESC";

也是无效的,特别急!

@Fudejun520 LZ解决了吗

@Fudejun520 replacing implementation 'androidx.fragment:fragment:1.3.0-alpha08' with implementation 'androidx.fragment:fragment:1..3.0-alpha06' 改一下androidx fragment的版本试试

@Fudejun520 replacing implementation 'androidx.fragment:fragment:1.3.0-alpha08' with implementation 'androidx.fragment:fragment:1..3.0-alpha06' 改一下androidx fragment的版本试试

可以了

@Fudejun520 replacing implementation 'androidx.fragment:fragment:1.3.0-alpha08' with implementation 'androidx.fragment:fragment:1..3.0-alpha06' 改一下androidx fragment的版本试试

这个在哪边改的?找了一遍没看到。

@Fudejun520 replacing implementation 'androidx.fragment:fragment:1.3.0-alpha08' with implementation 'androidx.fragment:fragment:1..3.0-alpha06' 改一下androidx fragment的版本试试

可以了

这个在哪边改的?找了一遍没看到。

@Fudejun520 replacing implementation 'androidx.fragment:fragment:1.3.0-alpha08' with implementation 'androidx.fragment:fragment:1..3.0-alpha06' 改一下androidx fragment的版本试试

可以了

这个在哪边改的?找了一遍没看到。

'androidx.appcompat:appcompat:1.3.0-alpha01'

遇到同样的问题,个人解决方案:
在 MatisseActivity.onAlbumSelected 中将 replace fragment,改为 remove 和 add

private Fragment fragment;
private void onAlbumSelected(Album album) {
    if (album.isAll() && album.isEmpty()) {
        mContainer.setVisibility(View.GONE);
        mEmptyView.setVisibility(View.VISIBLE);
    } else {
        mContainer.setVisibility(View.VISIBLE);
        mEmptyView.setVisibility(View.GONE);
        if (fragment != null) {
            getSupportFragmentManager()
                    .beginTransaction()
                    .remove(fragment)
                    .commitAllowingStateLoss();
        }
        fragment = MediaSelectionFragment.newInstance(album);
        getSupportFragmentManager()
                .beginTransaction()
                .add(R.id.container, fragment, MediaSelectionFragment.class.getSimpleName())
                .commitAllowingStateLoss();
    }
}

我的 fork 版本 解决了这个问题,同时还修复一些其他问题,适配了新的 Result Api https://github.com/lwj1994/Matisse

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xiaotianchang picture xiaotianchang  ·  4Comments

aliondos picture aliondos  ·  3Comments

meiniepan picture meiniepan  ·  7Comments

Mahan3340 picture Mahan3340  ·  4Comments

Freedomhxb picture Freedomhxb  ·  4Comments