Skip to content

Commit 68f94ff

Browse files
committed
增加高亮色,修改卡片
1 parent 5fe3111 commit 68f94ff

File tree

5 files changed

+28
-10
lines changed

5 files changed

+28
-10
lines changed

app/src/main/kotlin/com/rayfantasy/icode/ui/activity/ReplyActivity.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import org.jetbrains.anko.toast
2424

2525
class ReplyActivity : ActivityBase() {
2626
companion object {
27-
const val LOAD_ONCE = 5
27+
const val LOAD_ONCE = 10
2828
}
2929

3030
private var id: Int = 1
@@ -105,10 +105,10 @@ class ReplyActivity : ActivityBase() {
105105
}
106106
//否则将结果加入codeGoods,并刷新adapter
107107
adapter.replyList.addAll(it)
108-
adapter.notifyDataSetChanged()
108+
if(refresh) adapter.notifyDataSetChanged()
109+
else adapter.notifyItemRangeInserted(adapter.itemCount -1 - it.size,it.size)
109110
cacheData(adapter.replyList)
110111
}
111-
/*}*/
112112
}, { t, rc ->
113113
reply_swip.isRefreshing = false
114114
request = null

app/src/main/res/layout/item_code_list.xml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<android.support.v7.widget.CardView
1717
android:layout_width="match_parent"
1818
android:id="@+id/code_card"
19-
android:layout_marginBottom="4dp"
20-
android:layout_marginTop="4dp"
19+
android:layout_marginBottom="2dp"
20+
android:layout_marginTop="2dp"
2121
android:foreground="?android:attr/selectableItemBackground"
2222
android:layout_height="wrap_content">
2323

@@ -68,7 +68,9 @@
6868
<LinearLayout
6969
android:layout_width="match_parent"
7070
android:background="#dddd"
71-
android:layout_height="1dp">
71+
android:layout_height="1dp"
72+
android:layout_marginLeft="10dp"
73+
android:layout_marginRight="10dp">
7274

7375
</LinearLayout>
7476

@@ -99,11 +101,19 @@
99101
android:layout_toEndOf="@+id/code_title"
100102
android:layout_marginTop="3dp" />
101103
</LinearLayout>
104+
<LinearLayout
105+
android:layout_width="match_parent"
106+
android:background="#dddd"
107+
android:layout_height="1dp"
108+
android:layout_marginRight="10dp"
109+
android:layout_marginLeft="10dp">
102110

111+
</LinearLayout>
103112
<RelativeLayout
104113
android:layout_width="match_parent"
105114
android:layout_height="wrap_content">
106115

116+
107117
<com.like.LikeButton
108118
app:icon_type="heart"
109119
app:icon_size="16dp"
@@ -136,7 +146,7 @@
136146
android:layout_alignParentEnd="true"
137147
android:layout_marginRight="16dp"
138148
android:layout_marginEnd="16dp"
139-
android:layout_marginTop="24dp" />
149+
android:layout_marginTop="14dp" />
140150
</RelativeLayout>
141151
</LinearLayout>
142152
</android.support.v7.widget.CardView>

app/src/main/res/layout/item_recycler_reply_list.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
android:id="@+id/element_bg"
2020
android:layout_width="match_parent"
2121
android:layout_height="wrap_content"
22-
android:layout_marginBottom="4dp"
23-
android:layout_marginTop="4dp"
22+
android:layout_marginBottom="1dp"
23+
android:layout_marginTop="1dp"
2424
android:clickable="true"
2525
android:foreground="?android:attr/selectableItemBackground"
2626
android:transitionName="element_bg"

app/src/main/res/values/colors.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,12 @@
4949
<color name="colorPrimaryDark_deepblue">#303f9f</color>
5050
<color name="colorAccent_deepblue">#ff4081</color>
5151

52+
<!--code高亮颜色-->
53+
<color name="hight_light_brown">#724938</color>
54+
<color name="hight_light_blue">#0D5661</color>
55+
<color name="hight_light_purple">#3C2F41</color>
56+
<color name="hight_light_red">#CB4042</color>
57+
<color name="hight_light_yellow">#F05E1C</color>
58+
59+
5260
</resources>

postutil/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ dependencies {
5858
compile 'com.loopj.android:android-async-http:1.4.9'
5959
compile 'com.squareup.okhttp:okhttp:2.5.0'
6060
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
61-
compile 'com.google.code.gson:gson:2.5'
61+
compile 'com.google.code.gson:gson:2.6.1'
6262
compile 'com.mcxiaoke.volley:library:1.0.19'
6363

6464
//anko

0 commit comments

Comments
 (0)