缺省页UI
This commit is contained in:
@@ -8,6 +8,7 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.GradientDrawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
@@ -151,6 +152,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
private List<Fragment> mFragmentsBottom;
|
||||
private volatile boolean isUserLogin;
|
||||
|
||||
|
||||
/**
|
||||
* 动态
|
||||
*/
|
||||
@@ -967,4 +969,7 @@ public class GameHomeFragment extends BaseMvpFragment<IMainFragmentView, MainFra
|
||||
.subscribe();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@@ -2,6 +2,7 @@ package com.yizhuan.erban.home.fragment;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -22,6 +23,8 @@ import com.yizhuan.xchat_android_core.utils.net.RxHelper;
|
||||
import com.yizhuan.xchat_android_library.utils.ListUtils;
|
||||
import com.yizhuan.xchat_android_library.utils.log.MLog;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
@@ -38,6 +41,8 @@ public class HomeTabHomeFragment extends BaseFragment {
|
||||
private HomeRoomFragmentAdapter mHomeRoomAdapter;
|
||||
private List<HomeTabMapInfo> sixRoomsList;
|
||||
private final int ROOM_COUNT = 6;
|
||||
private Runnable runnable;
|
||||
private Handler handler = new Handler();
|
||||
|
||||
public static HomeTabHomeFragment newInstance(int tabId) {
|
||||
|
||||
@@ -60,6 +65,18 @@ public class HomeTabHomeFragment extends BaseFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
handler.removeCallbacks(runnable);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
handler.removeCallbacks(runnable);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRootLayoutId() {
|
||||
@@ -91,10 +108,6 @@ public class HomeTabHomeFragment extends BaseFragment {
|
||||
.compose(bindUntilEvent(FragmentEvent.DESTROY_VIEW))
|
||||
.subscribe((serviceResult, throwable) -> {
|
||||
if (throwable == null) {
|
||||
if (ListUtils.isListEmpty(serviceResult)) {
|
||||
showNoData();
|
||||
mHomeRoomAdapter.notifyDataSetChanged();
|
||||
}
|
||||
|
||||
int max = getMultipleItemData(serviceResult).size();
|
||||
int min = 0;
|
||||
@@ -134,17 +147,13 @@ public class HomeTabHomeFragment extends BaseFragment {
|
||||
|
||||
}
|
||||
|
||||
//重点转化方法啊,
|
||||
|
||||
/**
|
||||
* 添加布局Itemtype
|
||||
* 转化房间数组,不足6的加上虚位以待
|
||||
* @param itemList
|
||||
* @return
|
||||
*/
|
||||
private List<HomeTabMapInfo> getMultipleItemData(List<HomeTabMapInfo> itemList) {
|
||||
if (null==itemList||itemList.size()<=0){
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
final int ADD_COUNT = ROOM_COUNT - itemList.size();
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 20 KiB |
@@ -6,7 +6,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_marginTop="100dp"
|
||||
android:layout_marginTop="140dp"
|
||||
android:id="@+id/no_data_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -19,6 +19,7 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/no_list_data"
|
||||
android:textColor="@color/color_999999"
|
||||
android:layout_marginTop="@dimen/dp_17"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
@@ -1,6 +1,6 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<string name="app_name">66星球</string>
|
||||
<string name="no_list_data">这里什么都没有</string>
|
||||
<string name="no_list_data">暂无消息</string>
|
||||
<string name="str_network_not_capable">网络不给力</string>
|
||||
<string name="network_error_reload">网络异常,加载失败</string>
|
||||
<string name="click_screen_reload">点击刷新</string>
|
||||
|
@@ -612,7 +612,7 @@ public class DynamicDetailActivity extends BaseActivity implements IEmoticonSele
|
||||
UIUtil.dip2px(context, 260));
|
||||
emptyView.setLayoutParams(layoutParams);
|
||||
((ImageView) emptyView.findViewById(R.id.no_data_icon))
|
||||
.setImageResource(R.drawable.icon_dy_dynamic_empty);
|
||||
.setImageResource(R.drawable.icon_common_failure);
|
||||
((TextView) emptyView.findViewById(R.id.no_data_text))
|
||||
.setText(R.string.dy_empty_comment_tips);
|
||||
adapter.setEmptyView(emptyView);
|
||||
|
@@ -225,7 +225,7 @@ public class WorldDynamicFragment extends BaseMvpFragment<IWorldDynamicView, Wor
|
||||
noMoreData = true;
|
||||
hideLoadmoreView();
|
||||
if (isRefresh) {
|
||||
showNoData(R.drawable.icon_dy_dynamic_empty,
|
||||
showNoData(R.drawable.icon_common_failure,
|
||||
getString(R.string.dy_world_dynamic_list_empty_tips));
|
||||
}
|
||||
}
|
||||
@@ -267,7 +267,7 @@ public class WorldDynamicFragment extends BaseMvpFragment<IWorldDynamicView, Wor
|
||||
noMoreData = true;
|
||||
hideLoadmoreView();
|
||||
if (isRefresh) {
|
||||
showNoData(R.drawable.icon_dy_dynamic_empty,
|
||||
showNoData(R.drawable.icon_common_failure,
|
||||
getString(R.string.dy_world_dynamic_list_empty_tips));
|
||||
}
|
||||
}
|
||||
|
@@ -297,7 +297,7 @@ public class SquareDynamicFragment extends BaseMvpFragment<IMiniWorldCategoryVie
|
||||
if (squareType == SquareFragment.TAB_TYPE_ATTENT) {
|
||||
emptyTips = "暂无动态,去推荐看看吧~";
|
||||
}
|
||||
showNoData(R.drawable.icon_dy_dynamic_empty,
|
||||
showNoData(R.drawable.icon_common_failure,
|
||||
emptyTips);
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
@@ -1,15 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/refresh_layout"
|
||||
android:focusableInTouchMode="true"
|
||||
android:focusable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||
android:id="@+id/refresh_layout"
|
||||
android:focusableInTouchMode="true"
|
||||
android:focusable="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.yizhuan.erban.common.widget.StatusLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -24,5 +21,4 @@
|
||||
</com.yizhuan.erban.common.widget.StatusLayout>
|
||||
|
||||
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
Reference in New Issue
Block a user