Skip to content

A user interface element that displays text to the user.

License

Notifications You must be signed in to change notification settings

datanapps/CapTextView

Repository files navigation

CapTextView

A user interface element that displays text to the user.

Use Captextview as custom textview in your project

 <datanapps.captextview.CapTextView
        android:id="@+id/text2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"

        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        android:padding="5dp"
        app:layout_constraintTop_toBottomOf="@+id/text1"
        
        app:capsDropNumber="2"
        app:capFont="@font/eb_garamond_regular"
        app:capTextColor="@color/purple_700"
        app:capTextSize="@dimen/cap_text_size"

        app:bodyTextColor="@color/purple_700"
        app:bodyTextSize="@dimen/body_text_size"
        app:bodyTextFont="@font/eb_garamond_regular"
        />

Its facilitate to set attribites in xml

for cap text view:

        app:capsDropNumber="2"
        app:capFont="@font/eb_garamond_regular"
        app:capTextColor="@color/purple_700"
        app:capTextSize="@dimen/cap_text_size"
   

for body text view:

   
        app:bodyTextColor="@color/purple_700"
        app:bodyTextSize="@dimen/body_text_size"
        app:bodyTextFont="@font/eb_garamond_regular"
        
        

There is custom method is also available.

fun setCapTextFont(@NonNull fontId:Int)

fun setCapTextAttrColor(@NonNull color:Int)

fun setBodyTextFont(@NonNull fontId:Int)

fun setHtmlText(text: String, isCapText:Boolean)

fun setHtmlText(text: String)

fun setTextScale(sizeInPx: Int)

-----------------------------

Hope it will help. Thanks

See

License

Copyright [2021] [datanapps]

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

About

A user interface element that displays text to the user.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages