ZStore v1.7版本的 MD5 值为:ca9bb200afd8d690876bd39318f8215c
以下内容为反编译后的 CommentsActivity.java 源代码,内容仅作参考
package com.zackiestudios.zstore;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.RippleDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.SparseBooleanArray;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.core.motion.utils.TypedValues;
import androidx.core.view.ViewCompat;
import com.bumptech.glide.Glide;
import com.facebook.shimmer.ShimmerFrameLayout;
import com.google.android.gms.common.Scopes;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.FirebaseApp;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.ChildEventListener;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.GenericTypeIndicator;
import com.zackiestudios.zstore.RequestNetwork;
import de.hdodenhof.circleimageview.CircleImageView;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Random;
import java.util.Timer;
import java.util.TimerTask;
public class CommentsActivity extends AppCompatActivity {
private ChildEventListener _Users_child_listener;
private OnCompleteListener<AuthResult> _auth_create_user_listener;
private OnCompleteListener<Void> _auth_reset_password_listener;
private OnCompleteListener<AuthResult> _auth_sign_in_listener;
private ChildEventListener _comment_child_listener;
private RequestNetwork.RequestListener _network_request_listener;
private FirebaseAuth auth;
private OnCompleteListener<Void> auth_deleteUserListener;
private OnCompleteListener<Void> auth_emailVerificationSentListener;
private OnCompleteListener<AuthResult> auth_googleSignInListener;
private OnCompleteListener<AuthResult> auth_phoneAuthListener;
private OnCompleteListener<Void> auth_updateEmailListener;
private OnCompleteListener<Void> auth_updatePasswordListener;
private OnCompleteListener<Void> auth_updateProfileListener;
private CardView cardview1;
private ProgressDialog coreprog;
private SharedPreferences developer;
private AlertDialog.Builder dialog;
private EditText edittext1;
private ImageView imageview1;
private ImageView imageview2;
private LinearLayout linear1;
private LinearLayout linear10;
private LinearLayout linear11;
private LinearLayout linear12;
private LinearLayout linear13;
private LinearLayout linear14;
private LinearLayout linear15;
private LinearLayout linear16;
private LinearLayout linear17;
private LinearLayout linear18;
private LinearLayout linear19;
private LinearLayout linear2;
private LinearLayout linear20;
private LinearLayout linear21;
private LinearLayout linear22;
private LinearLayout linear23;
private LinearLayout linear24;
private LinearLayout linear25;
private LinearLayout linear26;
private LinearLayout linear27;
private LinearLayout linear28;
private LinearLayout linear29;
private LinearLayout linear3;
private LinearLayout linear4;
private LinearLayout linear5;
private LinearLayout linear6;
private LinearLayout linear7;
private LinearLayout linear8;
private LinearLayout linear9;
private LinearLayout linear_dash1;
private LinearLayout linear_dash10;
private LinearLayout linear_dash11;
private LinearLayout linear_dash13;
private LinearLayout linear_dash2;
private LinearLayout linear_dash3;
private LinearLayout linear_dash4;
private LinearLayout linear_dash5;
private LinearLayout linear_dash6;
private LinearLayout linear_dash7;
private LinearLayout linear_dash8;
private LinearLayout linear_dash9;
private LinearLayout linear_shimmer;
private ListView listview1;
private RequestNetwork network;
private ShimmerFrameLayout shimmer1;
private ShimmerFrameLayout shimmer10;
private ShimmerFrameLayout shimmer11;
private ShimmerFrameLayout shimmer12;
private ShimmerFrameLayout shimmer13;
private ShimmerFrameLayout shimmer14;
private ShimmerFrameLayout shimmer15;
private ShimmerFrameLayout shimmer16;
private ShimmerFrameLayout shimmer17;
private ShimmerFrameLayout shimmer18;
private ShimmerFrameLayout shimmer19;
private ShimmerFrameLayout shimmer2;
private ShimmerFrameLayout shimmer20;
private ShimmerFrameLayout shimmer21;
private ShimmerFrameLayout shimmer22;
private ShimmerFrameLayout shimmer23;
private ShimmerFrameLayout shimmer24;
private ShimmerFrameLayout shimmer25;
private ShimmerFrameLayout shimmer26;
private ShimmerFrameLayout shimmer27;
private ShimmerFrameLayout shimmer28;
private ShimmerFrameLayout shimmer29;
private ShimmerFrameLayout shimmer3;
private ShimmerFrameLayout shimmer30;
private ShimmerFrameLayout shimmer31;
private ShimmerFrameLayout shimmer32;
private ShimmerFrameLayout shimmer33;
private ShimmerFrameLayout shimmer34;
private ShimmerFrameLayout shimmer35;
private ShimmerFrameLayout shimmer36;
private ShimmerFrameLayout shimmer37;
private ShimmerFrameLayout shimmer38;
private ShimmerFrameLayout shimmer39;
private ShimmerFrameLayout shimmer4;
private ShimmerFrameLayout shimmer5;
private ShimmerFrameLayout shimmer6;
private ShimmerFrameLayout shimmer7;
private ShimmerFrameLayout shimmer8;
private ShimmerFrameLayout shimmer9;
private TextView textview_title;
private TimerTask timer;
private SharedPreferences users;
private Timer _timer = new Timer();
private FirebaseDatabase _firebase = FirebaseDatabase.getInstance();
private String post_key = "";
private String uid = "";
private double number = 0.0d;
private HashMap<String, Object> user_names = new HashMap<>();
private String profile = "";
private HashMap<String, Object> user_pic = new HashMap<>();
private HashMap<String, Object> user_color = new HashMap<>();
private String color = "";
private String key = "";
private HashMap<String, Object> map = new HashMap<>();
private boolean data1 = false;
private boolean data2 = false;
private String verified = "";
private HashMap<String, Object> verify_map = new HashMap<>();
private ArrayList<HashMap<String, Object>> listmap = new ArrayList<>();
private DatabaseReference comment = this._firebase.getReference("comments");
private DatabaseReference Users = this._firebase.getReference("Users");
private Calendar c = Calendar.getInstance();
private Intent intent = new Intent();
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.comments);
initialize(bundle);
FirebaseApp.initializeApp(this);
initializeLogic();
}
private void initialize(Bundle bundle) {
this.linear1 = (LinearLayout) findViewById(R.id.linear1);
this.linear2 = (LinearLayout) findViewById(R.id.linear2);
this.cardview1 = (CardView) findViewById(R.id.cardview1);
this.listview1 = (ListView) findViewById(R.id.listview1);
this.linear_shimmer = (LinearLayout) findViewById(R.id.linear_shimmer);
this.linear3 = (LinearLayout) findViewById(R.id.linear3);
this.imageview1 = (ImageView) findViewById(R.id.imageview1);
this.textview_title = (TextView) findViewById(R.id.textview_title);
this.linear4 = (LinearLayout) findViewById(R.id.linear4);
this.linear_dash1 = (LinearLayout) findViewById(R.id.linear_dash1);
this.linear6 = (LinearLayout) findViewById(R.id.linear6);
this.linear_dash2 = (LinearLayout) findViewById(R.id.linear_dash2);
this.linear8 = (LinearLayout) findViewById(R.id.linear8);
this.linear_dash3 = (LinearLayout) findViewById(R.id.linear_dash3);
this.linear9 = (LinearLayout) findViewById(R.id.linear9);
this.linear_dash4 = (LinearLayout) findViewById(R.id.linear_dash4);
this.linear10 = (LinearLayout) findViewById(R.id.linear10);
this.linear_dash5 = (LinearLayout) findViewById(R.id.linear_dash5);
this.linear15 = (LinearLayout) findViewById(R.id.linear15);
this.linear_dash6 = (LinearLayout) findViewById(R.id.linear_dash6);
this.linear19 = (LinearLayout) findViewById(R.id.linear19);
this.linear_dash7 = (LinearLayout) findViewById(R.id.linear_dash7);
this.linear20 = (LinearLayout) findViewById(R.id.linear20);
this.linear_dash8 = (LinearLayout) findViewById(R.id.linear_dash8);
this.linear21 = (LinearLayout) findViewById(R.id.linear21);
this.linear_dash9 = (LinearLayout) findViewById(R.id.linear_dash9);
this.linear22 = (LinearLayout) findViewById(R.id.linear22);
this.linear_dash10 = (LinearLayout) findViewById(R.id.linear_dash10);
this.linear24 = (LinearLayout) findViewById(R.id.linear24);
this.linear_dash11 = (LinearLayout) findViewById(R.id.linear_dash11);
this.linear26 = (LinearLayout) findViewById(R.id.linear26);
this.linear_dash13 = (LinearLayout) findViewById(R.id.linear_dash13);
this.linear28 = (LinearLayout) findViewById(R.id.linear28);
this.shimmer1 = (ShimmerFrameLayout) findViewById(R.id.shimmer1);
this.linear5 = (LinearLayout) findViewById(R.id.linear5);
this.shimmer2 = (ShimmerFrameLayout) findViewById(R.id.shimmer2);
this.shimmer3 = (ShimmerFrameLayout) findViewById(R.id.shimmer3);
this.shimmer4 = (ShimmerFrameLayout) findViewById(R.id.shimmer4);
this.linear7 = (LinearLayout) findViewById(R.id.linear7);
this.shimmer5 = (ShimmerFrameLayout) findViewById(R.id.shimmer5);
this.shimmer6 = (ShimmerFrameLayout) findViewById(R.id.shimmer6);
this.shimmer21 = (ShimmerFrameLayout) findViewById(R.id.shimmer21);
this.linear11 = (LinearLayout) findViewById(R.id.linear11);
this.shimmer7 = (ShimmerFrameLayout) findViewById(R.id.shimmer7);
this.shimmer8 = (ShimmerFrameLayout) findViewById(R.id.shimmer8);
this.shimmer22 = (ShimmerFrameLayout) findViewById(R.id.shimmer22);
this.linear12 = (LinearLayout) findViewById(R.id.linear12);
this.shimmer9 = (ShimmerFrameLayout) findViewById(R.id.shimmer9);
this.shimmer10 = (ShimmerFrameLayout) findViewById(R.id.shimmer10);
this.shimmer23 = (ShimmerFrameLayout) findViewById(R.id.shimmer23);
this.linear13 = (LinearLayout) findViewById(R.id.linear13);
this.shimmer11 = (ShimmerFrameLayout) findViewById(R.id.shimmer11);
this.shimmer12 = (ShimmerFrameLayout) findViewById(R.id.shimmer12);
this.shimmer24 = (ShimmerFrameLayout) findViewById(R.id.shimmer24);
this.linear14 = (LinearLayout) findViewById(R.id.linear14);
this.shimmer13 = (ShimmerFrameLayout) findViewById(R.id.shimmer13);
this.shimmer14 = (ShimmerFrameLayout) findViewById(R.id.shimmer14);
this.shimmer25 = (ShimmerFrameLayout) findViewById(R.id.shimmer25);
this.linear16 = (LinearLayout) findViewById(R.id.linear16);
this.shimmer15 = (ShimmerFrameLayout) findViewById(R.id.shimmer15);
this.shimmer16 = (ShimmerFrameLayout) findViewById(R.id.shimmer16);
this.shimmer26 = (ShimmerFrameLayout) findViewById(R.id.shimmer26);
this.linear17 = (LinearLayout) findViewById(R.id.linear17);
this.shimmer17 = (ShimmerFrameLayout) findViewById(R.id.shimmer17);
this.shimmer18 = (ShimmerFrameLayout) findViewById(R.id.shimmer18);
this.shimmer27 = (ShimmerFrameLayout) findViewById(R.id.shimmer27);
this.linear18 = (LinearLayout) findViewById(R.id.linear18);
this.shimmer19 = (ShimmerFrameLayout) findViewById(R.id.shimmer19);
this.shimmer20 = (ShimmerFrameLayout) findViewById(R.id.shimmer20);
this.shimmer28 = (ShimmerFrameLayout) findViewById(R.id.shimmer28);
this.linear23 = (LinearLayout) findViewById(R.id.linear23);
this.shimmer32 = (ShimmerFrameLayout) findViewById(R.id.shimmer32);
this.shimmer33 = (ShimmerFrameLayout) findViewById(R.id.shimmer33);
this.shimmer29 = (ShimmerFrameLayout) findViewById(R.id.shimmer29);
this.linear25 = (LinearLayout) findViewById(R.id.linear25);
this.shimmer34 = (ShimmerFrameLayout) findViewById(R.id.shimmer34);
this.shimmer35 = (ShimmerFrameLayout) findViewById(R.id.shimmer35);
this.shimmer30 = (ShimmerFrameLayout) findViewById(R.id.shimmer30);
this.linear27 = (LinearLayout) findViewById(R.id.linear27);
this.shimmer36 = (ShimmerFrameLayout) findViewById(R.id.shimmer36);
this.shimmer37 = (ShimmerFrameLayout) findViewById(R.id.shimmer37);
this.shimmer31 = (ShimmerFrameLayout) findViewById(R.id.shimmer31);
this.linear29 = (LinearLayout) findViewById(R.id.linear29);
this.shimmer38 = (ShimmerFrameLayout) findViewById(R.id.shimmer38);
this.shimmer39 = (ShimmerFrameLayout) findViewById(R.id.shimmer39);
this.edittext1 = (EditText) findViewById(R.id.edittext1);
this.imageview2 = (ImageView) findViewById(R.id.imageview2);
this.auth = FirebaseAuth.getInstance();
this.network = new RequestNetwork(this);
this.users = getSharedPreferences("users", 0);
this.developer = getSharedPreferences("developer", 0);
this.dialog = new AlertDialog.Builder(this);
this.imageview1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
CommentsActivity.this.finish();
}
});
this.imageview2.setOnClickListener(new AnonymousClass2());
ChildEventListener childEventListener = new ChildEventListener() {
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String str) {
}
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
CommentsActivity.this.data1 = true;
if (CommentsActivity.this.post_key.equals(hashMap.get("post_key").toString())) {
CommentsActivity.this.listmap.add(hashMap);
ListView listView = CommentsActivity.this.listview1;
CommentsActivity commentsActivity = CommentsActivity.this;
listView.setAdapter((ListAdapter) new Listview1Adapter(commentsActivity.listmap));
((BaseAdapter) CommentsActivity.this.listview1.getAdapter()).notifyDataSetChanged();
}
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
String key = dataSnapshot.getKey();
HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
if (CommentsActivity.this.post_key.equals(hashMap.get("post_key").toString())) {
CommentsActivity.this.number = 0.0d;
for (int i = 0; i < CommentsActivity.this.listmap.size(); i++) {
if (((HashMap) CommentsActivity.this.listmap.get((int) CommentsActivity.this.number)).get("key").toString().equals(key)) {
CommentsActivity.this.listmap.remove((int) CommentsActivity.this.number);
CommentsActivity.this.listmap.add((int) CommentsActivity.this.number, hashMap);
}
CommentsActivity.this.number += 1.0d;
}
ListView listView = CommentsActivity.this.listview1;
CommentsActivity commentsActivity = CommentsActivity.this;
listView.setAdapter((ListAdapter) new Listview1Adapter(commentsActivity.listmap));
((BaseAdapter) CommentsActivity.this.listview1.getAdapter()).notifyDataSetChanged();
}
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
String key = dataSnapshot.getKey();
if (CommentsActivity.this.post_key.equals(((HashMap) dataSnapshot.getValue(genericTypeIndicator)).get("post_key").toString())) {
CommentsActivity.this.number = 0.0d;
for (int i = 0; i < CommentsActivity.this.listmap.size(); i++) {
if (((HashMap) CommentsActivity.this.listmap.get((int) CommentsActivity.this.number)).get("key").toString().equals(key)) {
CommentsActivity.this.listmap.remove((int) CommentsActivity.this.number);
}
CommentsActivity.this.number += 1.0d;
}
ListView listView = CommentsActivity.this.listview1;
CommentsActivity commentsActivity = CommentsActivity.this;
listView.setAdapter((ListAdapter) new Listview1Adapter(commentsActivity.listmap));
((BaseAdapter) CommentsActivity.this.listview1.getAdapter()).notifyDataSetChanged();
}
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this._comment_child_listener = childEventListener;
this.comment.addChildEventListener(childEventListener);
ChildEventListener childEventListener2 = new ChildEventListener() {
@Override
public void onChildMoved(DataSnapshot dataSnapshot, String str) {
}
@Override
public void onChildAdded(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
CommentsActivity.this.data2 = true;
if (hashMap.containsKey("name") && hashMap.containsKey("uid")) {
CommentsActivity.this.user_names.put(hashMap.get("uid").toString(), hashMap.get("name").toString());
}
if (hashMap.containsKey("verified") && hashMap.containsKey("uid")) {
CommentsActivity.this.verify_map.put(hashMap.get("uid").toString(), hashMap.get("verified").toString());
}
if (hashMap.containsKey(Scopes.PROFILE) && hashMap.containsKey("uid")) {
CommentsActivity.this.user_pic.put(hashMap.get("uid").toString(), hashMap.get(Scopes.PROFILE).toString());
}
if (hashMap.containsKey(TypedValues.Custom.S_COLOR) && hashMap.containsKey("uid")) {
CommentsActivity.this.user_color.put(hashMap.get("uid").toString(), hashMap.get(TypedValues.Custom.S_COLOR).toString());
}
}
@Override
public void onChildChanged(DataSnapshot dataSnapshot, String str) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
HashMap hashMap = (HashMap) dataSnapshot.getValue(genericTypeIndicator);
if (hashMap.containsKey("name") && hashMap.containsKey("uid")) {
CommentsActivity.this.user_names.put(hashMap.get("uid").toString(), hashMap.get("name").toString());
}
if (hashMap.containsKey("verified") && hashMap.containsKey("uid")) {
CommentsActivity.this.verify_map.put(hashMap.get("uid").toString(), hashMap.get("verified").toString());
}
if (hashMap.containsKey(Scopes.PROFILE) && hashMap.containsKey("uid")) {
CommentsActivity.this.user_pic.put(hashMap.get("uid").toString(), hashMap.get(Scopes.PROFILE).toString());
}
if (hashMap.containsKey(TypedValues.Custom.S_COLOR) && hashMap.containsKey("uid")) {
CommentsActivity.this.user_color.put(hashMap.get("uid").toString(), hashMap.get(TypedValues.Custom.S_COLOR).toString());
}
}
@Override
public void onChildRemoved(DataSnapshot dataSnapshot) {
GenericTypeIndicator<HashMap<String, Object>> genericTypeIndicator = new GenericTypeIndicator<HashMap<String, Object>>() {
};
dataSnapshot.getKey();
}
@Override
public void onCancelled(DatabaseError databaseError) {
databaseError.getCode();
databaseError.getMessage();
}
};
this._Users_child_listener = childEventListener2;
this.Users.addChildEventListener(childEventListener2);
this._network_request_listener = new RequestNetwork.RequestListener() {
@Override
public void onErrorResponse(String str, String str2) {
}
@Override
public void onResponse(String str, String str2, HashMap<String, Object> hashMap) {
}
};
this.auth_updateEmailListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_updatePasswordListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_emailVerificationSentListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_deleteUserListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_phoneAuthListener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_updateProfileListener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this.auth_googleSignInListener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._auth_create_user_listener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._auth_sign_in_listener = new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(Task<AuthResult> task) {
task.isSuccessful();
if (task.getException() != null) {
task.getException().getMessage();
}
}
};
this._auth_reset_password_listener = new OnCompleteListener<Void>() {
@Override
public void onComplete(Task<Void> task) {
task.isSuccessful();
}
};
}
public class AnonymousClass2 implements View.OnClickListener {
AnonymousClass2() {
}
@Override
public void onClick(View view) {
if (SketchwareUtil.isConnected(CommentsActivity.this.getApplicationContext())) {
if (!CommentsActivity.this.edittext1.getText().toString().trim().equals("")) {
CommentsActivity.this._Custom_Loading(true);
CommentsActivity.this.timer = new TimerTask() {
@Override
public void run() {
CommentsActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
CommentsActivity.this.c = Calendar.getInstance();
CommentsActivity.this.key = CommentsActivity.this.comment.push().getKey();
CommentsActivity.this.map = new HashMap();
CommentsActivity.this.map.put("message", CommentsActivity.this.edittext1.getText().toString().trim());
CommentsActivity.this.map.put("uid", FirebaseAuth.getInstance().getCurrentUser().getUid());
CommentsActivity.this.map.put("name", CommentsActivity.this.users.getString("name", ""));
CommentsActivity.this.map.put("verify", CommentsActivity.this.users.getString("verified", ""));
CommentsActivity.this.map.put(TypedValues.Custom.S_COLOR, CommentsActivity.this.users.getString(TypedValues.Custom.S_COLOR, ""));
CommentsActivity.this.map.put("post_key", CommentsActivity.this.post_key);
CommentsActivity.this.map.put("key", CommentsActivity.this.key);
CommentsActivity.this.map.put("time", new SimpleDateFormat("dd/MM/yyyy - hh:mm a").format(CommentsActivity.this.c.getTime()));
CommentsActivity.this.comment.child(CommentsActivity.this.key).updateChildren(CommentsActivity.this.map);
CommentsActivity.this.map.clear();
CommentsActivity.this.edittext1.setText("");
CommentsActivity.this._Custom_Loading(false);
}
});
}
};
CommentsActivity.this._timer.schedule(CommentsActivity.this.timer, 1000L);
return;
}
SketchwareUtil.showMessage(CommentsActivity.this.getApplicationContext(), "Escreva algo...");
return;
}
SketchwareUtil.showMessage(CommentsActivity.this.getApplicationContext(), "Sem conexão com a Internet");
}
}
private void initializeLogic() {
_design();
this.post_key = getIntent().getStringExtra("key");
this.uid = getIntent().getStringExtra("uid");
this.data1 = false;
this.data2 = false;
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
CommentsActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if (CommentsActivity.this.data1 && CommentsActivity.this.data2) {
CommentsActivity.this.linear_shimmer.setVisibility(8);
}
}
});
}
};
this.timer = timerTask;
this._timer.scheduleAtFixedRate(timerTask, 0L, 200L);
}
public void _Custom_Loading(boolean z) {
if (z) {
if (this.coreprog == null) {
ProgressDialog progressDialog = new ProgressDialog(this);
this.coreprog = progressDialog;
progressDialog.setCancelable(false);
this.coreprog.setCanceledOnTouchOutside(false);
this.coreprog.requestWindowFeature(1);
this.coreprog.getWindow().setBackgroundDrawable(new ColorDrawable(0));
}
this.coreprog.setMessage(null);
this.coreprog.show();
View inflate = getLayoutInflater().inflate(R.layout.custom_dialog, (ViewGroup) null);
LinearLayout linearLayout = (LinearLayout) inflate.findViewById(R.id.linear_base);
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(0);
gradientDrawable.setCornerRadius(25.0f);
linearLayout.setBackground(gradientDrawable);
this.coreprog.setContentView(inflate);
return;
}
ProgressDialog progressDialog2 = this.coreprog;
if (progressDialog2 != null) {
progressDialog2.dismiss();
}
}
public void _RippleRoundStrokev2(View view, String str, String str2, double d, double d2, String str3, double d3) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(Color.parseColor(str));
gradientDrawable.setCornerRadius((float) d);
view.setElevation((float) d3);
gradientDrawable.setStroke((int) d2, Color.parseColor("#" + str3.replace("#", "")));
view.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{Color.parseColor(str2)}), gradientDrawable, null));
}
public void _round_corner_and_ripple(View view, double d, double d2, String str, boolean z) {
if (z) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(Color.parseColor(str));
gradientDrawable.setCornerRadius((int) d);
view.setElevation((int) d2);
Drawable rippleDrawable = new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{Color.parseColor("#9e9e9e")}), gradientDrawable, null);
view.setClickable(true);
view.setBackground(rippleDrawable);
return;
}
GradientDrawable gradientDrawable2 = new GradientDrawable();
gradientDrawable2.setColor(Color.parseColor(str));
gradientDrawable2.setCornerRadius((int) d);
view.setBackground(gradientDrawable2);
view.setElevation((int) d2);
}
public void _rippleRoundStroke(View view, String str, String str2, double d, double d2, String str3) {
GradientDrawable gradientDrawable = new GradientDrawable();
gradientDrawable.setColor(Color.parseColor(str));
gradientDrawable.setCornerRadius((float) d);
gradientDrawable.setStroke((int) d2, Color.parseColor("#" + str3.replace("#", "")));
view.setBackground(new RippleDrawable(new ColorStateList(new int[][]{new int[0]}, new int[]{Color.parseColor(str2)}), gradientDrawable, null));
}
public void _design() {
getWindow().getDecorView().setSystemUiVisibility(8192);
getWindow().setStatusBarColor(-1);
this.textview_title.setText(getIntent().getStringExtra("title"));
this.listview1.setTranscriptMode(2);
this.textview_title.setEllipsize(TextUtils.TruncateAt.MARQUEE);
this.textview_title.setMarqueeRepeatLimit(-1);
this.textview_title.setSingleLine(true);
this.textview_title.setSelected(true);
this.network.startRequestNetwork("GET", "https://www.google.com", "Sketch Store Yt", this._network_request_listener);
_RippleRoundStrokev2(this.linear2, "#FFFFFF", "#FFFFFF", 0.0d, 0.0d, "#FFFFFF", 15.0d);
_rippleRoundStroke(this.shimmer1, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer2, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer3, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer4, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer5, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer6, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer7, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer8, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer9, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer10, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer11, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer12, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer13, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer14, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer15, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer16, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer17, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer18, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer19, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer20, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer21, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer22, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer23, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer24, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer25, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer26, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer27, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer28, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer29, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer30, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer31, "#BDBDBD", "#00000000", 360.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer32, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer33, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer34, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer35, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer36, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer37, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer38, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
_rippleRoundStroke(this.shimmer39, "#BDBDBD", "#00000000", 20.0d, 0.0d, "#00000000");
}
public class Listview1Adapter extends BaseAdapter {
ArrayList<HashMap<String, Object>> _data;
@Override
public long getItemId(int i) {
return i;
}
public Listview1Adapter(ArrayList<HashMap<String, Object>> arrayList) {
this._data = arrayList;
}
@Override
public int getCount() {
return this._data.size();
}
@Override
public HashMap<String, Object> getItem(int i) {
return this._data.get(i);
}
@Override
public View getView(final int i, View view, ViewGroup viewGroup) {
TextView textView;
View inflate = view == null ? CommentsActivity.this.getLayoutInflater().inflate(R.layout.comments_cus, (ViewGroup) null) : view;
LinearLayout linearLayout = (LinearLayout) inflate.findViewById(R.id.linear3);
LinearLayout linearLayout2 = (LinearLayout) inflate.findViewById(R.id.linear_profile);
ImageView imageView = (ImageView) inflate.findViewById(R.id.imageview_verify);
CircleImageView circleImageView = (CircleImageView) inflate.findViewById(R.id.circleimageview1);
LinearLayout linearLayout3 = (LinearLayout) inflate.findViewById(R.id.profileview);
TextView textView2 = (TextView) inflate.findViewById(R.id.name2);
TextView textView3 = (TextView) inflate.findViewById(R.id.time);
TextView textView4 = (TextView) inflate.findViewById(R.id.name);
TextView textView5 = (TextView) inflate.findViewById(R.id.message);
View view2 = inflate;
CommentsActivity.this._round_corner_and_ripple(linearLayout, 0.0d, 0.0d, "#FFFFFF", true);
CommentsActivity.this._rippleRoundStroke(imageView, "#FFFFFF", "#FFFFFF", 360.0d, 0.0d, "#000000");
CommentsActivity.this._rippleRoundStroke(linearLayout2, "#FFFFFF", "#FFFFFF", 360.0d, 0.0d, "#000000");
if (this._data.get(i).containsKey("message")) {
textView5.setText(this._data.get(i).get("message").toString());
}
if (this._data.get(i).containsKey("time")) {
textView3.setText(this._data.get(i).get("time").toString());
}
if (!CommentsActivity.this.verify_map.get(this._data.get(i).get("uid").toString()).toString().equals("false")) {
textView = textView4;
if (CommentsActivity.this.verify_map.get(this._data.get(i).get("uid").toString()).toString().equals("true")) {
imageView.setVisibility(0);
textView.setTextColor(-15506955);
} else {
imageView.setVisibility(8);
textView.setTextColor(ViewCompat.MEASURED_STATE_MASK);
}
} else {
imageView.setVisibility(8);
textView = textView4;
textView.setTextColor(ViewCompat.MEASURED_STATE_MASK);
}
if (this._data.get(i).containsKey("uid") && CommentsActivity.this.user_names.containsKey(this._data.get(i).get("uid").toString())) {
textView.setText(CommentsActivity.this.user_names.get(this._data.get(i).get("uid").toString()).toString());
}
if (CommentsActivity.this.user_pic.containsKey(this._data.get(i).get("uid").toString())) {
if (!CommentsActivity.this.user_pic.get(this._data.get(i).get("uid").toString()).toString().equals("")) {
Glide.with(CommentsActivity.this.getApplicationContext()).load(Uri.parse(CommentsActivity.this.user_pic.get(this._data.get(i).get("uid").toString()).toString())).into(circleImageView);
linearLayout3.setVisibility(8);
circleImageView.setVisibility(0);
} else {
linearLayout3.setVisibility(0);
circleImageView.setVisibility(8);
if (CommentsActivity.this.user_color.containsKey(this._data.get(i).get("uid").toString())) {
linearLayout3.setVisibility(0);
circleImageView.setVisibility(8);
CommentsActivity commentsActivity = CommentsActivity.this;
commentsActivity._round_corner_and_ripple(linearLayout3, 360.0d, 0.0d, commentsActivity.user_color.get(this._data.get(i).get("uid").toString()).toString(), false);
textView2.setText(CommentsActivity.this.user_names.get(this._data.get(i).get("uid").toString()).toString().trim().substring(0, 2).toUpperCase());
}
}
}
linearLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view3) {
CommentsActivity.this.intent.setClass(CommentsActivity.this.getApplicationContext(), AccountActivity.class);
CommentsActivity.this.developer.edit().putString("uid", ((HashMap) CommentsActivity.this.listmap.get(i)).get("uid").toString()).commit();
}
});
linearLayout.setOnLongClickListener(new AnonymousClass2(i));
return view2;
}
class AnonymousClass2 implements View.OnLongClickListener {
private final int val$_position;
AnonymousClass2(int i) {
this.val$_position = i;
}
@Override
public boolean onLongClick(View view) {
if (!SketchwareUtil.isConnected(CommentsActivity.this.getApplicationContext())) {
SketchwareUtil.showMessage(CommentsActivity.this.getApplicationContext(), "Sem internet");
} else {
final AlertDialog create = new AlertDialog.Builder(CommentsActivity.this).create();
View inflate = CommentsActivity.this.getLayoutInflater().inflate(R.layout.options, (ViewGroup) null);
create.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
create.setView(inflate);
LinearLayout linearLayout = (LinearLayout) inflate.findViewById(R.id.bg);
LinearLayout linearLayout2 = (LinearLayout) inflate.findViewById(R.id.b1);
LinearLayout linearLayout3 = (LinearLayout) inflate.findViewById(R.id.b2);
LinearLayout linearLayout4 = (LinearLayout) inflate.findViewById(R.id.b3);
LinearLayout linearLayout5 = (LinearLayout) inflate.findViewById(R.id.b4);
if (!((HashMap) CommentsActivity.this.listmap.get(this.val$_position)).get("uid").toString().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {
linearLayout4.setVisibility(8);
}
if (((HashMap) CommentsActivity.this.listmap.get(this.val$_position)).get("uid").toString().equals(FirebaseAuth.getInstance().getCurrentUser().getUid())) {
linearLayout2.setVisibility(8);
linearLayout5.setVisibility(8);
}
CommentsActivity.this._round_corner_and_ripple(linearLayout, 30.0d, 0.0d, "#FFFFFF", true);
CommentsActivity.this._round_corner_and_ripple(linearLayout2, 0.0d, 0.0d, "#FFFFFF", true);
CommentsActivity.this._round_corner_and_ripple(linearLayout3, 0.0d, 0.0d, "#FFFFFF", true);
CommentsActivity.this._round_corner_and_ripple(linearLayout4, 0.0d, 0.0d, "#FFFFFF", true);
CommentsActivity.this._round_corner_and_ripple(linearLayout5, 0.0d, 0.0d, "#FFFFFF", true);
final int i = this.val$_position;
linearLayout2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view2) {
CommentsActivity.this.intent.setClass(CommentsActivity.this.getApplicationContext(), AccountActivity.class);
CommentsActivity.this.developer.edit().putString("uid", ((HashMap) CommentsActivity.this.listmap.get(i)).get("uid").toString()).commit();
CommentsActivity.this.startActivity(CommentsActivity.this.intent);
CommentsActivity.this.overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
create.dismiss();
}
});
final int i2 = this.val$_position;
linearLayout3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view2) {
CommentsActivity commentsActivity = CommentsActivity.this;
CommentsActivity.this.getApplicationContext();
((ClipboardManager) commentsActivity.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("clipboard", ((HashMap) CommentsActivity.this.listmap.get(i2)).get("message").toString()));
SketchwareUtil.showMessage(CommentsActivity.this.getApplicationContext(), "Copied");
create.dismiss();
}
});
final int i3 = this.val$_position;
linearLayout4.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view2) {
CommentsActivity.this.dialog.setTitle("Excluir");
CommentsActivity.this.dialog.setMessage("Tem certeza de que deseja excluir?");
AlertDialog.Builder builder = CommentsActivity.this.dialog;
final int i4 = i3;
builder.setPositiveButton("Excluir", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i5) {
CommentsActivity.this.comment.child(((HashMap) CommentsActivity.this.listmap.get(i4)).get("key").toString()).removeValue();
SketchwareUtil.showMessage(CommentsActivity.this.getApplicationContext(), "Excluído");
}
});
CommentsActivity.this.dialog.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i5) {
}
});
CommentsActivity.this.dialog.create().show();
create.dismiss();
}
});
linearLayout5.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view2) {
SketchwareUtil.showMessage(CommentsActivity.this.getApplicationContext(), "Indisponível agora");
create.dismiss();
}
});
create.setCancelable(true);
create.show();
}
return true;
}
}
}
@Deprecated
public void showMessage(String str) {
Toast.makeText(getApplicationContext(), str, 0).show();
}
@Deprecated
public int getLocationX(View view) {
int[] iArr = new int[2];
view.getLocationInWindow(iArr);
return iArr[0];
}
@Deprecated
public int getLocationY(View view) {
int[] iArr = new int[2];
view.getLocationInWindow(iArr);
return iArr[1];
}
@Deprecated
public int getRandom(int i, int i2) {
return new Random().nextInt((i2 - i) + 1) + i;
}
@Deprecated
public ArrayList<Double> getCheckedItemPositionsToArray(ListView listView) {
ArrayList<Double> arrayList = new ArrayList<>();
SparseBooleanArray checkedItemPositions = listView.getCheckedItemPositions();
for (int i = 0; i < checkedItemPositions.size(); i++) {
if (checkedItemPositions.valueAt(i)) {
arrayList.add(Double.valueOf(checkedItemPositions.keyAt(i)));
}
}
return arrayList;
}
@Deprecated
public float getDip(int i) {
return TypedValue.applyDimension(1, i, getResources().getDisplayMetrics());
}
@Deprecated
public int getDisplayWidthPixels() {
return getResources().getDisplayMetrics().widthPixels;
}
@Deprecated
public int getDisplayHeightPixels() {
return getResources().getDisplayMetrics().heightPixels;
}
}