Commit aa17130f by fengquan

fix: 修复进入我的动态,若未发布过动态,编辑按钮会刷新后消失

parent 5fb48d82
...@@ -37,6 +37,7 @@ import com.yidianling.dynamic.trendList.adapter.RecommendTopicListAdapter ...@@ -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
import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTER_STATE_NO_DATA 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_LOAD_MORE
import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter.FOOTRE_STATE_INIT
import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
...@@ -428,17 +429,13 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -428,17 +429,13 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
if (trend_list_no_datas_rel!!.visibility != View.GONE) { if (trend_list_no_datas_rel!!.visibility != View.GONE) {
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() { private fun showErrorView() {
if (page == 1) { if (page == 1) {
cdl!!.visibility = View.GONE
trend_list_no_datas_rel!!.visibility = View.VISIBLE trend_list_no_datas_rel!!.visibility = View.VISIBLE
} else { } else {
cdl!!.visibility = View.VISIBLE
trend_list_no_datas_rel!!.visibility = View.GONE trend_list_no_datas_rel!!.visibility = View.GONE
} }
} }
...@@ -590,8 +587,11 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -590,8 +587,11 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
} else { } else {
LogUtil.i("get datas no more data$data") LogUtil.i("get datas no more data$data")
trendsDatas!!.addAll(data) trendsDatas!!.addAll(data)
if (trendsDatas == null || trendsDatas!!.size <= 0) { if (trendsDatas == null || trendsDatas!!.size == 0) {
cdl!!.visibility = View.GONE mRcvAdapter!!.setDatas(trendsDatas, FOOTRE_STATE_INIT)
if (page == 1) {
mRcvAdapter!!.notifyDataSetChanged()
}
trend_list_no_datas_rel!!.visibility = View.VISIBLE trend_list_no_datas_rel!!.visibility = View.VISIBLE
return return
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout <com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/trends_lastr_swl" android:id="@+id/trends_lastr_swl"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<LinearLayout <androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="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"> android:background="@color/dynamic_white">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/cdl"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/trends_rcv" android:id="@+id/trends_rcv"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/dynamic_f5f5f5" android:background="@color/dynamic_f5f5f5"
android:descendantFocusability="blocksDescendants" android:descendantFocusability="blocksDescendants"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/> app:layout_behavior="@string/appbar_scrolling_view_behavior" />
<RelativeLayout
android:id="@+id/trend_list_no_datas_rel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:gravity="center"
android:visibility="gone">
<ImageView
android:id="@+id/trend_list_no_datas_iv"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="@drawable/dynamic_blank" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/trend_list_no_datas_iv"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:text="暂无相关记录~"
android:textColor="@color/dynamic_text_gray" />
</RelativeLayout>
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/image_scroll_top" android:id="@+id/image_scroll_top"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="85dp"
android:layout_marginRight="28dp" android:layout_marginRight="28dp"
android:padding="0dp" android:layout_marginBottom="85dp"
android:background="@color/dynamic_white" android:background="@color/dynamic_white"
android:padding="0dp"
android:scaleType="center"
android:src="@drawable/dynamic_newsfeed_top" android:src="@drawable/dynamic_newsfeed_top"
android:visibility="visible" android:visibility="visible"
app:backgroundTint="@color/dynamic_white" app:backgroundTint="@color/dynamic_white"
app:borderWidth="0dp" app:borderWidth="0dp"
app:fabSize="mini" app:fabSize="mini"
android:scaleType="center"
app:layout_anchor="@+id/trends_rcv" app:layout_anchor="@+id/trends_rcv"
app:layout_anchorGravity="bottom|right|end" app:layout_anchorGravity="bottom|right|end"
app:layout_behavior="com.yidianling.dynamic.common.behavior.ScrollAwareFABBehavior"/> app:layout_behavior="com.yidianling.dynamic.common.behavior.ScrollAwareFABBehavior" />
<com.google.android.material.floatingactionbutton.FloatingActionButton <com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/recommend_trend_add_iv" android:id="@+id/recommend_trend_add_iv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_marginRight="20dp" android:layout_marginRight="20dp"
android:layout_marginBottom="20dp"
android:background="@color/platform_main_theme" android:background="@color/platform_main_theme"
android:elevation="3dp" android:elevation="3dp"
android:padding="0dp" android:padding="0dp"
...@@ -60,37 +75,9 @@ ...@@ -60,37 +75,9 @@
app:borderWidth="0dp" app:borderWidth="0dp"
app:fabSize="normal" app:fabSize="normal"
app:layout_anchor="@+id/trends_rcv" app:layout_anchor="@+id/trends_rcv"
app:layout_anchorGravity="bottom|right|end"/> app:layout_anchorGravity="bottom|right|end" />
</androidx.coordinatorlayout.widget.CoordinatorLayout> </androidx.coordinatorlayout.widget.CoordinatorLayout>
<RelativeLayout
android:id="@+id/trend_list_no_datas_rel"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:gravity="center"
android:visibility="gone">
<ImageView
android:id="@+id/trend_list_no_datas_iv"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_centerHorizontal="true"
android:src="@drawable/dynamic_blank"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/trend_list_no_datas_iv"
android:layout_centerHorizontal="true"
android:layout_marginTop="15dp"
android:text="暂无相关记录~"
android:textColor="@color/dynamic_text_gray"/>
</RelativeLayout>
</LinearLayout>
</com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout> </com.ydl.ydlcommon.view.widgets.MultiSwipeRefreshLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment