A native android textview capable of adding strokes or outlines to texts.
Documentations are available online in KDoc.
StrokedTextView can be used for:
- Game GUIs
- Graffiti and art applications
- Stylizing fonts and typefaces
- Fancy texts
There are several ways to install this widget.
- Grab a JAR artifact from the Maven Central Repository:
implementation 'io.github.iodevblue:strokedtextview:1.0.0'
- On Apache Maven
<dependency>
<groudId> io.github.iodevblue </groudId>
<artifactId> strokedtextview </artifactId>
<version> 1.0.0 </version>
</dependency>
If it is a snapshot version, add the snapshot Maven Nexus OSS repository:
maven {
url 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
}
Then retrieve a copy:
implementation 'io.github.iodevblue:strokedtextview:1.0.0-SNAPSHOT'
- If you do not prefer the compiled JAR and want access to the source files directly, then follow this process:
- Download the project zip file.
- Create a new package with name
strokedtextview
in your project. - Copy the
StrokedTextView
class file located in thecom.blueiobase.api.android.strokedtextview
package from the downloaded project zip file into the newstrokedtextview
package. - Edit the package declaration in the class file accordingly.
- Copy the contents of the
res
folder in the project zip into your module'sres
folder.
If you do make major or minor improvements to the source code, consider making a pull request or an issue to make a contribution.
Check the Contributing for more information.
Add a StrokedTextView
to your XML design
<com.blueiobase.api.android.strokedtextview.StrokedTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Superman"
android:gravity="center"
android:textSize="50sp"
android:fontFamily="@font/asterix_blink"
android:layout_marginBottom="20dp"
app:textStrokeColor="#FF5722"
app:textStrokeWidth="5"
/>
The textStrokeColor
attribute defines the color to be applied to the text outline.
The textStrokeWidth
defines the thickness of the stroke applied to the text.
StrokedTextView
is essentially a TextView
and contains all its methods and properties.
Variable | Default | Use |
---|---|---|
strokeColor |
0 | The Stroke color. |
strokeWidth |
0F | The stroke width. |
Attribute | Default | Use |
---|---|---|
textStrokeColor |
Transparent | The stroke color for the textview. |
textStrokeWidth |
0 | The stroke width for the textview. |
Contributors are welcome!
NOTE: This repository is split into two branches:
- main branch
- development branch
All developing implementations and proposed changes are pushed to the development branch and finalized updates are pushed to the main branch.
To note if current developments are being made, there would be more commits in the development branch than in the main branch.
Check the Contributing for more information.
- 1.0.0
- Initial release
More version history can be gotten from the Change log file.
Copyright 2023 IO DevBlue
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.