New Year’s welfare
Thanks to Androider for supporting SuperTextView. It has been nearly 8 months since the first submission of SuperTextView in April 2017, and the star has accumulated from 0 to nearly 1.3K now. Thank you very much for your support.
In the process of SuperTextView from scratch, many students put forward many constructive suggestions. CoorChice was very grateful to these students and tried his best to meet some of their demands. However, since SuperTextView has been used in many commercial projects, CoorChice will be more cautious in the update and iteration, focusing on stability. Therefore, not all students’ expectations can be met, please understand.
CoorChice would like to wish all students a happy New Year!
Well, it’s the New Year, so it’s natural to have some benefits, HMM…
SuperTextView still doesn’t have a Logo, it’s not scientific! Unfortunately, CoorChice is just a Developer and could not draw a satisfactory Logo after thinking for a long time.
So, in the New Year, here’s a bonus:
Help CoorChice design a cool SuperTextView Logo that will be used as the official SuperTextView Logo.
CoorChice wants your talented Logo to reflect SuperTextView (consult the SuperTextView documentation for inspiration), but a simple Logo will be much more popular. It would be great if the Logo had a good communication attribute!
From December 29, 2017 to January 25, 2018, you can send your Logo to CoorChice via email or wechat. CoorChice will select the most suitable work as the official logo of the future SuperTextView.
[Email] : [email protected]
【 wechat 】 : 759393474
Meanwhile, here’s the big deal!
The CoorChice will send two boxes of cool and delicious crayfish to the talented author of the work chosen as the official SuperTextView logo as a thank-you. Uh huh… Is the stomach of a foodie already hungry? Start your show!
V2.0.1 – Future, here
CoorChice has always had a vision for a control that will do most of your development needs, displaying text, images, geometry, animation, and state, allowing you to do most of your development work efficiently with a single control. It’s so powerful, it’s mind-like, it takes your input, and it creates amazing images according to your mind. With SuperTextView V2.0.1, we are one step closer to this vision. Now, let’s meet SuperTextView V2.0.1.
Pictures, right now
In SuperTextView V2.0.1, support for image display was added. But it’s not just about showing images, it’s also about intelligently tailoring them to your desired shape based on your input.
Add rounded corners, borders, or even a circle to your image, all with a few simple attributes, and you’ll see it instantly.
Show a picture
How to display an image using SuperTextView? Just add the following two lines of code to the XML.
<com.coorchice.library.SuperTextView
...
app:state_drawable="@drawable/avatar1"
app:drawableAsBackground="true". />Copy the code
If you’re a regular user of SuperTextView, you’ll notice that the original state_drawable can now be used to display an image.
Round the corners of the picture
Now that your image is in front of you, maybe you want to do something different with it, like add a rounded corner, or just make it round? No problem, SuperTextView is now more than capable of doing just that.
<com.coorchice.library.SuperTextView
android:layout_width="100dp"
android:layout_height="100dp". app:corner="15dp"
app:state_drawable="@drawable/avatar1"
app:drawableAsBackground="true". />Copy the code
So simple! On the original basis, you just need to set a reasonable corner value.
Perhaps, you also want borders
Sometimes, you might want to use a border around your image, as in the example above. Yes, that’s certainly within the bounds of SuperTextView.
<com.coorchice.library.SuperTextView
android:layout_width="100dp"
android:layout_height="100dp". app:corner="50dp"
app:stroke_color="#F4E187"
app:stroke_width="4dp"
app:state_drawable="@drawable/avatar1"
app:drawableAsBackground="true". />Copy the code
App :stroke_color controls the color of the border, and app:stroke_width controls the width of the border. Everything flows so smoothly, as a control with a mind should, right?
Second state diagram
To cope with the complexity of changing requirements, SuperTextView spawned a second state diagram, state_drawable2.
Now, CoorChice will show you how the two effects in the image above are achieved.
- The sample a
<com.coorchice.library.SuperTextView
android:layout_width="100dp"
android:layout_height="100dp". app:corner="50dp"
app:state_drawable="@drawable/avatar1"
app:drawableAsBackground="true"// state_drawable2 configuration starts here app:isShowState2="true"
app:state_drawable2="@drawable/recousers"
app:state_drawable2_mode="rightTop"
app:state_drawable2_height="20dp"
app:state_drawable2_width="20dp". />Copy the code
- Example 2
<com.coorchice.library.SuperTextView
android:layout_width="100dp"
android:layout_height="100dp". // Android :background="@drawable/avatar7"// The drawable1 configuration starts here app:isShowState="true"
app:state_drawable="@drawable/triangle"
app:state_drawable_mode="leftTop"
app:state_drawable_width="20dp"
app:state_drawable_height="20dp"// state_drawable2 configuration starts here app:isShowState2="true"
app:state_drawable2="@drawable/recousers"
app:state_drawable2_mode="rightTop"
app:state_drawable2_height="20dp"
app:state_drawable2_width="20dp". />Copy the code
As you’re familiar with, state_drawable2 continues all the smooth operations of the first generation. If you are smart enough to use it properly, SuperTextView will shine brilliantly! 😉
The Adjuster era
Previously, Adjuster was designed to give SuperTextView a soul and make it a smarter control. The insertion of the drawing process and the capture of touch events allow you to easily change the state of a control from the outside. Creativity begins in the heart, and goes there.
Now, SuperTextView can accommodate up to 3 adjusters at the same time! Maybe your idea will be even more dazzling.
In the example above, CoorChice added the early sweeps and Ripples effects to a SuperTextView, and this is what you see.
More Adjuster means more combinations, more surprises. In v1.4.0, CoorChice also uses Adjuster to easily achieve the Adjuster change function.
This is the era of Adjuster, and when you’re smart, you can be creative.
Note ⚠️, the original setAdjuster(Adjuster) method is still in place for now, but later versions will be removed and you will have to migrate as soon as possible. The new alternative is addAdjuster(Adjuster).
other
- Fixed properties that control Shader mode
app:shaderMode="leftToRight"
The spelling. The original forapp:shaderMode="leftTopRight"
. If you use this property, please fix it when you update SuperTextView V2.0.1. - increase
set/getPressBgColor()
和set/getPressTextColor()
Used to control the pinch background color in code. - Fix [SuperTextView V2.0] setting click event invalid Bug.
How do I start SuperTextView V2.0.1
dependencies {
compile 'com. Making. ChenBingX: SuperTextView: v2.0.1'
}
Copy the code
Click here to jump to SuperTextView project address. https://github.com/chenBingX/SuperTextView
Write in the last
- If you like SuperTextView, please click a Star on Github to encourage you!
- Take out spare time to write an article to share need power, still ask everybody to see an officer move a small hand dot praise, give me dot encourage 😄
- I’ve been creating new dry goods from time to time. To get on, just go to my [personal] page and click “follow me”. Start then ~
Click here to jump to SuperTextView project address. https://github.com/chenBingX/SuperTextView
SuperTextViewThe old documents: https://www.jianshu.com/p/1b91e11e441d