Giter Club home page Giter Club logo

hmos-socialbuttons's Introduction

HMOS SocialButtons

.github/workflows/main.yml Quality Gate Status

Introduction

An HMOS 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.

Source

The code in this repository was inspired from championswimmer/Android-SocialButtons - v1.1. We are very thankful to championswimmer.

Screenshot

screenshot

How to use

Installation

In order to use the library, add the following line to your root gradle file:

I) For using SocialButton module in sample app, include the source code and add the below dependencies in entry/build.gradle to generate hap/support.har.

dependencies {
            implementation project(':socialbuttons')
            implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
            testImplementation 'junit:junit:4.13'
            ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
}

II) For using SocialButton in separate application using har file, add the har file in the entry/libs folder and add the dependencies in entry/build.gradle file.

dependencies {
        implementation fileTree(dir: 'libs', include: ['*.har'])
        testImplementation 'junit:junit:4.12'
}

III) For using SocialButton from a remote repository in separate application, add the below dependencies in entry/build.gradle file.

dependencies {
        implementation 'dev.applibgroup:socialbuttons:1.0.0'
        testImplementation 'junit:junit:4.13'
        ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100'
}

Floating Action Buttons

Usage

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

        <in.championswimmer.libsocialbuttons.SocialFab
                            ohos:height="match_content"
                            ohos:width="match_content"
                            ohos:fab_elevation="4vp"
                            ohos:fab_colorNormal="#345896"
                            ohos:image_src="$media:logo_facebook"/>

Customizations

xml attributes need to set from xml are the following: ohos:fab_elevation="4vp", ohos:fab_colorNormal="#345896" ohos:image_src="$media:logo_facebook" or else will have no effect of FAB.

SocialButton

Usage

For example a Twitter button, use the following in your xml

    <in.championswimmer.libsocialbuttons.SocialButton
                ohos:id="$+id:btn_twitter"
                ohos:height="match_content"
                ohos:width="match_parent"
                ohos:text="$string:login_twitter"
                ohos:text_size="20vp"
                app:msb_social="$string:twitter"/>

Customizations

You have to set your own text using the ohos:text="$string:login_twitter" attribute. Where login_twitter has value Login with twitter. You have to set app:msb_social="$string:twitter" in order set background color for twitter and twitter icon

Credits

Support and extension

Currently there is a limitation to

i) set image source and background color from library end. So, app developer has to set through xml for SocialFab as shown below: ohos:fab_colorNormal="#345896" ohos:image_src="$media:logo_facebook"

ii) and library dependency is there to set height and width for SocialFab

License

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

hmos-socialbuttons's People

Watchers

 avatar

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.