Android CalendarView - add color (image) based on category

733 views Asked by At

I'd like to add an image (really small, just a colored dot) to a specific date (which will be seen from the MonthlyView) in the CalendarView to specify what category it falls under. So how would I go about displaying these images? I have the png files in the drawable and I created the ImageView in XML which, when clicked should show the specific event

<ImageView
    android:src="@drawable/birthday"
    android:background="@null"
    android:text="@string/birthday"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:id="@+id/birthdaybutton"
    android:clickable="true"
    android:onClick="clickNew"
    />

But how do I get it to display? (what I have so far)

      if(category.isEmpty()){
                category = "None"; //category is a String
            }
            else if(category.equalsIgnoreCase("birthday")){
                categorySelected = (ImageView)findViewById(R.id.birthdaybutton); //categorySelected is an ImageView
            }
0

There are 0 answers