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