-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathIntroActivity.java
More file actions
69 lines (55 loc) · 2.7 KB
/
Copy pathIntroActivity.java
File metadata and controls
69 lines (55 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.wesaphzt.privatelocation;
import android.os.Bundle;
import android.view.WindowManager;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import com.github.paolorotolo.appintro.AppIntro;
import com.github.paolorotolo.appintro.AppIntroFragment;
import com.github.paolorotolo.appintro.model.SliderPage;
public class IntroActivity extends AppIntro {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//fullscreen
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
//slider pages
SliderPage sliderPageOne = new SliderPage();
sliderPageOne.setTitle(getResources().getString(R.string.slider_page_one_title));
sliderPageOne.setDescription(getString(R.string.slider_page_one_desc));
sliderPageOne.setImageDrawable(R.drawable.ic_intro_location);
sliderPageOne.setBgColor(getResources().getColor(R.color.colorPrimary));
addSlide(AppIntroFragment.newInstance(sliderPageOne));
SliderPage sliderPageTwo = new SliderPage();
sliderPageTwo.setTitle(getResources().getString(R.string.slider_page_two_title));
sliderPageTwo.setDescription(getResources().getString(R.string.slider_page_two_desc));
sliderPageTwo.setImageDrawable(R.drawable.ic_intro_cloud);
sliderPageTwo.setBgColor(getResources().getColor(R.color.colorIntroGrey));
addSlide(AppIntroFragment.newInstance(sliderPageTwo));
SliderPage sliderPageThree = new SliderPage();
sliderPageThree.setTitle(getResources().getString(R.string.slider_page_three_title));
sliderPageThree.setDescription(getResources().getString(R.string.slider_page_three_desc));
sliderPageThree.setImageDrawable(R.drawable.ic_intro_settings);
sliderPageThree.setBgColor(getResources().getColor(R.color.colorIntroGreen));
addSlide(AppIntroFragment.newInstance(sliderPageThree));
//options
setFadeAnimation();
showSkipButton(false);
setProgressButtonEnabled(true);
//setBarColor(getResources().getColor(R.color.colorPrimary));
//setSeparatorColor(getResources().getColor(R.color.white));
}
@Override
public void onSkipPressed(Fragment currentFragment) {
super.onSkipPressed(currentFragment);
}
@Override
public void onDonePressed(Fragment currentFragment) {
super.onDonePressed(currentFragment);
finish();
}
@Override
public void onSlideChanged(@Nullable Fragment oldFragment, @Nullable Fragment newFragment) {
super.onSlideChanged(oldFragment, newFragment);
}
}