Advertisement
luck-alex13

IntroActivity

Apr 23rd, 2018
225
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 4.23 KB | None | 0 0
  1. public class IntroActivity extends MaterialIntroActivity {
  2.  
  3.     @Override
  4.     protected void onCreate(Bundle savedInstanceState) {
  5.         super.onCreate(savedInstanceState);
  6.  
  7.  
  8.         addSlide(new SlideFragmentBuilder()
  9.                 .backgroundColor(R.color.orange_intro)
  10.                 .buttonsColor(R.color.whiteTransparent)
  11.                 .image(R.drawable.ic_magnifier_dollar_gold)
  12.                 .title(getString(R.string.looking_for_Easy_Money))
  13.                 .description(getString(R.string.we_are_happy_to_help))
  14.                 .build());
  15.         addSlide(new SlideFragmentBuilder()
  16.                 .backgroundColor(R.color.green)
  17.                 .buttonsColor(R.color.whiteTransparent)
  18.                 .image(R.drawable.ic_google_play_logo)
  19.                 .title(getString(R.string.find_and_install_intro))
  20.                 .description(getString(R.string.find_the_app_on_Google_Play_and_install))
  21.                 .build());
  22.  
  23.         addSlide(new SlideFragmentBuilder()
  24.                 .backgroundColor(R.color.blue)
  25.                 .buttonsColor(R.color.whiteTransparent)
  26.                 .image(R.drawable.ic_gamepad)
  27.                 .title(getString(R.string.launch_the_application))
  28.                 .description(getString(R.string.run_the_application_for_at_least_30_seconds))
  29.                 .build());
  30.  
  31.         addSlide(new SlideFragmentBuilder()
  32.                 .backgroundColor(R.color.grey)
  33.                 .image(R.drawable.ic_clock_with_padding)
  34.                 .buttonsColor(R.color.whiteTransparent)
  35.                 .title(getString(R.string.save_for_3_days))
  36.                 .description(getString(R.string.dont_uninstall_the_app_for_3_days))
  37.                 .build());
  38.  
  39.         addSlide(new SlideFragmentBuilder()
  40.                 .image(R.drawable.ic_transaction)
  41.                 .backgroundColor(R.color.red_pastel)
  42.                 .buttonsColor(R.color.whiteTransparent)
  43.                 .title(getString(R.string.get_the_reward))
  44.                 .build());
  45.  
  46.         addSlide(new SlideFragmentBuilder()
  47.                 .backgroundColor(R.color.ametist)
  48.                 .buttonsColor(R.color.whiteTransparent)
  49.                 .image(R.drawable.ic_users)
  50.                 .title(getString(R.string.invite_friends))
  51.                 .description(getString(R.string.invite_friends_with_your_promocode))
  52.                 .build());
  53.  
  54.         addSlide(new DangerSlide());
  55.  
  56.         addSlide(new SlideFragmentBuilder()
  57.                         .backgroundColor(R.color.green_sea)
  58.                         .buttonsColor(R.color.whiteTransparent)
  59.                         .image(R.drawable.ic_gears_white)
  60.                         .neededPermissions(new String[]{Manifest.permission.READ_PHONE_STATE, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION})
  61.                         .description(getString(R.string.permissions_slide_description))
  62.                         .build(),
  63.                 new MessageButtonBehaviour(new View.OnClickListener() {
  64.                     @Override
  65.                     public void onClick(View v) {
  66.                         findViewById(R.id.button_next).performClick();
  67.                     }
  68.                 }, getString(R.string.action_continue)));
  69.  
  70.         addSlide(new SlideFragmentBuilder()
  71.                 .backgroundColor(R.color.blue_light)
  72.                 .buttonsColor(R.color.whiteTransparent)
  73.                 .image(R.drawable.ic_chat)
  74.                 .title(getString(R.string.there_were_questions))
  75.                 .description(getString(R.string.apply_to_support))
  76.                 .build());
  77.  
  78.         addSlide(new SlideFragmentBuilder()
  79.                 .backgroundColor(R.color.colorPrimary)
  80.                 .buttonsColor(R.color.whiteTransparent)
  81.                 .image(R.drawable.ic_dollar)
  82.                 .title(getString(R.string.start_earning_right_now))
  83.                 .build());
  84.  
  85.     }
  86.  
  87.     @Override
  88.     public void onFinish() {
  89.         super.onFinish();
  90.         Config.setIntroViewed(true);
  91.         Intent myIntent;
  92.         myIntent = new Intent(this, MainActivity.class);
  93.         myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
  94.         myIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
  95.         startActivity(myIntent);
  96.     }
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement