diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java index bbdaf4e3..ebf1ebd9 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java @@ -289,6 +289,16 @@ public class AccountActivity extends BaseActivity { updateButtons(); } + private void updateFollowButton(FloatingActionButton button) { + if (following) { + button.setImageResource(R.drawable.ic_person_minus_24px); + button.setContentDescription(getString(R.string.action_unfollow)); + } else { + button.setImageResource(R.drawable.ic_person_add_24dp); + button.setContentDescription(getString(R.string.action_follow)); + } + } + private void updateButtons() { invalidateOptionsMenu(); @@ -297,24 +307,13 @@ public class AccountActivity extends BaseActivity { if(!isSelf && !blocking) { floatingBtn.show(); - if (following) { - floatingBtn.setImageResource(R.drawable.ic_person_minus_24px); - } else { - floatingBtn.setImageResource(R.drawable.ic_person_add_24dp); - } + updateFollowButton(floatingBtn); floatingBtn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - follow(accountId); - - if (following) { - floatingBtn.setImageResource(R.drawable.ic_person_minus_24px); - } else { - floatingBtn.setImageResource(R.drawable.ic_person_add_24dp); - } - + updateFollowButton(floatingBtn); } }); } diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml index 41b8c1e2..e3504dd6 100644 --- a/app/src/main/res/layout/activity_account.xml +++ b/app/src/main/res/layout/activity_account.xml @@ -36,7 +36,8 @@ app:layout_collapseMode="pin" android:fitsSystemWindows="true" android:layout_alignTop="@+id/account_header_info" - android:layout_alignBottom="@id/account_header_info" /> + android:layout_alignBottom="@id/account_header_info" + android:contentDescription="@null" /> + android:layout_toRightOf="@id/account_username" + android:contentDescription="@string/description_account_locked"/> @@ -181,6 +183,7 @@ android:layout_gravity="bottom|end" android:layout_margin="16dp" android:layout_height="wrap_content" - app:srcCompat="@drawable/ic_person_add_24dp"/> + app:srcCompat="@drawable/ic_person_add_24dp" + android:contentDescription="@string/action_follow" /> diff --git a/app/src/main/res/layout/activity_compose.xml b/app/src/main/res/layout/activity_compose.xml index fd3dd798..8361da98 100644 --- a/app/src/main/res/layout/activity_compose.xml +++ b/app/src/main/res/layout/activity_compose.xml @@ -1,5 +1,6 @@ - + app:srcCompat="@drawable/ic_attach_file_24dp" + android:contentDescription="@string/action_photo_pick" /> + app:srcCompat="@drawable/ic_public_24dp" + android:contentDescription="@string/action_compose_options" />