本文整理汇总了Java中com.roomorama.caldroid.CaldroidListener类的典型用法代码示例。如果您正苦于以下问题:Java CaldroidListener类的具体用法?Java CaldroidListener怎么用?Java CaldroidListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CaldroidListener类属于com.roomorama.caldroid包,在下文中一共展示了CaldroidListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initCalendar
import com.roomorama.caldroid.CaldroidListener; //导入依赖的package包/类
private void initCalendar(final long foodId, final int recommendedServings) {
datesWithEvents = new ArrayMap<>();
caldroid = CaldroidFragment.newInstance("", DateUtil.getCurrentMonthOneBased(), DateUtil.getCurrentYear());
caldroid.setCaldroidListener(new CaldroidListener() {
@Override
public void onSelectDate(Date date, View view) {
setResult(Args.SELECTABLE_DATE_REQUEST, Common.createShowDateIntent(date));
finish();
}
@Override
public void onChangeMonth(int month, int year) {
super.onChangeMonth(month, year);
displayEntriesForVisibleMonths(DateUtil.getCalendarForYearAndMonth(year, month - 1), foodId);
}
});
vgLegend.setVisibility(recommendedServings > 1 ? View.VISIBLE : View.GONE);
final FragmentTransaction t = getSupportFragmentManager().beginTransaction();
t.replace(R.id.calendar_fragment_container, caldroid);
t.commit();
}
示例2: onCreate
import com.roomorama.caldroid.CaldroidListener; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fragment_with_toolbar);
ButterKnife.bind(this);
CalendarActivityIntentBuilder.inject(getIntent(), this);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
userRecords = new UserRecords(this);
DateTime today = DateTime.now();
if (defDateTime == null) {
defDateTime = today;
}
Bundle args = new Bundle();
args.putInt(CaldroidFragment.MONTH, defDateTime.getMonthOfYear());
args.putInt(CaldroidFragment.YEAR, defDateTime.getYear());
fragment = new CaldroidFragment();
fragment.setArguments(args);
fragment.setMaxDate(today.toDate());
fragment.setSelectedDate(defDateTime.toDate());
fragment.setCaldroidListener(new CaldroidListener() {
@Override
public void onSelectDate(Date date, View view) {
onDateSelected(date);
}
});
getSupportFragmentManager().beginTransaction()
.replace(R.id.content, fragment)
.commit();
loadPrayerRecords();
}
示例3: initialize
import com.roomorama.caldroid.CaldroidListener; //导入依赖的package包/类
public void initialize() {
mis = getIntent().getStringExtra("mis");
FSMID = getIntent().getIntExtra("FSMID", 0);
SID = getIntent().getStringExtra("SID");
name = getIntent().getStringExtra("name");
title = (TextView) findViewById(R.id.title);
edit = (ImageButton) findViewById(R.id.ibEdit);
present = (TextView) findViewById(R.id.tvPresent);
absent = (TextView) findViewById(R.id.tvAbsent);
percentage = (TextView) findViewById(R.id.tvAttendance);
lvAttendance = (HListView) findViewById(R.id.lvAttendance);
title.setText(mis);
edit.setOnClickListener(this);
databaseHelper = new DatabaseHelper(this);
attendance = new List[3];
attendance[0] = new ArrayList<>();
attendance[1] = new ArrayList<>();
attendance[2] = new ArrayList<>();
backgroundForDateMap = new HashMap<>();
textForDateMap = new HashMap<>();
presentDates = new ArrayList<>();
absentDates = new ArrayList<>();
timeAttend = new ArrayList[2];
modify = new ArrayList[3];
modified = new ArrayList[3];
modify[0] = new ArrayList<>();
modify[1] = new ArrayList<>();
modify[2] = new ArrayList<>();
modified[0] = new ArrayList<>();
modified[1] = new ArrayList<>();
modified[2] = new ArrayList<>();
listener = new CaldroidListener() {
@Override
public void onSelectDate(Date date, View view) {
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
String date_string = sdf.format(date);
date_string = parseDateToddMMyyyy(date_string, 2);
timeAttend = getTimeForDate(date_string); //getting all lecture times for selected date
AttendanceAdapter adapter = new AttendanceAdapter(getApplicationContext(), timeAttend[0], timeAttend[1], parseDateToddMMyyyy(date_string, 1), present, absent, percentage);
lvAttendance.setAdapter(adapter);
lvAttendance.setVisibility(View.VISIBLE);
}
};
}