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:
relan 2015-09-23 18:34:51 +03:00
parent 38a19c305d
commit 3434d71569
2 changed files with 19 additions and 8 deletions

View File

@ -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"

View File

@ -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);
}
}
}