Android Showcase View 怎么用? [英] Android Showcase View how to use?

查看:33
本文介绍了Android Showcase View 怎么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

适合展示视图

我使用这个:

您可以使用此代码使用多个 showCaseView

1 在 Gradle.build 中添加库实现'com.github.mreram:ShowCaseView:1.0.5'

通过标题、描述文本、视图或视图 ID 和类型简单调用此方法

 ShowIntro("SetTheme", "Select Theme and Apply on your video", R.id.button_tool_theme, 1);

像这样创建方法

 private void ShowIntro(String title, String text, int viewId, final int type) {新的 GuideView.Builder(this).setTitle(标题).setContentText(文本).setTargetView((LinearLayout)findViewById(viewId)).setContentTextSize(12)//可选.setTitleTextSize(14)//可选.setDismissType(GuideView.DismissType.targetView)//可选 - 默认被 TargetView 关闭.setGuideListener(new GuideView.GuideListener() {@覆盖public void onDismiss(查看视图){如果(类型== 1){ShowIntro("Editor", "编辑所选照片中的任何照片而不是应用于您的视频", R.id.button_tool_editor, 6);} else if (type == 6) {ShowIntro("Duration", "设置照片之间的持续时间", R.id.button_tool_duration, 2);} else if (type == 2) {ShowIntro("过滤器", "为视频添加过滤器", R.id.button_tool_effect, 4);} else if (type == 4) {ShowIntro("添加歌曲", "在您的视频中添加您选择的歌曲", R.id.button_tool_music, 3);} else if (type == 3) {ShowIntro("Overlay", "在你的视频上添加你选择的叠加效果", R.id.button_tool_overlay, 5);} else if (type == 5) {SharePrefUtils.putBoolean("showcase", false);}}}).建造().展示();}

Well For Showcase View

I using this:

https://github.com/amlcurran/ShowcaseView

After importing files it gives error. this is my errors and improted .jar files

Errors says

in java

R cannot be resolved to a variable

in style

error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light'.

again, in style

error: Error: No resource found that matches the given name: attr 'android:fontFamily'.

Also Are there any tutorial to use Showcase view in my project. I can not find and I didnt understant from github project. it is not clear.

解决方案

This library works Awesome for all. How it works?? i want to highlight a toolbar option. Now just add the library and write code like this.

you can use multiple showCaseView using this code

1 add Library in our Gradle.build implementation 'com.github.mreram:ShowCaseView:1.0.5'

simple call this method with pass title, Description Text, view or view Id and Type

  ShowIntro("SetTheme", "Select Theme and Apply on your video", R.id.button_tool_theme, 1);

method create like this

 private void ShowIntro(String title, String text, int viewId, final int type) {

    new GuideView.Builder(this)
            .setTitle(title)
            .setContentText(text)
            .setTargetView((LinearLayout)findViewById(viewId))
            .setContentTextSize(12)//optional
            .setTitleTextSize(14)//optional
            .setDismissType(GuideView.DismissType.targetView) //optional - default dismissible by TargetView
            .setGuideListener(new GuideView.GuideListener() {
                    @Override
                    public void onDismiss(View view) {
                        if (type == 1) {
                            ShowIntro("Editor", "Edit any photo from selected photos than Apply on your video", R.id.button_tool_editor, 6);
                        } else if (type == 6) {
                            ShowIntro("Duration", "Set duration between photos", R.id.button_tool_duration, 2);
                        } else if (type == 2) {
                            ShowIntro("Filter", "Add filter to video ", R.id.button_tool_effect, 4);
                        } else if (type == 4) {
                            ShowIntro("Add Song", "Add your selected song on your video ", R.id.button_tool_music, 3);
                        } else if (type == 3) {
                            ShowIntro("Overlay", "Add your selected overlay effect on your video ", R.id.button_tool_overlay, 5);
                        } else if (type == 5) {
                            SharePrefUtils.putBoolean("showcase", false);
                        }
                    }
                })
            .build()
            .show();
}

这篇关于Android Showcase View 怎么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆