Skip to content
Snippets Groups Projects
Commit 0aefb644 authored by adi.bk's avatar adi.bk
Browse files

- Fix bug where issue title was not being set

- Use compund drawable instead of an imageview
- Reset compound drawable every time so that viewholders being reused show the correct confidentiality status
parent 976f6997
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -251,6 +251,7 @@ class IssueActivity : BaseActivity() {
 
fun bindIssue() {
setOpenCloseMenuStatus()
textTitle.text = issue?.title
toolbarTitle.text = getString(R.string.issue_number, issue?.iid)
if (issue?.isConfidential!!) {
toolbarTitle.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_confidential_24dp, 0)
Loading
Loading
Loading
Loading
@@ -33,7 +33,6 @@ class IssueViewHolder(view: View) : RecyclerView.ViewHolder(view) {
@BindView(R.id.issue_image) lateinit var image: ImageView
@BindView(R.id.issue_message) lateinit var textMessage: TextView
@BindView(R.id.issue_creator) lateinit var textCreator: TextView
@BindView(R.id.issue_confidential_image) lateinit var imageConfidential: ImageView
 
init {
ButterKnife.bind(this, view)
Loading
Loading
@@ -57,6 +56,10 @@ class IssueViewHolder(view: View) : RecyclerView.ViewHolder(view) {
}
 
textMessage.text = issue.title
textMessage.setCompoundDrawablesWithIntrinsicBounds(0, 0, 0, 0)
if (issue.isConfidential) {
textMessage.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_confidential_24dp, 0, 0, 0)
}
 
var time = ""
if (issue.createdAt != null) {
Loading
Loading
@@ -74,10 +77,5 @@ class IssueViewHolder(view: View) : RecyclerView.ViewHolder(view) {
id = "#" + issueId
 
textCreator.text = String.format(itemView.context.getString(R.string.opened_time), id, time, author)
if (issue.isConfidential) {
imageConfidential.visibility = View.VISIBLE
imageConfidential.setImageResource(R.drawable.ic_confidential_24dp)
}
}
}
Loading
Loading
@@ -9,31 +9,24 @@
android:baselineAligned="false">
<!--baselineAligned="false" is recommended for better performance by Android Studio-->
 
<RelativeLayout
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="8dp"
android:orientation="vertical"
android:layout_weight="1">
 
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/issue_confidential_image"
android:visibility="gone"
android:layout_marginRight="8dp"
tools:src="@drawable/ic_confidential_24dp"/>
<TextView
android:id="@+id/issue_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="2"
android:drawablePadding="8dp"
android:textSize="@dimen/text_size_small"
android:layout_toRightOf="@id/issue_confidential_image"
tools:text="I commited all the code at once cause I am cool. So sorry" />
 
<TextView
Loading
Loading
@@ -41,10 +34,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_tiny"
android:layout_below="@+id/issue_message"
tools:text="Created 45 days ago by Jawnnypoo" />
 
</RelativeLayout>
</LinearLayout>
 
<LinearLayout
android:orientation="vertical"
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment