refactor: enable social media links and improve visibility logic in MainActivity
- Re-enabled Facebook, Telegram, and WhatsApp click listeners to launch respective apps. - Updated visibility logic for notification items and other app links based on user IDs. - Cleaned up commented-out code and adjusted layout visibility in activity_main2.xml.
This commit is contained in:
@@ -549,22 +549,29 @@ public class MainActivity extends AppCompatActivity {
|
||||
.subscribe(new BaseObserver<>() {
|
||||
@Override
|
||||
public void onSuccess(Result<ResultDataInfo<MessageInfo>> o) {
|
||||
if (o.data != null && o.data.getTotal() > 0) {
|
||||
boolean blockedIds = userId == 112 || userId == 87 || userId == 91 || userId == 93
|
||||
|| userId == 92 || userId == 84 || userId == 120 || userId == 70
|
||||
|| userId == 143 || userId == 149;
|
||||
|
||||
if (blockedIds) {
|
||||
activityMain2Binding.btNotifyitem.setVisibility(View.INVISIBLE);
|
||||
activityMain2Binding.layoutOtherapp.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
boolean hasMsgs = o.data != null && o.data.getTotal() > 0;
|
||||
if (hasMsgs) {
|
||||
if (userId == 217 || userId == 211) {
|
||||
activityMain2Binding.btOtherapp.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
activityMain2Binding.btOtherapp.setVisibility(View.INVISIBLE);
|
||||
activityMain2Binding.ivOtherApp.setImageResource(R.mipmap.ic_shousuo);
|
||||
|
||||
}
|
||||
|
||||
activityMain2Binding.btNotifyitem.setVisibility(View.GONE);
|
||||
if (userId == 112 || userId == 87 || userId == 91 || userId == 93
|
||||
|| userId == 92 || userId == 84 || userId == 120 || userId == 70 || userId == 143 || userId == 149) {
|
||||
activityMain2Binding.btNotifyitem.setVisibility(View.INVISIBLE);
|
||||
activityMain2Binding.layoutOtherapp.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
activityMain2Binding.btNotifyitem.setVisibility(View.VISIBLE);
|
||||
if (userId == 217 || userId == 211) {
|
||||
activityMain2Binding.layoutOtherapp.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user