gavinliu / shapedimageview Goto Github PK
View Code? Open in Web Editor NEWAndroid Rounded, Circle, Path ImageView
Android Rounded, Circle, Path ImageView
第一次进入 正常 ,但是再次进去 就不正常了
http://ww3.sinaimg.cn/mw690/005SMY79gw1f5tae780jaj30k00zkwfz.jpg
第一行 的 左右两边的图片 是用 universalimageloader 加载
第三行 的 左右两边的图片 是用 Glide加载
都出现同样的问题 不知道是不是缓存的问题 请赐教
设置了shape_mode和round_radius
Loading an image with Glide into ShapedImageView seems to remove the stroke.
Glide.with(context)
.load(user.image)
.centerCrop()
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.into(pictureImageView)
Hello, when importing your library into my application, I get the following error:
Error:Execution failed for task ':app:processDebugManifest'.
Manifest merger failed : Attribute application@allowBackup value=(true) from AndroidManifest.xml:21:9-35
is also present at [cn.gavinliu.android.lib:ShapedImageView:0.8.4] AndroidManifest.xml:12:9-36 value=(false).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:20:5-118:19 to override.
This is from the AndroidManifest.xml in your library have a android:allowBackup, android:supportRtl, and an android:label attributes.
These attributes should be removed so that this error goes away.
public void setStroke(int strokeColor, float strokeWidth) {
if (mStrokeWidth <= 0) return;
if (mStrokeWidth != strokeWidth) {
mStrokeWidth = strokeWidth;
int width = getMeasuredWidth();
int height = getMeasuredHeight();
mStrokeShape.resize(width - mStrokeWidth * 2, height - mStrokeWidth * 2);
postInvalidate();
}
if (mStrokeColor != strokeColor) {
mStrokeColor = strokeColor;
makeStrokeBitmap();
postInvalidate();
}
}
if (strokeWidth <= 0) return; 是否应该改成,否则无法通过直接代码设置storke width。
ShapedImageView's bottom-right and bottom-left corner display incorrectly with below setting.
<cn.gavinliu.android.lib.shapedimageview.ShapedImageView
...
app:round_radius="5dp"
app:shape_mode="round_rect"
app:stroke_color="@color/black_color"
app:stroke_width="1dp" />
In RecyclerView circle border is hide.
AndroidManifest.xml 里的 android:allowBackup属性设置的为false,我应用里设置的为true,通过gradle导入运行不了提示冲突
Like change shape / stroke / color.
Thanks
Sometimes I get crash report from Crashlytics.
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.graphics.Bitmap.isRecycled()' on a null object reference
at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:69)
at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:226)
at android.view.RecordingCanvas.drawBitmap(RecordingCanvas.java:82)
at cn.gavinliu.android.lib.shapedimageview.ShapedImageView.onDraw(ShapedImageView.java:130)
at android.view.View.draw(View.java:21860)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.draw(View.java:21863)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.draw(View.java:21863)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.draw(View.java:21863)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.updateDisplayListIfDirty(View.java:20719)
at android.view.View.draw(View.java:21586)
at android.view.ViewGroup.drawChild(ViewGroup.java:4551)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4326)
at android.view.View.draw(View.java:21863)
at com.android.internal.policy.DecorView.draw(DecorView.java:1083)
at android.view.View.updateDisplayListIfDirty(View.java:20733)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:725)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:731)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:840)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3932)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3706)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3014)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1873)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8478)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949)
at android.view.Choreographer.doCallbacks(Choreographer.java:761)
at android.view.Choreographer.doFrame(Choreographer.java:696)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:6986)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1445)
The path is going backwards.
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.