GitXplorerGitXplorer
d

floating-text-button

public
148 stars
50 forks
6 issues

Commits

List of commits on branch master.
Unverified
f721dedcb2385b229e20badb5319805d004a5683

update readme

ddimorinny committed 5 years ago
Unverified
70b4d4b5fcf36b74579b7db1b1095f54b49432b0

bump version

ddimorinny committed 5 years ago
Unverified
6dfba79436a7ff9db4a75152d304fdf534134247

fixes

ddimorinny committed 5 years ago
Unverified
31796c0f486864312ed732bcf6475e719d52a49b

add left and right icons

ddimorinny committed 5 years ago
Unverified
84f8e46a9ac01511b28cddcf9fbddda913ec3d1d

bump version

ddimorinny committed 5 years ago
Unverified
c718ccd6b266a5874938b685a9505ffd03c2ef8e

Fixes #2 add getters

ddimorinny committed 5 years ago

README

The README file for this repository.

Floating Text Button

API

Dependency

Firstly, add Jitpack repository in your root build.gradle file (not your module build.gradle file):

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

Add dependency to your module's build.gradle file:

dependencies {
    compile 'com.github.dimorinny:floating-text-button:0.0.4'
}

Usage

Add floating text button to your layout file like this:

<ru.dimorinny.floatingtextbutton.FloatingTextButton
	android:id="@+id/action_button"
	android:layout_width="wrap_content"
	android:layout_height="wrap_content"
	app:floating_background_color="@color/color_action"
	app:floating_left_icon="@drawable/ic_action_white_24dp"
	app:floating_title="@string/action_button_title"
	app:floating_title_color="@android:color/white"
	/>

Also you can use app:floating_right_icon for adding icon to right side.

For more complication usage - see example.

Demo

Demo

Use with snackbar

If you want to use FloatingTextButton with snackbar, you should add layout_behavior attribute to your layout like this:

<ru.dimorinny.floatingtextbutton.FloatingTextButton
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_behavior="ru.dimorinny.floatingtextbutton.behavior.SnackbarBehavior"
        app:floating_background_color="?attr/colorPrimary"
        app:floating_icon="@drawable/ic_phone_white_24dp"
        app:floating_title="@string/call_button_title"
        app:floating_title_color="@android:color/white"/>

Demo