Coder Social home page Coder Social logo

giangpham96 / expandable-text Goto Github PK

View Code? Open in Web Editor NEW
51.0 2.0 9.0 12.34 MB

Light-weighted, convenient implementation of expandable text view that supports expanding & collapsing animations for Android projects.

License: MIT License

Kotlin 100.00%
android android-library textview expandable collapsible animation seemore android-ui compose compose-ui

expandable-text's Introduction

watching_count

Hi , I am Giang Pham 🇻🇳

LinkedIn  Gmail 

You're looking at the profile of an Android developer at  📱
and a graduate student at  🎓


 About me ...

✔ Refer me as he/him or that dude 😎
✔ I’m currently one of the contributors of Wolt Consumer app
✔ I help startups by consulting on how to build robust & scalable Android applications & mobile applications from different aspects. Contact me via email 📫


🛠 Tech Stack & Toolings

Kotlin Android Gradle Android Studio Firebase ReactiveX
Github Actions Github Git IntelliJ IDEA Swagger

expandable-text's People

Contributors

giangpham96 avatar papjul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

expandable-text's Issues

Links Not Working in ExpandableTextView

<io.github.giangpham96.expandable_textview.ExpandableTextView android:layout_width="wrap_content" android:layout_marginHorizontal="@dimen/_10sdp" android:layout_height="wrap_content" android:textSize="@dimen/_12sdp" app:expandAction="More" android:id="@+id/text" style="@style/Caption_TextView_Style" app:limitedMaxLines="5" app:expandActionColor="@color/button_bar_tint"/>

        website links not working 

Problems implementing

I'm trying to add the 'com.github.giangpham96.expandable-text:expandable_textview:2.0.0' dependency to my project and I get the error "Failed to resolve". I have added in the build.gradle of the project the following line:
allprojects {
repositories {
Google()
maven { url = uri("https://jitpack.io/") }
}
}

As it appears in the repository's Readme.

Add support for Api 22 and lower devices.

We must change getStaticLayout function for api 22 and lower devices. I tried adding new StaticLayout constuructor but it doesn't work properly.

` private fun getStaticLayout(targetMaxLines: Int, text: CharSequence, textWidth: Int): StaticLayout {
val maximumLineWidth = textWidth.coerceAtLeast(0)
val alignment = ALIGN_NORMAL
val includePadding = true

    return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
        StaticLayout.Builder
            .obtain(text, 0, text.length, paint, maximumLineWidth)
            .setIncludePad(false)
            .setMaxLines(targetMaxLines)
            .setAlignment(alignment)
            .setEllipsize(END)
            .setLineSpacing(lineSpacingExtra, lineSpacingMultiplier)
            .build()
    } else {
        StaticLayout(
            text,
            0,
            text.length,
            paint,
            maximumLineWidth,
            alignment,
            lineSpacingMultiplier,
            lineSpacingExtra,
            includePadding,
            END,
            width
        )
    }
}`

collapse expand listener

how to listen when the text is collapsed or expanded? i try to add clickListener but is causing the text cannot clicked

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.