Split "unsigned" and "unverified"
Since now we don't have problems with list item height, we can use two different text labels for unsigned and unverified repositories indication. Code now only switches visibility for them.
This commit is contained in:
parent
38a19c305d
commit
3434d71569
@ -30,6 +30,17 @@
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repo_unverified"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical|start"
|
||||
android:text="@string/unverified"
|
||||
android:textSize="14sp"
|
||||
android:textColor="@color/unverified"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/repo_unsigned"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -84,17 +84,17 @@ public class RepoAdapter extends CursorAdapter {
|
||||
TextView nameView = (TextView)view.findViewById(R.id.repo_name);
|
||||
nameView.setText(repo.getName());
|
||||
|
||||
TextView signedView = (TextView) view.findViewById(R.id.repo_unsigned);
|
||||
View unsignedView = view.findViewById(R.id.repo_unsigned);
|
||||
View unverifiedView = view.findViewById(R.id.repo_unverified);
|
||||
if (repo.isSigned()) {
|
||||
signedView.setVisibility(View.GONE);
|
||||
unsignedView.setVisibility(View.GONE);
|
||||
unverifiedView.setVisibility(View.GONE);
|
||||
} else if (repo.isSignedButUnverified()) {
|
||||
signedView.setText(R.string.unverified);
|
||||
signedView.setTextColor(view.getResources().getColor(R.color.unverified));
|
||||
signedView.setVisibility(View.VISIBLE);
|
||||
unsignedView.setVisibility(View.GONE);
|
||||
unverifiedView.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
signedView.setText(R.string.unsigned);
|
||||
signedView.setTextColor(view.getResources().getColor(R.color.unsigned));
|
||||
signedView.setVisibility(View.VISIBLE);
|
||||
unsignedView.setVisibility(View.VISIBLE);
|
||||
unverifiedView.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user