use of org.wikipedia.onboarding.OnboardingView in project apps-android-wikipedia by wikimedia.
the class ReadingListsFragment method maybeShowOnboarding.
private void maybeShowOnboarding() {
onboardingContainer.removeAllViews();
if (AccountUtil.isLoggedIn() && !Prefs.isReadingListSyncEnabled() && Prefs.isReadingListSyncReminderEnabled() && !ReadingListSyncAdapter.isDisabledByRemoteConfig()) {
OnboardingView onboardingView = new OnboardingView(requireContext());
onboardingView.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.base20));
onboardingView.setTitle(R.string.reading_lists_sync_reminder_title);
onboardingView.setText(StringUtil.fromHtml(getString(R.string.reading_lists_sync_reminder_text)));
onboardingView.setPositiveAction(R.string.reading_lists_sync_reminder_action);
onboardingContainer.addView(onboardingView);
onboardingView.setCallback(new SyncReminderOnboardingCallback());
} else if (!AccountUtil.isLoggedIn() && Prefs.isReadingListLoginReminderEnabled() && !ReadingListSyncAdapter.isDisabledByRemoteConfig()) {
OnboardingView onboardingView = new OnboardingView(requireContext());
onboardingView.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.base20));
onboardingView.setTitle(R.string.reading_list_login_reminder_title);
onboardingView.setText(R.string.reading_lists_login_reminder_text);
onboardingView.setNegativeAction(R.string.reading_lists_onboarding_got_it);
onboardingView.setPositiveAction(R.string.menu_login);
onboardingContainer.addView(onboardingView);
onboardingView.setCallback(new LoginReminderOnboardingCallback());
}
}
Aggregations