/** * @param context context * @param yOffset offset from top * @param minRippleSize minimum ripple size * @param maxRippleSize max ripple size */ public GuideDialog(Context context, int yOffset, int minRippleSize, int maxRippleSize) { super(context); supportRequestWindowFeature(Window.FEATURE_NO_TITLE); this.minRippleSize = Math.min(minRippleSize, maxRippleSize); this.maxRippleSize = Math.max(minRippleSize, maxRippleSize); this.yOffset = yOffset; guideLayout = new GuideLayout(getContext()); }
/** * @param context context * @param yOffset offset from top * @param minRippleSize minimum ripple size * @param maxRippleSize max ripple size */ public GuidePopupView(Context context, int yOffset, int minRippleSize, int maxRippleSize) { this.minRippleSize = Math.min(minRippleSize, maxRippleSize); this.maxRippleSize = Math.max(minRippleSize, maxRippleSize); this.yOffset = yOffset; guideLayout = new GuideLayout(context); guideLayout.setOnClickListener(null); guideLayout.setOnLongClickListener(null); }
/** * @param context context * @param yOffset offset from top * @param minRippleSize minimum ripple size * @param maxRippleSize max ripple size */ public GuidePopupWindow(Context context, int yOffset, int minRippleSize, int maxRippleSize) { this.minRippleSize = Math.min(minRippleSize, maxRippleSize); this.maxRippleSize = Math.max(minRippleSize, maxRippleSize); this.yOffset = yOffset; DisplayMetrics metrics = context.getResources().getDisplayMetrics(); guideLayout = new GuideLayout(context); guideLayout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); mPopupWindow = new PopupWindow(); mPopupWindow.setContentView(guideLayout); mPopupWindow.setWidth(metrics.widthPixels); mPopupWindow.setHeight(metrics.heightPixels); mPopupWindow.setFocusable(false); mPopupWindow.setOutsideTouchable(true); }