Updated 3 files from recycler-view-all
This commit is contained in:
committed by
Dominik Schürmann
parent
37abe757f0
commit
ca67c52aa0
@@ -76,7 +76,6 @@ public class SelectSignKeyIdActivity extends BaseActivity {
|
||||
if (appUri == null) {
|
||||
Log.e(Constants.TAG, "Intent data missing. Should be Uri of app!");
|
||||
finish();
|
||||
return;
|
||||
} else {
|
||||
Log.d(Constants.TAG, "uri: " + appUri);
|
||||
startListFragments(savedInstanceState, appUri, mData, mPreferredUserId);
|
||||
|
||||
@@ -91,7 +91,10 @@ public class SelectSignKeyIdListFragment extends RecyclerFragment<SelectSignKeyA
|
||||
// application this would come from a resource.
|
||||
setEmptyText(getString(R.string.list_empty));
|
||||
|
||||
setAdapter(new SelectSignKeyAdapter(getContext(), null));
|
||||
SelectSignKeyAdapter adapter = new SelectSignKeyAdapter(getContext(), null);
|
||||
adapter.setListener(this);
|
||||
|
||||
setAdapter(adapter);
|
||||
setLayoutManager(new LinearLayoutManager(getContext()));
|
||||
|
||||
// Start out with a progress indicator.
|
||||
@@ -151,6 +154,12 @@ public class SelectSignKeyIdListFragment extends RecyclerFragment<SelectSignKeyA
|
||||
getAdapter().swapCursor(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
getAdapter().setListener(null);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreateKeyDummyClicked() {
|
||||
OpenPgpUtils.UserId userIdSplit = KeyRing.splitUserId(mPrefUid);
|
||||
|
||||
@@ -109,7 +109,7 @@ public class SelectSignKeyAdapter extends KeyCursorAdapter<CursorAdapter.KeyCurs
|
||||
|
||||
public SignKeyItemHolder(View itemView) {
|
||||
super(itemView);
|
||||
itemView.setClickable(false);
|
||||
itemView.setClickable(true);
|
||||
itemView.setOnClickListener(this);
|
||||
|
||||
mUserIdText = (TextView) itemView.findViewById(R.id.select_key_item_name);
|
||||
@@ -148,6 +148,7 @@ public class SelectSignKeyAdapter extends KeyCursorAdapter<CursorAdapter.KeyCurs
|
||||
R.color.key_flag_gray
|
||||
);
|
||||
|
||||
itemView.setEnabled(false);
|
||||
mStatusIcon.setVisibility(View.VISIBLE);
|
||||
textColor = ContextCompat.getColor(context, R.color.key_flag_gray);
|
||||
} else if (cursor.isExpired()) {
|
||||
@@ -159,10 +160,11 @@ public class SelectSignKeyAdapter extends KeyCursorAdapter<CursorAdapter.KeyCurs
|
||||
R.color.key_flag_gray
|
||||
);
|
||||
|
||||
itemView.setEnabled(false);
|
||||
mStatusIcon.setVisibility(View.VISIBLE);
|
||||
textColor = ContextCompat.getColor(context, R.color.key_flag_gray);
|
||||
} else {
|
||||
itemView.setClickable(true);
|
||||
itemView.setEnabled(true);
|
||||
mStatusIcon.setVisibility(View.GONE);
|
||||
textColor = FormattingUtils.getColorFromAttr(context, R.attr.colorText);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user