crazyqiang / androidstudy Goto Github PK
View Code? Open in Web Editor NEW🔥 Android学习知识点总结 Jetpack、MVVM、MVI、Kotlin、ViewPager2、JUC多线程等,欢迎star!
Home Page: http://blog.csdn.net/u013700502
🔥 Android学习知识点总结 Jetpack、MVVM、MVI、Kotlin、ViewPager2、JUC多线程等,欢迎star!
Home Page: http://blog.csdn.net/u013700502
RT
CommonUtil.measureWidthAndHeight方法,具体实现是什么呢?我想试试你的idea,谢谢
private void startPopu(View v) {
if (popupWindow != null && popupWindow.isShowing())
return;
popupWindow = new CommonPopupWindow.Builder(SearchActivity.this)
.setView(R.layout.popu_more_car_type)
.setWidthAndHeight(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
.setBackGroundLevel(0.7f)//取值范围0.0f-1.0f 值越小越暗
.setAnimationStyle(R.style.AnimDown)
.setViewOnclickListener(this)
.create();
popupWindow.showAsDropDown(v);
}
图片:http://bmob-cdn-16268.b0.upaiyun.com/2019/01/29/697b63eb40e1e61180f914566d12e769.png
手机配置变化导致Activity重建时,比如旋转屏幕、深浅模式改变时,弹框不能恢复。DialogFragment应该原本就有支持恢复逻辑的,这个框架不能恢复是什么问题吗?
可以升级一下gradle吗?7.1的无法运行啊
private final Handler mHandler = new Handler(Looper.getMainLooper()) {
@OverRide
public void handleMessage(Message msg) {
switch (msg.what) {
case APPLE_INFO:
Apple apple = (Apple) msg.obj;
//观察者模式,通知所有客户端
final int clientNum = mCallbacks.beginBroadcast();
for (int i = 0; i < clientNum; i++) {
IRemoteServiceCallBack callBack = mCallbacks.getBroadcastItem(i);
if (callBack != null && apple != null) {
try {
callBack.noticeAppleInfo(apple);
} catch (RemoteException e) {
e.printStackTrace();
}
}
mCallbacks.finishBroadcast();
}
break;
}
super.handleMessage(msg);
}
mCallbacks.finishBroadcast();应该放到for循环后面,不然通知一个就结束了
SYDialog创建并show之后,如果此时屏幕旋转,那么Dialog将会消失,留下一层阴影。
测试Xiaomi 5S Plus和Vivo Z5都是这样的情况。
R.layout.activity_view_pager2 这个文件 大佬你没提交
请问,MvvmExampleActivity的WanViewModel在BaseMvvmActivity初始化了?这样多个Activity的viewmodel都在此的话,对所有Activity都可见了?
如果不在BaseMvvmActivity初始化的话registerEvent方法 mViewModel.errorFlow又没办法统一在BaseMvvmActivity中处理,怎么处理比较好呢?
作者可以写个示例吗,期待您的回复
new SYDialog.Builder(context)
.setDialogView(R.layout.dialog_garbage_details)
//设置动画
.setAnimStyle(R.style.AnimUp)
//设置屏幕宽度比例
.setScreenWidthP(1.0f)
//设置屏幕高度比例
.setScreenHeightP(1.0f)
//设置背景透明度
.setWindowBackgroundP(0.5f)
//设置是否屏蔽物理返回键 true不屏蔽 false屏蔽
.setCancelable(true)
//设置dialog外点击是否可以让dialog消失
.setCancelableOutSide(true)
.setBuildChildListener((dialog, view, layoutRes) -> initView(dialog, view))
.setOnDismissListener(dialog -> GarbageDetailsDialog.this.context = null)
.show();
写了 GarbageDetailsDialog.this.context = null 还是有内存泄漏
支持轮播fragment吗
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.