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
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!
@@brian_clips its not a problem. One can still use it for now. There must be some new implementation of it that must be getting recommended although im not entirely sure.
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!
This Series is based in 2020 and yes some things are not relevant in 2023, Try following his "Android Basics 2023" hope you will find the latest tools in that playlist!
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?
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
Did you import kotlinx.android.Synthetic.* (or something like that)? If not, then probably you're getting the error because this kotlinx plugin's feature has been deprecated for a while now, if you want to reference your viewID you can either get it with findViewById (Which I'd not recommend, probably only for some rare cases) or ViewBinding which is a feature from the AndroidX Jetpack library that I recommend.
@@trevorPhillips284 you have to use viewbinding, since synthetics are deprecated, and you already have ActivityMainBinding for the main activity xml you have to setup another one for custom toast, import ......CustomToastBinding, then in class MainActivity declare private lateinit var binding1 (or smth else since binding is already taken) : CustomToastBinding then use binding1.clToast in the inflater ...
friend your videos are marvellous, maybe you settled your language for german because, i can read english but i cannot listen and when i use the subtitles youtube offer me german translation,
@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.
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(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() } } }
To me using findViewById does not look like a natural solution. This is what I would suggest. class MainActivity : AppCompatActivity() { private lateinit var binding: ActivityMainBinding override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding = ActivityMainBinding.inflate(layoutInflater) setContentView(binding.root) binding.btnShowToast.setOnClickListener { Toast(this).apply { duration = Toast.LENGTH_LONG view = CustomToastBinding.inflate(layoutInflater).root show() } } } }
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!
Wow thanks, that is a compliment, keep going! 🙏
Lol me too - I can follow by just listening
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
Thank you man that's a great feedback ❤️
@@PhilippLackner you deserve it
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💯
Best explanation of Context in Android ever!
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!
Thanks man these tutorials are much better than the course i bought
Great video. None of the other videos i've seen mentioned custom toasts! It's new to me
Thank you! I'm glad it helps you
Absolutely awesome series :). BTW, it looks like the "view" at 14:58 is deprecated now.
did you solve this problem?
@@brian_clips its not a problem. One can still use it for now. There must be some new implementation of it that must be getting recommended although im not entirely sure.
I liked the screen trainsition of "imagine ..." :)
Thanks a lot for your efforts!!!
I like your videos. You are good at explaining things and you are easy to understand. Thanks
This German accent is much easier on the ear than that of "Coding In Flow"
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!
+1
I was getting an error too, did you solve it?
This Series is based in 2020 and yes some things are not relevant in 2023, Try following his "Android Basics 2023" hope you will find the latest tools in that playlist!
@@kushagragoel6760 just type null in the place of clToast
@@sreeragvp4808 thanks for the tip. i'm wondering what exactly does null do though?
Your videos really helpfull to understand the concepts .Thanku ❤
This is why java is a lot better for learning, all those abstraction that you explain, you need to code in java.
It was very helpful , Good work man.
since api 30 setView is deprecated. Is any other easy way to set custom view for toast?
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?
View binding. Philipp has and video about it
view is deprecated how can I change that?
Bro please make videos related to making an app which can connect to Nodemcu WiFi module
Good ol' Mr. Poop! Another great video, thanks!
Cool and clear as usual. Thanks🙏
hi Philipp , why you do not use Relative Layout ?
What would be the commands for the custom Toast in Java?
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
Did you import kotlinx.android.Synthetic.* (or something like that)? If not, then probably you're getting the error because this kotlinx plugin's feature has been deprecated for a while now, if you want to reference your viewID you can either get it with findViewById (Which I'd not recommend, probably only for some rare cases) or ViewBinding which is a feature from the AndroidX Jetpack library that I recommend.
i am having the same error as well
@@trevorPhillips284 you have to use viewbinding, since synthetics are deprecated, and you already have ActivityMainBinding for the main activity xml you have to setup another one for custom toast, import ......CustomToastBinding, then in class MainActivity declare private lateinit var binding1 (or smth else since binding is already taken) : CustomToastBinding then use binding1.clToast in the inflater ...
@@chochosan044 Woah thanks mate. What does deprecated mean?
friend your videos are marvellous, maybe you settled your language for german because, i can read english but i cannot listen and when i use the subtitles youtube offer me german translation,
Thank you for this amazing videos!
Thanks for watching!
Is there a way to place a property to pass the text that the Toast is going to display?
When I use the word "view" I see it written but crossed out. Does it have a newer version?
Superb
you are amazing, thank you
Thank you so much
@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.
How to toast an error in onError(). I can't get any context.
nice
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(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()
}
}
}
Thanky you bro !)
Thank you very very much!!!!!!!
Thanks a lot
thanks a lot brother
To me using findViewById does not look like a natural solution. This is what I would suggest.
class MainActivity : AppCompatActivity() {
private lateinit var binding: ActivityMainBinding
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.btnShowToast.setOnClickListener {
Toast(this).apply {
duration = Toast.LENGTH_LONG
view = CustomToastBinding.inflate(layoutInflater).root
show()
}
}
}
}
Buen video
Perfect :)
The custom toast is deprecated now I think
BOMB!!!
NSA wants to know your location
How to set width of toast match parent?
put match_parent on width xd
Did you just say Welcome Mr. Poop??? Lmao I wanna work with that guy now lol!!!!
Mr Poop has the bast name ever
Skip the part when he is making the custom Toast. It is depreciated, and will not work.
@Lahty V. I think .makeText() is the new way:
kotlin-android.com/android-toast-kotlin/
I am still learning this myself, so hopefully this is right...
"Welcome, Mr. Poop!"
😂😂
😂😂
Hi, I have a problem with the custom toast.
The view variable has a strike line, and the error is : Unresolved reference: inflate
setter for view: View?' is deprecated. Deprecated in Java
hey, did you solve this problem?
No...
@@guy1407 it's so bad, but thanks
i am having a similar issue
Ahah! You are German! Eingabe betrayed you.
Even though it looks pretty shitty😂😂😂
Please add subtitle english
:)
How can I send you a private message please ?
on my instagram
@@PhilippLackner Look there for a PM please
Noooo Kotlin