Show continuous months instead of month by month or show two months in Android CalendarView

0

I have tried everything and I can not show this CalendarView continuously.

It shows me only one month and to see the other months I have to do Scroll down. In a mobile phone half of the screen is blank and gives the impression of being wasted.

I want to fill the whole screen with the maximum number of full months that can enter, or to fill the entire screen with two months.

This is my current XML:

<?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:id="@+id/content_tercia"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/txt_salterio"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:orientation="vertical"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="org.deiverbum.liturgiacatolica.CalendarioActivity"
    tools:showIn="@layout/activity_tercia">
    <ScrollView
        android:id="@+id/scrollView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
        <CalendarView
            android:id="@+id/calendarView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
            android:layout_alignParentLeft="true" />
    </ScrollView>

</LinearLayout>

Any solution to avoid setting date limits (do not want to add restrictions to the calendar)?

    
asked by A. Cedano 17.10.2017 в 15:24
source

1 answer

0

Good evening, because you do not use two CalendarView and you synchronize it.

<?xml version="1.0" encoding="utf-8"?>

<ScrollView
    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:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

<LinearLayout

    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    tools:context="com.example.gustavo.calendarview.MainActivity">

    <CalendarView
            android:id="@+id/calendarView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />

    <CalendarView
        android:id="@+id/calendarView1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    </LinearLayout>

</ScrollView>
    
answered by 18.10.2017 в 02:23