Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void onGuideLayoutDismiss(GuideLayout guideLayout) {
* 显示当前引导页的前一页
*/
public void showPreviewPage() {
showPage(--current);
showPage(current - 1);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.app.hubert.guide.core.Controller;
import com.app.hubert.guide.util.LogUtil;
import com.app.hubert.guide.listener.OnLayoutInflatedListener;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
Expand Down Expand Up @@ -52,11 +53,19 @@ public String toString() {
public int padding;
public int gravity;

private OnLayoutInflatedListener mListener;

public RelativeGuide(@LayoutRes int layout, @LimitGravity int gravity) {
this.layout = layout;
this.gravity = gravity;
}

public RelativeGuide(@LayoutRes int layout, @LimitGravity int gravity , OnLayoutInflatedListener listener) {
this.layout = layout;
this.gravity = gravity;
this.mListener = listener;
}

/**
* @param layout 相对位置引导布局
* @param gravity 仅限left top right bottom
Expand Down Expand Up @@ -133,6 +142,9 @@ protected void onLayoutInflated(View view) {
* @param controller controller
*/
protected void onLayoutInflated(View view, Controller controller) {
//do nothing
// 调用自身onLayoutInflated listener
if (mListener != null){
mListener.onLayoutInflated(view,controller);
}
}
}