From 6063246b9673ac1597307a9d901a1719a29e8ce8 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sat, 12 Nov 2022 18:57:07 +0100 Subject: [PATCH] apply changes --- .../fedilab/android/activities/AdminAccountActivity.java | 4 ++-- .../app/fedilab/android/viewmodel/mastodon/AdminVM.java | 7 +++++++ app/src/main/res/layout/drawer_list.xml | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/activities/AdminAccountActivity.java b/app/src/main/java/app/fedilab/android/activities/AdminAccountActivity.java index 9965af5d..329b6c9f 100644 --- a/app/src/main/java/app/fedilab/android/activities/AdminAccountActivity.java +++ b/app/src/main/java/app/fedilab/android/activities/AdminAccountActivity.java @@ -147,7 +147,7 @@ public class AdminAccountActivity extends BaseActivity { }); binding.silenceAction.setOnClickListener(v -> { - if (adminAccount.disabled) { + if (adminAccount.silenced) { adminVM.unsilence(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, adminAccount.id) .observe(AdminAccountActivity.this, adminAccountResult -> { adminAccount = adminAccountResult; @@ -161,7 +161,7 @@ public class AdminAccountActivity extends BaseActivity { }); binding.suspendAction.setOnClickListener(v -> { - if (adminAccount.disabled) { + if (adminAccount.suspended) { adminVM.unsuspend(BaseMainActivity.currentInstance, BaseMainActivity.currentToken, adminAccount.id) .observe(AdminAccountActivity.this, adminAccountResult -> { adminAccount = adminAccountResult; diff --git a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/AdminVM.java b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/AdminVM.java index cb764d01..132d9625 100644 --- a/app/src/main/java/app/fedilab/android/viewmodel/mastodon/AdminVM.java +++ b/app/src/main/java/app/fedilab/android/viewmodel/mastodon/AdminVM.java @@ -17,6 +17,7 @@ package app.fedilab.android.viewmodel.mastodon; import android.app.Application; import android.os.Handler; import android.os.Looper; +import android.util.Log; import androidx.annotation.NonNull; import androidx.lifecycle.AndroidViewModel; @@ -213,10 +214,13 @@ public class AdminVM extends AndroidViewModel { AdminAccount adminAccount = null; Call approveCall = mastodonAdminService.approve(token, accountId); if (approveCall != null) { + Log.v(Helper.TAG, "request: " + approveCall.request()); try { Response approveResponse = approveCall.execute(); if (approveResponse.isSuccessful()) { adminAccount = approveResponse.body(); + } else { + Log.v(Helper.TAG, "err: " + approveResponse.errorBody().string()); } } catch (Exception e) { e.printStackTrace(); @@ -342,10 +346,13 @@ public class AdminVM extends AndroidViewModel { AdminAccount adminAccount = null; Call unsuspendCall = mastodonAdminService.unsuspend(token, accountId); if (unsuspendCall != null) { + Log.v(Helper.TAG, "request: " + unsuspendCall.request()); try { Response unsuspendResponse = unsuspendCall.execute(); if (unsuspendResponse.isSuccessful()) { adminAccount = unsuspendResponse.body(); + } else { + Log.v(Helper.TAG, "err: " + unsuspendResponse.errorBody().string()); } } catch (Exception e) { e.printStackTrace(); diff --git a/app/src/main/res/layout/drawer_list.xml b/app/src/main/res/layout/drawer_list.xml index 3ec10f03..bb1577d0 100644 --- a/app/src/main/res/layout/drawer_list.xml +++ b/app/src/main/res/layout/drawer_list.xml @@ -10,5 +10,6 @@ android:textAlignment="textStart" android:textColor="@color/cyanea_accent_dark_reference" app:icon="@drawable/ic_baseline_navigate_next_24" + app:iconTint="@color/cyanea_accent_dark_reference" app:iconGravity="end" app:strokeColor="@color/cyanea_accent_dark_reference" /> \ No newline at end of file