导航菜单

页面标题

页面副标题

bbinstant v6.24.0 - WelcomeActivity.java 源代码

正在查看: bbinstant v6.24.0 应用的 WelcomeActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.bigbasket.bbinstant.ui.walkthrough;

import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.viewpager.widget.ViewPager;
import com.adjetter.kapchatsdk.R;
import com.bigbasket.bbinstant.ui.BaseActivity;
import com.bigbasket.bbinstant.ui.landing.SplashActivity;

public class WelcomeActivity extends BaseActivity implements View.OnClickListener {
    public static final String WALKTHROUGH_SHOWN = "walkThroughShown";
    private Button btnNext;
    private Button btnSkip;
    private TextView[] dots;
    private LinearLayout dotsLayout;
    private Button finalbtn;
    private boolean isLaunchFromSetting;
    private int[] layouts;
    private d myViewPagerAdapter;
    LinearLayout navEndLayout;
    LinearLayout navLayout;
    private ViewPager viewPager;
    ViewPager.i viewPagerPageChangeListener = new a();

    class a implements ViewPager.i {
        a() {
        }

        @Override
        public void onPageScrollStateChanged(int i) {
        }

        @Override
        public void onPageScrolled(int i, float f, int i2) {
        }

        @Override
        public void onPageSelected(int i) {
            WelcomeActivity.this.addBottomDots(i);
            if (i == WelcomeActivity.this.layouts.length - 1) {
                WelcomeActivity.this.navLayout.setVisibility(8);
                WelcomeActivity.this.navEndLayout.setVisibility(0);
            } else {
                WelcomeActivity.this.navLayout.setVisibility(0);
                WelcomeActivity.this.navEndLayout.setVisibility(8);
            }
        }
    }

    public void addBottomDots(int i) {
        TextView[] textViewArr;
        this.dots = new TextView[this.layouts.length];
        this.dotsLayout.removeAllViews();
        int i2 = 0;
        while (true) {
            textViewArr = this.dots;
            if (i2 >= textViewArr.length) {
                break;
            }
            textViewArr[i2] = new TextView(this);
            this.dots[i2].setText(Html.fromHtml("•"));
            this.dots[i2].setTextSize(35.0f);
            this.dots[i2].setTextColor(getResources().getColor(2131099896));
            this.dotsLayout.addView(this.dots[i2]);
            i2++;
        }
        if (textViewArr.length > 0) {
            textViewArr[i].setTextColor(getResources().getColor(R.color.colorPrimary));
        }
    }

    private void changeStatusBarColor() {
        Window window = getWindow();
        window.addFlags(Integer.MIN_VALUE);
        window.setStatusBarColor(0);
    }

    private int getItem(int i) {
        return this.viewPager.getCurrentItem() + i;
    }

    private void init() {
        this.btnSkip = (Button) findViewById(2131361957);
        this.btnNext = (Button) findViewById(2131361948);
        this.navLayout = (LinearLayout) findViewById(2131362370);
        this.navEndLayout = (LinearLayout) findViewById(2131362365);
        this.finalbtn = (Button) findViewById(2131362101);
        this.viewPager = (ViewPager) findViewById(2131362806);
        this.dotsLayout = (LinearLayout) findViewById(2131362241);
        this.navLayout.setVisibility(0);
        this.navEndLayout.setVisibility(8);
        this.btnSkip.setOnClickListener(this);
        this.btnNext.setOnClickListener(this);
        this.finalbtn.setOnClickListener(this);
    }

    private void launchHomeScreen() {
        com.bigbasket.bbinstant.core.persistance.c.get().setDefaultsBoolean("walkThroughShown", true);
        startActivity(new Intent(this, (Class<?>) SplashActivity.class));
        finish();
    }

    @Override
    public void onClick(View view) {
        if (view == this.btnSkip) {
            if (this.isLaunchFromSetting) {
                finish();
                return;
            } else {
                launchHomeScreen();
                return;
            }
        }
        if (view != this.btnNext) {
            if (view == this.finalbtn) {
                launchHomeScreen();
            }
        } else {
            int item = getItem(1);
            if (item < this.layouts.length) {
                this.viewPager.setCurrentItem(item);
            } else {
                launchHomeScreen();
            }
        }
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        if (com.bigbasket.bbinstant.core.persistance.c.get().getDefaultsBoolean("walkThroughShown").booleanValue()) {
            launchHomeScreen();
        }
        setContentView(2131558457);
        getWindow().getDecorView().setSystemUiVisibility(1024);
        init();
        this.layouts = new int[]{2131558684, 2131558685, 2131558686, 2131558687};
        addBottomDots(0);
        changeStatusBarColor();
        d dVar = new d(this, this.layouts);
        this.myViewPagerAdapter = dVar;
        this.viewPager.setAdapter(dVar);
        this.viewPager.addOnPageChangeListener(this.viewPagerPageChangeListener);
    }
}