publicclassCalendarioextendsAppCompatActivityimplementsView.OnClickListener{Buttonvoltar;com.prolificinteractive.materialcalendarview.MaterialCalendarViewcalendarView;@Bind(R.id.calendarView)MaterialCalendarViewwidget;UserLocalStoreuserLocalStore;privateintcurrentTileSize;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_calendario);ButterKnife.bind(this);voltar=(Button)findViewById(R.id.voltar);calendarView=(com.prolificinteractive.materialcalendarview.MaterialCalendarView)findViewById(R.id.calendarView);voltar.setOnClickListener(this);currentTileSize=MaterialCalendarView.DEFAULT_TILE_SIZE_DP;userLocalStore=newUserLocalStore(this);}@OnClick(R.id.button_clear_selection)voidonClearSelection(){widget.clearSelection();}@OnClick(R.id.button_selection_mode)voidonChangeSelectionMode(){CharSequence[]items={"Nenhuma seleção",
"Uma Data",
"Multiplas Datas"
};
new AlertDialog.Builder(this)
.setTitle("Selecione o modo:")
.setSingleChoiceItems(items, widget.getSelectionMode(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
widget.setSelectionMode(which);
dialog.dismiss();
}
})
.show();
}
private static final int[] DAYS_OF_WEEK = {
Calendar.SUNDAY,
Calendar.MONDAY,
Calendar.TUESDAY,
Calendar.WEDNESDAY,
Calendar.THURSDAY,
Calendar.FRIDAY,
Calendar.SATURDAY,
};
@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.voltar:
userLocalStore.setUserLoggedIn(true);
Intent loginIntent = new Intent(this, MainActivity.class);
startActivity(loginIntent);
break;
}
}
}