enter image description here
There is a calendar and Showing Icons in marked dates
Related
I'm using Material Design Date picker: https://material.io/components/date-pickers in my Android Application, can I make every date in calendar to have different color?
Im using a DatePickerDialog on my app, and when it shows it looks like this
Im trying to change the look of it, to look like this one
This is how i declare my picker:
DatePickerDialog datepicker = new DatePickerDialog(getActivity(),
AlertDialog.THEME_DEVICE_DEFAULT_LIGHT,this,year,month,day);
According to a tutorial i was reading, if we pass AlertDialog.THEME_DEVICE_DEFAULT_LIGHT it should display the calendar like i want, but it does not work. Do i need something else?
Edit
Seems it might be an issue with Huawei(brand of the phone i was using) according to this
From the official docs -
When the DatePicker_datePickerMode attribute is set to calendar, the month and day can be selected using a calendar-style view while the year can be selected separately using a list.
According to datePickerMode doc -
Prior to the L release, the only choice was spinner. As of L, with the Material theme selected, the default layout is calendar.
So, if you are using the material theme in your Activity, then pass 0 in themeResId. This will make the dialog use the parent context's default alert dialog theme.
DatePickerDialog datepicker = new DatePickerDialog(getActivity(),
0 ,this,year,month,day);
Otherwise, you can use Theme_Material_Dialog_Alert or Theme_Material_Light_Dialog_Alert.
DatePickerDialog datepicker = new DatePickerDialog(getActivity(),
R.style.THEME_DEVICE_DEFAULT_LIGHT,this,year,month,day);
I manage to add events in google calendar and viewing the list of events but my problem is how can i sync those events to my custom calendar and the day must have a different color or any mark so that the user would know that the day has a event.
Try to check this documentation if this is the one you are looking for about syncing. Now, about the color of the events, you can set this different color in creating events by using the parameter colorId. For more information, check this SO question on how to do it in android code.
Hey guys having issues with customizing the date picker in android. Here's an image of my current date picker.
As I've highlighted in black two things I'm having issues with.
Is there away to remove the header of the date picker? I just want the calendar part.
Is there a way to adjust the date picker so that it'll fit the width of any screen it's on?
I'm using a date picker not a date picker dialog.
to remove the header
datePickerDialog.setTitle("");
see the link,
Remove Title from DatePickerDialog
to get fullscreen, set android:layout_width to match_parent
I am looking for way to get a calendar view with Event added on specific date something like the below:
And when I click on the calendar date another activity has to be opened?
Can the default calendar View help me doing the same or is there any other API that can help get the result like above?
Let me know!
Thanks!
You can use default calender library like
CalendarView
or you can use Caldroid
You can use default calendarview, I have used material calendarview for similar result.
You can even add events in text form as well as you can show drawable images with texts there.
See the line of code:
List<EventDay> events = new ArrayList<>();
events.add(new EventDay(calendar, CalendarUtils.getDrawableText(this, "₹"+wonAmt, Typeface.DEFAULT_BOLD, R.color.green, 8)));