Skip to content

A native android textview capable of adding strokes or outlines to texts.

License

Notifications You must be signed in to change notification settings

IODevBlue/StrokedTextView

Repository files navigation

StrokedTextView

A native android textview capable of adding strokes or outlines to texts.

GitHub release (latest by date) Repository Size License GitHub Repository stars GitHub watchers Gradle version Kotlin version

Table of content

Documentations

Documentations are available online in KDoc.

Uses

StrokedTextView can be used for:

  • Game GUIs
  • Graffiti and art applications
  • Stylizing fonts and typefaces
  • Fancy texts

Sample preview of the StrokedTextView widget

Installation

There are several ways to install this widget.

  1. 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'
  1. 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 the com.blueiobase.api.android.strokedtextview package from the downloaded project zip file into the new strokedtextview package.
  • Edit the package declaration in the class file accordingly.
  • Copy the contents of the res folder in the project zip into your module's res 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.

Usage

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.

Configurations:

Variable Default Use
strokeColor 0 The Stroke color.
strokeWidth 0F The stroke width.

XML attributes:

Attribute Default Use
textStrokeColor Transparent The stroke color for the textview.
textStrokeWidth 0 The stroke width for the textview.

Contributions

Contributors are welcome!

NOTE: This repository is split into two branches:

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.

Changelog

  • 1.0.0
    • Initial release

More version history can be gotten from the Change log file.

License

    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.

About

A native android textview capable of adding strokes or outlines to texts.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages