show "add linked id" button only for secret keys

This commit is contained in:
Vincent Breitmoser 2018-03-24 18:17:50 +01:00
parent a363a6cacb
commit 993cb57d92
2 changed files with 5 additions and 13 deletions

View file

@ -85,14 +85,9 @@ public class IdentitiesPresenter implements LoaderCallbacks<List<IdentityInfo>>
});
view.setIdentitiesAdapter(identitiesAdapter);
view.setAddLinkedIdButtonVisible(showLinkedIds);
view.setAddLinkedIdButtonVisible(showLinkedIds && isSecret);
view.setIdentitiesCardListener(new IdentitiesCardListener() {
@Override
public void onClickAddIdentity() {
addLinkedIdentity();
}
});
view.setIdentitiesCardListener(() -> addLinkedIdentity());
}
public void startLoader(LoaderManager loaderManager) {

View file

@ -50,12 +50,9 @@ public class IdentitiesCardView extends CardView implements IdentitiesMvpView {
vIdentities.addItemDecoration(new DividerItemDecoration(context, DividerItemDecoration.VERTICAL_LIST, false));
linkedIdsAddButton = view.findViewById(R.id.view_key_card_linked_ids_add);
linkedIdsAddButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (identitiesCardListener != null) {
identitiesCardListener.onClickAddIdentity();
}
linkedIdsAddButton.setOnClickListener(v -> {
if (identitiesCardListener != null) {
identitiesCardListener.onClickAddIdentity();
}
});
}