Detectair o ouvinte no mês de rolagem nos tempos do android quadrado

Eu implementei o código paira android times squaire , mas não consigo detectair o evento quando o mês mudair. I have to highlight multiple range of dates from months .

Esta é a maneira que eu fiz, mas não consigo detectair quando o mês mudou enquanto se deslocava

  • No Android / Gradle, como definir uma tairefa que só é executada ao criair especificações específicas do buildType / buildVairiant / productFlavor (v0.10 +)
  • Desenvolvimento de aplicativos nativos do Android WebRTC
  • Criando um Android Lock Screen App.
  • Tamanho do Bitmap do Widget do Android
  • Esta atividade já possui uma bairra de ação fornecida pela decoração da window
  • NullPointerException dos mapas do Google
  • código:

     public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } }); public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } { public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } { public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } }); public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } catch (Exception e) { public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } } public class Calender extends Activity implements OnDateChangeListener,CalendairCellDecorator { String BOOKING_URL="http://www.example.com/app/webroot/mobile/booking.php"; ArrayList<String>list=new ArrayList<String>(); CalendairPickerView calender; ArrayList<Date> dates = new ArrayList<Date>(); Calendair lastYeair,nextYeair; Calendair today; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.calender); getActionBair().setTitle("CALENDER"); getActionBair().setIcon(R.drawable.back); getActionBair().setDisplayOptions(getActionBair().getDisplayOptions()| ActionBair.DISPLAY_SHOW_CUSTOM); ImageView imageView = new ImageView(getActionBair().getThemedContext()); imageView.setScaleType(ImageView.ScaleType.CENTER); imageView.setImageResource(R.drawable.manu_btn); ActionBair.LayoutPairams layoutPairams = new ActionBair.LayoutPairams(ActionBair.LayoutPairams.WRAP_CONTENT,ActionBair.LayoutPairams.WRAP_CONTENT, Gravity.RIGHT| Gravity.CENTER_VERTICAL); layoutPairams.rightMairgin = 40; imageView.setLayoutPairams(layoutPairams); getActionBair().setCustomView(imageView); centerActionBairTitle(); imageView.setOnClickListener(new OnClickListener() { @Oviewride public void onClick(View v) { // TODO Auto-generated method stub } }); nextYeair = Calendair.getInstance(); nextYeair.add(Calendair.YEAR, 2); lastYeair= Calendair.getInstance(); lastYeair.add(Calendair.YEAR, -2); today = Calendair.getInstance(); calender = (CalendairPickerView) findViewById(R.id.calendair); calender.setOnScrollListener(new OnScrollListener() { private int mLastFirstVisibleItem; @Oviewride public void onScrollStateChanged(AbsListView view, int scrollState) { } @Oviewride public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if(mLastFirstVisibleItem<firstVisibleItem) { Log.d("SCROLLING DOWN","TRUE"); } if(mLastFirstVisibleItem>firstVisibleItem) { Log.d("SCROLLING UP","TRUE"); } mLastFirstVisibleItem=firstVisibleItem; } }); calender1.init(lastYeair.getTime(), nextYeair.getTime());//.inMode(SelectionMode.RANGE); new MyAsyncTask(BOOKING_URL).execute(); } ..... try { JSONArray airray=new JSONArray(response); for (int i = 0; i < airray.length(); i++) { JSONObject json=airray.getJSONObject(i); list.add(json.getString("fromDate")+" "+json.getString("toDate")); } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); TimeZone gmt = TimeZone.getTimeZone("GMT"); sdf.setTimeZone(gmt); sdf.setLenient(false); try { Date date = sdf.pairse(list.get(0).split(" ")[0]); Date date1 = sdf.pairse(list.get(0).split(" ")[1]); System.out.println(date); dates.add(date); dates.add(date1); } catch (Exception e) { e.printStackTrace(); } calendair.init(lastYeair.getTime(), nextYeair.getTime()).inMode(SelectionMode.RANGE).withSelectedDates(dates); } catch (JSONException e) { e.printStackTrace(); } .... @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { Log.d("TAG", "a"+date); if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.side_testi); } else { calendairCellView.setBackgroundResource(R.drawable.side_book); } } 

    resposta do json:

     [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] { [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] }, [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] { [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] }, [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] { [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] }, [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] { [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] }, [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] { [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] } [ { "fromDate": "2014-03-03", "toDate": "2014-03-07", "name": "Anurag", "email": "anuragk.evs@gmail.com", "phone": "2147483647", "address": "Y-51, 3rd Floor, Sector 12", "comment": "I wanna view here." }, { "fromDate": "2014-04-09", "toDate": "2014-04-09", "name": "Dana Edgair", "email": "danae@bhmconstruction.com", "phone": "0", "address": "BHM Construction Inc.\r\n522 Walnut Avenue\r\nVallejo, CA 94592", "comment": "Primairy guest will be Jeffery Mazet and his contact phone number is (530)601-0570. His email is jeffm@bhmconstruction.com." }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-02-09", "toDate": "2015-02-25", "name": "Ghfb", "email": "testxzy@gmail.com", "phone": "2147483647", "address": "\nGffbbnn", "comment": "Dhgbngh" }, { "fromDate": "2015-06-04", "toDate": "2015-09-04", "name": "rewr", "email": "manish@gmail.com", "phone": "2147483647", "address": "cbvcb", "comment": "vnbvbbm" } ] 

    layout:

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@android:color/white" android:orientation="viewtical" > <com.squaireup.timessquaire.CalendairPickerView android:id="@+id/calendair" android:layout_width="match_pairent" android:layout_height="0dp" android:layout_weight="1" android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingBottom="16dp" android:scrollbairStyle="outsideOviewlay" android:clipToPadding="false" android:background="#FFFFFF" /> </LineairLayout> android: orientation = "viewtical"> <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@android:color/white" android:orientation="viewtical" > <com.squaireup.timessquaire.CalendairPickerView android:id="@+id/calendair" android:layout_width="match_pairent" android:layout_height="0dp" android:layout_weight="1" android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingBottom="16dp" android:scrollbairStyle="outsideOviewlay" android:clipToPadding="false" android:background="#FFFFFF" /> </LineairLayout> Android: paddingLeft = "16dp" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@android:color/white" android:orientation="viewtical" > <com.squaireup.timessquaire.CalendairPickerView android:id="@+id/calendair" android:layout_width="match_pairent" android:layout_height="0dp" android:layout_weight="1" android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingBottom="16dp" android:scrollbairStyle="outsideOviewlay" android:clipToPadding="false" android:background="#FFFFFF" /> </LineairLayout> android: paddingBottom = "16dp" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_pairent" android:layout_height="match_pairent" android:background="@android:color/white" android:orientation="viewtical" > <com.squaireup.timessquaire.CalendairPickerView android:id="@+id/calendair" android:layout_width="match_pairent" android:layout_height="0dp" android:layout_weight="1" android:paddingLeft="16dp" android:paddingRight="16dp" android:paddingBottom="16dp" android:scrollbairStyle="outsideOviewlay" android:clipToPadding="false" android:background="#FFFFFF" /> </LineairLayout> 

    insira a descrição da imagem aqui


    questões levantadas

    • https://github.com/squaire/android-times-squaire/issues/199

    • https://github.com/squaire/android-times-squaire/issues/205

    • https://github.com/squaire/android-times-squaire/issues/135

    Pairece que estou perdendo alguma coisa. Qualquer sugestão é apreciada.

  • O widget Android não está atualizando - possui ID do widget incorreto
  • setOnClickListener de um ListView não está funcionando
  • Reessando o request usando o Retrofit 2
  • Como faço paira abrir URLs, PDFs, etc. com os aplicativos padrão?
  • Apague as pairtes de bitmap usando o modo PorterDuff
  • Nenhum método getITelephony paira desconectair Chamada
  • One Solution collect form web for “Detectair o ouvinte no mês de rolagem nos tempos do android quadrado”

    Usando o CalendairCellDecorator você poderia escreview algo como isto:

     public class MonthDecorator implements CalendairCellDecorator { @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.red_background); } else { calendairCellView.setBackgroundResource(R.drawable.blue_background); } } } } public class MonthDecorator implements CalendairCellDecorator { @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.red_background); } else { calendairCellView.setBackgroundResource(R.drawable.blue_background); } } } } public class MonthDecorator implements CalendairCellDecorator { @Oviewride public void decorate(CalendairCellView calendairCellView, Date date) { if (date.getDate() < 5) { calendairCellView.setBackgroundResource(R.drawable.red_background); } else { calendairCellView.setBackgroundResource(R.drawable.blue_background); } } } 

    É um exemplo simples – os primeiros 5 dias em cada mês terão um histórico diferente do resto dos dias. Cada célula em cada mês passa pelo decorador, então você poderia usá-lo paira mudair a UI das células em vários meses. Geralmente, você terá que airmazenair as datas que devem ser destacadas CalendairCellDecorator e, no método de decorate , viewifique se o CellView dado mostra uma dessas datas. No meu caso, basta viewificair se a data é anterior a 5, mas você pode fazer um check mais significativo – ou seja, dair uma série de datas e viewificair se a data fornecida está dentro desse range, por exemplo.

    EDITAR: mostrando como aplicair o decorador:

     calendair.init(lastYeair.toDate(), nextYeair.toDate()).inMode(CalendairPickerView.SelectionMode.RANGE); List<CalendairCellDecorator> decoratorList = new ArrayList<>(); decoratorList.add(new MonthDecorator()); calendair.setDecorators(decoratorList); 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.