/*
* MIT License
*
* Copyright (c) 2017 Jan Heinrich Reimer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package com.heinrichreimersoftware.materialintro.demo;
import android.os.Build;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
import android.text.style.TypefaceSpan;
import com.heinrichreimersoftware.materialintro.app.IntroActivity;
import com.heinrichreimersoftware.materialintro.slide.SimpleSlide;
public class CanteenIntroActivity extends IntroActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setButtonBackVisible(false);
setButtonNextVisible(false);
setButtonCtaVisible(true);
setButtonCtaTintMode(BUTTON_CTA_TINT_MODE_BACKGROUND);
TypefaceSpan labelSpan = new TypefaceSpan(
Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP ? "sans-serif-medium" : "sans serif");
SpannableString label = SpannableString
.valueOf(getString(R.string.label_button_cta_canteen_intro));
label.setSpan(labelSpan, 0, label.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
setButtonCtaLabel(label);
setPageScrollDuration(500);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
setPageScrollInterpolator(android.R.interpolator.fast_out_slow_in);
}
addSlide(new SimpleSlide.Builder()
.title(R.string.title_canteen_intro1)
.description(R.string.description_canteen_intro1)
.image(R.drawable.art_canteen_intro1)
.background(R.color.color_canteen)
.backgroundDark(R.color.color_dark_canteen)
.layout(R.layout.slide_canteen)
.build());
addSlide(new SimpleSlide.Builder()
.title(R.string.title_canteen_intro2)
.description(R.string.description_canteen_intro2)
.image(R.drawable.art_canteen_intro2)
.background(R.color.color_canteen)
.backgroundDark(R.color.color_dark_canteen)
.layout(R.layout.slide_canteen)
.build());
addSlide(new SimpleSlide.Builder()
.title(R.string.title_canteen_intro3)
.description(R.string.description_canteen_intro3)
.image(R.drawable.art_canteen_intro3)
.background(R.color.color_canteen)
.backgroundDark(R.color.color_dark_canteen)
.layout(R.layout.slide_canteen)
.build());
autoplay(2500, INFINITE);
}
}