This commit is contained in:
hch 2024-03-22 17:47:12 +08:00
parent 2cc58b920f
commit 4d4d3d1bae
19 changed files with 173 additions and 77 deletions

View File

@ -1,5 +1,6 @@
package com.yunbao.common;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@ -12,6 +13,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.FansMedalBean;
import com.yunbao.common.bean.NewCommunityType;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.bean.UserItemBean;
import com.yunbao.common.http.CommonHttpUtil;
@ -117,10 +119,45 @@ public class CommonAppConfig {
private String mAppName;
private Boolean mTiBeautyEnable;//是否使用萌颜 true使用萌颜 false 使用基础美颜
public static List<NewCommunityType> getCommunityTypeList(Context mContext) {
NewCommunityType type0 = new NewCommunityType();
type0.setId(0);
type0.setTalk_name(mContext.getString(R.string.recomment));
NewCommunityType type17 = new NewCommunityType();
type17.setId(17);
type17.setTalk_name(mContext.getResources().getString(R.string.main_active_type_01));
NewCommunityType type16 = new NewCommunityType();
type16.setId(16);
type16.setTalk_name(mContext.getResources().getString(R.string.main_active_type_02));
NewCommunityType type15 = new NewCommunityType();
type15.setId(15);
type15.setTalk_name(mContext.getResources().getString(R.string.main_active_type_03));
NewCommunityType type14 = new NewCommunityType();
type14.setId(14);
type14.setTalk_name(mContext.getResources().getString(R.string.main_active_type_04));
NewCommunityType type13 = new NewCommunityType();
type13.setId(13);
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(type16);
newCommunityTypeList.add(type15);
newCommunityTypeList.add(type14);
newCommunityTypeList.add(type13);
return newCommunityTypeList;
}
public String getUid() {
if (TextUtils.isEmpty(mUid)) {
String[] uidAndToken = SpUtil.getInstance()
.getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
if (uidAndToken != null) {
if (!TextUtils.isEmpty(uidAndToken[0]) && !TextUtils.isEmpty(uidAndToken[1])) {
mUid = uidAndToken[0];
@ -311,9 +348,7 @@ public class CommonAppConfig {
mUid = null;
mToken = null;
mLoginIM = false;
SpUtil.getInstance().removeValue(
SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN
);
SpUtil.getInstance().removeValue(SpUtil.UID, SpUtil.TOKEN, SpUtil.USER_INFO, SpUtil.IM_LOGIN);
}
@ -349,12 +384,7 @@ public class CommonAppConfig {
mProvince = null;
mCity = null;
mDistrict = null;
SpUtil.getInstance().removeValue(
SpUtil.LOCATION_LNG,
SpUtil.LOCATION_LAT,
SpUtil.LOCATION_PROVINCE,
SpUtil.LOCATION_CITY,
SpUtil.LOCATION_DISTRICT);
SpUtil.getInstance().removeValue(SpUtil.LOCATION_LNG, SpUtil.LOCATION_LAT, SpUtil.LOCATION_PROVINCE, SpUtil.LOCATION_CITY, SpUtil.LOCATION_DISTRICT);
}

View File

@ -3,6 +3,7 @@ package com.yunbao.common.bean;
public class NewCommunityType extends BaseModel {
private int id;
private String talk_name;
private String talk_name_en;
private String img;
private String is_hot;
private String hot_time;
@ -11,13 +12,12 @@ public class NewCommunityType extends BaseModel {
public NewCommunityType() {
}
public NewCommunityType(int id, String talk_name, String img, String is_hot, String hot_time, String sort) {
this.id = id;
this.talk_name = talk_name;
this.img = img;
this.is_hot = is_hot;
this.hot_time = hot_time;
this.sort = sort;
public String getTalk_name_en() {
return talk_name_en;
}
public void setTalk_name_en(String talk_name_en) {
this.talk_name_en = talk_name_en;
}
public int getId() {

View File

@ -36,7 +36,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="请输入200字以内的文字"
android:text="@string/_200"
android:textColor="#333333" />
</LinearLayout>
@ -50,7 +50,7 @@
android:layout_marginBottom="15dp"
android:background="@color/white"
android:gravity="start"
android:hint="写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么写点什么..."
android:hint="@string/video_say_something"
android:maxEms="200"
android:maxLength="200"
android:textSize="14dp" />
@ -112,7 +112,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="图文"
android:text="@string/pricture"
android:textColor="#333333"
android:textSize="14dp" />
@ -135,7 +135,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:text="视频"
android:text="@string/video"
android:textColor="#333333"
android:textSize="14dp" />
@ -172,7 +172,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="选择话题"
android:text="@string/choose_topic"
android:textColor="#333333"
android:textSize="14dp"
android:textStyle="bold" />
@ -218,7 +218,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:text="选择时间"
android:text="@string/send_active_time"
android:textColor="#333333"
android:textSize="14dp"
android:textStyle="bold" />
@ -229,7 +229,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_weight="1"
android:text="立即发表"
android:text="@string/now_send"
android:textColor="#333333"
android:textSize="12dp" />

View File

@ -320,7 +320,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:visibility="gone">
android:visibility="visible">
<ImageView
android:layout_width="25dp"
@ -375,7 +375,7 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="主播粉絲團"
android:text="@string/user_home_anchor"
android:textColor="#333333"
android:textSize="12dp"
android:textStyle="bold" />
@ -384,7 +384,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:text="粉絲團名稱"
android:text="@string/fan_group_name"
android:textColor="#777777"
android:textSize="14dp" />
@ -823,7 +823,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:paddingLeft="5dp"
android:text="编辑资料"
android:text="@string/edit_profile"
android:textColor="@color/white"
android:textSize="14dp"
android:textStyle="bold" />

View File

@ -65,7 +65,7 @@
android:paddingLeft="15dp"
android:gravity="center"
android:paddingRight="15dp"
android:text="发布"
android:text="@string/send"
android:textColor="@color/white"
android:textSize="16dp"
android:visibility="gone" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

View File

@ -258,7 +258,7 @@
<string name="live">Live broadcast</string>
<string name="login_tip_4">Log in</string>
<string name="shopmall">shopmall</string>
<string name="recomment">Recommend</string>
<string name="recomment">Hot</string>
<string name="main_type_find">Find</string>
<string name="cust_server">CSD</string>
<string name="live_anchor">Anchor</string>

View File

@ -10,5 +10,18 @@
<string name="_9">Add up to 9 pictures</string>
<string name="not_interested">not interested</string>
<string name="person_like">people liked it</string>
<string name="fan_group_name">主播守護團</string>
<string name="fan_group_name">Fan group name</string>
<string name="user_home_anchor">Anchor fan group</string>
<string name="main_active_type_01">Beauty</string>
<string name="main_active_type_02">Rookie</string>
<string name="main_active_type_03">Figure</string>
<string name="main_active_type_04">Live</string>
<string name="main_active_type_05">Life</string>
<string name="send_active_time">Selection period</string>
<string name="now_send">Now</string>
<string name="choose_topic">Select topic</string>
<string name="pricture">picture</string>
<string name="_200">Please enter text within 200 words</string>
<string name="time_hour">hour</string>
<string name="time_minute">minute</string>
</resources>

View File

@ -1476,4 +1476,17 @@
<string name="not_interested">不感興趣</string>
<string name="person_like">人觉得很赞</string>
<string name="fan_group_name">主播守護團</string>
<string name="user_home_anchor">主播粉絲團</string>
<string name="main_active_type_01">美圖</string>
<string name="main_active_type_02">新秀</string>
<string name="main_active_type_03">身材</string>
<string name="main_active_type_04">直播</string>
<string name="main_active_type_05">生活</string>
<string name="send_active_time">選擇時間</string>
<string name="now_send">立即發表</string>
<string name="choose_topic">選擇話題</string>
<string name="pricture">圖文</string>
<string name="_200">请输入200字以内的文字</string>
<string name="time_hour"></string>
<string name="time_minute"></string>
</resources>

View File

@ -1476,4 +1476,17 @@
<string name="not_interested">不感興趣</string>
<string name="person_like">人觉得很赞</string>
<string name="fan_group_name">主播守護團</string>
<string name="user_home_anchor">主播粉絲團</string>
<string name="main_active_type_01">美圖</string>
<string name="main_active_type_02">新秀</string>
<string name="main_active_type_03">身材</string>
<string name="main_active_type_04">直播</string>
<string name="main_active_type_05">生活</string>
<string name="send_active_time">選擇時間</string>
<string name="now_send">立即發表</string>
<string name="choose_topic">選擇話題</string>
<string name="pricture">圖文</string>
<string name="_200">请输入200字以内的文字</string>
<string name="time_hour"></string>
<string name="time_minute"></string>
</resources>

View File

@ -1473,4 +1473,17 @@
<string name="not_interested">不感興趣</string>
<string name="person_like">人觉得很赞</string>
<string name="fan_group_name">主播守護團</string>
<string name="user_home_anchor">主播粉絲團</string>
<string name="main_active_type_01">美圖</string>
<string name="main_active_type_02">新秀</string>
<string name="main_active_type_03">身材</string>
<string name="main_active_type_04">直播</string>
<string name="main_active_type_05">生活</string>
<string name="send_active_time">選擇時間</string>
<string name="now_send">立即發表</string>
<string name="choose_topic">選擇話題</string>
<string name="pricture">圖文</string>
<string name="_200">请输入200字以内的文字</string>
<string name="time_hour"></string>
<string name="time_minute"></string>
</resources>

View File

@ -258,7 +258,7 @@
<string name="live">Live broadcast</string>
<string name="login_tip_4">Log in</string>
<string name="shopmall">shopmall</string>
<string name="recomment">Recommend</string>
<string name="recomment">Hot</string>
<string name="main_type_find">Find</string>
<string name="cust_server">CSD</string>
<string name="live_anchor">Anchor</string>
@ -669,7 +669,7 @@
<string name="receive_awards">ReceiveAwards</string>
<string name="one_free">One free gift privilege!</string>
<string name="send">Send</string>
<string name="send">release</string>
<string name="sorry">I am sorry</string>
<string name="video">video</string>
<string name="FILE_PROVIDER">myname.pdlive.shayu.fileprovider</string>
@ -1495,6 +1495,19 @@ Limited ride And limited avatar frame</string>
<string name="not_interested">不感興趣</string>
<string name="person_like">人觉得很赞</string>
<string name="fan_group_name">主播守護團</string>
<string name="user_home_anchor">主播粉絲團</string>
<string name="main_active_type_01">美圖</string>
<string name="main_active_type_02">新秀</string>
<string name="main_active_type_03">身材</string>
<string name="main_active_type_04">直播</string>
<string name="main_active_type_05">生活</string>
<string name="send_active_time">選擇時間</string>
<string name="now_send">立即發表</string>
<string name="choose_topic">選擇話題</string>
<string name="pricture">圖文</string>
<string name="_200">请输入200字以内的文字</string>
<string name="time_hour"></string>
<string name="time_minute"></string>
</resources>

View File

@ -31,13 +31,13 @@ import com.bigkoo.pickerview.listener.OnTimeSelectListener;
import com.bigkoo.pickerview.view.OptionsPickerView;
import com.bigkoo.pickerview.view.TimePickerView;
import com.google.gson.Gson;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.R;
import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.bean.NewCommunityType;
import com.yunbao.common.custom.ItemDecoration;
import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.manager.CommunityTypeManager;
import com.yunbao.common.upload.UploadBean;
import com.yunbao.common.upload.UploadCallback;
import com.yunbao.common.upload.UploadQnImpl;
@ -50,6 +50,7 @@ import com.yunbao.common.utils.ToastUtil;
import java.io.File;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@ -90,7 +91,7 @@ public class CommunitySendActivity extends AbsActivity {
@Override
protected void main() {
newCommunityTypeList = new CommunityTypeManager(mContext).getCommunityTypeList();
newCommunityTypeList = CommonAppConfig.getCommunityTypeList(mContext);
content = findViewById(R.id.content);
submit = findViewById(R.id.submit);
submit.setVisibility(View.VISIBLE);
@ -144,6 +145,9 @@ public class CommunitySendActivity extends AbsActivity {
@RequiresApi(api = Build.VERSION_CODES.TIRAMISU)
@Override
public void onClick(View v) {
if (videoFile != null) {
return;
}
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
@ -163,6 +167,9 @@ public class CommunitySendActivity extends AbsActivity {
videoLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (imgUrlList.size() > 0) {
return;
}
String permission1 = Manifest.permission.READ_EXTERNAL_STORAGE;
String permission2 = Manifest.permission.WRITE_EXTERNAL_STORAGE;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
@ -214,12 +221,11 @@ public class CommunitySendActivity extends AbsActivity {
private void submit() {
if (isImage) {
if (imgUrlList.size() == 0) {
ToastUtil.show("请选择图片或者视频");
return;
}
} else {
if (StringUtil.isEmpty(videoUrl)) {
ToastUtil.show("请选择图片或者视频");
return;
}
}
@ -228,7 +234,7 @@ public class CommunitySendActivity extends AbsActivity {
imgUrl = new Gson().toJson(imgUrlList);
}
String tempTime = "";
if (!chooseTime.getText().toString().equals("立即发表")) {
if (!chooseTime.getText().toString().equals("立即發表") && !chooseTime.getText().toString().equals("Now")) {
tempTime = chooseTime.getText().toString();
}
JSONObject jsonObject = new JSONObject();
@ -256,7 +262,7 @@ public class CommunitySendActivity extends AbsActivity {
talkContent.setText(talkList.get(options1));
talkContent.setVisibility(View.VISIBLE);
}
}).setTitleText("选择话题").setContentTextSize(16).build();
}).setTitleText(getResources().getString(R.string.choose_topic)).setContentTextSize(16).build();
pickerView.setPicker(talkList, null, null);
pickerView.show();
}
@ -281,6 +287,11 @@ public class CommunitySendActivity extends AbsActivity {
}
public void showTimeChooseDialog() {
Calendar startCalendar = Calendar.getInstance();
startCalendar.set(1990, 1, 1);
Calendar endCalendar = Calendar.getInstance();
endCalendar.setTime(new Date());
TimePickerView timePickerView = new TimePickerBuilder(CommunitySendActivity.this, new OnTimeSelectListener() {
@SuppressLint("SetTextI18n")
@Override
@ -288,13 +299,14 @@ public class CommunitySendActivity extends AbsActivity {
chooseTime.setText(DateFormatUtil.getTimeStrings(date.getTime()));
}
}).setType(new boolean[]{true, true, true, true, true, false})// 默认全部显示
.setCancelText("Cancel")//取消按钮文字
.setSubmitText("Sure")//确认按钮文字
.setCancelText(getResources().getString(R.string.cancel))//取消按钮文字
.setSubmitText(getResources().getString(R.string.back_community_sure))//确认按钮文字
.setTitleSize(20)//标题文字大小
.setTitleText("Title")//标题文字
.setOutSideCancelable(false)//点击屏幕点在控件外部范围时是否取消显示
.isCyclic(true)//是否循环滚动
.setLabel("", "", "", "", "", "")//默认设置为年月日时分秒
.setTitleText("")//标题文字
.setOutSideCancelable(true)//点击屏幕点在控件外部范围时是否取消显示
.isCyclic(false)//是否循环滚动
.setRangDate(startCalendar, endCalendar)
.setLabel("", "", "", "", "", "")//默认设置为年月日时分秒
.isCenterLabel(false) //是否只显示中间选中项的label文字false则每项item全部都带有label
.build();
timePickerView.show();

View File

@ -199,6 +199,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
private View floatWarOrder;//战令浮窗
private List<AnchorStartLiveBean> startListNotifyList = new ArrayList<>();
@Override
protected int getLayoutId() {
return R.layout.activity_main;
@ -211,11 +212,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
getWindow().setSharedElementEnterTransition(new FullAdToBannerTransition(1, 0.4f, new DecelerateInterpolator()));
}
@Override
protected void onPause() {
super.onPause();
OpenAdManager.getInstance().dismiss();
}
@Override
protected void main() {
ActivityCompat.postponeEnterTransition(this);
@ -540,12 +543,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
MessageSayHiNotifyManager.getInstance().start();
showFirstLogin();
}
private void showFirstLogin(){
private void showFirstLogin() {
LiveNetManager.get(mContext)
.isFirstLogin(new com.yunbao.common.http.base.HttpCallback<FirstLoginBean>() {
@Override
public void onSuccess(FirstLoginBean data) {
if(data.getStatus()==0){
if (data.getStatus() == 0) {
mContext.startActivity(new Intent(mContext, CompleteUserInfoActivity.class));
}
}
@ -661,7 +665,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} else {
if (mainHomeComViewHolder != null && mainHomeComViewHolder.isFloatWarOrder()) {
floatWarOrder.setVisibility(View.GONE);
}else {
} else {
floatWarOrder.setVisibility(View.VISIBLE);
}
@ -1137,7 +1141,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
}
}
private void loadPageData(int position, boolean needlLoadData) {
if (mViewHolders == null) {
ToastUtil.showDebug("Holders为空");
@ -1152,7 +1155,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
return;
}
if (position == 0) {
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, parent);
mainHomeComViewHolder = new MainHomeComViewHolder(mContext, MainActivity.this, parent);
vh = mainHomeComViewHolder;
} else if (position == 1) {
mainHomeViewHolder = new MainHomeViewHolder(mContext, parent);

View File

@ -219,7 +219,7 @@ public class UserHomeActivity extends AbsActivity {
followLayout.setVisibility(View.GONE);
}
if (!StringUtil.isEmpty(userInfo.getUserHomeTopInfo().getUser_goodnum())) {
userId.setText("靓号:" + userInfo.getUserHomeTopInfo().getUser_goodnum());//用户靓号
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_goodnum());//用户靓号
} else {
userId.setText("ID:" + userInfo.getUserHomeTopInfo().getUser_id());//用户ID
}

View File

@ -1,6 +1,7 @@
package com.yunbao.main.views;
import android.Manifest;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
@ -10,9 +11,12 @@ import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.fragment.app.FragmentActivity;
import com.umeng.analytics.MobclickAgent;
import com.yunbao.common.event.FloatWarOrderEvent;
import com.yunbao.common.manager.IMLoginManager;
import com.yunbao.common.utils.ProcessImageUtil;
import com.yunbao.common.utils.ProcessResultUtil;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.common.utils.ToastUtil;
@ -40,8 +44,9 @@ public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
return floatWarOrder;
}
public MainHomeComViewHolder(Context context, ViewGroup parentView) {
public MainHomeComViewHolder(Context context, Activity activity, ViewGroup parentView) {
super(context, parentView);
mProcessResultUtil = new ProcessImageUtil((FragmentActivity) activity);
}
@Override
@ -79,9 +84,6 @@ public class MainHomeComViewHolder extends AbsMainHomeParentComViewHolder {
} else {
ToastUtil.show(mContext.getResources().getString(R.string.only_open_anchor));
}
Intent intent = new Intent(mContext, CommunitySendActivity.class);
mContext.startActivity(intent);
}
});
tvPlay = (TextView) findViewById(R.id.tvPlay);

View File

@ -13,6 +13,7 @@ import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants;
import com.yunbao.common.adapter.RefreshAdapter;
import com.yunbao.common.bean.ActiveBean;
@ -92,27 +93,10 @@ public class MainHomeNewViewHolder extends AbsMainHomeChildViewHolder implements
@Override
public void init() {
List<NewCommunityType> list = new CommunityTypeManager(mContext).getCommunityTypeList();
if (list != null && !list.isEmpty()&& !StringUtil.isEmpty(list.get(0).getTalk_name())) {
List<NewCommunityType> list = CommonAppConfig.getCommunityTypeList(mContext);
typeHot = list.get(0).getTalk_name();
select = list.get(0).getId();
} else {
CommonHttpUtil.getTag(new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
List<NewCommunityType> list = JSON.parseArray(Arrays.toString(info), NewCommunityType.class);
NewCommunityType newCommunityType = new NewCommunityType();
newCommunityType.setId(0);
newCommunityType.setTalk_name(mContext.getString(R.string.recomment));
list.add(0, newCommunityType);
CommunityTypeManager communityTypeManager = new CommunityTypeManager(mContext);
communityTypeManager.UpCommunityType(new Gson().toJson(list));
typeHot = list.get(0).getTalk_name();
select = list.get(0).getId();
initCommunityTypeList(list);
}
});
}
mBtnDismiss = findViewById(R.id.btn_dismiss);
mBtnDismiss.setOnClickListener(new View.OnClickListener() {
@Override