Комментарии:
i have having trouble with the custom toast. When i try to create view in line 18, it doesnt allows me to select the root id and there a dash in the view text aswell. i think its probably cause of version or that this method is deprecated. What should i do for this?
Ответитьnice
ОтветитьHey Philipp, I think the layoutInflater has undergone some changes in recent years. The custom toast portion of this video doesn't appear to work anymore if coded in Android today. I'm currently working through the playlist. I expect some hiccups from a 3 year old series... just wanted you to know. Thanks!
Ответитьhi Philipp , why you do not use Relative Layout ?
ОтветитьEven though it looks pretty shitty😂😂😂
ОтветитьMr Poop has the bast name ever
ОтветитьHow are you able to use btnShowToast.setOnClickListener directly without even findiViewById or viewBinding??
Ответитьjust realises that for any given user defined class that takes in `Context` instance as argument to it's constructor, we cannot declare our instance of such classes as property of an AppCompatActivity. Usually we have MainActivity inherits from AppCompatActivity. But then we cannot declare our "user defined"
class as property of MainActivity. Because it contains `Context` object but at this point the `Context` object is still not initialised by the JVM or Android..if we instantiate it inside one of the callback functions(e.g onCreate()) that define the lifetime of our instance and variables than here if we pass this@MainActivity to the "user defined" class's constructor then it will work. If we pass too early we will get `NullPointerException`
Some processes in this video are deprecated. If you want to complete a custom toast, see my code:
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
private var customToastView: View? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
//bind your parent xml layout with view binding
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
//inflate your custom toast xml file
customToastView = layoutInflater.inflate(
R.layout.custom_toast,
findViewById<View>(R.id.csToastContainer) as ViewGroup?
)
binding.btnShowToast.setOnClickListener {
val toast = Toast(this@MainActivity)
toast.duration = Toast.LENGTH_LONG
toast.setGravity(Gravity.BOTTOM, 0, 200)
toast.view = customToastView
toast.show()
}
}
}
Perfect :)
ОтветитьYour videos really helpfull to understand the concepts .Thanku ❤
ОтветитьBro please make videos related to making an app which can connect to Nodemcu WiFi module
ОтветитьWhen I use the word "view" I see it written but crossed out. Does it have a newer version?
ОтветитьAhah! You are German! Eingabe betrayed you.
ОтветитьWhat an excellent tutorial, with excellent hints on HOW to use these methods and techniques without sounding hurried. Thank you for putting in your efforts. You gained a fan!
ОтветитьI like your videos. You are good at explaining things and you are easy to understand. Thanks
Ответитьyou are amazing, thank you
ОтветитьDid you just say Welcome Mr. Poop??? Lmao I wanna work with that guy now lol!!!!
Ответитьsince api 30 setView is deprecated. Is any other easy way to set custom view for toast?
ОтветитьGood ol' Mr. Poop! Another great video, thanks!
ОтветитьCool and clear as usual. Thanks🙏
Ответить@Philipp - > " 'setter for view: View?' is deprecated. Deprecated in Java. "
Any chance in still doing custom toasts with the latest Kotlin implementation?!
Later EDIT:
It seems to be working fine, just throws a warning.
Buen video
Ответитьview is deprecated how can I change that?
ОтветитьThis German accent is much easier on the ear than that of "Coding In Flow"
ОтветитьThank you so much
ОтветитьThe custom toast is deprecated now I think
ОтветитьSuperb
ОтветитьI watch your videos even if I knew how to do that thing because you really teach all the small concepts which helps me to understand them better💯
ОтветитьIt was very helpful , Good work man.
ОтветитьHow to set width of toast match parent?
ОтветитьBest explanation of Context in Android ever!
ОтветитьHey Phillip, I did the same thind as you did but the clToast ID that you gave in the layoutInflater Statement is hilighted as red and showing error: Unresolved reference.
Please can you help me with that
Skip the part when he is making the custom Toast. It is depreciated, and will not work.
ОтветитьThanks man these tutorials are much better than the course i bought
Ответить"Welcome, Mr. Poop!"
ОтветитьWhat would be the commands for the custom Toast in Java?
ОтветитьPlease add subtitle english
ОтветитьHow to toast an error in onError(). I can't get any context.
ОтветитьThank you for this amazing videos!
Ответить:)
ОтветитьHi, I have a problem with the custom toast.
The view variable has a strike line, and the error is : Unresolved reference: inflate
How can I send you a private message please ?
ОтветитьI liked the screen trainsition of "imagine ..." :)
Thanks a lot for your efforts!!!
BOMB!!!
ОтветитьThis is very well done, thank you. I'm disabled and can only spend a limited time staring at a screen, and your explanations are clear enough that I can mostly follow just using audio!
ОтветитьI am George From Egypt
really I wana tell you something .. you are learn the content in very detailed and this is the point for the beginners
you are awesome
good job and you will be something great soon <3