Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
aa17130f
Commit
aa17130f
authored
Jun 27, 2022
by
fengquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复进入我的动态,若未发布过动态,编辑按钮会刷新后消失
parent
5fb48d82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
65 deletions
+53
-65
TrendsListFragment.kt
m-dynamic/src/main/java/com/yidianling/dynamic/trendList/TrendsListFragment.kt
+7
-7
dynamic_fragment_trends_list.xml
m-dynamic/src/main/res/layout/dynamic_fragment_trends_list.xml
+46
-58
No files found.
m-dynamic/src/main/java/com/yidianling/dynamic/trendList/TrendsListFragment.kt
View file @
aa17130f
...
...
@@ -37,6 +37,7 @@ import com.yidianling.dynamic.trendList.adapter.RecommendTopicListAdapter
import
com.yidianling.dynamic.trendList.adapter.TrendsListAdapter
import
com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTER_STATE_NO_DATA
import
com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTRE_STATE_LOAD_MORE
import
com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTRE_STATE_INIT
import
com.yidianling.dynamic.trendsDetail.TrendsDetailActivity
import
com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import
io.reactivex.android.schedulers.AndroidSchedulers
...
...
@@ -428,17 +429,13 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
if
(
trend_list_no_datas_rel
!!
.
visibility
!=
View
.
GONE
)
{
trend_list_no_datas_rel
!!
.
visibility
=
View
.
GONE
}
if
(
cdl
!!
.
visibility
!=
View
.
VISIBLE
)
{
cdl
!!
.
visibility
=
View
.
VISIBLE
}
}
private
fun
showErrorView
()
{
if
(
page
==
1
)
{
cdl
!!
.
visibility
=
View
.
GONE
trend_list_no_datas_rel
!!
.
visibility
=
View
.
VISIBLE
}
else
{
cdl
!!
.
visibility
=
View
.
VISIBLE
trend_list_no_datas_rel
!!
.
visibility
=
View
.
GONE
}
}
...
...
@@ -590,8 +587,11 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
}
else
{
LogUtil
.
i
(
"get datas no more data$data"
)
trendsDatas
!!
.
addAll
(
data
)
if
(
trendsDatas
==
null
||
trendsDatas
!!
.
size
<=
0
)
{
cdl
!!
.
visibility
=
View
.
GONE
if
(
trendsDatas
==
null
||
trendsDatas
!!
.
size
==
0
)
{
mRcvAdapter
!!
.
setDatas
(
trendsDatas
,
FOOTRE_STATE_INIT
)
if
(
page
==
1
)
{
mRcvAdapter
!!
.
notifyDataSetChanged
()
}
trend_list_no_datas_rel
!!
.
visibility
=
View
.
VISIBLE
return
}
...
...
m-dynamic/src/main/res/layout/dynamic_fragment_trends_list.xml
View file @
aa17130f
<?xml version="1.0" encoding="utf-8"?>
<com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/trends_lastr_swl"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<
Linea
rLayout
<
androidx.coordinatorlayout.widget.Coordinato
rLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_alignParentLeft=
"true"
android:layout_alignParentStart=
"true"
android:layout_alignParentTop=
"true"
android:orientation=
"vertical"
android:background=
"@color/dynamic_white"
>
<androidx.
coordinatorlayout.widget.CoordinatorLayout
android:id=
"@+id/
cdl
"
<androidx.
recyclerview.widget.RecyclerView
android:id=
"@+id/
trends_rcv
"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/trends_rcv"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/dynamic_f5f5f5"
android:descendantFocusability=
"blocksDescendants"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id=
"@+id/image_scroll_top"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"85dp"
android:layout_marginRight=
"28dp"
android:padding=
"0dp"
android:background=
"@color/dynamic_white"
android:src=
"@drawable/dynamic_newsfeed_top"
android:visibility=
"visible"
app:backgroundTint=
"@color/dynamic_white"
app:borderWidth=
"0dp"
app:fabSize=
"mini"
android:scaleType=
"center"
app:layout_anchor=
"@+id/trends_rcv"
app:layout_anchorGravity=
"bottom|right|end"
app:layout_behavior=
"com.yidianling.dynamic.common.behavior.ScrollAwareFABBehavior"
/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id=
"@+id/recommend_trend_add_iv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"20dp"
android:layout_marginRight=
"20dp"
android:background=
"@color/platform_main_theme"
android:elevation=
"3dp"
android:padding=
"0dp"
android:src=
"@drawable/dynamic_newsfeed_new2"
app:backgroundTint=
"@color/platform_main_theme"
app:borderWidth=
"0dp"
app:fabSize=
"normal"
app:layout_anchor=
"@+id/trends_rcv"
app:layout_anchorGravity=
"bottom|right|end"
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
android:layout_height=
"match_parent"
android:background=
"@color/dynamic_f5f5f5"
android:descendantFocusability=
"blocksDescendants"
app:layout_behavior=
"@string/appbar_scrolling_view_behavior"
/>
<RelativeLayout
android:id=
"@+id/trend_list_no_datas_rel"
...
...
@@ -77,7 +31,7 @@
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:layout_centerHorizontal=
"true"
android:src=
"@drawable/dynamic_blank"
/>
android:src=
"@drawable/dynamic_blank"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -86,11 +40,44 @@
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"15dp"
android:text=
"暂无相关记录~"
android:textColor=
"@color/dynamic_text_gray"
/>
android:textColor=
"@color/dynamic_text_gray"
/>
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id=
"@+id/image_scroll_top"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"28dp"
android:layout_marginBottom=
"85dp"
android:background=
"@color/dynamic_white"
android:padding=
"0dp"
android:scaleType=
"center"
android:src=
"@drawable/dynamic_newsfeed_top"
android:visibility=
"visible"
app:backgroundTint=
"@color/dynamic_white"
app:borderWidth=
"0dp"
app:fabSize=
"mini"
app:layout_anchor=
"@+id/trends_rcv"
app:layout_anchorGravity=
"bottom|right|end"
app:layout_behavior=
"com.yidianling.dynamic.common.behavior.ScrollAwareFABBehavior"
/>
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id=
"@+id/recommend_trend_add_iv"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"20dp"
android:layout_marginBottom=
"20dp"
android:background=
"@color/platform_main_theme"
android:elevation=
"3dp"
android:padding=
"0dp"
android:src=
"@drawable/dynamic_newsfeed_new2"
app:backgroundTint=
"@color/platform_main_theme"
app:borderWidth=
"0dp"
app:fabSize=
"normal"
app:layout_anchor=
"@+id/trends_rcv"
app:layout_anchorGravity=
"bottom|right|end"
/>
</
Linea
rLayout>
</
androidx.coordinatorlayout.widget.Coordinato
rLayout>
</com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout>
</com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout>
\ No newline at end of file
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