Giter VIP home page Giter VIP logo

intentshare's People

Contributors

tbarthel-fr avatar vbarthel-fr 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

intentshare's Issues

IndexOutOfBoundsException when using back button

Hey there,

first thanks for creating this libary! Sharing is by far not that easy on Android as it should, so IntentShare comes in very handy.

Now to my issue: Selecting an app to share to from the TargetChooserActivity works as expected. But going back to my app using Android's back button or application switcher causes a crash of my app with the following stacktrace:

java.lang.IndexOutOfBoundsException: Inconsistency detected. Invalid item position 0(offset:2).state:2 at android.support.v7.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:5427) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5363) at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5359) at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2141) at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1525) at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1488) at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:585) at android.support.v7.widget.RecyclerView.dispatchLayoutStep1(RecyclerView.java:3457) at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:3252) at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3767) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.widget.ScrollView.onLayout(ScrollView.java:1528) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1193) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.support.v7.widget.ActionBarOverlayLayout.onLayout(ActionBarOverlayLayout.java:437) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586) at android.widget.LinearLayout.onLayout(LinearLayout.java:1495) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678) at android.view.View.layout(View.java:16646) at android.view.ViewGroup.layout(ViewGroup.java:5440) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2183) at android.view.ViewRootImpl.performTraver

For me it seems that the RecyclerView in TargetChooserActivity is causing the issue as I don't have one in my layout of my activity.

Looking forward to a fix - keep up the good work!

Some application are not showing

I tried to implement in my project, but when share, some applications are not showing (empty icon), and if I try to share on this "empty icon" applications, I get a toast error from the application or it just do nothing...
The sample application on google play has the same problem...

Eg: I cannot share to Whatsapp -> https://imgur.com/HhLJIGr

Can't share image

Hello, I am a Chinese developer, I found that can only share text, pictures can not be shared when I share to Sina weibo(com.sina.weibo)/Tencent QQ(com.tencent.mobileqq)/WeChat(com.tencent.mm) with IntentShare,please help me!

Twitter post character limit

Hello,

Actually there is a limit exception in IntentShare class.

According to Twitter : https://blog.twitter.com/2016/doing-more-with-140-characters (section "Tweet object changes")

"...Developers must avoid hard-coding length assumptions into their applications."

I think it's better that we remove the following Exception in IntentShare :

if (tweet.length() > 140) {
            throw new IllegalArgumentException("Invalid tweet content : "
                    + "exceed the 140-Character limit : " + tweet);
}

We could not know if Twitter API will be changed in other ways so let Twitter application manages the sharing text.

What do you think?

Thanks.

com.android.mms and FileProvider

The target app com.android.mms crashes when an image is send as stream in the shared extras due to orientation check.

As the Uri has a content provider scheme, the com.android.mms skips the Exif check (which seems to be slow) and tries to query the MediaStore.Images.ImageColumns.ORIENTATION :
http://androidxref.com/5.1.1_r6/xref/packages/apps/Mms/src/com/android/mms/ui/UriImage.java#546

Unfortunately, the default implementation of FileProvider from support-v4 won't return any data for such a query since only OpenableColumns.DISPLAY_NAME and OpenableColumns.SIZE are taken into account :
http://androidxref.com/5.1.1_r6/xref/frameworks/support/v4/java/android/support/v4/content/FileProvider.java#421

As a result, http://androidxref.com/5.1.1_r6/xref/packages/apps/Mms/src/com/android/mms/ui/UriImage.java#546 will throw an exception.

FileProvider myst be extend in order to handle MediaStore.Images.ImageColumns.ORIENTATION query on our side.

how to change the bitmap URI code to content scheme?

        Picasso.with(getActivity()).load(cardata.getImage()).into(new Target() {
                                @Override public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
//                                    Intent i = new Intent(Intent.ACTION_SEND);
//                                    i.setType("image/*");
//                                    i.putExtra(Intent.EXTRA_STREAM, getLocalBitmapUri(bitmap));
//                                    startActivity(Intent.createChooser(i, "Share Image"));

                                    IntentShare.with(getActivity())
                                            .chooserTitle("Share ")
                                            .text("test")
                                            .image(getLocalBitmapUri(bitmap))
                                            .mailSubject("Test")
                                            .mailBody("Test")
                                            .deliver();
                                }
                                @Override public void onBitmapFailed(Drawable errorDrawable) { }
                                @Override public void onPrepareLoad(Drawable placeHolderDrawable) { }
                            });

    public Uri getLocalBitmapUri(Bitmap bmp) {
        Uri bmpUri = null;
        try {
            File file = new File(getActivity().getExternalFilesDir(Environment.DIRECTORY_PICTURES), "share_image_" + System.currentTimeMillis() + ".png");
            FileOutputStream out = new FileOutputStream(file);
            bmp.compress(Bitmap.CompressFormat.PNG, 90, out);
            out.close();
            bmpUri = Uri.fromFile(file);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return bmpUri;
    }

Custom prefix for resources

Use a custom prefix (like "icl_") for all the resources of the Intent Share Library to avoid conflict with resources of client projects.

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.