UI对稿,部分错误提示优化

This commit is contained in:
huangjian
2023-03-20 15:17:56 +08:00
parent 1a363a19e3
commit 87c1dddbab
16 changed files with 118 additions and 70 deletions

View File

@@ -540,7 +540,7 @@ public class XChatApplication extends Application {
Log.e(TAG, "testtest", e); Log.e(TAG, "testtest", e);
} }
initRxNet(instance, UriProvider.WEB_URL); initRxNet(instance, UriProvider.API_URL);
/** /**
* 使用到realm 数据库,这里配置数据库 这里必须先于模块初始化前进行初始化配置 * 使用到realm 数据库,这里配置数据库 这里必须先于模块初始化前进行初始化配置

View File

@@ -347,7 +347,7 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
.doOnSuccess(roomResult -> { .doOnSuccess(roomResult -> {
if (roomResult == null) { if (roomResult == null) {
if (getMvpView() != null) { if (getMvpView() != null) {
getMvpView().requestRoomInfoFailView(new Throwable("网络错误")); getMvpView().requestRoomInfoFailView(new Throwable("请求房间信息失败,请稍后重试!"));
} }
return; return;
} }

View File

@@ -328,7 +328,7 @@ public abstract class BaseFragment extends RxFragment implements KeyEvent.Callba
return; return;
} }
View status = view.findViewById(R.id.status_layout); View status = view.findViewById(R.id.status_layout);
if (status == null || view.getId() == View.NO_ID) { if (status == null || status.getId() == View.NO_ID) {
return; return;
} }
Fragment fragment; Fragment fragment;
@@ -355,7 +355,7 @@ public abstract class BaseFragment extends RxFragment implements KeyEvent.Callba
return; return;
} }
View status = view.findViewById(R.id.status_layout); View status = view.findViewById(R.id.status_layout);
if (status == null || view.getId() == View.NO_ID) { if (status == null || status.getId() == View.NO_ID) {
MLog.error(this, "xuwakao, had not set layout id "); MLog.error(this, "xuwakao, had not set layout id ");
return; return;
} }
@@ -366,7 +366,7 @@ public abstract class BaseFragment extends RxFragment implements KeyEvent.Callba
@Override @Override
public void showNoData(int drawable, CharSequence charSequence) { public void showNoData(int drawable, CharSequence charSequence) {
showNoData(getView(), drawable, charSequence); showNoData(mView, drawable, charSequence);
} }
@Override @Override
@@ -379,7 +379,7 @@ public abstract class BaseFragment extends RxFragment implements KeyEvent.Callba
return; return;
} }
View status = view.findViewById(R.id.status_layout); View status = view.findViewById(R.id.status_layout);
if (status == null || view.getId() == View.NO_ID) { if (status == null || status.getId() == View.NO_ID) {
MLog.error(this, "xuwakao, had not set layout id "); MLog.error(this, "xuwakao, had not set layout id ");
return; return;
} }

View File

@@ -808,6 +808,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
giftNumLayout.setVisibility(View.GONE); giftNumLayout.setVisibility(View.GONE);
llDrawGift.setVisibility(View.VISIBLE); llDrawGift.setVisibility(View.VISIBLE);
drawGiftHelper.setDrawEnable(true); drawGiftHelper.setDrawEnable(true);
sendGiftButton.setBackgroundResource(R.drawable.bg_magic_dialog_button_send_draw);
sendGiftButton.setEnabled(false); sendGiftButton.setEnabled(false);
WindowManager.LayoutParams params = getWindow().getAttributes(); WindowManager.LayoutParams params = getWindow().getAttributes();
if (params.dimAmount != 0.7f) { if (params.dimAmount != 0.7f) {
@@ -828,6 +829,7 @@ public class GiftDialog extends BottomSheetDialog implements View.OnClickListene
drawGiftHelper.setDrawEnable(false); drawGiftHelper.setDrawEnable(false);
drawGiftHelper.resetDrawGiftView(); drawGiftHelper.resetDrawGiftView();
boolean isDrawGiftTab = giftIndicator.getCurrrentType() == GiftIndicator.TYPE_DRAW_GIFT; boolean isDrawGiftTab = giftIndicator.getCurrrentType() == GiftIndicator.TYPE_DRAW_GIFT;
sendGiftButton.setBackgroundResource(R.drawable.bg_magic_dialog_button_send);
sendGiftButton.setEnabled(!isDrawGiftTab); sendGiftButton.setEnabled(!isDrawGiftTab);
giftNumLayout.setVisibility(isDrawGiftTab ? View.GONE : View.VISIBLE); giftNumLayout.setVisibility(isDrawGiftTab ? View.GONE : View.VISIBLE);
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#CC161722" /> <solid android:color="#181B2C" />
<corners <corners
android:bottomLeftRadius="0dp" android:bottomLeftRadius="0dp"

View File

@@ -8,7 +8,7 @@
</item> </item>
<item android:state_enabled="false"> <item android:state_enabled="false">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="@color/color_CCCCCC" /> <solid android:color="#E5DC8B" />
<corners android:bottomLeftRadius="0dp" android:bottomRightRadius="100dp" android:topLeftRadius="0dp" android:topRightRadius="100dp" /> <corners android:bottomLeftRadius="0dp" android:bottomRightRadius="100dp" android:topLeftRadius="0dp" android:topRightRadius="100dp" />
</shape> </shape>
</item> </item>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true">
<shape android:shape="rectangle">
<solid android:color="#FFE710" />
<corners android:radius="100dp"/>
</shape>
</item>
<item android:state_enabled="false">
<shape android:shape="rectangle">
<solid android:color="#E5DC8B" />
<corners android:radius="100dp"/>
</shape>
</item>
</selector>

View File

@@ -141,34 +141,14 @@
</LinearLayout> </LinearLayout>
<com.nnbc123.app.ui.widget.TopRoundLinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="0dp"
android:layout_height="0dp"
android:background="#01ffffff"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/ll_dialog_bottom_gift">
<com.github.mmin18.widget.RealtimeBlurView
android:id="@+id/realtime_blur_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:realtimeBlurRadius="30dp"
app:realtimeDownsampleFactor="3"
app:realtimeOverlayColor="#CC161722" />
</com.nnbc123.app.ui.widget.TopRoundLinearLayout>
<LinearLayout
android:id="@+id/ll_dialog_bottom_gift" android:id="@+id/ll_dialog_bottom_gift"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent">
tools:background="@drawable/bg_dialog_room_operation">
<LinearLayout <LinearLayout
android:id="@+id/ll_draw_gift" android:id="@+id/ll_draw_gift"
@@ -178,6 +158,9 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="gone" android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible"> tools:visibility="visible">
<TextView <TextView
@@ -221,8 +204,13 @@
android:id="@+id/ll_tab_type" android:id="@+id/ll_tab_type"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="18dp" android:background="@drawable/bg_dialog_room_operation"
android:layout_marginTop="10dp"> android:orientation="horizontal"
android:paddingStart="18dp"
android:paddingTop="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_draw_gift">
<TextView <TextView
android:id="@+id/tv_tab_send_gift" android:id="@+id/tv_tab_send_gift"
@@ -273,16 +261,24 @@
</LinearLayout> </LinearLayout>
<View <ImageView
android:id="@+id/line_tab_type" android:id="@+id/line_tab_type"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="1px" android:layout_height="1px"
android:background="@color/white_tran_10" /> android:background="#181B2C"
android:src="@color/white_transparent_5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_tab_type" />
<RelativeLayout <RelativeLayout
android:id="@+id/rl_avatars" android:id="@+id/rl_avatars"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
android:background="#181B2C"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/line_tab_type">
<LinearLayout <LinearLayout
android:id="@+id/desc_layout" android:id="@+id/desc_layout"
@@ -320,7 +316,8 @@
android:layout_marginTop="10dp" android:layout_marginTop="10dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:visibility="gone"> android:visibility="gone"
tools:visibility="visible">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
@@ -358,16 +355,40 @@
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/line_tab_avatar"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@id/ll_avatar_list"
android:layout_marginTop="6dp"
android:background="#181B2C"
android:src="@color/white_transparent_5" />
</RelativeLayout> </RelativeLayout>
<com.github.mmin18.widget.RealtimeBlurView
android:id="@+id/realtime_blur_view"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/layout_recharge"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/ll_tabs"
app:realtimeBlurRadius="25dp"
app:realtimeDownsampleFactor="4"
app:realtimeOverlayColor="#e0161722" />
<FrameLayout <FrameLayout
android:id="@+id/ll_tabs" android:id="@+id/ll_tabs"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="@dimen/dp_26" android:layout_height="34dp"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="10dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rl_avatars"
tools:background="@color/blue"> tools:background="@color/blue">
<com.nnbc123.app.ui.widget.magicindicator.GiftIndicator <com.nnbc123.app.ui.widget.magicindicator.GiftIndicator
@@ -399,7 +420,10 @@
android:id="@+id/rl_gifts" android:id="@+id/rl_gifts"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="261dp" android:layout_height="261dp"
android:layout_marginTop="@dimen/dp_10"> android:layout_marginTop="@dimen/dp_10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/ll_tabs">
<LinearLayout <LinearLayout
android:id="@+id/layout_loading" android:id="@+id/layout_loading"
@@ -434,7 +458,6 @@
android:id="@+id/layout_load_failed" android:id="@+id/layout_load_failed"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="6dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
android:visibility="gone" android:visibility="gone"
@@ -471,14 +494,12 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginStart="@dimen/dp_10" android:layout_marginStart="@dimen/dp_10"
android:layout_marginEnd="@dimen/dp_10" android:layout_marginEnd="@dimen/dp_10" />
android:layout_marginBottom="6dp" />
<LinearLayout <LinearLayout
android:id="@+id/layout_empty" android:id="@+id/layout_empty"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginBottom="6dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical" android:orientation="vertical"
tools:visibility="gone"> tools:visibility="gone">
@@ -504,11 +525,12 @@
<EditText <EditText
android:id="@+id/et_gift_message" android:id="@+id/et_gift_message"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="34dp" android:layout_height="34dp"
android:background="@color/color_F5F5F5_transparent_5" android:background="@color/color_F5F5F5_transparent_5"
android:hint="@string/hints_tips_gift_message" android:hint="@string/hints_tips_gift_message"
android:maxLength="15" android:maxLength="15"
android:paddingStart="@dimen/dp_15" android:paddingStart="@dimen/dp_15"
android:paddingEnd="0dp" android:paddingEnd="0dp"
android:singleLine="true" android:singleLine="true"
@@ -516,6 +538,9 @@
android:textColorHint="@color/white_transparent_30" android:textColorHint="@color/white_transparent_30"
android:textSize="@dimen/dp_14" android:textSize="@dimen/dp_14"
android:visibility="gone" android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rl_gifts"
tools:ignore="SpUsage" tools:ignore="SpUsage"
tools:visibility="gone" /> tools:visibility="gone" />
@@ -523,7 +548,10 @@
android:id="@+id/layout_recharge" android:id="@+id/layout_recharge"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_50" android:layout_height="@dimen/dp_50"
android:background="#161722"> android:background="#161722"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/et_gift_message">
<LinearLayout <LinearLayout
android:id="@+id/ll_gold" android:id="@+id/ll_gold"
@@ -601,13 +629,13 @@
android:layout_height="@dimen/dp_30" android:layout_height="@dimen/dp_30"
android:background="@drawable/bg_magic_dialog_button_send" android:background="@drawable/bg_magic_dialog_button_send"
android:text="赠送" android:text="赠送"
android:textColor="@color/color_161958" android:textColor="@color/text_normal_282828"
android:textSize="15dp" /> android:textSize="15dp" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <com.nnbc123.app.common.widget.StatusLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:id="@+id/status_layout"
android:layout_height="match_parent">
<com.nnbc123.app.common.widget.StatusLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@@ -16,7 +13,7 @@
android:id="@+id/rv_dynamic" android:id="@+id/rv_dynamic"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</com.nnbc123.app.common.widget.StatusLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
</com.nnbc123.app.common.widget.StatusLayout>

View File

@@ -53,12 +53,10 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_50" android:layout_marginStart="@dimen/dp_50"
android:layout_marginEnd="50dp" android:layout_marginEnd="50dp"
android:layout_marginBottom="15dp"
android:layout_marginTop="20dp"
android:lineSpacingExtra="5dp"
android:textColor="#CCFFFFFF" android:textColor="#CCFFFFFF"
android:textSize="13sp" android:textSize="13sp"
android:lines="2" android:lines="2"
android:layout_gravity="center_vertical"
app:layout_collapseMode="parallax" app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.4" app:layout_collapseParallaxMultiplier="0.4"
tools:text="故事的小黄花,从出生那年就飘着,童年的荡秋千,随记忆一直晃到现在故事的小黄花,从出生那年就飘着,童年的荡秋千,随记忆一直晃到现在~" /> tools:text="故事的小黄花,从出生那年就飘着,童年的荡秋千,随记忆一直晃到现在故事的小黄花,从出生那年就飘着,童年的荡秋千,随记忆一直晃到现在~" />
@@ -86,7 +84,7 @@
<com.nnbc123.app.ui.widget.magicindicator.MagicIndicator <com.nnbc123.app.ui.widget.magicindicator.MagicIndicator
android:id="@+id/mi_mini_world" android:id="@+id/mi_mini_world"
android:layout_width="120dp" android:layout_width="wrap_content"
android:layout_height="33dp" android:layout_height="33dp"
android:layout_marginEnd="12dp" /> android:layout_marginEnd="12dp" />

View File

@@ -179,7 +179,7 @@ public class RxHelper {
public final static String DEFAULT_MSG = "网络错误"; public final static String DEFAULT_MSG = "网络错误";
public static String getValidMessage(ServiceResult result) { public static <T> String getValidMessage(ServiceResult<T> result) {
if (result != null && !TextUtils.isEmpty(result.getMessage())) { if (result != null && !TextUtils.isEmpty(result.getMessage())) {
return result.getMessage(); return result.getMessage();
} }
@@ -210,7 +210,7 @@ public class RxHelper {
}; };
} }
public static Throwable createThrowable(ServiceResult result) { public static <T> Throwable createThrowable(ServiceResult<T> result) {
return new Throwable(getValidMessage(result)); return new Throwable(getValidMessage(result));
} }

View File

@@ -21,7 +21,7 @@ MobSDK.spEdition=FP
with_flutter_aar=true with_flutter_aar=true
with_jenkins=false with_jenkins=false
only_arm64=true only_arm64=false
channel_file=channel.txt channel_file=channel.txt

View File

@@ -11,6 +11,8 @@ import com.hjq.toast.ToastUtils;
public class SingleToastUtil { public class SingleToastUtil {
public static void showToast(String s) { public static void showToast(String s) {
//不弹这种没意义的错误
if ("网络错误".equals(s)) return;
ToastUtils.show(s); ToastUtils.show(s);
} }
@@ -20,22 +22,27 @@ public class SingleToastUtil {
@Deprecated @Deprecated
public static void showToastShort(String s) { public static void showToastShort(String s) {
//不弹这种没意义的错误
if ("网络错误".equals(s)) return;
ToastUtils.show(s); ToastUtils.show(s);
} }
@Deprecated @Deprecated
public static void showToastShort(int resId) { public static void showToastShort(int resId) {
ToastUtils.show(resId); ToastUtils.show(resId);
} }
@Deprecated @Deprecated
public static void showToast(Context context, String s) { public static void showToast(Context context, String s) {
//不弹这种没意义的错误
if ("网络错误".equals(s)) return;
ToastUtils.show(s); ToastUtils.show(s);
} }
@Deprecated @Deprecated
public static void showToast(Context mContext, final String s, final int length) { public static void showToast(Context mContext, final String s, final int length) {
//先解决问题再说,不弹这种没意义的错误 //不弹这种没意义的错误
if ("网络错误".equals(s)) return; if ("网络错误".equals(s)) return;
ToastUtils.show(s); ToastUtils.show(s);
} }