修复bug

This commit is contained in:
hch 2024-03-26 09:36:41 +08:00
parent 28f00f1c8a
commit 0324b638fa
7 changed files with 38 additions and 37 deletions

View File

@ -119,11 +119,14 @@ public class CommonAppConfig {
private String mAppName; private String mAppName;
private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜 private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜
public static List<NewCommunityType> getCommunityTypeList(Context mContext) { public static List<NewCommunityType> getCommunityTypeList(boolean isHome, Context mContext) {
NewCommunityType type0 = new NewCommunityType(); List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
type0.setId(0); if (isHome) {
type0.setTalk_name(mContext.getString(R.string.recomment)); NewCommunityType type0 = new NewCommunityType();
type0.setId(0);
type0.setTalk_name(mContext.getString(R.string.recomment));
newCommunityTypeList.add(type0);
}
NewCommunityType type17 = new NewCommunityType(); NewCommunityType type17 = new NewCommunityType();
type17.setId(17); type17.setId(17);
type17.setTalk_name(mContext.getResources().getString(R.string.main_active_type_01)); type17.setTalk_name(mContext.getResources().getString(R.string.main_active_type_01));
@ -144,8 +147,6 @@ public class CommonAppConfig {
type13.setId(13); type13.setId(13);
type13.setTalk_name(mContext.getResources().getString(R.string.main_active_type_05)); type13.setTalk_name(mContext.getResources().getString(R.string.main_active_type_05));
List<NewCommunityType> newCommunityTypeList = new ArrayList<>();
newCommunityTypeList.add(type0);
newCommunityTypeList.add(type17); newCommunityTypeList.add(type17);
newCommunityTypeList.add(type16); newCommunityTypeList.add(type16);
newCommunityTypeList.add(type15); newCommunityTypeList.add(type15);

View File

@ -36,7 +36,7 @@ public class LabelTagAdapter extends BaseTagAdapter<String, TextView> {
@Override @Override
protected void convert(TextView textView, String item, int position) { protected void convert(TextView textView, String item, int position) {
textView.setText(item); textView.setText("#"+item);
} }
public interface OnSureOnClickListener { public interface OnSureOnClickListener {

View File

@ -255,7 +255,7 @@
<string name="login_auth_success">Login successfully</string> <string name="login_auth_success">Login successfully</string>
<string name="login_auth_failure">privilege grant failed</string> <string name="login_auth_failure">privilege grant failed</string>
<string name="login_auth_cancle">Authorization cancelled</string> <string name="login_auth_cancle">Authorization cancelled</string>
<string name="live">Live broadcast</string> <string name="live">Live</string>
<string name="login_tip_4">Log in</string> <string name="login_tip_4">Log in</string>
<string name="shopmall">shopmall</string> <string name="shopmall">shopmall</string>
<string name="recomment">Hot</string> <string name="recomment">Hot</string>
@ -426,7 +426,7 @@
<string name="live_pk_time_2">Penalty time</string> <string name="live_pk_time_2">Penalty time</string>
<string name="live_no_data_6">No video</string> <string name="live_no_data_6">No video</string>
<string name="live_no_data_7">Let\'s release our own video</string> <string name="live_no_data_7">Let\'s release our own video</string>
<string name="main_home">home page</string> <string name="main_home">Home</string>
<string name="main_near">nearby</string> <string name="main_near">nearby</string>
<string name="main_list">Ranking</string> <string name="main_list">Ranking</string>
<string name="main_me">My</string> <string name="main_me">My</string>

View File

@ -256,7 +256,7 @@
<string name="login_auth_success">Login successfully</string> <string name="login_auth_success">Login successfully</string>
<string name="login_auth_failure">privilege grant failed</string> <string name="login_auth_failure">privilege grant failed</string>
<string name="login_auth_cancle">Authorization cancelled</string> <string name="login_auth_cancle">Authorization cancelled</string>
<string name="live">Live broadcast</string> <string name="live">Live</string>
<string name="login_tip_4">Log in</string> <string name="login_tip_4">Log in</string>
<string name="shopmall">shopmall</string> <string name="shopmall">shopmall</string>
<string name="recomment">Hot</string> <string name="recomment">Hot</string>
@ -427,7 +427,7 @@
<string name="live_pk_time_2">Penalty time</string> <string name="live_pk_time_2">Penalty time</string>
<string name="live_no_data_6">No video</string> <string name="live_no_data_6">No video</string>
<string name="live_no_data_7">Let\'s release our own video</string> <string name="live_no_data_7">Let\'s release our own video</string>
<string name="main_home">home page</string> <string name="main_home">Home</string>
<string name="main_near">nearby</string> <string name="main_near">nearby</string>
<string name="main_list">Ranking</string> <string name="main_list">Ranking</string>
<string name="main_me">My</string> <string name="main_me">My</string>

View File

@ -55,6 +55,8 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import io.rong.imkit.picture.tools.DateUtils;
public class CommunitySendActivity extends AbsActivity { public class CommunitySendActivity extends AbsActivity {
public static final int PERMISSION_REQUEST_CODE_IMG = 0; public static final int PERMISSION_REQUEST_CODE_IMG = 0;
public static final int PERMISSION_REQUEST_CODE_VIDEO = 1; public static final int PERMISSION_REQUEST_CODE_VIDEO = 1;
@ -91,7 +93,7 @@ public class CommunitySendActivity extends AbsActivity {
@Override @Override
protected void main() { protected void main() {
newCommunityTypeList = CommonAppConfig.getCommunityTypeList(mContext); newCommunityTypeList = CommonAppConfig.getCommunityTypeList(false, mContext);
content = findViewById(R.id.content); content = findViewById(R.id.content);
submit = findViewById(R.id.submit); submit = findViewById(R.id.submit);
submit.setVisibility(View.VISIBLE); submit.setVisibility(View.VISIBLE);
@ -214,7 +216,7 @@ public class CommunitySendActivity extends AbsActivity {
@Override @Override
public void onDel(int position) { public void onDel(int position) {
activeImageAdapter.deleteItem(position);
} }
}); });
} }
@ -222,7 +224,6 @@ public class CommunitySendActivity extends AbsActivity {
private void submit() { private void submit() {
if (isImage) { if (isImage) {
if (imgUrlList.size() == 0) { if (imgUrlList.size() == 0) {
return; return;
} }
} else { } else {
@ -289,10 +290,17 @@ public class CommunitySendActivity extends AbsActivity {
public void showTimeChooseDialog() { public void showTimeChooseDialog() {
Calendar startCalendar = Calendar.getInstance(); Calendar startCalendar = Calendar.getInstance();
//startCalendar.set(1990, 1, 1); startCalendar.set(1990, 1, 1);
Calendar endCalendar = Calendar.getInstance(); 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() { TimePickerView timePickerView = new TimePickerBuilder(CommunitySendActivity.this, new OnTimeSelectListener() {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
@Override @Override
@ -306,8 +314,7 @@ public class CommunitySendActivity extends AbsActivity {
.setTitleText("")//标题文字 .setTitleText("")//标题文字
.setOutSideCancelable(true)//点击屏幕点在控件外部范围时是否取消显示 .setOutSideCancelable(true)//点击屏幕点在控件外部范围时是否取消显示
.isCyclic(false)//是否循环滚动 .isCyclic(false)//是否循环滚动
.setRangDate(startCalendar, endCalendar) .setDate(endCalendar).setRangDate(startCalendar, endCalendar).setLabel("", "", "", "", "", "")//默认设置为年月日时分秒
.setLabel("", "", "", "", "", "")//默认设置为年月日时分秒
.isCenterLabel(false) //是否只显示中间选中项的label文字false则每项item全部都带有label .isCenterLabel(false) //是否只显示中间选中项的label文字false则每项item全部都带有label
.build(); .build();
timePickerView.show(); timePickerView.show();

View File

@ -243,6 +243,7 @@ public class UserHomeActivity extends AbsActivity {
authorIcon.setVisibility(View.VISIBLE); authorIcon.setVisibility(View.VISIBLE);
authenticationLayout.setVisibility(View.VISIBLE); authenticationLayout.setVisibility(View.VISIBLE);
} else { } else {
imgUp.setVisibility(View.GONE);
authorIcon.setVisibility(View.GONE); authorIcon.setVisibility(View.GONE);
authenticationLayout.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<>(); tempList = new ArrayList<>();
for (int i = 0; i < bannerImgList.size(); i++) { for (int i = 0; i < bannerImgList.size(); i++) {
tempList.add(new UserHomeImgBean(bannerImgList.get(i))); tempList.add(new UserHomeImgBean(bannerImgList.get(i)));
@ -768,23 +774,10 @@ public class UserHomeActivity extends AbsActivity {
tempList.get(0).setShow(true); tempList.get(0).setShow(true);
} }
userHomeImgAdapter.setCommentBeanList(tempList); 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;
}
} }

View File

@ -93,7 +93,7 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
@Override @Override
public void init() { public void init() {
List<NewCommunityType> list = CommonAppConfig.getCommunityTypeList(mContext); List<NewCommunityType> list = CommonAppConfig.getCommunityTypeList(true,mContext);
typeHot = list.get(0).getTalk_name(); typeHot = list.get(0).getTalk_name();
select = list.get(0).getId(); select = list.get(0).getId();