P
P
Pavel Rekun2014-08-15 11:02:34
Android
Pavel Rekun, 2014-08-15 11:02:34

Caldroid: How to get its Date from cell position?

Good afternoon, I'm working with the Caldroid library and I need a little help. Using the PointToPosition function, I get the position of the clicked cell, in the onTouch method, but I need to know this position to get the Date of this cell. How to get it?

public boolean onTouch(View v, MotionEvent event) {
        	float x = event.getX();
          
        	float y = event.getY();
        	
        	int action = event.getActionMasked();
        	
        	int Up_Position = gridView.pointToPosition((int) x, (int) y);
        	String UP = String.valueOf(Up_Position);
        	
        	
        	int Down_Position = gridView.pointToPosition((int) x, (int) y);
        	String DOWN = String.valueOf(Down_Position);
        	
            if(action == MotionEvent.ACTION_UP){
          	Log.d("MotionEvent", "UP: " + UP);
                return true; 
            } 
            
            
            if(action  == MotionEvent.ACTION_DOWN){
          	Log.d("MotionEvent", "DOWN: " + DOWN); 
            	return true;
            }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
one pavel, 2014-08-15
@onepavel

1. The adapter is networked in the gridView, data is passed to the adapter for display, refer
to this data
2. There is a CaldroidListener in the calendar library, which you need to implement and subscribe to calendar events and you will receive messages onSelectDate, onLongClickDate, onChangeMonth
3. I have car broke down, Ford model, winter tires

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question