KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have created a CustomView for Calendar. I have an onDraw method to draw the text in the calendar. I want to change the color of the day Text when i click on it. How can i achieve it? CalendarView.java : package com.example.calendar_module; import java.util.Calendar; import android.app.ActionBar.LayoutParams; import android.content.Context; import android.content.res.Resources; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.MonthDisplayHelper; import android.view.MotionEvent; import android.widget.ImageView; public class CalendarView extends ImageView { private static int WEEK_TOP_MARGIN = 0; private static int WEEK_LEFT_MARGIN = 05; private static int CELL_WIDTH = 20; private static int CELL_HEIGH = 20; private static int CELL_MARGIN_TOP = 05; private static int CELL_MARGIN_LEFT = 29; private static float CELL_TEXT_SIZE; private static int CALENDAR_WIDTH; private static int CALENDAR_HEIGHT; private static final String TAG = "CalendarView"; private String[] mDayString = {"Sun","Mon","Tue","Wed","Thu","Fri","Sat"}; private Calendar mRightNow = null; private Drawable mWeekTitle = null; private Cell mToday = null; private Cell[][] mCells = new Cell[6][7]; private Cell[] mDayCells = new Cell[7]; private OnCellTouchListener mOnCellTouchListener = null; MonthDisplayHelper mHelper; Drawable mDecoration = null; public interface OnCellTouchListener { public void onTouch(Cell cell); } public CalendarView(Context context) { this(context, null); } public CalendarView(Context context, AttributeSet attrs) { this(context, attrs, 0); } public CalendarView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); mDecoration = context.getResources().getDrawable(R.drawable.typeb_calendar_today); initCalendarView(); } private void initCalendarView()
Tags (comma-separated)
Save Edits
Cancel