yanyiqun001 / ganguo Goto Github PK
View Code? Open in Web Editor NEW干果——简洁易用的gank客户端
干果——简洁易用的gank客户端
06-13 09:28:42.433 8367-8367/com.gank E/art: Throwing OutOfMemoryError "Failed to allocate a 8294412 byte allocation with 6411488 free bytes and 6MB until OOM" 06-13 09:28:42.436 8367-8367/com.gank E/AndroidRuntime: FATAL EXCEPTION: main Process: com.gank, PID: 8367 java.lang.OutOfMemoryError: Failed to allocate a 8294412 byte allocation with 6411488 free bytes and 6MB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.Bitmap.nativeCreate(Native Method) at android.graphics.Bitmap.createBitmap(Bitmap.java:825) at android.graphics.Bitmap.createBitmap(Bitmap.java:802) at android.graphics.Bitmap.createBitmap(Bitmap.java:722) at android.graphics.Bitmap.createBitmap(Bitmap.java:647) at android.graphics.Bitmap.createBitmap(Bitmap.java:627) at com.gank.ui.base.BaseActivity.getCacheBitmapFromView(BaseActivity.java:123) at com.gank.ui.base.BaseActivity.showAnimation(BaseActivity.java:96) at com.gank.ui.base.BaseActivity.access$000(BaseActivity.java:40) at com.gank.ui.base.BaseActivity$1.accept(BaseActivity.java:59) at com.gank.ui.base.BaseActivity$1.accept(BaseActivity.java:56) at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:59) at io.reactivex.subjects.PublishSubject$PublishDisposable.onNext(PublishSubject.java:265) at io.reactivex.subjects.PublishSubject.onNext(PublishSubject.java:184) at com.gank.ui.base.RxBus.post(RxBus.java:75) at com.gank.ui.base.RxBus.post(RxBus.java:68) at com.gank.ui.setting.SettingFragment$3.onCheckedChanged(SettingFragment.java:118) at android.widget.CompoundButton.setChecked(CompoundButton.java:152) at android.support.v7.widget.SwitchCompat.setChecked(SwitchCompat.java:1062) at android.support.v7.widget.SwitchCompat.toggle(SwitchCompat.java:1057) at android.widget.CompoundButton.performClick(CompoundButton.java:124) at android.view.View$PerformClick.run(View.java:20136) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5562) 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:968) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:763)
大神应用的代码似乎把图片的所有资源都缓存了,但是内存似乎一直保持在80~90mb左右,是在哪里做了释放呢,且滑倒下面去之后再划上来,图片依然显示出来了,好像图片内存缓存并没有清一样
可否简单说说 大神的内存怎么处理的呢?
我这边做了很多处理 依然会有oom的存在。。
默认初始化频道是首页,android,ios,前端,但是点击选择频道以后,返回(无操作)会多出扩展资源。
只需要在初始化频道的时候把if(i<4) 改成if(i<3)就可以了
我用了作者的吸顶布局滚动监听
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@OverRide
public void onScrollStateChanged(RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
}
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
// if (dy <= 0) {
// fab.show();
// } else {
// fab.hide();
// }
View stickyInfoView = recyclerView.findChildViewUnder(
tvTop.getMeasuredWidth() / 2, 5);
if (stickyInfoView != null && stickyInfoView.getContentDescription() != null) {
tvTop.setText(String.valueOf(stickyInfoView.getContentDescription()));
}
View transInfoView = recyclerView.findChildViewUnder(
tvTop.getMeasuredWidth() / 2, tvTop.getMeasuredHeight() + 1);
if (transInfoView != null && transInfoView.getTag() != null) {
int transViewStatus = (int) transInfoView.getTag();
int dealtY = transInfoView.getTop() - tvTop.getMeasuredHeight();
if (transViewStatus == mConsumeAdapter.HAS_STICKY_VIEW) {
if (transInfoView.getTop() > 0) {
tvTop.setTranslationY(dealtY);
} else {
tvTop.setTranslationY(0);
}
} else if (transViewStatus == mConsumeAdapter.NONE_STICKY_VIEW) {
tvTop.setTranslationY(0);
}
}
}
});
为什么在最顶部的那个会缩进去,或者是位置不正确呢,找不出来问题,请教下作者
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.