Skip to content

Commit

Permalink
移除个人空间好友列表,新增 ChatGPT 节点图标
Browse files Browse the repository at this point in the history
  • Loading branch information
eternaljust committed Mar 17, 2023
1 parent 23578ed commit 0116bee
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,12 @@ private fun NodeCategoryIcon(fid: String) = when (fid) {
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.size(40.dp)
)
"130" -> Icon(
painter = painterResource(id = R.drawable.ic_baseline_sports_soccer_24),
contentDescription = "ChatGPT",
tint = MaterialTheme.colorScheme.primary,
modifier = Modifier.size(40.dp)
)
else -> Icon(
painter = painterResource(id = R.drawable.ic_baseline_image_24),
contentDescription = "默认",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,6 @@ fun ProfileDetailHeader(
Row(
modifier = Modifier
) {
Text(
text = "好友: "
)

Text(
text = profile.friend,
color = MaterialTheme.colorScheme.primary
)

Text(
text = " 回帖: "
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ class ProfileDetailViewModel : ViewModel() {

val profileItems: List<ProfileDetailTabItem>
get() = listOf(
ProfileDetailTabItem.TOPIC,
ProfileDetailTabItem.FRIEND
ProfileDetailTabItem.TOPIC
)

fun dispatch(action: ProfileDetailViewAction) {
Expand Down Expand Up @@ -93,23 +92,17 @@ class ProfileDetailViewModel : ViewModel() {
profile.name = name
}

profile.friend = ""
val a1 = document.selectXpath("//ul[@class='cl bbda pbm mbm']//a[1]").text()
if (a1.isNotEmpty() && a1.contains(" ")) {
val friend = a1.split(" ")[1]
println("friend=$friend")
profile.friend = friend
}

val a2 = document.selectXpath("//ul[@class='cl bbda pbm mbm']//a[2]").text()
if (a2.isNotEmpty() && a2.contains(" ")) {
val reply = a2.split(" ")[1]
val reply = a1.split(" ")[1]
println("reply=$reply")
profile.reply = reply
}

val a3 = document.selectXpath("//ul[@class='cl bbda pbm mbm']//a[3]").text()
if (a3.isNotEmpty() && a3.contains(" ")) {
val topic = a3.split(" ")[1]
val a2 = document.selectXpath("//ul[@class='cl bbda pbm mbm']//a[2]").text()
if (a2.isNotEmpty() && a2.contains(" ")) {
val topic = a2.split(" ")[1]
println("topic=$topic")
profile.topic = topic
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,6 @@ private fun DrawerHeader(
Row(
modifier = Modifier
) {
Text(
text = "好友: "
)

Text(
text = userInfo.friend,
color = MaterialTheme.colorScheme.primary
)

Text(
text = " 回帖: "
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DrawerViewModel : ViewModel() {
get() = listOf(
DrawerNavigationItem.Sign,
DrawerNavigationItem.Topic,
DrawerNavigationItem.Friend,
// DrawerNavigationItem.Friend,
DrawerNavigationItem.Favorite,
DrawerNavigationItem.Credit,
// DrawerNavigationItem.Group
Expand Down Expand Up @@ -66,23 +66,17 @@ class DrawerViewModel : ViewModel() {
UserInfo.instance.name = name
}

UserInfo.instance.friend = ""
val a1 = document.selectXpath("//ul[@class='cl bbda pbm mbm']//a[1]").text()
if (a1.isNotEmpty() && a1.contains(" ")) {
val friend = a1.split(" ")[1]
println("friend=$friend")
UserInfo.instance.friend = friend
}

val a2 = document.selectXpath("//ul[@class='cl bbda pbm mbm']//a[2]").text()
if (a2.isNotEmpty() && a2.contains(" ")) {
val reply = a2.split(" ")[1]
val reply = a1.split(" ")[1]
println("reply=$reply")
UserInfo.instance.reply = reply
}

val a3 = document.selectXpath("//ul[@class='cl bbda pbm mbm']//a[3]").text()
if (a3.isNotEmpty() && a3.contains(" ")) {
val topic = a3.split(" ")[1]
val a2 = document.selectXpath("//ul[@class='cl bbda pbm mbm']//a[2]").text()
if (a2.isNotEmpty() && a2.contains(" ")) {
val topic = a2.split(" ")[1]
println("topic=$topic")
UserInfo.instance.topic = topic
}
Expand Down

0 comments on commit 0116bee

Please sign in to comment.