Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
This commit is contained in:
@ -180,8 +180,6 @@ class DescAdapter(context: Context,
|
||||
override fun getSpanSize(position: Int): Int {
|
||||
return if (tips?.title != null) {
|
||||
if (position == 0) 3 else 1
|
||||
} else if (tips?.title == null && customColumn.title == null) {
|
||||
if (position == 0) 3 else 1
|
||||
} else {
|
||||
1
|
||||
}
|
||||
|
||||
@ -64,8 +64,9 @@ class GameDetailCustomColumnAdapter(private val tags: ArrayList<TagEntity>,
|
||||
|
||||
viewHolder.hintContentTv.setTextWithHighlightedTextWrappedInsideWrapper(text = tips?.content ?: "")
|
||||
|
||||
if (title == null ||
|
||||
(TextUtils.isEmpty(title.value) && TextUtils.isEmpty(title.color))) {
|
||||
if (title == null
|
||||
|| title.value == ""
|
||||
|| (TextUtils.isEmpty(title.value) && TextUtils.isEmpty(title.color))) {
|
||||
viewHolder.hintLl.visibility = View.GONE
|
||||
viewHolder.hintTv.visibility = View.GONE
|
||||
} else {
|
||||
|
||||
@ -178,7 +178,6 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
|
||||
mPersonalFuncGroupAdapter = new PersonalFunctionGroupAdapter(requireContext());
|
||||
mFuncRecyclerView.setLayoutManager(new LinearLayoutManager(requireContext()));
|
||||
mFuncRecyclerView.setAdapter(mPersonalFuncGroupAdapter);
|
||||
//mFuncRecyclerView.addItemDecoration(new VerticalItemDecoration(requireContext(), 5f, false));
|
||||
|
||||
final UserViewModel.Factory factory = new UserViewModel.Factory(getActivity().getApplication());
|
||||
mUserViewModel = ViewModelProviders.of(this, factory).get(UserViewModel.class);
|
||||
@ -266,7 +265,7 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mUserHomeViewModel.getUserInfos();
|
||||
mUserViewModel.retryCheckLogin();
|
||||
mUnreadViewModel.retry();
|
||||
//TODO:加了下面代码会导致滑动卡顿,先注释掉后面想办法
|
||||
// int currentItem = ((MainWrapperFragment) getParentFragment()).getCurrentItem();
|
||||
@ -365,7 +364,6 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
|
||||
if (mUserInfoEntity != null) {
|
||||
MtaHelper.onEvent("我的光环", "个人中心");
|
||||
MtaHelper.onEvent("我的光环_新", "头像", "点击头像");
|
||||
//startActivity(UserInfoActivity.getIntent(getContext()));
|
||||
DirectUtils.directToHomeActivity(requireContext(), UserManager.getInstance().getUserId(), "", "我的光环");
|
||||
} else {
|
||||
MtaHelper.onEvent("我的光环", "手机登录");
|
||||
@ -377,7 +375,6 @@ public class PersonalFragment extends BaseFragment implements Observer<ApiRespon
|
||||
if (mUserInfoEntity != null) {
|
||||
MtaHelper.onEvent("我的光环", "个人中心");
|
||||
MtaHelper.onEvent("我的光环_新", "昵称", "点击昵称");
|
||||
//startActivity(UserInfoActivity.getIntent(getContext()));
|
||||
DirectUtils.directToHomeActivity(requireContext(), UserManager.getInstance().getUserId(), "", "我的光环");
|
||||
} else {
|
||||
MtaHelper.onEvent("我的光环", "手机登录");
|
||||
|
||||
@ -69,7 +69,7 @@ class UserHomeFragment : NormalFragment() {
|
||||
mUserViewModel = viewModelProvider(UserViewModel.Factory(HaloApp.getInstance().application))
|
||||
mMessageUnreadViewModel = viewModelProvider()
|
||||
|
||||
mUserHomeViewModel.getUserInfos()
|
||||
mUserHomeViewModel.getUserInfo()
|
||||
mUserHomeViewModel.getBadgeList()
|
||||
mUserHomeViewModel.getUserPlayedGame()
|
||||
|
||||
@ -126,7 +126,7 @@ class UserHomeFragment : NormalFragment() {
|
||||
container.visibility = View.GONE
|
||||
reuse_no_connection.visibility = View.VISIBLE
|
||||
reuse_no_connection.setOnClickListener {
|
||||
mUserHomeViewModel.getUserInfos()
|
||||
mUserHomeViewModel.getUserInfo()
|
||||
mUserHomeViewModel.getUserPlayedGame()
|
||||
}
|
||||
toast("网络异常")
|
||||
|
||||
@ -30,7 +30,7 @@ class UserHomeViewModel(application: Application, var userId: String) : AndroidV
|
||||
var badges = MutableLiveData<List<BadgeEntity>>()
|
||||
var availableBadgeCount = MutableLiveData<Int>()
|
||||
|
||||
fun getUserInfos() {
|
||||
fun getUserInfo() {
|
||||
RetrofitManager.getInstance(getApplication())
|
||||
.api.getPersonalData(userId, HaloApp.getInstance().channel, Utils.getTime(getApplication()))
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
||||
@ -179,6 +179,8 @@ public class SettingsFragment extends NormalFragment {
|
||||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP_MR1) {
|
||||
return;
|
||||
}
|
||||
|
||||
mSettingUsageStatsSb.setClickable(false);
|
||||
|
||||
if (UsageStatsHelper.checkForPermission() && sp.getBoolean(UsageStatsHelper.USAGE_STATUS_SP_KEY, true)) {
|
||||
mSettingUsageStatsSb.setCheckedImmediately(true);
|
||||
@ -196,15 +198,6 @@ public class SettingsFragment extends NormalFragment {
|
||||
},
|
||||
() -> mSettingUsageStatsSb.setCheckedNoEvent(false));
|
||||
}
|
||||
} else {
|
||||
DialogUtils.showAlertDialog(getContext(),
|
||||
"提示",
|
||||
"关闭后将无法统计游戏时长,确定要关闭吗?",
|
||||
"确定关闭",
|
||||
"暂不关闭",
|
||||
() -> sp.edit().putBoolean(UsageStatsHelper.USAGE_STATUS_SP_KEY, false).apply(),
|
||||
() -> mSettingUsageStatsSb.setCheckedNoEvent(true)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -393,7 +386,21 @@ public class SettingsFragment extends NormalFragment {
|
||||
startActivity(WebActivity.getWebIntent(getContext()));
|
||||
break;
|
||||
case R.id.setting_usage_stats:
|
||||
mSettingUsageStatsSb.performClick();
|
||||
if (mSettingUsageStatsSb.isChecked()) {
|
||||
DialogUtils.showAlertDialog(getContext(),
|
||||
"提示",
|
||||
"关闭后将无法统计游戏时长,确定要关闭吗?",
|
||||
"确定关闭",
|
||||
"暂不关闭",
|
||||
() -> {
|
||||
mSettingUsageStatsSb.setChecked(false);
|
||||
sp.edit().putBoolean(UsageStatsHelper.USAGE_STATUS_SP_KEY, false).apply();
|
||||
},
|
||||
() -> mSettingUsageStatsSb.setCheckedNoEvent(true)
|
||||
);
|
||||
} else {
|
||||
mSettingUsageStatsSb.performClick();
|
||||
}
|
||||
break;
|
||||
case R.id.setting_clean_package:
|
||||
// MtaHelper.onEvent("发现", "安装包清理");
|
||||
|
||||
@ -1,37 +1,39 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
|
||||
android:layout_width = "match_parent"
|
||||
android:layout_height = "wrap_content" >
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id = "@+id/gamedetail_ll_hint"
|
||||
android:layout_width = "match_parent"
|
||||
android:layout_height = "wrap_content"
|
||||
android:paddingTop = "13dp"
|
||||
android:gravity = "center_vertical" >
|
||||
android:id="@+id/gamedetail_ll_hint"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingTop="13dp">
|
||||
|
||||
<com.facebook.drawee.view.SimpleDraweeView
|
||||
android:id = "@+id/gamedetail_iv_hint"
|
||||
android:layout_width = "16dp"
|
||||
android:layout_height = "16dp"
|
||||
android:layout_marginRight = "5dp" />
|
||||
android:id="@+id/gamedetail_iv_hint"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginRight="5dp" />
|
||||
|
||||
<TextView
|
||||
android:id = "@+id/gamedetail_tv_hint"
|
||||
android:layout_width = "wrap_content"
|
||||
android:layout_height = "wrap_content"
|
||||
android:text = "@string/plugin_tip"
|
||||
android:textColor = "@color/btn_plugin"
|
||||
android:textSize = "14sp" />
|
||||
</LinearLayout >
|
||||
android:id="@+id/gamedetail_tv_hint"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/plugin_tip"
|
||||
android:textColor="@color/btn_plugin"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id = "@+id/gamedetail_tv_content"
|
||||
android:layout_width = "wrap_content"
|
||||
android:layout_height = "wrap_content"
|
||||
android:layout_below = "@id/gamedetail_ll_hint"
|
||||
android:layout_marginTop = "8dp"
|
||||
android:textColor = "@color/text_5d5d5d"
|
||||
android:maxLines = "4"
|
||||
android:textSize = "13sp" />
|
||||
</RelativeLayout >
|
||||
android:id="@+id/gamedetail_tv_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/gamedetail_ll_hint"
|
||||
android:layout_marginTop="8dp"
|
||||
android:maxLines="4"
|
||||
android:textColor="@color/text_5d5d5d"
|
||||
android:textSize="13sp"
|
||||
tools:text="pm sucks" />
|
||||
</RelativeLayout>
|
||||
@ -168,6 +168,10 @@ public class KfStartHelper {
|
||||
chatIntent.putExtra("type", "peedId");
|
||||
chatIntent.putExtra("icon", icon);
|
||||
chatIntent.putExtra("inputContent", defaultInputContent);
|
||||
if (requestCode != null) mActivity.startActivityForResult(chatIntent, requestCode);
|
||||
if (requestCode != null) {
|
||||
mActivity.startActivityForResult(chatIntent, requestCode);
|
||||
} else {
|
||||
mActivity.startActivity(chatIntent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user