Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access cells content of CaldroidSampleCustomAdapter #458

Open
Eliont opened this issue May 6, 2017 · 1 comment
Open

Access cells content of CaldroidSampleCustomAdapter #458

Eliont opened this issue May 6, 2017 · 1 comment

Comments

@Eliont
Copy link

Eliont commented May 6, 2017

Hello and good time of day.
Managed to get to work custom fragment and i see custom cells.
But how to change this cells content (change tv2 that default has text "Hi") when runtime event occur (i.e. new evend added for date).

@Eliont
Copy link
Author

Eliont commented May 8, 2017

CaldroidSampleCustomAdapter.java and CaldroidSampleCustomFragment.java from example folder.

Adding:
caldroidFragment = new CaldroidSampleCustomFragment();`
Bundle args = new Bundle();
Calendar cal = Calendar.getInstance();
args.putInt(CaldroidFragment.MONTH, cal.get(Calendar.MONTH) + 1);
args.putInt(CaldroidFragment.YEAR, cal.get(Calendar.YEAR));
args.putBoolean(CaldroidFragment.ENABLE_CLICK_ON_DISABLED_DATES, false);
args.putInt(CaldroidFragment.START_DAY_OF_WEEK, CaldroidFragment.MONDAY);
caldroidFragment.setArguments(args);

    FragmentTransaction t = getSupportFragmentManager().beginTransaction();
    t.replace(R.id.calendar1, caldroidFragment);
    t.commit();

    caldroidFragment.setCaldroidListener(listener);

    cal.add(Calendar.DATE, 0);
    Date date = cal.getTime();

    caldroidFragment.setBackgroundResourceForDate(R.color.caldroid_gray, date);
    caldroidFragment.refreshView();`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant