标签:gety new t 可见 acs space order system sim 高亮
最最轻量级的新手引导库,能够快速为任何一个View创建一个遮罩层,支持单个页面,多个引导提示,支持为高亮区域设置不同的图形,支持引导动画,方便扩展,良好支持fragment
public class SimpleComponent implements Component { @Override public View getView(LayoutInflater inflater) { LinearLayout ll = new LinearLayout(inflater.getContext()); LinearLayout.LayoutParams param = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); ll.setOrientation(LinearLayout.VERTICAL); ll.setLayoutParams(param); TextView textView = new TextView(inflater.getContext()); textView.setText(R.string.welcome); textView.setTextColor(inflater.getContext().getResources().getColor(R.color.color_white)); textView.setTextSize(20); ImageView imageView = new ImageView(inflater.getContext()); imageView.setImageResource(R.mipmap.arrow); ll.removeAllViews(); ll.addView(textView); ll.addView(imageView); ll.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast.makeText(view.getContext(), "引导层被点击了", Toast.LENGTH_SHORT).show(); } }); return ll; } @Override public int getAnchor() { return Component.ANCHOR_BOTTOM; } @Override public int getFitPosition() { return Component.FIT_START; } @Override public int getXOffset() { return 30; } @Override public int getYOffset() { return 0; } } public void showGuideView() { final GuideBuilder builder1 = new GuideBuilder(); builder1.setTargetView(button1) .setAlpha(150) .setOverlayTarget(true)//设置目标区域是否高亮显示 .setOutsideTouchable(false); builder1.setOnVisibilityChangedListener(new GuideBuilder.OnVisibilityChangedListener() { @Override public void onShown() { // Toast.makeText(MutiGuideViewActivity.this, "show", Toast.LENGTH_SHORT).show(); } @Override public void onDismiss() { button2.post(new Runnable() { @Override public void run() { showGuideView2(); } }); // Toast.makeText(MutiGuideViewActivity.this, "dismiss", Toast.LENGTH_SHORT).show(); } }); builder1.addComponent(new SimpleComponent()); Guide guide = builder1.createGuide(); guide.setShouldCheckLocInWindow(false); guide.show(MutiGuideViewActivity.this); }
标签:gety new t 可见 acs space order system sim 高亮
原文地址:http://www.cnblogs.com/huolongluo/p/6268494.html