Search in sources :

Example 1 with ShowcaseView

use of com.github.amlcurran.showcaseview.ShowcaseView in project ShowcaseView by amlcurran.

the class CustomTextActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_text);
    TextPaint paint = new TextPaint(Paint.ANTI_ALIAS_FLAG);
    paint.setTextSize(getResources().getDimension(R.dimen.abc_text_size_body_1_material));
    paint.setStrikeThruText(true);
    paint.setColor(Color.RED);
    paint.setTypeface(Typeface.createFromAsset(getAssets(), "RobotoSlab-Regular.ttf"));
    TextPaint title = new TextPaint(Paint.ANTI_ALIAS_FLAG);
    title.setTextSize(getResources().getDimension(R.dimen.abc_text_size_headline_material));
    title.setUnderlineText(true);
    title.setColor(Color.YELLOW);
    title.setTypeface(Typeface.createFromAsset(getAssets(), "RobotoSlab-Regular.ttf"));
    ShowcaseView showcaseView = new ShowcaseView.Builder(this).withNewStyleShowcase().setTarget(new ViewTarget(R.id.imageView, this)).setContentTextPaint(paint).setContentTitle(R.string.custom_text_painting_title).setContentText(R.string.custom_text_painting_text).setContentTitlePaint(title).build();
    showcaseView.setDetailTextAlignment(Layout.Alignment.ALIGN_CENTER);
    showcaseView.setTitleTextAlignment(Layout.Alignment.ALIGN_CENTER);
    showcaseView.forceTextPosition(ShowcaseView.BELOW_SHOWCASE);
}
Also used : ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget) ShowcaseView(com.github.amlcurran.showcaseview.ShowcaseView) TextPaint(android.text.TextPaint)

Example 2 with ShowcaseView

use of com.github.amlcurran.showcaseview.ShowcaseView in project ShowcaseView by amlcurran.

the class MemoryManagementTesting method showcase.

private void showcase() {
    new ShowcaseView.Builder(this).withMaterialShowcase().setContentText(String.format("Showing %1$d", currentShowcase)).setTarget(new ViewTarget(R.id.buttonBlocked, this)).setShowcaseEventListener(new SimpleShowcaseEventListener() {

        @Override
        public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
            currentShowcase++;
            showcase();
        }
    }).build();
}
Also used : SimpleShowcaseEventListener(com.github.amlcurran.showcaseview.SimpleShowcaseEventListener) ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget) ShowcaseView(com.github.amlcurran.showcaseview.ShowcaseView)

Aggregations

ShowcaseView (com.github.amlcurran.showcaseview.ShowcaseView)2 ViewTarget (com.github.amlcurran.showcaseview.targets.ViewTarget)2 TextPaint (android.text.TextPaint)1 SimpleShowcaseEventListener (com.github.amlcurran.showcaseview.SimpleShowcaseEventListener)1