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()
: callshrink()
if expanded, callexpand()
if shrunkfabTextView.shrink()
: shrink to FABfabTextView.expand()
: expand from FAB to the long button