Skip to content

a fab that transform into textview... kind of

Notifications You must be signed in to change notification settings

DevenLu/FabTextView

 
 

Repository files navigation

FabTextView

An fab that transform into textview..

Install

Step 1

allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
	}

Step 2

Add this to your app/build.gradle.

If you don't want to include the dependency (com.android.support:appcompat-v7, com.android.support:design) from this project, use this:

compile('com.github.worker8:FabTextView:1.0.2') {
    transitive = false
}

Otherwise, use this:

compile 'com.github.worker8:FabTextView:1.0.2'

Usage

In xml:

<beepbeep.fabtextview.FabTextView
        android:id="@+id/fab_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_marginBottom="20dp"
        android:layout_marginEnd="16dp"
        app:fab_backgroundColor="@color/colorPrimaryDark"
        app:fab_diameter="55dp"
        app:fab_iconSrc="@mipmap/ic_launcher"
        app:fab_text="Android Robot"
        app:fab_textSize="20sp" />

To control the open and closing:

  • fabTextView.toggle(): call shrink() if expanded, call expand() if shrunk
  • fabTextView.shrink(): shrink to FAB
  • fabTextView.expand(): expand from FAB to the long button

About

a fab that transform into textview... kind of

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 57.6%
  • Java 42.4%