正在查看: Clash Legends v0.0.1 应用的 MeFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Clash Legends v0.0.1 应用的 MeFragment.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.clash.legends.ui.fragments;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.Switch;
import android.widget.TextView;
import android.widget.Toast;
import androidx.fragment.app.Fragment;
import com.android.volley.AuthFailureError;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.JsonObjectRequest;
import com.android.volley.toolbox.Volley;
import com.clash.legends.models.CurrentUser;
import com.clash.legends.ui.activities.AboutusActivity;
import com.clash.legends.ui.activities.AnnouncementActivity;
import com.clash.legends.ui.activities.ChooseLanguageActivity;
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.MainActivity;
import com.clash.legends.ui.activities.MyOrderActivity;
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.SelectedGameActivity;
import com.clash.legends.ui.activities.TermsandConditionActivity;
import com.clash.legends.ui.activities.TopPlayerActivity;
import com.clash.legends.utils.LoadingDialog;
import com.clash.legends.utils.LocaleHelper;
import com.clash.legends.utils.UserLocalStore;
import com.google.android.gms.auth.api.signin.GoogleSignIn;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.firebase.auth.FirebaseAuth;
import com.squareup.picasso.Picasso;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import org.json.JSONException;
import org.json.JSONObject;
public class MeFragment extends Fragment {
TextView aboutUs;
TextView amountWon;
TextView amounttitle;
TextView announcetv;
TextView appTutorial;
TextView appVersion;
TextView appdeveloper;
TextView chooselangvage;
Context context;
TextView customerSupport;
TextView killedtitle;
TextView leaderboard;
LoadingDialog loadingDialog;
TextView logOut;
RequestQueue mQueue;
TextView matchesPlayed;
TextView matchestitle;
TextView myOrder;
TextView myProfile;
TextView myReff;
TextView myRewards;
TextView myStatistics;
TextView myWallet;
TextView mymatches;
Switch notification;
TextView playCoin;
TextView playedtitle;
ImageView profileImage;
String profile_image;
TextView pushText;
Resources resources;
TextView shareApp;
SharedPreferences sp;
LinearLayout staticResult;
TextView termAndCondition;
TextView topPlayer;
TextView totalKilled;
TextView totaltitle;
RequestQueue uQueue;
CurrentUser user;
UserLocalStore userLocalStore;
TextView userName;
RequestQueue vQueue;
TextView wontitle;
String userNameforlogout = "";
String shareBody = "";
private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent != null && Objects.equals(intent.getAction(), "reloadprofile")) {
MeFragment.this.dashBoard();
}
}
};
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
Context locale = LocaleHelper.setLocale(getContext());
this.context = locale;
this.resources = locale.getResources();
UserLocalStore userLocalStore = new UserLocalStore(requireActivity());
this.userLocalStore = userLocalStore;
this.user = userLocalStore.getLoggedInUser();
this.loadingDialog = new LoadingDialog(getContext());
SharedPreferences sharedPreferences = getActivity().getSharedPreferences("tabinfo", 0);
this.sp = sharedPreferences;
String selectedtab = sharedPreferences.getString("selectedtab", "");
if (TextUtils.equals(selectedtab, "2")) {
this.loadingDialog.show();
}
View root = inflater.inflate(2131558688, container, false);
this.matchestitle = (TextView) root.findViewById(2131362685);
this.playedtitle = (TextView) root.findViewById(2131363031);
this.totaltitle = (TextView) root.findViewById(2131363540);
this.killedtitle = (TextView) root.findViewById(2131362557);
this.amounttitle = (TextView) root.findViewById(2131361924);
this.wontitle = (TextView) root.findViewById(2131363821);
this.userName = (TextView) root.findViewById(2131363725);
this.playCoin = (TextView) root.findViewById(2131363030);
this.myWallet = (TextView) root.findViewById(2131362790);
this.myProfile = (TextView) root.findViewById(2131362775);
this.aboutUs = (TextView) root.findViewById(2131361815);
this.customerSupport = (TextView) root.findViewById(2131362208);
this.logOut = (TextView) root.findViewById(2131362641);
this.appTutorial = (TextView) root.findViewById(2131362425);
this.shareApp = (TextView) root.findViewById(2131363326);
this.myStatistics = (TextView) root.findViewById(2131362787);
this.topPlayer = (TextView) root.findViewById(2131363532);
this.myReff = (TextView) root.findViewById(2131362782);
this.myRewards = (TextView) root.findViewById(2131362783);
this.leaderboard = (TextView) root.findViewById(2131362572);
this.termAndCondition = (TextView) root.findViewById(2131363452);
this.chooselangvage = (TextView) root.findViewById(2131362565);
this.staticResult = (LinearLayout) root.findViewById(2131363391);
this.matchesPlayed = (TextView) root.findViewById(2131362691);
this.totalKilled = (TextView) root.findViewById(2131363537);
this.amountWon = (TextView) root.findViewById(2131361925);
this.appVersion = (TextView) root.findViewById(2131361954);
this.mymatches = (TextView) root.findViewById(2131362772);
this.myOrder = (TextView) root.findViewById(2131362773);
this.announcetv = (TextView) root.findViewById(2131361934);
this.pushText = (TextView) root.findViewById(2131363107);
this.notification = (Switch) root.findViewById(2131362856);
this.appdeveloper = (TextView) root.findViewById(2131361947);
this.profileImage = (ImageView) root.findViewById(2131363460);
this.amounttitle.setText(this.resources.getString(2131886081));
this.wontitle.setText(this.resources.getString(2131887091));
this.playedtitle.setText(this.resources.getString(2131886892));
this.killedtitle.setText(this.resources.getString(2131886502));
this.totaltitle.setText(this.resources.getString(2131887038));
this.matchestitle.setText(this.resources.getString(2131886543));
this.myProfile.setText(this.resources.getString(2131886609));
this.aboutUs.setText(this.resources.getString(2131886144));
this.customerSupport.setText(this.resources.getString(2131886404));
this.logOut.setText(this.resources.getString(2131886518));
this.appTutorial.setText(this.resources.getString(2131886170));
this.shareApp.setText(this.resources.getString(2131886993));
this.myStatistics.setText(this.resources.getString(2131886616));
this.myWallet.setText(this.resources.getString(2131886617));
this.topPlayer.setText(this.resources.getString(2131887037));
this.myReff.setText(this.resources.getString(2131886610));
this.myRewards.setText(this.resources.getString(2131886613));
this.leaderboard.setText(this.resources.getString(2131886508));
this.termAndCondition.setText(this.resources.getString(2131887025));
this.chooselangvage.setText(this.resources.getString(2131886334));
this.mymatches.setText(this.resources.getString(2131886607));
this.myOrder.setText(this.resources.getString(2131886608));
this.announcetv.setText(this.resources.getString(2131886082));
this.pushText.setText(this.resources.getString(2131886944));
this.myProfile.setText(this.resources.getString(2131886609));
RequestQueue newRequestQueue = Volley.newRequestQueue(getActivity());
this.uQueue = newRequestQueue;
newRequestQueue.getCache().clear();
SharedPreferences sp = getActivity().getSharedPreferences("Notification", 0);
String switchstatus = sp.getString("switch", "on");
if (TextUtils.equals(switchstatus, "on")) {
this.notification.setChecked(true);
} else {
this.notification.setChecked(false);
}
this.announcetv.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m13lambda$onCreateView$0$comclashlegendsuifragmentsMeFragment(view);
}
});
this.notification.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
MeFragment.this.m27lambda$onCreateView$3$comclashlegendsuifragmentsMeFragment(compoundButton, z);
}
});
UserLocalStore userLocalStore2 = new UserLocalStore(getContext());
this.userLocalStore = userLocalStore2;
final CurrentUser user = userLocalStore2.getLoggedInUser();
this.userNameforlogout = user.getUsername();
IntentFilter intentFilter = new IntentFilter("reloadprofile");
requireActivity().registerReceiver(this.broadcastReceiver, intentFilter);
dashBoard();
this.mymatches.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m28lambda$onCreateView$4$comclashlegendsuifragmentsMeFragment(view);
}
});
this.myOrder.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m29lambda$onCreateView$5$comclashlegendsuifragmentsMeFragment(view);
}
});
this.staticResult.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m30lambda$onCreateView$6$comclashlegendsuifragmentsMeFragment(view);
}
});
this.myWallet.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m31lambda$onCreateView$7$comclashlegendsuifragmentsMeFragment(view);
}
});
this.myProfile.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m32lambda$onCreateView$8$comclashlegendsuifragmentsMeFragment(view);
}
});
this.shareApp.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m33lambda$onCreateView$9$comclashlegendsuifragmentsMeFragment(user, view);
}
});
this.appdeveloper.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.addCategory("android.intent.category.BROWSABLE");
intent.setData(Uri.parse(MeFragment.this.resources.getString(2131886173)));
MeFragment.this.startActivity(intent);
}
});
this.myStatistics.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m14lambda$onCreateView$10$comclashlegendsuifragmentsMeFragment(view);
}
});
this.topPlayer.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m15lambda$onCreateView$11$comclashlegendsuifragmentsMeFragment(view);
}
});
this.aboutUs.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m16lambda$onCreateView$12$comclashlegendsuifragmentsMeFragment(view);
}
});
this.customerSupport.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m17lambda$onCreateView$13$comclashlegendsuifragmentsMeFragment(view);
}
});
this.myReff.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m18lambda$onCreateView$14$comclashlegendsuifragmentsMeFragment(view);
}
});
this.myRewards.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m19lambda$onCreateView$15$comclashlegendsuifragmentsMeFragment(view);
}
});
this.leaderboard.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m20lambda$onCreateView$16$comclashlegendsuifragmentsMeFragment(view);
}
});
this.termAndCondition.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m21lambda$onCreateView$17$comclashlegendsuifragmentsMeFragment(view);
}
});
this.chooselangvage.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m22lambda$onCreateView$18$comclashlegendsuifragmentsMeFragment(view);
}
});
this.logOut.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m23lambda$onCreateView$19$comclashlegendsuifragmentsMeFragment(view);
}
});
this.appTutorial.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
MeFragment.this.m24lambda$onCreateView$20$comclashlegendsuifragmentsMeFragment(view);
}
});
RequestQueue newRequestQueue2 = Volley.newRequestQueue(getContext());
this.vQueue = newRequestQueue2;
newRequestQueue2.getCache().clear();
String vurl = this.resources.getString(2131886167) + "version/android";
JsonObjectRequest vrequest = new JsonObjectRequest(0, vurl, null, new Response.Listener() {
public final void onResponse(Object obj) {
MeFragment.this.m25lambda$onCreateView$21$comclashlegendsuifragmentsMeFragment((JSONObject) obj);
}
}, new Response.ErrorListener() {
public final void onErrorResponse(VolleyError volleyError) {
MeFragment.this.m26lambda$onCreateView$22$comclashlegendsuifragmentsMeFragment(volleyError);
}
}) {
protected Map<String, String> getParams() throws AuthFailureError {
return super.getParams();
}
public Map<String, String> getHeaders() {
Map<String, String> headers = new HashMap<>();
headers.put("x-localization", LocaleHelper.getPersist(MeFragment.this.context));
return headers;
}
};
vrequest.setShouldCache(false);
this.vQueue.add(vrequest);
return root;
}
void m13lambda$onCreateView$0$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent((Context) getActivity(), (Class<?>) AnnouncementActivity.class));
}
void m27lambda$onCreateView$3$comclashlegendsuifragmentsMeFragment(CompoundButton buttonView, boolean isChecked) {
String notistatus;
SharedPreferences sp12 = getActivity().getSharedPreferences("Notification", 0);
SharedPreferences.Editor editor = sp12.edit();
if (isChecked) {
editor.putString("switch", "on");
notistatus = "1";
} else {
editor.putString("switch", "off");
notistatus = "0";
}
String uurl = this.resources.getString(2131886167) + "update_myprofile";
HashMap<String, String> params = new HashMap<>();
params.put("member_id", this.user.getMemberid());
params.put("push_noti", notistatus);
params.put("submit", "submit_push_noti");
Log.d("save", new JSONObject(params).toString());
JsonObjectRequest urequest = new JsonObjectRequest(uurl, new JSONObject(params), new Response.Listener() {
public final void onResponse(Object obj) {
MeFragment.lambda$onCreateView$1((JSONObject) obj);
}
}, new Response.ErrorListener() {
public final void onErrorResponse(VolleyError volleyError) {
Log.e("**VolleyError", "error" + volleyError.getMessage());
}
}) {
public Map<String, String> getHeaders() {
Map headers = new HashMap();
CurrentUser user = MeFragment.this.userLocalStore.getLoggedInUser();
String token = "Bearer " + user.getToken();
headers.put("Content-Type", "application/json");
headers.put("Authorization", token);
return headers;
}
};
urequest.setShouldCache(false);
this.uQueue.add(urequest);
editor.apply();
}
static void lambda$onCreateView$1(JSONObject response) {
try {
response.getString("status").matches("true");
} catch (JSONException e) {
e.printStackTrace();
}
}
void m28lambda$onCreateView$4$comclashlegendsuifragmentsMeFragment(View view) {
Intent intent = new Intent((Context) getActivity(), (Class<?>) SelectedGameActivity.class);
SharedPreferences sp1 = getActivity().getSharedPreferences("gameinfo", 0);
SharedPreferences.Editor editor = sp1.edit();
editor.putString("gametitle", this.resources.getString(2131886607));
editor.putString("gameid", "not");
editor.apply();
startActivity(intent);
}
void m29lambda$onCreateView$5$comclashlegendsuifragmentsMeFragment(View view) {
Intent intent = new Intent((Context) getActivity(), (Class<?>) MyOrderActivity.class);
startActivity(intent);
}
void m30lambda$onCreateView$6$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent((Context) getActivity(), (Class<?>) MyStatisticsActivity.class));
}
void m31lambda$onCreateView$7$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent((Context) getActivity(), (Class<?>) MyWalletActivity.class));
}
void m32lambda$onCreateView$8$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent((Context) getActivity(), (Class<?>) MyProfileActivity.class));
}
void m33lambda$onCreateView$9$comclashlegendsuifragmentsMeFragment(CurrentUser user, View view) {
Intent sharingIntent = new Intent("android.intent.action.SEND");
sharingIntent.setType("text/plain");
sharingIntent.putExtra("android.intent.extra.TEXT", this.shareBody + this.resources.getString(2131886949) + " : " + user.getUsername());
startActivity(Intent.createChooser(sharingIntent, this.resources.getString(2131886994)));
}
void m14lambda$onCreateView$10$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent((Context) getActivity(), (Class<?>) MyStatisticsActivity.class));
}
void m15lambda$onCreateView$11$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent(getContext(), (Class<?>) TopPlayerActivity.class));
}
void m16lambda$onCreateView$12$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent(getContext(), (Class<?>) AboutusActivity.class));
}
void m17lambda$onCreateView$13$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent(getContext(), (Class<?>) CustomerSupportActivity.class));
}
void m18lambda$onCreateView$14$comclashlegendsuifragmentsMeFragment(View v) {
startActivity(new Intent((Context) getActivity(), (Class<?>) MyReferralsActivity.class));
}
void m19lambda$onCreateView$15$comclashlegendsuifragmentsMeFragment(View v) {
startActivity(new Intent((Context) getActivity(), (Class<?>) MyRewardedActivity.class));
}
void m20lambda$onCreateView$16$comclashlegendsuifragmentsMeFragment(View v) {
startActivity(new Intent((Context) getActivity(), (Class<?>) LeaderboardActivity.class));
}
void m21lambda$onCreateView$17$comclashlegendsuifragmentsMeFragment(View v) {
startActivity(new Intent((Context) getActivity(), (Class<?>) TermsandConditionActivity.class));
}
void m22lambda$onCreateView$18$comclashlegendsuifragmentsMeFragment(View v) {
startActivity(new Intent((Context) getActivity(), (Class<?>) ChooseLanguageActivity.class));
}
void m23lambda$onCreateView$19$comclashlegendsuifragmentsMeFragment(View view) {
logoutall();
}
void m24lambda$onCreateView$20$comclashlegendsuifragmentsMeFragment(View view) {
startActivity(new Intent((Context) getActivity(), (Class<?>) HowtoActivity.class));
}
void m25lambda$onCreateView$21$comclashlegendsuifragmentsMeFragment(JSONObject response) {
try {
this.appVersion.setText(this.resources.getString(2131887066) + " : " + response.getString("version"));
} catch (JSONException e) {
e.printStackTrace();
}
}
void m26lambda$onCreateView$22$comclashlegendsuifragmentsMeFragment(VolleyError error) {
Log.e("error", error.toString() + "*******************************************" + LocaleHelper.getPersist(this.context));
}
public void dashBoard() {
RequestQueue newRequestQueue = Volley.newRequestQueue(getContext());
this.mQueue = newRequestQueue;
newRequestQueue.getCache().clear();
String url = this.resources.getString(2131886167) + "dashboard/" + this.user.getMemberid();
JsonObjectRequest request = new JsonObjectRequest(url, null, new Response.Listener() {
public final void onResponse(Object obj) {
MeFragment.this.m12lambda$dashBoard$23$comclashlegendsuifragmentsMeFragment((JSONObject) obj);
}
}, new Response.ErrorListener() {
public final void onErrorResponse(VolleyError volleyError) {
Log.e("**VolleyError", "error" + volleyError.getMessage());
}
}) {
protected Map<String, String> getParams() throws AuthFailureError {
return super.getParams();
}
public Map<String, String> getHeaders() {
Map<String, String> headers = new HashMap<>();
CurrentUser user = MeFragment.this.userLocalStore.getLoggedInUser();
String token = "Bearer " + user.getToken();
headers.put("Content-Type", "application/json");
headers.put("Authorization", token);
headers.put("x-localization", LocaleHelper.getPersist(MeFragment.this.context));
return headers;
}
};
request.setShouldCache(false);
this.mQueue.add(request);
}
void m12lambda$dashBoard$23$comclashlegendsuifragmentsMeFragment(JSONObject response) {
String totalMoney;
try {
JSONObject obj = new JSONObject(response.getString("web_config"));
this.shareBody = obj.getString("share_description");
SharedPreferences sp111 = this.context.getSharedPreferences("sharedesc", 0);
SharedPreferences.Editor editor = sp111.edit();
editor.putString("sharedescription", this.shareBody);
editor.apply();
JSONObject memobj = new JSONObject(response.getString("member"));
String winMoney = memobj.getString("wallet_balance");
String joinMoney = memobj.getString("join_money");
if (TextUtils.equals(winMoney, "null")) {
winMoney = "0";
}
if (TextUtils.equals(joinMoney, "null")) {
joinMoney = "0";
}
String win = isDouble(winMoney) ? String.format("%.2f", Double.valueOf(Double.parseDouble(winMoney))) : String.valueOf(Integer.parseInt(winMoney));
String joinm = isDouble(joinMoney) ? String.format("%.2f", Double.valueOf(Double.parseDouble(joinMoney))) : String.valueOf(Integer.parseInt(joinMoney));
if (win.startsWith("0")) {
if (isDouble(joinm)) {
totalMoney = String.valueOf(Double.parseDouble(joinm));
} else {
totalMoney = String.valueOf(Integer.parseInt(joinm));
}
} else if (joinm.startsWith("-")) {
if (isDouble(win)) {
totalMoney = String.valueOf(Double.parseDouble(win));
} else {
totalMoney = String.valueOf(Integer.parseInt(win));
}
} else if (isDouble(win) && isDouble(joinm)) {
totalMoney = String.valueOf(Double.parseDouble(win) + Double.parseDouble(joinm));
} else {
totalMoney = String.valueOf(Integer.parseInt(win) + Integer.parseInt(joinm));
}
if (isDouble(totalMoney)) {
totalMoney = String.format("%.2f", Double.valueOf(Double.parseDouble(totalMoney)));
}
this.userName.setText(memobj.getString("user_name"));
String string = memobj.getString("profile_image");
this.profile_image = string;
if (!string.equals("null") && !this.profile_image.equals("")) {
Picasso.get().load(Uri.parse(this.profile_image)).placeholder(2131231125).fit().into(this.profileImage);
}
this.playCoin.setText(totalMoney);
JSONObject totplayobj = new JSONObject(response.getString("tot_match_play"));
if (TextUtils.equals(totplayobj.getString("total_match"), "null")) {
this.matchesPlayed.setText("0");
} else {
this.matchesPlayed.setText(totplayobj.getString("total_match"));
}
JSONObject totkillobj = new JSONObject(response.getString("tot_kill"));
if (TextUtils.equals(totkillobj.getString("total_kill"), "null")) {
this.totalKilled.setText("0");
} else {
this.totalKilled.setText(totkillobj.getString("total_kill"));
}
JSONObject totwinobj = new JSONObject(response.getString("tot_win"));
if (!TextUtils.equals(totwinobj.getString("total_win"), "null")) {
if (isDouble(totwinobj.getString("total_win"))) {
this.amountWon.setText(String.format("%.2f", Double.valueOf(Double.parseDouble(totwinobj.getString("total_win")))));
} else {
this.amountWon.setText(totwinobj.getString("total_win"));
}
} else {
this.amountWon.setText("0");
}
} catch (JSONException e) {
e.printStackTrace();
}
this.loadingDialog.dismiss();
}
boolean isDouble(String str) {
try {
Double.parseDouble(str);
return true;
} catch (NumberFormatException e) {
return false;
}
}
private void logoutall() {
SharedPreferences sp = getActivity().getSharedPreferences("tabitem", 0);
SharedPreferences.Editor editor1111 = sp.edit();
editor1111.putString("TAB", "0");
editor1111.apply();
this.userLocalStore.clearUserData();
FirebaseAuth.getInstance().signOut();
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN).requestIdToken(getString(2131886411)).requestEmail().build();
GoogleSignIn.getClient(getContext(), gso).signOut();
Toast.makeText((Context) getActivity(), (CharSequence) this.resources.getString(2131886515), 0).show();
startActivity(new Intent((Context) getActivity(), (Class<?>) MainActivity.class));
}
}