3 years later and this tutorial is still helping people! Thanks for making it!
@andrewm2103 Жыл бұрын
Awesome, Thank you used this tutorial to add to my project, 90% of the code worked perfectly, I just changed a couple of lines that didn't work in a Fragment. 100% happy with the outcome, looking forward to the next step.
@ChrisPugsworth7 ай бұрын
what was the 10% that didnt work? Im also planning on implementing it in a fragment but the calendar dates wont show in the recycler view.
@whitewolf1433 жыл бұрын
can pls make your videos a bit slow it's hard to follow for beginners like me (a little more explanation will help). thanks
@vidyab18213 жыл бұрын
Hei Arif! Try changing the playback speed by clicking on the three dots on the top right corner to 0.5x.
@doc41533 жыл бұрын
You seemed like a normal, level-headed young man at first, until you blinded me with your usage of light mode. GAHHHH!! I tease. Thank you for the great video.
@CodeWithCal3 жыл бұрын
😆 Light mode for the win! Thanks, you're welcome.
@gigajoules66363 жыл бұрын
I honestly though I had speed set to 2x. Not complaining.
@andreasflensmark86163 жыл бұрын
It is properly only me, but I had a hard time following along. I wouldn't mind if the video was longer, just take it a bit slower
@CodeWithCal3 жыл бұрын
Yeah, I have gotten a bit carried away with the pace on a few videos. Like everything I'm still working on finding that balance. That's for the feedback. 😊
@andreasflensmark86163 жыл бұрын
@@CodeWithCal Of course, you could try to go with something like Dani Krossing was doing, slow talk explaining the basics, if that is what you are aiming for of course. People will watch an hour-long video if they feel they are in control and understand what is going on. Other than that, great video. ;)
@CodeWithCal3 жыл бұрын
I'll check out some of his videos, cheers :)
@aldrensalada1002 Жыл бұрын
Great video. I was hoping to see a calendar tutorial with only months and years to choose from without displaying the days. Thanks!!
@AxLdmh3 жыл бұрын
I think tutorials are supposed to explain why you do stuff, not just show you doing it and you explain nothing at all
@CodeWithCal3 жыл бұрын
😜
@dany1681683 ай бұрын
Yeah, feel the same. But I think we as the beginners are not the target audience. This tutorial shows how you could implement a calendar when you already got a hold on the basic kotlin and Android Studio functionalities. He doesn't explain anything related to the programming language. This is a tutorial of how to implement a calendar functionality, not a kotlin tutorial. We'll have to find that somewhere else and maybe someday this will be also useful to us too.
@scooynilo Жыл бұрын
Mate, you just about saved a uni project cause I was dumb enough to assume CalendarView would be useful. Thank you
@elben81402 жыл бұрын
Why so fast though? You here to teach or to show off showoff
@CodeWithCal2 жыл бұрын
I provide a free tutorial, and you insult me by calling me a show off. Yeah this tutorial isn't perfect and maybe it is to fast, but you should be more considerate in the way you give feedback. Name calling is simply bullying and I won't stand for it.
@adityakamath60963 жыл бұрын
Hey cal, this was a really helpful video. I had one small doubt regarding adding holidays. Like what if i want to highlight particular days which are holidays
@CodeWithCal3 жыл бұрын
The highlighting part should be easy enough. How would you go about importing Holidays? Would it be user input? Or are you thinking of pulling from web service?
@086_it_jeetpatel43 жыл бұрын
@@CodeWithCal pulling from webservice and what if want to highlight present date ? Thank you for you time and consideration.
@japogi36392 жыл бұрын
Thank you for this tutorial, very helpful specially if we want custom calendar
@prateeksrivastava69403 жыл бұрын
Hey Cal,this video was very helpful and you are making great videos , Can we put notification and reminder to the specific ocassion or date
@CodeWithCal3 жыл бұрын
Notifications tutorial, can go on the to do list, thanks.
@srys71463 жыл бұрын
Thank's for this video Cal ❤️ How can I add privious month's dates & next month's dates in remaining position!!!!
@CodeWithCal3 жыл бұрын
Absolutely possible. 06:46 try to really understand what we are doing here with our days in month array. And I think the answer will become apparent. I would probably change the array to hold dates intead of strings and when we loop through the 42 days save each date, then in the calendar view holder check to see if the date is either the next or previous months and if so maybe change the text color or something.
@srys71463 жыл бұрын
@@CodeWithCal I tried whatever you said to me yesterday...but in ArrayList i got extra days for PREVIOUS and NEXT months.. can you please help me out and if possible please share code regarding this..
@srys71463 жыл бұрын
@@CodeWithCal done bro see yr weekly calendar code & solve my bugs tq dude
@rrebel99387 ай бұрын
Hi, I have the application working, however it is one day ahead. How do I change this?
@Johnlisb6 ай бұрын
Hi from Brazil. Do you have any video that shows the connection to the database?
@metalheadgamers63762 жыл бұрын
Thank you so much for the video bro . I am new to android development and this video was very helpful and easy ❤
@monteoregal5691Ай бұрын
It doesn't let me do Linear in Linear and there is no end of Linear with a
@mysgrown3 жыл бұрын
Thanks a lot Sir. 💌Your Channel is very helpful.👐🏻 I loved the way that you make your videos 🥳 the unique style with no audio explanation but everything is clear in video 🔥🔥
@CodeWithCal3 жыл бұрын
Thanks 😊
@mysgrown3 жыл бұрын
@@CodeWithCal 😊 welcome Sir 👐🏻
@syedmoinahmed95563 жыл бұрын
If there ever was a android studio on steroids Advertisement, it would be this video. No cap.
@CodeWithCal3 жыл бұрын
😆😉
@fabriqr29305 ай бұрын
Hey bro how to change color the date selected? And the save the pósiton selected with a api get?
@qpdbwvwdbqp47302 жыл бұрын
Thank you so much Cal! This was super super useful!
@blackiron85013 жыл бұрын
hi , i changed the layout to a Relative layout so i can add a bottom Navigation but now i can't see the days
@CodeWithCal3 жыл бұрын
Hard one to troubleshoot with out seeing the layout myself. Try nesting the original layout inside your new relative layout
@kingjiealdwinlee91892 жыл бұрын
sir, I am having a bit of trouble implementing the codes into a fragment is there a different code for that or is it just the same ? thank you
@rajmodi5669 Жыл бұрын
Hi Cal, thanks for the great example! I am trying to reference certain days of the month to change their color. Seems to work fine on the current month, but once we go to a different month, I can't grab a reference to any of the days. Any hints you can pass along on how to reference each day? Thanks!
@jamesheiman1602 Жыл бұрын
hello, I would like to know the way to highlight the chosen day. Would that be possible?
@mrsmile1982 Жыл бұрын
Thank you man you helped me so much!!!!
@panmacabre98953 жыл бұрын
you are genius and so inspiration to me
@CodeWithCal3 жыл бұрын
Thanks 😊
@klaasdeeindbaas Жыл бұрын
nice but you go a little too fast over things. eg. at layout.xml you clicked 'something' (1:10) to display the actual xml instead of the preview panes, but even at 0.25 speed I, a total beginner, still couldn't make clear what exactly you clicked to get the xml itself into view :( have some compassion with the people who actually need these tutorials bro!
@azamsulaiman1626 Жыл бұрын
Hello sir. Can you make a tutorial video about taking or passing the retrieved data inside the recyclerview into the form of timetable where table consist of time and day? if you know what I mean. like the ClassUp app, just that it takes the data from the recyclerview. that data may consists of subject, time, classroom, and etc.
@LucaElevate2 жыл бұрын
Hey Cal, I hope you can help me with this. When I implement the CalendarAdapter.onItemListener in the MainActivity, I cant implemet the methods. Instead I get this Error "Non-static field 'onItemListener' cannot be referenced from a static context"
@CodeWithCal2 жыл бұрын
Hey Lurg, The on ItemListener is an interface, have you added this line public class MainActivity extends AppCompatActivity implements CalendarAdapter.OnItemListener
@LucaElevate2 жыл бұрын
@@CodeWithCal I try to Integrate the Calendar in my App. So its not my MainActivity but that shouldn't be a problem, right ? First I thought its because my MainActivity was a Fragment but I also tried it with an new Activity with the same problem
@nicopintea39492 жыл бұрын
I followed all the steps but when I click my button in the main screen thats supposed to take me to the calendar the app just stops working, how could I fix it?
@CodeWithCal Жыл бұрын
Have you resolved this? what error are you getting?
@ДмитрийИвушкин-с1н2 жыл бұрын
Thanks for your tutorial. Please, tell me how to highlight the current date in color.
@CodeWithCal2 жыл бұрын
In the adapter add an if statement to check if the date is todays date. if so change the bg color or something similar
@marko64574 ай бұрын
@@CodeWithCal But how to do that? This solution does it for the same day in other months too
@yoku1010 Жыл бұрын
Is it possible to highlight some events that we want?
@ChrisPugsworth7 ай бұрын
When I run the code inside a fragment, the calendar dates wont show in the recycler view. based on my troubleshooting, it seems like the problem is lies inside the setMonthView after initializing the values inside the daysInMonth array. Can you help me fix it?
@LogDog21716 ай бұрын
@ChrisPugsworth Wasn't sure if you solved this yet, but I'm doing a similar section inside fragments. Mine seems to be working but only once you click one of the buttons and not upon creating the fragment (fixing that now). My setMonthView looks like monthYearText.setText(monthYearFromDate(selectedDate)); ArrayList daysInMonth = daysInMonthArray(selectedDate); CalendarAdapter calendarAdapter = new CalendarAdapter(daysInMonth, this); RecyclerView.LayoutManager layoutManager = new GridLayoutManager(v.findViewById(R.id.calendarRecyclerView).getContext(), 7); calendarRecyclerView.setLayoutManager(layoutManager); calendarRecyclerView.setAdapter(calendarAdapter); For myself I did have an issue where my RecyclerView simply wasn't partitioned to show correctly and wasn't visible so I would start there next if it still doesn't work. Hope this helps!
@DK-ij9sh2 жыл бұрын
Hi Cal. This is a great tutorial. I'm a beginner for android app development and I'm learning it with Kotlin for my university project. Can you do a tutorial for Calendar Views with Kotlin. Thank You.
@CodeWithCal2 жыл бұрын
I think the tutorial would be too similar. Thanks for watching :) good luck at uni
@jonn6038 Жыл бұрын
have you tried it on kotlin? I really need help as well I tried converting all into kotlin however, it wont open:((
@jonn6038 Жыл бұрын
can we save events and store it in database? thanks in advance sir
@irfanulhaqsoofi52752 жыл бұрын
Hi Cal Hope you will be doing well. Thanks a lot for publishing this very useful video. It's a great tutorial for beginners like me. I just want to ask you how I can highlight the current date in this app. Kindly help me solve this problem. A big thanks again for your productive efforts for the beginners community.
@CodeWithCal2 жыл бұрын
kzbin.info/www/bejne/d5rKamyqYsyBp68&ab_channel=CodeWithCal 09:32 - Monthly Calendar (Prev & Next Months Greyed out) You can do a similar thing as to here, where you compare current date to date and if so change bg color or something
@mariemepi4601 Жыл бұрын
Hello, is it possible to change the language for the month's name ? And if so how? Thank you very much for your help !
@CodeWithCal Жыл бұрын
Absolutely! Worth doing properly have a read of the following developer.android.com/training/basics/supporting-devices/languages
@pinkdiabanth67343 жыл бұрын
Nice tutorial!! Thanks for sharing your knowledge... Please keep posting these videos so that we (beginners) can learn from you. I want to add one more features that how to highlight the today's or current date? for example if today's date is 02-08-2021 so in the calendar how to highlight 2 ? currently it showing current month and year what about day?
@CodeWithCal3 жыл бұрын
Have you seen the weekly calendar tutorial? We highlight selected date in that and you could apply that to the monthly calendar. kzbin.info/www/bejne/oZ_ThJWql7WtadE
@CodeWithCal3 жыл бұрын
06:35 in Weekly calendar tutorial
@pinkdiabanth67343 жыл бұрын
@@CodeWithCal thanks a lot.. I will try to highlight the current day...
@jonilsoncoelho89302 жыл бұрын
Thank you so much! How to remove the empty items in recycleview in that case?
@CodeWithCal2 жыл бұрын
I'm not sure I understand what you mean?
@jonilsoncoelho89302 жыл бұрын
@@CodeWithCal Hi, bro! fine? I solved my question.. follow the solution: //before inserting the array into adapter if(firstDayOfMonth==7){ // remove all the empty elements from the beginning of the array when the first day of the month is on sunday. while(daysInMonthArray.get(0).isEmpty()){ daysInMonthArray.remove(0); } } // remove all the empty elements from the end of the array. while(daysInMonthArray.get(daysInMonthArray.size()-1).isEmpty()){ daysInMonthArray.remove(daysInMonthArray.size()-1); }
@marcospereira3150 Жыл бұрын
I don't speak English but I'm having to manage, it seems that there is no content in my language
@vijayreddy43722 жыл бұрын
Thanks Buddy great tutorial....
@CodeWithCal2 жыл бұрын
🙏
@abdurraqib7031 Жыл бұрын
is it possible to make it swipable?
@曾蒽2 жыл бұрын
Thanks for your tutorial, it helps me a lot.
@ethanhang7415 Жыл бұрын
Why did you use the condition "i
@CodeWithCal Жыл бұрын
6x7 =42
@Carlwiththehair2 жыл бұрын
When I run this, it's set the date to be one day off.... By that I mean it's set the 1st of Feb 2022 to be on a Wednesday in the app, when the 1st of Feb 2022 is on a Tuesday.... Googling it date issues are common in java when different timezones are used, but I have no idea how to set a timezone to correct this. Please can you help?
@CodeWithCal2 жыл бұрын
I think you can do something along the lines of setlocale stackoverflow.com/questions/35581921/localdate-format-with-locale
@elieckhaus566 Жыл бұрын
how do you do this so fast?? is the video sped up w/ audio over it?😭
@CodeWithCal Жыл бұрын
😅😉
@만두-s9j2q3 жыл бұрын
I really like your video thanks
@ayodejiadesuyi22483 жыл бұрын
This was very helpfu brother. thanks a lot. What can i do to implement same for api lower than Orea
@CodeWithCal3 жыл бұрын
The only reason I choose a higher target. Is for the use of Localdate, if you need to target lower I see no reason it shouldn't work you'll just have to rewrite out local dates for dates.
@winner376610 күн бұрын
What a bad video trying to flex on newer programmers by turning up the speed of the video so we have to watch it on 0.5 or 0.25 speed. Next there is no explaination I wouldn't recommend this video to newer programmers. Last but not least, show all the imports man, since sometimes my IDE was not automaticly importing the code properly. Thanks to your amazing technological achivements we are now able to use AI instead of searching on YT for Turorials on how to do something. TLDR: don't watch the video, give it a dislike and ask some AI language model on how to do it properly.
@CodeWithCal3 күн бұрын
This is just a tutorial on the internet bro, don’t appreciate your hostile tone. Some people like the pace of my videos some don’t. You clearly don’t and that’s okay. Anyway not sure why I’m engaging, but I thought I’d leave you with this quote: It's easy to criticize from the stands. What's hard…is doing something. It's not just that people like to criticize other people, it's that they like to criticize other people when they haven't achieved much themselves. Rob Walling
@seanmiguel9717 Жыл бұрын
Hey Cal, How can i get the maximum day of a specific month like, is it 30 or 31? Thank you Cal
@CodeWithCal Жыл бұрын
Localdate is awesome fort this www.studytonight.com/java-examples/java-localdate-lengthofmonth-method-with-examples#:~:text=Method%20With%20Examples-,Java%20LocalDate%20lengthOfMonth()%20Method%20With%20Examples,returns%2031%20as%20a%20result.
@salvorotta64853 жыл бұрын
Cale how you build a weekly calendar??
@hi_my_day2 жыл бұрын
Unfortunately, my app is not working. Do you know why it's forced to end?
@CodeWithCal2 жыл бұрын
Could be lots of things try adding a break point and reading the error message in your console :)
@hi_my_day2 жыл бұрын
@@CodeWithCal There is no error. However, it is forced to shut down when you run the app. My code is the same as yours.
@moshelevceder3 жыл бұрын
Any idea why my months are starting on the wrong number?
@CodeWithCal3 жыл бұрын
Could be a few different things. Have you tried setting a break point in the adapter?
@binnyandroid77743 жыл бұрын
Cal , can you make a custom calendar example with add event using contentResolver query? It will be a great help for me. Thanks in advance.
@CodeWithCal3 жыл бұрын
A follow up Weekly Android tutorial is in the making. :) I'm not using content resolver how ever...
@jaihaya76672 жыл бұрын
can you help me regrading the calendar with previous month day faded
Hi cal, i need your help i want to know why i cant select Daytext in calendar Cell it only Shows (Selected _ MM YYYY) why is that hope you can reply to me
@CodeWithCal Жыл бұрын
Looks like you've got your date formatter already sorted. or was that not the question?
@alokeshnath42693 жыл бұрын
Great tutorial!! I Need help can you please tell me, How I will select the month and year from spinners (I mean I want to put two spinners for month and year that will drop down) that will also change the month and year in the colander that you have created and at last choose a date from the calendar and then it should display selected date. Actually I am using your concept to choose D.O.B of a user. Can you please help me with that?
@CodeWithCal3 жыл бұрын
kzbin.info/www/bejne/g4PYgJaInKpjo68 Sounds like a good plan see link to custom spinner tutorial.
@alokeshnath42693 жыл бұрын
@@CodeWithCal thank you cal. Can you please make a tutorial on that or can you give hint how to do it...
@CodeWithCal3 жыл бұрын
@@alokeshnath4269With the custom spinner tutorial you have the tools you need. You need 2 spinners a month and year. Create an array list of years and a list of months id probably just manually create them. Then pass them into your custom spinner adapter. You should be able to use the same adapter for both
@alokeshnath42693 жыл бұрын
@@CodeWithCal I have created two spinners that is month and year. Now the question is how to change month and year dynamically in the calendar that you have shown in this tutorial. Please Help me...
@67Diadem3 жыл бұрын
Did you get any help?
@ticklemyturbine78012 жыл бұрын
I've coded all of the video, but the only part that shows up in the design view, or with the Pixel 2 Emulator is just the months without days. Any help?
@CodeWithCal2 жыл бұрын
Hard to say without seeing the code. Break points are a great debugging tool.
@LucaElevate2 жыл бұрын
Is it possible to change the color of a day number ?
@CodeWithCal2 жыл бұрын
So in the Calendar Adapter you can add an if statement to. check if the day you are up too is today. basically the same thing we do here in the daily calendar tutorial. 09:32 - Monthly Calendar (Prev & Next Months Greyed out) kzbin.info/www/bejne/d5rKamyqYsyBp68
@LucaElevate2 жыл бұрын
@@CodeWithCal but how can I do this with single days saved in a SqLite Databank. Its not possible to load data because I cant pass a Context in the parameter from the Adapter class but I also can't pass an Arraylist from a different class with the Constructor because It says that its might not be initialized. What can I do ?
@jairolima9592 жыл бұрын
thanks for the tutorial, :3
@LucaElevate2 жыл бұрын
hey i want to code a studyplanner app. I was wondering if I can just use the already existing calenderview of the widgets pallete?
@CodeWithCal2 жыл бұрын
I mean you probably could use the widget... Only you know the requirements of what you are trying to build. Benefit of the calendar in this tutorial is that it very customisable.
@LucaElevate2 жыл бұрын
@@CodeWithCal I will create my own calendar. I think its easier to work with because i know how to access everything
@charmcharm1243 жыл бұрын
U R GENIUS
@vamsimadhavh46642 жыл бұрын
Hello Cal just was wondering is there any way to start the calendar week from the top always as some times the top row is empty and it starts from 2nd row, thanks for a wonderful video
@AimesX82 жыл бұрын
After setting the dayOfWeek variable create an if statement before the for loop to see if it equals 7. If it does set it to 0. if (dayOfWeek == 7) { dayOfWeek = 0 } There is probably a better way, but this worked for me
@charchar2375 Жыл бұрын
@@AimesX8 where would you write this? In the for loop?
@codingcosmos70103 жыл бұрын
Hi, i want to change color of all Sundays... how can I achieve this ?
@CodeWithCal3 жыл бұрын
Hi, I would change the daysofMonth Array to hold the dates as apposed to the string of the day of month. Then inside the adapter you can check to see if what day of the week it is you will also have to extract the day of month. Finally change the colors accordingly.
@codingcosmos70103 жыл бұрын
@@CodeWithCal okay... Thanks a lot for answering
@sylladnaphang66602 жыл бұрын
Are u a developer or a rapper
@CodeWithCal2 жыл бұрын
🙃🙃🙃
@auditi8920 Жыл бұрын
Plz someone help When I click run ,it shows -- Unable to make field private final.lang.string.path accessible
@JupiterxBlues3 жыл бұрын
Seems to not be working for me. Copied your exact code and "view" is underlined red in 'return new CalenderViewHolder(view);' in 'CalendarAdapter.java. The error says that this is associated with the line 'public class CalenderViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {' in 'CalenderViewHolder.java'. Any suggestions?
@CodeWithCal3 жыл бұрын
Have you inflated the calendar_cell.xml correctly? Sounds like something is not quite right there.
@JupiterxBlues2 жыл бұрын
@@CodeWithCal I took a step back and took more lessons on Android Studio and Java and came back after a few months and I still don't understand why "view" keeps throwing an error for me but not for you in this video. right-clicking on 'view' gives the following suggestions "Create constructor" and "Remove 2nd parameter from constructor 'CalenderViewHolder' " However, If I remove the second variable as suggested (The "CalendarAdapter.OnItemListener onItemListener" part) "view" wont throw an error anymore BUT now I get "Variable 'onItemListener' might not have been initialized" in that constructor. very confused. Edit: My understanding is that I would need two variables to pass into the constructor requiring two variables but I am only passsing one variable named "view" and it wont accept that. Unless im missing something that I am not understanding?
@seoul_Jin5002 жыл бұрын
@@JupiterxBlues i am having same problem with you....and i am writing this with kotlin
@ДмитрийИвушкин-с1н2 жыл бұрын
Thank you for your Android Studio tutorials! Why when in the adapter add code: if(date.equals(CalendarUtils.selectedDate.now()) holder.dayOfMonth.setTextColor(Color.RED); Then the text of the current date is not highlighted in red? Please tell me my mistake.
@huungocluong81223 жыл бұрын
thank you very muck. This video was very helpful. But how can i make an appointment?
@CodeWithCal3 жыл бұрын
Do you mean creating an event? A tutorial extending this one is on the to do list. But in the mean time. You can put a list view or a recycler view inside our calendar recycler view cell. (For list of events) And implement an on on item click listener per calendar cell to create a new event.
@vikramragunathan63928 ай бұрын
Useful 🙏
@roopkishore785 Жыл бұрын
I don't know , but I am struggling to implement this.... not working
@KarnikDew2 жыл бұрын
Hey Cal, I know I'm being dumb here but I wanna know where I'm wrong... Everything works like a dream except for my arrow keys where both of them pull the months back instead of the forward button adding the month count... Where could I have had my logical error? And the app crashes if I click on a date... Help a fella out please!
@CodeWithCal2 жыл бұрын
Did you find a fix, sounds like you've got a few small mistakes
@KarnikDew2 жыл бұрын
@@CodeWithCal Yeah, i got my bug fixed for the buttons taking the months back, so when I copied the button code to mirror it to the other side, I forgot to change the onclick listener to nextMonth... Yeah, it was me being a zombie. And as for the crashing when i click, i still didn't get it. Thanks a million for helping me learn Android App Development and also, a real big thanks to you cause I used to be a person who used to shy away from coding cause i thought it was Rocket Science, watching your tutorials really helped me get out of that head space and approach coding with an open mind. Thank you Big Time Cal!
@eyanahmed97202 жыл бұрын
@@KarnikDew Hi I was following this tutorial and I also have the problem where both arrows face backward. how exactly did you fix this bug?
@datdothanh42733 жыл бұрын
Can i put it into a fragment?
@CodeWithCal3 жыл бұрын
I don't see why not ☺️
@sumitkb27702 жыл бұрын
sir how to highlight event date in calendar?
@CodeWithCal2 жыл бұрын
You can add a conditional statement to the adapter.
@sawankumar63553 жыл бұрын
dates are not showing in recycler view I am using databinding
@CodeWithCal3 жыл бұрын
Happy to help, might need a bit more to go off. So you aren't getting any dates showing. does the recycler view have the correct number of squares?
@sawankumar63553 жыл бұрын
@@CodeWithCal Yes, although all functions are working fine but the issues are with only dates
@sawankumar63553 жыл бұрын
@@CodeWithCal I think the adapter is not attached properly
@sawankumar63553 жыл бұрын
@@CodeWithCal Is it related to the minimum SDK version as I'm using min API level 21? Does this have something to do with it?
@CodeWithCal3 жыл бұрын
@@sawankumar6355 Yes, LocalDate class requires API 26. You could convert all local dates into java.util.Date. It will just take longer to write all methods and not have as many convenient things to call upon. Or up your min API
@dreadmanhua95523 жыл бұрын
I got a question, why can't I find "android.recyclerview.widget.recyclerview" for 2:42?
@CodeWithCal3 жыл бұрын
I'm using androidx for this tutorial, perhaps you are targeting lower/older versions of android? developer.android.com/jetpack/androidx developer.android.com/jetpack/androidx/migrate
@dreadmanhua95523 жыл бұрын
@@CodeWithCal Thank you! I continued the tutorial and found myself with the toast that doesn't appear. Do you know what causes this?
@CodeWithCal3 жыл бұрын
@@dreadmanhua9552 Try double checking the context you pass to the toast. I know that has caught me out in the past
@nemoelkristianalarcio32872 жыл бұрын
What if I used a lower version of the API? Will it still work
@nemoelkristianalarcio32872 жыл бұрын
Newer*
@CodeWithCal2 жыл бұрын
Yes, but Localdate class will not be available. No reason you couldn't rewrite all date functions to use java.util.Date instead of localdate :)
@gloriamartins53953 жыл бұрын
Hi, I'm getting an error , can you help me? Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference
@CodeWithCal3 жыл бұрын
Hello, I believe the textview is null, the find view by id is not matched with the id in your xml. Double check the ids match in xml and java.
@Quintav2 жыл бұрын
Hey, i got the same problem and ive been looking for it for a while now, ive checked the ids in my xml and theyre matched with the java. just wondering if you fixed yours and if you could share it, thanks
@jimt94712 жыл бұрын
hey so have you found any solution? i got the same problem too :/
@sim-card8685 Жыл бұрын
I found a solution: execute initWidgets() and setMonthView() in the onStart() method instead of onCreate()
@ruixuanchew29373 жыл бұрын
hey may i ask if its possible for each date to be clicked on and possibly intent to another page for example adding an event?
@CodeWithCal3 жыл бұрын
Absolutely possible. I have a video on a more standard recycler view see link. You should be able to apply the on item click listener from the recycler view tutorial to the calendar view. :) kzbin.info/www/bejne/f6ead6idmqiYp8k
@ruixuanchew29373 жыл бұрын
@@CodeWithCal may i ask under what method and java file do i implement this on item click listener should it be in calenderViewHolder?
@CodeWithCal3 жыл бұрын
From memory that's correct the view holder implements view on click listener.
@ayodejiadesuyi22483 жыл бұрын
This has given me so much headache bro. My dates keep starting from 9 and i have followed your tutorial over 3 times
@ayodejiadesuyi22483 жыл бұрын
sorry. found the bug.
@CodeWithCal3 жыл бұрын
🥳
@salvorotta64853 жыл бұрын
Cale how you build a weekly calendar
@salvorotta64853 жыл бұрын
Can you make a tutorial pls...
@CodeWithCal3 жыл бұрын
I will put on the to do list :) Thanks for the suggestion.
@salvorotta64853 жыл бұрын
Can I ask you how can I highlight the current date???
@CodeWithCal3 жыл бұрын
LocalDate.now() to get current date. Then you want to pass selected month and year into calendar adapter. Compare then if day month year matched change background color of view or what ever. Hope this helps.
@releNtless-eu3xc2 жыл бұрын
Sorry I have just started learning kotlin and I want to know how long will it take to become an intermitiate android developer at least.
@CodeWithCal2 жыл бұрын
🤔 interesting question. Depends. so many factors. Ultimately it does take some time to learn programming and android development. But I highly recommend to stick with it. I still only consider myself an intermediate at best, got to have the attitude that you are allways learning even after years of development :)
@releNtless-eu3xc2 жыл бұрын
@@CodeWithCal Thanks Cal ;) sorry but Android Studio highlights the words Vertical & Horizontal in these lines in red! And I have just typed everything exactly like yours :) android:orientation="Vertical" android:orientation="Horizontal" You also still haven't really answered my question regarding how long will it take to be able to at least create an app that you can make money with? lol or at least for yourself? thx
@CodeWithCal2 жыл бұрын
@@releNtless-eu3xc Could you have set the orientation twice? or is the parent definitely a Linear layout. These are just guesses as I cannot see your code. Well its true, I haven't answered your question as i feel it is an impossible one to answer. as there are just so many factors. I won't sugar coat, the app store is a very saturated market and to make money is tough... not impossible.. but tough. This is again maybe more philosophical of answer than you are looking for, but i believe there are no shortcuts in life and programming for that matter. Put in the time and effort and you will be rewarded eventually. Programming is a life long skill. that takes years to get good at. If you are only in it for the short term and for a quick dollar. I think you will be disappointed.
@releNtless-eu3xc2 жыл бұрын
for some reason, I can't copy and paste my code in here!?
@releNtless-eu3xc2 жыл бұрын
Also, I think I figured out myself what's the problem in here :) looks like there is nothing wrong with my code but for some reason although at the start of creating a new project I chose the template called with no activity for some reason my design view template doesn't show any textbox and I've even tried to insert one manually myself (textview or plain text) but looks like it inserts both of them outside that white rectangle and I'm not sure what I need to do in order to fix this problem?
@joshuatan58412 жыл бұрын
Anyone knows if this can be done on Minimum SDK Lollipop?
@joshuatan58412 жыл бұрын
Since Cal did it in Orea, if so may I know how?
@CodeWithCal2 жыл бұрын
You can absolutely! You just won't have access to LocalDates which have a lot of convenience methods. But you can use just a regular dates. your methods will need to be a bit longer as there is a little more logic you will have to be responsible for
@MuhammadAhmad-ew6po2 жыл бұрын
Thankyou.
@CodeWithCal2 жыл бұрын
☺️
@bilgipaylasmplatformu84543 жыл бұрын
How can i change color of selected date
@CodeWithCal3 жыл бұрын
We highlight selected date weekly calendar view tutorial 06:35 kzbin.info/www/bejne/oZ_ThJWql7WtadE
@bilgipaylasmplatformu84543 жыл бұрын
@@CodeWithCal how can i change the color of today's date
@yushuerguevarra3 жыл бұрын
I'm struggling in looking the errors. can someone help me?
@CodeWithCal3 жыл бұрын
Sure, what errors are you getting?
@yushuerguevarra3 жыл бұрын
@@CodeWithCal i fixed the error. but now I need the whole code for the numbers in the calendar
@NewesSkiller2 жыл бұрын
way to fast, little explaining. quick movement of tabs and directions. 2/10
Hey, how can I make it with the RecyclerView height set to wrap_content?
@CodeWithCal3 жыл бұрын
Wrap the whole thing in another view plus what ever view you need below it. I take it that's what you are trying to do?
@leventestancz45223 жыл бұрын
@@CodeWithCal What I'm trying to do is have your calendar in LinearLayout in a ScrollView that have an another RecyclerView under the calendar where I can post events (cardViews), and I thought both RecyclerView can have wrap_content as height but I can't seem to figure it out because the recycleviews just doesn't show when the app is running
@CodeWithCal3 жыл бұрын
The recylerview will need some sort of fixed height im fairly sure.
@leventestancz45223 жыл бұрын
@@CodeWithCal And what can use to add cardviews to and it's height is wrap content, I tried ListView but that did not work, any idea?
@CodeWithCal3 жыл бұрын
@@leventestancz4522 Well a scroll view has ambiguous vertical height. So you need to add fixed heights to all nested views. Im not sure what you are talking about with the list view and card view. I thought I was helping with a layout issue 😂
@incodewetrust8862 Жыл бұрын
in this function public CalandarViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) this line return new CalandarViewHolder(view); gives error as the constructor in calandarViewHolder has 2 arguments what is the solution ? i tries to make 2 constructor the other with only one parameter it completly breaks the code
@thesharonway46123 жыл бұрын
Is it possible to add pictures?
@CodeWithCal3 жыл бұрын
Add pictures to each day in the month? That would be possible
@thesharonway46123 жыл бұрын
@@CodeWithCal how?
@CodeWithCal3 жыл бұрын
@@thesharonway4612 So first thing would be to add an Image View to the cell xml file. Inside CalendarViewHolder.java duplicate whats happening for: TextView dayOfMonth; so ImageView myImageView; etc.. As far as the CalendarAdapter maybe instead of passing in ArrayList daysOfMonth you could create a custom class with two fields dayOfMonth of type String and image resource ID (I'm pretty sure is an int) you can then pass in ArrayList daysOfMonth Hope this helps and good luck :)
@thesharonway46123 жыл бұрын
@@CodeWithCal thank you
@NightWolf-cg6jn2 жыл бұрын
✌️✌️ so good
@CodeWithCal2 жыл бұрын
🎉
@jeremyheng85733 жыл бұрын
Good tutorial!
@CodeWithCal3 жыл бұрын
🙏
@jeremyheng85733 жыл бұрын
@@CodeWithCal u have tutorial for calender with event?
@@CodeWithCal got it! 1 more question is do you know how to create swipe-able month view?
@CodeWithCal3 жыл бұрын
@@jeremyheng8573 I do have an idea but it's probably a bit to complicated for a KZbin comment. The tricky thing will be ignoring the recylerviews default on tap and swipe
@TheZym0 Жыл бұрын
Slow down pls
@reflection35703 жыл бұрын
can I talk to you please? I need your help.
@CodeWithCal3 жыл бұрын
Sure thing, how can I help?
@mobius3693 жыл бұрын
Hey Cal, I am trying to add the same logic to a fragment instead of a main activity and the fragment keeps crashing, I tried to add methods such as getActivity() in order to invoke getApplicationContext() but I am not sure why it's still crashing. Also, when I try to create onClick methods in the fragment layout's code mode, it sends me to the MainActivity and not the fragment in which I am going to write the methods. Would appreciate it if you can give me some direction
@CodeWithCal3 жыл бұрын
Hey Z, I haven't had much experience with fragments. But will try to help best I can. What exception are you getting?
@mobius3693 жыл бұрын
Thank u for the reply Cal, my java compiles with no errors, when I run it, the app works, but the calendar fragment doesn’t respond. I tried looking at my logcat and build but there wasn’t an error pointing to my calendar-related classes. I am starting to think it has to do with the fact that it’s a fragment so I guess gotta debug line by line to.
@mattbangs57102 жыл бұрын
@@mobius369 Anyone here a year later trying to solve this in fragments, the key is to remove the onCreate() method and put it in the onCreateView. View view = inflater.inflate(R.layout.fragment_calendar, container, false); then use calendarRecyclerView = view.findViewById(R.id.calendarRecyclerView); ect. I hope this helps. I got his code working with these tweeks. (you also need to fix the back and forward buttons.)