Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev

This commit is contained in:
Jack
2020-02-03 17:55:28 +08:00
5 changed files with 12 additions and 5 deletions

View File

@ -52,7 +52,7 @@ public abstract class BaseFragment<T> extends Fragment implements OnRequestCallB
protected boolean isEverPause;
@NonNull
protected String mEntrance;
protected String mEntrance = "";
protected final Handler mBaseHandler = new BaseFragment.BaseHandler(this);

View File

@ -91,8 +91,8 @@ object TextHelper {
}
@JvmStatic
fun highlightTextThatIsWrappedInsideWrapperByDefault(textView: TextView, text: String) {
textView.text = getHighlightedSpannableStringThatIsWrappedInsideWrapper(textView.context, text, "###", R.color.theme, object : SimpleCallback<String> {
fun highlightTextThatIsWrappedInsideWrapperByDefault(textView: TextView, text: String?) {
textView.text = getHighlightedSpannableStringThatIsWrappedInsideWrapper(textView.context, text ?: "", "###", R.color.theme, object : SimpleCallback<String> {
override fun onCallback(arg: String) {
val application = HaloApp.getInstance().application
val cmb = application.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager

View File

@ -61,6 +61,9 @@ public abstract class ListAdapter<DataType> extends BaseRecyclerAdapter {
@Override
public boolean areItemsTheSame(int oldItemPosition, int newItemPosition) {
if (oldItemPosition >= mEntityList.size()) return false;
if (newItemPosition >= updateData.size()) return false;
DataType oldItem = mEntityList.get(oldItemPosition);
DataType newItem = updateData.get(newItemPosition);
return ListAdapter.this.areItemsTheSame(oldItem, newItem);
@ -68,6 +71,9 @@ public abstract class ListAdapter<DataType> extends BaseRecyclerAdapter {
@Override
public boolean areContentsTheSame(int oldItemPosition, int newItemPosition) {
if (oldItemPosition >= mEntityList.size()) return false;
if (newItemPosition >= updateData.size()) return false;
DataType oldItem = mEntityList.get(oldItemPosition);
DataType newItem = updateData.get(newItemPosition);
return ListAdapter.this.areContentsTheSame(oldItem, newItem);

View File

@ -204,7 +204,7 @@ class UserHomeFragment : NormalFragment() {
val titleList = listOf("游戏评论", "问答", "视频")
viewpager.offscreenPageLimit = fragmentList.size
viewpager.adapter = FragmentAdapter(fragmentManager, fragmentList, titleList)
viewpager.adapter = FragmentAdapter(childFragmentManager, fragmentList, titleList)
viewpager.currentItem = position
viewpager.doOnPageSelected { MtaHelper.onEvent("个人主页详情", "个人主页详情", titleList[it]) }
tabLayout.setupWithViewPager(viewpager)

View File

@ -91,7 +91,8 @@ public class AskSearchFragment extends BaseFragment_TabLayout {
if (fragment instanceof BaseAskSearchFragment) {
((BaseAskSearchFragment) fragment).search(key);
Bundle arguments = fragment.getArguments();
if (arguments != null) {
// 处于 state saved 状态的 fragment 不可 setArguments
if (arguments != null && !fragment.isStateSaved()) {
arguments.putString(EntranceUtils.KEY_SEARCHKEY, key);
fragment.setArguments(arguments);
}