1、优化英语情况下的UI显示

2、移除下标的红点,改到消息中心
This commit is contained in:
老皮 2024-09-12 13:23:42 +08:00
parent a8f92a1e38
commit cd4d0c13c1
11 changed files with 103 additions and 22 deletions

View File

@ -72,7 +72,7 @@
/>
<TextView
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="#ff777777"
android:textSize="10sp"
@ -81,10 +81,16 @@
app:layout_constraintStart_toStartOf="@id/top_view_1"
app:layout_constraintTop_toBottomOf="@id/room_name"
android:layout_marginTop="10dp"
app:layout_constraintEnd_toEndOf="parent"
android:maxLines="1"
android:ellipsize="end"
android:singleLine="true"
android:layout_marginEnd="6dp"
/>
<TextView
android:layout_width="95dp"
android:layout_width="0dp"
android:layout_height="21dp"
android:background="@drawable/white_alpa_shape"
app:layout_constraintBottom_toBottomOf="parent"
@ -92,6 +98,7 @@
android:layout_marginBottom="15dp"
android:layout_marginStart="37dp"
android:id="@+id/tmp_view"
app:layout_constraintEnd_toEndOf="@id/player_we_are"
/>
<com.makeramen.roundedimageview.RoundedImageView
@ -122,10 +129,11 @@
android:textSize="10sp"
android:id="@+id/player_we_are"
android:text="@string/interactive_game_player_we_are_4"
app:layout_constraintEnd_toEndOf="@id/tmp_view"
app:layout_constraintTop_toTopOf="@id/tmp_view"
app:layout_constraintBottom_toBottomOf="@id/tmp_view"
android:layout_marginEnd="6dp"
app:layout_constraintStart_toEndOf="@id/tmp_image"
android:layout_marginStart="2dp"
android:paddingEnd="6dp"
/>
<ImageView
@ -135,7 +143,8 @@
android:src="@mipmap/people"
app:layout_constraintTop_toTopOf="@id/tmp_view"
app:layout_constraintBottom_toBottomOf="@id/tmp_view"
app:layout_constraintEnd_toStartOf="@id/player_we_are"
app:layout_constraintStart_toEndOf="@id/sex"
android:layout_marginStart="5dp"
android:layout_marginEnd="2dp"/>

View File

@ -809,6 +809,7 @@
<string name="kefu_time">每日13:00PM-1:00AM</string>
<string name="withdraw">撤回</string>
<string name="open_noble_text">開通貴族享受專屬特權!</string>
<string name="open_noble_text_new">開通貴族享專屬特權</string>
<string name="chat_like">與喜歡的人不期而遇~</string>
<string name="chat_action_no">暫無動態消息哦~~</string>

View File

@ -768,6 +768,7 @@
<string name="withdraw">Withdraw</string>
<string name="open_noble_text">Open VIP and enjoy exclusive privileges!</string>
<string name="open_noble_text_new">Open VIP and enjoy exclusive privileges!</string>
<string name="chat_like">Meet someone you like by chance~</string>
<string name="chat_action_no">There is no news yet~~</string>

View File

@ -61,6 +61,7 @@ import com.yunbao.common.bean.QiniuLog;
import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.server.DownloadService;
import com.yunbao.common.utils.AppManager;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.L;
import com.yunbao.common.utils.LogUtil;
import com.yunbao.common.utils.MobclickAgent;
@ -129,6 +130,7 @@ import com.yunbao.main.dialog.AnchorStartLiveNotifyDialog;
import com.yunbao.main.dialog.MainStartDialogFragment;
import com.yunbao.main.dialog.ReturnUserDialog;
import com.yunbao.main.dialog.SigninDialog;
import com.yunbao.main.event.MessageRefreshEvent;
import com.yunbao.main.event.PDLiveConversationListEvent;
import com.yunbao.main.http.MainHttpConsts;
import com.yunbao.main.http.MainHttpUtil;
@ -207,7 +209,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
private boolean isWebClose = false;
public static boolean isTabClose = false;
private boolean isFirstOpen = true;
private int messageNumber = 0, numberMe = 0;
public static int messageNumber = 0;
private static int numberMe = 0;
private ImageView waitingTip;
private FloatBannerView floatBanner;
private boolean isfloatBannernet = true, isFirst = true;
@ -651,11 +654,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
MainHttpUtil.getBaseInfo(new CommonCallback<UserBean>() {
@Override
public void callback(UserBean bean) {
if (bean.getUserInfoComplete() == 0) {
/* if (bean.getUserInfoComplete() == 0) {
v_table_redpoint_me.setVisibility(View.VISIBLE);
} else {
v_table_redpoint_me.setVisibility(View.GONE);
}
}*/
}
});
@ -1511,7 +1514,9 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true)
public void onMessageIMEvent(MessageIMEvent event) {
messageNumber = event.getNumber();
if (event.getNumber() > 0) {
Bus.get().post(new MessageRefreshEvent());
/* if (event.getNumber() > 0) {
v_table_redpoint.setVisibility(View.VISIBLE);
if (event.getNumber() > 99) {
v_table_redpoint.setText("99+");
@ -1522,7 +1527,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} else {
v_table_redpoint.setVisibility(View.GONE);
v_table_redpoint.setText("");
}
}*/
}
//红点(我的)
@ -1539,11 +1544,11 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
//红点(我的)
@Subscribe(threadMode = ThreadMode.MAIN)
public void onCompleteInformationEvent(CompleteInformationEvent event) {
if (event.isCompleteInformation()) {
/*if (event.isCompleteInformation()) {
v_table_redpoint_me.setVisibility(View.VISIBLE);
} else {
v_table_redpoint_me.setVisibility(View.GONE);
}
}*/
}
/**

View File

@ -15,6 +15,7 @@ import com.yunbao.common.glide.ImgLoader;
import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.views.weight.ViewClicksAntiShake;
import com.yunbao.main.R;
import com.yunbao.main.activity.MainActivity;
import java.util.List;
@ -104,12 +105,14 @@ public class MainMeAdapter extends RecyclerView.Adapter<MainMeAdapter.Vh> {
class Vh extends RecyclerView.ViewHolder {
ImageView mThumb;
TextView mName;
TextView mName,message_redpoint;
public Vh(View itemView) {
super(itemView);
mThumb = (ImageView) itemView.findViewById(R.id.thumb);
mName = (TextView) itemView.findViewById(R.id.name);
message_redpoint = (TextView) itemView.findViewById(R.id.message_redpoint);
ViewClicksAntiShake.clicksAntiShake(itemView, () -> {
Object tag = itemView.getTag();
if (tag != null) {
@ -125,6 +128,12 @@ public class MainMeAdapter extends RecyclerView.Adapter<MainMeAdapter.Vh> {
itemView.setTag(bean);
ImgLoader.display(mContext, bean.getThumb(), mThumb);
mName.setText(bean.getName());
if (MainActivity.messageNumber > 0 && bean.getId() == 101){
message_redpoint.setVisibility(View.VISIBLE);
message_redpoint.setText(String.valueOf(MainActivity.messageNumber));
}else {
message_redpoint.setVisibility(View.GONE);
}
}
}
}

View File

@ -0,0 +1,6 @@
package com.yunbao.main.event;
import com.yunbao.common.bean.BaseModel;
public class MessageRefreshEvent extends BaseModel {
}

View File

@ -30,6 +30,7 @@ import com.opensource.svgaplayer.SVGADrawable;
import com.opensource.svgaplayer.SVGAImageView;
import com.opensource.svgaplayer.SVGAParser;
import com.opensource.svgaplayer.SVGAVideoEntity;
import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.MobclickAgent;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
@ -71,10 +72,14 @@ import com.yunbao.main.activity.SettingActivity;
import com.yunbao.main.activity.ThreeDistributActivity;
import com.yunbao.main.activity.ZhuangBanActivity;
import com.yunbao.main.adapter.MainMeAdapter;
import com.yunbao.main.event.EditProfileEvent;
import com.yunbao.main.event.MessageRefreshEvent;
import com.yunbao.main.http.MainHttpConsts;
import com.yunbao.main.http.MainHttpUtil;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.math.BigDecimal;
import java.net.MalformedURLException;
@ -116,9 +121,11 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
return R.layout.view_new_main_me;
}
@SuppressLint("WrongViewCast")
@Override
public void init() {
Bus.getOn(this);
mAvatar = (ImageView) findViewById(R.id.avatar);
ViewClicksAntiShake.clicksAntiShake(mAvatar, new ViewClicksAntiShake.ViewClicksCallBack() {
@Override
@ -196,6 +203,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
@Override
public void onDestroy() {
super.onDestroy();
Bus.getOff(this);
MainHttpUtil.cancel(MainHttpConsts.GET_BASE_INFO);
}
@ -267,6 +275,14 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi
private List<SlideBean> mBannerListNew = new ArrayList<>();
@SuppressLint("NotifyDataSetChanged")
@Subscribe(threadMode = ThreadMode.MAIN)
public void onMessageRefreshEvent(MessageRefreshEvent event) {
mAdapter.notifyDataSetChanged();
}
private void showData(UserBean u, List<UserItemBean> list) {
mBannerList.clear();
mBannerListNew.clear();

View File

@ -34,7 +34,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:textColor="#ff333333"
android:textSize="12sp"
app:layout_constraintBottom_toBottomOf="parent"
@ -42,6 +42,12 @@
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="8dp"
android:id="@+id/item_name"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="end"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -24,7 +24,7 @@
/>
<TextView
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="所有游戏"
android:textColor="#111111"
@ -34,6 +34,12 @@
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginBottom="14dp"
android:id="@+id/item_name"
android:layout_marginStart="4dp"
android:layout_marginEnd="4dp"
android:gravity="center"
android:maxLines="1"
android:singleLine="true"
android:ellipsize="end"
/>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,13 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:gravity="center"
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:orientation="vertical">
>
<ImageView
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:id="@+id/thumb"
android:layout_width="24dp"
android:layout_height="24dp" />
@ -17,10 +21,25 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
app:layout_constraintTop_toBottomOf="@id/thumb"
android:text=""
android:singleLine="true"
android:ellipsize="end"
android:textColor="@color/textColor"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:id="@+id/message_redpoint"
android:layout_width="20dp"
android:layout_height="20dp"
android:background="@drawable/background_ff5075"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:gravity="center"
android:textColor="@color/white"
android:textSize="10dp"
android:visibility="gone" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -360,12 +360,14 @@
android:id="@+id/user_noble_time"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/open_noble_text"
android:textColor="#000000"
android:text="@string/open_noble_text_new"
android:textColor="#777777"
android:textSize="10sp"
app:layout_constraintStart_toEndOf="@id/user_noble_ico"
android:layout_marginStart="10dp"
android:layout_marginBottom="5dp"
android:maxLines="2"
android:ellipsize="end"
app:layout_constraintEnd_toEndOf="@id/guizu_center_tv"
app:layout_constraintTop_toBottomOf="@id/user_noble_text"
android:layout_marginEnd="5dp"
@ -420,14 +422,15 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="@string/guard_for_your_beloved_one"
android:textColor="#000000"
android:textColor="#777777"
android:textSize="10sp"
app:layout_constraintStart_toEndOf="@id/shouhu_center_iv"
android:layout_marginStart="10dp"
android:id="@+id/shouhu_center_tv2"
app:layout_constraintEnd_toEndOf="@id/shouhu_center"
app:layout_constraintTop_toBottomOf="@id/shouhu_center_tv"
android:maxLines="2"
android:ellipsize="end"
/>