Git Product home page Git Product logo

Comments (17)

tranb3r avatar tranb3r commented on August 18, 2024 1

The crash occurs whatever color you specify.
Again, a quick workaround to prevent the crash would be to skip color assignments on android 11.
Let me know if you need some help with the PR.

from toast.

sunkerGit avatar sunkerGit commented on August 18, 2024 1

GWS @ishrakland :D

from toast.

tranb3r avatar tranb3r commented on August 18, 2024

https://stackoverflow.com/questions/62884286/toast-getview-returns-null-on-android-11-api-30

from toast.

tranb3r avatar tranb3r commented on August 18, 2024

My suggestion if you do not have the time to work on a full fix, would be to skip colors assignments on android 11, which would avoid the crash.
I can do the PR if you want.

from toast.

ishrakland avatar ishrakland commented on August 18, 2024

Hello , @tranb3r i will fix it as soon as possible. Thank you for your help.

from toast.

tranb3r avatar tranb3r commented on August 18, 2024

@ishrakland Any update ? A quick fix to prevent the crash by ignoring colors would be good enough...

from toast.

ishrakland avatar ishrakland commented on August 18, 2024

try custom toast you can specify the color you want. I will fix it : i have a lot of charge.

from toast.

jpveldtman avatar jpveldtman commented on August 18, 2024

Experiencing the same issue

from toast.

tranb3r avatar tranb3r commented on August 18, 2024

@ishrakland I understand you may not have the time to work on this issue. Do you think you can provide a fix, or at least merge a quick fix to prevent the crash if I do the PR ?
I really like this plugin, but considering the impact of this issue, I'm thinking about moving to xamarin-community-toolkit which also has a toast functionnality.

from toast.

douglassimaodev avatar douglassimaodev commented on August 18, 2024

Same problem here.... and based on the time it got reported.. I assume it won't get fix soon

from toast.

ishrakland avatar ishrakland commented on August 18, 2024

from toast.

ishrakland avatar ishrakland commented on August 18, 2024

It's free plugin, opensource and i don't get money from it . it's open for all users to contribute.

from toast.

tranb3r avatar tranb3r commented on August 18, 2024

Maintaining this kind of plugin is too big a challenge for the long-term, and the xamarin community toolkit already has a toast functionality.
I think you should consider merging your code into their repo if you think you can provide additional features.

from toast.

ishrakland avatar ishrakland commented on August 18, 2024

@tranb3r Yes, thank you

from toast.

tranb3r avatar tranb3r commented on August 18, 2024

Did you find any solution @tranb3r

Yes, I'm using xamarin community toolkit now, instead of this plugin.

from toast.

iane87 avatar iane87 commented on August 18, 2024

I'm thinking that the following changes in ShowToastPopUp.cs in Android should fix it

private void ShowMessage(string message, string backgroundHexColor = null, string textHexColor = null, Abstractions.ToastLength toastLength = Abstractions.ToastLength.Short)
        {
            var length = toastLength == Abstractions.ToastLength.Short ? Android.Widget.ToastLength.Short :  Android.Widget.ToastLength.Long;
            // To dismiss existing toast, otherwise, the screen will be populated with it if the user do so
            _instance?.Cancel();
            _instance = Android.Widget.Toast.MakeText(Android.App.Application.Context, message, length);
            if (Xamarin.Essentials.DeviceInfo.Version.Major <= 10)
            {
                View tView = _instance.View;
                if (!string.IsNullOrEmpty(backgroundHexColor))
                    tView.Background.SetColorFilter(Color.ParseColor(backgroundHexColor), PorterDuff.Mode.SrcIn);//Gets the actual oval background of the Toast then sets the color filter

                TextView text = (TextView)tView.FindViewById(Android.Resource.Id.Message);
                if (!string.IsNullOrEmpty(textHexColor))
                    text.SetTextColor(Color.ParseColor(textHexColor));
                
            }
            _instance.Show();
        }

from toast.

aproko234 avatar aproko234 commented on August 18, 2024

Hi.

This issue is still repeating in Android 11.

When are you coming out with the updated plugin.toast to handle this issue?

Thanks.

from toast.

Related Issues (19)

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.