Android SocialButtons

Additional

Language
Java
Version
1.1 (Apr 3, 2016)
Created
Oct 31, 2015
Updated
Jul 2, 2018 (Retired)
Owner
Arnav Gupta (championswimmer)
Contributors
Arnav Gupta (championswimmer)
Magomed Khalimbekov (Gundabadec)
Alperen Kantarcı (Alpkant)
3
Activity
Badge
Generate
Download
Source code

Advertisement

Android SocialButtons

An android library for implementing login/share buttons easily for social networks.

As of now, this is only a UI library. This library does not provide any social network functionality. That you have to code yourself.

Screenshots

How to use

Include the library

You can either download the source or add to gradle via jitpack.io Add jitpack to your dependencies (in the main project folder) -

 repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }

And include the library in your dependencies (in app folder)

 dependencies {
        compile 'in.championswimmer:Android-SocialButtons:1.3'
    }

Floating Action Buttons

Usage

To use FloatingActionButtons, (for example a Facebook button), use the FABFacebook component

        <in.championswimmer.libsocialbuttons.fabs.FABSocial
            xmlns:app="http://schemas.android.com/apk/res-auto"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_margin="7dp"
            app:social="facebook"
             />

Customizations

Other than the color and the icon, everything else can be changed using the usual xml attributes. android:src, android:backgroundTint will have no effect even if you set them in your layout xml.

Buttons

Usage

Usual Button is also available. To use, for example a Twitter button, use the following in your xml

    <in.championswimmer.libsocialbuttons.buttons.BtnSocial
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:text="Follow on Twitter"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:social="twitter"
         />

Customizations

You have to set your own text using the android:text attribute. While the Button has it's own style predefined, you can still override the following via xml attributes -

  • android:textAllCaps (Default: false)
  • android:font-family and android:textStyle (Default: sans-serif-ligt normal)
  • android:textSize (Default: 24sp)
  • android:padding (Default: 15dp)
  • android:drawablePadding (Default: 15dp)

You cannot set android:drawableLeft and the other Right, Top, Bottom drawbles.

NOTE: If you chose to you can set no text, and you'll just get a square button with a social icon in it

Credits

License

This software is licensed under the Apache License V2.0 A copy can be found here