diff --git a/common/src/main/java/com/yunbao/common/CommonAppConfig.java b/common/src/main/java/com/yunbao/common/CommonAppConfig.java index 6b1a7119d..427d41508 100644 --- a/common/src/main/java/com/yunbao/common/CommonAppConfig.java +++ b/common/src/main/java/com/yunbao/common/CommonAppConfig.java @@ -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 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 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); } diff --git a/common/src/main/java/com/yunbao/common/bean/NewCommunityType.java b/common/src/main/java/com/yunbao/common/bean/NewCommunityType.java index 3a1bbb473..b39a4e772 100644 --- a/common/src/main/java/com/yunbao/common/bean/NewCommunityType.java +++ b/common/src/main/java/com/yunbao/common/bean/NewCommunityType.java @@ -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() { diff --git a/common/src/main/res/layout/activity_community_send.xml b/common/src/main/res/layout/activity_community_send.xml index c29dc6d10..4c5a02589 100644 --- a/common/src/main/res/layout/activity_community_send.xml +++ b/common/src/main/res/layout/activity_community_send.xml @@ -36,7 +36,7 @@ @@ -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" /> diff --git a/common/src/main/res/layout/activity_user_home.xml b/common/src/main/res/layout/activity_user_home.xml index 9c4ab697f..2c6b08ba3 100644 --- a/common/src/main/res/layout/activity_user_home.xml +++ b/common/src/main/res/layout/activity_user_home.xml @@ -320,7 +320,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_vertical" - android:visibility="gone"> + android:visibility="visible"> @@ -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" /> diff --git a/common/src/main/res/layout/view_title2.xml b/common/src/main/res/layout/view_title2.xml index adaaa534f..f907f64e4 100644 --- a/common/src/main/res/layout/view_title2.xml +++ b/common/src/main/res/layout/view_title2.xml @@ -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" /> diff --git a/common/src/main/res/mipmap-b+en+us/icon_img_up_label.png b/common/src/main/res/mipmap-b+en+us/icon_img_up_label.png new file mode 100644 index 000000000..dc1c4a9b4 Binary files /dev/null and b/common/src/main/res/mipmap-b+en+us/icon_img_up_label.png differ diff --git a/common/src/main/res/mipmap-b+en+us/icon_liveing.gif b/common/src/main/res/mipmap-b+en+us/icon_liveing.gif new file mode 100644 index 000000000..c1cd884ca Binary files /dev/null and b/common/src/main/res/mipmap-b+en+us/icon_liveing.gif differ diff --git a/common/src/main/res/mipmap-mdpi/icon_liveing.gif b/common/src/main/res/mipmap-mdpi/icon_liveing.gif new file mode 100644 index 000000000..dee8de098 Binary files /dev/null and b/common/src/main/res/mipmap-mdpi/icon_liveing.gif differ diff --git a/common/src/main/res/values-en-rUS/string.xml b/common/src/main/res/values-en-rUS/string.xml index 6f52a4f56..a165d49cf 100644 --- a/common/src/main/res/values-en-rUS/string.xml +++ b/common/src/main/res/values-en-rUS/string.xml @@ -258,7 +258,7 @@ Live broadcast Log in shopmall - Recommend + Hot Find CSD Anchor diff --git a/common/src/main/res/values-en-rUS/strings.xml b/common/src/main/res/values-en-rUS/strings.xml index 17f78241b..a7654cc40 100644 --- a/common/src/main/res/values-en-rUS/strings.xml +++ b/common/src/main/res/values-en-rUS/strings.xml @@ -10,5 +10,18 @@ Add up to 9 pictures not interested people liked it - 主播守護團 + Fan group name + Anchor fan group + Beauty + Rookie + Figure + Live + Life + Selection period + Now + Select topic + picture + Please enter text within 200 words + hour + minute \ No newline at end of file diff --git a/common/src/main/res/values-zh-rHK/strings.xml b/common/src/main/res/values-zh-rHK/strings.xml index 1bebb3f3e..eaac0bdb9 100644 --- a/common/src/main/res/values-zh-rHK/strings.xml +++ b/common/src/main/res/values-zh-rHK/strings.xml @@ -1476,4 +1476,17 @@ 不感興趣 人觉得很赞 主播守護團 + 主播粉絲團 + 美圖 + 新秀 + 身材 + 直播 + 生活 + 選擇時間 + 立即發表 + 選擇話題 + 圖文 + 请输入200字以内的文字 + + diff --git a/common/src/main/res/values-zh-rTW/strings.xml b/common/src/main/res/values-zh-rTW/strings.xml index 471bbeb2a..12d76c52c 100644 --- a/common/src/main/res/values-zh-rTW/strings.xml +++ b/common/src/main/res/values-zh-rTW/strings.xml @@ -1476,4 +1476,17 @@ 不感興趣 人觉得很赞 主播守護團 + 主播粉絲團 + 美圖 + 新秀 + 身材 + 直播 + 生活 + 選擇時間 + 立即發表 + 選擇話題 + 圖文 + 请输入200字以内的文字 + + diff --git a/common/src/main/res/values-zh/strings.xml b/common/src/main/res/values-zh/strings.xml index ceddb99e2..02a9f1202 100644 --- a/common/src/main/res/values-zh/strings.xml +++ b/common/src/main/res/values-zh/strings.xml @@ -1473,4 +1473,17 @@ 不感興趣 人觉得很赞 主播守護團 + 主播粉絲團 + 美圖 + 新秀 + 身材 + 直播 + 生活 + 選擇時間 + 立即發表 + 選擇話題 + 圖文 + 请输入200字以内的文字 + + diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 6bc11ee08..54be929e0 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -258,7 +258,7 @@ Live broadcast Log in shopmall - Recommend + Hot Find CSD Anchor @@ -669,7 +669,7 @@ ReceiveAwards One free gift privilege! - Send + release I am sorry video myname.pdlive.shayu.fileprovider @@ -1495,6 +1495,19 @@ Limited ride And limited avatar frame 不感興趣 人觉得很赞 主播守護團 + 主播粉絲團 + 美圖 + 新秀 + 身材 + 直播 + 生活 + 選擇時間 + 立即發表 + 選擇話題 + 圖文 + 请输入200字以内的文字 + + 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 c1443734e..02355c072 100644 --- a/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/CommunitySendActivity.java @@ -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(); diff --git a/main/src/main/java/com/yunbao/main/activity/MainActivity.java b/main/src/main/java/com/yunbao/main/activity/MainActivity.java index 3db2c2eff..ae0fb4b90 100644 --- a/main/src/main/java/com/yunbao/main/activity/MainActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/MainActivity.java @@ -199,6 +199,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene private View floatWarOrder;//战令浮窗 private List 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() { @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); 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 95a89b277..efceecdb2 100644 --- a/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java +++ b/main/src/main/java/com/yunbao/main/activity/UserHomeActivity.java @@ -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 } diff --git a/main/src/main/java/com/yunbao/main/views/MainHomeComViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainHomeComViewHolder.java index c15445aa3..aef6742a0 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeComViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeComViewHolder.java @@ -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); 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 9d00a171c..00e1705f6 100644 --- a/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainHomeNewViewHolder.java @@ -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 list = new CommunityTypeManager(mContext).getCommunityTypeList(); - if (list != null && !list.isEmpty()&& !StringUtil.isEmpty(list.get(0).getTalk_name())) { - 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 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); - } - }); - } + List list = CommonAppConfig.getCommunityTypeList(mContext); + typeHot = list.get(0).getTalk_name(); + select = list.get(0).getId(); + mBtnDismiss = findViewById(R.id.btn_dismiss); mBtnDismiss.setOnClickListener(new View.OnClickListener() { @Override