gcssloop / diycode Goto Github PK
View Code? Open in Web Editor NEW[暂停维护]diycode android app
License: Apache License 2.0
[暂停维护]diycode android app
License: Apache License 2.0
通过请求 异步+eventbus。这个确实很美观。
不过这样多个注册了 @subscribe 的 页面同时存活,其中一个请求。
另一个页面也会处理相同的数据,会不会凌乱呢?
求解答~
刚才我玩diycode测试版本app,发现一个bug,就是登陆界面。我进入登陆界面,点击注册,进入注册界面。不注册,然后返回登陆。点击输入框,程序退出
rt 400
从竖屏切换成横屏之后
点击了浮动按钮
然后停止运行了
屡试不爽。
为什么内存缓存和磁盘缓存的处理要放到fragment中呢?放到数据处理层BaseImpl层会不会更合理一些。
目前已知问题。
每个帖子末尾都有微博和网站的链接,一点就崩了
调试的时候执行到以下代码行停住了
// X5内核初始化接口
QbSdk.initX5Environment(application, null);
应该是没有做到兼容各大网页img标签,所以目前好像只有简书才能点击查看大图..而且我好像点击图片进去以后,下面viewpager指示器好像不能准确定位到当前图片,有点混乱。
你好:
魔法师,有个疑问想问下你。
去年参加DevFest听到秋百万的讲解,他比较不赞成的就是采用SparseArray这种的;
并且我看到drakeet的项目中也有这个说法,为什么SparseArray这种方式不太好呢,我看你的项目中用到了。
drakeet/MultiType#8
我看项目里使用了 fixFocusedViewLeak 解决inputmanager 内存泄漏问题,网上有的帖子说这个是系统bug,不需要解决,因为就算你不泄露,别人也会泄漏,您是怎么看这个问题的~
navigationMenu里的图标在nexus6上有点拉伸的太丑了,--!
FloatingActionButton 在三星 Galaxy S6 上显示有问题,如图:
我看了下代码可能是隐藏 view 的问题
public static void translateHide(View view, ViewPropertyAnimatorListener
viewPropertyAnimatorListener) {
view.setVisibility(View.VISIBLE);
ViewCompat.animate(view)
.translationY(260)
.setDuration(400)
.setInterpolator(FAST_OUT_SLOW_IN_INTERPOLATOR)
.setListener(viewPropertyAnimatorListener)
.start();
}
应该是translationY(260) 这个地方出现的问题,260是px值,转换为dp。
DataCache:
public void saveData(@nonnull String key, @nonnull T data) {
mLruCache.put(key, data);
mDiskCache.put(key, data, ACache.TIME_WEEK); // 数据缓存时间为 1 周
}
执行到最后:
/**
* 保存 byte数据 到 缓存中
*
* @param key 保存的key
* @param value 保存的数据
*/
public void put(String key, byte[] value) {
File file = mCache.newFile(key);
....
mCache.put(file);
}
private File newFile(String key) {
return new File(cacheDir, key.hashCode() + "");
}
private void put(File file) {
.....
Long currentTime = System.currentTimeMillis();
file.setLastModified(currentTime);
lastUsageDates.put(file, currentTime);
}
每次put操作,会新建一个File对象,然后将该引用保存到lastUsageDates中
///////////////////////////////////////////////////////
get操作
public T getData(@nonnull String key) {
T result = (T) mLruCache.get(key);
if (result == null) {
result = (T) mDiskCache.getAsObject(key);
if (result != null) {
mLruCache.put(key, result);
}
}
return result;
}
/**
* 获取 byte 数据
*
* @param key
* @return byte 数据
*/
public byte[] getAsBinary(String key) {
RandomAccessFile RAFile = null;
boolean removeFile = false;
try {
File file = mCache.get(key);
....
}
private File get(String key) {
File file = newFile(key);
Long currentTime = System.currentTimeMillis();
file.setLastModified(currentTime);
lastUsageDates.put(file, currentTime);
return file;
}
每次get操作,都会创建一个新的File对象,然后将这个File引用保存到lastUsageDates中。
//////////////////////////////////////////////////////////////////
那么,bug就是,比如,我存放一个SD卡缓存,key是loginInfo,保存到SD卡中的一个文件。
然后,我不断去get,会不断添加新的File引用到lastUsageDates。lastUsageDates中,使用的key是File引用值,每个新创建的File对象,它们的引用值都是不同的,即使它们指向相同的文件。
那个注入js代码添加点击事件试了下是可以的,普通网页没问题。
可像那些列表页面,也就是网页进去是js代码请求接口获取列表数据,然后才for循环添加的img标签吧,这种的话 在onPageFinished里执行addImageClickListener()也不行啊,这时候网页还没加载完了吧。那些img标签都还没添加进来了。。所以就无效了。。我试着延迟两秒执行addImageClickListener方法就没问题了。 所以现在的问题是,咋判断网页是彻底的加载完了?
求高人指点,3q
缺少参数
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.