Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds-android
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
云深项目组
beyond-clouds-android
Commits
80b36517
Commit
80b36517
authored
Mar 21, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问答列表完成
parent
8bc7b9bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
62 deletions
+35
-62
app/src/main/java/cn/yunliyunwai/beyondclouds/adapter/QuestionListRecyclerViewAdapter.java
+10
-6
app/src/main/java/cn/yunliyunwai/beyondclouds/data/model/Question.java
+2
-1
app/src/main/res/layout/question_item.xml
+23
-55
No files found.
app/src/main/java/cn/yunliyunwai/beyondclouds/adapter/QuestionListRecyclerViewAdapter.java
View file @
80b36517
package
cn
.
yunliyunwai
.
beyondclouds
.
adapter
;
package
cn
.
yunliyunwai
.
beyondclouds
.
adapter
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
cn.yunliyunwai.beyondclouds.data.model.Question
;
import
cn.yunliyunwai.beyondclouds.data.model.Question
;
import
cn.yunliyunwai.beyondclouds.databinding.QuestionItemBinding
;
import
cn.yunliyunwai.beyondclouds.databinding.QuestionItemBinding
;
import
cn.yunliyunwai.beyondclouds.util.DateUtils
;
import
cn.yunliyunwai.beyondclouds.util.GlideRoundTransform
;
public
class
QuestionListRecyclerViewAdapter
extends
BaseQuickAdapter
<
Question
,
BaseViewHolder
>
{
public
class
QuestionListRecyclerViewAdapter
extends
BaseQuickAdapter
<
Question
,
BaseViewHolder
>
{
private
static
final
GlideRoundTransform
glideRoundTransform
=
new
GlideRoundTransform
(
3
);
public
QuestionListRecyclerViewAdapter
(
int
layoutResId
)
{
public
QuestionListRecyclerViewAdapter
(
int
layoutResId
)
{
super
(
layoutResId
);
super
(
layoutResId
);
}
}
...
@@ -21,8 +20,12 @@ public class QuestionListRecyclerViewAdapter extends BaseQuickAdapter<Question,B
...
@@ -21,8 +20,12 @@ public class QuestionListRecyclerViewAdapter extends BaseQuickAdapter<Question,B
QuestionItemBinding
binding
=
QuestionItemBinding
.
bind
(
helper
.
itemView
);
QuestionItemBinding
binding
=
QuestionItemBinding
.
bind
(
helper
.
itemView
);
binding
.
txtTitle
.
setText
(
question
.
getQuestionTitle
());
binding
.
txtTitle
.
setText
(
question
.
getQuestionTitle
());
binding
.
txtAbstract
.
setText
(
question
.
getQuestionAbstract
());
binding
.
txtReplyNumber
.
setText
(
question
.
getReplyNumber
()
+
"回答"
);
binding
.
txtAuthor
.
setText
(
question
.
getUserNick
());
binding
.
txtCreateTime
.
setText
(
DateUtils
.
format
(
question
.
getCreateTime
()));
if
(
question
.
isSolved
())
{
binding
.
txtSolved
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
binding
.
txtSolved
.
setVisibility
(
View
.
GONE
);
}
}
}
}
}
\ No newline at end of file
app/src/main/java/cn/yunliyunwai/beyondclouds/data/model/Question.java
View file @
80b36517
...
@@ -8,7 +8,8 @@ import lombok.Data;
...
@@ -8,7 +8,8 @@ import lombok.Data;
public
class
Question
{
public
class
Question
{
private
String
questionId
;
private
String
questionId
;
private
String
questionTitle
;
private
String
questionTitle
;
private
String
questionAbstract
;
private
String
replyNumber
;
private
String
userNick
;
private
String
userNick
;
private
boolean
solved
;
private
Date
createTime
;
private
Date
createTime
;
}
}
app/src/main/res/layout/question_item.xml
View file @
80b36517
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"22dp"
android:layout_height=
"22dp"
android:text=
"SpringBoot迭代发布JRA瘦身配置"
android:text=
"SpringBoot迭代发布JRA瘦身配置"
android:textSize=
"1
6
sp"
android:textSize=
"1
5
sp"
android:textColor=
"@color/colorTextLevel3"
android:textColor=
"@color/colorTextLevel3"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
...
@@ -32,75 +32,43 @@
...
@@ -32,75 +32,43 @@
tools:layout_editor_absoluteY=
"16dp"
/>
tools:layout_editor_absoluteY=
"16dp"
/>
<TextView
<TextView
android:id=
"@+id/txt_
abstract
"
android:id=
"@+id/txt_
reply_number
"
android:layout_marginTop=
"
10
dp"
android:layout_marginTop=
"
8
dp"
android:layout_width=
"
0dp
"
android:layout_width=
"
wrap_content
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxHeight=
"55dp"
android:maxHeight=
"55dp"
android:textSize=
"12sp"
android:textSize=
"12sp"
android:text=
"
我们所处的时代我们所处的时代我们所处的时代我们所处的时代我们所处的时代我们所处的时代我们所处的时代我们所处的时代
"
android:text=
"
0回答
"
app:layout_constraintTop_toBottomOf=
"@id/barrier_title"
app:layout_constraintTop_toBottomOf=
"@id/barrier_title"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
/>
app:layout_constraintEnd_toEndOf=
"parent"
/>
<androidx.constraintlayout.widget.Barrier
android:id=
"@+id/barrier_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:barrierDirection=
"bottom"
app:constraint_referenced_ids=
"txt_abstract"
tools:layout_editor_absoluteX=
"12dp"
tools:layout_editor_absoluteY=
"16dp"
/>
<TextView
<TextView
android:id=
"@+id/txt_author"
android:id=
"@+id/txt_solved"
android:layout_marginTop=
"10dp"
android:layout_marginTop=
"8dp"
android:text=
"段启岩"
android:layout_marginStart=
"20dp"
android:textSize=
"10sp"
android:layout_marginLeft=
"20dp"
android:textColor=
"@color/colorTextLevel5"
app:layout_constraintTop_toBottomOf=
"@id/barrier_title"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/txt_reply_number"
app:layout_constraintTop_toBottomOf=
"@id/barrier_content"
android:layout_width=
"132dp"
android:layout_width=
"wrap_content"
android:layout_height=
"18dp"
android:layout_height=
"wrap_content"
/>
android:text=
"已解决"
<TextView
android:textColor=
"#75d098"
android:id=
"@+id/txt_dot"
android:textSize=
"12sp"
android:text=
"·"
android:gravity=
"left"
android:layout_marginTop=
"10dp"
/>
android:textSize=
"10sp"
android:textStyle=
"bold"
android:textColor=
"@color/colorTextLevel5"
app:layout_constraintTop_toBottomOf=
"@id/barrier_content"
app:layout_constraintStart_toEndOf=
"@id/txt_author"
android:paddingStart=
"6dp"
android:paddingLeft=
"6dp"
android:paddingEnd=
"6dp"
android:paddingRight=
"6dp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/txt_create_time"
android:layout_marginTop=
"10dp"
android:textSize=
"10sp"
android:textColor=
"@color/colorTextLevel5"
android:text=
"2020-2-18 10:24:00"
app:layout_constraintTop_toBottomOf=
"@id/barrier_content"
app:layout_constraintStart_toEndOf=
"@id/txt_dot"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<androidx.constraintlayout.widget.Barrier
<androidx.constraintlayout.widget.Barrier
android:id=
"@+id/barrier_
info
"
android:id=
"@+id/barrier_
content
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
app:barrierDirection=
"bottom"
app:barrierDirection=
"bottom"
app:constraint_referenced_ids=
"txt_
create_time,txt_author,txt_dot
"
app:constraint_referenced_ids=
"txt_
reply_number
"
tools:layout_editor_absoluteX=
"12dp"
tools:layout_editor_absoluteX=
"12dp"
tools:layout_editor_absoluteY=
"16dp"
/>
tools:layout_editor_absoluteY=
"16dp"
/>
<View
<View
app:layout_constraintTop_toBottomOf=
"@id/barrier_
info
"
app:layout_constraintTop_toBottomOf=
"@id/barrier_
content
"
android:layout_marginTop=
"1
8
dp"
android:layout_marginTop=
"1
4
dp"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_height=
"1dp"
android:layout_height=
"1dp"
android:background=
"#efefef"
/>
android:background=
"#efefef"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment