137 lines
5.2 KiB
Java
137 lines
5.2 KiB
Java
package com.ubt.jimu;
|
|
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.net.Uri;
|
|
import android.text.TextUtils;
|
|
import android.view.View;
|
|
import android.widget.ImageView;
|
|
import android.widget.TextView;
|
|
import androidx.viewpager.widget.ViewPager;
|
|
import com.alibaba.android.arouter.facade.Postcard;
|
|
import com.alibaba.android.arouter.launcher.ARouter;
|
|
import com.ubt.jimu.adapter.GuideViewPagerAdapter;
|
|
import com.ubt.jimu.base.SuperActivity;
|
|
import com.ubt.jimu.base.entities.Constant;
|
|
import com.ubt.jimu.base.entities.Redirection;
|
|
import com.ubt.jimu.utils.JsonHelper;
|
|
import com.ubt.jimu.utils.SPUtils;
|
|
import java.net.URLDecoder;
|
|
import java.util.ArrayList;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class NoviceGuideActivity extends SuperActivity implements View.OnClickListener {
|
|
int a;
|
|
ImageView im_shape_left;
|
|
ImageView im_shape_right;
|
|
TextView tv_guide_page;
|
|
TextView tv_skip;
|
|
ViewPager viewPager;
|
|
|
|
private void D0() {
|
|
SPUtils.a(Constant.NoviceGuide.SHOW_GUIDE, true);
|
|
E0();
|
|
finish();
|
|
}
|
|
|
|
private void E0() {
|
|
Intent intent = getIntent();
|
|
Uri data = intent.getData();
|
|
Redirection redirection = null;
|
|
if (data != null) {
|
|
try {
|
|
String decode = URLDecoder.decode(data.getQueryParameter("json"), "UTF-8");
|
|
redirection = !TextUtils.isEmpty(decode) ? (Redirection) JsonHelper.b(decode, Redirection.class) : null;
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
}
|
|
this.a = 10002;
|
|
} else {
|
|
this.a = intent.getIntExtra(Constant.Base.ACTIVITY_START_ACTION, 0);
|
|
}
|
|
Postcard a = ARouter.b().a("/page/main");
|
|
a.a(Constant.Base.ACTIVITY_START_ACTION, this.a);
|
|
a.a("ACTIVITY_START_REDIRECTION", redirection);
|
|
a.t();
|
|
finish();
|
|
}
|
|
|
|
public static void b(Context context) {
|
|
context.startActivity(new Intent(context, (Class<?>) NoviceGuideActivity.class));
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.SuperActivity
|
|
protected void initData() {
|
|
View inflate = View.inflate(this, R.layout.layout_guide_page_1, null);
|
|
View inflate2 = View.inflate(this, R.layout.layout_guide_page_2, null);
|
|
View inflate3 = View.inflate(this, R.layout.layout_guide_page_3, null);
|
|
View inflate4 = View.inflate(this, R.layout.layout_guide_page_4, null);
|
|
View inflate5 = View.inflate(this, R.layout.layout_guide_page_5, null);
|
|
View inflate6 = View.inflate(this, R.layout.layout_guide_page_6, null);
|
|
View inflate7 = View.inflate(this, R.layout.layout_guide_page_7, null);
|
|
View inflate8 = View.inflate(this, R.layout.layout_guide_page_8, null);
|
|
View inflate9 = View.inflate(this, R.layout.layout_guide_page_9, null);
|
|
inflate9.findViewById(R.id.im_start).setOnClickListener(this);
|
|
ArrayList arrayList = new ArrayList();
|
|
arrayList.add(inflate);
|
|
arrayList.add(inflate2);
|
|
arrayList.add(inflate3);
|
|
arrayList.add(inflate4);
|
|
arrayList.add(inflate5);
|
|
arrayList.add(inflate6);
|
|
arrayList.add(inflate7);
|
|
arrayList.add(inflate8);
|
|
arrayList.add(inflate9);
|
|
this.viewPager.setAdapter(new GuideViewPagerAdapter(arrayList));
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.SuperActivity
|
|
protected void initEvent() {
|
|
this.tv_skip.setOnClickListener(this);
|
|
this.im_shape_right.setOnClickListener(this);
|
|
this.im_shape_left.setOnClickListener(this);
|
|
this.viewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { // from class: com.ubt.jimu.NoviceGuideActivity.1
|
|
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
|
public void onPageScrollStateChanged(int i) {
|
|
}
|
|
|
|
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
|
public void onPageScrolled(int i, float f, int i2) {
|
|
}
|
|
|
|
@Override // androidx.viewpager.widget.ViewPager.OnPageChangeListener
|
|
public void onPageSelected(int i) {
|
|
NoviceGuideActivity.this.im_shape_left.setVisibility(i == 0 ? 8 : 0);
|
|
NoviceGuideActivity.this.im_shape_right.setVisibility(i == 8 ? 8 : 0);
|
|
NoviceGuideActivity.this.tv_skip.setVisibility(i == 8 ? 8 : 0);
|
|
NoviceGuideActivity.this.tv_guide_page.setText((i + 1) + "/9");
|
|
}
|
|
});
|
|
}
|
|
|
|
@Override // com.ubt.jimu.base.SuperActivity
|
|
public View initView() {
|
|
return View.inflate(this, R.layout.activity_novice_guide, null);
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public void onClick(View view) {
|
|
switch (view.getId()) {
|
|
case R.id.im_shape_left /* 2131296801 */:
|
|
this.viewPager.setCurrentItem(this.viewPager.getCurrentItem() - 1);
|
|
return;
|
|
case R.id.im_shape_right /* 2131296802 */:
|
|
this.viewPager.setCurrentItem(this.viewPager.getCurrentItem() + 1);
|
|
return;
|
|
case R.id.im_start /* 2131296807 */:
|
|
D0();
|
|
break;
|
|
case R.id.tv_skip /* 2131297799 */:
|
|
break;
|
|
default:
|
|
return;
|
|
}
|
|
D0();
|
|
}
|
|
}
|