From 0324b638fac3930bf5429bde5f133660364e63b9 Mon Sep 17 00:00:00 2001 From: hch <16607480311@163.com> Date: Tue, 26 Mar 2024 09:36:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yunbao/common/CommonAppConfig.java | 15 +++++------ .../common/adapter/LabelTagAdapter.java | 2 +- common/src/main/res/values-en-rUS/string.xml | 4 +-- common/src/main/res/values/strings.xml | 4 +-- .../main/activity/CommunitySendActivity.java | 23 +++++++++++------ .../main/activity/UserHomeActivity.java | 25 +++++++------------ .../main/views/MainHomeNewViewHolder.java | 2 +- 7 files changed, 38 insertions(+), 37 deletions(-) diff --git a/common/src/main/java/com/yunbao/common/CommonAppConfig.java b/common/src/main/java/com/yunbao/common/CommonAppConfig.java index 427d41508..809d5fadb 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppConfig.java +++ b/common/src/main/java/com/yunbao/common/CommonAppConfig.java @@ -119,11 +119,14 @@ public class CommonAppConfig { private String mAppName; private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜 - public static List getCommunityTypeList(Context mContext) { - NewCommunityType type0 = new NewCommunityType(); - type0.setId(0); - type0.setTalk_name(mContext.getString(R.string.recomment)); - + public static List getCommunityTypeList(boolean isHome, Context mContext) { + List newCommunityTypeList = new ArrayList<>(); + if (isHome) { + NewCommunityType type0 = new NewCommunityType(); + type0.setId(0); + type0.setTalk_name(mContext.getString(R.string.recomment)); + newCommunityTypeList.add(type0); + } NewCommunityType type17 = new NewCommunityType(); type17.setId(17); type17.setTalk_name(mContext.getResources().getString(R.string.main_active_type_01)); @@ -144,8 +147,6 @@ public class CommonAppConfig { type13.setId(13); type13.setTalk_name(mContext.getResources().getString(R.string.main_active_type_05)); - List newCommunityTypeList = new ArrayList<>(); - newCommunityTypeList.add(type0); newCommunityTypeList.add(type17); newCommunityTypeList.add(type16); newCommunityTypeList.add(type15); diff --git a/common/src/main/java/com/yunbao/common/adapter/LabelTagAdapter.java b/common/src/main/java/com/yunbao/common/adapter/LabelTagAdapter.java index 63af4d3df..0dc995cc6 100644 --- a/common/src/main/java/com/yunbao/common/adapter/LabelTagAdapter.java +++ b/common/src/main/java/com/yunbao/common/adapter/LabelTagAdapter.java @@ -36,7 +36,7 @@ public class LabelTagAdapter extends BaseTagAdapter { @Override protected void convert(TextView textView, String item, int position) { - textView.setText(item); + textView.setText("#"+item); } public interface OnSureOnClickListener { diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index a165d49cf..fbff81ad3 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -255,7 +255,7 @@ Login successfully privilege grant failed Authorization cancelled - Live broadcast + Live Log in shopmall Hot @@ -426,7 +426,7 @@ Penalty time No video Let\'s release our own video - home page + Home nearby Ranking My diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 9b987e1bc..15c390d1f 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -256,7 +256,7 @@ Login successfully privilege grant failed Authorization cancelled - Live broadcast + Live Log in shopmall Hot @@ -427,7 +427,7 @@ Penalty time No video Let\'s release our own video - home page + Home nearby Ranking My diff --git a/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java b/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java index 92a727da1..97f620ca0 100644 --- a/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java @@ -55,6 +55,8 @@ import java.util.Date; import java.util.List; import java.util.Objects; +import io.rong.imkit.picture.tools.DateUtils; + public class CommunitySendActivity extends AbsActivity { public static final int PERMISSION_REQUEST_CODE_IMG = 0; public static final int PERMISSION_REQUEST_CODE_VIDEO = 1; @@ -91,7 +93,7 @@ public class CommunitySendActivity extends AbsActivity { @Override protected void main() { - newCommunityTypeList = CommonAppConfig.getCommunityTypeList(mContext); + newCommunityTypeList = CommonAppConfig.getCommunityTypeList(false, mContext); content = findViewById(R.id.content); submit = findViewById(R.id.submit); submit.setVisibility(View.VISIBLE); @@ -214,7 +216,7 @@ public class CommunitySendActivity extends AbsActivity { @Override public void onDel(int position) { - + activeImageAdapter.deleteItem(position); } }); } @@ -222,7 +224,6 @@ public class CommunitySendActivity extends AbsActivity { private void submit() { if (isImage) { if (imgUrlList.size() == 0) { - return; } } else { @@ -289,10 +290,17 @@ public class CommunitySendActivity extends AbsActivity { public void showTimeChooseDialog() { Calendar startCalendar = Calendar.getInstance(); - //startCalendar.set(1990, 1, 1); - + startCalendar.set(1990, 1, 1); Calendar endCalendar = Calendar.getInstance(); - endCalendar.setTime(new Date()); + Calendar calendar = Calendar.getInstance(); + int year = calendar.get(Calendar.YEAR); + int month = calendar.get(Calendar.MONTH) + 1; // Calendar.MONTH 从0开始计数 + int day = calendar.get(Calendar.DAY_OF_MONTH); + int hour = calendar.get(Calendar.HOUR); // 使用24小时制 + int minute = calendar.get(Calendar.MINUTE); + int second = calendar.get(Calendar.SECOND); + endCalendar.set(year, month, day, hour, minute, second); + TimePickerView timePickerView = new TimePickerBuilder(CommunitySendActivity.this, new OnTimeSelectListener() { @SuppressLint("SetTextI18n") @Override @@ -306,8 +314,7 @@ public class CommunitySendActivity extends AbsActivity { .setTitleText("")//标题文字 .setOutSideCancelable(true)//点击屏幕,点在控件外部范围时,是否取消显示 .isCyclic(false)//是否循环滚动 - .setRangDate(startCalendar, endCalendar) - .setLabel("", "", "", "", "", "")//默认设置为年月日时分秒 + .setDate(endCalendar).setRangDate(startCalendar, endCalendar).setLabel("", "", "", "", "", "")//默认设置为年月日时分秒 .isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。 .build(); timePickerView.show(); diff --git a/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java b/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java index c5425ed0a..109b08a77 100644 --- a/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java @@ -243,6 +243,7 @@ public class UserHomeActivity extends AbsActivity { authorIcon.setVisibility(View.VISIBLE); authenticationLayout.setVisibility(View.VISIBLE); } else { + imgUp.setVisibility(View.GONE); authorIcon.setVisibility(View.GONE); authenticationLayout.setVisibility(View.GONE); } @@ -309,7 +310,12 @@ public class UserHomeActivity extends AbsActivity { } }); - bannerImgList = userInfo.getUserHomeTopInfo().getUser_home_banner(); + bannerImgList = new ArrayList<>(); + if (isAnchor) { + bannerImgList = userInfo.getUserHomeTopInfo().getUser_home_banner(); + } else { + bannerImgList.add(userInfo.getUserHomeTopInfo().getUser_avatar()); + } tempList = new ArrayList<>(); for (int i = 0; i < bannerImgList.size(); i++) { tempList.add(new UserHomeImgBean(bannerImgList.get(i))); @@ -768,23 +774,10 @@ public class UserHomeActivity extends AbsActivity { tempList.get(0).setShow(true); } userHomeImgAdapter.setCommentBeanList(tempList); + } else { + ToastUtil.show(msg); } } }); } - - private File uri2File(Uri uri) { - String img_path; - String[] proj = {MediaStore.Images.Media.DATA}; - Cursor actualimagecursor = this.managedQuery(uri, proj, null, null, null); - if (actualimagecursor == null) { - img_path = uri.getPath(); - } else { - int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); - actualimagecursor.moveToFirst(); - img_path = actualimagecursor.getString(actual_image_column_index); - } - File file = new File(img_path); - return file; - } } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java index 00e1705f6..23ec7064d 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java @@ -93,7 +93,7 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements @Override public void init() { - List list = CommonAppConfig.getCommunityTypeList(mContext); + List list = CommonAppConfig.getCommunityTypeList(true,mContext); typeHot = list.get(0).getTalk_name(); select = list.get(0).getId();