GithubHelp home page GithubHelp logo

floating-text-button's Introduction

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

floating-text-button's People

Contributors

dimorinny 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  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  avatar  avatar  avatar

floating-text-button's Issues

Hide When Scroll

hey, thanks for making great alternative flooating action button. but do this floating-text-button come up with auto-hide when scroll function? how can i get approach to it.
sorry for my bad english. hope you help. thanks.

getting text of the button

I don't know if there is a way to get the text of the button of a floating text button. a help would be nice.

Change Font

Hello, is there a way to change the font inside the button?

Getter Methods

Hello,
I love using your library :) Thank you so much!
I get setTitle but I cannot get title.. Can you make getter methods for this beautiful library? :)

Thank you so much!

Looks wrong

It looks like in the attached image after I added into my layout. Tested on real device, also the same.

<ru.dimorinny.floatingtextbutton.FloatingTextButton
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/addBtn"
                android:layout_below="@id/xxx"
                android:layout_marginTop="20dp"
                android:layout_centerHorizontal="true"
                app:floating_background_color="#1976D2"
                app:floating_left_icon="@drawable/ic_add_white_24dp"
                app:floating_title="添加"
                app:floating_title_color="@color/white"/>

screen shot 2018-03-04 at 12 27 12 pm

The root layout is a relativeLayout. Thanks!

Error inflating class FloatingTextButton on API 1 - 20

FloatingTextButton was placed in a fragment and my app kept crashing with the error below

E/AndroidRuntime: FATAL EXCEPTION: main

android.view.InflateException: Binary XML file line #48: Error inflating class ru.dimorinny.floatingtextbutton.FloatingTextButton

Shape

The shape is not square round but flat square

How to provide text in lowercase?

Now by default the text on the button is in upper case. How to disable that? There should be some way to enter text on lowercase as well.

Icon Side

Hello :)
Is it possible to add the icon on the right side of the text ?
Thank you

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.