Giter Club home page Giter Club logo

android-socialbuttons's Introduction

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.

Paypal Donate

Build Status Release Android Arsenal

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

android-socialbuttons's People

Contributors

alpkant avatar championswimmer avatar gundabadec 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-socialbuttons's Issues

Can't show entire the shadow and cannot be edited.

At first, thank you for this nice library.

My problem is, I want to add some social buttons inside the horizontal linear layout. After adding, the buttons' shadow seems like cutten, like this;

screenshot_2017-08-24-20-04-04

I am trying to add spaces bottom of the buttons but I could't achive this.
I added margin, padding to each button, liner layout and scrollview orderly. But I could't fix it.
Also I can not disable the shadows. So, the shadow attribute should be added and the view size should be edited according to shadow size.

Thank you.

New Google+ icon

Google plus icon has changed. Can you do update? Thank you :)

Error: Failed to resolve

gradle Error:(49, 13) Failed to resolve: in.championswimmer:Android-SocialButtons:1.2
Added maven repo in project root also

Files not actually inside the dependecy


04-22 14:31:03.966 5487-5487/it.unito.lamba.projector E/AndroidRuntime: FATAL EXCEPTION: main
    Process: it.unito.lamba.projector, PID: 5487
    java.lang.RuntimeException: Unable to start activity ComponentInfo{it.unito.lamba.projector/it.unito.lamba.projector.LoginActivity}: android.view.InflateException: Binary XML file line #118: Binary XML file line #118: Error inflating class in.championswimmer.libsocialbuttons.buttons.BtnSocial
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2892)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3027)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:101)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:73)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1786)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
     Caused by: android.view.InflateException: Binary XML file line #118: Binary XML file line #118: Error inflating class in.championswimmer.libsocialbuttons.buttons.BtnSocial
     Caused by: android.view.InflateException: Binary XML file line #118: Error inflating class in.championswimmer.libsocialbuttons.buttons.BtnSocial
     Caused by: java.lang.ClassNotFoundException: Didn't find class "in.championswimmer.libsocialbuttons.buttons.BtnSocial" on path: DexPathList[[zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/base.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_dependencies_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_resources_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_0_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_1_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_2_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_3_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_4_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_5_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_6_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_7_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_8_apk.apk", zip file "/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/lib/x86, /system/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at android.view.LayoutInflater.createView(LayoutInflater.java:606)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
04-22 14:31:03.969 5487-5487/it.unito.lamba.projector E/AndroidRuntime:     at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
        at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
        at it.unito.lamba.projector.LoginActivity.onCreate(LoginActivity.kt:40)
        at android.app.Activity.performCreate(Activity.java:7117)
        at android.app.Activity.performCreate(Activity.java:7108)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1262)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2867)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3027)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:101)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:73)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1786)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
    	Suppressed: java.io.IOException: No original dex files found for dex location /data/app/it.unito.lamba.projector-BxNwJ2lMy-VoD5atSXRZpw==/split_lib_resources_apk.apk
        at dalvik.system.DexFile.openDexFileNative(Native Method)
        at dalvik.system.DexFile.openDexFile(DexFile.java:356)
        at dalvik.system.DexFile.<init>(DexFile.java:103)
        at dalvik.system.DexFile.<init>(DexFile.java:77)
        at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
        at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
        at dalvik.system.DexPathList.<init>(DexPathList.java:157)
        at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
        at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
        at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
        at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
        at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:72)
        at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:38)
        at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:713)
        at android.app.LoadedApk.getClassLoader(LoadedApk.java:747)
        at android.app.LoadedApk.getResources(LoadedApk.java:969)
        at android.app.ContextImpl.createAppContext(ContextImpl.java:2298)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5754)
        at android.app.ActivityThread.access$1100(ActivityThread.java:193)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1623)
        		... 6 more

Refactor the package name for easy access?

As of now, to access the library you need to type in the whole path to the view (which is quite annoying if using the library at multiple places)

in.championswimmer.libsocialbuttons.fabs.FABFacebook

I suggest refactoring this to

lib.social.fab.facebook

Not a deal breaker but could be a nice tweak.

Let me know if you want a pull request. ๐Ÿ‘

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.