正在查看: Mantra Counter v25.01 应用的 PublicGroupInfoPage.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Mantra Counter v25.01 应用的 PublicGroupInfoPage.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.sweetedge.mantracounter.group;
import android.content.Context;
import android.content.DialogInterface;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.bumptech.glide.Glide;
import com.google.firebase.crashlytics.buildtools.reloc.org.apache.commons.cli.HelpFormatter;
import com.sweetedge.mantracounter.IndianNumberFormatter;
import com.sweetedge.mantracounter.MainActivity;
import com.sweetedge.mantracounter.R;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
import save_data.Const;
import sweetedge.decoration.PSetTypeface;
import sweetedge.extra.PLog;
import sweetedge.popup.PDialog;
import sweetedge.popup.PToast;
import sweetedge.preference.PSharedPreference;
public class PublicGroupInfoPage extends AppCompatActivity {
public static String GroupDesc;
public static String GroupId;
public static String GroupImg;
public static String GroupName;
public static String GroupNote;
public static String GroupTarget;
public static Drawable groupImageDrawable;
RelativeLayout GroupInfoLayout;
TextView Logout;
RecyclerView MemberListView;
TextView TotalJapa;
TextView groupDesc;
ImageView groupImage;
TextView groupName;
TextView groupNote;
TextView group_target;
PublicGroupListAdapter memAdapter;
ProgressBar progressBar;
TextView progressText;
TextView totalMember;
ArrayList<PublicGroupMemberPojo> memberlist = new ArrayList<>();
Long TotalCounter = 0L;
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
MainActivity.setLanguage(this);
setContentView(R.layout.public_group_info_screen);
this.groupName = (TextView) findViewById(R.id.pub_groupname);
this.groupDesc = (TextView) findViewById(R.id.pub_groupdesc);
this.TotalJapa = (TextView) findViewById(R.id.pub_totalJapa);
this.groupNote = (TextView) findViewById(R.id.pub_groupnote);
this.group_target = (TextView) findViewById(R.id.pub_group_target);
this.totalMember = (TextView) findViewById(R.id.totalMember);
this.Logout = (TextView) findViewById(R.id.Logout);
this.MemberListView = findViewById(R.id.pub_memberList);
this.GroupInfoLayout = (RelativeLayout) findViewById(R.id.pub_groupInfoLayout);
this.groupImage = (ImageView) findViewById(R.id.pub_godImage);
this.progressBar = (ProgressBar) findViewById(R.id.progressBar);
this.progressText = (TextView) findViewById(R.id.progressText);
FetchGroupInfo(this, GroupId);
Drawable drawable = groupImageDrawable;
if (drawable == null) {
Glide.with(this).load(GroupImg).into(this.groupImage);
} else {
this.groupImage.setImageDrawable(drawable);
}
this.groupName.setText(GroupName);
if (GroupTarget.length() > 0) {
this.group_target.setText(IndianNumberFormatter.formatIndianNumber(Long.parseLong(GroupTarget)) + "");
}
this.groupNote.setText(getResources().getString(R.string.note) + ":" + GroupNote);
this.groupNote.setSelected(true);
this.groupDesc.setText(GroupDesc);
PSetTypeface.setTextView(this, this.Logout, "FontAwesome.ttf");
this.Logout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (i == -1) {
GroupWebService.ExitGroup(PublicGroupInfoPage.this, PublicGroupInfoPage.GroupId);
}
}
};
PDialog.showSimple(PublicGroupInfoPage.this, onClickListener, PublicGroupInfoPage.this.getResources().getString(R.string.leftGroup) + HelpFormatter.DEFAULT_LONG_OPT_SEPARATOR + PublicGroupInfoPage.GroupName, PublicGroupInfoPage.this.getResources().getString(R.string.leftGroupDesc), PublicGroupInfoPage.this.getResources().getString(R.string.Yes), PublicGroupInfoPage.this.getResources().getString(R.string.cancel));
}
});
}
private void FetchGroupInfo(final Context context, final String str) {
LoadingDialog.showD(context);
PLog.print("Getting Group Data for " + str);
Volley.newRequestQueue(context).add(new StringRequest(1, GroupConst.getPublicGroupURL, new Response.Listener<String>() {
public void onResponse(String str2) {
PLog.print("Info " + str2);
LoadingDialog.hideD();
if (str2.length() > 25) {
try {
PublicGroupInfoPage.this.memberlist.clear();
JSONObject jSONObject = new JSONObject(str2.trim());
if (jSONObject.has("PublicMembers") && !jSONObject.isNull("PublicMembers")) {
JSONArray jSONArray = jSONObject.getJSONArray("PublicMembers");
PublicGroupInfoPage.this.TotalCounter = 0L;
if (jSONArray != null && jSONArray.length() > 0) {
PublicGroupInfoPage.this.totalMember.setText(jSONArray.length() + HelpFormatter.DEFAULT_LONG_OPT_SEPARATOR + PublicGroupInfoPage.this.getResources().getString(R.string.members));
for (int i = 0; i < jSONArray.length(); i++) {
String trim = jSONArray.getJSONObject(i).getString("Nm").trim();
String trim2 = jSONArray.getJSONObject(i).getString("Gm").trim();
String trim3 = jSONArray.getJSONObject(i).getString("Cnt").trim();
String trim4 = jSONArray.getJSONObject(i).getString("Onln").trim();
String trim5 = jSONArray.getJSONObject(i).getString("St").trim();
if (trim3.length() == 0) {
trim3 = "0";
}
String str3 = trim3;
PublicGroupInfoPage publicGroupInfoPage = PublicGroupInfoPage.this;
publicGroupInfoPage.TotalCounter = Long.valueOf(publicGroupInfoPage.TotalCounter.longValue() + Long.parseLong(str3));
PublicGroupInfoPage.this.memberlist.add(new PublicGroupMemberPojo(trim, trim2, str3, trim4, trim5));
}
}
}
Collections.sort(PublicGroupInfoPage.this.memberlist, new Comparator<PublicGroupMemberPojo>() {
@Override
public int compare(PublicGroupMemberPojo publicGroupMemberPojo, PublicGroupMemberPojo publicGroupMemberPojo2) {
return Long.compare(Long.parseLong(publicGroupMemberPojo2.mCounter), Long.parseLong(publicGroupMemberPojo.mCounter));
}
});
PublicGroupInfoPage.this.MemberListView.setHasFixedSize(true);
PublicGroupInfoPage.this.MemberListView.setLayoutManager(new GridLayoutManager(context, 1));
PublicGroupInfoPage.this.memAdapter = new PublicGroupListAdapter(context, PublicGroupInfoPage.this.memberlist);
PublicGroupInfoPage.this.MemberListView.setAdapter(PublicGroupInfoPage.this.memAdapter);
PublicGroupInfoPage.this.TotalJapa.setText(PublicGroupInfoPage.this.TotalCounter + "" + PublicGroupInfoPage.this.getResources().getString(R.string.completed));
PublicGroupInfoPage.this.setProgressBar(PublicGroupInfoPage.GroupTarget, PublicGroupInfoPage.this.TotalCounter);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
}, new Response.ErrorListener() {
public void onErrorResponse(VolleyError volleyError) {
PToast.showT(context, "The server is down, Please try after some time!");
PLog.print("Response Error" + volleyError + " = " + volleyError.getMessage());
LoadingDialog.hideD();
}
}) {
protected Map<String, String> getParams() {
HashMap hashMap = new HashMap();
hashMap.put("Gmail", PSharedPreference.getString(context, Const.GMAIL, "null"));
hashMap.put("GID", str);
return hashMap;
}
});
}
public void setProgressBar(String str, Long l) {
if (str.length() <= 0 || l.longValue() <= 0) {
return;
}
int longValue = (int) ((l.longValue() * 100) / Long.valueOf(Long.parseLong(str)).longValue());
PLog.print("Progress = " + longValue);
this.progressBar.setProgress(longValue);
this.progressText.setText(longValue + "%");
}
}