Closed Cornholio2108 closed 4 years ago
https://medium.com/tangoagency/material-intro-screen-for-android-apps-c4317fbac923
dependencies {
compile 'agency.tango.android:material-intro-screen:{latest_release}'
}
public class IntroActivity extends MaterialIntroActivity
<activity
android:name=".IntroActivity"
android:theme="@style/Theme.Intro" />
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addSlide(new SlideFragmentBuilder()
.backgroundColor(R.color.colorPrimary)
.buttonsColor(R.color.colorAccent)
.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(agency.tango.materialintroscreen.R.drawable.ic_next)
.title("title 3")
.description("Description 3")
.build(),
new MessageButtonBehaviour(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(IntroActivity.this, "We provide solutions to make you love your work", Toast.LENGTH_SHORT).show();
}
}, "Work with love"));
}
public class CustomSlide extends SlideFragment {
private CheckBox checkBox;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
final View view = inflater.inflate(R.layout.fragment_custom_slide, container, false);
checkBox = (CheckBox) view.findViewById(R.id.checkBox);
return view;
}
@Override
public int backgroundColor() {
return R.color.custom_slide_background;
}
@Override
public int buttonsColor() {
return R.color.custom_slide_buttons;
}
@Override
public boolean canMoveFurther() {
return checkBox.isChecked();
}
@Override
public String cantMoveFurtherErrorMessage() {
return getString(R.string.error_message);
}
}
done
Add onBoarding / App Intro for new User