Display lock icon on locked profiles

main
Eugen Rochko 8 years ago
parent 2e50c547ce
commit bc46afd801
  1. 11
      app/src/main/java/com/keylesspalace/tusky/AccountActivity.java
  2. 32
      app/src/main/res/layout/activity_account.xml

@ -47,6 +47,8 @@ import com.squareup.picasso.Picasso;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
@ -63,10 +65,13 @@ public class AccountActivity extends BaseActivity {
private TabLayout tabLayout; private TabLayout tabLayout;
private Account loadedAccount; private Account loadedAccount;
@BindView(R.id.account_locked) ImageView accountLockedView;
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account); setContentView(R.layout.activity_account);
ButterKnife.bind(this);
Intent intent = getIntent(); Intent intent = getIntent();
accountId = intent.getStringExtra("id"); accountId = intent.getStringExtra("id");
@ -193,6 +198,12 @@ public class AccountActivity extends BaseActivity {
note.setLinksClickable(true); note.setLinksClickable(true);
note.setMovementMethod(LinkMovementMethod.getInstance()); note.setMovementMethod(LinkMovementMethod.getInstance());
if (account.locked) {
accountLockedView.setVisibility(View.VISIBLE);
} else {
accountLockedView.setVisibility(View.GONE);
}
Picasso.with(this) Picasso.with(this)
.load(account.avatar) .load(account.avatar)
.placeholder(R.drawable.avatar_default) .placeholder(R.drawable.avatar_default)

@ -78,14 +78,30 @@
android:textColor="?android:textColorPrimary" android:textColor="?android:textColorPrimary"
android:textSize="18sp" /> android:textSize="18sp" />
<TextView <RelativeLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content">
android:maxLines="1" <TextView
android:ellipsize="end" android:layout_width="wrap_content"
android:textColor="?android:textColorSecondary" android:layout_height="wrap_content"
android:id="@+id/account_username" /> android:maxLines="1"
android:ellipsize="end"
android:textColor="?android:textColorSecondary"
android:id="@+id/account_username" />
<ImageView
android:id="@+id/account_locked"
android:visibility="gone"
android:layout_centerVertical="true"
android:layout_width="16sp"
android:layout_height="16sp"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_toEndOf="@id/account_username"
app:srcCompat="@drawable/reblog_disabled_light"
android:tint="?android:textColorSecondary"
android:layout_toRightOf="@id/account_username" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>

Loading…
Cancel
Save