|
|
@@ -74,10 +74,13 @@ public class NewbieGuideHelper {
|
|
|
exitAnimation.setFillAfter(true);
|
|
|
}
|
|
|
|
|
|
+ private String getLabelPrex(int type){
|
|
|
+ return DataUtil.getInstance().getUserId()+ "_page_" + type;
|
|
|
+ }
|
|
|
+
|
|
|
public void show(int type) {
|
|
|
- String label = DataUtil.getInstance().getUserId()+ "_page_" + type;
|
|
|
- if (isShowed(label)) return;
|
|
|
- showed(label);
|
|
|
+ if (isShowed(getLabelPrex(type))) return;
|
|
|
+ showed(getLabelPrex(type));
|
|
|
List<GuidePage> pages = null;
|
|
|
if (type == GUIDE_HOME) {
|
|
|
pages = Arrays.asList(getPage1(), getPage2(), getPage3(), getPage4());
|
|
|
@@ -91,7 +94,7 @@ public class NewbieGuideHelper {
|
|
|
return;
|
|
|
}
|
|
|
Builder builder = NewbieGuide.with(mActivity)
|
|
|
- .setLabel(label)//设置引导层标示区分不同引导层,必传!否则报错
|
|
|
+ .setLabel(getLabelPrex(type))//设置引导层标示区分不同引导层,必传!否则报错
|
|
|
.setOnGuideChangedListener(new OnGuideChangedListener() {
|
|
|
@Override
|
|
|
public void onShowed(Controller controller) {
|
|
|
@@ -298,8 +301,15 @@ public class NewbieGuideHelper {
|
|
|
private void showed(String page) {
|
|
|
SharedPreferences sp = mActivity.getSharedPreferences("newbie_guide", Context.MODE_PRIVATE);
|
|
|
SharedPreferences.Editor editor = sp.edit();
|
|
|
- editor.putBoolean("page", true);
|
|
|
+ editor.putBoolean(page, true);
|
|
|
editor.commit();
|
|
|
}
|
|
|
|
|
|
+ public void disableAll(){
|
|
|
+ showed(getLabelPrex(0));
|
|
|
+ showed(getLabelPrex(1));
|
|
|
+ showed(getLabelPrex(2));
|
|
|
+ showed(getLabelPrex(3));
|
|
|
+ }
|
|
|
+
|
|
|
}
|