Giter VIP home page Giter VIP logo

qingmei2 / rximagepicker Goto Github PK

View Code? Open in Web Editor NEW
1.2K 17.0 156.0 20.34 MB

:rocket:RxJava2 and RxJava3 external support. Android flexible picture selector, provides the support for theme of Zhihu and WeChat (灵活的Android图片选择器,提供了知乎和微信主题的支持).

License: MIT License

Kotlin 100.00%
imagepicker rximagepicker picture-selector android android-library android-image-picker android-image-selector

rximagepicker's Introduction

RxImagePicker

English Documentation | 中文文档

(RxJava3) (RxJava2)

Support for RxJava2. Flexible picture selector of Android, provides the support for theme of Zhihu and WeChat.

Zhihu: Famous Online Q&A Community APP in China.
WeChat: Most Used Instant Messaging Social Networking App in China.

Introduction

Purpose of RxImagePicker: Let developers realize the demand of selecting picture in the development of Android in a simple and flexible way.

RxImagePicker is a reactive picture selector for Android, which converts your selection requirements of picture into an interface for configuration and displays any UI theme in Activity or Fragment.

Support

  • Android Camera Photograph
  • Android photo album picture selection
  • Returns data in the format of reactive data stream ( such as Observable/Flowable/Single/Maybe )
  • AndroidX support ( after v2.3.0 )

Support of UI

  • System Picture Selector
  • [Optional] Theme Picture Selector of Zhihu
  • [Optional] Theme Picture Selector of WeChat ()
  • [Optional] Custom UI Picture Selector

Screenshots

Selection and result display of system picture:

Theme of Zhihu

Theme of WeChat

UI Test

Basic Usage

The following code will show you how to use photo album or camera at the Android system-level :

1.Add the following depending on the file of build.gradle:

// The most basic architecture, only provides the default
// picture selector and photographing function of system.

implementation 'com.github.qingmei2:rximagepicker:${last_version}'

// Provide the basic components of custom UI picture selector
// and this dependency needs to be added to the requirements of the custom UI
implementation 'com.github.qingmei2:rximagepicker_support:${last_version}'


// If you need additional UI support, choose to rely on the corresponding UI extension library

// Zhihu picture selector
implementation 'com.github.qingmei2:rximagepicker_support_zhihu:${last_version}'

// WeChat picture selector
implementation 'com.github.qingmei2:rximagepicker_support_wechat:${last_version}'

If your project not migrate to androidx, please use version 2.2.0.

2.Interface Configuration

Declare an interface and carry out the following configuration:

public interface MyImagePicker {

    @Gallery    // open gallery
    Observable<Result> openGallery(Context context);

    @Camera     // take photos
    Observable<Result> openCamera(Context context);
}

3.Instantiate and use it

Instantiate the interface in your Activity or Fragment to open the default album and camera screen of system:

RxImagePicker
        .create(MyImagePicker.class)
        .openGallery(this)
        .subscribe(new Consumer<Result>() {
            @Override
            public void accept(Result result) throws Exception {
                // do something, ex:
                Uri uri = result.getUri();
                GlideApp.with(this)
                         .load(uri)
                         .into(ivPickedImage);
            }
        });

Support UI theme Usage

1.Add the following depending on the file of build.gradle:

// Zhihu picture selector
implementation 'com.github.qingmei2:rximagepicker_support_zhihu:${last_version}'

2.Interface Configuration

Declare an interface and carry out the following configuration:

interface ZhihuImagePicker {

    // normal style
    @Gallery(componentClazz = ZhihuImagePickerActivity::class,
            openAsFragment = false)
    fun openGalleryAsNormal(context: Context,
                            config: ICustomPickerConfiguration): Observable<Result>

    // dracula style                        
    @Gallery(componentClazz = ZhihuImagePickerActivity::class,
            openAsFragment = false)
    fun openGalleryAsDracula(context: Context,
                             config: ICustomPickerConfiguration): Observable<Result>

    // take photo                         
    @Camera
    fun openCamera(context: Context): Observable<Result>
}

3.Instantiate and use it

val rxImagePicker: ZhihuImagePicker = RxImagePicker
                .create(ZhihuImagePicker::class.java)

rxImagePicker.openGalleryAsNormal(this,
                ZhihuConfigurationBuilder(MimeType.ofImage(), false)
                        .maxSelectable(9)
                        .countable(true)
                        .spanCount(4)
                        .theme(R.style.Zhihu_Normal)
                        .build())
               .subscribe {
                    Glide.with(this@ZhihuActivity)
                            .load(it.uri)
                            .into(imageView)
                }

see sample for more informations.

Advanced Usage

1. Action Annotation

RxImagePicker provides two action annovation, respectively @Gallery and @Camera.

@Camera will declare the way annovated by the annovation Open the camera to take a photo.

Please note, each method of the interface must add an action annotation to declare the corresponding action. If the method is not configured with @Gallery or @Camera, RxImagePicker will throw an Exception at runtime.

@Gallery

@Gallery will open the photo album to choose picture.

It has three parameters:

  • componentClazz:KClass<*> The class object of UI component, opens SystemGalleryPickerView::class—— the system Gallery by default.

  • openAsFragment:Boolean Whether UI component is displayed as Fragment in some parts of Activity is true by default.

  • containerViewId: Int If UI needs to be displayed as Fragment in ViewGroup, the id corresponding to the ViewGroup needs to be assigned to it.

At present UI component only supports two kinds: FragmentActivity or Fragment(support-v4).

Taking turning on the system camera for example, its principle is to instantiate an invisible Fragment in the current Activity, and Fragment opens the system photo album through Intent and processes the returned data through the method of onActivityResult(). The code is as the following:

interface SystemImagePicker {

    @Gallery   // by default,componentClazz:KClass = SystemGalleryPickerView::class,openAsFragment:Boolean=true
    fun openGallery(context: Context): Observable<Result>
}

When need to custom UI, taking Zhihu theme as an example, we will configure ZhihuImagePickerActivity::class to componentClazz and set the value of openAsFragment to false:

interface ZhihuImagePicker {

    @Gallery(componentClazz = ZhihuImagePickerActivity::class,
            openAsFragment = false)
    fun openGalleryAsNormal(context: Context,
                            config: ICustomPickerConfiguration): Observable<Result>

    @Gallery(componentClazz = ZhihuImagePickerActivity::class,
            openAsFragment = false)
    fun openGalleryAsDracula(context: Context,
                             config: ICustomPickerConfiguration): Observable<Result>

    @Camera
    fun openCamera(context: Context): Observable<Result>
}

For more information, please refer to the ZhihuActivity in sample.

At the same time, when UI needs to be displayed as Fragment, RxImagePicker needs to be informed of the id of the ViewGroup control so that RxImagePicker can be correctly displayed in the corresponding ViewGroup.

@Camera

@Camera will declare the way annotated by the annotation open the camera to take photo.

Please note, @Camera only provides the function of calling the system camera to take a photo at present. Although this annotation provides the same API as @Gallery, there is no sense to configure them at present.

2.ICustomPickerView

ICustomPickerView is an underneath interface, it is used for:

    1. Show the picture selector interface
    1. Obtain selection results of users
interface ICustomPickerView {

    fun display(fragmentActivity: FragmentActivity,
                @IdRes viewContainer: Int,
                configuration: ICustomPickerConfiguration?)

    fun pickImage(): Observable<Result>
}

It has several classic implementation classes, for example, ImagePickerDisplayer when open the corresponding activity through configuration;

3.Context: necessary parameters.

Each interface method of RxImagePicker must be configured with a Context as parameters. If the method does not have any parameters, it will throw out NullPointerException:

${method.name} requires just one instance of type: Context, but none.

This is understandable. Starting the UI component of a picture selector must depend on the instance of Context.

Note, This Context must be a FragmentActivity, not Application or others, or else throw out the abnormity of IllegalArgumentException!

4.ICustomPickerConfiguration: optional parameters

ICustomPickerConfiguration interface, similar to a tag. RxImagePicker will treat it as the configuration class.

As for opening the system photo album or system camera, it makes no sense to configure, but it must be configured for custom UI ( such as WeChat theme and Zhihu theme ).

The basic components of RxImagePicker do not provide the implementation class, please refer to SelectionSpec if any questions.

2.5 Complete full custom UI

Though RxImagePicker provides the UI style of WeChat picture selector and Zhihu picture selector, two sets of models are still not enough to cover more and more sophisticated UI demands of APP.

RxImagePicker provides enough degree of freedom interface to provide private customized UI for developers. Whether a new Activity is created or displayed in a ViewGroup container at present, it is enough.

The above WeChat theme and Zhihu theme are based on its to implement. Please refer to the source code for detailed implementation.

Another author's libraries using RxJava:

License

The RxImagePicker:MIT License

Copyright (c) 2018 qingmei2

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

rximagepicker's People

Contributors

13kmsteady avatar cocomikes avatar qingmei2 avatar sunnyqjm avatar vicent9920 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rximagepicker's Issues

Espresso为什么用不了

楼主,我想问下我照你说的那样加了依赖包,然后创建了一个测试代码,在AndroidTest 目录下,但是为什么就是没有 onView方法,模拟不了点击事件...很无奈..希望能得到您的答复,谢谢!

【意见征集】RxImagePicker需要您宝贵的建议!

任何库都时通过不断地 迭代完善 慢慢变得完美,对我个人来说,RxImagePicker可能还有很多需要改进地地方。

我将 最新的开发计划 都通过issue 列了出来,此外,如果您有改进意见,请在下面留言。如有必要,我会将您的建议列为 下一阶段的开发目标🏃。

在此,感谢您宝贵的意见和建议 🙏。

有的机型会报:No Activity found to handle Intent

io.reactivex.exceptions.OnErrorNotImplementedException: No Activity found to handle Intent { act=android.intent.action.PICK typ=image/* flg=0x41 (has extras) } at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704) at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701) at io.reactivex.internal.observers.LambdaObserver.onError(LambdaObserver.java:77) at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:67) at io.reactivex.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:309) at io.reactivex.subjects.PublishSubject.onNext(PublishSubject.java:229) at com.qingmei2.rximagepicker.ui.BaseSystemPickerView.onAttach(BaseSystemPickerView.kt:43) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1372) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827) at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2596) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2383) at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:703) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5055) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method) Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.PICK typ=image/* flg=0x41 (has extras) } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424) at android.app.Activity.startActivityForResult(Activity.java:3424) at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:68) at android.support.v4.app.ActivityCompat.startActivityForResult(ActivityCompat.java:233) at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:830) at android.support.v4.app.FragmentActivity$HostCallbacks.onStartActivityFromFragment(FragmentActivity.java:939) at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:1021) at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:1010) at com.qingmei2.rximagepicker.ui.gallery.SystemGalleryPickerView.startRequest(SystemGalleryPickerView.kt:55) at com.qingmei2.rximagepicker.ui.BaseSystemPickerView$requestPickImage$1.accept(BaseSystemPickerView.kt:49) at com.qingmei2.rximagepicker.ui.BaseSystemPickerView$requestPickImage$1.accept(BaseSystemPickerView.kt:22) at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63) ... 21 more android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.PICK typ=image/* flg=0x41 (has extras) } at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632) at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424) at android.app.Activity.startActivityForResult(Activity.java:3424) at android.support.v4.app.BaseFragmentActivityApi16.startActivityForResult(BaseFragmentActivityApi16.java:54) at android.support.v4.app.FragmentActivity.startActivityForResult(FragmentActivity.java:68) at android.support.v4.app.ActivityCompat.startActivityForResult(ActivityCompat.java:233) at android.support.v4.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:830) at android.support.v4.app.FragmentActivity$HostCallbacks.onStartActivityFromFragment(FragmentActivity.java:939) at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:1021) at android.support.v4.app.Fragment.startActivityForResult(Fragment.java:1010) at com.qingmei2.rximagepicker.ui.gallery.SystemGalleryPickerView.startRequest(SystemGalleryPickerView.kt:55) at com.qingmei2.rximagepicker.ui.BaseSystemPickerView$requestPickImage$1.accept(BaseSystemPickerView.kt:49) at com.qingmei2.rximagepicker.ui.BaseSystemPickerView$requestPickImage$1.accept(BaseSystemPickerView.kt:22) at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63) at io.reactivex.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:309) at io.reactivex.subjects.PublishSubject.onNext(PublishSubject.java:229) at com.qingmei2.rximagepicker.ui.BaseSystemPickerView.onAttach(BaseSystemPickerView.kt:43) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1372) at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759) at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827) at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797) at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2596) at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2383) at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338) at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2245) at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:703) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5055) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) at dalvik.system.NativeStart.main(Native Method)
能不能对这个异常进行捕获处理呢?

库本身依赖的库太多了

可以优化下 不然集成到项目中 会引起各种冲突 起码我用的时候就出现冲突 所以集成不了

添加依赖的时候报错

Error:Module 'com.github.qingmei2:rximagepicker:0.4.0' depends on one or more Android Libraries but is a jar

迁移到AndroidX后,首次拍照正常返回后,跳转到其他页面会出现崩溃

版本:
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'com.google.android.material:material:1.1.0-alpha02'
implementation 'com.github.qingmei2:rximagepicker:2.4.1'

使用场景:
在同一个Activity中,第一次打开相机,拍照,正常
再次打开相机,此时已经报错
日志:
java.lang.IllegalStateException: Failure saving state: active BasicCameraFragment{7999170 (9a42260b-7266-49b4-a844-2ee5c4298dcc)} was removed from the FragmentManager at androidx.fragment.app.FragmentManagerImpl.saveAllState(FragmentManagerImpl.java:2315) at androidx.fragment.app.FragmentController.saveAllState(FragmentController.java:150) at androidx.fragment.app.FragmentActivity.onSaveInstanceState(FragmentActivity.java:496) at androidx.appcompat.app.AppCompatActivity.onSaveInstanceState(AppCompatActivity.java:511) at android.app.Activity.performSaveInstanceState(Activity.java:1537) at android.app.Instrumentation.callActivityOnSaveInstanceState(Instrumentation.java:1301) at android.app.ActivityThread.callCallActivityOnSaveInstanceState(ActivityThread.java:4760) at android.app.ActivityThread.performStopActivityInner(ActivityThread.java:4073) at android.app.ActivityThread.handleStopActivity(ActivityThread.java:4132) at android.app.ActivityThread.-wrap25(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1697) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:159) at android.app.ActivityThread.main(ActivityThread.java:6385) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)

点击预览崩溃

场景

  1. 使用微信相册UI框架
  2. 从相册选择图片,限定只选择一张。当选中一个图片后,再点击该图片预览,崩溃。
  3. 这个崩溃并不是每次都会发生,有时候需要反复操作(选中->预览,返回取消,再选中->预览等等)才会发生。有时操作一次就会发生,有时需要操作一二十次才会发生,但终究会发生。
  4. 而且这个崩溃只发生在一张图片上,点击其他的图片预览时不会发生这种崩溃,至少目前是这样的。

崩溃 stacktrace

java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter object
        at com.qingmei2.rximagepicker_extension.ui.adapter.PreviewPagerAdapter.setPrimaryItem(PreviewPagerAdapter.kt)
        at android.support.v4.view.ViewPager.populate(ViewPager.java:1236)
        at android.support.v4.view.ViewPager.populate(ViewPager.java:1086)
        at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1616)
        at android.view.View.measure(View.java:19857)
        at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
        at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6083)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:689)
        at android.view.View.measure(View.java:19857)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2275)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1366)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1619)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1254)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6337)
        at android.view.Choreographer$CallbackRecord.run(Choreographer.java:874)
        at android.view.Choreographer.doCallbacks(Choreographer.java:686)
        at android.view.Choreographer.doFrame(Choreographer.java:621)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6119)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

崩溃前的部分日志信息

Bugly记录并打印的

08-14 09:44:53.296 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onPaused <<<
08-14 09:44:53.297 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:44:53.324 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onResumed <<<
08-14 09:44:53.325 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:44:53.481 30025-30090/com.xxx.xxxx D/OpenGLRenderer: endAllActiveAnimators on 0x8e2a5700 (AppCompatTextView) with handle 0x8ac651e0
08-14 09:44:53.737 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onDestroyed <<<
08-14 09:44:56.663 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onPaused <<<
08-14 09:44:56.664 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:44:56.683 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onCreated <<<
08-14 09:44:56.713 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onResumed <<<
08-14 09:44:56.714 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:44:56.750 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:44:56.772 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:44:56.798 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:44:56.842 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:44:56.962 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:44:57.046 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:44:57.662 30025-30067/com.xxx.xxxx D/CrashReport: [AsyncTaskHandler] Post a normal task: com.tencent.bugly.crashreport.biz.a$2
    Uploading frequency will not be checked if SDK is in debug mode.
08-14 09:44:57.669 30025-30067/com.xxx.xxxx D/CrashReport: [UserInfo] There is no user info in local database.
08-14 09:44:58.494 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onPaused <<<
08-14 09:44:58.495 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:44:58.516 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onResumed <<<
08-14 09:44:58.517 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:44:58.893 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onDestroyed <<<
08-14 09:45:00.658 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onPaused <<<
08-14 09:45:00.659 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:00.691 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onCreated <<<
08-14 09:45:00.728 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onResumed <<<
08-14 09:45:00.731 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:00.774 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:00.803 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:00.836 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:00.900 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:01.016 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:01.116 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:02.666 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onPaused <<<
08-14 09:45:02.667 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:02.690 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onResumed <<<
08-14 09:45:02.691 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:03.080 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onDestroyed <<<
08-14 09:45:06.850 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onPaused <<<
08-14 09:45:06.851 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:06.869 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onCreated <<<
08-14 09:45:06.898 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onResumed <<<
08-14 09:45:06.899 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:06.933 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:06.955 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:06.978 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:07.024 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:07.125 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:07.226 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:07.769 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onPaused <<<
08-14 09:45:07.770 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:07.790 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onResumed <<<
08-14 09:45:07.792 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:08.194 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onDestroyed <<<
08-14 09:45:11.821 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onPaused <<<
08-14 09:45:11.822 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:11.846 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onCreated <<<
08-14 09:45:11.878 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onResumed <<<
08-14 09:45:11.879 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:11.920 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:11.949 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:11.978 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:12.039 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:12.188 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:12.256 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:12.884 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onPaused <<<
08-14 09:45:12.885 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:12.905 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onResumed <<<
08-14 09:45:12.907 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:13.293 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onDestroyed <<<
08-14 09:45:14.471 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onPaused <<<
08-14 09:45:14.472 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:14.502 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onCreated <<<
08-14 09:45:14.539 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onResumed <<<
08-14 09:45:14.540 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:14.582 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:14.604 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:14.630 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:14.682 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:14.781 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:14.898 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:15.811 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onPaused <<<
08-14 09:45:15.812 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:15.828 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onResumed <<<
08-14 09:45:15.829 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:16.204 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onDestroyed <<<
08-14 09:45:20.815 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onPaused <<<
08-14 09:45:20.816 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:20.839 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onCreated <<<
08-14 09:45:20.872 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onResumed <<<
08-14 09:45:20.873 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:20.919 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:20.950 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:20.979 30025-30025/com.xxx.xxxx I/ExifInterface_JNI: Raw image not detected
08-14 09:45:21.060 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:21.160 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:21.227 30025-30025/com.xxx.xxxx D/ImageViewTouchBase: matrix: { x: 47.25, y: 0.0, scalex: 0.934375, scaley: 0.934375 }
08-14 09:45:21.747 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onPaused <<<
08-14 09:45:21.748 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:21.774 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onResumed <<<
08-14 09:45:21.776 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:22.131 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onDestroyed <<<
08-14 09:45:23.581 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity onPaused <<<
08-14 09:45:23.582 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(false)
08-14 09:45:23.601 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onCreated <<<
08-14 09:45:23.633 30025-30025/com.xxx.xxxx D/CrashReport: >>> com.qingmei2.rximagepicker_extension_wechat.ui.WechatAlbumPreviewActivity onResumed <<<
08-14 09:45:23.633 30025-30025/com.xxx.xxxx I/CrashReport-Native: Set native info: isAppForeground(true)
08-14 09:45:23.652 30025-30025/com.xxx.xxxx D/AndroidRuntime: Shutting down VM

崩溃时手机的使用情况

    # CRASH DEVICE: Nexus 6 ROOTED
    # RUNTIME AVAIL RAM:849653760 ROM:25250299904 SD:25250299904
    # RUNTIME TOTAL RAM:3114692608 ROM:27893952512 SD:27893952512

崩溃发生的图片信息

image

291534212293_ pic

如有可能,麻烦尽快解决这个Bug

返回多张图片API

你好,我看了一下你的文档和demo,不知道返回多张图片应该使用什么方法(我自身对RXjava不熟悉)?能不能在文档或者demo中注明,帮助一些基础比较弱的童鞋呢?

选择多张图片调用方式

在选择多张图片时,第二次选择的时候能不能传入上一次已经选择的图片呢?我阅读了文档和查看了一下源码,没有找到相关的内容。

【Feature】单元测试代码补全

这是一个需要长时间实现的功能。

目前RxImagePicker的开发环境下已经 添加了 测试工具 的依赖,我将在闲暇时间为库补全 单元测试代码

优先级低。

doFilter的使用?

调用微信图片选择后,里面有视频和图片,我怎么设置只显示图片或只显示视频?
是使用doFilter吗?这个怎么使用啊?
.addFilter(object : Filter() {
override fun filter(context: Context, item: Item): IncapableCause {
return IncapableCause("123456")
}

                                override fun constraintTypes(): Set<MimeType> {
                                    val set = HashSet<MimeType>()
                                    set.add(MimeType.JPEG)
                                    set.add(MimeType.PNG)
                                    return set
                                }
                            })

我这样做,感觉没有用

【Feature】对返回数据的封装

目前库对于返回数据的处理,默认数据类型为Uri,这种数据的问题在于,Uri无法添加拓展数据。

库本身也许更应该返回一个封装的数据,比如RxResultData,通过这个数据能增加拓展数据,比如标记该Uri对应的文件是否需要“发送原图”,并在subscribe方法中进行对应的处理。

该功能优先级较高,预计在v0.4.0中发布。

跨进程问题

作者貌似不支持跨进程调用,在manifest中配置了单独进程的activity调用知乎样式的图片选择器会闪退,报错
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.qingmei2.sample/com.qingmei2.rximagepicker_extension_zhihu.ui.ZhihuImagePickerActivity}: java.lang.NullPointerException: Attempt to read from field 'int com.qingmei2.rximagepicker_extension.entity.SelectionSpec.themeId' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2964)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3025)
at android.app.ActivityThread.-wrap13(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1658)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:177)
at android.app.ActivityThread.main(ActivityThread.java:6665)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802)
Caused by: java.lang.NullPointerException: Attempt to read from field 'int com.qingmei2.rximagepicker_extension.entity.SelectionSpec.themeId' on a null object reference
at com.qingmei2.rximagepicker_extension_zhihu.ui.ZhihuImagePickerActivity.onCreate(ZhihuImagePickerActivity.java:23)
at android.app.Activity.performCreate(Activity.java:6748)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1132)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2917)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3025) 
at android.app.ActivityThread.-wrap13(ActivityThread.java) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1658) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:177) 
at android.app.ActivityThread.main(ActivityThread.java:6665) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:802) 

Custom Item

wechat 版本的 Item 是繼承 AlbumMediaAdapterMediaGrid 來改變 Item Layout。

如果 Item Layout 想要更客製化,例如:不要 mVideoDuration,就沒辦法直接繼承 MediaGrid
因為在 MediaGrid::bindMedia 會初始化 mVideoDuration

如果 Override 它,去除 setVideoDuration,則會發現其他初始化的 method 都是 private 無法使用,
如果將初始化 method 直接複製過來,則會發現 PreBindInfo 的 field 沒辦法取得,因為它的作用域是預設的(也就是 protected)

如果不繼承 MediaGrid,那也不能直接繼承 AlbumMediaAdapter ,感覺走遠了 ..

想請問是否我理解錯誤?Custom Item 該如何實作?單純以 Item 不帶 mVideoDuration 為目標。

引入项目无法编译

错误日志:Dex cannot parse version 52 byte code.

由于你的jar包是基于jdk 1.8的,但我项目AS使用的jdk是1.7的,若要升级本地,会导致项目很多遗留问题,所以无法使用的的库。
能否解决一下?

2.2.0重写知乎UI后崩溃

重写知乎UI并放入fragment中出现闪退,闪退代码
mAdapter = AlbumMediaAdapter(
context!!,
mSelectionProvider!!.provideSelectedItemCollection(),
mRecyclerView
).apply {
registerCheckStateListener(this@ZhihuImageListGridFragment)
registerOnMediaClickListener(this@ZhihuImageListGridFragment)
}

image

大佬 最新版 2.3.0-alpha01 奔溃了 本地库 没事

*** crash ***
*** time: 11-02 12:41:00.458 ***
*** version: 2.3.0-alpha01/21 ***
*** device: HUAWEI/HUAWEI MT7-CL00/6.0 ***
java.lang.NoClassDefFoundError: Failed resolution of: Lio/reactivex/android/schedulers/AndroidSchedulers;
at com.qingmei2.rximagepicker.scheduler.RxImagePickerSchedulers.ui(RxImagePickerSchedulers.kt:18)
at com.qingmei2.rximagepicker.core.ConfigProcessor.process(ConfigProcessor.kt:26)
at com.qingmei2.rximagepicker.core.ProxyProviders$invoke$1.call(ProxyProviders.kt:23)
at com.qingmei2.rximagepicker.core.ProxyProviders$invoke$1.call(ProxyProviders.kt:9)
at io.reactivex.internal.operators.observable.ObservableDefer.subscribeActual(ObservableDefer.java:32)
at io.reactivex.Observable.subscribe(Observable.java:12030)
at io.reactivex.Observable.blockingFirst(Observable.java:4986)
at com.qingmei2.rximagepicker.core.ProxyProviders.invoke(ProxyProviders.kt:40)
at java.lang.reflect.Proxy.invoke(Proxy.java:393)
at $Proxy3.openGallery(Unknown Source)
at com.qingmei2.sample.wechat.WechatActivity.openGallery(WechatActivity.java:99)
at com.qingmei2.sample.wechat.WechatActivity.onPermissionGrant(WechatActivity.java:89)
at com.qingmei2.sample.wechat.WechatActivity.checkPermissionAndRequest(WechatActivity.java:66)
at com.qingmei2.sample.wechat.WechatActivity.access$000(WechatActivity.java:26)
at com.qingmei2.sample.wechat.WechatActivity$2.onClick(WechatActivity.java:54)
at android.view.View.performClick(View.java:5264)
at android.view.View$PerformClick.run(View.java:21297)
at android.os.Handler.handleCallback(Handler.java:743)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
Caused by: java.lang.ClassNotFoundException: Didn't find class "io.reactivex.android.schedulers.AndroidSchedulers" on path: DexPathList[[zip file "/data/app/com.qingmei2.sample-1/base.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_dependencies_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_0_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_1_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_2_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_3_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_4_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_5_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_6_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_7_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_8_apk.apk", zip file "/data/app/com.qingmei2.sample-1/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.qingmei2.sample-1/lib/arm, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 24 more
Suppressed: java.lang.ClassNotFoundException: io.reactivex.android.schedulers.AndroidSchedulers
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 25 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available

*** crash ***
*** time: 11-02 12:41:02.123 ***
*** version: 2.3.0-alpha01/21 ***
*** device: HUAWEI/HUAWEI MT7-CL00/6.0 ***
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.qingmei2.sample/com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity}: kotlin.KotlinNullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2444)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2504)
at android.app.ActivityThread.access$900(ActivityThread.java:165)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1368)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:5546)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:794)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:684)
Caused by: kotlin.KotlinNullPointerException
at com.qingmei2.rximagepicker_extension.entity.SelectionSpec$Companion.getInstance(SelectionSpec.kt:127)
at com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerActivity.onCreate(WechatImagePickerActivity.kt:15)
at android.app.Activity.performCreate(Activity.java:6367)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1110)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2397)
... 9 more

Demo图片预览BUG

我相册里有两张图,一张83x1291,一张2171x51,知乎和微信两个demo预览是一片黑,左右滑动也滑不动,别的图片正常

2018-09-30 15:58:09.926 6104-6205/com.qingmei2.sample W/OpenGLRenderer: Bitmap too large to be uploaded into a texture (1080x16799, max=16384x16384)

还有不支持WEBP图片预览啊,虽然实际能预览出来,但是有报错

2018-09-30 15:53:44.699 6104-6104/com.qingmei2.sample W/ExifInterface: Invalid image: ExifInterface got an unsupported image format file(ExifInterface supports JPEG and some RAW image formats only) or a corrupted JPEG file to ExifInterface.
    java.io.IOException: Invalid marker: 89
        at android.media.ExifInterface.getJpegAttributes(ExifInterface.java:1846)
        at android.media.ExifInterface.loadAttributes(ExifInterface.java:1475)
        at android.media.ExifInterface.<init>(ExifInterface.java:1112)
        at com.qingmei2.rximagepicker_extension.utils.ExifInterfaceCompat.newInstance(ExifInterfaceCompat.kt:49)
        at com.qingmei2.rximagepicker_extension.utils.PhotoMetadataUtils$Companion.shouldRotate(PhotoMetadataUtils.kt:154)
        at com.qingmei2.rximagepicker_extension.utils.PhotoMetadataUtils$Companion.getBitmapSize(PhotoMetadataUtils.kt:62)
        at com.qingmei2.rximagepicker_extension.ui.PreviewItemFragment.onViewCreated(PreviewItemFragment.kt:62)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1439)
        at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1759)
        at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1827)
        at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:797)
        at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2596)
        at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2383)
        at android.support.v4.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManager.java:2338)
        at android.support.v4.app.FragmentManagerImpl.execSingleAction(FragmentManager.java:2215)
        at android.support.v4.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:649)
        at android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:145)
        at android.support.v4.view.ViewPager.populate(ViewPager.java:1238)
        at android.support.v4.view.ViewPager.populate(ViewPager.java:1086)
        at android.support.v4.view.ViewPager.onMeasure(ViewPager.java:1616)
        at android.view.View.measure(View.java:19957)
        at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:715)
        at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:461)
        at android.view.View.measure(View.java:19957)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6132)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:141)
        at android.view.View.measure(View.java:19957)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6132)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19957)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6132)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at android.view.View.measure(View.java:19957)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6132)
        at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
        at android.widget.LinearLayout.measureVertical(LinearLayout.java:758)
        at android.widget.LinearLayout.onMeasure(LinearLayout.java:640)
        at android.view.View.measure(View.java:19957)
        at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6132)
        at android.widget.FrameLayout.onMeasure(FrameLayout.java:185)
        at com.android.internal.policy.DecorView.onMeasure(DecorView.java:855)
        at android.view.View.measure(View.java:19957)
        at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2548)
        at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1628)
        at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1892)
        at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1504)
        at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6983)
2018-09-30 15:53:44.699 6104-6104/com.qingmei2.sample W/ExifInterface:     at android.view.Choreographer$CallbackRecord.run(Choreographer.java:883)
        at android.view.Choreographer.doCallbacks(Choreographer.java:689)
        at android.view.Choreographer.doFrame(Choreographer.java:624)
        at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:869)
        at android.os.Handler.handleCallback(Handler.java:751)
        at android.os.Handler.dispatchMessage(Handler.java:95)
        at android.os.Looper.loop(Looper.java:159)
        at android.app.ActivityThread.main(ActivityThread.java:6364)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)

qq

qq那个页面如何实现

红米note 5A 打开相册崩溃

系统版本:android 7.1.2

java.lang.NoSuchMethodError: No virtual method placeholder(Landroid/graphics/drawable/Drawable;)Lcom/bumptech/glide/request/RequestOptions; in class Lcom/bumptech/glide/request/RequestOptions; or its super classes (declaration of 'com.bumptech.glide.request.RequestOptions' appears in /data/app/com.ctg.saas.ehr-1/base.apk:classes3.dex)
at com.qingmei2.rximagepicker_extension_zhihu.engine.impl.ZhihuGlideEngine.loadThumbnail(ZhihuGlideEngine.kt:37)
at com.qingmei2.rximagepicker_extension.ui.widget.MediaGrid.setImage(MediaGrid.kt:113)
at com.qingmei2.rximagepicker_extension.ui.widget.MediaGrid.bindMedia(MediaGrid.kt:84)
at com.qingmei2.rximagepicker_extension.ui.adapter.AlbumMediaAdapter.onBindViewHolder(AlbumMediaAdapter.kt:104)
at com.qingmei2.rximagepicker_extension.ui.adapter.RecyclerViewCursorAdapter.onBindViewHolder(RecyclerViewCursorAdapter.kt:44)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:6823)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:5752)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6019)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5858)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5854)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2230)
at androidx.recyclerview.widget.GridLayoutManager.layoutChunk(GridLayoutManager.java:557)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1517)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:612)
at androidx.recyclerview.widget.GridLayoutManager.onLayoutChildren(GridLayoutManager.java:171)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3924)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3641)
at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4194)
at android.view.View.layout(View.java:17666)
at android.view.ViewGroup.layout(ViewGroup.java:5577)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17666)
at android.view.ViewGroup.layout(ViewGroup.java:5577)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17666)
at android.view.ViewGroup.layout(ViewGroup.java:5577)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079)
at android.view.View.layout(View.java:17666)
at android.view.ViewGroup.layout(ViewGroup.java:5577)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17666)
at android.view.ViewGroup.layout(ViewGroup.java:5577)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17666)
at android.view.ViewGroup.layout(ViewGroup.java:5577)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1585)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1494)
at android.view.View.layout(View.java:17666)
at android.view.ViewGroup.layout(ViewGroup.java:5577)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323)
at android.widget.FrameLayout.onLayout(FrameLayout.java:261)
at android.view.View.layout(View.java:17666)
at android.view.ViewGroup.layout(ViewGroup.java:5577)

取消拍照,如何处理的呢

进入拍照界面,如果用户突然不想拍了,直接返回,现在好像会直接返回更上一级的页面,即显示拍照dialog所在页面的上一级页面,请问我该如何处理呢

微信 相机 不拍照直接返回报错

io.reactivex.exceptions.OnErrorNotImplementedException
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:704)
at io.reactivex.internal.functions.Functions$OnErrorMissingConsumer.accept(Functions.java:701)
at io.reactivex.internal.observers.ConsumerSingleObserver.onError(ConsumerSingleObserver.java:47)
at io.reactivex.internal.operators.observable.ObservableSingleSingle$SingleElementObserver.onComplete(ObservableSingleSingle.java:113)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated(ObservableObserveOn.java:281)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:172)
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:5958)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:879)
Caused by: java.util.NoSuchElementException
at io.reactivex.internal.operators.observable.ObservableSingleSingle$SingleElementObserver.onComplete(ObservableSingleSingle.java:113) 
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.checkTerminated(ObservableObserveOn.java:281) 
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:172) 
at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252) 
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:109) 
at android.os.Handler.handleCallback(Handler.java:815) 
at android.os.Handler.dispatchMessage(Handler.java:104) 
at android.os.Looper.loop(Looper.java:224) 
at android.app.ActivityThread.main(ActivityThread.java:5958) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1113) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:879) 

请教下调用拍照的问题

我只是引用了com.github.qingmei2:rximagepicker:2.4.2的包,在调用拍照的时候出现找不到BasicCameraFragment的问题。如下是我的调用代码:
picker.openCamera(ModuleJNMapMainActivity.this).subscribe(result -> {
Glide.with(ModuleJNMapMainActivity.this).load(result.getUri()).into(mBinding.moduleJnMapMainImg);
});

如下是报错信息:
java.lang.NoClassDefFoundError: com.qingmei2.rximagepicker.ui.camera.BasicCameraFragment
at libcore.reflect.InternalNames.getClass(InternalNames.java:55)
at java.lang.Class.getDexCacheType(Class.java:476)
at libcore.reflect.AnnotationAccess.decodeValue(AnnotationAccess.java:705)
at libcore.reflect.AnnotationAccess.getDefaultValue(AnnotationAccess.java:361)
at java.lang.reflect.Method.getDefaultValue(Method.java:327)
at libcore.reflect.AnnotationFactory.getElementsDescription(AnnotationFactory.java:75)
at libcore.reflect.AnnotationFactory.(AnnotationFactory.java:112)
at libcore.reflect.AnnotationFactory.createAnnotation(AnnotationFactory.java:94)
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:666)
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:641)
at libcore.reflect.AnnotationAccess.getDeclaredAnnotation(AnnotationAccess.java:170)
at java.lang.reflect.Method.getAnnotation(Method.java:300)
at com.qingmei2.rximagepicker.core.ProxyTranslator.streamSourcesFrom(ProxyTranslator.kt:87)
at com.qingmei2.rximagepicker.core.ProxyTranslator.processMethod(ProxyTranslator.kt:25)
at com.qingmei2.rximagepicker.core.ProxyProviders$invoke$1.call(ProxyProviders.kt:19)
at com.qingmei2.rximagepicker.core.ProxyProviders$invoke$1.call(ProxyProviders.kt:9)
at io.reactivex.internal.operators.observable.ObservableDefer.subscribeActual(ObservableDefer.java:32)
at io.reactivex.Observable.subscribe(Observable.java:12030)
at io.reactivex.Observable.blockingFirst(Observable.java:4986)
at com.qingmei2.rximagepicker.core.ProxyProviders.invoke(ProxyProviders.kt:40)
at java.lang.reflect.Proxy.invoke(Proxy.java:393)
at com.chinadci.yongy.jn_map.ui.main.$Proxy0.openCamera(Unknown Source)
at com.chinadci.yongy.jn_map.ui.main.ModuleJNMapMainActivity$ModuleJNMapClick.goToCameraInterface(ModuleJNMapMainActivity.java:487)
at com.chinadci.yongy.jn_map.databinding.ActivityModuleJnMapMainBinding._internalCallbackOnClick(ActivityModuleJnMapMainBinding.java:645)
at android.databinding.generated.callback.OnClickListener.onClick(OnClickListener.java:11)
at android.view.View.performClick(View.java:5275)
at android.view.View$PerformClick.run(View.java:21559)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5845)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:768)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.qingmei2.rximagepicker.ui.camera.BasicCameraFragment" on path: DexPathList[[zip file "/data/app/com.chinadci.yongy.jn_tel_dcimbs-2/base.apk"],nativeLibraryDirectories=[/data/app/com.chinadci.yongy.jn_tel_dcimbs-2/lib/arm, /data/app/com.chinadci.yongy.jn_tel_dcimbs-2/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at libcore.reflect.InternalNames.getClass(InternalNames.java:53)
at java.lang.Class.getDexCacheType(Class.java:476) 
at libcore.reflect.AnnotationAccess.decodeValue(AnnotationAccess.java:705) 
at libcore.reflect.AnnotationAccess.getDefaultValue(AnnotationAccess.java:361) 
at java.lang.reflect.Method.getDefaultValue(Method.java:327) 
at libcore.reflect.AnnotationFactory.getElementsDescription(AnnotationFactory.java:75) 
at libcore.reflect.AnnotationFactory.(AnnotationFactory.java:112) 
at libcore.reflect.AnnotationFactory.createAnnotation(AnnotationFactory.java:94) 
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:666) 
at libcore.reflect.AnnotationAccess.toAnnotationInstance(AnnotationAccess.java:641) 
at libcore.reflect.AnnotationAccess.getDeclaredAnnotation(AnnotationAccess.java:170) 
at java.lang.reflect.Method.getAnnotation(Method.java:300) 
at com.qingmei2.rximagepicker.core.ProxyTranslator.streamSourcesFrom(ProxyTranslator.kt:87) 
at com.qingmei2.rximagepicker.core.ProxyTranslator.processMethod(ProxyTranslator.kt:25) 
at com.qingmei2.rximagepicker.core.ProxyProviders$invoke$1.call(ProxyProviders.kt:19) 
at com.qingmei2.rximagepicker.core.ProxyProviders$invoke$1.call(ProxyProviders.kt:9) 
at io.reactivex.internal.operators.observable.ObservableDefer.subscribeActual(ObservableDefer.java:32) 
at io.reactivex.Observable.subscribe(Observable.java:12030) 
at io.reactivex.Observable.blockingFirst(Observable.java:4986) 
at com.qingmei2.rximagepicker.core.ProxyProviders.invoke(ProxyProviders.kt:40) 
at java.lang.reflect.Proxy.invoke(Proxy.java:393) 
at com.chinadci.yongy.jn_map.ui.main.$Proxy0.openCamera(Unknown Source) 
at com.chinadci.yongy.jn_map.ui.main.ModuleJNMapMainActivity$ModuleJNMapClick.goToCameraInterface(ModuleJNMapMainActivity.java:487) 
at com.chinadci.yongy.jn_map.databinding.ActivityModuleJnMapMainBinding._internalCallbackOnClick(ActivityModuleJnMapMainBinding.java:645) 
at android.databinding.generated.callback.OnClickListener.onClick(OnClickListener.java:11) 
at android.view.View.performClick(View.java:5275) 
at android.view.View$PerformClick.run(View.java:21559) 
at android.os.Handler.handleCallback(Handler.java:815) 
at android.os.Handler.dispatchMessage(Handler.java:104) 
at android.os.Looper.loop(Looper.java:207) 
at android.app.ActivityThread.main(ActivityThread.java:5845) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:768) 
Suppressed: java.lang.NoClassDefFoundError: com.qingmei2.rximagepicker.ui.camera.BasicCameraFragment
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:226)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
at dalvik.system.DexPathList.findClass(DexPathList.java:338)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
... 36 more
Suppressed: java.lang.ClassNotFoundException: com.qingmei2.rximagepicker.ui.camera.BasicCameraFragment
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.

微信主题预览 6张图片,点击使用报 OOM

操作步骤

1. 选择微信主题,点击相册按钮,进入相册选取界面

album_selection

2. 选择 6 张图片,点击预览,进入 预览界面

preview

3. 点击 预览界面 的使用按钮,程序发生闪退。以下为错误日志

05-25 18:30:54.067 5083-5083/com.qingmei2.sample E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.qingmei2.sample, PID: 5083
    java.lang.OutOfMemoryError: Failed to allocate a 71663628 byte allocation with 16768896 free bytes and 53MB until OOM
        at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
        at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
        at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:639)
        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:615)
        at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:653)
        at android.provider.MediaStore$Images$Media.getBitmap(MediaStore.java:867)
        at com.qingmei2.rximagepicker.funtions.ObserverAsConverter$2.subscribe(ObserverAsConverter.java:80)
        at io.reactivex.internal.operators.observable.ObservableCreate.subscribeActual(ObservableCreate.java:40)
        at io.reactivex.Observable.subscribe(Observable.java:11040)
        at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.subscribeInner(ObservableFlatMap.java:162)
        at io.reactivex.internal.operators.observable.ObservableFlatMap$MergeObserver.onNext(ObservableFlatMap.java:139)
        at io.reactivex.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:261)
        at io.reactivex.subjects.PublishSubject.onNext(PublishSubject.java:182)
        at com.qingmei2.rximagepicker.core.ActivityPickerProjector.emitUri(ActivityPickerProjector.java:62)
        at com.qingmei2.rximagepicker_extension_wechat.ui.WechatImagePickerFragment.onActivityResult(WechatImagePickerFragment.java:290)
        at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:156)
        at android.app.Activity.dispatchActivityResult(Activity.java:6562)
        at android.app.ActivityThread.deliverResults(ActivityThread.java:3768)
        at android.app.ActivityThread.handleSendResult(ActivityThread.java:3815)
        at android.app.ActivityThread.access$1500(ActivityThread.java:154)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1430)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:157)
        at android.app.ActivityThread.main(ActivityThread.java:5571)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)

图片大小及尺寸

序号 大小(M) 尺寸(px)
1 2 4272 x 2848
2 5.75 5184 x 3456
3 3.62 3495 x 5236
4 4.69 4000 x 5217
5 1.97 3456 x 5184
6 3.03 5184 x 3888

手机

型号:红米 3s
内存:2 + 16
系统:Android 6.0.1

为何第一点击button显示选择的图片,第二次点击这个button无任何响应?

这是源码,谢谢

public class MainActivity extends AppCompatActivity implements View.OnClickListener ,MyImagePicker{
private Button btn_picker;
private ImageView iv_show;
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
(btn_picker=(Button) findViewById(R.id.btn_picker)).setOnClickListener(this);
iv_show=(ImageView) findViewById(R.id.iv_show_img);
}

@Override
public void onClick(View v) {
    if(v.getId()==R.id.btn_picker){
        new RxImagePicker.Builder()
                .with(this)
                .build()
                .create(MyImagePicker.class)  
                .openGallery()            
                .subscribe(new Consumer<File>() {
                    @Override
                    public void accept(File file) throws Exception {
                        // do what you want to do
                        Glide.with(MainActivity.this)
                                .load(file)
                                .into(iv_show);
                    }
                });
    }
}

@Override
public Observable<File> openGallery() {
    return null;
}

@Override
public Observable<Bitmap> openCamera() {
    return null;
}

}

有没有打算加入裁剪,压缩功能?

如题,基本上引用图库的地方都是为了上传图片,几乎都会涉及到裁剪和压缩,作者大神有没有考虑加入这些功能,可以像知乎和微信样式似的独立出来,还有就是应该添加一个是否显示gif的属性,这样引用起来更方便一点,不用自己去引用module改代码了

拍照的问题

关于拍照使用系统相机问题,在重写了onActivityResult的Activity中使用openCamer,由于BaseSystemPickerView中的Fragment重写了onActivityResult,使得fragmen中的onActivityResult和调用者中的onActivityResult发生冲突,不回调,造成拍照无反应的问题

使用0.4.0版本,在BaseSystemPickerView类的120行调用onNext方法报NullPointerException

java.lang.RuntimeException: Unable to resume activity {com.mozhe.mzcz/com.mozhe.mzcz.mvp.view.home.book.BookSetupActivity}: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=65636, result=0, data=null} to activity {com.mozhe.mzcz/com.mozhe.mzcz.mvp.view.home.book.BookSetupActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.a.n.e.onNext(java.lang.Object)' on a null object reference
	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3216)
	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3247)
	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2582)
	at android.app.ActivityThread.access$1000(ActivityThread.java:166)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1414)
	at android.os.Handler.dispatchMessage(Handler.java:102)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:5628)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:853)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:737)
Caused by: java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=65636, result=0, data=null} to activity {com.mozhe.mzcz/com.mozhe.mzcz.mvp.view.home.book.BookSetupActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.a.n.e.onNext(java.lang.Object)' on a null object reference
	at android.app.ActivityThread.deliverResults(ActivityThread.java:3818)
	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3190)
	... 10 more
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void io.a.n.e.onNext(java.lang.Object)' on a null object reference
	at com.c.a.f.b.a(BaseSystemPickerView.java:120)
	at android.support.v4.app.FragmentActivity.onActivityResult(FragmentActivity.java:156)
	at com.mozhe.mzcz.mvp.view.home.book.BookSetupActivity.onActivityResult(BookSetupActivity.java:183)
	at android.app.Activity.dispatchActivityResult(Activity.java:6524)
	at android.app.ActivityThread.deliverResults(ActivityThread.java:3814)
	... 11 more

选择相册的弹框中图片有时不显示

你好,我在跑sample时发现一个奇怪的问题,像图中的ListPopupWindow的单个条目图片经常加载不出来,但是首次点击可以加载出来,自己断点调试发现相应的AlbumsAdapter.bindView()和ZhihuGlideEngine.loadThumbnail()的方法都走了,希望能给我解惑,这个问题是怎么导致的,感谢。
1554889164696

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.