-
Notifications
You must be signed in to change notification settings - Fork 411
/
IntroActivity.java
81 lines (71 loc) · 3.37 KB
/
IntroActivity.java
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
70
71
72
73
74
75
76
77
78
79
80
81
package agency.tango.materialintro;
import android.Manifest;
import android.os.Bundle;
import android.support.annotation.FloatRange;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.Toast;
import agency.tango.materialintroscreen.MaterialIntroActivity;
import agency.tango.materialintroscreen.MessageButtonBehaviour;
import agency.tango.materialintroscreen.SlideFragmentBuilder;
import agency.tango.materialintroscreen.animations.IViewTranslation;
public class IntroActivity extends MaterialIntroActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
enableLastSlideAlphaExitTransition(true);
getBackButtonTranslationWrapper()
.setEnterTranslation(new IViewTranslation() {
@Override
public void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage) {
view.setAlpha(percentage);
}
});
addSlide(new SlideFragmentBuilder()
.backgroundColor(R.color.first_slide_background)
.buttonsColor(R.color.first_slide_buttons)
.image(R.drawable.img_office)
.title("Organize your time with us")
.description("Would you try?")
.build(),
new MessageButtonBehaviour(new View.OnClickListener() {
@Override
public void onClick(View v) {
showMessage("We provide solutions to make you love your work");
}
}, "Work with love"));
addSlide(new SlideFragmentBuilder()
.backgroundColor(R.color.second_slide_background)
.buttonsColor(R.color.second_slide_buttons)
.title("Want more?")
.description("Go on")
.build());
addSlide(new CustomSlide());
addSlide(new SlideFragmentBuilder()
.backgroundColor(R.color.third_slide_background)
.buttonsColor(R.color.third_slide_buttons)
.possiblePermissions(new String[]{Manifest.permission.CALL_PHONE, Manifest.permission.READ_SMS})
.neededPermissions(new String[]{Manifest.permission.CAMERA, Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION})
.image(R.drawable.img_equipment)
.title("We provide best tools")
.description("ever")
.build(),
new MessageButtonBehaviour(new View.OnClickListener() {
@Override
public void onClick(View v) {
showMessage("Try us!");
}
}, "Tools"));
addSlide(new SlideFragmentBuilder()
.backgroundColor(R.color.fourth_slide_background)
.buttonsColor(R.color.fourth_slide_buttons)
.title("That's it")
.description("Would you join us?")
.build());
}
@Override
public void onFinish() {
super.onFinish();
Toast.makeText(this, "Try this library in your project! :)", Toast.LENGTH_SHORT).show();
}
}