Search in sources :

Example 11 with ViewTarget

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

the class CustomShowcaseActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_custom_showcase);
    new ShowcaseView.Builder(this).setTarget(new ViewTarget(R.id.imageView, this)).setContentTitle(R.string.custom_text_painting_title).setContentText(R.string.custom_text_painting_text).setShowcaseDrawer(new CustomShowcaseView(getResources())).build();
}
Also used : ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget) ShowcaseView(com.github.amlcurran.showcaseview.ShowcaseView)

Example 12 with ViewTarget

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

the class EventsActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_events);
    TextView eventLog = (TextView) findViewById(R.id.events_log);
    Button customButton = (Button) getLayoutInflater().inflate(R.layout.view_custom_button, null);
    MultiEventListener multiEventListener = new MultiEventListener(new LogToTextListener(eventLog), new ShakeButtonListener(customButton));
    new ShowcaseView.Builder(this).withMaterialShowcase().setStyle(R.style.CustomShowcaseTheme3).setTarget(new ViewTarget(R.id.imageView, this)).setContentTitle("Events").setContentText("Listening to ShowcaseView events is easy!").setShowcaseEventListener(multiEventListener).replaceEndButton(customButton).build();
}
Also used : Button(android.widget.Button) SpannableStringBuilder(android.text.SpannableStringBuilder) TextView(android.widget.TextView) ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget)

Example 13 with ViewTarget

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

the class MainActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    setSupportActionBar((Toolbar) findViewById(R.id.toolbar));
    HardcodedListAdapter adapter = new HardcodedListAdapter(this);
    listView = (ListView) findViewById(R.id.listView);
    listView.setAdapter(adapter);
    listView.setOnItemClickListener(this);
    buttonBlocked = (Button) findViewById(R.id.buttonBlocked);
    buttonBlocked.setOnClickListener(this);
    RelativeLayout.LayoutParams lps = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    lps.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
    lps.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
    int margin = ((Number) (getResources().getDisplayMetrics().density * 12)).intValue();
    lps.setMargins(margin, margin, margin, margin);
    ViewTarget target = new ViewTarget(R.id.buttonBlocked, this);
    sv = new ShowcaseView.Builder(this).withMaterialShowcase().setTarget(target).setContentTitle(R.string.showcase_main_title).setContentText(R.string.showcase_main_message).setStyle(R.style.CustomShowcaseTheme2).setShowcaseEventListener(this).replaceEndButton(R.layout.view_custom_button).build();
    sv.setButtonPosition(lps);
}
Also used : RelativeLayout(android.widget.RelativeLayout) ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget) ShowcaseView(com.github.amlcurran.showcaseview.ShowcaseView)

Example 14 with ViewTarget

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

the class SingleShotActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_single_shot);
    Target viewTarget = new ViewTarget(R.id.button, this);
    new ShowcaseView.Builder(this).setTarget(viewTarget).setContentTitle(R.string.title_single_shot).setContentText(R.string.R_string_desc_single_shot).singleShot(42).build();
}
Also used : ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget) Target(com.github.amlcurran.showcaseview.targets.Target) ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget) ShowcaseView(com.github.amlcurran.showcaseview.ShowcaseView)

Example 15 with ViewTarget

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

the class ViewTargets method navigationButtonViewTarget.

/**
     * Highlight the navigation button (the Up or Navigation drawer button) in a Toolbar
     * @param toolbar The toolbar to search for the view in
     * @return the {@link ViewTarget} to supply to a {@link com.github.amlcurran.showcaseview.ShowcaseView}
     * @throws MissingViewException when the view couldn't be found. Raise an issue on Github if you get this!
     */
public static ViewTarget navigationButtonViewTarget(Toolbar toolbar) throws MissingViewException {
    try {
        Field field = Toolbar.class.getDeclaredField("mNavButtonView");
        field.setAccessible(true);
        View navigationView = (View) field.get(toolbar);
        return new ViewTarget(navigationView);
    } catch (NoSuchFieldException e) {
        throw new MissingViewException(e);
    } catch (IllegalAccessException e) {
        throw new MissingViewException(e);
    }
}
Also used : Field(java.lang.reflect.Field) ViewTarget(com.github.amlcurran.showcaseview.targets.ViewTarget) View(android.view.View)

Aggregations

ViewTarget (com.github.amlcurran.showcaseview.targets.ViewTarget)16 ShowcaseView (com.github.amlcurran.showcaseview.ShowcaseView)11 View (android.view.View)7 Button (android.widget.Button)7 TextView (android.widget.TextView)6 RecyclerView (android.support.v7.widget.RecyclerView)5 ImageView (android.widget.ImageView)5 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)4 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)4 RelativeLayout (android.widget.RelativeLayout)4 ClickItemTouchListener (com.sdsmdg.harjot.MusicDNA.clickitemtouchlistener.ClickItemTouchListener)4 Handler (android.os.Handler)3 UnifiedTrack (com.sdsmdg.harjot.MusicDNA.models.UnifiedTrack)3 PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)2 FloatingActionButton (android.support.design.widget.FloatingActionButton)2 TextPaint (android.text.TextPaint)2 MenuItem (android.view.MenuItem)2 AdapterView (android.widget.AdapterView)2 SeekBar (android.widget.SeekBar)2 ImageLoader (com.sdsmdg.harjot.MusicDNA.imageloader.ImageLoader)2