android - Highlight the clicked event in Alam kanak Week View Library -


i using compile 'com.github.alamkanak:android-week-view:1.2.6' library in app.i highlight selected emptyview when clicked first time. did override onemptyviewclicked(calendar time) of library calling super.getview().setbackgrounddrawable(drawable d); changes ground of whole view instead of empty view. how change color of empty view when clicked (or highlight it)? how achieve that?

here doing now.

   @override public void onemptyviewclicked(calendar time) {      gradientdrawable gd = new gradientdrawable(             gradientdrawable.orientation.top_bottom,             new int[] {0xff616261,0xff131313});     gd.setcornerradius(0f);      getview().setbackground(gd);     } 

well, after spending time searching got know there answer on github not merged master branch. wanted give range calendar's horizontal scroll plus highlight empty event on first tap. user can add event on second tap.clone repo in ur project/ add module. https://github.com/mrwhite1/weekviewlibrary can set scroll range using

    calendar cal = calendar.getinstance();     cal.add(calendar.date, -7);     mweekview.setmindate(cal);      calendar c = calendar.getinstance();     c.add(calendar.date,21);      mweekview.setmaxdate(c); 

for highlighting (and adding) event add,

   mweekview.setemptyviewclicklistener(this);      // set addevent click listener     mweekview.setaddeventclicklistener(this);      @override public void onemptyviewclicked(calendar time, calendar temptime, boolean clickedtwice) {   //empty event clicked first time }   @override public void onaddeventclicked(calendar starttime, calendar endtime) {     // set logic add event (second tap)  } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -