amlcurran / ShowcaseView

[Archived] Highlight the best bits of your app to users quickly, simply, and cool...ly
5.6k stars 1.29k forks source link

I use my own custom style, but I want to use cling.png circle like the original, how? #464

Open topex-psy opened 6 years ago

topex-psy commented 6 years ago

I've created & use my own custom style like below, but I want to use cling.png circle like the original. How to achieve that? I've tried to put it in sv_showcaseColor but it can't accept drawable. Any solution?

<style name="CustomShowcaseMaterial" parent="ShowcaseView">
    <item name="sv_backgroundColor">#CC000000</item>
    <item name="sv_showcaseColor">@drawable/cling</item>
    <item name="sv_buttonText">Mengerti!</item>
    <item name="sv_titleTextAppearance">@style/CustomTitleMaterial</item>
    <item name="sv_detailTextAppearance">@style/CustomTextMaterial</item>
</style>

<style name="CustomTitleMaterial" parent="TextAppearance.ShowcaseView.Title.Light">
    <item name="android:textColor">@color/background_active</item>
</style>

<style name="CustomTextMaterial" parent="TextAppearance.ShowcaseView.Detail.Light">
    <item name="android:textColor">#ffffff</item>
</style>

In my fragment:

Target target = new ViewTarget(R.id.menu_cari, act);
                    new ShowcaseView.Builder(act)
                            .setTarget(target)
                            .setContentTitle("Ingin Cari Kampus?")
                            .setContentText("Klik tombol ini dan temukan kampus sesuai dengan kriteria Anda!")
                            .hideOnTouchOutside()
                            .withMaterialShowcase()
                            .setStyle(R.style.CustomShowcaseMaterial)
                            .build();