Skip to content

Latest commit

Β 

History

History
134 lines (96 loc) Β· 3.39 KB

File metadata and controls

134 lines (96 loc) Β· 3.39 KB

🌟 Welcome to TextWithSubText Library

🧩 A lightweight and customizable Android library for displaying a main title with a subtext β€” perfect for lists, settings screens, or profile sections.

It supports custom text styles, colors, and drawables (start & end) with flexible padding, making your UI cleaner and more elegant.

✨ Preview

Preview

πŸš€ How to Use

1️⃣ Add JitPack Repository

Add the following line to your settings.gradle or settings.gradle.kts file πŸ‘‡

gradle


maven { url = uri("https://jitpack.io") }

Your repositories block should look like this:

gradle

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url = uri("https://jitpack.io") }  // Now paste here
    }
} 

2️⃣ Add Dependency

In your app/build.gradle file, add:

Groovy DSL

implementation 'com.github.JoyRay0:TextWithSubText:$release Version'

Kotlin DSL

implementation("com.github.JoyRay0:TextWithSubText:$release version")

🧱 XML Example

<com.rk_softwares.textwithsubtext.TextWithSubText
    android:id="@+id/text"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:mainText="Hello"
    app:mainTextSize="14sp"
    app:mainTextColor="#000"
    app:mainTextStyle="bold"
    app:subText="World"
    app:subTextSize="12sp"
    app:subTextColor="#625959"
    app:subTextStyle="bold"
    app:drawableStart="@drawable/ic_android"
    app:drawableEnd="@drawable/ic_forward_"
    app:drawablePadding="10dp"
    />

🧠 Customize in Java

java


TextWithSubText text = findViewById(R.id.text);

text.setMainText("Hello")
text.setSubText("World")
text.setMainTextColor("#000000")
text.setSubTextColor("#000000")
text.setMainTextSize(30)
text.setSubTextSize(20)
text.setMainTextStyle(Typeface.BOLD)
text.setSubTextStyle(Typeface.NORMAL)
text.drawableStart(R.drawable.ic_android)
text.drawableEnd(R.drawable.ic_forward_)
text.drawablePadding(10)

🧠 Customize in Kotlin

kotlin


val text: TextWithSubText = findViewById(R.id.text)

text.setMainText("Hello")
text.setSubText("World")
text.setMainTextColor("#000000")
text.setSubTextColor("#000000")
text.setMainTextSize(30)
text.setSubTextSize(20)
text.setMainTextStyle(Typeface.BOLD)
text.setSubTextStyle(Typeface.NORMAL)
text.drawableStart(R.drawable.ic_android)
text.drawableEnd(R.drawable.ic_forward_)
text.drawablePadding(10)

πŸ’– Special Thanks

I would like to express my heartfelt thanks to everyone who uses or contributes to TextWithSubText. Your support, feedback, and contributions inspire me to make this library even better.

Every suggestion, bug report, and pull request helps this project grow stronger. Together, we’re building something simple, elegant, and useful for the Android community.

πŸ’¬ Thank you for being a part of this journey β€” your encouragement means the world! πŸŒπŸ’«

βš–οΈ License

MIT License β€” Use freely in your projects, commercial or personal.