I'm building an application using CalendarView. My issue is, that I don't find the way to customize the calendar style.
This is my layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/calendario_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<CalendarView
android:id="#+id/calendarView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
When I show this screen, I get the month's name and the year, like in the photo.
How can I customize the CalendarView style?
for designing the calendar you can try this Link
and change the
android:layout_height="wrap_content"
to
android:layout_height="match_parent"
this might also help you Link
Related
I want to show a similar glow like on this image
I know how to get dominant color using Palette. I was wondering how to show a glow effect like this.
I did a similar couple of days ago using a Third-party library. Follow initial steps by adding dependency and maven from here.
below is the xml code of the Glowing button.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:orientation="vertical"
android:gravity="center"
android:background="#color/black"
android:layout_height="match_parent"
tools:context=".MainActivity">
<com.smb.glowbutton.GlowButton
android:id="#+id/myGlowButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginHorizontal="16dp"
android:layout_marginTop="8dp"
app:gb_drawablePadding="50dp"
app:gb_drawableTint="#color/black"
android:paddingTop="5dp"
android:paddingBottom="5dp"
app:gb_text="Prime Video"
app:gb_textColor="#color/white"
app:gb_textSize="16dp"
app:gb_backgroundColor="#305B7B"
app:gb_cornerRadius="15dp"
app:gb_disabledTextColor="#808080"
app:gb_glowAnimationDuration="500"
app:gb_glowColor="#305B7B"
app:gb_rippleAnimationDuration="1500"
app:gb_rippleColor="#305B7B"
app:gb_rippleEnabled="true" />
</LinearLayout>
Output
Hope it would help you.
I need to enter an initial date and a final date similar to this application in IOs:
Gif video about IOs app
I'm thinking of using a DatePicker to enter the initial date and then another or the same for the final date.
But my boss wants to see both DatePicker at the same time for the start date and end date. Is that possible?
Or there is a way to do something similar to the video gif previously indicated.
Thanks
You could you use 2 datepickers like this below,
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<DatePicker
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></DatePicker>
<DatePicker
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</DatePicker>
</LinearLayout>
</ScrollView>
</LinearLayout>
I have a problem with the date picker in android 6.0 Marshmallow.
The problem is a simple one, in landscape mode, i have the OK button missing.
Here are some images to demonstrate the problem. (It works perfectly with the time picker)
The problem on tablet and phone:
As you can see, i have a spinner on top, but removing it didn't help.
I dont have that problem on the system itself.Here on setting and set datetime it works fine:
Here is the layout for the date time fragment.
<?xml version="1.0" encoding="utf-8"?>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#color/White"
android:orientation="vertical">
<Spinner
android:id="#+id/spinner_date_time_choice"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</Spinner>
<TimePicker
android:id="#+id/time_picker"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<DatePicker
android:id="#+id/date_picker"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
How can I get this timpicker
Instead of this one?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TimePicker
android:id="#+id/timepicker_arbetstid"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
I think you can try
android:calendarViewShown="false"
and
android:timePickerMode="spinner"
in the datepicker xml.
For backwards compatibility, you may use this library to support material design time picker:
https://github.com/code-troopers/android-betterpickers
I want to implement CalendarView / DatePicker button into my Google Map
How can i do it ?
On click of this button i want a small calendar to open and enable to pick a date from the calendar,when the date is picked i want to execute a function that i wrote.
Thank you !
**The area marked with red doesn't exist right now :
I want this button to open a datePicker
https://imagizer.imageshack.us/v2/390x695q90/633/VyWT4l.jpg
my activity xml right now looks like:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/map"
tools:context=".MapsActivity"
android:name="com.google.android.gms.maps.SupportMapFragment"/>
You can edit your map view and add button to it like any other layout.
for example you can use this code for your activity layout.
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MapActivity" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment" />
<RelativeLayout
android:id="#+id/footer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#FC0"
android:gravity="center" >
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:text="Fixed Footer"
android:textColor="#000"
android:textSize="20sp" />
</RelativeLayout>
</FrameLayout>
after that you can use datepicker for showing a dialog to select date.
you can find a solution for it here http://www.mkyong.com/android/android-date-picker-example/
for calling a function after selecting date you can use onDateSet function of datepicker , so call your function inside of onDateSet
you can find more informations about it by reading the article that i shared link with you.