本文整理匯總了Java中com.chyrta.onboarder.OnboarderPage類的典型用法代碼示例。如果您正苦於以下問題:Java OnboarderPage類的具體用法?Java OnboarderPage怎麽用?Java OnboarderPage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OnboarderPage類屬於com.chyrta.onboarder包,在下文中一共展示了OnboarderPage類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.chyrta.onboarder.OnboarderPage; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
List<OnboarderPage> onboarderPages = new ArrayList<>();
// Create your first page
OnboarderPage onboarderPage1 = new OnboarderPage(getString(R.string.intro1_title), getString(R.string.intro1_text), R.drawable.ic_launcher_intro);
OnboarderPage onboarderPage2 = new OnboarderPage(getString(R.string.intro2_title), getString(R.string.intro2_text), R.drawable.s_1);
OnboarderPage onboarderPage3 = new OnboarderPage(getString(R.string.intro3_title), getString(R.string.intro3_text), R.drawable.s_2);
OnboarderPage onboarderPage4 = new OnboarderPage(getString(R.string.intro4_title), getString(R.string.intro4_text), R.drawable.s_3);
OnboarderPage onboarderPage5 = new OnboarderPage(getString(R.string.intro5_title), getString(R.string.intro5_text), R.drawable.s_4);
// You can define title and description colors (by default white)
onboarderPage1.setTitleColor(R.color.colorAccent);
onboarderPage1.setBackgroundColor(R.color.colorPrimary_blue);
onboarderPage2.setTitleColor(R.color.colorAccent);
onboarderPage2.setBackgroundColor(R.color.colorPrimary_blue);
onboarderPage3.setTitleColor(R.color.colorAccent);
onboarderPage3.setBackgroundColor(R.color.colorPrimary_blue);
onboarderPage4.setTitleColor(R.color.colorAccent);
onboarderPage4.setBackgroundColor(R.color.colorPrimary_blue);
onboarderPage5.setTitleColor(R.color.colorAccent);
onboarderPage5.setBackgroundColor(R.color.colorPrimary_blue);
// Add your pages to the fragments
onboarderPages.add(onboarderPage1);
onboarderPages.add(onboarderPage2);
onboarderPages.add(onboarderPage3);
onboarderPages.add(onboarderPage4);
onboarderPages.add(onboarderPage5);
// And pass your pages to 'setOnboardPagesReady' method
setActiveIndicatorColor(R.color.colorLight);
setInactiveIndicatorColor(R.color.colorLight_trans);
shouldDarkenButtonsLayout(true);
setSkipButtonHidden();
setFinishButtonTitle(getString(R.string.intro_finish));
setOnboardPagesReady(onboarderPages);
}
示例2: populateOnboardingList
import com.chyrta.onboarder.OnboarderPage; //導入依賴的package包/類
private List<OnboarderPage> populateOnboardingList() {
List<OnboarderPage> onboardingList = new ArrayList<>();
onboardingList.add(new OnboarderPage(getString(R.string.title_onboard_0), getString(R.string.msg_onboard_0), R.drawable.onboarder_0));
onboardingList.get(0).setBackgroundColor(R.color.onboarding_0);
onboardingList.add(new OnboarderPage(getString(R.string.title_onboard_1), getString(R.string.msg_onboard_1), R.drawable.onboarder_1));
onboardingList.get(1).setBackgroundColor(R.color.onboarding_1);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
onboardingList.add(new OnboarderPage(getString(R.string.title_onboard_2), getString(R.string.msg_onboard_2), R.drawable.onboarder_2));
onboardingList.get(2).setBackgroundColor(R.color.onboarding_2);
}
return onboardingList;
}
示例3: onCreate
import com.chyrta.onboarder.OnboarderPage; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
OnboarderPage onboarderPage1 = new OnboarderPage("JumpGo Dev Edition", "Welcome to the developer edition!", R.drawable.planet1);
OnboarderPage onboarderPage2 = new OnboarderPage("Venus", "The love goddess", R.drawable.planet2);
OnboarderPage onboarderPage3 = new OnboarderPage("Mars", "Say hi to Curiosity!", R.drawable.planet3);
onboarderPage1.setBackgroundColor(R.color.onboarder_bg_1);
onboarderPage2.setBackgroundColor(R.color.onboarder_bg_2);
onboarderPage3.setBackgroundColor(R.color.onboarder_bg_3);
List<OnboarderPage> pages = new ArrayList<>();
pages.add(onboarderPage1);
pages.add(onboarderPage2);
pages.add(onboarderPage3);
for (OnboarderPage page : pages) {
page.setTitleColor(R.color.primary_text);
page.setDescriptionColor(R.color.secondary_text);
//page.setMultilineDescriptionCentered(true);
}
setSkipButtonTitle("Skip");
setFinishButtonTitle("Finish");
setOnboardPagesReady(pages);
}