diff --git a/app/src/main/java/com/gh/common/util/CheckLoginUtils.java b/app/src/main/java/com/gh/common/util/CheckLoginUtils.java index d3e3649b4e..cff1fd0924 100644 --- a/app/src/main/java/com/gh/common/util/CheckLoginUtils.java +++ b/app/src/main/java/com/gh/common/util/CheckLoginUtils.java @@ -29,14 +29,7 @@ public class CheckLoginUtils { LogUtils.login("activity", null, entrance); if (SPUtils.getBoolean(Constants.SP_HAS_GET_PHONE_INFO) || NetworkUtils.isOpenMobileData(context)) { - // 需要确保传入的 context 不为 application - if (!(context instanceof Activity)) { - context = CurrentActivityHolder.getCurrentActivity(); - } - - if (context != null) { - QuickLoginHelper.startLogin(context, entrance); - } + startQuickLogin(context, entrance); } else { // 有可能App未启动 Bundle bundle = new Bundle(); @@ -51,6 +44,17 @@ public class CheckLoginUtils { } } + private static void startQuickLogin(Context context, String entrance) { + // 需要确保传入的 context 不为 application + if (!(context instanceof Activity)) { + context = CurrentActivityHolder.getCurrentActivity(); + } + + if (context != null) { + QuickLoginHelper.startLogin(context, entrance); + } + } + public static void checkLogin(final Context context, Bundle nextToBundle, boolean isTriggerNextStep, String entrance, OnLoginListener listener) { if (!isLogin()) { if (listener != null) Utils.toast(context, "需要登录"); diff --git a/app/src/main/java/com/gh/common/util/DataUtils.java b/app/src/main/java/com/gh/common/util/DataUtils.java index 0c8a42e4fa..2edff346ee 100644 --- a/app/src/main/java/com/gh/common/util/DataUtils.java +++ b/app/src/main/java/com/gh/common/util/DataUtils.java @@ -43,6 +43,10 @@ import kotlin.Pair; */ public class DataUtils { + private DataUtils() { + throw new IllegalStateException("Utility class"); + } + /** * 初始化各种统计工具,仅在release build(非debug)模式启用统计 */ diff --git a/app/src/main/java/com/gh/gamecenter/adapter/CommentDetailAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/CommentDetailAdapter.java index 32a3230d19..f12e0ff95d 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/CommentDetailAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/CommentDetailAdapter.java @@ -18,7 +18,7 @@ import com.gh.gamecenter.core.utils.MtaHelper; import com.gh.gamecenter.common.utils.TextHelper; import com.gh.gamecenter.R; import com.gh.gamecenter.adapter.viewholder.CommentViewHolder; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.entity.ArticleCommentParent; import com.gh.gamecenter.entity.CommentEntity; import com.gh.gamecenter.common.retrofit.Response; @@ -232,17 +232,17 @@ public class CommentDetailAdapter extends BaseRecyclerAdapter { private void initFooterViewHolder(FooterViewHolder holder) { if (mIsNetworkError) { - holder.loading.setVisibility(View.GONE); - holder.hint.setText(R.string.loading_error_network); + holder.getLoading().setVisibility(View.GONE); + holder.getHint().setText(R.string.loading_error_network); } else if (!mIsOver) { - holder.hint.setText(R.string.loading); - holder.loading.setVisibility(View.VISIBLE); + holder.getHint().setText(R.string.loading); + holder.getLoading().setVisibility(View.VISIBLE); } else if (mCommentList.size() == 0) { - holder.loading.setVisibility(View.GONE); - holder.hint.setText(R.string.comment_empty); + holder.getLoading().setVisibility(View.GONE); + holder.getHint().setText(R.string.comment_empty); } else { - holder.hint.setText(R.string.comment_nomore); - holder.loading.setVisibility(View.GONE); + holder.getHint().setText(R.string.comment_nomore); + holder.getLoading().setVisibility(View.GONE); } } diff --git a/app/src/main/java/com/gh/gamecenter/adapter/GameNewsAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/GameNewsAdapter.java index 67e847a527..5dd2d6efb5 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/GameNewsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/GameNewsAdapter.java @@ -22,7 +22,7 @@ import com.gh.gamecenter.core.utils.UrlFilterUtils; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.NewsSearchActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.GameNewsSearchViewHolder; import com.gh.gamecenter.adapter.viewholder.GameNewsTypeListViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsTextViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java index 2254cb5ff7..e7bcc1ce74 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/LibaoDetailAdapter.java @@ -30,7 +30,7 @@ import com.gh.gamecenter.core.utils.StringUtils; import com.gh.gamecenter.GameDetailActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.SuggestionActivity; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.LibaoDetailContentViewHolder; import com.gh.gamecenter.adapter.viewholder.LibaoDetailTopViewHolder; import com.gh.gamecenter.databinding.LibaodetailItemContentBinding; @@ -149,7 +149,7 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter { } else if (holder instanceof FooterViewHolder) { FooterViewHolder viewHolder = (FooterViewHolder) holder; viewHolder.initItemPadding(); - viewHolder.loading.setVisibility(View.GONE); + viewHolder.getLoading().setVisibility(View.GONE); SpannableStringBuilder builder = new SpanBuilder("此礼包有问题?点击反馈") .click(7, 11, R.color.theme_font, false, () -> { @@ -160,9 +160,9 @@ public class LibaoDetailAdapter extends BaseRecyclerAdapter { return null; }) .build(); - viewHolder.hint.setText(builder); - viewHolder.hint.setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitle)); - viewHolder.hint.setMovementMethod(new LinkMovementMethod()); + viewHolder.getHint().setText(builder); + viewHolder.getHint().setTextColor(ContextCompat.getColor(mContext, R.color.text_subtitle)); + viewHolder.getHint().setMovementMethod(new LinkMovementMethod()); } } diff --git a/app/src/main/java/com/gh/gamecenter/adapter/MessageDetailAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/MessageDetailAdapter.java index 9b8b6e6567..46e96824bc 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/MessageDetailAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/MessageDetailAdapter.java @@ -35,7 +35,7 @@ import com.gh.gamecenter.ShareCardPicActivity; import com.gh.gamecenter.WebActivity; import com.gh.gamecenter.adapter.viewholder.CommentHeadViewHolder; import com.gh.gamecenter.adapter.viewholder.CommentViewHolder; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsDigestViewHolder; import com.gh.gamecenter.databinding.CommentHeadItemBinding; import com.gh.gamecenter.databinding.NewsDigestItemBinding; @@ -500,24 +500,24 @@ public class MessageDetailAdapter extends BaseRecyclerAdapter { private void initFooterViewHolder(final FooterViewHolder viewHolder) { if (isNetworkError) { - viewHolder.loading.setVisibility(View.GONE); - viewHolder.hint.setText(R.string.loading_error_network); + viewHolder.getLoading().setVisibility(View.GONE); + viewHolder.getHint().setText(R.string.loading_error_network); } else if (!isOver) { - viewHolder.hint.setText(R.string.loading); - viewHolder.loading.setVisibility(View.VISIBLE); + viewHolder.getHint().setText(R.string.loading); + viewHolder.getLoading().setVisibility(View.VISIBLE); } else if (mNormalCommentList.size() == 0 && mHotCommentList.size() == 0) { - viewHolder.loading.setVisibility(View.GONE); - viewHolder.hint.setText(R.string.comment_empty); + viewHolder.getLoading().setVisibility(View.GONE); + viewHolder.getHint().setText(R.string.comment_empty); } else { - viewHolder.hint.setText(R.string.comment_nomore); - viewHolder.loading.setVisibility(View.GONE); + viewHolder.getHint().setText(R.string.comment_nomore); + viewHolder.getLoading().setVisibility(View.GONE); } viewHolder.itemView.setOnClickListener(v -> { if (isNetworkError) { isNetworkError = false; - viewHolder.loading.setVisibility(View.VISIBLE); - viewHolder.hint.setText(R.string.loading); + viewHolder.getLoading().setVisibility(View.VISIBLE); + viewHolder.getHint().setText(R.string.loading); addHotComment(); notifyDataSetChanged(); } diff --git a/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java b/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java index b965849e78..1cba3f32b7 100644 --- a/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/adapter/ToolBoxRvAdapter.java @@ -13,7 +13,7 @@ import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; import com.gh.gamecenter.SuggestionActivity; import com.gh.gamecenter.WebActivity; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder; import com.gh.gamecenter.adapter.viewholder.ToolBoxViewHolder; import com.gh.gamecenter.databinding.ToolboxItemBinding; @@ -165,17 +165,17 @@ public class ToolBoxRvAdapter extends BaseRecyclerAdapter { private void initFooterViewHolder(FooterViewHolder viewHolder) { viewHolder.initItemPadding(); if (mIsNetworkError) { - viewHolder.loading.setVisibility(View.GONE); - viewHolder.hint.setText(R.string.loading_failed_retry); + viewHolder.getLoading().setVisibility(View.GONE); + viewHolder.getHint().setText(R.string.loading_failed_retry); viewHolder.itemView.setClickable(true); viewHolder.itemView.setOnClickListener(v -> loadData()); } else if (mIsOver) { - viewHolder.loading.setVisibility(View.GONE); - viewHolder.hint.setText(R.string.loading_complete); + viewHolder.getLoading().setVisibility(View.GONE); + viewHolder.getHint().setText(R.string.loading_complete); viewHolder.itemView.setClickable(false); } else { - viewHolder.loading.setVisibility(View.VISIBLE); - viewHolder.hint.setText(loading); + viewHolder.getLoading().setVisibility(View.VISIBLE); + viewHolder.getHint().setText(loading); viewHolder.itemView.setClickable(false); } } diff --git a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/FooterViewHolder.java b/app/src/main/java/com/gh/gamecenter/adapter/viewholder/FooterViewHolder.java deleted file mode 100644 index 33c3c79ba8..0000000000 --- a/app/src/main/java/com/gh/gamecenter/adapter/viewholder/FooterViewHolder.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.gh.gamecenter.adapter.viewholder; - -import android.view.View; -import android.view.View.OnClickListener; -import android.widget.ProgressBar; -import android.widget.TextView; - -import androidx.annotation.StringRes; - -import com.gh.gamecenter.common.base.BaseRecyclerViewHolder; -import com.gh.gamecenter.common.base.activity.BaseActivity; -import com.gh.gamecenter.common.callback.OnListClickListener; -import com.gh.gamecenter.R; -import com.gh.gamecenter.common.baselist.ListViewModel; -import com.gh.gamecenter.common.baselist.LoadType; - -import java.util.ArrayList; - -public class FooterViewHolder extends BaseRecyclerViewHolder { - - public ProgressBar loading; - public TextView hint; - - public FooterViewHolder(View itemView) { - super(itemView); - loading = itemView.findViewById(R.id.footerview_loading); - hint = itemView.findViewById(R.id.footerview_hint); - } - - public FooterViewHolder(View itemView, OnListClickListener listClickListener) { - super(itemView, listClickListener); - loading = itemView.findViewById(R.id.footerview_loading); - hint = itemView.findViewById(R.id.footerview_hint); - itemView.setOnClickListener(this); - } - - // 减去recyclerView item间隔(个别列表间隔很大) - public void initItemPadding() { - itemView.setPadding(0, 0, 0, 0); - } - - public void initFooterViewHolder(boolean isNetworkError, boolean isOver, @StringRes int loadOverHint) { - if (isNetworkError) { - loading.setVisibility(View.GONE); - hint.setText(R.string.loading_failed_retry); - } else if (isOver) { - loading.setVisibility(View.GONE); - hint.setText(loadOverHint); - } else { - loading.setVisibility(View.VISIBLE); - hint.setText(R.string.loading); - } - } - - public void initFooterViewHolder(ListViewModel viewModel, boolean isLoading, boolean isNetworkError, boolean isOver) { - initFooterViewHolder(isLoading, isNetworkError, isOver, R.string.load_over_hint, v -> { - if (isNetworkError) viewModel.load(LoadType.RETRY); - }); - } - - public void bindFooterDefaultEmpty(ListViewModel viewModel, boolean isLoading, boolean isNetworkError, boolean isOver) { - if (isNetworkError) { - loading.setVisibility(View.GONE); - hint.setVisibility(View.VISIBLE); - hint.setText(R.string.loading_failed_retry); - } else if (isOver) { - loading.setVisibility(View.GONE); - hint.setVisibility(View.VISIBLE); - hint.setText(R.string.load_over_hint); - } else if (isLoading) { - loading.setVisibility(View.VISIBLE); - hint.setVisibility(View.VISIBLE); - hint.setText(R.string.loading); - } else { - loading.setVisibility(View.GONE); - hint.setVisibility(View.GONE); - } - itemView.setOnClickListener(v -> { - if (isNetworkError) viewModel.load(LoadType.RETRY); - }); - } - - public void initFooterViewHolder(boolean isLoading, boolean isNetworkError, boolean isOver) { - initFooterViewHolder(isLoading, isNetworkError, isOver, R.string.load_over_hint); - } - - public void initFooterViewHolder(boolean isLoading, boolean isNetworkError, boolean isOver, @StringRes int loadOverHint) { - BaseActivity.updateStaticView(itemView, new ArrayList<>()); - if (isNetworkError) { - loading.setVisibility(View.GONE); - hint.setText(R.string.loading_failed_retry); - } else if (isOver) { - loading.setVisibility(View.GONE); - hint.setText(loadOverHint); - } else if (isLoading) { - loading.setVisibility(View.VISIBLE); - hint.setText(R.string.loading); - } else { - loading.setVisibility(View.GONE); - hint.setText(R.string.loading_more_hint); - } - } - - public void initFooterViewHolder(boolean isLoading, boolean mIsNetworkError, boolean mIsOver, OnClickListener onClickListener) { - initFooterViewHolder(isLoading, mIsNetworkError, mIsOver, R.string.load_over_hint, onClickListener); - } - - public void initFooterViewHolder(boolean isLoading, boolean mIsNetworkError, boolean mIsOver, @StringRes int loadOverHint, OnClickListener onClickListener) { - if (mIsNetworkError) { - loading.setVisibility(View.GONE); - hint.setText(R.string.loading_failed_retry); - itemView.setClickable(true); - itemView.setOnClickListener(onClickListener); - } else if (mIsOver) { - loading.setVisibility(View.GONE); - hint.setText(loadOverHint); - itemView.setClickable(true); - itemView.setOnClickListener(onClickListener); - } else if (isLoading) { - loading.setVisibility(View.VISIBLE); - hint.setText(R.string.loading); - itemView.setClickable(false); - } else { - loading.setVisibility(View.GONE); - hint.setText(R.string.loading_more_hint); - itemView.setClickable(false); - } - } - -} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/amway/AmwayAdapter.kt b/app/src/main/java/com/gh/gamecenter/amway/AmwayAdapter.kt index a978f1744b..171bcb0e33 100644 --- a/app/src/main/java/com/gh/gamecenter/amway/AmwayAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/amway/AmwayAdapter.kt @@ -16,7 +16,7 @@ import com.gh.common.util.NewLogUtils import com.gh.common.util.SyncDataBetweenPageHelper import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.constant.EntranceConsts diff --git a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt index e82024b1ff..8df1ae702f 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/NewCatalogListAdapter.kt @@ -12,7 +12,7 @@ import com.gh.common.exposure.IExposable import com.gh.common.util.* import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.core.utils.StringUtils diff --git a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogAdapter.kt b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogAdapter.kt index 878841d3ec..38f26b15b8 100644 --- a/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/catalog/SpecialCatalogAdapter.kt @@ -18,7 +18,7 @@ import com.gh.common.exposure.ExposureSource import com.gh.common.exposure.IExposable import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.PageSwitchDataHelper diff --git a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListAdapter.kt b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListAdapter.kt index a95e89a71c..8d0bebc627 100644 --- a/app/src/main/java/com/gh/gamecenter/category/NewCategoryListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/category/NewCategoryListAdapter.kt @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.GameEntity diff --git a/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListAdapter.kt b/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListAdapter.kt index 2f079e89af..0c99137e78 100644 --- a/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/category2/CategoryV2ListAdapter.kt @@ -16,7 +16,7 @@ import com.gh.common.util.* import com.gh.gamecenter.common.view.DrawableView import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.dip2px diff --git a/app/src/main/java/com/gh/gamecenter/collection/AnswerAdapter.java b/app/src/main/java/com/gh/gamecenter/collection/AnswerAdapter.java index 8b48db17fe..bb3e562a36 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/AnswerAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/collection/AnswerAdapter.java @@ -16,7 +16,7 @@ import com.gh.gamecenter.common.utils.DialogHelper; import com.gh.gamecenter.common.utils.ExtensionsKt; import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.common.baselist.LoadType; import com.gh.gamecenter.databinding.CommunityAnswerItemBinding; diff --git a/app/src/main/java/com/gh/gamecenter/collection/ArticleAdapter.java b/app/src/main/java/com/gh/gamecenter/collection/ArticleAdapter.java index 9d48840699..29fb72f981 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/ArticleAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/collection/ArticleAdapter.java @@ -21,7 +21,7 @@ import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.common.util.NewsUtils; import com.gh.gamecenter.core.utils.NumberUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage1ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage2ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage3ViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleAdapter.kt b/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleAdapter.kt index 0be66129bb..1343344101 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/CommunityArticleAdapter.kt @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.CommunityAnswerItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionAdapter.kt b/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionAdapter.kt index a147fb7c09..526db88477 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/GamesCollectionAdapter.kt @@ -19,7 +19,7 @@ import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameCollectionItemViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.collection.GamesCollectionFragment.Companion.TYPE_USER diff --git a/app/src/main/java/com/gh/gamecenter/collection/ToolsAdapter.java b/app/src/main/java/com/gh/gamecenter/collection/ToolsAdapter.java index 6920097b91..3dc60577c7 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/ToolsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/collection/ToolsAdapter.java @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.ToolBoxViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.ToolboxItemBinding; diff --git a/app/src/main/java/com/gh/gamecenter/collection/VideoAdapter.kt b/app/src/main/java/com/gh/gamecenter/collection/VideoAdapter.kt index dbbb5be532..a43088281f 100644 --- a/app/src/main/java/com/gh/gamecenter/collection/VideoAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/collection/VideoAdapter.kt @@ -14,7 +14,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.databinding.PopupHistoryOptionBinding diff --git a/app/src/main/java/com/gh/gamecenter/download/InstalledGameFragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/download/InstalledGameFragmentAdapter.java index 4795650f6f..be141e149b 100644 --- a/app/src/main/java/com/gh/gamecenter/download/InstalledGameFragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/download/InstalledGameFragmentAdapter.java @@ -22,7 +22,7 @@ //import com.gh.download.DownloadManager; //import com.gh.gamecenter.GameDetailActivity; //import com.gh.gamecenter.R; -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +//import com.gh.gamecenter.common.viewholder.FooterViewHolder; //import com.gh.gamecenter.adapter.viewholder.GameViewHolder; //import com.gh.gamecenter.databinding.GameItemBinding; //import com.gh.gamecenter.entity.ApkEntity; diff --git a/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragmentAdapter.kt b/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragmentAdapter.kt index ba5aeaa2e4..2ce19f135b 100644 --- a/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragmentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/download/NewInstalledGameFragmentAdapter.kt @@ -19,7 +19,7 @@ import com.gh.common.util.DownloadItemUtils.setOnClickListener import com.gh.common.util.DownloadItemUtils.updateItem import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.utils.safelyGetInRelease import com.gh.gamecenter.databinding.GameItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/entity/LoginResponseEntity.kt b/app/src/main/java/com/gh/gamecenter/entity/LoginResponseEntity.kt deleted file mode 100644 index 88d6302f35..0000000000 --- a/app/src/main/java/com/gh/gamecenter/entity/LoginResponseEntity.kt +++ /dev/null @@ -1,30 +0,0 @@ -package com.gh.gamecenter.entity - -import com.google.gson.annotations.SerializedName - -/** - * Created by khy on 7/07/17. - */ -class LoginResponseEntity { - - @SerializedName("access_token") - var accessToken: AccessToken? = null - - @SerializedName("refresh_token") - var refreshToken: RefreshToken? = null - - var loginType: String? = null - - var userToken: String? = null - - class AccessToken { - var value: String? = null - var expire: Long? = null - } - - - class RefreshToken { - var value: String? = null - var expire: Long? = null - } -} \ No newline at end of file diff --git a/app/src/main/java/com/gh/gamecenter/entity/LoginTokenEntity.java b/app/src/main/java/com/gh/gamecenter/entity/LoginTokenEntity.java deleted file mode 100644 index fb24e3fbd2..0000000000 --- a/app/src/main/java/com/gh/gamecenter/entity/LoginTokenEntity.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.gh.gamecenter.entity; - -import androidx.annotation.NonNull; - -import com.google.gson.annotations.SerializedName; - -/** - * Created by khy on 29/11/17. - */ -public class LoginTokenEntity { - - @NonNull - private String id; - - @SerializedName("access_token") - @NonNull - private TokenEntity accessToken; - - @SerializedName("refresh_token") - @NonNull - private TokenEntity refreshToken; - - private String loginType; - - @SerializedName("first_login") - private boolean firstLogin; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public TokenEntity getAccessToken() { - return accessToken; - } - - public void setAccessToken(TokenEntity accessToken) { - this.accessToken = accessToken; - } - - public TokenEntity getRefreshToken() { - return refreshToken; - } - - public void setRefreshToken(TokenEntity refreshToken) { - this.refreshToken = refreshToken; - } - - public String getLoginType() { - return loginType; - } - - public void setLoginType(String loginType) { - this.loginType = loginType; - } - - public boolean isFirstLogin() { - return firstLogin; - } - - public void setFirstLogin(boolean firstLogin) { - this.firstLogin = firstLogin; - } -} diff --git a/app/src/main/java/com/gh/gamecenter/entity/TokenEntity.java b/app/src/main/java/com/gh/gamecenter/entity/TokenEntity.java deleted file mode 100644 index 9caebf157f..0000000000 --- a/app/src/main/java/com/gh/gamecenter/entity/TokenEntity.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.gh.gamecenter.entity; - -/** - * Created by khy on 29/11/17. - */ -public class TokenEntity { - - private String value; - - private long expire; - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } - - public long getExpire() { - return expire; - } - - public void setExpire(long expire) { - this.expire = expire; - } -} diff --git a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListAdapter.kt index 98ca8a1759..9649bcf5cd 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/detail/ForumArticleAskListAdapter.kt @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.gamecenter.core.utils.MtaHelper import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.databinding.CommunityAnswerItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityAdapter.kt index d7f618dbc5..4049a6ec98 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumActivityAdapter.kt @@ -8,7 +8,7 @@ import com.gh.common.exposure.time.TimeUtil import com.gh.common.util.DirectUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.constant.ItemViewType diff --git a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListAdapter.kt index ad3ef49547..f0bfbe02d1 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/home/ForumArticleListAdapter.kt @@ -14,7 +14,7 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.goneIf import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toDrawable diff --git a/app/src/main/java/com/gh/gamecenter/forum/list/ForumListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/list/ForumListAdapter.kt index 8c37aaf163..ab22df5331 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/list/ForumListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/list/ForumListAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.core.utils.ToastUtils import com.gh.gamecenter.common.utils.debounceActionWithInterval diff --git a/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt index f6fe9f2fef..c0590485f6 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/search/ForumContentSearchListAdapter.kt @@ -16,7 +16,7 @@ import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListAdapter.kt b/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListAdapter.kt index f12e36b66d..1008b2ba19 100644 --- a/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/forum/search/UserSearchListAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.goneIf diff --git a/app/src/main/java/com/gh/gamecenter/game/GameFragmentAdapter.kt b/app/src/main/java/com/gh/gamecenter/game/GameFragmentAdapter.kt index 4c775df65d..e507a32333 100644 --- a/app/src/main/java/com/gh/gamecenter/game/GameFragmentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/game/GameFragmentAdapter.kt @@ -70,6 +70,7 @@ import com.gh.gamecenter.servers.GameServersActivity import com.gh.gamecenter.subject.SubjectActivity import com.lightgame.adapter.BaseRecyclerAdapter import com.lightgame.download.DownloadEntity +import com.gh.gamecenter.common.viewholder.FooterViewHolder class GameFragmentAdapter( context: Context, diff --git a/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailAdapter.kt b/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailAdapter.kt index 2e7f2be7ee..ef70e43099 100644 --- a/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/game/columncollection/detail/ColumnCollectionDetailAdapter.kt @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.core.utils.MtaHelper import com.gh.gamecenter.core.utils.PageSwitchDataHelper import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameColumnCollectionItemViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.GameColumnCollectionItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddSearchAndPlayedGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddSearchAndPlayedGameAdapter.kt index 4e296683fe..15009b75d9 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddSearchAndPlayedGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/choose/AddSearchAndPlayedGameAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.common.utils.toDrawable import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.databinding.GameItemBinding import com.gh.gamecenter.game.GameItemViewHolder import com.gh.gamecenter.qa.editor.GameAdapter diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionAdapter.kt index 31db573aec..05860690fa 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/mine/MyGameCollectionAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.core.utils.DisplayUtils import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.GamesCollectionEntity diff --git a/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareAdapter.kt index bbcae66db6..353c7874c4 100644 --- a/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamecollection/square/GameCollectionSquareAdapter.kt @@ -27,7 +27,7 @@ import com.gh.common.exposure.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.common.entity.ExposureEntity diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt index 29e877507c..c4e423398a 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/desc/DescAdapter.kt @@ -33,7 +33,7 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.GameNewsActivity import com.gh.gamecenter.R import com.gh.gamecenter.SuggestionActivity -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.callback.OnListClickListener import com.gh.gamecenter.common.constant.Constants import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiAdapter.kt index 010d4f0b19..60341c02eb 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/fuli/FuLiAdapter.kt @@ -14,7 +14,7 @@ import com.gh.gamecenter.GameNewsActivity import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.SuggestionActivity -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameDetailNoticeViewHolder import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.common.utils.goneIf diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingAdapter.kt index 6e8faad16e..c44d7f18db 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/myrating/MyRatingAdapter.kt @@ -8,7 +8,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.copyTextAndToast import com.gh.gamecenter.common.utils.goneIf diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt index 648286f4db..e536a74750 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingAdapter.kt @@ -14,7 +14,7 @@ import com.gh.common.util.* import com.gh.common.util.DialogUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.constant.EntranceConsts import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt index b9551e8e92..2e070a2260 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/RatingReplyAdapter.kt @@ -32,7 +32,7 @@ import com.gh.gamecenter.common.view.CustomLinkMovementMethod import com.gh.gamecenter.common.view.DrawableView import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.callback.ConfirmListener diff --git a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsAdapter.kt b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsAdapter.kt index 6f380dd163..02b294dbc4 100644 --- a/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/gamedetail/rating/logs/CommentLogsAdapter.kt @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.utils.ImageUtils import com.gh.common.util.NewsUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.common.utils.toColor diff --git a/app/src/main/java/com/gh/gamecenter/help/HelpContentAdapter.kt b/app/src/main/java/com/gh/gamecenter/help/HelpContentAdapter.kt index 188711c866..ab97efec76 100644 --- a/app/src/main/java/com/gh/gamecenter/help/HelpContentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/help/HelpContentAdapter.kt @@ -12,7 +12,7 @@ import com.gh.common.util.* import com.gh.gamecenter.QaActivity import com.gh.gamecenter.R import com.gh.gamecenter.WebActivity -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.common.utils.dip2px diff --git a/app/src/main/java/com/gh/gamecenter/history/HistoryGameListAdapter.kt b/app/src/main/java/com/gh/gamecenter/history/HistoryGameListAdapter.kt index c2aadb834e..5495d23ddb 100644 --- a/app/src/main/java/com/gh/gamecenter/history/HistoryGameListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/history/HistoryGameListAdapter.kt @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt b/app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt index d18c3407ea..2b3db81394 100644 --- a/app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/home/HomeFragmentAdapter.kt @@ -14,7 +14,7 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.AboutActivity import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder import com.gh.gamecenter.common.baselist.DiffUtilAdapter import com.gh.gamecenter.common.baselist.LoadStatus diff --git a/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipAdapter.kt b/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipAdapter.kt index d402f7a568..5e357c747a 100644 --- a/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/home/skip/PackageSkipAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.core.utils.EmptyCallback import com.gh.gamecenter.core.utils.StringUtils diff --git a/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java b/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java index 7155dc588e..b317756f5e 100644 --- a/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/ConcernAdapter.java @@ -22,7 +22,7 @@ import com.gh.common.util.PlatformUtils; import com.gh.gamecenter.core.utils.StringUtils; import com.gh.gamecenter.core.utils.UrlFilterUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsDigestViewHolder; import com.gh.gamecenter.databinding.NewsDigestItemBinding; import com.gh.gamecenter.entity.CommentnumEntity; diff --git a/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java b/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java index 58c0ab3546..1649281e79 100644 --- a/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/InfoAdapter.java @@ -17,7 +17,7 @@ import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.common.util.NewsUtils; import com.gh.gamecenter.core.utils.NumberUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage1ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage2ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage3ViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java b/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java index 97d9ce9d4f..5f3ba4c001 100644 --- a/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/info/OriginalAdapter.java @@ -16,7 +16,7 @@ import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.common.util.NewsUtils; import com.gh.gamecenter.core.utils.NumberUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage1ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage2ViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsImage3ViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java index bb42577ed5..25fcd38316 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/libao/Libao2FragmentAdapter.java @@ -15,7 +15,7 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder; import com.gh.common.util.LibaoUtils; import com.gh.common.util.PlatformUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder; import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.callback.OnRequestCallBackListener; diff --git a/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java index 232d619966..e9f6d71980 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/libao/Libao3FragmentAdapter.java @@ -21,7 +21,7 @@ import com.gh.gamecenter.core.utils.TimeUtils; import com.gh.gamecenter.common.view.BugFixedPopupWindow; import com.gh.gamecenter.LibaoDetailActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder; import com.gh.gamecenter.databinding.LibaoItemBinding; import com.gh.gamecenter.entity.LibaoEntity; @@ -332,8 +332,8 @@ class Libao3FragmentAdapter extends BaseRecyclerAdapter private void initFooterViewHolder(FooterViewHolder holder) { holder.initItemPadding(); if (isNetworkError) { - holder.loading.setVisibility(View.GONE); - holder.hint.setText(R.string.loading_failed_retry); + holder.getLoading().setVisibility(View.GONE); + holder.getHint().setText(R.string.loading_failed_retry); holder.itemView.setClickable(true); holder.itemView.setOnClickListener(new View.OnClickListener() { @Override @@ -343,12 +343,12 @@ class Libao3FragmentAdapter extends BaseRecyclerAdapter } }); } else if (isOver) { - holder.loading.setVisibility(View.GONE); - holder.hint.setText(R.string.load_over_hint); + holder.getLoading().setVisibility(View.GONE); + holder.getHint().setText(R.string.load_over_hint); holder.itemView.setClickable(false); } else { - holder.loading.setVisibility(View.VISIBLE); - holder.hint.setText(R.string.loading); + holder.getLoading().setVisibility(View.VISIBLE); + holder.getHint().setText(R.string.loading); holder.itemView.setClickable(false); } } diff --git a/app/src/main/java/com/gh/gamecenter/libao/LibaoHistoryAdapter.java b/app/src/main/java/com/gh/gamecenter/libao/LibaoHistoryAdapter.java index f5972e6abc..e7846f5707 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/LibaoHistoryAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/libao/LibaoHistoryAdapter.java @@ -12,7 +12,7 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder; import com.gh.common.util.LibaoUtils; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder; import com.gh.gamecenter.common.callback.OnRequestCallBackListener; import com.gh.gamecenter.common.constant.ItemViewType; diff --git a/app/src/main/java/com/gh/gamecenter/libao/LibaoNewAdapter.kt b/app/src/main/java/com/gh/gamecenter/libao/LibaoNewAdapter.kt index 0c08f3d64b..ba36d8453a 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/LibaoNewAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/libao/LibaoNewAdapter.kt @@ -11,7 +11,7 @@ import com.gh.common.util.LibaoUtils import com.gh.common.util.PlatformUtils import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder import com.gh.gamecenter.common.utils.setRootBackgroundColor import com.gh.gamecenter.databinding.LibaoItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/libao/LibaoSearchAdapter.kt b/app/src/main/java/com/gh/gamecenter/libao/LibaoSearchAdapter.kt index c589fbf38c..3454b39115 100644 --- a/app/src/main/java/com/gh/gamecenter/libao/LibaoSearchAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/libao/LibaoSearchAdapter.kt @@ -11,7 +11,7 @@ import com.gh.common.util.PlatformUtils import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.core.utils.UrlFilterUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.LibaoNormalViewHolder import com.gh.gamecenter.common.utils.setRootBackgroundColor import com.gh.gamecenter.databinding.LibaoItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java index b9a4acb261..0ffb9f3086 100644 --- a/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/message/KeFuFragmentAdapter.java @@ -31,7 +31,7 @@ import com.gh.gamecenter.GameDetailActivity; import com.gh.gamecenter.ImageViewerActivity; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.MessageKefuItemBinding; import com.gh.gamecenter.energy.view.EnergyCenterActivity; diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java b/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java index 2e0aa914b8..91e6346f21 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageAdapter.java @@ -12,7 +12,7 @@ import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.common.databind.BindingAdapters; import com.gh.gamecenter.common.utils.DialogHelper; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.MessageItemBinding; import com.gh.gamecenter.databinding.MessageItemTopBinding; diff --git a/app/src/main/java/com/gh/gamecenter/message/MessageNormalAdapter.java b/app/src/main/java/com/gh/gamecenter/message/MessageNormalAdapter.java index 16f5cfb147..8ac3218c8d 100644 --- a/app/src/main/java/com/gh/gamecenter/message/MessageNormalAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/message/MessageNormalAdapter.java @@ -10,7 +10,7 @@ import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.utils.DialogHelper; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.MessageItemBinding; import com.gh.gamecenter.entity.MessageEntity; diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameAdapter.kt index 6890886060..5a5aae1620 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyFollowedGameAdapter.kt @@ -17,7 +17,7 @@ import com.gh.common.util.NewFlatLogUtils import com.gh.gamecenter.common.view.DrawableView import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/mygame/MyReservationAdapter.kt b/app/src/main/java/com/gh/gamecenter/mygame/MyReservationAdapter.kt index b0271ffca9..99c6105792 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/MyReservationAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/MyReservationAdapter.kt @@ -16,7 +16,7 @@ import com.gh.common.exposure.IExposable import com.gh.common.util.* import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.CancelListener diff --git a/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameAdapter.kt index 8e2ec0a464..b959efb93b 100644 --- a/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/mygame/PlayedGameAdapter.kt @@ -26,7 +26,7 @@ import com.gh.gamecenter.common.view.BugFixedPopupWindow import com.gh.gamecenter.common.view.DrawableView import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.callback.CancelListener diff --git a/app/src/main/java/com/gh/gamecenter/mypost/MyPostAdapter.kt b/app/src/main/java/com/gh/gamecenter/mypost/MyPostAdapter.kt index 8916500121..da88ac0083 100644 --- a/app/src/main/java/com/gh/gamecenter/mypost/MyPostAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/mypost/MyPostAdapter.kt @@ -8,7 +8,7 @@ import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt b/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt index f83b611194..625715ace8 100644 --- a/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personal/PersonalFunctionAdapter.kt @@ -9,7 +9,6 @@ import android.view.ViewGroup import android.widget.ImageView import android.widget.TextView import androidx.recyclerview.widget.RecyclerView -import com.alibaba.android.arouter.launcher.ARouter import com.facebook.drawee.view.SimpleDraweeView import com.gh.common.util.CheckLoginUtils import com.gh.common.util.DataCollectionUtils @@ -17,8 +16,6 @@ import com.gh.common.util.DirectUtils import com.gh.common.util.NewLogUtils import com.gh.gamecenter.* import com.gh.gamecenter.common.constant.Constants -import com.gh.gamecenter.common.constant.EntranceConsts -import com.gh.gamecenter.common.constant.RouteConsts import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.ImageUtils import com.gh.gamecenter.common.utils.PermissionHelper diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansAdapter.kt index 3d549b7c85..9a2e84bcae 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/FollowersOrFansAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.common.util.DialogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.common.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryAdapter.kt index 13b6a3ee71..182ae01760 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserHistoryAdapter.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.common.util.DialogUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.PersonalHomeRatingViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryAdapter.kt index ea02ffe549..d99470b51f 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/UserVideoHistoryAdapter.kt @@ -8,7 +8,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.DirectUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.VideoNewItemBinding import com.gh.gamecenter.entity.MyVideoEntity diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryAdapter.kt index 7a6d3c4d17..5ef7cc23d3 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserCommentHistoryAdapter.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameAdapter.kt index 395c6e96e2..b942c29c45 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/home/game/UserPlayedGameAdapter.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.core.utils.NumberUtils diff --git a/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingAdapter.kt b/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingAdapter.kt index 1912a35618..1ddf42756b 100644 --- a/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/personalhome/rating/RatingAdapter.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.utils.fromHtml import com.gh.gamecenter.common.utils.setTextWithHighlightedTextWrappedInsideWrapper import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.PersonalHomeRatingViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.NormalListViewModel diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftAdapter.java index 81a187b584..dce4a5ec1e 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/draft/AnswerDraftAdapter.java @@ -15,7 +15,7 @@ import com.gh.gamecenter.common.utils.DialogHelper; import com.gh.gamecenter.common.utils.ImageUtils; import com.gh.gamecenter.common.utils.PermissionHelper; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.common.baselist.ListViewModel; import com.gh.gamecenter.common.baselist.LoadType; diff --git a/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldAdapter.java index 5c841c0b2c..4443af6b39 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/answer/fold/AnswerFoldAdapter.java @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.CommunityAnswerItemBinding; import com.gh.gamecenter.qa.answer.CommunityAnswerItemViewHolder; diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleAdapter.kt index 7835c57b61..cddebfb23f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/MyArticleAdapter.kt @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.databinding.CommunityAnswerItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListAdapter.kt index 6f1843e72e..9a7364f997 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/SimpleArticleListAdapter.kt @@ -7,7 +7,7 @@ //import com.gh.gamecenter.common.constant.ItemViewType //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.gamecenter.R -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +//import com.gh.gamecenter.common.viewholder.FooterViewHolder //import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding //import com.gh.gamecenter.login.user.UserManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/article/draft/ArticleDraftAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/article/draft/ArticleDraftAdapter.kt index a90a2fdc57..8d82600e68 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/article/draft/ArticleDraftAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/article/draft/ArticleDraftAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.CommunityArticleDraftItemBinding import com.gh.gamecenter.qa.entity.ArticleDraftEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnAdapter.kt deleted file mode 100644 index cccba1b17d..0000000000 --- a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnAdapter.kt +++ /dev/null @@ -1,62 +0,0 @@ -//package com.gh.gamecenter.qa.column -// -//import android.content.Context -//import android.view.ViewGroup -//import com.gh.gamecenter.common.base.BaseRecyclerViewHolder -//import com.gh.common.util.DataUtils -//import com.gh.gamecenter.R -//import com.gh.gamecenter.databinding.AskColumnTagItemBinding -//import com.gh.gamecenter.login.user.UserManager -//import com.gh.gamecenter.qa.column.detail.AskColumnDetailActivity -//import com.gh.gamecenter.qa.column.order.AskTabOrderActivity -//import com.gh.gamecenter.qa.entity.AskTagGroupsEntity -//import com.lightgame.adapter.BaseRecyclerAdapter -// -//class AskColumnAdapter(context: Context) : BaseRecyclerAdapter(context) { -// -// private var mListData: MutableList? = null -// -// fun setListData(listData: List) { -// this.mListData = listData as MutableList -// notifyDataSetChanged() -// } -// -// override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AskColumnTabItemViewHolder { -// val bind = AskColumnTagItemBinding.bind(mLayoutInflater.inflate(R.layout.ask_column_tag_item, parent, false)) -// return AskColumnTabItemViewHolder(bind) -// } -// -// override fun onBindViewHolder(holder: AskColumnTabItemViewHolder, position: Int) { -// val entity = if (position == itemCount - 1) { // 跳转排序按钮 -// val orderEntity = AskTagGroupsEntity() -// orderEntity.name = "调整排序" -// orderEntity.icon = "res:///" + R.drawable.ask_column_tag_order -// orderEntity -// } else { -// mListData?.get(position) -// } -// holder.binding.entity = entity -// holder.itemView.setOnClickListener { -// if (position == itemCount - 1) { -// DataUtils.onMtaEvent(mContext, "问答页面", -// CommunityManager.getInstance().community.name, "专栏-调整排序") -// mContext.startActivity(AskTabOrderActivity.getIntent(mContext)) -// } else { -// DataUtils.onMtaEvent(mContext, "问答页面", -// CommunityManager.getInstance().community.name, "专栏-" + entity?.name) -// mContext.startActivity(AskColumnDetailActivity.getIntentByColumn(mContext, entity!!, CommunityManager.getInstance().community, "", "问答-专栏")) -// } -// } -// } -// -// override fun getItemCount(): Int { -// if (mListData != null && mListData!!.size > 0) { -// return mListData!!.size + 1 -// } -// return 0 -// } -// -// class AskColumnTabItemViewHolder(bind: AskColumnTagItemBinding) : BaseRecyclerViewHolder(bind.root) { -// val binding = bind -// } -//} diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnFragment.kt b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnFragment.kt deleted file mode 100644 index 9720f4d8d2..0000000000 --- a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnFragment.kt +++ /dev/null @@ -1,65 +0,0 @@ -//package com.gh.gamecenter.qa.column -// -//import android.os.Bundle -//import android.view.View -//import androidx.core.content.ContextCompat -//import androidx.lifecycle.Observer -//import androidx.lifecycle.ViewModelProviders -//import androidx.recyclerview.widget.GridLayoutManager -//import com.gh.gamecenter.common.base.fragment.BaseFragment -//import com.gh.gamecenter.common.view.GridDivider -//import com.gh.gamecenter.R -//import com.gh.gamecenter.databinding.FragmentAskColumnBinding -//import com.halo.assistant.HaloApp -// -//class AskColumnFragment : BaseFragment() { -// -// private lateinit var mBinding: FragmentAskColumnBinding -// -// private var mViewModel: AskColumnViewModel? = null -// -// private var mLayoutManager: GridLayoutManager? = null -// -// private var mAdapter: AskColumnAdapter? = null -// -// override fun getLayoutId(): Int { -// return R.layout.fragment_ask_column -// } -// -// override fun onCreate(savedInstanceState: Bundle?) { -// super.onCreate(savedInstanceState) -// mBinding = FragmentAskColumnBinding.bind(mCachedView) -// val factory = AskColumnViewModel.Factory(HaloApp.getInstance().application) -// mViewModel = ViewModelProviders.of(this, factory).get(AskColumnViewModel::class.java) -// mViewModel?.tagGroupsObservable?.observe(this, Observer { -// if (it != null) { -// mAdapter?.setListData(it) -// } else { -// // null || no_connection 不会出现这一栏 -// } -// }) -// } -// -// override fun onViewCreated(view: View, savedInstanceState: Bundle?) { -// super.onViewCreated(view, savedInstanceState) -// mAdapter = AskColumnAdapter(requireContext()) -// mLayoutManager = GridLayoutManager(context, 2) -// mBinding.askColumnList.addItemDecoration( -// GridDivider( -// context, 2, 2, -// ContextCompat.getColor(requireContext(), R.color.cutting_line) -// ) -// ) -// mBinding.askColumnList.layoutManager = mLayoutManager -// mBinding.askColumnList.adapter = mAdapter -// } -// -// fun scrollToTop(smooth: Boolean) { -// mBinding.askColumnList.stopScroll() -// if (smooth) { -// mLayoutManager?.smoothScrollToPosition(mBinding.askColumnList, null, 0) -// } else { -// mLayoutManager?.scrollToPosition(0) -// } -// } -//} diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnRepository.java b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnRepository.java deleted file mode 100644 index 2c52aa2a50..0000000000 --- a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnRepository.java +++ /dev/null @@ -1,187 +0,0 @@ -//package com.gh.gamecenter.qa.column; -// -//import androidx.lifecycle.MutableLiveData; -//import android.content.Context; -//import android.text.TextUtils; -// -//import com.gh.common.util.ErrorHelper; -//import com.gh.gamecenter.core.utils.GsonUtils; -//import com.gh.gamecenter.login.user.UserManager; -//import com.gh.gamecenter.manager.CommunityManager; -//import com.gh.gamecenter.qa.entity.AskTagGroupsEntity; -//import com.gh.gamecenter.common.retrofit.Response; -//import com.gh.gamecenter.retrofit.RetrofitManager; -//import com.gh.gamecenter.common.retrofit.ApiResponse; -//import com.halo.assistant.HaloApp; -// -//import java.util.ArrayList; -//import java.util.Collections; -//import java.util.List; -// -//import io.reactivex.android.schedulers.AndroidSchedulers; -//import io.reactivex.schedulers.Schedulers; -//import okhttp3.MediaType; -//import okhttp3.RequestBody; -//import okhttp3.ResponseBody; -//import retrofit2.HttpException; -// -///** -// * Created by khy on 13/12/17. -// */ -// -//public class AskColumnRepository { -// -// private Context mContext; -// -// private List mCacheTagGroupsList = new ArrayList<>(); -// private MutableLiveData> mObservableTagGroupsList = new MutableLiveData<>(); -// -// private String mCurCommunityId; -// -// public static AskColumnRepository getInstance() { -// return SingletonHolder.INSTANCE; -// } -// -// public AskColumnRepository() { -// mContext = HaloApp.getInstance().getApplicationContext(); -// loadUserTagGroups(); -// } -// -// private void loadUserTagGroups() { -// mCurCommunityId = UserManager.getInstance().getUserId(); -// RetrofitManager.getInstance().getApi() -// .getUserAskColumnsTags(UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new Response>() { -// @Override -// public void onResponse(List response) { -// super.onResponse(response); -// loadDefaultTagGroups(response); -// } -// -// @Override -// public void onApiFailure(ApiResponse> e) { -// super.onApiFailure(e); -// loadDefaultTagGroups(null); -// } -// }); -// } -// -// private void loadDefaultTagGroups(List userEntity) { -// RetrofitManager.getInstance().getApi() -// .getAskColumnsTags(CommunityManager.getInstance().getCommunity().getId()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new Response>() { -// @Override -// public void onResponse(List response) { -// super.onResponse(response); -// if (userEntity != null) { -// for (AskTagGroupsEntity userGroupsEntity : userEntity) { -// for (AskTagGroupsEntity defaultGroupsEntity : response) { -// if (userGroupsEntity.getId().equals(defaultGroupsEntity.getId())) { -// defaultGroupsEntity.setOrder(userGroupsEntity.getOrder()); -// } -// } -// } -// Collections.sort(response, (t0, t1) -> t0.getOrder() - t1.getOrder()); -// } -// cacheAndNotifyTagGroups(response); -// } -// -// @Override -// public void onApiFailure(ApiResponse> e) { -// super.onApiFailure(e); -// cacheAndNotifyTagGroups(null); -// } -// }); -// } -// -// private void postUserAskTagGroups(List tagGroupsEntity) { -// if (tagGroupsEntity == null || tagGroupsEntity.size() == 0) return; -// -// List entity = new ArrayList<>(tagGroupsEntity); -// for (int i = 0; i < entity.size(); i++) { -// entity.get(i).setOrder(i); -// } -// -// RequestBody body = RequestBody.create(MediaType.parse("application/json"), GsonUtils.toJson(entity)); -// -// RetrofitManager.getInstance().getApi() -// .patchUserAskColumnsTags(body, UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new Response() { -// @Override -// public void onResponse(ResponseBody response) { -// super.onResponse(response); -// } -// -// @Override -// public void onFailure(HttpException e) { -// super.onFailure(e); -// String errorString = null; -// try { -// errorString = e.response().errorBody().string(); -// } catch (Exception e1) { -// e1.printStackTrace(); -// } -// ErrorHelper.handleError(mContext, errorString, false, null); -// } -// }); -// -// } -// -// private void deleteUserAskTagGroups() { -// RetrofitManager.getInstance() -// .getApi() -// .deleteUserAskColumnsTags(UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new Response() { -// @Override -// public void onResponse(ResponseBody response) { -// super.onResponse(response); -// } -// }); -// } -// -// -// public void cacheAndNotifyTagGroups(List tagGroups) { -// mCacheTagGroupsList = tagGroups; -// mObservableTagGroupsList.postValue(tagGroups); -// } -// -// public MutableLiveData> getTagGroupsObservable() { -// if (mCacheTagGroupsList != null) { -// mObservableTagGroupsList.postValue(mCacheTagGroupsList); -// } -// return mObservableTagGroupsList; -// } -// -// public String getCurCommunityId() { -// return mCurCommunityId; -// } -// -// public void retry() { -// loadUserTagGroups(); -// } -// -// public void reset() { -// loadDefaultTagGroups(null); -// if (!TextUtils.isEmpty(UserManager.getInstance().getToken())) { -// deleteUserAskTagGroups(); -// } -// } -// -// public void update(List entity) { -// if (!TextUtils.isEmpty(UserManager.getInstance().getToken())) { -// postUserAskTagGroups(entity); -// } -// } -// -// private static class SingletonHolder { -// private static final AskColumnRepository INSTANCE = new AskColumnRepository(); -// } -//} diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnViewModel.kt b/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnViewModel.kt deleted file mode 100644 index 9436cf12b0..0000000000 --- a/app/src/main/java/com/gh/gamecenter/qa/column/AskColumnViewModel.kt +++ /dev/null @@ -1,50 +0,0 @@ -//package com.gh.gamecenter.qa.column -// -//import android.app.Application -//import androidx.lifecycle.* -//import android.text.TextUtils -//import com.gh.gamecenter.login.user.UserManager -//import com.gh.gamecenter.qa.entity.AskTagGroupsEntity -// -//class AskColumnViewModel(application: Application, private val mRepository: AskColumnRepository) : AndroidViewModel(application) { -// -// private var mObservableTagGroupsList = MutableLiveData>() -// -// val tagGroupsObservable: LiveData> -// get() = mObservableTagGroupsList -// -// init { -// mObservableTagGroupsList = mRepository.tagGroupsObservable -// if (TextUtils.isEmpty(mRepository.curCommunityId) || -// mRepository.curCommunityId == CommunityManager.getInstance().community.id) { -// retry() -// } -// } -// -// fun cacheAndNotifyTagGroups(tagGroups: List) { -// mRepository.cacheAndNotifyTagGroups(tagGroups) -// } -// -// fun reset() { -// mRepository.reset() -// } -// -// fun update(entity: List) { -// mRepository.update(entity) -// } -// -// fun retry() { -// mRepository.retry() -// } -// -// class Factory(private val mApplication: Application) : ViewModelProvider.NewInstanceFactory() { -// -// private val mRepository: AskColumnRepository = AskColumnRepository.getInstance() -// -// override fun create(modelClass: Class): T { -// -// return AskColumnViewModel(mApplication, mRepository) as T -// } -// } -// -//} diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotAdapter.kt index 09b3228603..c65bb9e788 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/hot/HotAdapter.kt @@ -6,7 +6,7 @@ //import com.gh.gamecenter.common.constant.ItemViewType //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.gamecenter.R -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +//import com.gh.gamecenter.common.viewholder.FooterViewHolder //import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding //import com.gh.gamecenter.common.entity.CommunityEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsAdapter.kt index 3e0bd1b323..c01a82c492 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/recommends/RecommendsAdapter.kt @@ -6,7 +6,7 @@ //import com.gh.gamecenter.common.constant.ItemViewType //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.gamecenter.R -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +//import com.gh.gamecenter.common.viewholder.FooterViewHolder //import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding //import com.gh.gamecenter.entity.SpecialColumn diff --git a/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredAdapter.kt index 91e5d788bb..91ae04fb2e 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/column/detail/unanswered/UnansweredAdapter.kt @@ -6,7 +6,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.CommunityQuestionItemBinding import com.gh.gamecenter.entity.SpecialColumn diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentAdapter.kt index e9b4fa8f5b..e939c8f02b 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/NewCommentAdapter.kt @@ -11,7 +11,7 @@ import com.gh.common.util.* import com.gh.gamecenter.R import com.gh.gamecenter.adapter.OnCommentCallBackListener import com.gh.gamecenter.adapter.viewholder.AnswerCommentViewHolder -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.ConfirmListener import com.gh.gamecenter.core.utils.SpanBuilder diff --git a/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentAdapter.kt index 1ed7b98b9b..558c711d66 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/comment/StairsCommentAdapter.kt @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.R import com.gh.gamecenter.adapter.OnCommentCallBackListener -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.StairsCommentItemBinding import com.gh.gamecenter.entity.CommentEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerAdapter.kt index 121d3edd18..6e536d5569 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/dialog/ChooseForumContainerAdapter.kt @@ -9,7 +9,7 @@ import com.gh.gamecenter.common.base.BaseRecyclerViewHolder import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.fromHtml import com.gh.gamecenter.common.utils.toBinding diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerAdapter.kt index fc69ee9694..fed54417a7 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/AnswerAdapter.kt @@ -7,7 +7,7 @@ import android.view.View import android.view.ViewGroup import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.collection.AnswerFragment import com.gh.gamecenter.databinding.AskAnswerItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleAdapter.kt index 5b4fdff9c2..d48ffbf5cd 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/ArticleAdapter.kt @@ -9,7 +9,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.collection.CollectionCommunityArticleViewHolder import com.gh.gamecenter.common.callback.ConfirmListener diff --git a/app/src/main/java/com/gh/gamecenter/qa/editor/VideoAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/editor/VideoAdapter.kt index b460832c07..be4169d298 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/editor/VideoAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/editor/VideoAdapter.kt @@ -8,7 +8,7 @@ import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.core.utils.SPUtils diff --git a/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowAdapter.kt index 81d6b084b2..e02bbd8ee0 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/follow/AskFollowAdapter.kt @@ -9,7 +9,7 @@ package com.gh.gamecenter.qa.follow //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.common.util.* //import com.gh.gamecenter.R -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +//import com.gh.gamecenter.common.viewholder.FooterViewHolder //import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityFollowItemBinding //import com.gh.gamecenter.entity.PersonalHistoryEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsAdapter.java index 534795664f..821854b99c 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/ConcernQuestionsAdapter.java @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.CommunityQuestionItemBinding; import com.gh.gamecenter.qa.entity.Questions; diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerAdapter.java index 5df0337dbe..4426d811b6 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyAnswerAdapter.java @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.core.utils.DisplayUtils; import com.gh.gamecenter.databinding.CommunityAnswerItemBinding; diff --git a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsAdapter.java index fc56078b5e..4776e783aa 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/myqa/MyQuestionsAdapter.java @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.constant.ItemViewType; import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.databinding.CommunityQuestionItemBinding; import com.gh.gamecenter.qa.entity.Questions; diff --git a/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyAdapter.java index 9d0e8acad4..420280472a 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/newest/AskQuestionsNewBodyAdapter.java @@ -10,7 +10,7 @@ //import com.gh.gamecenter.common.constant.ItemViewType; //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler; //import com.gh.gamecenter.R; -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +//import com.gh.gamecenter.common.viewholder.FooterViewHolder; //import com.gh.gamecenter.common.baselist.ListAdapter; //import com.gh.gamecenter.databinding.CommunityQuestionItemBinding; //import com.gh.gamecenter.qa.entity.Questions; diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailAdapter.kt index a43d4cc32d..5393849cbc 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/detail/QuestionsDetailAdapter.kt @@ -21,7 +21,7 @@ //import com.gh.common.util.* //import com.gh.gamecenter.common.view.DrawableView //import com.gh.gamecenter.R -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +//import com.gh.gamecenter.common.viewholder.FooterViewHolder //import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder //import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftAdapter.kt index d488a160c1..85caa3ea06 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/draft/QuestionDraftAdapter.kt @@ -11,7 +11,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.CommunityQuestionDraftItemBinding import com.gh.gamecenter.qa.entity.QuestionDraftEntity diff --git a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteAdapter.kt index d555fca64b..b027ad9db3 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/questions/invite/QuestionsInviteAdapter.kt @@ -8,7 +8,7 @@ import com.gh.gamecenter.common.callback.OnListClickListener import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.DirectUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.QuestioninviteHeaderItemBinding import com.gh.gamecenter.databinding.QuestionsinviteItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsAdapter.java index 7b81d97520..b173a5ad20 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/AskQuestionsRecommendsAdapter.java @@ -16,7 +16,7 @@ //import com.gh.gamecenter.common.utils.DialogHelper; //import com.gh.gamecenter.core.utils.MtaHelper; //import com.gh.gamecenter.R; -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +//import com.gh.gamecenter.common.viewholder.FooterViewHolder; //import com.gh.gamecenter.adapter.viewholder.ReuseViewHolder; //import com.gh.gamecenter.common.baselist.ListAdapter; //import com.gh.gamecenter.databinding.AskRecommendsItemConcernBinding; diff --git a/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestAdapter.kt index 95987c5bca..6529c7b39e 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/recommends/newest/RecommendNewestAdapter.kt @@ -7,7 +7,7 @@ //import com.gh.gamecenter.common.constant.ItemViewType //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.gamecenter.R -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +//import com.gh.gamecenter.common.viewholder.FooterViewHolder //import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.databinding.CommunityAnswerItemBinding //import com.gh.gamecenter.login.user.UserManager diff --git a/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchAdapter.kt index 5e79904a32..a6a34c0638 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/search/base/BaseAskSearchAdapter.kt @@ -8,7 +8,7 @@ //import com.gh.gamecenter.common.syncpage.ISyncAdapterHandler //import com.gh.common.util.DirectUtils //import com.gh.gamecenter.R -//import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +//import com.gh.gamecenter.common.viewholder.FooterViewHolder //import com.gh.gamecenter.common.baselist.ListAdapter //import com.gh.gamecenter.common.baselist.ListViewModel //import com.gh.gamecenter.db.AskSearchHistoryDao diff --git a/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectAdapter.java index 6f3196f21e..0fd5ad9104 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectAdapter.java +++ b/app/src/main/java/com/gh/gamecenter/qa/subject/AskSubjectAdapter.java @@ -7,7 +7,7 @@ import android.view.ViewGroup; import androidx.core.content.ContextCompat; import androidx.recyclerview.widget.RecyclerView; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.common.baselist.ListAdapter; import com.gh.gamecenter.common.callback.OnListClickListener; import com.gh.gamecenter.common.constant.ItemViewType; diff --git a/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewRepository.java b/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewRepository.java deleted file mode 100644 index a16468dc90..0000000000 --- a/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewRepository.java +++ /dev/null @@ -1,189 +0,0 @@ -//package com.gh.gamecenter.qa.tags; -// -//import androidx.lifecycle.MutableLiveData; -//import android.content.Context; -//import android.text.TextUtils; -// -//import com.gh.common.util.ErrorHelper; -//import com.gh.gamecenter.core.utils.GsonUtils; -//import com.gh.gamecenter.R; -//import com.gh.gamecenter.login.user.UserManager; -//import com.gh.gamecenter.manager.CommunityManager; -//import com.gh.gamecenter.qa.entity.AskTagGroupsEntity; -//import com.gh.gamecenter.common.retrofit.Response; -//import com.gh.gamecenter.retrofit.RetrofitManager; -//import com.gh.gamecenter.common.retrofit.ApiResponse; -//import com.halo.assistant.HaloApp; -// -//import java.util.ArrayList; -//import java.util.Collections; -//import java.util.List; -// -//import io.reactivex.android.schedulers.AndroidSchedulers; -//import io.reactivex.schedulers.Schedulers; -//import okhttp3.MediaType; -//import okhttp3.RequestBody; -//import okhttp3.ResponseBody; -//import retrofit2.HttpException; -// -///** -// * Created by khy on 13/12/17. -// */ -// -//public class AskQuestionsNewRepository { -// -// private Context mContext; -// -// private List mCacheTagGroupsList = new ArrayList<>(); -// private MutableLiveData> mObservableTagGroupsList = new MutableLiveData<>(); -// -// public static AskQuestionsNewRepository getInstance() { -// return SingletonHolder.INSTANCE; -// } -// -// public AskQuestionsNewRepository() { -// mContext = HaloApp.getInstance().getApplicationContext(); -// loadUserTagGroups(); -// } -// -// private void loadUserTagGroups() { -// RetrofitManager.getInstance().getApi() -// .getUserAskTagGroups(UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new Response>() { -// @Override -// public void onResponse(List response) { -// super.onResponse(response); -// loadDefaultTagGroups(response); -// } -// -// @Override -// public void onApiFailure(ApiResponse> e) { -// super.onApiFailure(e); -// loadDefaultTagGroups(null); -// } -// }); -// } -// -// private void loadDefaultTagGroups(List userEntity) { -// RetrofitManager.getInstance().getApi() -// .getDefaultAskTagGroups(CommunityManager.getInstance().getCommunity().getId()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new Response>() { -// @Override -// public void onResponse(List response) { -// super.onResponse(response); -// AskTagGroupsEntity tagGroupsEntity = new AskTagGroupsEntity(); -// tagGroupsEntity.setIcon("res:///" + R.drawable.ask_tab_new_icon); -// tagGroupsEntity.setOrder(0); -// tagGroupsEntity.setName("最新"); -// response.add(0, tagGroupsEntity); -// -// if (userEntity != null) { -// for (AskTagGroupsEntity userGroupsEntity : userEntity) { -// for (AskTagGroupsEntity defaultGroupsEntity : response) { -// if (userGroupsEntity.getId().equals(defaultGroupsEntity.getId())) { -// defaultGroupsEntity.setOrder(userGroupsEntity.getOrder()); -// } -// } -// } -// Collections.sort(response, (t0, t1) -> t0.getOrder() - t1.getOrder()); -// } -// cacheAndNotifyTagGroups(response); -// } -// -// @Override -// public void onApiFailure(ApiResponse> e) { -// super.onApiFailure(e); -// cacheAndNotifyTagGroups(null); -// } -// }); -// } -// -// private void postUserAskTagGroups(List tagGroupsEntity) { -// if (tagGroupsEntity == null || tagGroupsEntity.size() == 0) return; -// -// List entity = new ArrayList<>(tagGroupsEntity); -// for (int i = 0; i < entity.size(); i++) { -// entity.get(i).setOrder(i); -// } -// -// if ("全部".equals(entity.get(0).getName())) entity.remove(0); -// -// RequestBody body = RequestBody.create(MediaType.parse("application/json"), GsonUtils.toJson(entity)); -// -// RetrofitManager.getInstance().getApi() -// .postUserAskTagGroups(body, UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new Response() { -// @Override -// public void onResponse(ResponseBody response) { -// super.onResponse(response); -// } -// -// @Override -// public void onFailure(HttpException e) { -// super.onFailure(e); -// String errorString = null; -// try { -// errorString = e.response().errorBody().string(); -// } catch (Exception e1) { -// e1.printStackTrace(); -// } -// ErrorHelper.handleError(mContext, errorString, false, null); -// } -// }); -// -// } -// -// private void deleteUserAskTagGroups() { -// RetrofitManager.getInstance() -// .getApi() -// .deleteUserAskTagGroups(UserManager.getInstance().getUserId(), CommunityManager.getInstance().getCommunity().getId()) -// .subscribeOn(Schedulers.io()) -// .observeOn(AndroidSchedulers.mainThread()) -// .subscribe(new Response() { -// @Override -// public void onResponse(ResponseBody response) { -// super.onResponse(response); -// } -// }); -// } -// -// -// public void cacheAndNotifyTagGroups(List tagGroups) { -// mCacheTagGroupsList = tagGroups; -// mObservableTagGroupsList.postValue(tagGroups); -// } -// -// public MutableLiveData> getTagGroupsObservable() { -// if (mCacheTagGroupsList != null) { -// mObservableTagGroupsList.postValue(mCacheTagGroupsList); -// } -// return mObservableTagGroupsList; -// } -// -// public void repty() { -// loadUserTagGroups(); -// } -// -// public void reset() { -// loadDefaultTagGroups(null); -// if (!TextUtils.isEmpty(UserManager.getInstance().getToken())) { -// deleteUserAskTagGroups(); -// } -// } -// -// public void update(List entity) { -// if (!TextUtils.isEmpty(UserManager.getInstance().getToken())) { -// postUserAskTagGroups(entity); -// } -// } -// -// private static class SingletonHolder { -// private static final AskQuestionsNewRepository INSTANCE = new AskQuestionsNewRepository(); -// } -//} diff --git a/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewViewModel.java b/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewViewModel.java deleted file mode 100644 index 647761e2fe..0000000000 --- a/app/src/main/java/com/gh/gamecenter/qa/tags/AskQuestionsNewViewModel.java +++ /dev/null @@ -1,69 +0,0 @@ -//package com.gh.gamecenter.qa.tags; -// -//import android.app.Application; -//import androidx.lifecycle.AndroidViewModel; -//import androidx.lifecycle.LiveData; -//import androidx.lifecycle.MutableLiveData; -//import androidx.lifecycle.ViewModel; -//import androidx.lifecycle.ViewModelProvider; -//import androidx.annotation.NonNull; -// -//import com.gh.gamecenter.qa.entity.AskTagGroupsEntity; -// -//import java.util.List; -// -///** -// * Created by khy on 13/12/17. -// */ -// -//public class AskQuestionsNewViewModel extends AndroidViewModel { -// -// private AskQuestionsNewRepository mRepository; -// -// private MutableLiveData> mObservableTagGroupsList = new MutableLiveData<>(); -// -// public AskQuestionsNewViewModel(@NonNull Application application, AskQuestionsNewRepository repository) { -// super(application); -// mRepository = repository; -// mObservableTagGroupsList = repository.getTagGroupsObservable(); -// } -// -// public void cacheAndNotifyTagGroups(List tagGroups) { -// mRepository.cacheAndNotifyTagGroups(tagGroups); -// } -// -// public LiveData> getTagGroupsObservable() { -// return mObservableTagGroupsList; -// } -// -// public void reset() { -// mRepository.reset(); -// } -// -// public void update(List entity) { -// mRepository.update(entity); -// } -// -// public void repty() { -// mRepository.repty(); -// } -// -// public static class Factory extends ViewModelProvider.NewInstanceFactory { -// @NonNull -// private final Application mApplication; -// -// private final AskQuestionsNewRepository mRepository; -// -// public Factory(@NonNull Application application) { -// mApplication = application; -// mRepository = AskQuestionsNewRepository.getInstance(); -// } -// -// @Override -// public T create(Class modelClass) { -// //noinspection unchecked -// return (T) new AskQuestionsNewViewModel(mApplication, mRepository); -// } -// } -// -//} diff --git a/app/src/main/java/com/gh/gamecenter/qa/tags/AskTagPagerFragmentAdapter.java b/app/src/main/java/com/gh/gamecenter/qa/tags/AskTagPagerFragmentAdapter.java deleted file mode 100644 index 0f6fc97f9a..0000000000 --- a/app/src/main/java/com/gh/gamecenter/qa/tags/AskTagPagerFragmentAdapter.java +++ /dev/null @@ -1,33 +0,0 @@ -//package com.gh.gamecenter.qa.tags; -// -//import androidx.fragment.app.Fragment; -//import androidx.fragment.app.FragmentManager; -//import androidx.fragment.app.FragmentStatePagerAdapter; -// -//import com.gh.gamecenter.qa.newest.AskQuestionsNewBodyFragment; -//import com.gh.gamecenter.qa.entity.AskTagGroupsEntity; -// -//import java.util.List; -// -///** -// * Created by khy on 28/01/18. -// */ -// -//public class AskTagPagerFragmentAdapter extends FragmentStatePagerAdapter { -// private List mTagList; -// -// public AskTagPagerFragmentAdapter(FragmentManager fm, List tagList) { -// super(fm); -// mTagList = tagList; -// } -// -// @Override -// public Fragment getItem(int position) { -// return AskQuestionsNewBodyFragment.newInstance(mTagList.get(position).getName()); -// } -// -// @Override -// public int getCount() { -// return mTagList.size(); -// } -//} diff --git a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescAdapter.kt b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescAdapter.kt index be071b8399..8dceb0979f 100644 --- a/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/qa/video/detail/desc/VideoDescAdapter.kt @@ -9,7 +9,7 @@ import com.gh.common.util.NewLogUtils import com.gh.gamecenter.core.utils.TimeUtils import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.entity.VideoDescItemEntity import com.gh.gamecenter.qa.video.detail.ForumVideoDetailActivity diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchDefaultFragment.kt b/app/src/main/java/com/gh/gamecenter/search/SearchDefaultFragment.kt index 6d2137db6c..8961b6efbb 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchDefaultFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchDefaultFragment.kt @@ -183,41 +183,55 @@ open class SearchDefaultFragment : BaseFragment() { updateTabStyle(tab, true) } }) - post { - var tabLayoutWidth = 8F.dip2px() + 8F.dip2px() - if (childCount > 0) { - val viewGroup = getChildAt(0) as ViewGroup - for (i in 0 until viewGroup.childCount) { - val tab = viewGroup.getChildAt(i) ?: continue - tabLayoutWidth += tab.width - } + handleTabLayoutBorder() + } + } + } + + private fun handleTabLayoutBorder() { + mBinding.rankTabLayout.run { + post { + val screenWidth = resources.displayMetrics.widthPixels + var tabLayoutWidth = getTabLayoutWidth() + if (screenWidth >= tabLayoutWidth) { + (layoutParams as ViewGroup.MarginLayoutParams).apply { + leftMargin = 8F.dip2px() + rightMargin = 8F.dip2px() + layoutParams = this } - if (screenWidth >= tabLayoutWidth) { + clipToPadding = true + } else { + val paddingOffset = (tabLayoutWidth - screenWidth) / 2 + if (paddingOffset < 8F.dip2px()) { (layoutParams as ViewGroup.MarginLayoutParams).apply { - leftMargin = 8F.dip2px() - rightMargin = 8F.dip2px() + leftMargin = 8F.dip2px() - paddingOffset + rightMargin = 8F.dip2px() - paddingOffset layoutParams = this } - clipToPadding = true + setPadding(paddingOffset, 16F.dip2px(), paddingOffset, 0) } else { - val paddingOffset = (tabLayoutWidth - screenWidth) / 2 - if (paddingOffset < 8F.dip2px()) { - (layoutParams as ViewGroup.MarginLayoutParams).apply { - leftMargin = 8F.dip2px() - paddingOffset - rightMargin = 8F.dip2px() - paddingOffset - layoutParams = this - } - setPadding(paddingOffset, 16F.dip2px(), paddingOffset, 0) - } else { - setPadding(8F.dip2px(), 16F.dip2px(), 8F.dip2px(), 0) - } - clipToPadding = false + setPadding(8F.dip2px(), 16F.dip2px(), 8F.dip2px(), 0) } + clipToPadding = false } } } } + private fun getTabLayoutWidth(): Int { + mBinding.rankTabLayout.run { + var tabLayoutWidth = 8F.dip2px() + 8F.dip2px() + if (childCount > 0) { + val viewGroup = getChildAt(0) as ViewGroup + for (i in 0 until viewGroup.childCount) { + val tab = viewGroup.getChildAt(i) ?: continue + tabLayoutWidth += tab.width + } + } + return tabLayoutWidth + } + } + fun updateTabStyle(tab: TabLayout.Tab?, isChecked: Boolean) { tab?.customView?.findViewById(R.id.tabTitle)?.isChecked = isChecked } diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt index 039c322b91..0502860db2 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultAdapter.kt @@ -25,7 +25,7 @@ import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R import com.gh.gamecenter.SearchType import com.gh.gamecenter.SuggestionActivity -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.adapter.viewholder.SearchGameFooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt index fcaaab5b76..4d65b92cb0 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultFragment.kt @@ -146,23 +146,27 @@ class SearchGameResultFragment : ListFragment -DisplayUtils.dip2px(50F) && mAdapter?.isLoadOver() == true) { - mBinding.containerMenuClose.visibility = View.GONE - } else { - mBinding.containerMenuClose.visibility = View.VISIBLE - } - } else { - if (!mLoadingAnimation) mBinding.containerMenuClose.visibility = View.VISIBLE - } + handleCloseMenuVisibility(recyclerView) } }) initAnimation() } + private fun handleCloseMenuVisibility(recyclerView: RecyclerView) { + val position = mLayoutManager!!.findLastVisibleItemPosition() + if (position == mAdapter!!.itemCount - 1) { + val child = mLayoutManager!!.findViewByPosition(position) + if (child != null && recyclerView.bottom - child.bottom > -DisplayUtils.dip2px(50F) && mAdapter?.isLoadOver() == true) { + mBinding.containerMenuClose.visibility = View.GONE + } else { + mBinding.containerMenuClose.visibility = View.VISIBLE + } + } else { + if (!mLoadingAnimation) mBinding.containerMenuClose.visibility = View.VISIBLE + } + } + private fun initAnimation() { mShowAction = TranslateAnimation( Animation.RELATIVE_TO_SELF, diff --git a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultViewModel.kt b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultViewModel.kt index 2831aa531e..e048959fa6 100644 --- a/app/src/main/java/com/gh/gamecenter/search/SearchGameResultViewModel.kt +++ b/app/src/main/java/com/gh/gamecenter/search/SearchGameResultViewModel.kt @@ -40,20 +40,22 @@ class SearchGameResultViewModel(application: Application) : ListViewModel, itemDataList: ArrayList) { + if (mPage == 1 && list.isEmpty()) { + mLoadStatusLiveData.value = if (itemDataList.isEmpty()) LoadStatus.INIT_EMPTY else LoadStatus.INIT_OVER + } + } + override fun loadStatusControl(size: Int) { if (mCurLoadParams.loadOffset == LoadParams.DEFAULT_OFFSET) { // 初始化列表 if (size == 0) { diff --git a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.kt b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.kt index 7a87560f56..82382538a6 100644 --- a/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/servers/GameServersContentAdapter.kt @@ -16,7 +16,7 @@ import com.gh.common.util.* import com.gh.gamecenter.common.view.DrawableView.getServerDrawableBySource import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameTestViewHolder import com.gh.gamecenter.common.baselist.LoadStatus import com.gh.gamecenter.core.utils.StringUtils diff --git a/app/src/main/java/com/gh/gamecenter/servers/GameServersTestAdapter.kt b/app/src/main/java/com/gh/gamecenter/servers/GameServersTestAdapter.kt index e4594030fd..bdb6b7c770 100644 --- a/app/src/main/java/com/gh/gamecenter/servers/GameServersTestAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/servers/GameServersTestAdapter.kt @@ -16,7 +16,7 @@ import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.common.utils.toBinding import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.utils.toColor import com.gh.gamecenter.databinding.ItemTestServerTextBinding diff --git a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt index 980eb5b387..32ca3cecdd 100644 --- a/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/simulatorgame/SimulatorGameListAdapter.kt @@ -30,7 +30,7 @@ import com.gh.gamecenter.common.view.BugFixedPopupWindow import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.MainActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.callback.BiCallback diff --git a/app/src/main/java/com/gh/gamecenter/subject/SubjectAdapter.kt b/app/src/main/java/com/gh/gamecenter/subject/SubjectAdapter.kt index a7d6ac3e37..c1ed233857 100644 --- a/app/src/main/java/com/gh/gamecenter/subject/SubjectAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/subject/SubjectAdapter.kt @@ -16,7 +16,7 @@ import com.gh.common.util.* import com.gh.common.util.NewLogUtils import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameImageViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter diff --git a/app/src/main/java/com/gh/gamecenter/tag/TagsListAdapter.kt b/app/src/main/java/com/gh/gamecenter/tag/TagsListAdapter.kt index bc95039d4e..de256041b9 100644 --- a/app/src/main/java/com/gh/gamecenter/tag/TagsListAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/tag/TagsListAdapter.kt @@ -12,7 +12,7 @@ import com.gh.gamecenter.core.utils.StringUtils import com.gh.gamecenter.common.utils.dip2px import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.GameViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.databinding.GameItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoAdapter.kt b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoAdapter.kt index e2df4f141b..978a858f57 100644 --- a/app/src/main/java/com/gh/gamecenter/video/game/GameVideoAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/video/game/GameVideoAdapter.kt @@ -7,7 +7,7 @@ import androidx.recyclerview.widget.RecyclerView import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.DirectUtils import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.NormalListViewModel import com.gh.gamecenter.databinding.VideoNewItemBinding diff --git a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftAdapter.kt b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftAdapter.kt index 6f638fd622..b086d27ee4 100644 --- a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoDraftAdapter.kt @@ -13,7 +13,7 @@ import com.gh.gamecenter.common.constant.ItemViewType import com.gh.common.util.* import com.gh.gamecenter.common.view.BugFixedPopupWindow import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.DialogHelper import com.gh.gamecenter.core.utils.EmptyCallback diff --git a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyAdapter.kt b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyAdapter.kt index af61faf9eb..654c806882 100644 --- a/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/video/videomanager/VideoVerifyAdapter.kt @@ -13,7 +13,7 @@ import com.gh.common.util.* import com.gh.common.util.LogUtils import com.gh.gamecenter.common.view.BugFixedPopupWindow import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.utils.* import com.gh.gamecenter.core.utils.* diff --git a/app/src/main/java/com/gh/gamecenter/vote/VoteAdapter.kt b/app/src/main/java/com/gh/gamecenter/vote/VoteAdapter.kt index 223aa3bf71..0699d8d6bb 100644 --- a/app/src/main/java/com/gh/gamecenter/vote/VoteAdapter.kt +++ b/app/src/main/java/com/gh/gamecenter/vote/VoteAdapter.kt @@ -14,7 +14,7 @@ import com.gh.gamecenter.CleanApkActivity import com.gh.gamecenter.GameDetailActivity.Companion.startGameDetailActivity import com.gh.gamecenter.NewsDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.adapter.viewholder.VoteViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.LoadStatus diff --git a/app/src/main/java/com/gh/vspace/VDownloadManagerAdapter.kt b/app/src/main/java/com/gh/vspace/VDownloadManagerAdapter.kt index 0da701dda5..8000d090e8 100644 --- a/app/src/main/java/com/gh/vspace/VDownloadManagerAdapter.kt +++ b/app/src/main/java/com/gh/vspace/VDownloadManagerAdapter.kt @@ -19,7 +19,7 @@ import com.gh.common.view.DownloadButton import com.gh.download.DownloadManager import com.gh.gamecenter.GameDetailActivity import com.gh.gamecenter.R -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder +import com.gh.gamecenter.common.viewholder.FooterViewHolder import com.gh.gamecenter.common.baselist.ListAdapter import com.gh.gamecenter.common.baselist.LoadType import com.gh.gamecenter.common.constant.Constants diff --git a/app/src/main/java/com/gh/vspace/VHelper.kt b/app/src/main/java/com/gh/vspace/VHelper.kt index 75210244fd..55ebae351c 100644 --- a/app/src/main/java/com/gh/vspace/VHelper.kt +++ b/app/src/main/java/com/gh/vspace/VHelper.kt @@ -269,7 +269,7 @@ object VHelper { val containsUpdate = shouldShowVSpaceUpdate(mUpdateEntity, installedSpaceVersionCode) if (containsUpdate) { - val dialogType = if (mUpdateEntity!!.isAlertEveryTime()) "强制更新" else "提示更新" + val dialogType = getDialogType() NewFlatLogUtils.logHaloFunEvent("halo_fun_update_dialog_show") SPUtils.setString( KEY_LAST_ALERT_UPDATE_URL, @@ -319,6 +319,8 @@ object VHelper { } } + private fun getDialogType() = if (mUpdateEntity!!.isAlertEveryTime()) "强制更新" else "提示更新" + /** * 获取已安装的包名列表 */ diff --git a/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt b/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt index 06309d81eb..24089718f5 100644 --- a/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/WebFragment.kt @@ -110,7 +110,9 @@ class WebFragment : LazyFragment(), IScrollable { } } - override fun onCancel() {} + override fun onCancel() { + // Do nothing + } } } diff --git a/app/src/main/java/com/halo/assistant/fragment/game/GameNewsSearchResultFragment.java b/app/src/main/java/com/halo/assistant/fragment/game/GameNewsSearchResultFragment.java index f6e025e43a..2cd90cce90 100644 --- a/app/src/main/java/com/halo/assistant/fragment/game/GameNewsSearchResultFragment.java +++ b/app/src/main/java/com/halo/assistant/fragment/game/GameNewsSearchResultFragment.java @@ -24,7 +24,7 @@ import com.gh.gamecenter.core.utils.UrlFilterUtils; import com.gh.gamecenter.common.view.VerticalItemDecoration; import com.gh.gamecenter.NewsDetailActivity; import com.gh.gamecenter.R; -import com.gh.gamecenter.adapter.viewholder.FooterViewHolder; +import com.gh.gamecenter.common.viewholder.FooterViewHolder; import com.gh.gamecenter.adapter.viewholder.NewsTextViewHolder; import com.gh.gamecenter.databinding.NewsTextItemBinding; import com.gh.gamecenter.entity.NewsEntity; @@ -252,8 +252,8 @@ public class GameNewsSearchResultFragment extends ToolbarFragment { } else if (holder instanceof FooterViewHolder) { FooterViewHolder viewHolder = (FooterViewHolder) holder; if (mIsNetworkError) { - viewHolder.loading.setVisibility(View.GONE); - viewHolder.hint.setText(R.string.loading_failed_retry); + viewHolder.getLoading().setVisibility(View.GONE); + viewHolder.getHint().setText(R.string.loading_failed_retry); viewHolder.itemView.setClickable(true); viewHolder.itemView.setOnClickListener(new View.OnClickListener() { @Override @@ -264,12 +264,12 @@ public class GameNewsSearchResultFragment extends ToolbarFragment { } }); } else if (mIsRemove) { - viewHolder.loading.setVisibility(View.GONE); - viewHolder.hint.setText(R.string.loading_complete); + viewHolder.getLoading().setVisibility(View.GONE); + viewHolder.getHint().setText(R.string.loading_complete); viewHolder.itemView.setClickable(false); } else { - viewHolder.loading.setVisibility(View.VISIBLE); - viewHolder.hint.setText(R.string.loading); + viewHolder.getLoading().setVisibility(View.VISIBLE); + viewHolder.getHint().setText(R.string.loading); viewHolder.itemView.setClickable(false); } } diff --git a/app/src/main/java/com/halo/assistant/fragment/user/VerifyPhoneFragment.kt b/app/src/main/java/com/halo/assistant/fragment/user/VerifyPhoneFragment.kt index 84dfc79fce..92ec592288 100644 --- a/app/src/main/java/com/halo/assistant/fragment/user/VerifyPhoneFragment.kt +++ b/app/src/main/java/com/halo/assistant/fragment/user/VerifyPhoneFragment.kt @@ -82,18 +82,7 @@ class VerifyPhoneFragment : ToolbarFragment() { mBinding.phoneEt.setTextChangedListener { s, _, _, _ -> // 输入手机号码加空格 val stringBuilder = StringBuilder() - for (i in s.indices) { - if (i != 3 && i != 8 && s[i] == ' ') { - continue - } else { - stringBuilder.append(s[i]) - if ((stringBuilder.length == 4 || stringBuilder.length == 9) - && stringBuilder[stringBuilder.length - 1] != ' ' - ) { - stringBuilder.insert(stringBuilder.length - 1, ' ') - } - } - } + handlePhoneStringBuilder(s, stringBuilder) if (stringBuilder.toString() != s.toString()) { mBinding.phoneEt.setText(stringBuilder.toString()) mBinding.phoneEt.setSelection(mBinding.phoneEt.text.toString().length) @@ -121,6 +110,21 @@ class VerifyPhoneFragment : ToolbarFragment() { } } + private fun handlePhoneStringBuilder(s: CharSequence, stringBuilder: StringBuilder) { + for (i in s.indices) { + if (i != 3 && i != 8 && s[i] == ' ') { + continue + } else { + stringBuilder.append(s[i]) + if ((stringBuilder.length == 4 || stringBuilder.length == 9) + && stringBuilder[stringBuilder.length - 1] != ' ' + ) { + stringBuilder.insert(stringBuilder.length - 1, ' ') + } + } + } + } + override fun onClick(v: View?) { super.onClick(v) // 防止快速点击 diff --git a/module_common/src/main/java/com/gh/gamecenter/common/utils/DialogUtils.java b/module_common/src/main/java/com/gh/gamecenter/common/utils/DialogUtils.java index 4e617924d9..26418f38bd 100644 --- a/module_common/src/main/java/com/gh/gamecenter/common/utils/DialogUtils.java +++ b/module_common/src/main/java/com/gh/gamecenter/common/utils/DialogUtils.java @@ -19,6 +19,11 @@ import com.gh.gamecenter.core.provider.IDirectProvider; import com.lightgame.utils.AppManager; public class DialogUtils { + + private DialogUtils() { + throw new IllegalStateException("Utility class"); + } + /** * @param context may be is application context * @return activity context diff --git a/module_common/src/main/java/com/gh/gamecenter/common/viewholder/FooterViewHolder.java b/module_common/src/main/java/com/gh/gamecenter/common/viewholder/FooterViewHolder.java index a0e6c018c9..5c6920596e 100644 --- a/module_common/src/main/java/com/gh/gamecenter/common/viewholder/FooterViewHolder.java +++ b/module_common/src/main/java/com/gh/gamecenter/common/viewholder/FooterViewHolder.java @@ -18,8 +18,8 @@ import java.util.ArrayList; public class FooterViewHolder extends BaseRecyclerViewHolder { - public ProgressBar loading; - public TextView hint; + private ProgressBar loading; + private TextView hint; public FooterViewHolder(View itemView) { super(itemView); @@ -127,4 +127,11 @@ public class FooterViewHolder extends BaseRecyclerViewHolder { } } + public ProgressBar getLoading() { + return loading; + } + + public TextView getHint() { + return hint; + } } \ No newline at end of file diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/CheckLoginUtils.java b/module_energy/src/energy/java/com/gh/gamecenter/energy/CheckLoginUtils.java index dcfb464378..108801c177 100644 --- a/module_energy/src/energy/java/com/gh/gamecenter/energy/CheckLoginUtils.java +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/CheckLoginUtils.java @@ -25,18 +25,9 @@ public class CheckLoginUtils { public static void checkLogin(Context context, String entrance, OnLoginListener listener) { if (!isLogin()) { if (listener != null) Utils.toast(context, "需要登录"); -// LogUtils.login("dialog", null, entrance); -// LogUtils.login("activity", null, entrance); if (SPUtils.getBoolean(Constants.SP_HAS_GET_PHONE_INFO) || NetworkUtils.isOpenMobileData(context)) { - // 需要确保传入的 context 不为 application - if (!(context instanceof Activity)) { - context = CurrentActivityHolder.getCurrentActivity(); - } - - if (context != null) { - QuickLoginHelper.startLogin(context, entrance); - } + startQuickLogin(context, entrance); } else { ARouter.getInstance().build(RouteConsts.activity.loginActivity) .withString(EntranceConsts.KEY_ENTRANCE, entrance) @@ -49,6 +40,17 @@ public class CheckLoginUtils { } } + private static void startQuickLogin(Context context, String entrance) { + // 需要确保传入的 context 不为 application + if (!(context instanceof Activity)) { + context = CurrentActivityHolder.getCurrentActivity(); + } + + if (context != null) { + QuickLoginHelper.startLogin(context, entrance); + } + } + public static boolean isLogin() { return !TextUtils.isEmpty(UserManager.getInstance().getToken()); } diff --git a/module_energy/src/energy/java/com/gh/gamecenter/energy/DataUtils.java b/module_energy/src/energy/java/com/gh/gamecenter/energy/DataUtils.java index c5b37fb35f..87c762230a 100644 --- a/module_energy/src/energy/java/com/gh/gamecenter/energy/DataUtils.java +++ b/module_energy/src/energy/java/com/gh/gamecenter/energy/DataUtils.java @@ -14,6 +14,10 @@ import io.sentry.android.core.SentryAndroid; */ public class DataUtils { + private DataUtils() { + throw new IllegalStateException("Utility class"); + } + /** * 初始化各种统计工具,仅在release build(非debug)模式启用统计 */ @@ -39,7 +43,6 @@ public class DataUtils { options.setDebug(BuildConfig.DEBUG); options.setEnableSessionTracking(true); -// options.setEnvironment(BuildConfig.FLAVOR); options.setDsn("https://6b1caf0d17c1408e8680f3f73ff80bd0@sentry.shanqu.cc/22"); options.setBeforeSend((event, hint) -> { @@ -49,17 +52,6 @@ public class DataUtils { return event; } }); - -// options.setBeforeBreadcrumb(((breadcrumb, hint) -> { -// if ("ui.lifecycle".equals(breadcrumb.getCategory()) && "started".equals(breadcrumb.getData("state")) && GlobalActivityManager.INSTANCE.getCurrentActivity() instanceof BaseActivity) { -// Pair businessId = ((BaseActivity) GlobalActivityManager.INSTANCE.getCurrentActivity()).getBusinessId(); -// if (businessId != null) { -// breadcrumb.setData("businessId1", businessId.component1()); -// breadcrumb.setData("businessId2", businessId.component2()); -// } -// } -// return breadcrumb; -// })); }); Sentry.configureScope(scope -> { diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/HaloApp.kt b/module_energy/src/main/java/com/gh/gamecenter/energy/HaloApp.kt index e23e56053b..dc2047e7a6 100644 --- a/module_energy/src/main/java/com/gh/gamecenter/energy/HaloApp.kt +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/HaloApp.kt @@ -9,7 +9,7 @@ import com.google.auto.service.AutoService class HaloApp : IApplication { override fun attachBaseContext() { - + // Do nothing } override fun onCreate(application: Application) { @@ -18,19 +18,19 @@ class HaloApp : IApplication { override fun onLowMemory() { - + // Do nothing } override fun onTerminate() { - + // Do nothing } override fun onTrimMemory(level: Int) { - + // Do nothing } override fun onConfigurationChanged(newConfig: Configuration) { - + // Do nothing } companion object { diff --git a/module_energy/src/main/java/com/gh/gamecenter/energy/utils/DialogUtils.java b/module_energy/src/main/java/com/gh/gamecenter/energy/utils/DialogUtils.java index 40c7b1a4cd..721679c7c0 100644 --- a/module_energy/src/main/java/com/gh/gamecenter/energy/utils/DialogUtils.java +++ b/module_energy/src/main/java/com/gh/gamecenter/energy/utils/DialogUtils.java @@ -21,6 +21,11 @@ import com.gh.gamecenter.energy.databinding.DialogEnergySignBinding; import com.lightgame.utils.AppManager; public class DialogUtils { + + private DialogUtils() { + throw new IllegalStateException("Utility class"); + } + /** * @param context may be is application context * @return activity context @@ -82,9 +87,7 @@ public class DialogUtils { contentTv.setText(content); okTv.setTextColor(ContextCompat.getColor(context, R.color.theme_font)); - okTv.setOnClickListener(v -> { - dialog.dismiss(); - }); + okTv.setOnClickListener(v -> dialog.dismiss()); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(contentView); diff --git a/module_login/src/main/java/com/gh/gamecenter/login/HaloApp.kt b/module_login/src/main/java/com/gh/gamecenter/login/HaloApp.kt index 9f4aa26ff6..bd3e796a13 100644 --- a/module_login/src/main/java/com/gh/gamecenter/login/HaloApp.kt +++ b/module_login/src/main/java/com/gh/gamecenter/login/HaloApp.kt @@ -9,7 +9,7 @@ import com.google.auto.service.AutoService class HaloApp : IApplication { override fun attachBaseContext() { - + // Do nothing } override fun onCreate(application: Application) { @@ -18,19 +18,19 @@ class HaloApp : IApplication { override fun onLowMemory() { - + // Do nothing } override fun onTerminate() { - + // Do nothing } override fun onTrimMemory(level: Int) { - + // Do nothing } override fun onConfigurationChanged(newConfig: Configuration) { - + // Do nothing } companion object { diff --git a/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java b/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java index 65701ae2a3..76ac021687 100644 --- a/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java +++ b/module_login/src/main/java/com/gh/gamecenter/login/view/LoginFragment.java @@ -90,7 +90,7 @@ public class LoginFragment private Animation mShakeAnim; private int mStatus = QuickLoginHelper.STATUS_DEFAULT; - private final int THIRD_PARTY_LOGIN_CLICK_DIFF = 3000; + private static final int THIRD_PARTY_LOGIN_CLICK_DIFF = 3000; @Override protected void handleMessage(Message msg) { @@ -162,6 +162,10 @@ public class LoginFragment view.setOnClickListener(this); } + initView(); + } + + private void initView() { if (PackageFlavorHelper.IS_TEST_FLAVOR) { if (SPUtils.getBoolean(Constants.SP_HAS_COMPLETE_INVITE_CODE)) { mBinding.loginInviteContainer.setVisibility(View.GONE); @@ -197,6 +201,11 @@ public class LoginFragment mBinding.loginPassEt.addTextChangedListener(new LoginTextWatcher(mBinding.loginPassEt)); mBinding.loginPhoneEt.addTextChangedListener(new LoginTextWatcher(mBinding.loginPhoneEt)); + mBinding.loginPrivacyPolicy.setText(getPrivacyContent()); + mBinding.loginPrivacyPolicy.setMovementMethod(new LinkMovementMethod()); + } + + private SpannableStringBuilder getPrivacyContent() { SpannableStringBuilder privacyContent = new SpannableStringBuilder("阅读并同意《用户协议》和《隐私政策》"); privacyContent.setSpan(new ClickableSpan() { @@ -237,9 +246,7 @@ public class LoginFragment } } }, privacyContent.length() - 13, privacyContent.length() - 7, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); - - mBinding.loginPrivacyPolicy.setText(privacyContent); - mBinding.loginPrivacyPolicy.setMovementMethod(new LinkMovementMethod()); + return privacyContent; } public void onClick(View v) {