导航菜单

页面标题

页面副标题

Clash Legends v0.0.1 - TestFragment.java 源代码

正在查看: Clash Legends v0.0.1 应用的 TestFragment.java JAVA 源代码文件

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


package com.clash.legends.ui.fragments;

import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.fragment.app.Fragment;
import com.clash.legends.models.BanerData;
import com.clash.legends.ui.activities.AboutusActivity;
import com.clash.legends.ui.activities.AnnouncementActivity;
import com.clash.legends.ui.activities.CustomerSupportActivity;
import com.clash.legends.ui.activities.HowtoActivity;
import com.clash.legends.ui.activities.LeaderboardActivity;
import com.clash.legends.ui.activities.LotteryActivity;
import com.clash.legends.ui.activities.MyProfileActivity;
import com.clash.legends.ui.activities.MyReferralsActivity;
import com.clash.legends.ui.activities.MyRewardedActivity;
import com.clash.legends.ui.activities.MyStatisticsActivity;
import com.clash.legends.ui.activities.MyWalletActivity;
import com.clash.legends.ui.activities.ProductActivity;
import com.clash.legends.ui.activities.ReferandEarnActivity;
import com.clash.legends.ui.activities.SelectedGameActivity;
import com.clash.legends.ui.activities.TermsandConditionActivity;
import com.clash.legends.ui.activities.TopPlayerActivity;
import com.clash.legends.ui.activities.WatchAndEarnActivity;
import com.clash.legends.utils.LocaleHelper;
import com.squareup.picasso.Picasso;
import java.util.List;

public class TestFragment extends Fragment {
    Context context;
    private String mContent = "???";
    private String mContenturl = "";
    List<BanerData> mData;
    int position;
    Resources resources;

    public static TestFragment newInstance(String content, String contenturl, Context c, List<BanerData> data, int pos) {
        TestFragment fragment = new TestFragment();
        fragment.mContent = content;
        fragment.mContenturl = contenturl;
        fragment.mData = data;
        fragment.position = pos;
        return fragment;
    }

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setRetainInstance(true);
    }

    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        ViewGroup Rootview = (ViewGroup) inflater.inflate(2131558783, container, false);
        Context locale = LocaleHelper.setLocale(getContext());
        this.context = locale;
        this.resources = locale.getResources();
        try {
            final BanerData data = this.mData.get(this.position);
            ImageView baneriv = (ImageView) Rootview.findViewById(2131362445);
            if (TextUtils.equals(data.getLink(), "Refer and Earn")) {
                Picasso.get().load(Uri.parse(data.getImage())).placeholder(2131231388).fit().into(baneriv);
            } else if (TextUtils.equals(data.getLink(), "Luckey Draw")) {
                Picasso.get().load(Uri.parse(data.getImage())).placeholder(2131231128).fit().into(baneriv);
            } else if (TextUtils.equals(data.getLink(), "Watch and Earn")) {
                Picasso.get().load(Uri.parse(data.getImage())).placeholder(2131231438).fit().into(baneriv);
            } else if (TextUtils.equals(data.getLink(), "Buy Product")) {
                Picasso.get().load(Uri.parse(data.getImage())).placeholder(2131230889).fit().into(baneriv);
            } else {
                Picasso.get().load(Uri.parse(data.getImage())).placeholder(2131231003).fit().into(baneriv);
            }
            baneriv.setOnClickListener(new View.OnClickListener() {
                @Override
                public final void onClick(View view) {
                    TestFragment.this.m54xab03417(data, view);
                }
            });
        } catch (Exception e) {
        }
        return Rootview;
    }

    void m54xab03417(BanerData data, View v) {
        if (TextUtils.equals(data.getLinkType(), "app")) {
            if (TextUtils.equals(data.getLink(), "Refer and Earn")) {
                Intent intent = new Intent((Context) getActivity(), (Class<?>) ReferandEarnActivity.class);
                startActivity(intent);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Luckey Draw")) {
                Intent intent2 = new Intent((Context) getActivity(), (Class<?>) LotteryActivity.class);
                startActivity(intent2);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Watch and Earn")) {
                Intent intent3 = new Intent((Context) getActivity(), (Class<?>) WatchAndEarnActivity.class);
                startActivity(intent3);
                return;
            }
            if (TextUtils.equals(data.getLink(), "My Profile")) {
                Intent intent4 = new Intent((Context) getActivity(), (Class<?>) MyProfileActivity.class);
                startActivity(intent4);
                return;
            }
            if (TextUtils.equals(data.getLink(), "My Wallet")) {
                Intent intent5 = new Intent((Context) getActivity(), (Class<?>) MyWalletActivity.class);
                startActivity(intent5);
                return;
            }
            if (TextUtils.equals(data.getLink(), "My Matches")) {
                Intent intent6 = new Intent((Context) getActivity(), (Class<?>) SelectedGameActivity.class);
                SharedPreferences sp = getActivity().getSharedPreferences("gameinfo", 0);
                SharedPreferences.Editor editor = sp.edit();
                editor.putString("gametitle", "My Matches");
                editor.putString("gameid", "not");
                editor.apply();
                startActivity(intent6);
                return;
            }
            if (TextUtils.equals(data.getLink(), "My Statics")) {
                Intent intent7 = new Intent((Context) getActivity(), (Class<?>) MyStatisticsActivity.class);
                startActivity(intent7);
                return;
            }
            if (TextUtils.equals(data.getLink(), "My Referral")) {
                Intent intent8 = new Intent((Context) getActivity(), (Class<?>) MyReferralsActivity.class);
                startActivity(intent8);
                return;
            }
            if (TextUtils.equals(data.getLink(), "My Rewards")) {
                Intent intent9 = new Intent((Context) getActivity(), (Class<?>) MyRewardedActivity.class);
                startActivity(intent9);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Announcement")) {
                Intent intent10 = new Intent((Context) getActivity(), (Class<?>) AnnouncementActivity.class);
                startActivity(intent10);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Top Players")) {
                Intent intent11 = new Intent((Context) getActivity(), (Class<?>) TopPlayerActivity.class);
                startActivity(intent11);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Leaderboard")) {
                Intent intent12 = new Intent((Context) getActivity(), (Class<?>) LeaderboardActivity.class);
                startActivity(intent12);
                return;
            }
            if (TextUtils.equals(data.getLink(), "App Tutorials")) {
                Intent intent13 = new Intent((Context) getActivity(), (Class<?>) HowtoActivity.class);
                startActivity(intent13);
                return;
            }
            if (TextUtils.equals(data.getLink(), "About us")) {
                Intent intent14 = new Intent((Context) getActivity(), (Class<?>) AboutusActivity.class);
                startActivity(intent14);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Customer Support")) {
                Intent intent15 = new Intent((Context) getActivity(), (Class<?>) CustomerSupportActivity.class);
                startActivity(intent15);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Terms and Condition")) {
                Intent intent16 = new Intent((Context) getActivity(), (Class<?>) TermsandConditionActivity.class);
                startActivity(intent16);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Game")) {
                Intent intent17 = new Intent((Context) getActivity(), (Class<?>) SelectedGameActivity.class);
                SharedPreferences sp2 = getActivity().getSharedPreferences("gameinfo", 0);
                SharedPreferences.Editor editor2 = sp2.edit();
                editor2.putString("gametitle", data.getLinkname());
                editor2.putString("gameid", data.getLinkId());
                editor2.apply();
                startActivity(intent17);
                return;
            }
            if (TextUtils.equals(data.getLink(), "Buy Product")) {
                Intent intent18 = new Intent((Context) getActivity(), (Class<?>) ProductActivity.class);
                startActivity(intent18);
                return;
            }
            return;
        }
        if (TextUtils.equals(data.getLinkType(), "web")) {
            Intent browserIntent = new Intent("android.intent.action.VIEW", Uri.parse(data.getLink()));
            startActivity(browserIntent);
        }
    }
}