spikeysanju / motiontoast Goto Github PK
View Code? Open in Web Editor NEW๐ A Beautiful Motion Toast Library for Kotlin Android
๐ A Beautiful Motion Toast Library for Kotlin Android
Can we customise colors? These colors aren't our brand colors therefore we cant use this library if we can't change them.
How to set custom Toast Duration, example 10 sec
Motion Toast (createToast) "Warning, Info and Delete " does not contain the message parameter thus when copied to android studio it causes error(Type Mismatch)
MotionToast.createToast(this,"Please fill all the details!",
MotionToastStyle.WARNING,
MotionToast.GRAVITY_BOTTOM,
MotionToast.LONG_DURATION,
ResourcesCompat.getFont(this,R.font.helvetica_regular))
Hi, When I build the project using the Motion Toast imports in project and app gradle files, the compiler gives me the following error ->
Execution failed for task ':app:checkDebugDuplicateClasses'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Could not find com.github.Spikeysanju:MotionToast:1.4.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/Spikeysanju/MotionToast/1.4/MotionToast-1.4.pom
- https://repo.maven.apache.org/maven2/com/github/Spikeysanju/MotionToast/1.4/MotionToast-1.4.pom
- https://jcenter.bintray.com/com/github/Spikeysanju/MotionToast/1.4/MotionToast-1.4.pom
Required by:
project :app
Here's a copy of the gradle
Motion toast runs fine on Activities, but on fragments the context should be passed as activity (If there's a way to run it on a fragment do tell me ). Please fix it.
Fatal Exception: java.lang.NullPointerException: Can't toast on a thread that has not called Looper.prepare()
at com.android.internal.util.Preconditions.checkNotNull(Preconditions.java:157)
at android.widget.Toast.getLooper(Toast.java:179)
at android.widget.Toast.(Toast.java:164)
at android.widget.Toast.(Toast.java:154)
at www.sanju.motiontoast.MotionToast$Companion.darkColorToast(MotionToast.kt:978)
at com.aryomtech.dhitifoundation.public_notes.create_announcement$3.run(create_announcement.java:653)
at java.util.TimerThread.mainLoop(Timer.java:562)
at java.util.TimerThread.run(Timer.java:512)
on android 9 doesn't showing but trying on android 7,8,10,11 is no problem
Hi, there is issue in description text of toast. It shows only text in 2 lines and longer text not showing completely.
I noticed that you have set android:maxLines="2"
to android:id="@+id/custom_toast_description"
TextView in motion_toast.xml file.
Can you please make height of TextView open or increase maxLines.
Thanks
Some functions are not available in Java because @JvmStatic is not added above the function declarations.
Hello, after I updated to 1.3.3.2 all the imports are broken and the Studio can't seem to find anything to import.
I think you haven't added them to any repo.
I did:
But did not work...
I have already added maven { url 'https://jitpack.io' }
to all repos in my root level build.gradle file but still not works...
verion 1.3.3.1 works fine.
if (checkConnect()) {
//toast(getString(R.string.no_internet_connection))
MotionToast.createToast(this,"This is information toast!",
MotionToast.TOAST_INFO,
MotionToast.GRAVITY_BOTTOM,
MotionToast.LONG_DURATION,
ResourcesCompat.getFont(this,R.font.helvetica_regular))
}
Sometimes opens many times in a row..... I dont undrstnd
When I choose gravity top it automatically gets sticks to the top left side. and while I use the centre property it gets stuck to the right side.
I am converting this kotlin toast into java and using it in activity. Here it works perfectly but when I tried to use it in a service the first argument of the MotionToast shows error as it doesn't accept 'this' as an argument. Hint is showed that it requires android.app.Activity as a first argument. It will be a pleasure to me and you if you solve this problem.
As far as I understood, the title of the toast determined by the toast type, such as TOAST_ERROR, TOAST_WARNING etc.
Is there any way to custom assign the title text for language support except english.
I am using your library in java language instead of kotlin. But I tried everything to use in the constructor of motion toast the first argument shows an error. I tried this, service_name.this, getapplicationcontext(). Then you said use service name.this.getapplicationcontext() but that also didn't worked. Solve this problem please. Thank You
The goal of this issue is to migrate Motion Toast to use View Binding
.
I tried to call the Toast from Fragment, on the Click of a Button. The Main Layout was MotionLayout if that helps.
On the button press, the toast is either delayed or never appears. Initially, I repeatedly pressed the button to trigger the Toast but the app crashed with the Exception stated below.
2020-08-19 18:47:29.961 6627-6627/ E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.omega.cart, PID: 6627
java.lang.IllegalStateException: View android.widget.RelativeLayout{6e6c3c3 V.E...... ......I. 0,0-0,0 #7f0a00b2 app:id/color_toast_view} has already been added to the window manager.
at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:328)
at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:94)
at android.widget.Toast$TN.handleShow(Toast.java:499)
at android.widget.Toast$TN$1.handleMessage(Toast.java:403)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
--
( E/Toast: setGravity() shouldn't be called on text toasts, the values won't be used) Why is this error coming?
LONG DRATION not working,..
as well custom duration not working...
It is a normal floating service. First argument of Toast shows an error when I enter this,service_name.this,getapplicationcontext(),service_name.this.getapplicationcontext(). Nothing works. Please give a solution of this problem.
Kindly update jitpack with the latest version. I can only download till 1.3.2
Java Implementation Examples are needed.......... Many devs prefer Java
I am unable to change the background color.
Please support RTL for the rest of us.
Thank you very much for this awesome lib!
Could you take the title of the toast as a parameter? The hardcoded strings make it impossible to customize or localize. Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.