Fole is a simple library to collapse and expand a TextView.

Overview

Fole Tweet

Fole is a simple library that handles a toggle for you, to expand and collapse a TextView.

Please, star this repo if you find it useful. 🙃


DemoInstallingBasic UsageAnimations


Demo

Installing

    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }

    dependencies {
        implementation 'com.github.bffcorreia:fole:1.0.0'
    }

Basic Usage

    Fole.with(yourTextView).text("Your text...").maxLines(4).toggleView(yourToggleView);
    Fole.with(yourTextView).text("Your text...").maxChars(50).toggleView(yourToggleView);

Ellipsis Placeholder

    Fole.with(yourTextView).maxLines(4).ellipsisPlaceholder("###").toggleView(yourToggleView);

Callback

If you want to know when the TextView expands or collapses just add a FoleCallback.

    FoleCallback callback = new FoleCallback() {
          @Override public void onTextExpand() {
            // Handle onTextExpand!
          }
    
          @Override public void onTextCollapse() {
             // Handle onTextCollapse!
          }
        };
    Fole.with(yourTextView).maxLines(4).toggleView(yourToggleView, callback);

Animations

To animate the TextView when it extends or collapses, simply add your animation.

    Animation animation = AnimationUtils.loadAnimation(context, android.R.anim.fade_in);
    Fole.with(yourTextView)
        .maxLines(4)
        .animation(animation)
        .toggleView(yourToggleView);

If you want to use different animations:

    Animation expandAnimation = AnimationUtils.loadAnimation(context, android.R.anim.fade_in);
    Animation collapseAnimation = AnimationUtils.loadAnimation(context, android.R.anim.slide_in_left);
    Fole.with(yourTextView)
        .maxLines(4)
        .expandAnimation(expandAnimation)
        .collapseAnimation(collapseAnimation)
        .toggleView(yourToggleView);

License

Copyright 2016 Bruno Correia

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.
You might also like...
KdGaugeView is a simple and customizable Gauge / Speedometer control for Android.
KdGaugeView is a simple and customizable Gauge / Speedometer control for Android.

KdGaugeView KDGaugeView is a simple and customizable gauge control for Android inspired by LMGaugeView Motivation I need some clean Guage view for my

💳 Bank Card View is a simple and elegant card view with Flip animation.
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário 💳 Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

💳 Bank Card View is a simple and elegant card view with Flip animation.
💳 Bank Card View is a simple and elegant card view with Flip animation.

Visualização de cartão bancário 💳 Bank Card View é uma visualização de cartão simples e elegante com animação Flip. Versões Selecione a língua : Engl

Postman is a reactive One-tap SMS verification library. This library allows the usage of RxJava with The SMS User Consent API
Postman is a reactive One-tap SMS verification library. This library allows the usage of RxJava with The SMS User Consent API

What is Postman? Postman is a reactive One-tap SMS verification library. This library allows the usage of RxJava with The SMS User Consent API Usage P

AppIntroAnimation is a set of code snippets to make cool intro screen for your app with special Image Translation and Transformation animation effects. It is very easy to use and customize without adding third party library integrations. FilePicker is a small and fast file selector library that is constantly evolving with the goal of rapid integration, high customization, and configurability~
FilePicker is a small and fast file selector library that is constantly evolving with the goal of rapid integration, high customization, and configurability~

Android File Picker 🛩️ 中文简体 Well, it doesn't have a name like Rocky, Cosmos or Fish. Android File Picker, like its name, is a local file selector fra

A simple animated step view for Android
A simple animated step view for Android

StepView A simple animated step view for Android. Backward and forward animations is supported. Usage Add jcenter() to repositories block in your grad

Simple way to animate your views on Android with Rx 🚀
Simple way to animate your views on Android with Rx 🚀

This is an Android library to make a simple way to animate your views on Android with Rx.

This is a simple util to create Activity transition animation
This is a simple util to create Activity transition animation

TransitionHelper This is a simple util to create Activity transition animation API compatible with Android 2.2+ 中文说明 Screenshots How to use 1.startAct

Releases(1.1.0)
Owner
Bruno Correia
A Mobile Developer and a Peanut Butter addict.
Bruno Correia
An Android library which provides simple Item animations to RecyclerView items

RecyclerViewItemAnimators Library Travis master: This repo provides: Appearance animations Simple animators for the item views Quick start You can now

Gabriele Mariotti 3.1k Dec 16, 2022
Android library to control Transition animates. A simple way to create a interactive animation.

TransitionPlayer Android library to control Transition animates. A simple way to create a interactive animation. Demo1 SimpleTransition Code: ....

林法鑫 1.2k Dec 17, 2022
Simple android library to present an animated ferris wheel

Ferris Wheel View Overview An Android Library used to implement an animated Ferris Wheel in android. API SDK 15+ Written in Kotlin Supports landscape

Igor Lashkov 318 Dec 7, 2022
An simple & awesome animation library written in Kotlin for Android

An simple & awesome animation library written in Kotlin for Android

Romman Sabbir 53 Oct 17, 2022
Android library to control Transition animates. A simple way to create a interactive animation.

TransitionPlayer Android library to control Transition animates. A simple way to create a interactive animation. Demo1 SimpleTransition Code: ....

林法鑫 1.2k Dec 17, 2022
A simple and customizable Android full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" gestures

Stfalcon ImageViewer A simple and customizable full-screen image viewer with shared image transition support, "pinch to zoom" and "swipe to dismiss" g

Stfalcon LLC 1.9k Jan 5, 2023
A Simple Todo app design in Flutter to keep track of your task on daily basis. Its build on BLoC Pattern. You can add a project, labels, and due-date to your task also you can sort your task on the basis of project, label, and dates

WhatTodo Life can feel overwhelming. But it doesn’t have to. A Simple To-do app design in flutter to keep track of your task on daily basis. You can a

Burhanuddin Rashid 1k Jan 1, 2023
Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. The library is based on the code of Mario Klingemann.

Android StackBlur Android StackBlur is a library that can perform a blurry effect on a Bitmap based on a gradient or radius, and return the result. Th

Enrique López Mañas 3.6k Dec 29, 2022
Combine ViewPager and Animations to provide a simple way to create applications' guide pages.

WoWoViewPager WoWoViewPager combines ViewPager and Animations to provide a simple way to create applications' guide pages. When users are dragging WoW

Nightonke 2.7k Dec 30, 2022
Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices.

PreLollipopTransition Simple tool which help you to implement activity and fragment transition for pre-Lollipop devices. Download In your app build.gr

Takahiro Menju 1.3k Nov 28, 2022