It's a flip way to show share widget.

Related tags

UI/UX FlipShare
Overview

What's FlipShare ?

It's a cool way to show share widget.

Demo

Markdown

Usage

step 1. Confirm your parentView to locate the share widget, and then you can custom by yourself.

FlipShareView share = new FlipShareView.Builder(this, mBtnLeftTop)
                        .addItem(new ShareItem("Facebook", Color.WHITE, 0xff43549C, BitmapFactory.decodeResource(getResources(), R.mipmap.ic_facebook)))
                        .addItem(new ShareItem("Twitter", Color.WHITE, 0xff4999F0, BitmapFactory.decodeResource(getResources(), R.mipmap.ic_twitter)))
                        .addItem(new ShareItem("Google+", Color.WHITE, 0xffD9392D, BitmapFactory.decodeResource(getResources(), R.mipmap.ic_google)))
                        .addItem(new ShareItem("http://www.wangyuwei.me", Color.WHITE, 0xff57708A))
                        .setBackgroundColor(0x60000000)
                        .setItemDuration(500)
                        .setSeparateLineColor(0x30000000)
                        .setAnimType(FlipShareView.TYPE_SLIDE)
                        .create();

step 2. Recognize some custom Attributes.

Animation type

@IntDef(flag = true, value = {TYPE_VERTICLE, TYPE_HORIZONTAL, TYPE_SLIDE})
    public @interface AnimType {
}
   

Builder

public Builder addItem(ShareItem shareItem) {
    mShareItemList.add(shareItem);
    return this;
}

public Builder addItems(List<ShareItem> list) {
    mShareItemList.addAll(list);
    return this;
}

public Builder setItemDuration(int mils) {
    mMilliSecond = mils;
    return this;
}

public Builder setAnimType(@AnimType int animType) {
    mAnimType = animType;
    return this;
}

public Builder setBackgroundColor(int color) {
    mBgColor = color;
    return this;
}

public Builder setSeparateLineColor(int color) {
    mSeparateLineColor = color;
    return this;
}

step 3. Add OnFlipClickListener to get some callback.

share.setOnFlipClickListener(new FlipShareView.OnFlipClickListener() {
    @Override
    public void onItemClick(int position) {
        Toast.makeText(MainActivity.this, "position " + position + " is clicked.", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void dismiss() {
    }
});

Import

Step 1. Add it in your project's build.gradle at the end of repositories:

repositories {
    maven {
        url 'https://dl.bintray.com/wangyuwei/maven'
    }
}

Step 2. Add the dependency:

dependencies {
  compile 'me.wangyuwei:FlipShare:1.0.2'
}

About Me

Weibo

Blog

QQ Group 欢迎讨论

479729938

##License

Copyright [2016] [JeasonWong of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You might also like...
Android Widget
Android Widget

Circular Counter Circular Counter is an Android Widget I needed to implement for an application I was developing. As it could be useful to more people

A Pin view widget for Android
A Pin view widget for Android

PinView A Pin view widget for Android. PinView has a feature that allows you to find out when they have completed all parameters. Support for Android

This is a sample Android Studio project that shows the necessary code to create a note list widget, And it's an implementation of a lesson on the Pluralsight platform, but with some code improvements
This is a sample Android Studio project that shows the necessary code to create a note list widget, And it's an implementation of a lesson on the Pluralsight platform, but with some code improvements

NoteKeeper-Custom-Widgets This is a sample Android Studio project that shows the necessary code to create a note list widget, And it's an implementati

TabSlider - An expanding slider widget which displays selected value
TabSlider - An expanding slider widget which displays selected value

TabSlider - An expanding slider widget which displays selected value

Show triangle view.
Show triangle view.

TriangleLabelView Show triangle view. How to Use To see how the TriangleLabelView are added to your xml layouts, check the sample project. jp.shts.an

ExpandableSelector is an Android library created to show a list of Button/ImageButton widgets inside a animated container which can be collapsed or expanded.
ExpandableSelector is an Android library created to show a list of Button/ImageButton widgets inside a animated container which can be collapsed or expanded.

ExpandableSelector ExpandableSelector is an Android library created to show a list of Button/ImageButton widgets inside a animated container which can

A view to show bling bling stars when you touch it.
A view to show bling bling stars when you touch it.

AndroidGlitterView A view to show bling bling stars when you touch it. Demo Dependency compile('com.liangfeizc:glitterview:1.0.0@aar') Attributes name

FogView is a android library that can show fog on any layout and the fog removes when user rubs it.
FogView is a android library that can show fog on any layout and the fog removes when user rubs it.

Fog View Android Library Min SDK 8 (Android 2.2–2.2.3 Froyo) Screnshots How to use If you want use this library, you can download project and import i

WindView is an Android Library to show Weather's Wind & pressure Status
WindView is an Android Library to show Weather's Wind & pressure Status

WindView WindView is an Android Library to show Weather's Wind & pressure Status Screenshot Demo demo.apk Setup Step 1: Add it as a Dependency in Your

Owner
巴掌
巴掌
An elegant way to show your menu or messages.

Android View Hover In my opinion, jumping to a new activity to show your menu is a kind of wasting time and life. So, I think, we need a hover view, t

代码家 3.2k Jan 2, 2023
This a Ride User app in which in integrate almost every features of a Ride Share app.

My-Ride-App This a Ride app(User) in which I integrate almost every features of a Ride Share app. Here I use kotlin programing language, Google map SD

Khairul Islam 5 Apr 27, 2022
Android View that displays different content based on its state

MultiStateView Android View that displays different content based on its state. Based off of MeetMe/MultiStateView The four different states the view

Kenny 1.2k Dec 16, 2022
Android widget for selecting a range of values.

RangeBar The RangeBar is similar to an enhanced SeekBar widget, though it doesn't make use of the SeekBar. It provides for the selection of a range of

Edmodo 715 Nov 14, 2022
An Android Widget for selecting items that rotate on a wheel.

Looking for maintainers I'm no longer active on this project but I'll still focus on fixing crashing issues and review any code changes etc. WheelView

Luke Deighton 888 Jan 3, 2023
segmentcontrol widget for android

中文 a simple SegmentControl Widget 使用: 添加依赖到build.gradle: dependencies { compile 'com.7heaven.widgets:segmentcontrol:1.17' } 相关属性: selectedColor 设置

7heaven 614 Nov 26, 2022
A library that provides an implementation of the banner widget from the Material design.

MaterialBanner A banner displays a prominent message and related optional actions. MaterialBanner is a library that provides an implementation of the

Sergey Ivanov 252 Nov 18, 2022
Android Thermometer Widget.

Thermometer Android Thermometer Widget. Developer Kofi Gyan ([email protected]) License Copyright 2016 Kofi Gyan. Licensed under the Apache Licen

Kofi Gyan 125 Nov 17, 2022
Custom wheel widget for android

Wheel widget for Android To include the wheel widget in the current layout, you should add in the layout xml this lines: <it.sephiroth.android

Alessandro Crugnola 384 Nov 21, 2022