From bc46afd801499c02a74db6180ff48b5169a9ff88 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Tue, 14 Mar 2017 15:27:22 +0100 Subject: [PATCH] Display lock icon on locked profiles --- .../keylesspalace/tusky/AccountActivity.java | 11 +++++++ app/src/main/res/layout/activity_account.xml | 30 ++++++++++++++----- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java index a5ce6ab4e..22b417d11 100644 --- a/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/AccountActivity.java @@ -47,6 +47,8 @@ import com.squareup.picasso.Picasso; import java.util.ArrayList; import java.util.List; +import butterknife.BindView; +import butterknife.ButterKnife; import retrofit2.Call; import retrofit2.Callback; import retrofit2.Response; @@ -63,10 +65,13 @@ public class AccountActivity extends BaseActivity { private TabLayout tabLayout; private Account loadedAccount; + @BindView(R.id.account_locked) ImageView accountLockedView; + @Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_account); + ButterKnife.bind(this); Intent intent = getIntent(); accountId = intent.getStringExtra("id"); @@ -193,6 +198,12 @@ public class AccountActivity extends BaseActivity { note.setLinksClickable(true); note.setMovementMethod(LinkMovementMethod.getInstance()); + if (account.locked) { + accountLockedView.setVisibility(View.VISIBLE); + } else { + accountLockedView.setVisibility(View.GONE); + } + Picasso.with(this) .load(account.avatar) .placeholder(R.drawable.avatar_default) diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml index 32399cb1b..af884a60c 100644 --- a/app/src/main/res/layout/activity_account.xml +++ b/app/src/main/res/layout/activity_account.xml @@ -78,14 +78,30 @@ android:textColor="?android:textColorPrimary" android:textSize="18sp" /> - + + + +