正在查看: Clash Legends v0.0.1 应用的 IndroductionActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Clash Legends v0.0.1 应用的 IndroductionActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.clash.legends.ui.activities;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewpager.widget.PagerAdapter;
import androidx.viewpager.widget.ViewPager;
public class IndroductionActivity extends AppCompatActivity {
private TextView btnNext;
private TextView btnSkip;
private TextView[] dots;
private LinearLayout dotsLayout;
private int[] layouts;
private MyViewPagerAdapter myViewPagerAdapter;
private ViewPager viewPager;
ViewPager.OnPageChangeListener viewPagerPageChangeListener = new ViewPager.OnPageChangeListener() {
public void onPageSelected(int position) {
IndroductionActivity.this.addBottomDots(position);
}
public void onPageScrolled(int arg0, float arg1, int arg2) {
}
public void onPageScrollStateChanged(int arg0) {
}
};
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(2131558449);
getWindow().getDecorView().setSystemUiVisibility(1280);
this.viewPager = findViewById(2131363752);
this.dotsLayout = (LinearLayout) findViewById(2131362569);
this.btnSkip = (TextView) findViewById(2131362063);
this.btnNext = (TextView) findViewById(2131362058);
this.layouts = new int[]{2131558620, 2131558621, 2131558622};
addBottomDots(0);
changeStatusBarColor();
MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter();
this.myViewPagerAdapter = myViewPagerAdapter;
this.viewPager.setAdapter(myViewPagerAdapter);
this.viewPager.addOnPageChangeListener(this.viewPagerPageChangeListener);
this.btnSkip.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
IndroductionActivity.this.startActivity(new Intent(IndroductionActivity.this.getApplicationContext(), (Class<?>) CreateNewAccount.class));
}
});
this.btnNext.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
IndroductionActivity.this.startActivity(new Intent(IndroductionActivity.this.getApplicationContext(), (Class<?>) MainActivity.class));
}
});
}
public void addBottomDots(int currentPage) {
TextView[] textViewArr;
this.dots = new TextView[this.layouts.length];
int[] colorsActive = getResources().getIntArray(2130903040);
getResources().getIntArray(2130903041);
this.dotsLayout.removeAllViews();
int i = 0;
while (true) {
textViewArr = this.dots;
if (i >= textViewArr.length) {
break;
}
textViewArr[i] = new TextView(this);
this.dots[i].setText("-");
this.dots[i].setTextSize(35.0f);
this.dots[i].setTextColor(getResources().getColor(2131100324));
this.dotsLayout.addView(this.dots[i]);
i++;
}
int i2 = textViewArr.length;
if (i2 > 0) {
textViewArr[currentPage].setTextColor(colorsActive[currentPage]);
}
}
private void changeStatusBarColor() {
Window window = getWindow();
window.addFlags(Integer.MIN_VALUE);
window.setStatusBarColor(0);
}
public class MyViewPagerAdapter extends PagerAdapter {
private LayoutInflater layoutInflater;
public MyViewPagerAdapter() {
}
public Object instantiateItem(ViewGroup container, int position) {
LayoutInflater layoutInflater = (LayoutInflater) IndroductionActivity.this.getSystemService("layout_inflater");
this.layoutInflater = layoutInflater;
View view = layoutInflater.inflate(IndroductionActivity.this.layouts[position], container, false);
container.addView(view);
return view;
}
public int getCount() {
return IndroductionActivity.this.layouts.length;
}
public boolean isViewFromObject(View view, Object obj) {
return view == obj;
}
public void destroyItem(ViewGroup container, int position, Object object) {
View view = (View) object;
container.removeView(view);
}
}
}