Showing
33 changed files
with
634 additions
and
546 deletions
| @@ -44,6 +44,23 @@ android { | @@ -44,6 +44,23 @@ android { | ||
| 44 | dependencies { | 44 | dependencies { |
| 45 | implementation 'com.wd:wdkit:1.0.2' | 45 | implementation 'com.wd:wdkit:1.0.2' |
| 46 | implementation 'com.wd:wdbean:1.0.0' | 46 | implementation 'com.wd:wdbean:1.0.0' |
| 47 | + implementation 'com.wd:router:1.0.0' | ||
| 48 | + implementation 'com.wd:wdnetwork:1.0.0' | ||
| 49 | + implementation 'androidx.recyclerview:recyclerview:1.2.1' | ||
| 50 | + implementation 'androidx.viewpager2:viewpager2:1.0.0' | ||
| 51 | + implementation 'com.github.hackware1993:MagicIndicator:1.7.0' | ||
| 52 | + // 基础依赖库 | ||
| 53 | + api 'com.alibaba:arouter-api:1.5.2' | ||
| 54 | + api 'com.squareup.okhttp3:okhttp:4.8.0' | ||
| 55 | + api 'com.squareup.retrofit2:retrofit:2.9.0' | ||
| 56 | + api 'com.squareup.retrofit2:converter-gson:2.9.0' | ||
| 57 | + api 'com.squareup.retrofit2:adapter-rxjava2:2.9.0' | ||
| 58 | + //rxjava | ||
| 59 | + api 'io.reactivex.rxjava2:rxjava:2.2.8' | ||
| 60 | + api 'io.reactivex.rxjava2:rxandroid:2.1.0' | ||
| 61 | + //解析bean | ||
| 62 | + api 'com.alibaba:fastjson:1.2.62' | ||
| 63 | + api 'com.airbnb.android:lottie:5.2.0' | ||
| 47 | } | 64 | } |
| 48 | 65 | ||
| 49 | uploadArchives { | 66 | uploadArchives { |
| @@ -4,23 +4,12 @@ | @@ -4,23 +4,12 @@ | ||
| 4 | 4 | ||
| 5 | package com.wd.capability.layout.comp; | 5 | package com.wd.capability.layout.comp; |
| 6 | 6 | ||
| 7 | -import static com.people.common.constant.IntentConstants.PAGE_BACKGROUND_URL; | ||
| 8 | -import static com.people.common.constant.IntentConstants.PAGE_HOME_COLOR; | ||
| 9 | -import static com.people.common.constant.IntentConstants.PAGE_NOTICE_COLOR; | ||
| 10 | -import static com.people.common.constant.IntentConstants.PAGE_STATUS_COLOR; | ||
| 11 | -import static com.people.common.constant.IntentConstants.PARAM_PAGE_ID; | ||
| 12 | -import static com.people.common.constant.IntentConstants.TAB_NEWS_TITLE; | ||
| 13 | - | ||
| 14 | import android.os.Bundle; | 7 | import android.os.Bundle; |
| 15 | 8 | ||
| 16 | import androidx.fragment.app.Fragment; | 9 | import androidx.fragment.app.Fragment; |
| 17 | 10 | ||
| 18 | -import com.people.common.constant.IntentConstants; | ||
| 19 | -import com.people.entity.custom.video.VodDetailIntentBean; | ||
| 20 | -import com.people.router.WdRouterRule; | ||
| 21 | -import com.people.router.constants.RouterConstants; | ||
| 22 | -import com.wondertek.wheat.ability.tools.JsonUtils; | ||
| 23 | - | 11 | +import com.wd.foundation.bean.custom.video.VodDetailIntentBean; |
| 12 | +import com.wd.foundation.wdkitcore.tools.JsonUtils; | ||
| 24 | 13 | ||
| 25 | /** | 14 | /** |
| 26 | * comp组件的相关Service实现<BR> | 15 | * comp组件的相关Service实现<BR> |
| @@ -31,7 +20,6 @@ import com.wondertek.wheat.ability.tools.JsonUtils; | @@ -31,7 +20,6 @@ import com.wondertek.wheat.ability.tools.JsonUtils; | ||
| 31 | */ | 20 | */ |
| 32 | public class CompServiceImpl implements ICompService { | 21 | public class CompServiceImpl implements ICompService { |
| 33 | 22 | ||
| 34 | - | ||
| 35 | @Override | 23 | @Override |
| 36 | public Fragment createMainFragment(String id) { | 24 | public Fragment createMainFragment(String id) { |
| 37 | return null; | 25 | return null; |
| @@ -66,7 +54,6 @@ public class CompServiceImpl implements ICompService { | @@ -66,7 +54,6 @@ public class CompServiceImpl implements ICompService { | ||
| 66 | return new Fragment(); | 54 | return new Fragment(); |
| 67 | } | 55 | } |
| 68 | 56 | ||
| 69 | - | ||
| 70 | @Override | 57 | @Override |
| 71 | public Fragment createDefaultFragment() { | 58 | public Fragment createDefaultFragment() { |
| 72 | // 这里默认直接创建Fragment | 59 | // 这里默认直接创建Fragment |
| @@ -80,12 +67,13 @@ public class CompServiceImpl implements ICompService { | @@ -80,12 +67,13 @@ public class CompServiceImpl implements ICompService { | ||
| 80 | 67 | ||
| 81 | @Override | 68 | @Override |
| 82 | public Fragment createCommonFragment(String pageId) { | 69 | public Fragment createCommonFragment(String pageId) { |
| 83 | - //return CommonFragment.newInstance(pageId); | 70 | + // return CommonFragment.newInstance(pageId); |
| 84 | return null; | 71 | return null; |
| 85 | } | 72 | } |
| 86 | 73 | ||
| 87 | @Override | 74 | @Override |
| 88 | - public Fragment createMiFragment(String pageId, String pageName, int statuesBar, String backgroundUrl, String homeColor, String noticeColor) { | 75 | + public Fragment createMiFragment(String pageId, String pageName, int statuesBar, String backgroundUrl, |
| 76 | + String homeColor, String noticeColor) { | ||
| 89 | Fragment myFragment = | 77 | Fragment myFragment = |
| 90 | (Fragment) WdRouterRule.getInstance().getFragment(RouterConstants.PATH_MODULE_MY_FRAGMENT); | 78 | (Fragment) WdRouterRule.getInstance().getFragment(RouterConstants.PATH_MODULE_MY_FRAGMENT); |
| 91 | Bundle bundle = new Bundle(); | 79 | Bundle bundle = new Bundle(); |
| @@ -6,7 +6,7 @@ package com.wd.capability.layout.comp; | @@ -6,7 +6,7 @@ package com.wd.capability.layout.comp; | ||
| 6 | 6 | ||
| 7 | import androidx.fragment.app.Fragment; | 7 | import androidx.fragment.app.Fragment; |
| 8 | 8 | ||
| 9 | -import com.wondertek.wheat.ability.scheduler.IService; | 9 | +import com.wd.foundation.wdkitcore.scheduler.IService; |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * comp服务的相关接口<BR> | 12 | * comp服务的相关接口<BR> |
| @@ -52,7 +52,6 @@ public interface ICompService extends IService { | @@ -52,7 +52,6 @@ public interface ICompService extends IService { | ||
| 52 | */ | 52 | */ |
| 53 | Fragment createLiveChannelFragment(boolean isGray, String level1ChannelId, String pageId, String channelId); | 53 | Fragment createLiveChannelFragment(boolean isGray, String level1ChannelId, String pageId, String channelId); |
| 54 | 54 | ||
| 55 | - | ||
| 56 | /** | 55 | /** |
| 57 | * 创建默认Fragment | 56 | * 创建默认Fragment |
| 58 | * | 57 | * |
| @@ -62,6 +61,7 @@ public interface ICompService extends IService { | @@ -62,6 +61,7 @@ public interface ICompService extends IService { | ||
| 62 | 61 | ||
| 63 | /** | 62 | /** |
| 64 | * 创建关注Fragment | 63 | * 创建关注Fragment |
| 64 | + * | ||
| 65 | * @param pageId 页面id | 65 | * @param pageId 页面id |
| 66 | * @return | 66 | * @return |
| 67 | */ | 67 | */ |
| @@ -69,6 +69,7 @@ public interface ICompService extends IService { | @@ -69,6 +69,7 @@ public interface ICompService extends IService { | ||
| 69 | 69 | ||
| 70 | /** | 70 | /** |
| 71 | * 创建通用Fragment | 71 | * 创建通用Fragment |
| 72 | + * | ||
| 72 | * @param pageId | 73 | * @param pageId |
| 73 | * @return | 74 | * @return |
| 74 | */ | 75 | */ |
| @@ -76,14 +77,17 @@ public interface ICompService extends IService { | @@ -76,14 +77,17 @@ public interface ICompService extends IService { | ||
| 76 | 77 | ||
| 77 | /** | 78 | /** |
| 78 | * 创建 我的 Fragment | 79 | * 创建 我的 Fragment |
| 80 | + * | ||
| 79 | * @param pageId | 81 | * @param pageId |
| 80 | * @return | 82 | * @return |
| 81 | */ | 83 | */ |
| 82 | - Fragment createMiFragment(String pageId,String pageName,int statuesBar,String backgroundUrl,String homeColor,String noticeColor); | 84 | + Fragment createMiFragment(String pageId, String pageName, int statuesBar, String backgroundUrl, String homeColor, |
| 85 | + String noticeColor); | ||
| 83 | 86 | ||
| 84 | /** | 87 | /** |
| 85 | * 创建短视频Fragment | 88 | * 创建短视频Fragment |
| 89 | + * | ||
| 86 | * @param pageId 页面id | 90 | * @param pageId 页面id |
| 87 | */ | 91 | */ |
| 88 | - Fragment createShortVideoFragment(String pageId,int color); | 92 | + Fragment createShortVideoFragment(String pageId, int color); |
| 89 | } | 93 | } |
| @@ -15,8 +15,9 @@ import android.view.ViewGroup; | @@ -15,8 +15,9 @@ import android.view.ViewGroup; | ||
| 15 | import androidx.annotation.NonNull; | 15 | import androidx.annotation.NonNull; |
| 16 | import androidx.recyclerview.widget.RecyclerView; | 16 | import androidx.recyclerview.widget.RecyclerView; |
| 17 | 17 | ||
| 18 | -import com.people.component.R; | ||
| 19 | -import com.people.entity.custom.item.ItemBean; | 18 | +import com.wd.capability.layout.R; |
| 19 | +import com.wd.foundation.bean.custom.item.ItemBean; | ||
| 20 | + | ||
| 20 | 21 | ||
| 21 | public abstract class BaseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { | 22 | public abstract class BaseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { |
| 22 | 23 | ||
| @@ -35,7 +36,7 @@ public abstract class BaseAdapter extends RecyclerView.Adapter<RecyclerView.View | @@ -35,7 +36,7 @@ public abstract class BaseAdapter extends RecyclerView.Adapter<RecyclerView.View | ||
| 35 | } catch (Exception e) { | 36 | } catch (Exception e) { |
| 36 | e.printStackTrace(); | 37 | e.printStackTrace(); |
| 37 | } | 38 | } |
| 38 | - return R.layout.rmrb_item_layout_placeholder; | 39 | + return R.layout.wdlayout_item_layout_placeholder; |
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | /** | 42 | /** |
| @@ -9,9 +9,9 @@ import java.util.List; | @@ -9,9 +9,9 @@ import java.util.List; | ||
| 9 | 9 | ||
| 10 | import androidx.annotation.NonNull; | 10 | import androidx.annotation.NonNull; |
| 11 | 11 | ||
| 12 | -import com.people.component.comp.layoutdata.AbsPage; | ||
| 13 | -import com.people.component.comp.layoutdata.AbsSection; | ||
| 14 | -import com.people.component.comp.layoutdata.Page; | 12 | +import com.wd.capability.layout.comp.layoutdata.AbsPage; |
| 13 | +import com.wd.capability.layout.comp.layoutdata.AbsSection; | ||
| 14 | +import com.wd.capability.layout.comp.layoutdata.Page; | ||
| 15 | 15 | ||
| 16 | /** | 16 | /** |
| 17 | * Page 布局渲染器, 将comp渲染到页面上 | 17 | * Page 布局渲染器, 将comp渲染到页面上 |
| @@ -29,12 +29,14 @@ public interface ILayoutRender { | @@ -29,12 +29,14 @@ public interface ILayoutRender { | ||
| 29 | 29 | ||
| 30 | /** | 30 | /** |
| 31 | * 移除置指定的item | 31 | * 移除置指定的item |
| 32 | + * | ||
| 32 | * @param positon | 33 | * @param positon |
| 33 | */ | 34 | */ |
| 34 | void itemRemoved(int positon); | 35 | void itemRemoved(int positon); |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * 依据LayoutManager的 HashCode值删除对应的LayoutManager | 38 | * 依据LayoutManager的 HashCode值删除对应的LayoutManager |
| 39 | + * | ||
| 38 | * @param hashCode | 40 | * @param hashCode |
| 39 | */ | 41 | */ |
| 40 | void itemRemovedByLayoutManagerHashCode(int hashCode); | 42 | void itemRemovedByLayoutManagerHashCode(int hashCode); |
| @@ -67,7 +69,7 @@ public interface ILayoutRender { | @@ -67,7 +69,7 @@ public interface ILayoutRender { | ||
| 67 | * | 69 | * |
| 68 | * @param page Page实例 | 70 | * @param page Page实例 |
| 69 | */ | 71 | */ |
| 70 | - void renderPage(AbsPage page,boolean isRefresh); | 72 | + void renderPage(AbsPage page, boolean isRefresh); |
| 71 | 73 | ||
| 72 | // /** | 74 | // /** |
| 73 | // * 渲染overlay浮层 | 75 | // * 渲染overlay浮层 |
| @@ -10,15 +10,16 @@ import java.util.List; | @@ -10,15 +10,16 @@ import java.util.List; | ||
| 10 | 10 | ||
| 11 | import androidx.annotation.NonNull; | 11 | import androidx.annotation.NonNull; |
| 12 | 12 | ||
| 13 | -import com.orhanobut.logger.Logger; | ||
| 14 | -import com.people.component.comp.layoutdata.AbsGroup; | ||
| 15 | -import com.people.component.comp.layoutdata.AbsPage; | ||
| 16 | -import com.people.component.comp.layoutdata.AbsSection; | ||
| 17 | -import com.people.component.comp.layoutdata.channel.BaseLineSection; | ||
| 18 | -import com.people.component.comp.layoutmanager.channel.BaseLineLayoutManager; | ||
| 19 | -import com.people.entity.custom.BaseLineBean; | ||
| 20 | -import com.people.entity.custom.item.ItemBean; | ||
| 21 | -import com.wondertek.wheat.ability.tools.ArrayUtils; | 13 | +import com.wd.base.log.Logger; |
| 14 | +import com.wd.capability.layout.comp.layoutdata.AbsGroup; | ||
| 15 | +import com.wd.capability.layout.comp.layoutdata.AbsPage; | ||
| 16 | +import com.wd.capability.layout.comp.layoutdata.AbsSection; | ||
| 17 | +import com.wd.capability.layout.comp.layoutdata.channel.BaseLineSection; | ||
| 18 | +import com.wd.capability.layout.comp.layoutmanager.channel.BaseLineLayoutManager; | ||
| 19 | +import com.wd.foundation.bean.custom.BaseLineBean; | ||
| 20 | +import com.wd.foundation.bean.custom.item.ItemBean; | ||
| 21 | +import com.wd.foundation.wdkitcore.tools.ArrayUtils; | ||
| 22 | + | ||
| 22 | 23 | ||
| 23 | /** | 24 | /** |
| 24 | * | 25 | * |
| @@ -5,8 +5,7 @@ | @@ -5,8 +5,7 @@ | ||
| 5 | 5 | ||
| 6 | package com.wd.capability.layout.comp.layoutmanager; | 6 | package com.wd.capability.layout.comp.layoutmanager; |
| 7 | 7 | ||
| 8 | - | ||
| 9 | -import com.people.entity.custom.item.ItemBean; | 8 | +import com.wd.foundation.bean.custom.item.ItemBean; |
| 10 | 9 | ||
| 11 | public abstract class ItemContainerManager<T extends ItemBean> extends ItemLayoutManager<T> { | 10 | public abstract class ItemContainerManager<T extends ItemBean> extends ItemLayoutManager<T> { |
| 12 | 11 |
| @@ -20,37 +20,19 @@ import androidx.core.content.ContextCompat; | @@ -20,37 +20,19 @@ import androidx.core.content.ContextCompat; | ||
| 20 | import androidx.fragment.app.Fragment; | 20 | import androidx.fragment.app.Fragment; |
| 21 | import androidx.fragment.app.FragmentActivity; | 21 | import androidx.fragment.app.FragmentActivity; |
| 22 | 22 | ||
| 23 | -import com.people.common.CommonNetUtils; | ||
| 24 | -import com.people.common.ProcessUtils; | ||
| 25 | -import com.people.common.analytics.CommonTrack; | ||
| 26 | -import com.people.common.analytics.constants.PageNameConstants; | ||
| 27 | -import com.people.common.constant.Constants; | ||
| 28 | -import com.people.common.interact.like.model.UserLikeFetcher; | ||
| 29 | -import com.people.common.listener.OnCollectCheckedChangeListener; | ||
| 30 | -import com.people.common.util.GrayManager; | ||
| 31 | -import com.people.common.util.PDUtils; | ||
| 32 | -import com.people.common.viewclick.OnMoreClickListener; | ||
| 33 | -import com.people.common.widget.AnimationView; | ||
| 34 | -import com.people.component.R; | ||
| 35 | -import com.people.component.comp.layoutdata.AbsSection; | ||
| 36 | -import com.people.component.comp.layoutmanager.adapter.CompCommonListAdapter; | ||
| 37 | -import com.people.component.utils.CompentLogicUtil; | ||
| 38 | -import com.people.daily.lib_library.CommonUtil; | ||
| 39 | -import com.people.entity.analytics.TrackContentBean; | ||
| 40 | -import com.people.entity.custom.comp.CompBean; | ||
| 41 | -import com.people.entity.custom.comp.ContainerItemBean; | ||
| 42 | -import com.people.entity.custom.content.ContentBean; | ||
| 43 | -import com.people.entity.custom.content.PeopleMasterBean; | ||
| 44 | -import com.people.entity.custom.item.ItemBean; | ||
| 45 | -import com.people.room.MailBookingLiveHelper; | ||
| 46 | -import com.people.room.MailMessageHelper; | ||
| 47 | -import com.people.toolset.SpUtils; | ||
| 48 | -import com.people.toolset.string.StrUtils; | ||
| 49 | -import com.view.text.view.TagTextView; | ||
| 50 | -import com.wondertek.wheat.ability.thread.ThreadPoolUtils; | ||
| 51 | -import com.wondertek.wheat.ability.tools.AppContext; | ||
| 52 | -import com.wondertek.wheat.ability.tools.StringUtils; | ||
| 53 | - | 23 | +import com.wd.capability.layout.R; |
| 24 | +import com.wd.capability.layout.comp.layoutdata.AbsSection; | ||
| 25 | +import com.wd.capability.layout.comp.layoutmanager.adapter.CompCommonListAdapter; | ||
| 26 | +import com.wd.foundation.bean.analytics.TrackContentBean; | ||
| 27 | +import com.wd.foundation.bean.custom.comp.CompBean; | ||
| 28 | +import com.wd.foundation.bean.custom.comp.ContainerItemBean; | ||
| 29 | +import com.wd.foundation.bean.custom.content.ContentBean; | ||
| 30 | +import com.wd.foundation.bean.custom.content.PeopleMasterBean; | ||
| 31 | +import com.wd.foundation.bean.custom.item.ItemBean; | ||
| 32 | +import com.wd.foundation.wdkitcore.thread.ThreadPoolUtils; | ||
| 33 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 34 | +import com.wd.foundation.wdkitcore.tools.SpUtils; | ||
| 35 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 54 | 36 | ||
| 55 | public abstract class ItemLayoutManager<T extends ItemBean> { | 37 | public abstract class ItemLayoutManager<T extends ItemBean> { |
| 56 | 38 | ||
| @@ -79,7 +61,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -79,7 +61,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 79 | */ | 61 | */ |
| 80 | private String likeStatus = "0"; | 62 | private String likeStatus = "0"; |
| 81 | 63 | ||
| 82 | - | ||
| 83 | // 组件内每页最大数量 | 64 | // 组件内每页最大数量 |
| 84 | protected final int maxCount = 20; | 65 | protected final int maxCount = 20; |
| 85 | 66 | ||
| @@ -100,7 +81,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -100,7 +81,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 100 | */ | 81 | */ |
| 101 | public abstract int getItemSpan(); | 82 | public abstract int getItemSpan(); |
| 102 | 83 | ||
| 103 | - | ||
| 104 | public void setSection(AbsSection section) { | 84 | public void setSection(AbsSection section) { |
| 105 | this.section = section; | 85 | this.section = section; |
| 106 | } | 86 | } |
| @@ -109,7 +89,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -109,7 +89,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 109 | return section; | 89 | return section; |
| 110 | } | 90 | } |
| 111 | 91 | ||
| 112 | - | ||
| 113 | public void setItemIndex(ItemIndex itemIndex) { | 92 | public void setItemIndex(ItemIndex itemIndex) { |
| 114 | this.index = itemIndex; | 93 | this.index = itemIndex; |
| 115 | } | 94 | } |
| @@ -151,14 +130,14 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -151,14 +130,14 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 151 | int keyWordsLength = keyWords.length(); | 130 | int keyWordsLength = keyWords.length(); |
| 152 | for (int i = 0; i < title.length(); i++) { | 131 | for (int i = 0; i < title.length(); i++) { |
| 153 | if (title.regionMatches(true, i, keyWords, 0, keyWordsLength)) { | 132 | if (title.regionMatches(true, i, keyWords, 0, keyWordsLength)) { |
| 154 | - result.setSpan(new ForegroundColorSpan(ContextCompat.getColor(tv_title.getContext(), R.color.color_B71D26)), | ||
| 155 | - i, i + keyWordsLength, SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE); | 133 | + result.setSpan( |
| 134 | + new ForegroundColorSpan(ContextCompat.getColor(tv_title.getContext(), R.color.color_B71D26)), i, | ||
| 135 | + i + keyWordsLength, SpannableStringBuilder.SPAN_INCLUSIVE_INCLUSIVE); | ||
| 156 | } | 136 | } |
| 157 | } | 137 | } |
| 158 | tv_title.setText(result); | 138 | tv_title.setText(result); |
| 159 | } | 139 | } |
| 160 | 140 | ||
| 161 | - | ||
| 162 | /** | 141 | /** |
| 163 | * 装载数据 | 142 | * 装载数据 |
| 164 | * | 143 | * |
| @@ -196,7 +175,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -196,7 +175,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 196 | public void onInvisible() { | 175 | public void onInvisible() { |
| 197 | } | 176 | } |
| 198 | 177 | ||
| 199 | - | ||
| 200 | public void onCreateViewHolder(BaseAdapter adapter, View itemView) { | 178 | public void onCreateViewHolder(BaseAdapter adapter, View itemView) { |
| 201 | 179 | ||
| 202 | } | 180 | } |
| @@ -243,26 +221,25 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -243,26 +221,25 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 243 | } | 221 | } |
| 244 | 222 | ||
| 245 | if (isPersonalHomePage(bean, position, ivMore)) { | 223 | if (isPersonalHomePage(bean, position, ivMore)) { |
| 246 | - //号主页 统一隐藏关注按钮 | 224 | + // 号主页 统一隐藏关注按钮 |
| 247 | attentionLay.setVisibility(View.GONE); | 225 | attentionLay.setVisibility(View.GONE); |
| 248 | } else { | 226 | } else { |
| 249 | - //非号主页 统一隐藏更多按钮 | 227 | + // 非号主页 统一隐藏更多按钮 |
| 250 | ivMore.setVisibility(View.GONE); | 228 | ivMore.setVisibility(View.GONE); |
| 251 | } | 229 | } |
| 252 | } | 230 | } |
| 253 | 231 | ||
| 254 | - | ||
| 255 | /** | 232 | /** |
| 256 | * 是否是号主页 | 233 | * 是否是号主页 |
| 257 | */ | 234 | */ |
| 258 | private boolean isPersonalHomePage(ContentBean bean, int position, ImageView ivMore) { | 235 | private boolean isPersonalHomePage(ContentBean bean, int position, ImageView ivMore) { |
| 259 | String fromPage = StrUtils.getStringValue(bean.getFromPage()); | 236 | String fromPage = StrUtils.getStringValue(bean.getFromPage()); |
| 260 | if (PageNameConstants.MAIN_PERSONAL_HOME_PAGE.equals(fromPage)) { | 237 | if (PageNameConstants.MAIN_PERSONAL_HOME_PAGE.equals(fromPage)) { |
| 261 | - //主态号主页 | 238 | + // 主态号主页 |
| 262 | if (bean.isShowMoreButton()) { | 239 | if (bean.isShowMoreButton()) { |
| 263 | bean.position = position; | 240 | bean.position = position; |
| 264 | ivMore.setVisibility(View.VISIBLE); | 241 | ivMore.setVisibility(View.VISIBLE); |
| 265 | - //扩大View的触摸和点击响应范围 | 242 | + // 扩大View的触摸和点击响应范围 |
| 266 | CommonUtil.expandViewTouchDelegate(ivMore, 50); | 243 | CommonUtil.expandViewTouchDelegate(ivMore, 50); |
| 267 | ivMore.setOnClickListener(new View.OnClickListener() { | 244 | ivMore.setOnClickListener(new View.OnClickListener() { |
| 268 | @Override | 245 | @Override |
| @@ -275,7 +252,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -275,7 +252,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 275 | } | 252 | } |
| 276 | return true; | 253 | return true; |
| 277 | } else if (PageNameConstants.CUSTOMER_PERSONAL_HOME_PAGE.equals(fromPage)) { | 254 | } else if (PageNameConstants.CUSTOMER_PERSONAL_HOME_PAGE.equals(fromPage)) { |
| 278 | - //客态号主页 | 255 | + // 客态号主页 |
| 279 | ivMore.setVisibility(View.GONE); | 256 | ivMore.setVisibility(View.GONE); |
| 280 | return true; | 257 | return true; |
| 281 | } | 258 | } |
| @@ -291,7 +268,8 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -291,7 +268,8 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 291 | public boolean isCollectPage(ContentBean contentBean) { | 268 | public boolean isCollectPage(ContentBean contentBean) { |
| 292 | if (contentBean != null) { | 269 | if (contentBean != null) { |
| 293 | String fromPage = StrUtils.getStringValue(contentBean.getFromPage()); | 270 | String fromPage = StrUtils.getStringValue(contentBean.getFromPage()); |
| 294 | - if (PageNameConstants.MY_COLLECT_PAGE.equals(fromPage) || PageNameConstants.MY_HISTORY_PAGE.equals(fromPage)) { | 271 | + if (PageNameConstants.MY_COLLECT_PAGE.equals(fromPage) |
| 272 | + || PageNameConstants.MY_HISTORY_PAGE.equals(fromPage)) { | ||
| 295 | return true; | 273 | return true; |
| 296 | } | 274 | } |
| 297 | } | 275 | } |
| @@ -302,11 +280,11 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -302,11 +280,11 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 302 | * 更新已读状态 | 280 | * 更新已读状态 |
| 303 | */ | 281 | */ |
| 304 | public void updateReadState(TextView tvTitle, ContainerItemBean data) { | 282 | public void updateReadState(TextView tvTitle, ContainerItemBean data) { |
| 305 | - //未读 | 283 | + // 未读 |
| 306 | if ("2".equals(data.getLocalFiledReadState())) { | 284 | if ("2".equals(data.getLocalFiledReadState())) { |
| 307 | data.setLocalFiledReadState("1"); | 285 | data.setLocalFiledReadState("1"); |
| 308 | if (tvTitle != null) { | 286 | if (tvTitle != null) { |
| 309 | - //设置已读、更新已读状态 | 287 | + // 设置已读、更新已读状态 |
| 310 | tvTitle.setTextColor(ContextCompat.getColor(tvTitle.getContext(), R.color.res_color_common_C3)); | 288 | tvTitle.setTextColor(ContextCompat.getColor(tvTitle.getContext(), R.color.res_color_common_C3)); |
| 311 | } | 289 | } |
| 312 | ThreadPoolUtils.submit(new Runnable() { | 290 | ThreadPoolUtils.submit(new Runnable() { |
| @@ -320,14 +298,15 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -320,14 +298,15 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 320 | 298 | ||
| 321 | public void updateReadState(ContainerItemBean data) { | 299 | public void updateReadState(ContainerItemBean data) { |
| 322 | if ("0".equals(data.getLocalFiledType())) { | 300 | if ("0".equals(data.getLocalFiledType())) { |
| 323 | - //0站内信-预约直播类型 | 301 | + // 0站内信-预约直播类型 |
| 324 | String userId = SpUtils.getUserId(); | 302 | String userId = SpUtils.getUserId(); |
| 325 | if (TextUtils.isEmpty(userId)) { | 303 | if (TextUtils.isEmpty(userId)) { |
| 326 | return; | 304 | return; |
| 327 | } | 305 | } |
| 328 | - MailBookingLiveHelper.getInstance(AppContext.getContext()).updateReadStateByKey(data.getLocalFiledIdType(), userId); | 306 | + MailBookingLiveHelper.getInstance(AppContext.getContext()) |
| 307 | + .updateReadStateByKey(data.getLocalFiledIdType(), userId); | ||
| 329 | } else if ("1".equals(data.getLocalFiledType())) { | 308 | } else if ("1".equals(data.getLocalFiledType())) { |
| 330 | - //1站内信-推送消息记录类型 | 309 | + // 1站内信-推送消息记录类型 |
| 331 | MailMessageHelper.getInstance(AppContext.getContext()).updateReadStateByKey(data.getLocalFiledIdType()); | 310 | MailMessageHelper.getInstance(AppContext.getContext()).updateReadStateByKey(data.getLocalFiledIdType()); |
| 332 | } | 311 | } |
| 333 | } | 312 | } |
| @@ -373,10 +352,10 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -373,10 +352,10 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 373 | trackContentBean.exporeOrClick(isClick); | 352 | trackContentBean.exporeOrClick(isClick); |
| 374 | if (isClick) { | 353 | if (isClick) { |
| 375 | if ("0".equals(type)) { | 354 | if ("0".equals(type)) { |
| 376 | - //站内信-预约直播列表子项点击 | 355 | + // 站内信-预约直播列表子项点击 |
| 377 | CommonTrack.getInstance().liveSubscribeNoticeClickTrack(trackContentBean); | 356 | CommonTrack.getInstance().liveSubscribeNoticeClickTrack(trackContentBean); |
| 378 | } else if ("1".equals(type)) { | 357 | } else if ("1".equals(type)) { |
| 379 | - //站内信-推送消息列表子项点击 | 358 | + // 站内信-推送消息列表子项点击 |
| 380 | CommonTrack.getInstance().followAuthorNoticeClickTrack(trackContentBean); | 359 | CommonTrack.getInstance().followAuthorNoticeClickTrack(trackContentBean); |
| 381 | } else { | 360 | } else { |
| 382 | CommonTrack.getInstance().contentClickTrack(trackContentBean); | 361 | CommonTrack.getInstance().contentClickTrack(trackContentBean); |
| @@ -427,13 +406,12 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -427,13 +406,12 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 427 | */ | 406 | */ |
| 428 | private void trackCommentClickContent(ContentBean contentBean, int position) { | 407 | private void trackCommentClickContent(ContentBean contentBean, int position) { |
| 429 | // 点击埋点 | 408 | // 点击埋点 |
| 430 | -// TrackContentBean trackContentBean = new TrackContentBean(); | ||
| 431 | -// trackContentBean.contentBeantoBean(contentBean, section == null ? null : section.getCompBean()); | ||
| 432 | -// trackContentBean.commentAction(); | ||
| 433 | -// CommonTrack.getInstance().contentCommentTrack(trackContentBean); | 409 | + // TrackContentBean trackContentBean = new TrackContentBean(); |
| 410 | + // trackContentBean.contentBeantoBean(contentBean, section == null ? null : section.getCompBean()); | ||
| 411 | + // trackContentBean.commentAction(); | ||
| 412 | + // CommonTrack.getInstance().contentCommentTrack(trackContentBean); | ||
| 434 | } | 413 | } |
| 435 | 414 | ||
| 436 | - | ||
| 437 | /** | 415 | /** |
| 438 | * 检测是否要开启国殇View && section.getCompBean().isPageGrayFlag() | 416 | * 检测是否要开启国殇View && section.getCompBean().isPageGrayFlag() |
| 439 | */ | 417 | */ |
| @@ -446,7 +424,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -446,7 +424,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 446 | itemView = view; | 424 | itemView = view; |
| 447 | } | 425 | } |
| 448 | 426 | ||
| 449 | - if(itemView != null){ | 427 | + if (itemView != null) { |
| 450 | if (GrayManager.getInstance().switchOpen && index < 8 && section.getCompBean().isPageGrayFlag()) { | 428 | if (GrayManager.getInstance().switchOpen && index < 8 && section.getCompBean().isPageGrayFlag()) { |
| 451 | GrayManager.getInstance().setLayerGrayType(itemView); | 429 | GrayManager.getInstance().setLayerGrayType(itemView); |
| 452 | } else { | 430 | } else { |
| @@ -470,7 +448,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -470,7 +448,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 470 | view.getLayoutParams().height = h; | 448 | view.getLayoutParams().height = h; |
| 471 | } | 449 | } |
| 472 | 450 | ||
| 473 | - | ||
| 474 | /** | 451 | /** |
| 475 | * 初始化历史记录复选框 | 452 | * 初始化历史记录复选框 |
| 476 | */ | 453 | */ |
| @@ -542,7 +519,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -542,7 +519,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 542 | 519 | ||
| 543 | boolean followStatus = true; | 520 | boolean followStatus = true; |
| 544 | 521 | ||
| 545 | - | ||
| 546 | /** | 522 | /** |
| 547 | * 查看是否关注 | 523 | * 查看是否关注 |
| 548 | */ | 524 | */ |
| @@ -557,7 +533,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -557,7 +533,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 557 | 533 | ||
| 558 | // 默认显示关注入口 | 534 | // 默认显示关注入口 |
| 559 | if (contentBean.isOpenFollowBt()) { | 535 | if (contentBean.isOpenFollowBt()) { |
| 560 | - //当用登录用户是人民号,且是自己发布的直播,不需要显示关注 | 536 | + // 当用登录用户是人民号,且是自己发布的直播,不需要显示关注 |
| 561 | boolean isMasterSelf = false; | 537 | boolean isMasterSelf = false; |
| 562 | if (bean != null) { | 538 | if (bean != null) { |
| 563 | String masUserId = bean.getUserId(); | 539 | String masUserId = bean.getUserId(); |
| @@ -581,8 +557,9 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -581,8 +557,9 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 581 | if (section != null) { | 557 | if (section != null) { |
| 582 | pageId = section.getCompBean().getCompInforPageId(); | 558 | pageId = section.getCompBean().getCompInforPageId(); |
| 583 | } | 559 | } |
| 584 | - CommonNetUtils.getInstance().operation(pageId, bean.getUserId(), bean.getUserType(), | ||
| 585 | - bean.getRmhId(), followStatus ? 0 : 1); | 560 | + CommonNetUtils.getInstance() |
| 561 | + .operation(pageId, bean.getUserId(), bean.getUserType(), bean.getRmhId(), | ||
| 562 | + followStatus ? 0 : 1); | ||
| 586 | 563 | ||
| 587 | trackFollowClickContent(!followStatus, contentBean, 0); | 564 | trackFollowClickContent(!followStatus, contentBean, 0); |
| 588 | } | 565 | } |
| @@ -596,10 +573,8 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -596,10 +573,8 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 596 | attentionLay.setVisibility(View.GONE); | 573 | attentionLay.setVisibility(View.GONE); |
| 597 | } | 574 | } |
| 598 | 575 | ||
| 599 | - | ||
| 600 | } | 576 | } |
| 601 | 577 | ||
| 602 | - | ||
| 603 | /** | 578 | /** |
| 604 | * 处理用户关注状态 | 579 | * 处理用户关注状态 |
| 605 | * | 580 | * |
| @@ -636,7 +611,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -636,7 +611,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 636 | } | 611 | } |
| 637 | } | 612 | } |
| 638 | 613 | ||
| 639 | - | ||
| 640 | /** | 614 | /** |
| 641 | * 人民号底部的评论点赞详情和点击事件 | 615 | * 人民号底部的评论点赞详情和点击事件 |
| 642 | * | 616 | * |
| @@ -647,16 +621,16 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -647,16 +621,16 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 647 | TextView shareBtn = bottomView.findViewById(R.id.share_btn); | 621 | TextView shareBtn = bottomView.findViewById(R.id.share_btn); |
| 648 | TagTextView commentLay = bottomView.findViewById(R.id.ttcomment_btn); | 622 | TagTextView commentLay = bottomView.findViewById(R.id.ttcomment_btn); |
| 649 | LinearLayout praiseLay = bottomView.findViewById(R.id.praise_lay); | 623 | LinearLayout praiseLay = bottomView.findViewById(R.id.praise_lay); |
| 650 | - //TextView praiseBtnTv = bottomView.findViewById(R.id.praise_btn); | 624 | + // TextView praiseBtnTv = bottomView.findViewById(R.id.praise_btn); |
| 651 | praiseBtn = bottomView.findViewById(R.id.praise_img); | 625 | praiseBtn = bottomView.findViewById(R.id.praise_img); |
| 652 | 626 | ||
| 653 | // 评论处理 | 627 | // 评论处理 |
| 654 | -// if (!TextUtils.isEmpty(contentBean.commentNum) && !"0".equals(contentBean.commentNum)) { | ||
| 655 | -// commentBtn.setText(NumberStrUtils.Companion.getINSTANCE().handlerNumber(contentBean.commentNum)); | ||
| 656 | -// } else { | ||
| 657 | -// commentBtn.setText(R.string.comp_bottom_comment_txt); | ||
| 658 | -// } | ||
| 659 | - //点赞数量 | 628 | + // if (!TextUtils.isEmpty(contentBean.commentNum) && !"0".equals(contentBean.commentNum)) { |
| 629 | + // commentBtn.setText(NumberStrUtils.Companion.getINSTANCE().handlerNumber(contentBean.commentNum)); | ||
| 630 | + // } else { | ||
| 631 | + // commentBtn.setText(R.string.comp_bottom_comment_txt); | ||
| 632 | + // } | ||
| 633 | + // 点赞数量 | ||
| 660 | handlerLikeNum(); | 634 | handlerLikeNum(); |
| 661 | // 点赞处理 | 635 | // 点赞处理 |
| 662 | if (!StringUtils.isEmpty(contentBean.getLikeStatus())) { | 636 | if (!StringUtils.isEmpty(contentBean.getLikeStatus())) { |
| @@ -671,7 +645,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -671,7 +645,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 671 | if (contentBean.getRmhInfo() == null) { | 645 | if (contentBean.getRmhInfo() == null) { |
| 672 | return; | 646 | return; |
| 673 | } | 647 | } |
| 674 | - //分享按钮控制 | 648 | + // 分享按钮控制 |
| 675 | if (contentBean.getShareInfo() != null && "1".equals(contentBean.getShareInfo().getShareOpen())) { | 649 | if (contentBean.getShareInfo() != null && "1".equals(contentBean.getShareInfo().getShareOpen())) { |
| 676 | shareBtn.setVisibility(View.VISIBLE); | 650 | shareBtn.setVisibility(View.VISIBLE); |
| 677 | shareBtn.setOnClickListener(new View.OnClickListener() { | 651 | shareBtn.setOnClickListener(new View.OnClickListener() { |
| @@ -718,7 +692,8 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -718,7 +692,8 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 718 | 692 | ||
| 719 | } | 693 | } |
| 720 | 694 | ||
| 721 | - if (shareBtn.getVisibility() == View.GONE && commentLay.getVisibility() == View.GONE && praiseLay.getVisibility() == View.GONE) { | 695 | + if (shareBtn.getVisibility() == View.GONE && commentLay.getVisibility() == View.GONE |
| 696 | + && praiseLay.getVisibility() == View.GONE) { | ||
| 722 | RelativeLayout.LayoutParams layoutParams1 = (RelativeLayout.LayoutParams) bottomView.getLayoutParams(); | 697 | RelativeLayout.LayoutParams layoutParams1 = (RelativeLayout.LayoutParams) bottomView.getLayoutParams(); |
| 723 | layoutParams1.bottomMargin = 0; | 698 | layoutParams1.bottomMargin = 0; |
| 724 | bottomView.setLayoutParams(layoutParams1); | 699 | bottomView.setLayoutParams(layoutParams1); |
| @@ -728,10 +703,8 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -728,10 +703,8 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 728 | bottomView.setLayoutParams(layoutParams1); | 703 | bottomView.setLayoutParams(layoutParams1); |
| 729 | } | 704 | } |
| 730 | 705 | ||
| 731 | - | ||
| 732 | } | 706 | } |
| 733 | 707 | ||
| 734 | - | ||
| 735 | /** | 708 | /** |
| 736 | * 点赞、取消点赞 | 709 | * 点赞、取消点赞 |
| 737 | * | 710 | * |
| @@ -764,10 +737,11 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -764,10 +737,11 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 764 | // ToastNightUtil.showShort(showTip); | 737 | // ToastNightUtil.showShort(showTip); |
| 765 | // 发送点赞、取消点赞事件 | 738 | // 发送点赞、取消点赞事件 |
| 766 | UserLikeFetcher fetcher = new UserLikeFetcher(); | 739 | UserLikeFetcher fetcher = new UserLikeFetcher(); |
| 767 | - String channelId = contentBean.getChannelInfoBean() != null ? contentBean.getChannelInfoBean().getChannelId() : ""; | 740 | + String channelId = |
| 741 | + contentBean.getChannelInfoBean() != null ? contentBean.getChannelInfoBean().getChannelId() : ""; | ||
| 768 | fetcher.contentExecuteLike(contentBean.getObjectId(), contentBean.getObjectType(), | 742 | fetcher.contentExecuteLike(contentBean.getObjectId(), contentBean.getObjectType(), |
| 769 | - contentBean.getContentRelId(), String.valueOf(contentBean.getRelType()), likeStatus, contentBean.getNewsTitle(), channelId); | ||
| 770 | - | 743 | + contentBean.getContentRelId(), String.valueOf(contentBean.getRelType()), likeStatus, |
| 744 | + contentBean.getNewsTitle(), channelId); | ||
| 771 | 745 | ||
| 772 | } | 746 | } |
| 773 | 747 | ||
| @@ -778,7 +752,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -778,7 +752,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 778 | * @param imageView | 752 | * @param imageView |
| 779 | */ | 753 | */ |
| 780 | private void likeIcon(boolean isCollect, AnimationView imageView) { | 754 | private void likeIcon(boolean isCollect, AnimationView imageView) { |
| 781 | - if (imageView != null){ | 755 | + if (imageView != null) { |
| 782 | imageView.setSelected(isCollect); | 756 | imageView.setSelected(isCollect); |
| 783 | } | 757 | } |
| 784 | } | 758 | } |
| @@ -855,7 +829,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -855,7 +829,6 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 855 | */ | 829 | */ |
| 856 | public void updateUserFollow(String createId, boolean followStatusFlag) { | 830 | public void updateUserFollow(String createId, boolean followStatusFlag) { |
| 857 | 831 | ||
| 858 | - | ||
| 859 | if (contentBean != null && contentBean.getRmhInfo() != null && !TextUtils.isEmpty(createId)) { | 832 | if (contentBean != null && contentBean.getRmhInfo() != null && !TextUtils.isEmpty(createId)) { |
| 860 | PeopleMasterBean rmhInfo = contentBean.getRmhInfo(); | 833 | PeopleMasterBean rmhInfo = contentBean.getRmhInfo(); |
| 861 | if (createId.equals(rmhInfo.getRmhId())) { | 834 | if (createId.equals(rmhInfo.getRmhId())) { |
| @@ -884,7 +857,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -884,7 +857,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 884 | if (contentBean != null && contentBean.getRmhInfo() != null) { | 857 | if (contentBean != null && contentBean.getRmhInfo() != null) { |
| 885 | 858 | ||
| 886 | if (contentBean.getObjectId().equals(contentId)) { | 859 | if (contentBean.getObjectId().equals(contentId)) { |
| 887 | - //&& contentBean.getContentRelId().equals(relId) | 860 | + // && contentBean.getContentRelId().equals(relId) |
| 888 | if (isZan) { | 861 | if (isZan) { |
| 889 | contentBean.setLikeStatus("1"); | 862 | contentBean.setLikeStatus("1"); |
| 890 | } else { | 863 | } else { |
| @@ -919,13 +892,13 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -919,13 +892,13 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 919 | * 依据点赞数量展示 | 892 | * 依据点赞数量展示 |
| 920 | */ | 893 | */ |
| 921 | private void handlerLikeNum() { | 894 | private void handlerLikeNum() { |
| 922 | - //点赞数量 | ||
| 923 | -// if (contentBean.likeNum > 0) { | ||
| 924 | -// praiseBtnTv.setText(NumberStrUtils.Companion.getINSTANCE().handlerNumber(contentBean.likeNum + "")); | ||
| 925 | -// } else { | ||
| 926 | -// praiseBtnTv.setText(R.string.comp_bottom_praise_txt); | ||
| 927 | -// contentBean.likeNum = 0; | ||
| 928 | -// } | 895 | + // 点赞数量 |
| 896 | + // if (contentBean.likeNum > 0) { | ||
| 897 | + // praiseBtnTv.setText(NumberStrUtils.Companion.getINSTANCE().handlerNumber(contentBean.likeNum + "")); | ||
| 898 | + // } else { | ||
| 899 | + // praiseBtnTv.setText(R.string.comp_bottom_praise_txt); | ||
| 900 | + // contentBean.likeNum = 0; | ||
| 901 | + // } | ||
| 929 | } | 902 | } |
| 930 | 903 | ||
| 931 | /** | 904 | /** |
| @@ -934,7 +907,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | @@ -934,7 +907,7 @@ public abstract class ItemLayoutManager<T extends ItemBean> { | ||
| 934 | public void updateData(int position) { | 907 | public void updateData(int position) { |
| 935 | 908 | ||
| 936 | if (llFromm != null && contentBean != null) { | 909 | if (llFromm != null && contentBean != null) { |
| 937 | - //if (contentBean.isExposure()) { | 910 | + // if (contentBean.isExposure()) { |
| 938 | if (llFromm.getVisibility() != View.GONE) { | 911 | if (llFromm.getVisibility() != View.GONE) { |
| 939 | // 处理频道和发布日期 | 912 | // 处理频道和发布日期 |
| 940 | CompentLogicUtil.handlerFromDataInfor(llFromm, contentBean); | 913 | CompentLogicUtil.handlerFromDataInfor(llFromm, contentBean); |
| @@ -6,7 +6,7 @@ package com.wd.capability.layout.comp.layoutmanager; | @@ -6,7 +6,7 @@ package com.wd.capability.layout.comp.layoutmanager; | ||
| 6 | 6 | ||
| 7 | import androidx.recyclerview.widget.RecyclerView; | 7 | import androidx.recyclerview.widget.RecyclerView; |
| 8 | 8 | ||
| 9 | -import com.people.entity.custom.item.ItemBean; | 9 | +import com.wd.foundation.bean.custom.item.ItemBean; |
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * 节目tab样式(专题页面tab样式)<BR> | 12 | * 节目tab样式(专题页面tab样式)<BR> |
| @@ -12,11 +12,11 @@ import android.view.View; | @@ -12,11 +12,11 @@ import android.view.View; | ||
| 12 | 12 | ||
| 13 | import androidx.annotation.NonNull; | 13 | import androidx.annotation.NonNull; |
| 14 | 14 | ||
| 15 | -import com.people.component.comp.layoutdata.AbsPage; | ||
| 16 | -import com.people.component.comp.layoutdata.AbsSection; | ||
| 17 | -import com.people.component.comp.layoutdata.Page; | ||
| 18 | -import com.people.entity.custom.BaseLineBean; | ||
| 19 | -import com.people.entity.custom.comp.PageBean; | 15 | +import com.wd.capability.layout.comp.layoutdata.AbsPage; |
| 16 | +import com.wd.capability.layout.comp.layoutdata.AbsSection; | ||
| 17 | +import com.wd.capability.layout.comp.layoutdata.Page; | ||
| 18 | +import com.wd.foundation.bean.custom.BaseLineBean; | ||
| 19 | +import com.wd.foundation.bean.custom.comp.PageBean; | ||
| 20 | 20 | ||
| 21 | public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayoutManagerScrollListener { | 21 | public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayoutManagerScrollListener { |
| 22 | 22 | ||
| @@ -40,12 +40,12 @@ public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayout | @@ -40,12 +40,12 @@ public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayout | ||
| 40 | public void itemRangeRemoved(int startIndex, int count) { | 40 | public void itemRangeRemoved(int startIndex, int count) { |
| 41 | List<ItemLayoutManager> itemLayoutManagers = indexer.getItemLayoutManagers(); | 41 | List<ItemLayoutManager> itemLayoutManagers = indexer.getItemLayoutManagers(); |
| 42 | List<ItemLayoutManager> list = new ArrayList<>(); | 42 | List<ItemLayoutManager> list = new ArrayList<>(); |
| 43 | - for(int i = 0 ; i < count ; i++){ | 43 | + for (int i = 0; i < count; i++) { |
| 44 | int position = startIndex + i; | 44 | int position = startIndex + i; |
| 45 | list.add(itemLayoutManagers.get(position)); | 45 | list.add(itemLayoutManagers.get(position)); |
| 46 | } | 46 | } |
| 47 | itemLayoutManagers.removeAll(list); | 47 | itemLayoutManagers.removeAll(list); |
| 48 | - notifyItemRangeRemoved(startIndex,count); | 48 | + notifyItemRangeRemoved(startIndex, count); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | @Override | 51 | @Override |
| @@ -85,10 +85,10 @@ public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayout | @@ -85,10 +85,10 @@ public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayout | ||
| 85 | @Override | 85 | @Override |
| 86 | public void renderPage(AbsPage page, boolean isRefresh) { | 86 | public void renderPage(AbsPage page, boolean isRefresh) { |
| 87 | 87 | ||
| 88 | - if(isRefresh){ | 88 | + if (isRefresh) { |
| 89 | indexer.updateItemLayoutManagers(page); | 89 | indexer.updateItemLayoutManagers(page); |
| 90 | - }else { | ||
| 91 | - indexer.updateItemLayoutManagersByGroup(page,isRefresh); | 90 | + } else { |
| 91 | + indexer.updateItemLayoutManagersByGroup(page, isRefresh); | ||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | } | 94 | } |
| @@ -213,8 +213,6 @@ public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayout | @@ -213,8 +213,6 @@ public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayout | ||
| 213 | } | 213 | } |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | - | ||
| 217 | - | ||
| 218 | /** | 216 | /** |
| 219 | * item滑出屏幕 | 217 | * item滑出屏幕 |
| 220 | * | 218 | * |
| @@ -234,7 +232,6 @@ public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayout | @@ -234,7 +232,6 @@ public class LayoutAdapter extends BaseAdapter implements ILayoutRender, ILayout | ||
| 234 | this.layoutManagerScrollListener = layoutManagerScrollListener; | 232 | this.layoutManagerScrollListener = layoutManagerScrollListener; |
| 235 | } | 233 | } |
| 236 | 234 | ||
| 237 | - | ||
| 238 | @Override | 235 | @Override |
| 239 | public void onScrolled(View view, int dx, int dy) { | 236 | public void onScrolled(View view, int dx, int dy) { |
| 240 | if (null != layoutManagerScrollListener) { | 237 | if (null != layoutManagerScrollListener) { |
| @@ -7,11 +7,10 @@ package com.wd.capability.layout.comp.layoutmanager.channel; | @@ -7,11 +7,10 @@ package com.wd.capability.layout.comp.layoutmanager.channel; | ||
| 7 | import android.view.View; | 7 | import android.view.View; |
| 8 | import android.widget.TextView; | 8 | import android.widget.TextView; |
| 9 | 9 | ||
| 10 | -import com.people.common.TextViewUtils; | ||
| 11 | -import com.people.component.R; | ||
| 12 | -import com.people.component.comp.layoutmanager.ItemLayoutManager; | ||
| 13 | -import com.people.entity.custom.BaseLineBean; | ||
| 14 | -import com.wondertek.wheat.ability.tools.ResUtils; | 10 | +import com.wd.capability.layout.R; |
| 11 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 12 | +import com.wd.foundation.bean.custom.BaseLineBean; | ||
| 13 | +import com.wd.foundation.wdkitcore.tools.ResUtils; | ||
| 15 | 14 | ||
| 16 | /** | 15 | /** |
| 17 | * 底线样式(page接口返回的数据,不同于其他样式) | 16 | * 底线样式(page接口返回的数据,不同于其他样式) |
| 1 | + | ||
| 1 | package com.wd.capability.layout.comp.layoutmanager.channel; | 2 | package com.wd.capability.layout.comp.layoutmanager.channel; |
| 2 | 3 | ||
| 3 | import android.annotation.SuppressLint; | 4 | import android.annotation.SuppressLint; |
| @@ -6,15 +7,11 @@ import android.view.ViewGroup; | @@ -6,15 +7,11 @@ import android.view.ViewGroup; | ||
| 6 | import android.widget.ImageView; | 7 | import android.widget.ImageView; |
| 7 | import android.widget.TextView; | 8 | import android.widget.TextView; |
| 8 | 9 | ||
| 9 | -import com.people.common.ProcessUtils; | ||
| 10 | -import com.people.common.viewclick.BaseClickListener; | ||
| 11 | -import com.people.component.R; | ||
| 12 | -import com.people.component.comp.layoutmanager.ItemLayoutManager; | ||
| 13 | -import com.people.component.utils.CompentLogicUtil; | ||
| 14 | -import com.people.daily.lib_library.TimeUtil; | ||
| 15 | -import com.people.entity.custom.NavigationBeanNews; | ||
| 16 | -import com.people.entity.custom.act.BaseActivityBean; | ||
| 17 | -import com.people.toolset.imageglide.ImageUtils; | 10 | +import com.wd.capability.layout.R; |
| 11 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 12 | +import com.wd.foundation.bean.custom.NavigationBeanNews; | ||
| 13 | +import com.wd.foundation.bean.custom.act.BaseActivityBean; | ||
| 14 | +import com.wd.foundation.wdkit.viewclick.BaseClickListener; | ||
| 18 | 15 | ||
| 19 | /** | 16 | /** |
| 20 | * @Description: 活动卡 | 17 | * @Description: 活动卡 |
| @@ -26,14 +23,12 @@ import com.people.toolset.imageglide.ImageUtils; | @@ -26,14 +23,12 @@ import com.people.toolset.imageglide.ImageUtils; | ||
| 26 | */ | 23 | */ |
| 27 | public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | 24 | public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { |
| 28 | 25 | ||
| 29 | - | ||
| 30 | private ImageView imageView; | 26 | private ImageView imageView; |
| 31 | 27 | ||
| 32 | private TextView tvTitle, tvData, tvLookDetail; | 28 | private TextView tvTitle, tvData, tvLookDetail; |
| 33 | 29 | ||
| 34 | private View viewTag; | 30 | private View viewTag; |
| 35 | 31 | ||
| 36 | - | ||
| 37 | @Override | 32 | @Override |
| 38 | public int getItemViewType() { | 33 | public int getItemViewType() { |
| 39 | return R.layout.comp_activity_01; | 34 | return R.layout.comp_activity_01; |
| @@ -55,15 +50,15 @@ public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | @@ -55,15 +50,15 @@ public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | ||
| 55 | tvLookDetail = itemView.findViewById(R.id.tvLookDetail); | 50 | tvLookDetail = itemView.findViewById(R.id.tvLookDetail); |
| 56 | viewTag = itemView.findViewById(R.id.viewTag); | 51 | viewTag = itemView.findViewById(R.id.viewTag); |
| 57 | 52 | ||
| 58 | -// // 绘制图片 | ||
| 59 | -// int screenWith = DeviceUtil.getDeviceWidth(); | ||
| 60 | -// float imageW = (screenWith - AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp32)) / 3; | ||
| 61 | -// float imageH = imageW * 2 / 3; | ||
| 62 | -// | ||
| 63 | -// RelativeLayout.LayoutParams imageViewLp = (RelativeLayout.LayoutParams) imageView.getLayoutParams(); | ||
| 64 | -// imageViewLp.width = (int) imageW; | ||
| 65 | -// imageViewLp.height = (int) imageH; | ||
| 66 | -// imageView.setLayoutParams(imageViewLp); | 53 | + // // 绘制图片 |
| 54 | + // int screenWith = DeviceUtil.getDeviceWidth(); | ||
| 55 | + // float imageW = (screenWith - AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp32)) / 3; | ||
| 56 | + // float imageH = imageW * 2 / 3; | ||
| 57 | + // | ||
| 58 | + // RelativeLayout.LayoutParams imageViewLp = (RelativeLayout.LayoutParams) imageView.getLayoutParams(); | ||
| 59 | + // imageViewLp.width = (int) imageW; | ||
| 60 | + // imageViewLp.height = (int) imageH; | ||
| 61 | + // imageView.setLayoutParams(imageViewLp); | ||
| 67 | 62 | ||
| 68 | // 国殇 | 63 | // 国殇 |
| 69 | checkOpenGrayModel(itemView, position); | 64 | checkOpenGrayModel(itemView, position); |
| @@ -93,7 +88,8 @@ public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | @@ -93,7 +88,8 @@ public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | ||
| 93 | CompentLogicUtil.contentObjectTextMsg(tvLookDetail, contentBean); | 88 | CompentLogicUtil.contentObjectTextMsg(tvLookDetail, contentBean); |
| 94 | // 活动开始和结束日期 | 89 | // 活动开始和结束日期 |
| 95 | String commentTxt = tvData.getContext().getString(R.string.comp_activity_data); | 90 | String commentTxt = tvData.getContext().getString(R.string.comp_activity_data); |
| 96 | - tvData.setText(String.format(commentTxt, TimeUtil.transFormTime9(activityBean.getStartTime()), TimeUtil.transFormTime9(activityBean.getEndTime()))); | 91 | + tvData.setText(String.format(commentTxt, TimeUtil.transFormTime9(activityBean.getStartTime()), |
| 92 | + TimeUtil.transFormTime9(activityBean.getEndTime()))); | ||
| 97 | 93 | ||
| 98 | itemView.setOnClickListener(new BaseClickListener() { | 94 | itemView.setOnClickListener(new BaseClickListener() { |
| 99 | @Override | 95 | @Override |
| @@ -105,7 +101,6 @@ public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | @@ -105,7 +101,6 @@ public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | ||
| 105 | } | 101 | } |
| 106 | }); | 102 | }); |
| 107 | 103 | ||
| 108 | - | ||
| 109 | // 曝光埋点 | 104 | // 曝光埋点 |
| 110 | itemView.post(() -> | 105 | itemView.post(() -> |
| 111 | 106 | ||
| @@ -114,12 +109,10 @@ public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | @@ -114,12 +109,10 @@ public class CompActivity01 extends ItemLayoutManager<NavigationBeanNews> { | ||
| 114 | 109 | ||
| 115 | }); | 110 | }); |
| 116 | 111 | ||
| 117 | - | ||
| 118 | } else { | 112 | } else { |
| 119 | setLayoutManagerItemViewHeight(itemView, 0); | 113 | setLayoutManagerItemViewHeight(itemView, 0); |
| 120 | } | 114 | } |
| 121 | return position; | 115 | return position; |
| 122 | } | 116 | } |
| 123 | 117 | ||
| 124 | - | ||
| 125 | } | 118 | } |
| 1 | + | ||
| 1 | package com.wd.capability.layout.comp.layoutmanager.channel; | 2 | package com.wd.capability.layout.comp.layoutmanager.channel; |
| 2 | 3 | ||
| 3 | import java.util.List; | 4 | import java.util.List; |
| @@ -15,22 +16,14 @@ import androidx.appcompat.widget.LinearLayoutCompat; | @@ -15,22 +16,14 @@ import androidx.appcompat.widget.LinearLayoutCompat; | ||
| 15 | import androidx.recyclerview.widget.LinearLayoutManager; | 16 | import androidx.recyclerview.widget.LinearLayoutManager; |
| 16 | import androidx.recyclerview.widget.RecyclerView; | 17 | import androidx.recyclerview.widget.RecyclerView; |
| 17 | 18 | ||
| 18 | -import com.chad.library.adapter.base.BaseQuickAdapter; | ||
| 19 | -import com.chad.library.adapter.base.viewholder.BaseViewHolder; | ||
| 20 | -import com.people.common.ProcessUtils; | ||
| 21 | -import com.people.common.viewclick.BaseClickListener; | ||
| 22 | -import com.people.common.widget.RoundCornerImageView; | ||
| 23 | -import com.people.component.R; | ||
| 24 | -import com.people.component.comp.layoutmanager.ItemLayoutManager; | ||
| 25 | -import com.people.component.ui.widget.assist.SpeaceLineHDecoration; | ||
| 26 | -import com.people.entity.custom.comp.CompBean; | ||
| 27 | -import com.people.entity.custom.content.ContentBean; | ||
| 28 | -import com.people.entity.custom.label.CompAdv01Bean; | ||
| 29 | -import com.people.livedate.EventConstants; | ||
| 30 | -import com.people.livedate.base.LiveDataBus; | ||
| 31 | -import com.people.toolset.imageglide.ImageUtils; | ||
| 32 | -import com.people.toolset.system.DeviceUtil; | ||
| 33 | -import com.wondertek.wheat.ability.tools.AppContext; | 19 | +import com.wd.capability.layout.R; |
| 20 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 21 | +import com.wd.foundation.bean.custom.comp.CompBean; | ||
| 22 | +import com.wd.foundation.bean.custom.content.ContentBean; | ||
| 23 | +import com.wd.foundation.bean.custom.label.CompAdv01Bean; | ||
| 24 | +import com.wd.foundation.wdkit.viewclick.BaseClickListener; | ||
| 25 | +import com.wd.foundation.wdkitcore.livedata.LiveDataBus; | ||
| 26 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 34 | 27 | ||
| 35 | /** | 28 | /** |
| 36 | * 冠名广告 | 29 | * 冠名广告 |
| @@ -54,7 +47,6 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -54,7 +47,6 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 54 | 47 | ||
| 55 | private TextView tvMore; | 48 | private TextView tvMore; |
| 56 | 49 | ||
| 57 | - | ||
| 58 | @Override | 50 | @Override |
| 59 | public int getItemViewType() { | 51 | public int getItemViewType() { |
| 60 | return R.layout.comp_adv_guan_mi; | 52 | return R.layout.comp_adv_guan_mi; |
| @@ -78,21 +70,21 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -78,21 +70,21 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 78 | LinearLayout llContent = itemView.findViewById(R.id.llContent); | 70 | LinearLayout llContent = itemView.findViewById(R.id.llContent); |
| 79 | setHorizontalSlideMargin(position, llContent, bottomLine); | 71 | setHorizontalSlideMargin(position, llContent, bottomLine); |
| 80 | // 国殇 | 72 | // 国殇 |
| 81 | - checkOpenGrayModel(itemView,position); | 73 | + checkOpenGrayModel(itemView, position); |
| 82 | 74 | ||
| 83 | itemView.findViewById(R.id.flClose).setOnClickListener(new View.OnClickListener() { | 75 | itemView.findViewById(R.id.flClose).setOnClickListener(new View.OnClickListener() { |
| 84 | @Override | 76 | @Override |
| 85 | public void onClick(View v) { | 77 | public void onClick(View v) { |
| 86 | CompBean compBean = section.getCompBean(); | 78 | CompBean compBean = section.getCompBean(); |
| 87 | int hashCode = CompAdvGuanMI.this.hashCode(); | 79 | int hashCode = CompAdvGuanMI.this.hashCode(); |
| 88 | - LiveDataBus.getInstance().with(EventConstants.USER_COMP_MANUSCRIPT_DEL + compBean.getCompInforPageId()).postValue(hashCode); | 80 | + LiveDataBus.getInstance() |
| 81 | + .with(EventConstants.USER_COMP_MANUSCRIPT_DEL + compBean.getCompInforPageId()) | ||
| 82 | + .postValue(hashCode); | ||
| 89 | } | 83 | } |
| 90 | }); | 84 | }); |
| 91 | 85 | ||
| 92 | - | ||
| 93 | } | 86 | } |
| 94 | 87 | ||
| 95 | - | ||
| 96 | @Override | 88 | @Override |
| 97 | public int bindItem(View itemView, int position, CompAdv01Bean data) { | 89 | public int bindItem(View itemView, int position, CompAdv01Bean data) { |
| 98 | if (data == null) { | 90 | if (data == null) { |
| @@ -113,7 +105,7 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -113,7 +105,7 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 113 | String topImageUrl = data.topImageUrl; | 105 | String topImageUrl = data.topImageUrl; |
| 114 | 106 | ||
| 115 | itemView.findViewById(R.id.more_LLC).setOnClickListener(moreClick); | 107 | itemView.findViewById(R.id.more_LLC).setOnClickListener(moreClick); |
| 116 | - //imageView.setOnClickListener(moreClick); | 108 | + // imageView.setOnClickListener(moreClick); |
| 117 | 109 | ||
| 118 | // 头部广告图 | 110 | // 头部广告图 |
| 119 | int screenWith = DeviceUtil.getDeviceWidth(); | 111 | int screenWith = DeviceUtil.getDeviceWidth(); |
| @@ -127,7 +119,6 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -127,7 +119,6 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 127 | 119 | ||
| 128 | ImageUtils.getInstance().loadImageSourceByNetStatus(imageView, topImageUrl, R.drawable.shape_comp_default); | 120 | ImageUtils.getInstance().loadImageSourceByNetStatus(imageView, topImageUrl, R.drawable.shape_comp_default); |
| 129 | 121 | ||
| 130 | - | ||
| 131 | // 计算出最长标题 | 122 | // 计算出最长标题 |
| 132 | String maxTitleStr = data.maxTitleName; | 123 | String maxTitleStr = data.maxTitleName; |
| 133 | 124 | ||
| @@ -136,7 +127,7 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -136,7 +127,7 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 136 | contentRv.removeItemDecorationAt(0); | 127 | contentRv.removeItemDecorationAt(0); |
| 137 | } | 128 | } |
| 138 | /* | 129 | /* |
| 139 | - 数量=2,间距=12dp | 130 | + * 数量=2,间距=12dp |
| 140 | */ | 131 | */ |
| 141 | int interval = (int) AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp8); | 132 | int interval = (int) AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp8); |
| 142 | if (size == 2) { | 133 | if (size == 2) { |
| @@ -151,13 +142,11 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -151,13 +142,11 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 151 | if (position == 0) { | 142 | if (position == 0) { |
| 152 | rvR = (int) AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp10); | 143 | rvR = (int) AppContext.getContext().getResources().getDimension(R.dimen.rmrb_dp10); |
| 153 | } | 144 | } |
| 154 | - speaceLineHDecoration = new SpeaceLineHDecoration(contentRv.getContext(), | ||
| 155 | - interval, | ||
| 156 | - rvLr, | ||
| 157 | - rvR); | 145 | + speaceLineHDecoration = new SpeaceLineHDecoration(contentRv.getContext(), interval, rvLr, rvR); |
| 158 | contentRv.addItemDecoration(speaceLineHDecoration); | 146 | contentRv.addItemDecoration(speaceLineHDecoration); |
| 159 | 147 | ||
| 160 | - LinearLayoutManager layoutManager = new LinearLayoutManager(contentRv.getContext(), LinearLayoutManager.HORIZONTAL, false); | 148 | + LinearLayoutManager layoutManager = |
| 149 | + new LinearLayoutManager(contentRv.getContext(), LinearLayoutManager.HORIZONTAL, false); | ||
| 161 | contentRv.setLayoutManager(layoutManager); | 150 | contentRv.setLayoutManager(layoutManager); |
| 162 | 151 | ||
| 163 | contentAdapter = new ContentAdapter(size, maxTitleStr); | 152 | contentAdapter = new ContentAdapter(size, maxTitleStr); |
| @@ -170,11 +159,9 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -170,11 +159,9 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 170 | tvMore.setText(R.string.component_more); | 159 | tvMore.setText(R.string.component_more); |
| 171 | } | 160 | } |
| 172 | 161 | ||
| 173 | - | ||
| 174 | return position; | 162 | return position; |
| 175 | } | 163 | } |
| 176 | 164 | ||
| 177 | - | ||
| 178 | private View.OnClickListener moreClick = new View.OnClickListener() { | 165 | private View.OnClickListener moreClick = new View.OnClickListener() { |
| 179 | @Override | 166 | @Override |
| 180 | public void onClick(View v) { | 167 | public void onClick(View v) { |
| @@ -216,12 +203,11 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -216,12 +203,11 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 216 | } else { | 203 | } else { |
| 217 | imageWith = (int) (screenWith * 150f / 375f); | 204 | imageWith = (int) (screenWith * 150f / 375f); |
| 218 | } | 205 | } |
| 219 | - //按要求不做等比放大,按照设计图大小开发 | 206 | + // 按要求不做等比放大,按照设计图大小开发 |
| 220 | imageHeight = imageWith * 84f / 150f; | 207 | imageHeight = imageWith * 84f / 150f; |
| 221 | 208 | ||
| 222 | } | 209 | } |
| 223 | 210 | ||
| 224 | - | ||
| 225 | @Override | 211 | @Override |
| 226 | protected void convert(@NonNull BaseViewHolder baseViewHolder, ContentBean bean) { | 212 | protected void convert(@NonNull BaseViewHolder baseViewHolder, ContentBean bean) { |
| 227 | 213 | ||
| @@ -233,7 +219,8 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -233,7 +219,8 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 233 | TextView tvTitleTemp = baseViewHolder.itemView.findViewById(R.id.tvTitleTemp); | 219 | TextView tvTitleTemp = baseViewHolder.itemView.findViewById(R.id.tvTitleTemp); |
| 234 | tvTitleTemp.setText(maxTitleStr); | 220 | tvTitleTemp.setText(maxTitleStr); |
| 235 | 221 | ||
| 236 | - RecyclerView.LayoutParams itemViewLp = (RecyclerView.LayoutParams) baseViewHolder.itemView.getLayoutParams(); | 222 | + RecyclerView.LayoutParams itemViewLp = |
| 223 | + (RecyclerView.LayoutParams) baseViewHolder.itemView.getLayoutParams(); | ||
| 237 | itemViewLp.width = (int) imageWith; | 224 | itemViewLp.width = (int) imageWith; |
| 238 | baseViewHolder.itemView.setLayoutParams(itemViewLp); | 225 | baseViewHolder.itemView.setLayoutParams(itemViewLp); |
| 239 | 226 | ||
| @@ -251,7 +238,6 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -251,7 +238,6 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 251 | } | 238 | } |
| 252 | }); | 239 | }); |
| 253 | 240 | ||
| 254 | - | ||
| 255 | // 曝光埋点 | 241 | // 曝光埋点 |
| 256 | baseViewHolder.itemView.post(() -> { | 242 | baseViewHolder.itemView.post(() -> { |
| 257 | trackItemContent(false, bean, 0, null); | 243 | trackItemContent(false, bean, 0, null); |
| @@ -259,6 +245,5 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | @@ -259,6 +245,5 @@ public class CompAdvGuanMI extends ItemLayoutManager<CompAdv01Bean> { | ||
| 259 | }); | 245 | }); |
| 260 | } | 246 | } |
| 261 | 247 | ||
| 262 | - | ||
| 263 | } | 248 | } |
| 264 | } | 249 | } |
| 1 | + | ||
| 1 | package com.wd.capability.layout.comp.layoutmanager.channel; | 2 | package com.wd.capability.layout.comp.layoutmanager.channel; |
| 2 | 3 | ||
| 3 | import android.text.TextUtils; | 4 | import android.text.TextUtils; |
| @@ -6,18 +7,13 @@ import android.view.ViewGroup; | @@ -6,18 +7,13 @@ import android.view.ViewGroup; | ||
| 6 | import android.widget.LinearLayout; | 7 | import android.widget.LinearLayout; |
| 7 | import android.widget.TextView; | 8 | import android.widget.TextView; |
| 8 | 9 | ||
| 9 | -import com.people.common.ProcessUtils; | ||
| 10 | -import com.people.common.viewclick.BaseClickListener; | ||
| 11 | -import com.people.common.widget.RoundCornerImageView; | ||
| 12 | -import com.people.component.R; | ||
| 13 | -import com.people.component.comp.layoutmanager.ItemLayoutManager; | ||
| 14 | -import com.people.entity.custom.NavigationBeanNews; | ||
| 15 | -import com.people.entity.custom.comp.CompBean; | ||
| 16 | -import com.people.livedate.EventConstants; | ||
| 17 | -import com.people.livedate.base.LiveDataBus; | ||
| 18 | -import com.people.toolset.imageglide.ImageUtils; | ||
| 19 | -import com.people.toolset.system.DeviceUtil; | ||
| 20 | -import com.wondertek.wheat.ability.tools.AppContext; | 10 | +import com.wd.capability.layout.R; |
| 11 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 12 | +import com.wd.foundation.bean.custom.NavigationBeanNews; | ||
| 13 | +import com.wd.foundation.bean.custom.comp.CompBean; | ||
| 14 | +import com.wd.foundation.wdkit.viewclick.BaseClickListener; | ||
| 15 | +import com.wd.foundation.wdkitcore.livedata.LiveDataBus; | ||
| 16 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 21 | 17 | ||
| 22 | /** | 18 | /** |
| 23 | * 长通栏广告(可带标题) | 19 | * 长通栏广告(可带标题) |
| @@ -29,12 +25,10 @@ import com.wondertek.wheat.ability.tools.AppContext; | @@ -29,12 +25,10 @@ import com.wondertek.wheat.ability.tools.AppContext; | ||
| 29 | */ | 25 | */ |
| 30 | public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | 26 | public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { |
| 31 | 27 | ||
| 32 | - | ||
| 33 | private RoundCornerImageView imageView; | 28 | private RoundCornerImageView imageView; |
| 34 | 29 | ||
| 35 | private TextView tvTitle; | 30 | private TextView tvTitle; |
| 36 | 31 | ||
| 37 | - | ||
| 38 | @Override | 32 | @Override |
| 39 | public int getItemViewType() { | 33 | public int getItemViewType() { |
| 40 | return R.layout.comp_adv_long_image_lan; | 34 | return R.layout.comp_adv_long_image_lan; |
| @@ -56,11 +50,13 @@ public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | @@ -56,11 +50,13 @@ public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | ||
| 56 | public void onClick(View v) { | 50 | public void onClick(View v) { |
| 57 | CompBean compBean = section.getCompBean(); | 51 | CompBean compBean = section.getCompBean(); |
| 58 | int hashCode = CompAdvLongImageLan.this.hashCode(); | 52 | int hashCode = CompAdvLongImageLan.this.hashCode(); |
| 59 | - LiveDataBus.getInstance().with(EventConstants.USER_COMP_MANUSCRIPT_DEL + compBean.getCompInforPageId()).postValue(hashCode); | 53 | + LiveDataBus.getInstance() |
| 54 | + .with(EventConstants.USER_COMP_MANUSCRIPT_DEL + compBean.getCompInforPageId()) | ||
| 55 | + .postValue(hashCode); | ||
| 60 | } | 56 | } |
| 61 | }); | 57 | }); |
| 62 | // 国殇 | 58 | // 国殇 |
| 63 | - checkOpenGrayModel(itemView,position); | 59 | + checkOpenGrayModel(itemView, position); |
| 64 | } | 60 | } |
| 65 | 61 | ||
| 66 | @Override | 62 | @Override |
| @@ -94,7 +90,7 @@ public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | @@ -94,7 +90,7 @@ public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | ||
| 94 | protected void onNoDoubleClick(View v) { | 90 | protected void onNoDoubleClick(View v) { |
| 95 | 91 | ||
| 96 | ProcessUtils.processPage(contentBean); | 92 | ProcessUtils.processPage(contentBean); |
| 97 | - //更新已读状态 | 93 | + // 更新已读状态 |
| 98 | // updateReadState(tvTitle, data); | 94 | // updateReadState(tvTitle, data); |
| 99 | // 点击埋点 | 95 | // 点击埋点 |
| 100 | trackItemContent(true, contentBean, position, data.getLocalFiledType()); | 96 | trackItemContent(true, contentBean, position, data.getLocalFiledType()); |
| @@ -107,7 +103,6 @@ public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | @@ -107,7 +103,6 @@ public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | ||
| 107 | trackItemContent(false, contentBean, position, data.getLocalFiledType()); | 103 | trackItemContent(false, contentBean, position, data.getLocalFiledType()); |
| 108 | }); | 104 | }); |
| 109 | 105 | ||
| 110 | - | ||
| 111 | } else { | 106 | } else { |
| 112 | setLayoutManagerItemViewHeight(itemView, 0); | 107 | setLayoutManagerItemViewHeight(itemView, 0); |
| 113 | } | 108 | } |
| @@ -115,5 +110,4 @@ public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | @@ -115,5 +110,4 @@ public class CompAdvLongImageLan extends ItemLayoutManager<NavigationBeanNews> { | ||
| 115 | return position; | 110 | return position; |
| 116 | } | 111 | } |
| 117 | 112 | ||
| 118 | - | ||
| 119 | } | 113 | } |
| @@ -10,22 +10,14 @@ import androidx.annotation.NonNull; | @@ -10,22 +10,14 @@ import androidx.annotation.NonNull; | ||
| 10 | import androidx.appcompat.widget.LinearLayoutCompat; | 10 | import androidx.appcompat.widget.LinearLayoutCompat; |
| 11 | import androidx.recyclerview.widget.LinearLayoutManager; | 11 | import androidx.recyclerview.widget.LinearLayoutManager; |
| 12 | 12 | ||
| 13 | -import com.chad.library.adapter.base.BaseQuickAdapter; | ||
| 14 | -import com.chad.library.adapter.base.viewholder.BaseViewHolder; | ||
| 15 | -import com.people.common.ProcessUtils; | ||
| 16 | -import com.people.common.viewclick.BaseClickListener; | ||
| 17 | -import com.people.common.widget.RoundCornerImageView; | ||
| 18 | -import com.people.component.R; | ||
| 19 | -import com.people.component.comp.layoutmanager.ItemLayoutManager; | ||
| 20 | -import com.people.component.ui.widget.ItemRecyclerView; | ||
| 21 | -import com.people.entity.custom.comp.CompBean; | ||
| 22 | -import com.people.entity.custom.content.ContentBean; | ||
| 23 | -import com.people.entity.custom.label.CompAdv01Bean; | ||
| 24 | -import com.people.livedate.EventConstants; | ||
| 25 | -import com.people.livedate.base.LiveDataBus; | ||
| 26 | -import com.people.toolset.imageglide.ImageUtils; | ||
| 27 | -import com.people.toolset.system.DeviceUtil; | ||
| 28 | -import com.wondertek.wheat.ability.tools.AppContext; | 13 | +import com.wd.capability.layout.comp.layoutmanager.BaseAdapter; |
| 14 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 15 | +import com.wd.foundation.bean.custom.comp.CompBean; | ||
| 16 | +import com.wd.foundation.bean.custom.label.CompAdv01Bean; | ||
| 17 | +import com.wd.foundation.wdkit.viewclick.BaseClickListener; | ||
| 18 | +import com.wd.foundation.wdkitcore.livedata.LiveDataBus; | ||
| 19 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 20 | + | ||
| 29 | 21 | ||
| 30 | /** | 22 | /** |
| 31 | * @Description: 视频展会广告 | 23 | * @Description: 视频展会广告 |
| @@ -163,7 +155,7 @@ public class CompAdvVideoEx extends ItemLayoutManager<CompAdv01Bean> { | @@ -163,7 +155,7 @@ public class CompAdvVideoEx extends ItemLayoutManager<CompAdv01Bean> { | ||
| 163 | 155 | ||
| 164 | 156 | ||
| 165 | @Override | 157 | @Override |
| 166 | - protected void convert(@NonNull BaseViewHolder baseViewHolder, ContentBean bean) { | 158 | + protected void convert(@NonNull BaseAdapter.BaseViewHolder baseViewHolder, ContentBean bean) { |
| 167 | 159 | ||
| 168 | TextView tvTitle = baseViewHolder.itemView.findViewById(R.id.tvTitle); | 160 | TextView tvTitle = baseViewHolder.itemView.findViewById(R.id.tvTitle); |
| 169 | tvTitle.setText(bean.getNewsTitle()); | 161 | tvTitle.setText(bean.getNewsTitle()); |
| 1 | + | ||
| 1 | package com.wd.capability.layout.comp.layoutmanager.channel; | 2 | package com.wd.capability.layout.comp.layoutmanager.channel; |
| 2 | 3 | ||
| 3 | import java.util.List; | 4 | import java.util.List; |
| @@ -8,19 +9,13 @@ import android.widget.ImageView; | @@ -8,19 +9,13 @@ import android.widget.ImageView; | ||
| 8 | import android.widget.RelativeLayout; | 9 | import android.widget.RelativeLayout; |
| 9 | import android.widget.TextView; | 10 | import android.widget.TextView; |
| 10 | 11 | ||
| 11 | -import com.people.common.CommonNetUtils; | ||
| 12 | -import com.people.common.ProcessUtils; | ||
| 13 | -import com.people.common.util.PDUtils; | ||
| 14 | -import com.people.common.viewclick.BaseClickListener; | ||
| 15 | -import com.people.component.R; | ||
| 16 | -import com.people.component.comp.layoutmanager.ItemLayoutManager; | ||
| 17 | -import com.people.entity.custom.NavigationBeanNews; | ||
| 18 | -import com.people.entity.custom.content.ContentBean; | ||
| 19 | -import com.people.network.BaseObserver; | ||
| 20 | -import com.people.toolset.imageglide.FilletUtil; | ||
| 21 | -import com.people.toolset.imageglide.ImageUtils; | ||
| 22 | -import com.people.toolset.string.NumberStrUtils; | ||
| 23 | -import com.wondertek.wheat.ability.tools.ResUtils; | 12 | +import com.wd.capability.layout.R; |
| 13 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 14 | +import com.wd.capability.network.BaseObserver; | ||
| 15 | +import com.wd.foundation.bean.custom.NavigationBeanNews; | ||
| 16 | +import com.wd.foundation.bean.custom.content.ContentBean; | ||
| 17 | +import com.wd.foundation.wdkit.viewclick.BaseClickListener; | ||
| 18 | +import com.wd.foundation.wdkitcore.tools.ResUtils; | ||
| 24 | 19 | ||
| 25 | /** | 20 | /** |
| 26 | * 搜索结果-更多人民号模块 | 21 | * 搜索结果-更多人民号模块 |
| @@ -33,101 +28,106 @@ import com.wondertek.wheat.ability.tools.ResUtils; | @@ -33,101 +28,106 @@ import com.wondertek.wheat.ability.tools.ResUtils; | ||
| 33 | * com.people.component.comp.layoutmanager.channel.CompSingleRowRecommendFollow} | 28 | * com.people.component.comp.layoutmanager.channel.CompSingleRowRecommendFollow} |
| 34 | */ | 29 | */ |
| 35 | public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBeanNews> { | 30 | public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBeanNews> { |
| 36 | - private ImageView riv_author,ivtagsplitpoint,ivadd,ivvip,imgavatarframe; | ||
| 37 | - private TextView tvTitle,tv_fans,tv_desc,btn_focus; | 31 | + private ImageView riv_author, ivtagsplitpoint, ivadd, ivvip, imgavatarframe; |
| 32 | + | ||
| 33 | + private TextView tvTitle, tv_fans, tv_desc, btn_focus; | ||
| 34 | + | ||
| 38 | private RelativeLayout rlcare; | 35 | private RelativeLayout rlcare; |
| 39 | - private View vline,vauthorheadframe,vvipbg; | 36 | + |
| 37 | + private View vline, vauthorheadframe, vvipbg; | ||
| 40 | 38 | ||
| 41 | @Override | 39 | @Override |
| 42 | public void prepareItem(View itemView, int position) { | 40 | public void prepareItem(View itemView, int position) { |
| 43 | - //荣誉头像框 | 41 | + // 荣誉头像框 |
| 44 | imgavatarframe = itemView.findViewById(R.id.imgavatarframe); | 42 | imgavatarframe = itemView.findViewById(R.id.imgavatarframe); |
| 45 | - //用户头像边框 #000000 0.5 dp 5% | 43 | + // 用户头像边框 #000000 0.5 dp 5% |
| 46 | vauthorheadframe = itemView.findViewById(R.id.vauthorheadframe); | 44 | vauthorheadframe = itemView.findViewById(R.id.vauthorheadframe); |
| 47 | - //用户头像 | 45 | + // 用户头像 |
| 48 | riv_author = itemView.findViewById(R.id.riv_author); | 46 | riv_author = itemView.findViewById(R.id.riv_author); |
| 49 | - //用户V图标边框 | 47 | + // 用户V图标边框 |
| 50 | vvipbg = itemView.findViewById(R.id.vvipbg); | 48 | vvipbg = itemView.findViewById(R.id.vvipbg); |
| 51 | - //用户户V图标 | 49 | + // 用户户V图标 |
| 52 | ivvip = itemView.findViewById(R.id.ivvip); | 50 | ivvip = itemView.findViewById(R.id.ivvip); |
| 53 | - //用户名称 | 51 | + // 用户名称 |
| 54 | tvTitle = itemView.findViewById(R.id.tv_author); | 52 | tvTitle = itemView.findViewById(R.id.tv_author); |
| 55 | - //粉丝数 | 53 | + // 粉丝数 |
| 56 | tv_fans = itemView.findViewById(R.id.tv_fans); | 54 | tv_fans = itemView.findViewById(R.id.tv_fans); |
| 57 | - //粉丝数目和简介之间的分割线 | 55 | + // 粉丝数目和简介之间的分割线 |
| 58 | ivtagsplitpoint = itemView.findViewById(R.id.ivtagsplitpoint); | 56 | ivtagsplitpoint = itemView.findViewById(R.id.ivtagsplitpoint); |
| 59 | - //用户简介 | 57 | + // 用户简介 |
| 60 | tv_desc = itemView.findViewById(R.id.tv_desc); | 58 | tv_desc = itemView.findViewById(R.id.tv_desc); |
| 61 | - //用户关注布局 | 59 | + // 用户关注布局 |
| 62 | rlcare = itemView.findViewById(R.id.rlcare); | 60 | rlcare = itemView.findViewById(R.id.rlcare); |
| 63 | - //用户关注+号 | 61 | + // 用户关注+号 |
| 64 | ivadd = itemView.findViewById(R.id.ivadd); | 62 | ivadd = itemView.findViewById(R.id.ivadd); |
| 65 | - //用户关注状态标签 已关注/关注 | 63 | + // 用户关注状态标签 已关注/关注 |
| 66 | btn_focus = itemView.findViewById(R.id.btn_focus); | 64 | btn_focus = itemView.findViewById(R.id.btn_focus); |
| 67 | - //底线 | 65 | + // 底线 |
| 68 | vline = itemView.findViewById(R.id.vline); | 66 | vline = itemView.findViewById(R.id.vline); |
| 69 | // 国殇 | 67 | // 国殇 |
| 70 | - checkOpenGrayModel(itemView,position); | 68 | + checkOpenGrayModel(itemView, position); |
| 71 | } | 69 | } |
| 72 | 70 | ||
| 73 | @Override | 71 | @Override |
| 74 | public int bindItem(View itemView, int position, NavigationBeanNews data) { | 72 | public int bindItem(View itemView, int position, NavigationBeanNews data) { |
| 75 | List<ContentBean> subList = data.getSubList(); | 73 | List<ContentBean> subList = data.getSubList(); |
| 76 | - if(subList != null){ | 74 | + if (subList != null) { |
| 77 | contentBean = subList.get(0); | 75 | contentBean = subList.get(0); |
| 78 | } | 76 | } |
| 79 | - //设置荣誉头像框 | ||
| 80 | - ImageUtils.getInstance().loadImage(imgavatarframe, contentBean.getRmhInfo().getHonoraryIcon(),-1); | ||
| 81 | - //设置头像 | ||
| 82 | - ImageUtils.getInstance().loadImageCircle(riv_author, | ||
| 83 | - contentBean.getRmhInfo().getRmhHeadUrl(), R.mipmap.icon_default_head); | ||
| 84 | - //设置v标识 | ||
| 85 | - if(TextUtils.isEmpty(contentBean.getRmhInfo().getAuthIcon())){ | 77 | + // 设置荣誉头像框 |
| 78 | + ImageUtils.getInstance().loadImage(imgavatarframe, contentBean.getRmhInfo().getHonoraryIcon(), -1); | ||
| 79 | + // 设置头像 | ||
| 80 | + ImageUtils.getInstance() | ||
| 81 | + .loadImageCircle(riv_author, contentBean.getRmhInfo().getRmhHeadUrl(), R.mipmap.icon_default_head); | ||
| 82 | + // 设置v标识 | ||
| 83 | + if (TextUtils.isEmpty(contentBean.getRmhInfo().getAuthIcon())) { | ||
| 86 | vvipbg.setVisibility(View.GONE); | 84 | vvipbg.setVisibility(View.GONE); |
| 87 | ivvip.setVisibility(View.GONE); | 85 | ivvip.setVisibility(View.GONE); |
| 88 | - }else{ | ||
| 89 | - ImageUtils.getInstance().loadImageCircle(ivvip, | ||
| 90 | - contentBean.getRmhInfo().getAuthIcon(), -1); | 86 | + } else { |
| 87 | + ImageUtils.getInstance().loadImageCircle(ivvip, contentBean.getRmhInfo().getAuthIcon(), -1); | ||
| 91 | vvipbg.setVisibility(View.VISIBLE); | 88 | vvipbg.setVisibility(View.VISIBLE); |
| 92 | ivvip.setVisibility(View.VISIBLE); | 89 | ivvip.setVisibility(View.VISIBLE); |
| 93 | } | 90 | } |
| 94 | - //设置用户昵称 | ||
| 95 | - setTittleValue(TextUtils.isEmpty(contentBean.getRmhInfo().getRmhName())?"":contentBean.getRmhInfo().getRmhName(),tvTitle,null); | 91 | + // 设置用户昵称 |
| 92 | + setTittleValue( | ||
| 93 | + TextUtils.isEmpty(contentBean.getRmhInfo().getRmhName()) ? "" : contentBean.getRmhInfo().getRmhName(), | ||
| 94 | + tvTitle, null); | ||
| 96 | boolean hasFansAndIntroduction = true; | 95 | boolean hasFansAndIntroduction = true; |
| 97 | - //设置粉丝 | ||
| 98 | - if(TextUtils.isEmpty(contentBean.getRmhInfo().fansNum) || "0".equals(contentBean.getRmhInfo().fansNum)){ | 96 | + // 设置粉丝 |
| 97 | + if (TextUtils.isEmpty(contentBean.getRmhInfo().fansNum) || "0".equals(contentBean.getRmhInfo().fansNum)) { | ||
| 99 | hasFansAndIntroduction = false; | 98 | hasFansAndIntroduction = false; |
| 100 | tv_fans.setText(""); | 99 | tv_fans.setText(""); |
| 101 | - }else{ | ||
| 102 | - tv_fans.setText("粉丝"+NumberStrUtils.Companion.getINSTANCE().handlerNumber(contentBean.getRmhInfo().fansNum)); | 100 | + } else { |
| 101 | + tv_fans | ||
| 102 | + .setText("粉丝" + NumberStrUtils.Companion.getINSTANCE().handlerNumber(contentBean.getRmhInfo().fansNum)); | ||
| 103 | } | 103 | } |
| 104 | - //设置简介 | ||
| 105 | - if(TextUtils.isEmpty(contentBean.getRmhInfo().getRmhDesc())){ | 104 | + // 设置简介 |
| 105 | + if (TextUtils.isEmpty(contentBean.getRmhInfo().getRmhDesc())) { | ||
| 106 | hasFansAndIntroduction = false; | 106 | hasFansAndIntroduction = false; |
| 107 | tv_desc.setText(""); | 107 | tv_desc.setText(""); |
| 108 | - }else{ | 108 | + } else { |
| 109 | tv_desc.setText(contentBean.getRmhInfo().getRmhDesc()); | 109 | tv_desc.setText(contentBean.getRmhInfo().getRmhDesc()); |
| 110 | } | 110 | } |
| 111 | - //设置分割点 | ||
| 112 | - if(hasFansAndIntroduction){ | 111 | + // 设置分割点 |
| 112 | + if (hasFansAndIntroduction) { | ||
| 113 | ivtagsplitpoint.setVisibility(View.VISIBLE); | 113 | ivtagsplitpoint.setVisibility(View.VISIBLE); |
| 114 | - }else{ | 114 | + } else { |
| 115 | ivtagsplitpoint.setVisibility(View.GONE); | 115 | ivtagsplitpoint.setVisibility(View.GONE); |
| 116 | } | 116 | } |
| 117 | - //设置关注状态 | 117 | + // 设置关注状态 |
| 118 | refreshCareState(contentBean.getRmhInfo().followStatus); | 118 | refreshCareState(contentBean.getRmhInfo().followStatus); |
| 119 | - //点击关注/取消关注 | 119 | + // 点击关注/取消关注 |
| 120 | rlcare.setOnClickListener(new BaseClickListener() { | 120 | rlcare.setOnClickListener(new BaseClickListener() { |
| 121 | @Override | 121 | @Override |
| 122 | protected void onNoDoubleClick(View v) { | 122 | protected void onNoDoubleClick(View v) { |
| 123 | - if(!PDUtils.isLogin()){ | 123 | + if (!PDUtils.isLogin()) { |
| 124 | ProcessUtils.toOneKeyLoginActivity(); | 124 | ProcessUtils.toOneKeyLoginActivity(); |
| 125 | } | 125 | } |
| 126 | - int status = TextUtils.isEmpty(contentBean.getRmhInfo().followStatus)?0:Integer.parseInt(contentBean.getRmhInfo().followStatus); | ||
| 127 | - CommonNetUtils.getInstance().operation(contentBean.getRmhInfo().getUserId(), | ||
| 128 | - contentBean.getRmhInfo().getUserType(), | ||
| 129 | - contentBean.getRmhInfo().getRmhId(), | ||
| 130 | - status == 1 ?0:1, new BaseObserver<String>() { | 126 | + int status = TextUtils.isEmpty(contentBean.getRmhInfo().followStatus) ? 0 |
| 127 | + : Integer.parseInt(contentBean.getRmhInfo().followStatus); | ||
| 128 | + CommonNetUtils.getInstance() | ||
| 129 | + .operation(contentBean.getRmhInfo().getUserId(), contentBean.getRmhInfo().getUserType(), | ||
| 130 | + contentBean.getRmhInfo().getRmhId(), status == 1 ? 0 : 1, new BaseObserver<String>() { | ||
| 131 | @Override | 131 | @Override |
| 132 | protected void dealSpecialCode(int code, String message) { | 132 | protected void dealSpecialCode(int code, String message) { |
| 133 | 133 | ||
| @@ -137,7 +137,7 @@ public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBea | @@ -137,7 +137,7 @@ public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBea | ||
| 137 | protected void onSuccess(String s) { | 137 | protected void onSuccess(String s) { |
| 138 | if (status == 1) { | 138 | if (status == 1) { |
| 139 | contentBean.getRmhInfo().followStatus = "0"; | 139 | contentBean.getRmhInfo().followStatus = "0"; |
| 140 | - }else{ | 140 | + } else { |
| 141 | contentBean.getRmhInfo().followStatus = "1"; | 141 | contentBean.getRmhInfo().followStatus = "1"; |
| 142 | } | 142 | } |
| 143 | refreshCareState(contentBean.getRmhInfo().followStatus); | 143 | refreshCareState(contentBean.getRmhInfo().followStatus); |
| @@ -145,16 +145,14 @@ public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBea | @@ -145,16 +145,14 @@ public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBea | ||
| 145 | }); | 145 | }); |
| 146 | } | 146 | } |
| 147 | }); | 147 | }); |
| 148 | - //跳转到号主页 | 148 | + // 跳转到号主页 |
| 149 | itemView.setOnClickListener(new BaseClickListener() { | 149 | itemView.setOnClickListener(new BaseClickListener() { |
| 150 | @Override | 150 | @Override |
| 151 | protected void onNoDoubleClick(View v) { | 151 | protected void onNoDoubleClick(View v) { |
| 152 | - //跳转个人中心页 | ||
| 153 | - ProcessUtils.jumpToPersonalCenterActivity( | ||
| 154 | - contentBean.getRmhInfo().getCnMainControl(), contentBean.getRmhInfo().getUserId(), | ||
| 155 | - contentBean.getRmhInfo().getUserType(), | ||
| 156 | - contentBean.getRmhInfo().getRmhId() | ||
| 157 | - ); | 152 | + // 跳转个人中心页 |
| 153 | + ProcessUtils.jumpToPersonalCenterActivity(contentBean.getRmhInfo().getCnMainControl(), | ||
| 154 | + contentBean.getRmhInfo().getUserId(), contentBean.getRmhInfo().getUserType(), | ||
| 155 | + contentBean.getRmhInfo().getRmhId()); | ||
| 158 | } | 156 | } |
| 159 | }); | 157 | }); |
| 160 | 158 | ||
| @@ -164,16 +162,17 @@ public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBea | @@ -164,16 +162,17 @@ public class CompAllResultPeoplesAccount extends ItemLayoutManager<NavigationBea | ||
| 164 | private void refreshCareState(String status) { | 162 | private void refreshCareState(String status) { |
| 165 | int linesize = (int) rlcare.getContext().getResources().getDimension(R.dimen.rmrb_dp0_5); | 163 | int linesize = (int) rlcare.getContext().getResources().getDimension(R.dimen.rmrb_dp0_5); |
| 166 | if ("1".equals(status)) { | 164 | if ("1".equals(status)) { |
| 167 | - //已关注 | ||
| 168 | - rlcare.setBackground(FilletUtil.createRectangleDrawable(0x00000000,rlcare.getContext().getResources().getColor(R.color.res_color_common_C5), | ||
| 169 | - Math.max(1,linesize),rlcare.getContext().getResources().getDimension(R.dimen.rmrb_dp3))); | ||
| 170 | - rlcare.setPadding(0,0,0,0); | 165 | + // 已关注 |
| 166 | + rlcare.setBackground(FilletUtil.createRectangleDrawable(0x00000000, | ||
| 167 | + rlcare.getContext().getResources().getColor(R.color.res_color_common_C5), Math.max(1, linesize), | ||
| 168 | + rlcare.getContext().getResources().getDimension(R.dimen.rmrb_dp3))); | ||
| 169 | + rlcare.setPadding(0, 0, 0, 0); | ||
| 171 | ivadd.setVisibility(View.GONE); | 170 | ivadd.setVisibility(View.GONE); |
| 172 | btn_focus.setTextColor(btn_focus.getContext().getResources().getColor(R.color.res_color_common_C5)); | 171 | btn_focus.setTextColor(btn_focus.getContext().getResources().getColor(R.color.res_color_common_C5)); |
| 173 | btn_focus.setText(btn_focus.getContext().getResources().getString(R.string.res_followed)); | 172 | btn_focus.setText(btn_focus.getContext().getResources().getString(R.string.res_followed)); |
| 174 | - }else{ | ||
| 175 | - rlcare.setPadding(0,0, (int) ResUtils.getDimension(R.dimen.rmrb_dp2),0); | ||
| 176 | - //未关注 | 173 | + } else { |
| 174 | + rlcare.setPadding(0, 0, (int) ResUtils.getDimension(R.dimen.rmrb_dp2), 0); | ||
| 175 | + // 未关注 | ||
| 177 | rlcare.setBackground(null); | 176 | rlcare.setBackground(null); |
| 178 | ivadd.setVisibility(View.VISIBLE); | 177 | ivadd.setVisibility(View.VISIBLE); |
| 179 | btn_focus.setTextColor(btn_focus.getContext().getResources().getColor(R.color.res_color_common_C11)); | 178 | btn_focus.setTextColor(btn_focus.getContext().getResources().getColor(R.color.res_color_common_C11)); |
| @@ -9,15 +9,10 @@ import android.widget.FrameLayout; | @@ -9,15 +9,10 @@ import android.widget.FrameLayout; | ||
| 9 | import android.widget.ImageView; | 9 | import android.widget.ImageView; |
| 10 | import android.widget.RelativeLayout; | 10 | import android.widget.RelativeLayout; |
| 11 | 11 | ||
| 12 | -import com.aliyun.player.IPlayer; | ||
| 13 | -import com.people.component.R; | ||
| 14 | -import com.people.entity.custom.content.ContentBean; | ||
| 15 | -import com.people.player.widget.AliyunRenderView; | ||
| 16 | -import com.people.toolset.SpUtils; | ||
| 17 | -import com.people.toolset.imageglide.RenderViewOutlineProvider; | ||
| 18 | -import com.wondertek.wheat.ability.tools.AppContext; | ||
| 19 | -import com.wondertek.wheat.ability.tools.NetworkUtil; | ||
| 20 | -import com.wondertek.wheat.ability.tools.ViewUtils; | 12 | +import com.wd.capability.layout.R; |
| 13 | +import com.wd.foundation.bean.custom.content.ContentBean; | ||
| 14 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 15 | +import com.wd.foundation.wdkitcore.tools.SpUtils; | ||
| 21 | 16 | ||
| 22 | /** | 17 | /** |
| 23 | * 组件播放器控制器 | 18 | * 组件播放器控制器 |
| @@ -30,7 +25,6 @@ public class CompPlayController { | @@ -30,7 +25,6 @@ public class CompPlayController { | ||
| 30 | 25 | ||
| 31 | private static final String TAG = "CompPlayController"; | 26 | private static final String TAG = "CompPlayController"; |
| 32 | 27 | ||
| 33 | - | ||
| 34 | private static CompPlayController instance = null; | 28 | private static CompPlayController instance = null; |
| 35 | 29 | ||
| 36 | private PlayerItemHolder mPlayerItemHolder; | 30 | private PlayerItemHolder mPlayerItemHolder; |
| @@ -55,9 +49,8 @@ public class CompPlayController { | @@ -55,9 +49,8 @@ public class CompPlayController { | ||
| 55 | return instance; | 49 | return instance; |
| 56 | } | 50 | } |
| 57 | 51 | ||
| 58 | - | ||
| 59 | -// // 埋点对象 | ||
| 60 | -// private ConvertQtBean qtBean; | 52 | + // // 埋点对象 |
| 53 | + // private ConvertQtBean qtBean; | ||
| 61 | 54 | ||
| 62 | private CompPlayController() { | 55 | private CompPlayController() { |
| 63 | // qtBean = new ConvertQtBean(); | 56 | // qtBean = new ConvertQtBean(); |
| @@ -114,7 +107,8 @@ public class CompPlayController { | @@ -114,7 +107,8 @@ public class CompPlayController { | ||
| 114 | 107 | ||
| 115 | }); | 108 | }); |
| 116 | 109 | ||
| 117 | - mPlayerItemHolder.player_layout = ViewUtils.findViewById(mPlayerItemHolder.playParentLayout, R.id.player_layout); | 110 | + mPlayerItemHolder.player_layout = |
| 111 | + ViewUtils.findViewById(mPlayerItemHolder.playParentLayout, R.id.player_layout); | ||
| 118 | } | 112 | } |
| 119 | 113 | ||
| 120 | mPlayerItemHolder.player.setOnStateChangedListener(state -> { | 114 | mPlayerItemHolder.player.setOnStateChangedListener(state -> { |
| @@ -28,43 +28,29 @@ import androidx.recyclerview.widget.RecyclerView; | @@ -28,43 +28,29 @@ import androidx.recyclerview.widget.RecyclerView; | ||
| 28 | import androidx.viewpager2.adapter.FragmentStateAdapter; | 28 | import androidx.viewpager2.adapter.FragmentStateAdapter; |
| 29 | import androidx.viewpager2.widget.ViewPager2; | 29 | import androidx.viewpager2.widget.ViewPager2; |
| 30 | 30 | ||
| 31 | -import com.orhanobut.logger.Logger; | ||
| 32 | -import com.people.common.ProcessUtils; | ||
| 33 | -import com.people.common.analytics.CommonTrack; | ||
| 34 | -import com.people.common.analytics.GeneralTrack; | ||
| 35 | -import com.people.common.analytics.constants.PageNameConstants; | ||
| 36 | -import com.people.common.base.BaseAutoLazyFragment; | ||
| 37 | -import com.people.common.base.BaseLazyFragment; | ||
| 38 | -import com.people.common.constant.DefaultViewConstant; | ||
| 39 | -import com.people.common.statusbar.StatusBarStyleEnum; | ||
| 40 | -import com.people.common.util.GrayManager; | ||
| 41 | -import com.people.common.util.ToolsUtil; | ||
| 42 | -import com.people.common.viewclick.BaseClickListener; | ||
| 43 | -import com.people.common.widget.DefaultView; | ||
| 44 | -import com.people.component.R; | ||
| 45 | -import com.people.component.comp.CompServiceImpl; | ||
| 46 | -import com.people.component.comp.layoutmanager.ItemContainerManager; | ||
| 47 | -import com.people.component.ui.assist.LivingMarkDataFetcher; | ||
| 48 | -import com.people.component.ui.channel.listener.PageInforToLayoutManagerCallback; | ||
| 49 | -import com.people.component.ui.fragment.ColumnFragment; | ||
| 50 | -import com.people.component.ui.fragment.HomeFollowFragment; | ||
| 51 | -import com.people.component.ui.fragment.MainFragment; | ||
| 52 | -import com.people.component.ui.fragment.TemplateFragment; | ||
| 53 | -import com.people.component.ui.widget.commonnavigator.titles.TopNavEffectTitleView; | ||
| 54 | -import com.people.entity.custom.MenuBean; | ||
| 55 | -import com.people.entity.custom.SimpleTabBean; | ||
| 56 | -import com.people.entity.custom.comp.ChannelInfoBean; | ||
| 57 | -import com.people.entity.custom.comp.CompDataSourceBean; | ||
| 58 | -import com.people.entity.custom.comp.TopicInfoBean; | ||
| 59 | -import com.people.entity.theme.ThemeMessage; | ||
| 60 | -import com.people.livedate.EventConstants; | ||
| 61 | -import com.people.livedate.base.LiveDataBus; | ||
| 62 | -import com.people.network.NetworkUtils; | ||
| 63 | -import com.people.room.entity.ChannelBean; | ||
| 64 | -import com.people.toolset.ScreenUtils; | ||
| 65 | -import com.people.toolset.imageglide.ImageUtils; | ||
| 66 | -import com.wondertek.wheat.ability.tools.ArrayUtils; | ||
| 67 | -import com.wondertek.wheat.ability.tools.ViewUtils; | 31 | + |
| 32 | +import com.wd.base.log.Logger; | ||
| 33 | +import com.wd.capability.layout.comp.CompServiceImpl; | ||
| 34 | +import com.wd.capability.layout.ui.channel.listener.PageInforToLayoutManagerCallback; | ||
| 35 | +import com.wd.capability.layout.ui.fragment.ColumnFragment; | ||
| 36 | +import com.wd.capability.layout.ui.fragment.HomeFollowFragment; | ||
| 37 | +import com.wd.capability.layout.ui.fragment.MainFragment; | ||
| 38 | +import com.wd.capability.layout.ui.fragment.TemplateFragment; | ||
| 39 | +import com.wd.capability.network.NetworkUtils; | ||
| 40 | +import com.wd.foundation.bean.custom.MenuBean; | ||
| 41 | +import com.wd.foundation.bean.custom.SimpleTabBean; | ||
| 42 | +import com.wd.foundation.bean.custom.comp.ChannelInfoBean; | ||
| 43 | +import com.wd.foundation.bean.custom.comp.CompDataSourceBean; | ||
| 44 | +import com.wd.foundation.bean.custom.comp.TopicInfoBean; | ||
| 45 | +import com.wd.foundation.bean.response.ChannelBean; | ||
| 46 | +import com.wd.foundation.bean.theme.ThemeMessage; | ||
| 47 | +import com.wd.foundation.wdkit.base.BaseLazyFragment; | ||
| 48 | +import com.wd.foundation.wdkit.constant.DefaultViewConstant; | ||
| 49 | +import com.wd.foundation.wdkit.statusbar.StatusBarStyleEnum; | ||
| 50 | +import com.wd.foundation.wdkit.utils.ToolsUtil; | ||
| 51 | +import com.wd.foundation.wdkit.widget.DefaultView; | ||
| 52 | +import com.wd.foundation.wdkitcore.livedata.LiveDataBus; | ||
| 53 | +import com.wd.foundation.wdkitcore.tools.ArrayUtils; | ||
| 68 | 54 | ||
| 69 | import net.lucode.hackware.magicindicator.MagicIndicator; | 55 | import net.lucode.hackware.magicindicator.MagicIndicator; |
| 70 | import net.lucode.hackware.magicindicator.buildins.UIUtil; | 56 | import net.lucode.hackware.magicindicator.buildins.UIUtil; |
| 1 | + | ||
| 1 | package com.wd.capability.layout.ui.channel.listener; | 2 | package com.wd.capability.layout.ui.channel.listener; |
| 2 | 3 | ||
| 3 | -import com.people.entity.custom.comp.ChannelInfoBean; | ||
| 4 | -import com.people.entity.custom.comp.TopicInfoBean; | ||
| 5 | -import com.people.entity.theme.ThemeMessage; | 4 | +import com.wd.foundation.bean.custom.comp.ChannelInfoBean; |
| 5 | +import com.wd.foundation.bean.custom.comp.TopicInfoBean; | ||
| 6 | +import com.wd.foundation.bean.theme.ThemeMessage; | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * 构建页面LayoutManager 与 ColumnFragment 回调接口类 | 9 | * 构建页面LayoutManager 与 ColumnFragment 回调接口类 |
| @@ -18,9 +19,7 @@ public interface PageInforToLayoutManagerCallback { | @@ -18,9 +19,7 @@ public interface PageInforToLayoutManagerCallback { | ||
| 18 | * | 19 | * |
| 19 | * @param themeMessage | 20 | * @param themeMessage |
| 20 | */ | 21 | */ |
| 21 | - void onPageThemeChange( ThemeMessage themeMessage); | ||
| 22 | - | ||
| 23 | - | 22 | + void onPageThemeChange(ThemeMessage themeMessage); |
| 24 | 23 | ||
| 25 | /** | 24 | /** |
| 26 | * 获取pangeinfor 专题对象 | 25 | * 获取pangeinfor 专题对象 |
| @@ -56,5 +55,4 @@ public interface PageInforToLayoutManagerCallback { | @@ -56,5 +55,4 @@ public interface PageInforToLayoutManagerCallback { | ||
| 56 | */ | 55 | */ |
| 57 | void failedPage(int errorCode); | 56 | void failedPage(int errorCode); |
| 58 | 57 | ||
| 59 | - | ||
| 60 | } | 58 | } |
| @@ -4,31 +4,30 @@ | @@ -4,31 +4,30 @@ | ||
| 4 | 4 | ||
| 5 | package com.wd.capability.layout.ui.channel.model; | 5 | package com.wd.capability.layout.ui.channel.model; |
| 6 | 6 | ||
| 7 | - | ||
| 8 | import java.util.HashMap; | 7 | import java.util.HashMap; |
| 9 | import java.util.List; | 8 | import java.util.List; |
| 10 | import java.util.Map; | 9 | import java.util.Map; |
| 11 | 10 | ||
| 12 | import android.text.TextUtils; | 11 | import android.text.TextUtils; |
| 13 | 12 | ||
| 14 | -import com.orhanobut.logger.Logger; | ||
| 15 | -import com.people.common.fetcher.BaseDataFetcher; | ||
| 16 | -import com.people.component.ui.channel.vm.IChannelDataListener; | ||
| 17 | -import com.people.daily.lib_library.ToastNightUtil; | ||
| 18 | -import com.people.entity.custom.SimpleTabBean; | ||
| 19 | -import com.people.entity.custom.comp.PageBean; | ||
| 20 | -import com.people.entity.response.PageTopNavBean; | ||
| 21 | -import com.people.network.BaseObserver; | ||
| 22 | -import com.people.network.bean.MetaBean; | ||
| 23 | -import com.people.network.cachedata.CacheData; | ||
| 24 | -import com.people.network.response.BaseResponse; | ||
| 25 | -import com.people.room.ChannelDbHelper; | ||
| 26 | -import com.people.room.entity.ChannelBean; | ||
| 27 | -import com.people.toolset.SpUtils; | ||
| 28 | -import com.people.toolset.json.GsonUtils; | ||
| 29 | -import com.wondertek.wheat.ability.tools.AppContext; | ||
| 30 | -import com.wondertek.wheat.ability.tools.ArrayUtils; | ||
| 31 | -import com.wondertek.wheat.ability.tools.StringUtils; | 13 | +import com.wd.base.log.Logger; |
| 14 | +import com.wd.capability.layout.ui.channel.vm.IChannelDataListener; | ||
| 15 | +import com.wd.capability.network.BaseObserver; | ||
| 16 | +import com.wd.capability.network.bean.MetaBean; | ||
| 17 | +import com.wd.capability.network.cachedata.CacheData; | ||
| 18 | +import com.wd.capability.network.response.BaseResponse; | ||
| 19 | +import com.wd.foundation.bean.custom.SimpleTabBean; | ||
| 20 | +import com.wd.foundation.bean.custom.comp.PageBean; | ||
| 21 | +import com.wd.foundation.bean.response.ChannelBean; | ||
| 22 | +import com.wd.foundation.bean.response.PageTopNavBean; | ||
| 23 | +import com.wd.foundation.wdinterface.toast.IToast; | ||
| 24 | +import com.wd.foundation.wdkit.datafetcher.BaseDataFetcher; | ||
| 25 | +import com.wd.foundation.wdkitcore.router.ArouterServiceManager; | ||
| 26 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 27 | +import com.wd.foundation.wdkitcore.tools.ArrayUtils; | ||
| 28 | +import com.wd.foundation.wdkitcore.tools.JsonUtils; | ||
| 29 | +import com.wd.foundation.wdkitcore.tools.SpUtils; | ||
| 30 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 32 | 31 | ||
| 33 | import io.reactivex.Observable; | 32 | import io.reactivex.Observable; |
| 34 | 33 | ||
| @@ -45,10 +44,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -45,10 +44,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 45 | 44 | ||
| 46 | private static final String TAG = "ChannelDataFetcherNews"; | 45 | private static final String TAG = "ChannelDataFetcherNews"; |
| 47 | 46 | ||
| 48 | - | ||
| 49 | private final IChannelDataListener mListener; | 47 | private final IChannelDataListener mListener; |
| 50 | 48 | ||
| 51 | - | ||
| 52 | /** | 49 | /** |
| 53 | * 构造器 | 50 | * 构造器 |
| 54 | * | 51 | * |
| @@ -58,13 +55,16 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -58,13 +55,16 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 58 | this.mListener = listener; | 55 | this.mListener = listener; |
| 59 | } | 56 | } |
| 60 | 57 | ||
| 61 | - | ||
| 62 | /** | 58 | /** |
| 63 | * 取消任务 | 59 | * 取消任务 |
| 64 | */ | 60 | */ |
| 65 | public void cancel() { | 61 | public void cancel() { |
| 66 | } | 62 | } |
| 67 | 63 | ||
| 64 | + @Override | ||
| 65 | + public String getLogTag() { | ||
| 66 | + return ""; | ||
| 67 | + } | ||
| 68 | 68 | ||
| 69 | /** | 69 | /** |
| 70 | * 获取顶部菜单导航栏数据(底部导航栏接口里返回的) | 70 | * 获取顶部菜单导航栏数据(底部导航栏接口里返回的) |
| @@ -76,7 +76,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -76,7 +76,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 76 | 76 | ||
| 77 | // 读取缓存数据 | 77 | // 读取缓存数据 |
| 78 | int dataType = loadLocalCacheData(id, isNewsChannl); | 78 | int dataType = loadLocalCacheData(id, isNewsChannl); |
| 79 | - //Log.e("DDDDSSS","--dataType--->"+dataType); | 79 | + // Log.e("DDDDSSS","--dataType--->"+dataType); |
| 80 | Map<String, Object> map = new HashMap<>(); | 80 | Map<String, Object> map = new HashMap<>(); |
| 81 | map.put("id", id); | 81 | map.put("id", id); |
| 82 | if (!TextUtils.isEmpty(SpUtils.getProvinceCode())) { | 82 | if (!TextUtils.isEmpty(SpUtils.getProvinceCode())) { |
| @@ -90,7 +90,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -90,7 +90,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 90 | map.put("districtCode", SpUtils.getDistrictCode()); | 90 | map.put("districtCode", SpUtils.getDistrictCode()); |
| 91 | } | 91 | } |
| 92 | if (isNewsChannl) { | 92 | if (isNewsChannl) { |
| 93 | - List<ChannelBean> myChannelBeans = ChannelDbHelper.getInstance(AppContext.getContext()).searchAllSelectChannel(); | 93 | + List<ChannelBean> myChannelBeans = |
| 94 | + ChannelDbHelper.getInstance(AppContext.getContext()).searchAllSelectChannel(); | ||
| 94 | StringBuilder builder = new StringBuilder(); | 95 | StringBuilder builder = new StringBuilder(); |
| 95 | int index = -1; | 96 | int index = -1; |
| 96 | if (myChannelBeans != null && myChannelBeans.size() > 0) { | 97 | if (myChannelBeans != null && myChannelBeans.size() > 0) { |
| @@ -102,7 +103,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -102,7 +103,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 102 | builder.append(","); | 103 | builder.append(","); |
| 103 | } | 104 | } |
| 104 | } | 105 | } |
| 105 | - //获取我的频道 | 106 | + // 获取我的频道 |
| 106 | map.put("channelIds", builder.toString()); | 107 | map.put("channelIds", builder.toString()); |
| 107 | } | 108 | } |
| 108 | } | 109 | } |
| @@ -128,7 +129,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -128,7 +129,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 128 | return; | 129 | return; |
| 129 | } | 130 | } |
| 130 | CacheData localCacheData = CacheData.getLocalCacheData(CacheData.channelCacheDataKey + id); | 131 | CacheData localCacheData = CacheData.getLocalCacheData(CacheData.channelCacheDataKey + id); |
| 131 | - //没缓存数据进行刷新 | 132 | + // 没缓存数据进行刷新 |
| 132 | boolean needRefresh = false; | 133 | boolean needRefresh = false; |
| 133 | 134 | ||
| 134 | if (localCacheData == null) { | 135 | if (localCacheData == null) { |
| @@ -139,7 +140,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -139,7 +140,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 139 | if (metaBean != null) { | 140 | if (metaBean != null) { |
| 140 | dataMd5 = metaBean.getMd5(); | 141 | dataMd5 = metaBean.getMd5(); |
| 141 | } | 142 | } |
| 142 | - //代码规范提示if里不要有复杂计算 | 143 | + // 代码规范提示if里不要有复杂计算 |
| 143 | if (localCacheData != null && localCacheData.needRefreshByMd5(dataMd5)) { | 144 | if (localCacheData != null && localCacheData.needRefreshByMd5(dataMd5)) { |
| 144 | needRefresh = true; | 145 | needRefresh = true; |
| 145 | } | 146 | } |
| @@ -152,8 +153,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -152,8 +153,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 152 | } | 153 | } |
| 153 | 154 | ||
| 154 | } | 155 | } |
| 155 | - if (pageTopNavBean != null && pageTopNavBean.getTopNavChannelList() != null && | ||
| 156 | - pageTopNavBean.getTopNavChannelList().size() > 0) { | 156 | + if (pageTopNavBean != null && pageTopNavBean.getTopNavChannelList() != null |
| 157 | + && pageTopNavBean.getTopNavChannelList().size() > 0) { | ||
| 157 | // 缓存到本地 | 158 | // 缓存到本地 |
| 158 | CacheData.saveDataToPreference(CacheData.channelCacheDataKey + id, pageTopNavBean, dataMd5); | 159 | CacheData.saveDataToPreference(CacheData.channelCacheDataKey + id, pageTopNavBean, dataMd5); |
| 159 | } | 160 | } |
| @@ -163,7 +164,10 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -163,7 +164,10 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 163 | @Override | 164 | @Override |
| 164 | protected void _onError(String message) { | 165 | protected void _onError(String message) { |
| 165 | super._onError(message); | 166 | super._onError(message); |
| 166 | - ToastNightUtil.showShort(message); | 167 | + IToast toaster = ArouterServiceManager.provide(IToast.class); |
| 168 | + if (toaster != null) { | ||
| 169 | + toaster.showShort(message); | ||
| 170 | + } | ||
| 167 | if (mListener != null) { | 171 | if (mListener != null) { |
| 168 | mListener.onPageDataFailed(message); | 172 | mListener.onPageDataFailed(message); |
| 169 | } | 173 | } |
| @@ -185,7 +189,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -185,7 +189,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 185 | if (pageTopNavData != null && !StringUtils.isBlank(pageTopNavData.getNetWorkData())) { | 189 | if (pageTopNavData != null && !StringUtils.isBlank(pageTopNavData.getNetWorkData())) { |
| 186 | // 缓存数据 | 190 | // 缓存数据 |
| 187 | String netWorkData = pageTopNavData.getNetWorkData(); | 191 | String netWorkData = pageTopNavData.getNetWorkData(); |
| 188 | - PageTopNavBean pageTopNavBean = GsonUtils.fromJson(netWorkData, PageTopNavBean.class); | 192 | + PageTopNavBean pageTopNavBean = JsonUtils.convertJsonToObject(netWorkData, PageTopNavBean.class); |
| 189 | // 更新频道选择页面数据 | 193 | // 更新频道选择页面数据 |
| 190 | if (isNewsChannl) { | 194 | if (isNewsChannl) { |
| 191 | updateLocalColumnSubscriptionDb(pageTopNavBean, "2"); | 195 | updateLocalColumnSubscriptionDb(pageTopNavBean, "2"); |
| @@ -197,7 +201,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -197,7 +201,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 197 | // 预置的数据 | 201 | // 预置的数据 |
| 198 | String pageTopNavPresetsData = CacheData.getChannelPresetsData(id); | 202 | String pageTopNavPresetsData = CacheData.getChannelPresetsData(id); |
| 199 | if (!StringUtils.isBlank(pageTopNavPresetsData)) { | 203 | if (!StringUtils.isBlank(pageTopNavPresetsData)) { |
| 200 | - PageTopNavBean pageTopNavBean = GsonUtils.fromJson(pageTopNavPresetsData, PageTopNavBean.class); | 204 | + PageTopNavBean pageTopNavBean = |
| 205 | + JsonUtils.convertJsonToObject(pageTopNavPresetsData, PageTopNavBean.class); | ||
| 201 | 206 | ||
| 202 | if (isNewsChannl) { | 207 | if (isNewsChannl) { |
| 203 | // 2023/5/18 本地无栏目数据则更新本地栏目数据 | 208 | // 2023/5/18 本地无栏目数据则更新本地栏目数据 |
| @@ -224,7 +229,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -224,7 +229,8 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 224 | 229 | ||
| 225 | SimpleTabBean simpleTabBean = new SimpleTabBean(); | 230 | SimpleTabBean simpleTabBean = new SimpleTabBean(); |
| 226 | if (isNews) { | 231 | if (isNews) { |
| 227 | - List<ChannelBean> myChannelList = ChannelDbHelper.getInstance(AppContext.getContext()).searchAllSelectChannel(); | 232 | + List<ChannelBean> myChannelList = |
| 233 | + ChannelDbHelper.getInstance(AppContext.getContext()).searchAllSelectChannel(); | ||
| 228 | if (myChannelList.size() > 0) { | 234 | if (myChannelList.size() > 0) { |
| 229 | simpleTabBean.setTopNavChannelList(myChannelList); | 235 | simpleTabBean.setTopNavChannelList(myChannelList); |
| 230 | } else { | 236 | } else { |
| @@ -244,7 +250,6 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -244,7 +250,6 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 244 | */ | 250 | */ |
| 245 | public void getPageInfor(String pageId) { | 251 | public void getPageInfor(String pageId) { |
| 246 | 252 | ||
| 247 | - | ||
| 248 | CacheData localCacheData = loadLocalPageInforCacheData(pageId); | 253 | CacheData localCacheData = loadLocalPageInforCacheData(pageId); |
| 249 | 254 | ||
| 250 | Map<String, Object> map = new HashMap<>(); | 255 | Map<String, Object> map = new HashMap<>(); |
| @@ -271,7 +276,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -271,7 +276,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 271 | return; | 276 | return; |
| 272 | } | 277 | } |
| 273 | 278 | ||
| 274 | - //没缓存数据进行刷新 | 279 | + // 没缓存数据进行刷新 |
| 275 | boolean needRefresh = false; | 280 | boolean needRefresh = false; |
| 276 | if (localCacheData == null) { | 281 | if (localCacheData == null) { |
| 277 | needRefresh = true; | 282 | needRefresh = true; |
| @@ -281,7 +286,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -281,7 +286,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 281 | if (metaBean != null) { | 286 | if (metaBean != null) { |
| 282 | dataMd5 = metaBean.getMd5(); | 287 | dataMd5 = metaBean.getMd5(); |
| 283 | } | 288 | } |
| 284 | - //代码规范提示if里不要有复杂计算 | 289 | + // 代码规范提示if里不要有复杂计算 |
| 285 | if (localCacheData != null && localCacheData.needRefreshByMd5(dataMd5)) { | 290 | if (localCacheData != null && localCacheData.needRefreshByMd5(dataMd5)) { |
| 286 | needRefresh = true; | 291 | needRefresh = true; |
| 287 | } | 292 | } |
| @@ -300,7 +305,10 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -300,7 +305,10 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 300 | 305 | ||
| 301 | @Override | 306 | @Override |
| 302 | protected void _onError(String e) { | 307 | protected void _onError(String e) { |
| 303 | - ToastNightUtil.showShort(e); | 308 | + IToast toaster = ArouterServiceManager.provide(IToast.class); |
| 309 | + if (toaster != null) { | ||
| 310 | + toaster.showShort(e); | ||
| 311 | + } | ||
| 304 | if (mListener != null) { | 312 | if (mListener != null) { |
| 305 | mListener.onPageDataFailed("page is not exist"); | 313 | mListener.onPageDataFailed("page is not exist"); |
| 306 | } | 314 | } |
| @@ -308,7 +316,6 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -308,7 +316,6 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 308 | }); | 316 | }); |
| 309 | } | 317 | } |
| 310 | 318 | ||
| 311 | - | ||
| 312 | /** | 319 | /** |
| 313 | * 获取早晚报业务数据 | 320 | * 获取早晚报业务数据 |
| 314 | */ | 321 | */ |
| @@ -343,7 +350,10 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -343,7 +350,10 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 343 | 350 | ||
| 344 | @Override | 351 | @Override |
| 345 | protected void _onError(String e) { | 352 | protected void _onError(String e) { |
| 346 | - ToastNightUtil.showShort(e); | 353 | + IToast toaster = ArouterServiceManager.provide(IToast.class); |
| 354 | + if (toaster != null) { | ||
| 355 | + toaster.showShort(e); | ||
| 356 | + } | ||
| 347 | if (mListener != null) { | 357 | if (mListener != null) { |
| 348 | mListener.onPageDataFailed("page is not exist"); | 358 | mListener.onPageDataFailed("page is not exist"); |
| 349 | } | 359 | } |
| @@ -360,7 +370,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -360,7 +370,7 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 360 | CacheData pageCacheData = CacheData.getLocalCacheData(CacheData.comPageInfoCacheKey + pageId); | 370 | CacheData pageCacheData = CacheData.getLocalCacheData(CacheData.comPageInfoCacheKey + pageId); |
| 361 | if (pageCacheData != null && !StringUtils.isBlank(pageCacheData.getNetWorkData())) { | 371 | if (pageCacheData != null && !StringUtils.isBlank(pageCacheData.getNetWorkData())) { |
| 362 | String netWorkData = pageCacheData.getNetWorkData(); | 372 | String netWorkData = pageCacheData.getNetWorkData(); |
| 363 | - PageBean pageBean = GsonUtils.fromJson(netWorkData, PageBean.class); | 373 | + PageBean pageBean = JsonUtils.convertJsonToObject(netWorkData, PageBean.class); |
| 364 | if (pageBean == null || ArrayUtils.isEmpty(pageBean.getGroups())) { | 374 | if (pageBean == null || ArrayUtils.isEmpty(pageBean.getGroups())) { |
| 365 | return null; | 375 | return null; |
| 366 | } | 376 | } |
| @@ -379,29 +389,29 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -379,29 +389,29 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 379 | * 1预置数据、2本地数据、3接口数据 | 389 | * 1预置数据、2本地数据、3接口数据 |
| 380 | */ | 390 | */ |
| 381 | private synchronized void updateLocalColumnSubscriptionDb(PageTopNavBean bean, String type) { | 391 | private synchronized void updateLocalColumnSubscriptionDb(PageTopNavBean bean, String type) { |
| 382 | -// if(BuildConfig.DEBUG){ | ||
| 383 | -// type = "3"; | ||
| 384 | -// } | ||
| 385 | - //使用本地数据 | 392 | + // if(BuildConfig.DEBUG){ |
| 393 | + // type = "3"; | ||
| 394 | + // } | ||
| 395 | + // 使用本地数据 | ||
| 386 | if ("2".equals(type)) { | 396 | if ("2".equals(type)) { |
| 387 | - //无需变化,优先首页逻辑 | 397 | + // 无需变化,优先首页逻辑 |
| 388 | onTopNavDataSuccess(bean, true); | 398 | onTopNavDataSuccess(bean, true); |
| 389 | } | 399 | } |
| 390 | - //无数据 | 400 | + // 无数据 |
| 391 | if (bean == null || bean.getTopNavChannelList() == null || bean.getTopNavChannelList().size() == 0) { | 401 | if (bean == null || bean.getTopNavChannelList() == null || bean.getTopNavChannelList().size() == 0) { |
| 392 | Logger.t(TAG).d("updateLocalColumnSubscriptionDb return"); | 402 | Logger.t(TAG).d("updateLocalColumnSubscriptionDb return"); |
| 393 | onTopNavDataSuccess(bean, false); | 403 | onTopNavDataSuccess(bean, false); |
| 394 | return; | 404 | return; |
| 395 | } | 405 | } |
| 396 | - //获取本地数据库 | 406 | + // 获取本地数据库 |
| 397 | ChannelDbHelper helper = ChannelDbHelper.getInstance(AppContext.getContext()); | 407 | ChannelDbHelper helper = ChannelDbHelper.getInstance(AppContext.getContext()); |
| 398 | - //预置数据 如果数据库已经有数据,则无需更新,数据库的数据和预置的一样 | 408 | + // 预置数据 如果数据库已经有数据,则无需更新,数据库的数据和预置的一样 |
| 399 | if ("1".equals(type) && helper.hasData()) { | 409 | if ("1".equals(type) && helper.hasData()) { |
| 400 | Logger.t(TAG).d("预置数据 如果数据库已经有数据,则无需更新,数据库的数据和预置的一样"); | 410 | Logger.t(TAG).d("预置数据 如果数据库已经有数据,则无需更新,数据库的数据和预置的一样"); |
| 401 | onTopNavDataSuccess(bean, true); | 411 | onTopNavDataSuccess(bean, true); |
| 402 | return; | 412 | return; |
| 403 | } | 413 | } |
| 404 | - //本地数据直接获取 | 414 | + // 本地数据直接获取 |
| 405 | if ("2".equals(type)) { | 415 | if ("2".equals(type)) { |
| 406 | Logger.t(TAG).d("本地数据"); | 416 | Logger.t(TAG).d("本地数据"); |
| 407 | List<ChannelBean> local = helper.getData(); | 417 | List<ChannelBean> local = helper.getData(); |
| @@ -411,9 +421,9 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | @@ -411,9 +421,9 @@ public class ChannelDataFetcherNews extends BaseDataFetcher { | ||
| 411 | } | 421 | } |
| 412 | Logger.t(TAG).d(local.size() + " 本地数据大小"); | 422 | Logger.t(TAG).d(local.size() + " 本地数据大小"); |
| 413 | } else { | 423 | } else { |
| 414 | - //清除本地数据 | 424 | + // 清除本地数据 |
| 415 | helper.deleteAll(); | 425 | helper.deleteAll(); |
| 416 | - //4.保存数据到数据库 | 426 | + // 4.保存数据到数据库 |
| 417 | helper.save(bean.getTopNavChannelList()); | 427 | helper.save(bean.getTopNavChannelList()); |
| 418 | Logger.t(TAG).d("首次数据 save:" + bean.getTopNavChannelList().size()); | 428 | Logger.t(TAG).d("首次数据 save:" + bean.getTopNavChannelList().size()); |
| 419 | onTopNavDataSuccess(bean, true); | 429 | onTopNavDataSuccess(bean, true); |
| @@ -6,13 +6,13 @@ package com.wd.capability.layout.ui.channel.vm; | @@ -6,13 +6,13 @@ package com.wd.capability.layout.ui.channel.vm; | ||
| 6 | 6 | ||
| 7 | import androidx.lifecycle.LifecycleOwner; | 7 | import androidx.lifecycle.LifecycleOwner; |
| 8 | 8 | ||
| 9 | -import com.orhanobut.logger.Logger; | ||
| 10 | -import com.people.common.UIViewModel; | ||
| 11 | -import com.people.component.comp.layoutdata.Page; | ||
| 12 | -import com.people.component.ui.channel.model.ChannelDataFetcherNews; | ||
| 13 | -import com.people.entity.custom.SimpleTabBean; | ||
| 14 | -import com.people.entity.custom.comp.PageBean; | ||
| 15 | -import com.wondertek.wheat.ability.tools.StringUtils; | 9 | +import com.wd.base.log.Logger; |
| 10 | +import com.wd.capability.layout.comp.layoutdata.Page; | ||
| 11 | +import com.wd.capability.layout.ui.channel.model.ChannelDataFetcherNews; | ||
| 12 | +import com.wd.foundation.bean.custom.SimpleTabBean; | ||
| 13 | +import com.wd.foundation.bean.custom.comp.PageBean; | ||
| 14 | +import com.wd.foundation.wdkit.mvvm.vm.BaseViewModel; | ||
| 15 | +import com.wd.foundation.wdkitcore.tools.StringUtils; | ||
| 16 | 16 | ||
| 17 | 17 | ||
| 18 | /** | 18 | /** |
| @@ -22,7 +22,7 @@ import com.wondertek.wheat.ability.tools.StringUtils; | @@ -22,7 +22,7 @@ import com.wondertek.wheat.ability.tools.StringUtils; | ||
| 22 | * @version [V1.0.0, 2021/12/8] | 22 | * @version [V1.0.0, 2021/12/8] |
| 23 | * @since V1.0.0 | 23 | * @since V1.0.0 |
| 24 | */ | 24 | */ |
| 25 | -public class ChannelViewModel extends UIViewModel { | 25 | +public class ChannelViewModel extends BaseViewModel { |
| 26 | /** | 26 | /** |
| 27 | * 频道列表保存名 | 27 | * 频道列表保存名 |
| 28 | */ | 28 | */ |
| @@ -4,10 +4,10 @@ | @@ -4,10 +4,10 @@ | ||
| 4 | 4 | ||
| 5 | package com.wd.capability.layout.ui.channel.vm; | 5 | package com.wd.capability.layout.ui.channel.vm; |
| 6 | 6 | ||
| 7 | -import com.people.component.comp.layoutdata.Page; | ||
| 8 | -import com.people.entity.custom.SimpleTabBean; | ||
| 9 | -import com.people.entity.custom.comp.PageBean; | ||
| 10 | -import com.wondertek.wheat.component.framework.mvvm.vm.IVMCallback; | 7 | +import com.wd.capability.layout.comp.layoutdata.Page; |
| 8 | +import com.wd.foundation.bean.custom.SimpleTabBean; | ||
| 9 | +import com.wd.foundation.bean.custom.comp.PageBean; | ||
| 10 | +import com.wd.foundation.wdkit.mvvm.vm.IVMCallback; | ||
| 11 | 11 | ||
| 12 | /** | 12 | /** |
| 13 | * 频道页VM监听回调接口<BR> | 13 | * 频道页VM监听回调接口<BR> |
| @@ -19,10 +19,10 @@ import com.wondertek.wheat.component.framework.mvvm.vm.IVMCallback; | @@ -19,10 +19,10 @@ import com.wondertek.wheat.component.framework.mvvm.vm.IVMCallback; | ||
| 19 | public interface IChannelDataListener extends IVMCallback { | 19 | public interface IChannelDataListener extends IVMCallback { |
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | - * | ||
| 23 | * @param data | 22 | * @param data |
| 24 | */ | 23 | */ |
| 25 | void onPageInforSuccess(PageBean data); | 24 | void onPageInforSuccess(PageBean data); |
| 25 | + | ||
| 26 | /** | 26 | /** |
| 27 | * 获取页面数据返回 | 27 | * 获取页面数据返回 |
| 28 | * | 28 | * |
| @@ -45,5 +45,4 @@ public interface IChannelDataListener extends IVMCallback { | @@ -45,5 +45,4 @@ public interface IChannelDataListener extends IVMCallback { | ||
| 45 | */ | 45 | */ |
| 46 | void onPageDataFailed(String error); | 46 | void onPageDataFailed(String error); |
| 47 | 47 | ||
| 48 | - | ||
| 49 | } | 48 | } |
| @@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
| 4 | 4 | ||
| 5 | package com.wd.capability.layout.ui.channel.vm; | 5 | package com.wd.capability.layout.ui.channel.vm; |
| 6 | 6 | ||
| 7 | -import com.people.entity.custom.SimpleTabBean; | ||
| 8 | -import com.wondertek.wheat.component.framework.mvvm.vm.IVMCallback; | 7 | +import com.wd.foundation.bean.custom.SimpleTabBean; |
| 8 | +import com.wd.foundation.wdkit.mvvm.vm.IVMCallback; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 首页VM监听回调接口<BR> | 11 | * 首页VM监听回调接口<BR> |
| @@ -4,8 +4,8 @@ | @@ -4,8 +4,8 @@ | ||
| 4 | 4 | ||
| 5 | package com.wd.capability.layout.ui.channel.vm; | 5 | package com.wd.capability.layout.ui.channel.vm; |
| 6 | 6 | ||
| 7 | -import com.people.entity.custom.comp.PageBean; | ||
| 8 | -import com.wondertek.wheat.component.framework.mvvm.vm.IVMCallback; | 7 | +import com.wd.foundation.bean.custom.comp.PageBean; |
| 8 | +import com.wd.foundation.wdkit.mvvm.vm.IVMCallback; | ||
| 9 | 9 | ||
| 10 | /** | 10 | /** |
| 11 | * 首页VM监听回调接口<BR> | 11 | * 首页VM监听回调接口<BR> |
| @@ -10,13 +10,11 @@ import android.widget.FrameLayout; | @@ -10,13 +10,11 @@ import android.widget.FrameLayout; | ||
| 10 | import androidx.annotation.NonNull; | 10 | import androidx.annotation.NonNull; |
| 11 | import androidx.annotation.Nullable; | 11 | import androidx.annotation.Nullable; |
| 12 | 12 | ||
| 13 | -import com.people.common.constant.IntentConstants; | ||
| 14 | -import com.people.component.R; | ||
| 15 | -import com.people.component.comp.page.ItemNoTitleLayoutManager; | ||
| 16 | -import com.people.entity.custom.MenuBean; | ||
| 17 | import com.wd.base.log.Logger; | 13 | import com.wd.base.log.Logger; |
| 14 | +import com.wd.capability.layout.comp.page.ItemNoTitleLayoutManager; | ||
| 15 | +import com.wd.foundation.bean.custom.MenuBean; | ||
| 18 | import com.wd.foundation.wdkit.base.BaseLazyFragment; | 16 | import com.wd.foundation.wdkit.base.BaseLazyFragment; |
| 19 | -import com.wondertek.wheat.ability.tools.SafeBundleUtil; | 17 | +import com.wd.foundation.wdkit.statusbar.StatusBarCompat; |
| 20 | 18 | ||
| 21 | /** | 19 | /** |
| 22 | * 常见碎片 | 20 | * 常见碎片 |
| @@ -4,7 +4,6 @@ | @@ -4,7 +4,6 @@ | ||
| 4 | 4 | ||
| 5 | package com.wd.capability.layout.ui.fragment; | 5 | package com.wd.capability.layout.ui.fragment; |
| 6 | 6 | ||
| 7 | - | ||
| 8 | import android.os.Bundle; | 7 | import android.os.Bundle; |
| 9 | import android.text.TextUtils; | 8 | import android.text.TextUtils; |
| 10 | import android.view.KeyEvent; | 9 | import android.view.KeyEvent; |
| @@ -17,23 +16,13 @@ import androidx.annotation.NonNull; | @@ -17,23 +16,13 @@ import androidx.annotation.NonNull; | ||
| 17 | import androidx.annotation.Nullable; | 16 | import androidx.annotation.Nullable; |
| 18 | import androidx.lifecycle.Observer; | 17 | import androidx.lifecycle.Observer; |
| 19 | 18 | ||
| 20 | -import com.orhanobut.logger.Logger; | ||
| 21 | -import com.people.common.analytics.GeneralTrack; | ||
| 22 | -import com.people.common.analytics.constants.PageNameConstants; | ||
| 23 | -import com.people.common.base.BaseFragment; | ||
| 24 | -import com.people.common.base.BaseLazyFragment; | ||
| 25 | -import com.people.common.constant.DefaultViewConstant; | ||
| 26 | -import com.people.common.constant.IntentConstants; | ||
| 27 | -import com.people.component.comp.page.ItemMenuTopLayoutManager; | ||
| 28 | -import com.people.component.ui.channel.vm.ChannelViewModel; | ||
| 29 | -import com.people.component.ui.channel.vm.INavChannelDataListener; | ||
| 30 | -import com.people.entity.custom.MenuBean; | ||
| 31 | -import com.people.entity.custom.SimpleTabBean; | ||
| 32 | -import com.people.entity.livedate.EventMessage; | ||
| 33 | -import com.people.livedate.EventConstants; | ||
| 34 | -import com.people.livedate.base.LiveDataBus; | ||
| 35 | -import com.wondertek.wheat.ability.tools.CastUtils; | ||
| 36 | -import com.wondertek.wheat.ability.tools.SafeBundleUtil; | 19 | +import com.wd.base.log.Logger; |
| 20 | +import com.wd.capability.layout.comp.page.ItemMenuTopLayoutManager; | ||
| 21 | +import com.wd.capability.layout.ui.channel.vm.ChannelViewModel; | ||
| 22 | +import com.wd.foundation.bean.custom.MenuBean; | ||
| 23 | +import com.wd.foundation.bean.custom.SimpleTabBean; | ||
| 24 | +import com.wd.foundation.wdkit.base.BaseLazyFragment; | ||
| 25 | +import com.wd.foundation.wdkit.constant.DefaultViewConstant; | ||
| 37 | 26 | ||
| 38 | /** | 27 | /** |
| 39 | * 页面fragment<BR> | 28 | * 页面fragment<BR> |
| @@ -92,7 +81,8 @@ public class MainFragment extends BaseLazyFragment { | @@ -92,7 +81,8 @@ public class MainFragment extends BaseLazyFragment { | ||
| 92 | 81 | ||
| 93 | @Override | 82 | @Override |
| 94 | protected View getJavaLayout() { | 83 | protected View getJavaLayout() { |
| 95 | - FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); | 84 | + FrameLayout.LayoutParams params = |
| 85 | + new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); | ||
| 96 | mRootView = new FrameLayout(activity); | 86 | mRootView = new FrameLayout(activity); |
| 97 | mRootView.setLayoutParams(params); | 87 | mRootView.setLayoutParams(params); |
| 98 | return mRootView; | 88 | return mRootView; |
| @@ -101,7 +91,7 @@ public class MainFragment extends BaseLazyFragment { | @@ -101,7 +91,7 @@ public class MainFragment extends BaseLazyFragment { | ||
| 101 | @Override | 91 | @Override |
| 102 | protected void perCreate() { | 92 | protected void perCreate() { |
| 103 | super.perCreate(); | 93 | super.perCreate(); |
| 104 | - //首页启动速度用户,使用java布局 | 94 | + // 首页启动速度用户,使用java布局 |
| 105 | setIsjava(true); | 95 | setIsjava(true); |
| 106 | } | 96 | } |
| 107 | 97 | ||
| @@ -117,7 +107,7 @@ public class MainFragment extends BaseLazyFragment { | @@ -117,7 +107,7 @@ public class MainFragment extends BaseLazyFragment { | ||
| 117 | mId = menuData.getNavId(); | 107 | mId = menuData.getNavId(); |
| 118 | initNavBar(mRootView); | 108 | initNavBar(mRootView); |
| 119 | initViewModel(); | 109 | initViewModel(); |
| 120 | - if(menuData.isSearchTab()){ | 110 | + if (menuData.isSearchTab()) { |
| 121 | receiveLiveDataMsg(); | 111 | receiveLiveDataMsg(); |
| 122 | } | 112 | } |
| 123 | 113 | ||
| @@ -135,12 +125,12 @@ public class MainFragment extends BaseLazyFragment { | @@ -135,12 +125,12 @@ public class MainFragment extends BaseLazyFragment { | ||
| 135 | * 请求顶部导航栏接口 | 125 | * 请求顶部导航栏接口 |
| 136 | */ | 126 | */ |
| 137 | public void request() { | 127 | public void request() { |
| 138 | - if(menuData.isTemplate()){ | 128 | + if (menuData.isTemplate()) { |
| 139 | haveDataLoadInPage = true; | 129 | haveDataLoadInPage = true; |
| 140 | SimpleTabBean tabBean = new SimpleTabBean(); | 130 | SimpleTabBean tabBean = new SimpleTabBean(); |
| 141 | tabBean.setTopNavChannelList(menuData.getTopNavChannelList()); | 131 | tabBean.setTopNavChannelList(menuData.getTopNavChannelList()); |
| 142 | initData(tabBean); | 132 | initData(tabBean); |
| 143 | - }else{ | 133 | + } else { |
| 144 | mViewModel.getNavData(mId, false); | 134 | mViewModel.getNavData(mId, false); |
| 145 | } | 135 | } |
| 146 | } | 136 | } |
| @@ -207,13 +197,14 @@ public class MainFragment extends BaseLazyFragment { | @@ -207,13 +197,14 @@ public class MainFragment extends BaseLazyFragment { | ||
| 207 | 197 | ||
| 208 | } | 198 | } |
| 209 | 199 | ||
| 210 | - | ||
| 211 | @Override | 200 | @Override |
| 212 | public void onDestroy() { | 201 | public void onDestroy() { |
| 213 | super.onDestroy(); | 202 | super.onDestroy(); |
| 214 | Logger.t(TAG).i("onDestroy."); | 203 | Logger.t(TAG).i("onDestroy."); |
| 215 | - if(menuData != null && menuData.isSearchTab()){ | ||
| 216 | - LiveDataBus.getInstance().with(EventConstants.SEARCH_POST_KEYWORD_TAB, EventMessage.class).removeObservers(this); | 204 | + if (menuData != null && menuData.isSearchTab()) { |
| 205 | + LiveDataBus.getInstance() | ||
| 206 | + .with(EventConstants.SEARCH_POST_KEYWORD_TAB, EventMessage.class) | ||
| 207 | + .removeObservers(this); | ||
| 217 | } | 208 | } |
| 218 | } | 209 | } |
| 219 | 210 | ||
| @@ -221,7 +212,9 @@ public class MainFragment extends BaseLazyFragment { | @@ -221,7 +212,9 @@ public class MainFragment extends BaseLazyFragment { | ||
| 221 | * 初始化LiveData监听 | 212 | * 初始化LiveData监听 |
| 222 | */ | 213 | */ |
| 223 | private void initLiveData() { | 214 | private void initLiveData() { |
| 224 | - LiveDataBus.getInstance().with(EventConstants.SHORT_VIDEO_SWITCH_FULL, String.class).observe(getViewLifecycleOwner(), result -> { | 215 | + LiveDataBus.getInstance() |
| 216 | + .with(EventConstants.SHORT_VIDEO_SWITCH_FULL, String.class) | ||
| 217 | + .observe(getViewLifecycleOwner(), result -> { | ||
| 225 | if ("1".equals(result)) { | 218 | if ("1".equals(result)) { |
| 226 | // 横屏 | 219 | // 横屏 |
| 227 | mTabManager.changeOrientation(true); | 220 | mTabManager.changeOrientation(true); |
| @@ -230,7 +223,9 @@ public class MainFragment extends BaseLazyFragment { | @@ -230,7 +223,9 @@ public class MainFragment extends BaseLazyFragment { | ||
| 230 | } | 223 | } |
| 231 | }); | 224 | }); |
| 232 | // 接收画中画,处理首页view事件 | 225 | // 接收画中画,处理首页view事件 |
| 233 | - LiveDataBus.getInstance().with(EventConstants.HOME_PICTURE_IN_PICTURE, Boolean.class).observe(getViewLifecycleOwner(), result -> { | 226 | + LiveDataBus.getInstance() |
| 227 | + .with(EventConstants.HOME_PICTURE_IN_PICTURE, Boolean.class) | ||
| 228 | + .observe(getViewLifecycleOwner(), result -> { | ||
| 234 | if (result) { | 229 | if (result) { |
| 235 | // 横屏 | 230 | // 横屏 |
| 236 | mTabManager.changeOrientation(true); | 231 | mTabManager.changeOrientation(true); |
| @@ -270,7 +265,7 @@ public class MainFragment extends BaseLazyFragment { | @@ -270,7 +265,7 @@ public class MainFragment extends BaseLazyFragment { | ||
| 270 | if (mTabManager != null) { | 265 | if (mTabManager != null) { |
| 271 | LiveDataBus.getInstance().with(EventConstants.HOME_TAB_BACKGROUND_THEME).postValue(false); | 266 | LiveDataBus.getInstance().with(EventConstants.HOME_TAB_BACKGROUND_THEME).postValue(false); |
| 272 | 267 | ||
| 273 | - if(menuData != null){ | 268 | + if (menuData != null) { |
| 274 | 269 | ||
| 275 | if (menuData.isTabVideo()) { | 270 | if (menuData.isTabVideo()) { |
| 276 | mTabManager.checkLiveRedMark(); | 271 | mTabManager.checkLiveRedMark(); |
| @@ -283,15 +278,15 @@ public class MainFragment extends BaseLazyFragment { | @@ -283,15 +278,15 @@ public class MainFragment extends BaseLazyFragment { | ||
| 283 | int statusBarColor = menuData.getStatusBarColor(); | 278 | int statusBarColor = menuData.getStatusBarColor(); |
| 284 | changePhoneStatusBarWhiteOrBlack(statusBarColor == 0); | 279 | changePhoneStatusBarWhiteOrBlack(statusBarColor == 0); |
| 285 | // 埋点 | 280 | // 埋点 |
| 286 | - String pageName =""; | 281 | + String pageName = ""; |
| 287 | if (menuData.isTabRMH()) { | 282 | if (menuData.isTabRMH()) { |
| 288 | pageName = PageNameConstants.TAB_TWO; | 283 | pageName = PageNameConstants.TAB_TWO; |
| 289 | - } else if (menuData.isTabVideo() ) { | 284 | + } else if (menuData.isTabVideo()) { |
| 290 | pageName = PageNameConstants.TAB_THREE; | 285 | pageName = PageNameConstants.TAB_THREE; |
| 291 | - }else if (menuData.isTabService() ){ | 286 | + } else if (menuData.isTabService()) { |
| 292 | pageName = PageNameConstants.TAB_FOUR; | 287 | pageName = PageNameConstants.TAB_FOUR; |
| 293 | } | 288 | } |
| 294 | - if(!TextUtils.isEmpty(pageName)){ | 289 | + if (!TextUtils.isEmpty(pageName)) { |
| 295 | GeneralTrack.getInstance().barClick(menuData.getTitle(), menuData.getNavId()); | 290 | GeneralTrack.getInstance().barClick(menuData.getTitle(), menuData.getNavId()); |
| 296 | 291 | ||
| 297 | } | 292 | } |
| @@ -300,7 +295,6 @@ public class MainFragment extends BaseLazyFragment { | @@ -300,7 +295,6 @@ public class MainFragment extends BaseLazyFragment { | ||
| 300 | 295 | ||
| 301 | } | 296 | } |
| 302 | 297 | ||
| 303 | - | ||
| 304 | /** | 298 | /** |
| 305 | * 切换频道 | 299 | * 切换频道 |
| 306 | */ | 300 | */ |
| @@ -312,7 +306,6 @@ public class MainFragment extends BaseLazyFragment { | @@ -312,7 +306,6 @@ public class MainFragment extends BaseLazyFragment { | ||
| 312 | } | 306 | } |
| 313 | } | 307 | } |
| 314 | 308 | ||
| 315 | - | ||
| 316 | public void grayUiPage() { | 309 | public void grayUiPage() { |
| 317 | 310 | ||
| 318 | if (mTabManager != null) { | 311 | if (mTabManager != null) { |
| @@ -4,7 +4,6 @@ | @@ -4,7 +4,6 @@ | ||
| 4 | 4 | ||
| 5 | package com.wd.capability.layout.ui.fragment; | 5 | package com.wd.capability.layout.ui.fragment; |
| 6 | 6 | ||
| 7 | - | ||
| 8 | import java.util.ArrayList; | 7 | import java.util.ArrayList; |
| 9 | import java.util.List; | 8 | import java.util.List; |
| 10 | 9 | ||
| @@ -18,28 +17,20 @@ import android.widget.FrameLayout; | @@ -18,28 +17,20 @@ import android.widget.FrameLayout; | ||
| 18 | import androidx.annotation.NonNull; | 17 | import androidx.annotation.NonNull; |
| 19 | import androidx.annotation.Nullable; | 18 | import androidx.annotation.Nullable; |
| 20 | 19 | ||
| 21 | -import com.orhanobut.logger.Logger; | ||
| 22 | -import com.people.common.ProcessUtils; | ||
| 23 | -import com.people.common.analytics.GeneralTrack; | ||
| 24 | -import com.people.common.analytics.constants.PageNameConstants; | ||
| 25 | -import com.people.common.base.BaseFragment; | ||
| 26 | -import com.people.common.base.BaseLazyFragment; | ||
| 27 | -import com.people.common.constant.DefaultViewConstant; | ||
| 28 | -import com.people.common.constant.IntentConstants; | ||
| 29 | -import com.people.component.comp.layoutmanager.ItemLayoutManager; | ||
| 30 | -import com.people.component.comp.page.ItemErrorSubjectLayoutManager; | ||
| 31 | -import com.people.component.comp.page.ItemNewsHomeMenuTopLayoutManager; | ||
| 32 | -import com.people.component.ui.channel.vm.ChannelViewModel; | ||
| 33 | -import com.people.component.ui.channel.vm.INavChannelDataListener; | ||
| 34 | -import com.people.entity.custom.MenuBean; | ||
| 35 | -import com.people.entity.custom.SimpleTabBean; | ||
| 36 | -import com.people.livedate.EventConstants; | ||
| 37 | -import com.people.livedate.base.LiveDataBus; | ||
| 38 | -import com.people.room.ChannelDbHelper; | ||
| 39 | -import com.people.room.entity.ChannelBean; | ||
| 40 | -import com.wondertek.wheat.ability.tools.AppContext; | ||
| 41 | -import com.wondertek.wheat.ability.tools.CastUtils; | ||
| 42 | -import com.wondertek.wheat.ability.tools.SafeBundleUtil; | 20 | +import com.wd.base.log.Logger; |
| 21 | +import com.wd.capability.layout.comp.layoutmanager.ItemLayoutManager; | ||
| 22 | +import com.wd.capability.layout.comp.page.ItemErrorSubjectLayoutManager; | ||
| 23 | +import com.wd.capability.layout.comp.page.ItemNewsHomeMenuTopLayoutManager; | ||
| 24 | +import com.wd.capability.layout.ui.channel.vm.ChannelViewModel; | ||
| 25 | +import com.wd.capability.layout.ui.channel.vm.INavChannelDataListener; | ||
| 26 | +import com.wd.foundation.bean.custom.MenuBean; | ||
| 27 | +import com.wd.foundation.bean.custom.SimpleTabBean; | ||
| 28 | +import com.wd.foundation.bean.response.ChannelBean; | ||
| 29 | +import com.wd.foundation.wdkit.base.BaseFragment; | ||
| 30 | +import com.wd.foundation.wdkit.base.BaseLazyFragment; | ||
| 31 | +import com.wd.foundation.wdkit.constant.DefaultViewConstant; | ||
| 32 | +import com.wd.foundation.wdkitcore.livedata.LiveDataBus; | ||
| 33 | +import com.wd.foundation.wdkitcore.tools.AppContext; | ||
| 43 | 34 | ||
| 44 | /** | 35 | /** |
| 45 | * 页面fragment | 36 | * 页面fragment |
| @@ -101,7 +92,8 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -101,7 +92,8 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 101 | 92 | ||
| 102 | @Override | 93 | @Override |
| 103 | protected View getJavaLayout() { | 94 | protected View getJavaLayout() { |
| 104 | - FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); | 95 | + FrameLayout.LayoutParams params = |
| 96 | + new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT); | ||
| 105 | mRootView = new FrameLayout(activity); | 97 | mRootView = new FrameLayout(activity); |
| 106 | mRootView.setLayoutParams(params); | 98 | mRootView.setLayoutParams(params); |
| 107 | return mRootView; | 99 | return mRootView; |
| @@ -110,7 +102,7 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -110,7 +102,7 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 110 | @Override | 102 | @Override |
| 111 | protected void perCreate() { | 103 | protected void perCreate() { |
| 112 | super.perCreate(); | 104 | super.perCreate(); |
| 113 | - //首页启动速度用户,使用java布局 | 105 | + // 首页启动速度用户,使用java布局 |
| 114 | setIsjava(true); | 106 | setIsjava(true); |
| 115 | } | 107 | } |
| 116 | 108 | ||
| @@ -127,7 +119,9 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -127,7 +119,9 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 127 | initNavBar(mRootView); | 119 | initNavBar(mRootView); |
| 128 | initViewModel(); | 120 | initViewModel(); |
| 129 | 121 | ||
| 130 | - LiveDataBus.getInstance().with(EventConstants.TWO_PAGE_REFRESH + mId, Boolean.class).observe(getViewLifecycleOwner(), aBoolean -> { | 122 | + LiveDataBus.getInstance() |
| 123 | + .with(EventConstants.TWO_PAGE_REFRESH + mId, Boolean.class) | ||
| 124 | + .observe(getViewLifecycleOwner(), aBoolean -> { | ||
| 131 | if (aBoolean) { | 125 | if (aBoolean) { |
| 132 | request(); | 126 | request(); |
| 133 | } | 127 | } |
| @@ -135,17 +129,14 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -135,17 +129,14 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 135 | 129 | ||
| 136 | } | 130 | } |
| 137 | 131 | ||
| 138 | - | ||
| 139 | } | 132 | } |
| 140 | 133 | ||
| 141 | @Override | 134 | @Override |
| 142 | protected void lazyLoadData() { | 135 | protected void lazyLoadData() { |
| 143 | request(); | 136 | request(); |
| 144 | 137 | ||
| 145 | - | ||
| 146 | } | 138 | } |
| 147 | 139 | ||
| 148 | - | ||
| 149 | /** | 140 | /** |
| 150 | * 请求顶部导航栏接口 | 141 | * 请求顶部导航栏接口 |
| 151 | */ | 142 | */ |
| @@ -228,10 +219,8 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -228,10 +219,8 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 228 | mTabManager.bindItem(mRootView, 0, menuBean); | 219 | mTabManager.bindItem(mRootView, 0, menuBean); |
| 229 | } | 220 | } |
| 230 | 221 | ||
| 231 | - | ||
| 232 | } | 222 | } |
| 233 | 223 | ||
| 234 | - | ||
| 235 | @Override | 224 | @Override |
| 236 | public void onDestroy() { | 225 | public void onDestroy() { |
| 237 | super.onDestroy(); | 226 | super.onDestroy(); |
| @@ -263,12 +252,15 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -263,12 +252,15 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 263 | */ | 252 | */ |
| 264 | private void initLiveData() { | 253 | private void initLiveData() { |
| 265 | 254 | ||
| 266 | - //频道编辑完成事件 | ||
| 267 | - LiveDataBus.getInstance().with(EventConstants.COLUMN_NAVIGATION_DATACHANGE, ChannelBean.class).observe(getViewLifecycleOwner(), result -> { | 255 | + // 频道编辑完成事件 |
| 256 | + LiveDataBus.getInstance() | ||
| 257 | + .with(EventConstants.COLUMN_NAVIGATION_DATACHANGE, ChannelBean.class) | ||
| 258 | + .observe(getViewLifecycleOwner(), result -> { | ||
| 268 | 259 | ||
| 269 | if (mTabManager != null && mTabBean != null && menuData != null) { | 260 | if (mTabManager != null && mTabBean != null && menuData != null) { |
| 270 | // 获取我的频道数据 | 261 | // 获取我的频道数据 |
| 271 | - List<ChannelBean> myChannelList = ChannelDbHelper.getInstance(AppContext.getContext()).searchAllSelectChannel(); | 262 | + List<ChannelBean> myChannelList = |
| 263 | + ChannelDbHelper.getInstance(AppContext.getContext()).searchAllSelectChannel(); | ||
| 272 | mTabBean.setTopNavChannelList(myChannelList); | 264 | mTabBean.setTopNavChannelList(myChannelList); |
| 273 | if (result != null) { | 265 | if (result != null) { |
| 274 | menuData.jumpChannelId = result.getChannelId(); | 266 | menuData.jumpChannelId = result.getChannelId(); |
| @@ -282,13 +274,15 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -282,13 +274,15 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 282 | }); | 274 | }); |
| 283 | 275 | ||
| 284 | // 接收临时频道数据 | 276 | // 接收临时频道数据 |
| 285 | - LiveDataBus.getInstance().with(EventConstants.COLUMN_NAVIGATION_DATACHANGE_ADD, ChannelBean.class).observe(getViewLifecycleOwner(), result -> { | 277 | + LiveDataBus.getInstance() |
| 278 | + .with(EventConstants.COLUMN_NAVIGATION_DATACHANGE_ADD, ChannelBean.class) | ||
| 279 | + .observe(getViewLifecycleOwner(), result -> { | ||
| 286 | 280 | ||
| 287 | if (mTabManager != null && mTabBean != null) { | 281 | if (mTabManager != null && mTabBean != null) { |
| 288 | if (tempAddList == null) { | 282 | if (tempAddList == null) { |
| 289 | tempAddList = new ArrayList<>(); | 283 | tempAddList = new ArrayList<>(); |
| 290 | } | 284 | } |
| 291 | - //检测是否有重复的 | 285 | + // 检测是否有重复的 |
| 292 | int size = tempAddList.size(); | 286 | int size = tempAddList.size(); |
| 293 | if (size > 0) { | 287 | if (size > 0) { |
| 294 | boolean isAdd = true; | 288 | boolean isAdd = true; |
| @@ -307,7 +301,8 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -307,7 +301,8 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 307 | } | 301 | } |
| 308 | 302 | ||
| 309 | // 获取我的频道数据 | 303 | // 获取我的频道数据 |
| 310 | - List<ChannelBean> myChannelList = ChannelDbHelper.getInstance(AppContext.getContext()).searchAllSelectChannel(); | 304 | + List<ChannelBean> myChannelList = |
| 305 | + ChannelDbHelper.getInstance(AppContext.getContext()).searchAllSelectChannel(); | ||
| 311 | // 增加个临时频道 | 306 | // 增加个临时频道 |
| 312 | myChannelList.addAll(tempAddList); | 307 | myChannelList.addAll(tempAddList); |
| 313 | 308 | ||
| @@ -377,10 +372,8 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -377,10 +372,8 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 377 | mTabManager.onResume(); | 372 | mTabManager.onResume(); |
| 378 | } | 373 | } |
| 379 | 374 | ||
| 380 | - | ||
| 381 | } | 375 | } |
| 382 | 376 | ||
| 383 | - | ||
| 384 | /** | 377 | /** |
| 385 | * 切换频道 | 378 | * 切换频道 |
| 386 | */ | 379 | */ |
| @@ -392,7 +385,6 @@ public class NewsHomeFragment extends BaseLazyFragment { | @@ -392,7 +385,6 @@ public class NewsHomeFragment extends BaseLazyFragment { | ||
| 392 | } | 385 | } |
| 393 | } | 386 | } |
| 394 | 387 | ||
| 395 | - | ||
| 396 | /** | 388 | /** |
| 397 | * 切换到默认tab | 389 | * 切换到默认tab |
| 398 | */ | 390 | */ |
| @@ -17,23 +17,12 @@ import androidx.annotation.NonNull; | @@ -17,23 +17,12 @@ import androidx.annotation.NonNull; | ||
| 17 | import androidx.annotation.Nullable; | 17 | import androidx.annotation.Nullable; |
| 18 | import androidx.lifecycle.Observer; | 18 | import androidx.lifecycle.Observer; |
| 19 | 19 | ||
| 20 | -import com.orhanobut.logger.Logger; | ||
| 21 | -import com.people.common.analytics.GeneralTrack; | ||
| 22 | -import com.people.common.analytics.constants.PageNameConstants; | ||
| 23 | -import com.people.common.base.BaseFragment; | ||
| 24 | -import com.people.common.base.BaseLazyFragment; | ||
| 25 | -import com.people.common.constant.DefaultViewConstant; | ||
| 26 | -import com.people.common.constant.IntentConstants; | ||
| 27 | -import com.people.component.comp.page.TemplateMenuTopLayoutManager; | ||
| 28 | -import com.people.component.ui.channel.vm.ChannelViewModel; | ||
| 29 | -import com.people.component.ui.channel.vm.INavChannelDataListener; | ||
| 30 | -import com.people.entity.custom.MenuBean; | ||
| 31 | -import com.people.entity.custom.SimpleTabBean; | ||
| 32 | -import com.people.entity.livedate.EventMessage; | ||
| 33 | -import com.people.livedate.EventConstants; | ||
| 34 | -import com.people.livedate.base.LiveDataBus; | ||
| 35 | -import com.wondertek.wheat.ability.tools.CastUtils; | ||
| 36 | -import com.wondertek.wheat.ability.tools.SafeBundleUtil; | 20 | +import com.wd.capability.layout.comp.page.TemplateMenuTopLayoutManager; |
| 21 | +import com.wd.capability.layout.ui.channel.vm.ChannelViewModel; | ||
| 22 | +import com.wd.foundation.bean.custom.MenuBean; | ||
| 23 | +import com.wd.foundation.bean.custom.SimpleTabBean; | ||
| 24 | +import com.wd.foundation.wdkit.base.BaseLazyFragment; | ||
| 25 | + | ||
| 37 | 26 | ||
| 38 | /** | 27 | /** |
| 39 | * 页面fragment<BR> 我的留言tab、搜索结果页tab | 28 | * 页面fragment<BR> 我的留言tab、搜索结果页tab |
| 1 | +/* | ||
| 2 | + * Copyright (c) Wondertek Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.foundation.wdkit.datafetcher; | ||
| 6 | + | ||
| 7 | +import java.util.HashMap; | ||
| 8 | + | ||
| 9 | +import com.wd.base.log.Logger; | ||
| 10 | +import com.wd.capability.network.BaseObserver; | ||
| 11 | +import com.wd.capability.network.RetrofitClient; | ||
| 12 | +import com.wd.capability.network.constant.ParameterConstant; | ||
| 13 | +import com.wd.foundation.wdkitcore.tools.JsonUtils; | ||
| 14 | + | ||
| 15 | +import io.reactivex.Observable; | ||
| 16 | +import okhttp3.MediaType; | ||
| 17 | +import okhttp3.RequestBody; | ||
| 18 | + | ||
| 19 | +/** | ||
| 20 | + * 描述:获取数据 | ||
| 21 | + * | ||
| 22 | + * @author : lvjinhui | ||
| 23 | + * @since: 2022/6/21 | ||
| 24 | + */ | ||
| 25 | +public abstract class BaseDataFetcher implements IDataFetcher<IRequestApi> { | ||
| 26 | + | ||
| 27 | + @Override | ||
| 28 | + public RequestBody getBody(String paramsJson) { | ||
| 29 | + Logger.t(getLogTag()).d("---请求data---" + paramsJson); | ||
| 30 | + MediaType mediaType = MediaType.Companion.parse(ParameterConstant.HEADER_JSON_TYPE); | ||
| 31 | + RequestBody body = RequestBody.Companion.create(paramsJson, mediaType); | ||
| 32 | + return body; | ||
| 33 | + } | ||
| 34 | + | ||
| 35 | + @Override | ||
| 36 | + public RequestBody getBody(Object object) { | ||
| 37 | + String requestJson = JsonUtils.convertObjectToJson(object); | ||
| 38 | + Logger.t(getLogTag()).d("---请求data---" + requestJson); | ||
| 39 | + MediaType mediaType = MediaType.Companion.parse(ParameterConstant.HEADER_JSON_TYPE); | ||
| 40 | + RequestBody body = RequestBody.Companion.create(requestJson, mediaType); | ||
| 41 | + return body; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + @Override | ||
| 45 | + public RequestBody getBody(HashMap<String, Object> map) { | ||
| 46 | + String requestJson = JsonUtils.convertObjectToJson(map); | ||
| 47 | + Logger.t(getLogTag()).d("---请求data---" + requestJson); | ||
| 48 | + MediaType mediaType = MediaType.Companion.parse(ParameterConstant.HEADER_JSON_TYPE); | ||
| 49 | + RequestBody requestBody = RequestBody.Companion.create(requestJson, mediaType); | ||
| 50 | + return requestBody; | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + @Override | ||
| 54 | + public IRequestApi getRetrofit() { | ||
| 55 | + return RetrofitClient.getInstance().create(IRequestApi.class); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + /** | ||
| 59 | + * 请求封装 | ||
| 60 | + * | ||
| 61 | + * @param observable | ||
| 62 | + * @param baseObserver | ||
| 63 | + * @param <T> | ||
| 64 | + */ | ||
| 65 | + @Override | ||
| 66 | + public <T> void request(Observable observable, BaseObserver<T> baseObserver) { | ||
| 67 | + RetrofitClient.execute(observable, baseObserver); | ||
| 68 | + } | ||
| 69 | + | ||
| 70 | + public abstract String getLogTag(); | ||
| 71 | +} |
| 1 | +/* | ||
| 2 | + * Copyright (c) Wondertek Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 3 | + */ | ||
| 4 | + | ||
| 5 | +package com.wd.foundation.wdkit.datafetcher; | ||
| 6 | + | ||
| 7 | +import java.util.HashMap; | ||
| 8 | + | ||
| 9 | +import com.wd.capability.network.BaseObserver; | ||
| 10 | + | ||
| 11 | +import io.reactivex.Observable; | ||
| 12 | +import okhttp3.RequestBody; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 描述: | ||
| 16 | + * | ||
| 17 | + * @author : lvjinhui | ||
| 18 | + * @since: 2022/6/21 | ||
| 19 | + * @param <T> | ||
| 20 | + */ | ||
| 21 | +public interface IDataFetcher<T> { | ||
| 22 | + | ||
| 23 | + /** | ||
| 24 | + * 获取body | ||
| 25 | + * | ||
| 26 | + * @param map | ||
| 27 | + * @return RequestBody | ||
| 28 | + */ | ||
| 29 | + RequestBody getBody(HashMap<String, Object> map); | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * 获取body | ||
| 33 | + * | ||
| 34 | + * @param object | ||
| 35 | + * @return RequestBody | ||
| 36 | + */ | ||
| 37 | + | ||
| 38 | + RequestBody getBody(Object object); | ||
| 39 | + | ||
| 40 | + /** | ||
| 41 | + * 获取body | ||
| 42 | + * | ||
| 43 | + * @param params | ||
| 44 | + * @return RequestBody | ||
| 45 | + */ | ||
| 46 | + RequestBody getBody(String params); | ||
| 47 | + | ||
| 48 | + /** | ||
| 49 | + * 接口定义 | ||
| 50 | + * | ||
| 51 | + * @return T | ||
| 52 | + */ | ||
| 53 | + T getRetrofit(); | ||
| 54 | + | ||
| 55 | + /** | ||
| 56 | + * 发送请求 | ||
| 57 | + * | ||
| 58 | + * @param observable | ||
| 59 | + * @param baseObserver | ||
| 60 | + * @param <D> | ||
| 61 | + */ | ||
| 62 | + <D> void request(Observable observable, BaseObserver<D> baseObserver); | ||
| 63 | + | ||
| 64 | +} |
| 1 | + | ||
| 2 | +/* | ||
| 3 | + * Copyright (c) Wondertek Technologies Co., Ltd. 2019-2022. All rights reserved. | ||
| 4 | + */ | ||
| 5 | + | ||
| 6 | +package com.wd.foundation.wdkit.datafetcher; | ||
| 7 | + | ||
| 8 | +import java.util.List; | ||
| 9 | + | ||
| 10 | +import com.wd.capability.network.response.BaseResponse; | ||
| 11 | + | ||
| 12 | +import io.reactivex.Observable; | ||
| 13 | +import retrofit2.http.GET; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 请求的接口 | ||
| 17 | + * | ||
| 18 | + * @author shishuagnxi | ||
| 19 | + */ | ||
| 20 | +public interface IRequestApi { | ||
| 21 | + | ||
| 22 | + /** | ||
| 23 | + * 获取隐私政策和协议 | ||
| 24 | + * http://180.167.180.242:7866/project/3466/interface/api/182973 | ||
| 25 | + * /display/zh/c/agreement | ||
| 26 | + */ | ||
| 27 | + @GET("api/rmrb-bff-display-zh/display/zh/c/agreement") | ||
| 28 | + Observable<BaseResponse<List<?>>> getAppAgreement(); | ||
| 29 | +} |
| 1 | +<?xml version="1.0" encoding="utf-8"?> | ||
| 2 | +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
| 3 | + android:layout_width="match_parent" | ||
| 4 | + android:layout_height="@dimen/wdkit_dp30"> | ||
| 5 | + | ||
| 6 | + <TextView | ||
| 7 | + android:layout_width="match_parent" | ||
| 8 | + android:layout_height="wrap_content" | ||
| 9 | + android:layout_gravity="center" | ||
| 10 | + android:gravity="center" | ||
| 11 | + android:text="敬请期待 >" /> | ||
| 12 | + | ||
| 13 | + <View | ||
| 14 | + | ||
| 15 | + android:layout_width="match_parent" | ||
| 16 | + android:layout_marginLeft="@dimen/wdkit_dp16" | ||
| 17 | + android:layout_marginRight="@dimen/wdkit_dp16" | ||
| 18 | + android:layout_height="@dimen/wdkit_dp1" | ||
| 19 | + android:layout_gravity="bottom" | ||
| 20 | + android:background="@color/res_color_common_C7" /> | ||
| 21 | +</FrameLayout> |
-
Please register or login to post a comment