正在查看: 爱心e站 v1.0.0 应用的 GuideActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 爱心e站 v1.0.0 应用的 GuideActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.newheyd.JZKFcanjiren.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import com.newheyd.JZKFcanjiren.BaseActivity;
import com.newheyd.JZKFcanjiren.R;
import com.newheyd.JZKFcanjiren.Utils.SharedPreferencedUtils;
import com.newheyd.JZKFcanjiren.model.BaseResult;
import com.newheyd.JZKFcanjiren.net.NewHYTask;
import java.util.ArrayList;
public class GuideActivity extends BaseActivity {
private MyFirstEnterPagerAdapter adapter;
private ImageButton bt_ljtiyan;
private ViewPager pager;
private ArrayList<ImageView> list = new ArrayList<>();
private int[] images = {R.mipmap.ji_worker_page_one, R.mipmap.ji_worker_page_two, R.mipmap.ji_worker_page_threw};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
SharedPreferencedUtils.getInstance(this.mContext).putBoolean("isFirstOpen", false);
setContentView(R.layout.page_guide);
this.pager = (ViewPager) findViewById(R.id.viewpager_guide);
this.bt_ljtiyan = (ImageButton) findViewById(R.id.bt_lijitiyan);
this.bt_ljtiyan.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
GuideActivity.this.startActivity(new Intent(GuideActivity.this, (Class<?>) HomeFragActivity.class));
GuideActivity.this.finish();
}
});
for (int i = 0; i < this.images.length; i++) {
ImageView iv = new ImageView(this);
iv.setScaleType(ImageView.ScaleType.FIT_XY);
iv.setImageResource(this.images[i]);
this.list.add(iv);
}
this.adapter = new MyFirstEnterPagerAdapter();
this.pager.setAdapter(this.adapter);
this.pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageSelected(int arg0) {
if (arg0 == GuideActivity.this.list.size() - 1) {
GuideActivity.this.bt_ljtiyan.setVisibility(0);
} else {
GuideActivity.this.bt_ljtiyan.setVisibility(8);
}
}
@Override
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
@Override
public void onPageScrollStateChanged(int arg0) {
}
});
}
@Override
public void onResponseBefore(NewHYTask task) {
}
@Override
public void onResponseAfter(NewHYTask task) {
}
@Override
public void onResponseSuccessful(NewHYTask task, BaseResult object) {
}
@Override
public void onResponseError(NewHYTask task, BaseResult object) {
}
@Override
public void onServerError(NewHYTask task, int failedType) {
}
@Override
public void initViews() {
}
@Override
public void setListener() {
}
class MyFirstEnterPagerAdapter extends PagerAdapter {
MyFirstEnterPagerAdapter() {
}
@Override
public int getCount() {
return GuideActivity.this.list.size();
}
@Override
public boolean isViewFromObject(View arg0, Object arg1) {
return arg0 == arg1;
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
ImageView v = (ImageView) GuideActivity.this.list.get(position);
container.addView(v);
return v;
}
@Override
public void destroyItem(ViewGroup container, int position, Object object) {
container.removeView((View) object);
}
}
}