question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is possible to hide arrows and put some imageView between title of calendar and weekdays?

See original GitHub issue

First thanks for the component, is excellent and very complete.

I have some questions about usage of your MaterialCalendarView:

  1. How to hide arrows?

  2. How to put some ImageView between title of calendar and weekdays?

  3. How to set default drawable for selected item?

    com.prolificinteractive.materialcalendarview.MaterialCalendarView android:id=“@+id/calendarView” android:layout_width=“match_parent” android:layout_height=“wrap_content” android:layout_marginTop=“10dp” xmlns:app=“http://schemas.android.com/apk/res-auto” app:mcv_showOtherDates=“out_of_range” app:mcv_dateTextAppearance=“@style/TextAppearance.DayText” app:mcv_headerTextAppearance=“@style/TextAppearance.TitleText” app:mcv_weekDayTextAppearance=“@style/TextAppearance.WeekdayText”/>

I’ve set @drawable/calendar_day_selector by default, but my day cell still have circle cyan background:

<style name="TextAppearance.DayText" parent="android:TextAppearance.DeviceDefault.Small"> <item name="android:textSize">16sp</item> <item name="android:textColor">@color/calendar_day_text_color</item> <item name="android:background">@drawable/calendar_day_selector</item> </style>

My calendar_day_selector.xml: <selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">

<item
    android:state_checked="true"
    android:drawable="@drawable/calendar_day_selected"
    />

<item
    android:state_pressed="true"
    android:drawable="@drawable/calendar_day_selected"
    />

<item android:drawable="@android:color/transparent" />
</selector>

My calendar_day_selected.xml:

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

<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">

<stroke android:color="@color/blue_color_1" android:width="2dp"/>
<solid android:color="@android:color/transparent"/>
</shape>

I’ve use Decorator for specific days. And it works perfectly:

public class CalendarDayDecorator implements DayViewDecorator{

private Context context;
private final Set<CalendarDay> dates;

public CalendarDayDecorator(Context context, Set<CalendarDay> dates) {
    this.context = context;
    this.dates = new HashSet<CalendarDay>(dates);
}

@Override
public boolean shouldDecorate(CalendarDay day) {
    return dates.contains(day);
}

@Override
public void decorate(DayViewFacade view) {
    view.setSelectionDrawable(ContextCompat.getDrawable(context, R.drawable.calendar_day_selector));
    view.addSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.gray_color)));
}

}

But I want the same selector (R.drawable.calendar_day_selector) for all days.

Thanks in advance.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dandc87commented, Nov 4, 2015
  1. There is no way to hide just the arrows, but you can hide the top bar with setTopbarVisible(false)
  2. No, you would have to hide the top bar and make your own
  3. To use a custom selector drawable, you need to use a decorator where shouldDecorate() always return true. Decorator ordering matters, so decorators you can override the selector with another decorator.
0reactions
dandc87commented, Nov 5, 2015

@anivaler you can use setShowOtherDates() to show disabled dates. This will draw them in a disabled state, which can be customized with a custom TextAppearance with a custom textColor. You can read more about it in the documentation

Read more comments on GitHub >

github_iconTop Results From Across the Web

Change Android CalendarView arrow color/icon and replace ...
and also check these : Is possible to hide arrows and put some imageView between title of calendar and weekdays? and Material Calendar...
Read more >
Designing The Perfect Date And Time Picker
We want the date to be chosen as quickly as possible, and being able to set the date with two taps (tap to...
Read more >
Diff - 9ff22e41d05aa66bede1e72767d67dcc2f2d500e^2^2 ...
We will only fire an onScale event if - * the computed ratio between the current ... You can enable or disable some...
Read more >
The Grumpy Editor's Guide to Image Management Applications
DigiKam wants to organize images into "albums." An album is a simple directory full of image files, though digiKam goes out of its...
Read more >
Changes - Documentation - Webmail - The Horde Project
[mjr] Require Horde_Perms::DELETE for including a calendar as sync-able. ... Log [jan] Add a few common aliases for the log level constants.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found