changed AccountActivity so that it shows FAB that allows a user to un/follow a user from it instead of the menu

added an xml svg for unfollowing someone
removed the useless line from build.gradle that I added in the last pull
This commit is contained in:
Zachary Epps 2017-04-06 11:07:40 -04:00
commit 7a5e5dca7e
3 changed files with 28 additions and 4 deletions

View file

@ -294,14 +294,27 @@ public class AccountActivity extends BaseActivity {
final FloatingActionButton floatingBtn = (FloatingActionButton) findViewById(R.id.floating_btn);
if(!isSelf && !blocking && !following) {
if(!isSelf && !blocking) {
floatingBtn.show();
floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
if (following) {
floatingBtn.setImageResource(R.drawable.ic_person_minus_24px);
} else {
floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
}
floatingBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
follow(accountId);
floatingBtn.hide();
if (following) {
floatingBtn.setImageResource(R.drawable.ic_person_minus_24px);
} else {
floatingBtn.setImageResource(R.drawable.ic_person_add_24dp);
}
}
});
}