Share all the things!

Overview

Android-ShareEverywhere

This project is the tribute to my favorite Android Widget: the Share button. Share ALL THE THINGS!

screenshot

Summary

You may know about the ShareActionProvider that was introduced in API 14. This project extends the ShareActionProvider in a few very important ways:

  1. It breaks the Widget free of the ActionBar. It can be used as a standalone View in any layout.
  2. It allows you to specify multiple share intents, which will be combined when displayed.
  3. Its default sorting function also uses alphabetical order.
  4. It can be used (with ActionBarSherlock) on versions of android prior to API 14.

Usage

As a View

Using this view in a layout is simple:

<com.dgmltn.shareeverywhere.ShareView
    android:id="@+id/share_view"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

Then give it an intent (or multiple intents) in your Activity or Fragment:

    ShareView shareView = (ShareView) findViewById(R.id.share_view);
    shareView.setShareIntent(emailIntent, txtIntent);

In the ActionBar

Its use in the actionbar is the same as http://developer.android.com/reference/android/widget/ShareActionProvider.html

In your menu.xml:

<item
    android:id="@+id/action_share"
    android:actionProviderClass="com.dgmltn.shareeverywhere.ShareActionProvider"
    android:showAsAction="always"
    android:title="Share" />

Then in your Activity/Fragment:

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);

        MenuItem item = menu.findItem(R.id.action_share);
        ShareActionProvider shareActionProvider 
            = (ShareActionProvider) item.getActionProvider();
        shareActionProvider.setShareIntent(mSharedIntents);
        return true;
    }

Style

ShareEverywhere is quite styleable, most things that may want to be styled, can. Set this in your theme.xml:

<style name="AppTheme">
    ...
    <item name="shareViewStyle">@style/Widget.ShareView.Dark</item>
</style>

Or, style your view explicitly:

<com.dgmltn.shareeverywhere.ShareView
    style="@style/Widget.ShareView.Light"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />

Create your own style. Styleable elements can be found in res/values/styles.xml.

<style name="Widget.ShareView.Custom" parent="Widget.ShareView">
    <item name="sv_buttonDrawable">@drawable/my_share_button</item>
    <item name="sv_buttonBackground">@drawable/my_list_selector</item>
    <item name="sv_popupTextColor">#f3f3f3</item>
</style>

Obtaining

Include in your android project from jcenter, using Gradle:

compile 'com.dgmltn:share-everywhere:1.0.1'

Requirements

License

Copyright 2013 Doug Melton

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...
This is a repository for implementing Brontodroid and test it easily before we finalize things into a library/module to be consumed separately.

Bronto Playground This is a repository for implementing Brontodroid and test it easily before we finalize things into a library/module to be consumed

Modern GTD(Get Things Done) Android App
Modern GTD(Get Things Done) Android App

Neo Flow A modern GTD Android App to improve your workflow Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Pro

TwitchControlsMinecraft - A mod that lets your twitch chat let things happen in your game on a specific event

Twitch Controls Minecraft A mod that lets your Twitch chat lets your twitch chat

A Mindustry v7 mod provides lots of cybernetic things
A Mindustry v7 mod provides lots of cybernetic things

Cyber IO A Mindustry v7 mod provides lots of cybernetic things!!! How To Play The official website of Cyber IO is liplum.github.io/CyberIO

A first-person shooter game where the only things you'll hear are your own thoughts.

Bloody Silence This is a shooter unlike any you have ever played. There is no sound whatsoever, so you will need to use your eyesight to find indicato

Candroid does things different. The Candroid app store is a library of APK client wrappers (F-Droid, APKPure, etc.) For the main Candroid app store, try visiting the Candroid Market.
Candroid does things different. The Candroid app store is a library of APK client wrappers (F-Droid, APKPure, etc.) For the main Candroid app store, try visiting the Candroid Market.

Candroid App Store Candroid does things different. The Candroid app store is a library of APK client wrappers (F-Droid, APKPure, etc.) For the main Ca

CovidTracker traces all the covid-19 cases all over the world.
CovidTracker traces all the covid-19 cases all over the world.

CovidTracker Crona Tracker trace india covid-19 cases upto district level and can trace other countries cases too. It can also traces user's current l

Purpose for this base architectural project is to load it with all latest components and libraries So it become reference for all kind of Android projects

The purpose of this base architectural project is to load it with all the latest components and libraries, So it becomes a reference for all kinds of Android projects

Android Ptrace Inject for all ABIs and all APIs. Help you inject Shared Library on Android.

Android Ptrace Inject 中文可以参考我的注释内容进行理解 我写的注释相对来说比较全面了 How to build Make sure you have CMake and Ninja in your PATH Edit CMakeLists.txt. Set ANDROID_ND

Android application to slice and share your pictures
Android application to slice and share your pictures

Piclice A practical tool which helps users to slice and share their pictures. Features Displaying all pictures of system Gallery Slicing and resizing

Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app! :sun_with_face:
Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app! :sun_with_face:

Anakin Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app! Descript

Library to save image locally and shows options to open and share !

Image Save and Share Library to save image locally and shows options to open and share ! Download Demo APK from HERE Kindly use the following links to

A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation codes like Share, Contacts, Email and etc, which you can easily use.

Android-Intent-Library A library which will save you a lot of time from writing the same intent creation code. it consist of many intent creation code

It's a flip way to show share widget.
It's a flip way to show share widget.

What's FlipShare ? It's a cool way to show share widget. Demo Usage step 1. Confirm your parentView to locate the share widget, and then you can custo

Quick Text is about send the message on WhatsApp without saving number. You can see the status of other and share and download those status also.
Quick Text is about send the message on WhatsApp without saving number. You can see the status of other and share and download those status also.

Quick Text is about send the message on WhatsApp without saving number. You can see the status of other and share and download those status also.

This a Ride User app in which in integrate almost every features of a Ride Share app.
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

An Online Meme Sharing app with swipeable vidoes, user can like, share different videos, each viewpager item has one video to show.
An Online Meme Sharing app with swipeable vidoes, user can like, share different videos, each viewpager item has one video to show.

MemesSharing An Online Meme Sharing app with swipeable vidoes, user can like, share different videos, each viewpager item has one video to show. 1. Fl

An app for random Reddit memes with the option to share it as well!

Meme Share App What - An app for random Reddit memes with the option to share it as well! Why - Wanted to learn about integrating APIs with Android ap

Share MPS code snippets. More than just screenshots.

skadi gist Share MPS code snippets. More than just screenshots. Repository Content ide-plugin: MPS Plugin that creates a gist from the IDE written in

Comments
  • Use .getDrawable instead of .getResourceId

    Use .getDrawable instead of .getResourceId

    These should be using .getDrawable():

    https://github.com/dgmltn/Android-ShareEverywhere/blob/master/share-everywhere/src/com/dgmltn/shareeverywhere/ShareView.java#L260

    support lib 23.1.0 breaks on .setImageResource(0) a few lines down.

    opened by dgmltn 0
Owner
Doug Melton
Doug Melton
Connect UPG is an app that enables students to interact and share their thoughts, emotions, feeling as things

Connect UPG is an app that enables students to interact and share their thoughts, emotions, feeling as things

Krish Parekh 7 Jan 18, 2022
Clippy - Android app that adds a "Copy to clipboard" share target to android share sheet (Especially for MIUI)

Clippy Android app that adds a "Copy to clipboard" share target to android share sheet MIUI 11 and 12 lack a "Copy to clipboard" option in the system

kriticalflare 2 Jan 3, 2022
Android Navigation Fragment Share Element Example: Use Share Element Transition with recyclerView Item and ViewPager2 Item.

Android-Navigation-Fragment-Share-Element-Example 说明 Android 使用Navigation导航切换Fragment中使用共享元素过渡动画的例子:将在listFragment的RecyclerView的Item共享元素过渡到pagerFragme

null 3 Sep 28, 2022
All things generative! Discord Bot

Thingy Discord bot to generate images based on a text prompt - way more than just that! Through a wide variety of tools, you can alter your generated

Peter Willemsen 17 Dec 15, 2022
Simple Progress View that you can compare things, like statistics of a Football match

Simple Progress View that you can compare things, like statistics of a Football match

Kostas Antoniou 29 Jun 8, 2022
This is an example repository to demonstrate the good practices of using ViewModel and how usage of AndroidViewModel can make things worst in a codebase

ViewModel Good Practices ??‍♂️ This is a example repository to demonstrate the good practices of using ViewModel and how usage of AndroidViewModel can

Shreyas Patil 29 Sep 28, 2022
Compose app with dummy data which serves as a playground to try out new things in the Android world.

Music Event Manager Compose app with dummy data which serves as a playground to try out new things in the Android world. Description The app primarily

Igor Tepavac 4 Apr 4, 2022
Actions are things that run, with parameters. Serves as a common dependency for a variety of Cepi extensions.

Actions Actions that take in customizable paramaters, an optional target, and do things. Installation Download the jar from Releases OR compile it you

Cepi 1 Jan 9, 2022