goldze / MVVMHabit

👕基于谷歌最新AAC架构,MVVM设计模式的一套快速开发库,整合Okhttp+RxJava+Retrofit+Glide等主流模块,满足日常开发需求。使用该框架可以快速开发一个高质量、易维护的Android应用。
Apache License 2.0
7.58k stars 1.69k forks source link

Bug问题,统一在此反馈 #29

Closed goldze closed 4 years ago

goldze commented 6 years ago

如果您在使用中发现存在Bug,请在此提出,感谢您的反馈!

goldze commented 5 years ago

@ywqzzy 也可以做的, 在activity或者重写onTouch方法,, 和常规操作一样

goldze commented 5 years ago

@brady2037 等androidX国内普及了会升级的, 现在升还有点早, 我们的项目也没有升

ywqzzy commented 5 years ago

我的意思是在框架里面可能不太好做。感谢回复

---原始邮件--- 发件人: "Xian Ze Zeng"notifications@github.com 发送时间: 2019年5月5日(星期日) 上午9:43 收件人: "goldze/MVVMHabit"MVVMHabit@noreply.github.com; 抄送: "Mention"mention@noreply.github.com;"虚弱球"592838129@qq.com; 主题: Re: [goldze/MVVMHabit] Bug问题,统一在此反馈 (#29)

@ywqzzy 也可以做的, 在activity或者重写onTouch方法,, 和常规操作一样

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

JYPJSY commented 5 years ago

image image Boss,您的框架 在Android7的小米设备没问题 运行在Android5.1.1(小厂家定制)就不行 ,报上图的错,但是我定位不到具体问题,请在百忙之中指点一下,谢谢

XiaMuYao commented 5 years ago

Kotlin中使用会出现问题

var onClickToast = BindingCommand<MainViewModel>(BindingAction { ToastUtils.showLongMessage(context, "显示的信息")})

在XMl中绑定之后会直接执行这个方法 然而我并没有点击

@goldze 可以看一下这个问题么

liuhang1234 commented 5 years ago

有一个问题,设置点击事件 之前是在3.0.6 是可以的,现在升级到了3.1.2,报了这两个错误,之前都是可以跑的,想请问一下是什么原因,如果不容易解决的话 我就还是换成3.0.6了。谢谢 Cannot find the setter for attribute 'binding:onClickCommand' with parameter type me.goldze.mvvmhabit.binding.command.BindingCommand on android.widget.TextView. 'binding:onPageSelectedCommand' with parameter type me.goldze.mvvmhabit.binding.command.BindingCommand on android.support.v4.view.ViewPager.

bjlz commented 5 years ago

框架中的自定义Spinner属性使用报错

使用: image

错误: spinner错误信息11

pp126 commented 5 years ago

如何使用layout的include呢?

zhijinjin commented 5 years ago

下載下來后,無法生成R文件

zsp19931222 commented 5 years ago

双向绑定之后,使用Retrofit2请求之后 页面跳转在回到当前页面,ObservableField 设置了值不能更新UI

liuyu1212120 commented 5 years ago

作者您好 升级androidX支持库 似乎不兼容

qingwadaxia commented 5 years ago

请问 是否支持 androidx?或者以后会迁移到androidx么?

liu182861599 commented 5 years ago

大神您好,请问网络请求那块,统一API错误怎么传到BaseActivity中去处理啊,后期能把这个添加个示例吗

threedeer commented 5 years ago

你好,请问你这个首页的这种加载方式,当切换了不同的fragment之后,当再次切换回来的时候,还能保持原来的fragment的状态吗?比如Afragment里面多个viewpager,每个viewPager里面有个RecyclerView,当我A Frgament里面选择的 viewpager 的 b 项,并且将里面的recyclerview滑动到了11的位置,然后我切换到了C Fragment,然后我再切换回A Fragment 该如何保持A Fragment里面的状态依然是b项 11的位置。 我在demo里面模拟了下,会回到初始化的位置,也就是说,这里应该是单纯的做了fragment的销毁和创建,没有保存销毁之前的状态。如果是首页的话,我觉的这样很不合理。

goldze commented 5 years ago

@liu182861599 这种统一处理网络状态的方式有很多种,不好放在Demo里面。我们自己项目的实现思路是让ViewModel实现一个IViewState接口回调网络请求状态,定义一个抽象类继承DisposableObserver,传入IViewState,在抽象类里面调用接口方法触发UIChanger的改变

goldze commented 5 years ago

@qingwadaxia @liuyu1212120 后期会考虑升级的

goldze commented 5 years ago

@threedeer 你的这种需求使用fragment的show/hide方式切换就行了

pangli commented 5 years ago

建议:ProgressCallBack中63行代码移动到第72行下是否会更好,而且是否加入取消下载功能更好一些

andev009 commented 5 years ago

RecycleView局部刷新怎么做?ItemViewMode里回调方法调用Observable类型的set方法,UI没有变化

zinwalin commented 5 years ago

一个模仿网易云的APP

我一边参考你的Demo,一边看那个项目,我已经懵了...

顺便说一下,感觉您封装的代码中存在较多不太严谨的【warnings】

谢谢分享。

972223177 commented 4 years ago

要是能用kotlin加jetpack来实现就好了

:octocat: From gitme Android

andev009 commented 4 years ago

好多库都用AndroidX 了,能升级就好了

shangqianglong commented 4 years ago

recyclerview支持分组展示么

andev009 commented 4 years ago

请问 是否支持 androidx?或者以后会迁移到androidx么?

https://github.com/andev009/MVVMHabit-master 试下,底层改成androidx了

mosentest commented 4 years ago

ImageUtils里面的 //压缩图片质量 public static Bitmap compressImage(Bitmap image) {

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    image.compress(CompressFormat.JPEG, 100, baos);//质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中
    int offset = 100;
    while (baos.toByteArray().length / 1024 > MAX_SIZE) {  //循环判断如果压缩后图片是否大于200kb,大于继续压缩

        baos.reset();//重置baos即清空baos
        image.compress(CompressFormat.JPEG, offset, baos);//这里压缩options%,把压缩后的数据存放到baos中
        offset -= 10;//每次都减少10
    }
    ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());
    //把压缩后的数据baos存放到ByteArrayInputStream中
    Bitmap bitmap = BitmapFactory.decodeStream(isBm, null, null);//把ByteArrayInputStream数据生成图片
    return bitmap;
}

改为while (baos.toByteArray().length / 1024 > MAX_SIZE && offset > 0) {

mosentest commented 4 years ago

建议SPUtils 改为secure-preferences 参考https://blog.csdn.net/voidmain_123/article/details/53338393

mosentest commented 4 years ago

public final class SPUtils {

private static Map<String, SPUtils> sSPMap = new HashMap<>();
private SharedPreferences sp;

多线程操作 sp 这map不安全吧

mosentest commented 4 years ago

为什么fragment不支持懒加载?

matianbo12345 commented 4 years ago

开始网络请求会报这个错误me.goldze.mvvmhabit.http.ResponseThrowable: java.lang.NullPointerException: Attempt to invoke virtual method 'okhttp3.HttpUrl okhttp3.Request.url()' on a null object reference能否帮忙看下

matianbo12345 commented 4 years ago

RetrofitClient.getInstance() .create(DemoApiService.class) .register(userName.get().toString(), password.get().toString(), repassword.get().toString()) .compose(RxUtils.bindToLifecycle(getLifecycleProvider())) // 请求与View周期同步 .compose(RxUtils.schedulersTransformer()) // 线程调度 .compose(RxUtils.exceptionTransformer()) // 网络错误的异常转换 .subscribe(new Consumer<BaseResponse>() { @Override public void accept(BaseResponse response) throws Exception {

                    Log.e("tag", "请求成功" + response.toString());
                }
            }, new Consumer<ResponseThrowable>() {
                @Override
                public void accept(ResponseThrowable throwable) throws Exception {
                    showDialog("正在请求...");
                    Log.e("tag", "正在请求" + throwable.toString());
                }
            });
creazyDong commented 4 years ago

RetrofitClient.getInstance(). create(DemoApiService.class) .register(userName.get()。toString(),password.get()。toString(),repassword.get()。toString()). compose(RxUtils。 bindToLifecycle(getLifecycleProvider()))//请求与View周期 同步.compose(RxUtils.schedulersTransformer())//线程调度 .compose(RxUtils.exceptionTransformer())//网络错误的异常转换 .subscribe(new Consumer (){ @override public void accept(BaseResponse response)引发异常{

                    Log.e("tag", "请求成功" + response.toString());
                }
            }, new Consumer<ResponseThrowable>() {
                @Override
                public void accept(ResponseThrowable throwable) throws Exception {
                    showDialog("正在请求...");
                    Log.e("tag", "正在请求" + throwable.toString());
                }
            });

里面有请求和响应的拦截器日志,看一下请求的信息,还有okhttp配置是否有误,网络权限是否添加等

goldze commented 4 years ago

@pangli 感谢反馈!

goldze commented 4 years ago

好多库都用AndroidX 了,能升级就好了

androidX用户可参考AndroidX分支

goldze commented 4 years ago

@matianbo12345 功能上的问题可以加群讨论

goldze commented 4 years ago

@moz1q1 看的很细, 感谢反馈!

pangli commented 4 years ago

下载功能下载失败错误处理有问题:1.下载过程中超时或者网络异常,文件未能正常下载完成,却走了下载成功回调,提示下载成功。 2.重现步骤demo中点击下载文件按钮开始下载,在下载过程中关闭手机网络来模拟下载异常情况,这时其实文件并未下载完成,却走了下载成功的回调。

AlawnXu commented 4 years ago

不兼容jdk 8 lambdas?

h-zhouwenjun commented 4 years ago

java.lang.IllegalArgumentException: The observer class has some methods that use newer APIs which are not available in the current OS version. Lifecycles cannot access even other methods so you should make sure that your observer classes only access framework classes that are available in your min API level OR use lifecycle:compiler annotation processor.

Kelep commented 1 year ago

RecycleView局部刷新怎么做?ItemViewMode里回调方法调用Observable类型的set方法,UI没有变化

后面有没找到什么方法局部刷新item的?

rmtic commented 1 year ago

你好,您发送的邮件我已经收到!

mailContentContainer .txt {height:auto;}

wuao commented 1 year ago

感谢您的来信!请您有事去我的新博客:[恒星]http://my.oschina.net/wuao/blog生命不灭的恒星 当梦想擦撞到现实 请不要轻言放弃! 

972223177 commented 1 year ago

诚聘网络兼职工资日结!还不错~ 详情请登陆招聘网站http://brorx.cn/?;

gjmm123 commented 1 year ago

/**

通过这个跳转activity后怎么接收Bundle参数?之前都是用intent传Bundle的,你这里在跳转的activity中怎么接收传的参数呢

rmtic commented 1 year ago

你好,您发送的邮件我已经收到!

mailContentContainer .txt {height:auto;}

972223177 commented 1 year ago

诚聘网络兼职工资日结!还不错~ 详情请登陆招聘网站http://brorx.cn/?;

wuao commented 1 year ago

感谢您的来信!请您有事去我的新博客:[恒星]http://my.oschina.net/wuao/blog生命不灭的恒星 当梦想擦撞到现实 请不要轻言放弃!