正在查看: Clash Legends v0.0.1 应用的 FragmentSelectedTournamentDescription.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Clash Legends v0.0.1 应用的 FragmentSelectedTournamentDescription.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.clash.legends.ui.fragments;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.cardview.widget.CardView;
import androidx.fragment.app.Fragment;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.android.volley.AuthFailureError;
import com.android.volley.DefaultRetryPolicy;
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.fragments.FragmentSelectedTournamentDescription;
import com.clash.legends.utils.LoadingDialog;
import com.clash.legends.utils.LocaleHelper;
import com.clash.legends.utils.UserLocalStore;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class FragmentSelectedTournamentDescription extends Fragment {
TextView about;
TextView aboutmatchtitle;
Context context;
TextView entryFee;
String entryFees;
TextView entryfeetitle;
LinearLayout joinedll;
LoadingDialog loadingDialog;
String mIds;
RequestQueue mQueue;
TextView map;
String maps;
TextView maptitle;
String matchDescs;
String matchNames;
TextView matchSchedule;
String matchSponsers;
String matchTimes;
TextView matchTitleAndNumber;
TextView matchType;
String matchTypes;
String matchUrl;
LinearLayout matchpraivDescdetaill;
String matchprivateDesc;
TextView matchprivateDescription;
TextView matchprivateDesctitle;
TextView matchscheduletitle;
TextView matchtypetitle;
String memberId;
TextView mode;
TextView modetitle;
String noOfPlayers;
String numberOfPosition;
TextView perKill;
String perKills;
TextView perkilltitle;
Button playNow;
TextView pricedetails;
SwipeRefreshLayout pullToRefresh;
CardView rData;
Resources resources;
LinearLayout roomDetail;
TextView roomId;
String roomIds;
TextView roomPass;
String roomPassword;
TextView room_id_titile;
TextView room_password_title;
TextView roomdetailltitle;
CardView roomidcard;
TextView sponser;
LinearLayout sponsorll;
TextView team;
TextView teamtitle;
String type;
String version;
String winPrizes;
TextView winnigprizetitle;
TextView winningPrize;
String join_status = null;
String packagename = "";
String from = "";
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View root = inflater.inflate(2131558612, container, false);
Context locale = LocaleHelper.setLocale(getContext());
this.context = locale;
this.resources = locale.getResources();
this.loadingDialog = new LoadingDialog(getActivity());
Intent intent = getActivity().getIntent();
this.from = intent.getStringExtra("FROM");
String mid = intent.getStringExtra("M_ID");
SwipeRefreshLayout findViewById = root.findViewById(2131363105);
this.pullToRefresh = findViewById;
findViewById.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
public final void onRefresh() {
FragmentSelectedTournamentDescription.this.m5x72699893();
}
});
this.room_password_title = (TextView) root.findViewById(2131363251);
this.room_id_titile = (TextView) root.findViewById(2131363250);
this.teamtitle = (TextView) root.findViewById(2131363458);
this.entryfeetitle = (TextView) root.findViewById(2131362309);
this.modetitle = (TextView) root.findViewById(2131362734);
this.matchtypetitle = (TextView) root.findViewById(2131362703);
this.maptitle = (TextView) root.findViewById(2131362683);
this.matchscheduletitle = (TextView) root.findViewById(2131362698);
this.winnigprizetitle = (TextView) root.findViewById(2131363803);
this.perkilltitle = (TextView) root.findViewById(2131363015);
this.pricedetails = (TextView) root.findViewById(2131363049);
this.aboutmatchtitle = (TextView) root.findViewById(2131361814);
this.matchprivateDesctitle = (TextView) root.findViewById(2131362695);
this.roomdetailltitle = (TextView) root.findViewById(2131363256);
this.matchprivateDescription = (TextView) root.findViewById(2131362694);
this.roomidcard = root.findViewById(2131363258);
this.teamtitle.setText(this.resources.getString(2131887023));
this.entryfeetitle.setText(this.resources.getString(2131886440));
this.modetitle.setText(this.resources.getString(2131886096));
this.matchtypetitle.setText(this.resources.getString(2131886095));
this.maptitle.setText(this.resources.getString(2131886093));
this.matchscheduletitle.setText(this.resources.getString(2131886094));
this.winnigprizetitle.setText(this.resources.getString(2131886111));
this.perkilltitle.setText(this.resources.getString(2131886104));
this.pricedetails.setText(this.resources.getString(2131886921));
this.aboutmatchtitle.setText(this.resources.getString(2131886143));
this.matchTitleAndNumber = (TextView) root.findViewById(2131362699);
this.team = (TextView) root.findViewById(2131363455);
this.entryFee = (TextView) root.findViewById(2131362308);
this.mode = (TextView) root.findViewById(2131362733);
this.matchType = (TextView) root.findViewById(2131362702);
this.map = (TextView) root.findViewById(2131362682);
this.matchSchedule = (TextView) root.findViewById(2131362697);
this.winningPrize = (TextView) root.findViewById(2131363802);
this.perKill = (TextView) root.findViewById(2131363014);
this.about = (TextView) root.findViewById(2131361811);
this.sponser = (TextView) root.findViewById(2131363374);
this.rData = root.findViewById(2131363150);
this.roomDetail = (LinearLayout) root.findViewById(2131363255);
this.matchpraivDescdetaill = (LinearLayout) root.findViewById(2131362693);
this.roomId = (TextView) root.findViewById(2131363257);
this.roomPass = (TextView) root.findViewById(2131363261);
this.playNow = (Button) root.findViewById(2131363035);
this.joinedll = (LinearLayout) root.findViewById(2131362528);
this.sponsorll = (LinearLayout) root.findViewById(2131363375);
this.rData.setVisibility(8);
RequestQueue newRequestQueue = Volley.newRequestQueue(getActivity());
this.mQueue = newRequestQueue;
newRequestQueue.getCache().clear();
final UserLocalStore userLocalStore = new UserLocalStore(getActivity());
CurrentUser user = userLocalStore.getLoggedInUser();
String url = this.resources.getString(2131886167) + "single_match/" + mid + "/" + user.getMemberid();
JsonObjectRequest request = new JsonObjectRequest(url, null, new Response.Listener() {
public final void onResponse(Object obj) {
FragmentSelectedTournamentDescription.this.m9x55eb1b0f((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 user2 = userLocalStore.getLoggedInUser();
String token = "Bearer " + user2.getToken();
headers.put("Content-Type", "application/json");
headers.put("Authorization", token);
headers.put("x-localization", LocaleHelper.getPersist(FragmentSelectedTournamentDescription.this.context));
return headers;
}
};
request.setShouldCache(false);
this.mQueue.add(request);
return root;
}
void m5x72699893() {
this.pullToRefresh.setRefreshing(true);
refresh();
this.pullToRefresh.setRefreshing(false);
}
void m9x55eb1b0f(org.json.JSONObject r10) {
throw new UnsupportedOperationException("Method not decompiled: com.clash.legends.ui.fragments.FragmentSelectedTournamentDescription.m9x55eb1b0f(org.json.JSONObject):void");
}
void m6xab49f932(View view) {
ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService("clipboard");
ClipData clip = ClipData.newPlainText(this.resources.getString(2131886968), this.roomIds);
clipboard.setPrimaryClip(clip);
Toast.makeText((Context) getActivity(), (CharSequence) this.resources.getString(2131886969), 0).show();
}
void m7xe42a59d1(View view) {
ClipboardManager clipboard = (ClipboardManager) getContext().getSystemService("clipboard");
ClipData clip = ClipData.newPlainText(this.resources.getString(2131886970), this.roomPassword);
clipboard.setPrimaryClip(clip);
Toast.makeText((Context) getActivity(), (CharSequence) this.resources.getString(2131886971), 0).show();
}
void m8x1d0aba70(View view) {
openApplication(getActivity(), this.packagename);
}
public void JSON_PARSE_DATA_AFTER_WEBCALL_JOIN(JSONArray array) {
for (int i = 0; i < array.length(); i++) {
try {
JSONObject json = array.getJSONObject(i);
View view = getLayoutInflater().inflate(2131558624, (ViewGroup) null);
TextView r_team = (TextView) view.findViewById(2131363153);
TextView r_position = (TextView) view.findViewById(2131363151);
TextView r_pubgname = (TextView) view.findViewById(2131363152);
if (TextUtils.equals(this.from, "LIVE")) {
r_pubgname.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0);
r_pubgname.setClickable(false);
r_pubgname.setEnabled(false);
}
r_team.setText(this.resources.getString(2131887024) + json.getString("team"));
r_position.setText(json.getString("position"));
r_pubgname.setText(json.getString("pubg_id"));
r_pubgname.setOnClickListener(new AnonymousClass2(r_pubgname, json));
this.joinedll.addView(view);
} catch (JSONException e) {
e.printStackTrace();
}
}
}
class AnonymousClass2 implements View.OnClickListener {
final JSONObject val$finalJson;
final TextView val$r_pubgname;
AnonymousClass2(TextView textView, JSONObject jSONObject) {
this.val$r_pubgname = textView;
this.val$finalJson = jSONObject;
}
@Override
public void onClick(View v) {
final Dialog builder = new Dialog(FragmentSelectedTournamentDescription.this.getActivity());
builder.setContentView(2131558496);
TextView title = (TextView) builder.findViewById(2131362678);
EditText newplayername = (EditText) builder.findViewById(2131362815);
LinearLayout add_player_ll = (LinearLayout) builder.findViewById(2131361887);
Button newok = (Button) builder.findViewById(2131362814);
Button newcancel = (Button) builder.findViewById(2131362812);
title.setText(FragmentSelectedTournamentDescription.this.resources.getString(2131886423));
newok.setText(FragmentSelectedTournamentDescription.this.resources.getString(2131886979));
add_player_ll.setVisibility(8);
newplayername.setText(this.val$r_pubgname.getText().toString());
newok.setOnClickListener(new AnonymousClass1(newplayername, builder));
newcancel.setOnClickListener(new View.OnClickListener() {
@Override
public final void onClick(View view) {
builder.dismiss();
}
});
builder.show();
}
class AnonymousClass1 implements View.OnClickListener {
final Dialog val$builder;
final EditText val$newplayername;
AnonymousClass1(EditText editText, Dialog dialog) {
this.val$newplayername = editText;
this.val$builder = dialog;
}
@Override
public void onClick(View v) {
if (TextUtils.isEmpty(this.val$newplayername.getText().toString().trim())) {
this.val$newplayername.setError(FragmentSelectedTournamentDescription.this.resources.getString(2131886902));
return;
}
RequestQueue jQueue = Volley.newRequestQueue(FragmentSelectedTournamentDescription.this.getContext());
jQueue.getCache().clear();
String jurl = FragmentSelectedTournamentDescription.this.resources.getString(2131886167) + "change_player_name";
final UserLocalStore userLocalStore = new UserLocalStore(FragmentSelectedTournamentDescription.this.getActivity());
CurrentUser user = userLocalStore.getLoggedInUser();
HashMap<String, String> params = new HashMap<>();
params.put("member_id", user.getMemberid());
params.put("match_id", FragmentSelectedTournamentDescription.this.mIds);
try {
params.put("match_join_member_id", AnonymousClass2.this.val$finalJson.getString("match_join_member_id"));
} catch (JSONException e) {
e.printStackTrace();
}
params.put("pubg_id", this.val$newplayername.getText().toString());
Log.d(jurl, new JSONObject(params).toString());
JSONObject jSONObject = new JSONObject(params);
final Dialog dialog = this.val$builder;
JsonObjectRequest jrequest = new JsonObjectRequest(jurl, jSONObject, new Response.Listener() {
public final void onResponse(Object obj) {
FragmentSelectedTournamentDescription.AnonymousClass2.AnonymousClass1.this.m10x841130ff(dialog, (JSONObject) obj);
}
}, new Response.ErrorListener() {
public final void onErrorResponse(VolleyError volleyError) {
Log.e("error " + String.valueOf(volleyError.getNetworkTimeMs()), String.valueOf(volleyError));
}
}) {
protected Map<String, String> getParams() throws AuthFailureError {
return super.getParams();
}
public Map<String, String> getHeaders() {
Map<String, String> headers = new HashMap<>();
CurrentUser user2 = userLocalStore.getLoggedInUser();
String token = "Bearer " + user2.getToken();
headers.put("Content-Type", "application/json");
headers.put("Authorization", token);
headers.put("x-localization", LocaleHelper.getPersist(FragmentSelectedTournamentDescription.this.context));
return headers;
}
};
jrequest.setShouldCache(false);
jrequest.setRetryPolicy(new DefaultRetryPolicy(30000, 1, 0.0f));
jQueue.add(jrequest);
}
void m10x841130ff(Dialog builder, JSONObject response) {
Log.d("Edit name ", response.toString());
FragmentSelectedTournamentDescription.this.loadingDialog.dismiss();
try {
if (response.getString("status").matches("true")) {
builder.dismiss();
FragmentSelectedTournamentDescription.this.getActivity().finish();
FragmentSelectedTournamentDescription.this.getActivity().overridePendingTransition(0, 0);
FragmentSelectedTournamentDescription.this.startActivity(FragmentSelectedTournamentDescription.this.getActivity().getIntent());
FragmentSelectedTournamentDescription.this.getActivity().overridePendingTransition(0, 0);
} else {
Toast.makeText((Context) FragmentSelectedTournamentDescription.this.getActivity(), (CharSequence) Html.fromHtml(response.getString("message")), 0).show();
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
}
public void openApplication(Context context, String packageN) {
Intent i = context.getPackageManager().getLaunchIntentForPackage(packageN);
if (i == null) {
try {
Intent intent = new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=" + packageN));
intent.addFlags(268435456);
context.startActivity(intent);
return;
} catch (ActivityNotFoundException e) {
Intent intent2 = new Intent("android.intent.action.VIEW", Uri.parse("Uri.parse(\"http://play.google.com/store/apps/details?id=\"" + packageN));
intent2.addFlags(268435456);
context.startActivity(intent2);
return;
}
}
i.addCategory("android.intent.category.LAUNCHER");
context.startActivity(i);
}
public void refresh() {
if (Build.VERSION.SDK_INT >= 24) {
requireActivity().getSupportFragmentManager().beginTransaction().detach(this).commitNow();
requireActivity().getSupportFragmentManager().beginTransaction().attach(this).commitNow();
} else {
requireActivity().getSupportFragmentManager().beginTransaction().detach(this).attach(this).commit();
}
}
}