public class Calendario extends AppCompatActivity implements View.OnClickListener {
Button voltar;
com.prolificinteractive.materialcalendarview.MaterialCalendarView calendarView;
@Bind(R.id.calendarView)
MaterialCalendarView widget;
UserLocalStore userLocalStore;
private int currentTileSize;
@Override
protected void onCreate(Bundle savedInstanceState) {
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 = new UserLocalStore(this);
}
@OnClick(R.id.button_clear_selection)
void onClearSelection() {
widget.clearSelection();
}
@OnClick(R.id.button_selection_mode)
void onChangeSelectionMode() {
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;
}
}
}