光环助手V4.0.2-游戏上传功能优化(20200622测试 1-5,7-9,15) https://gitlab.ghzs.com/pm/halo-app-issues/-/issues/903
This commit is contained in:
@ -489,7 +489,7 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
startActivityForResult(intent, MEDIA_STORE_CREDENTIALS_REQUEST);
|
||||
}
|
||||
});
|
||||
},null);
|
||||
mCredentialsAdapter.setPicItem(R.layout.game_upload_pic_item);
|
||||
mCredentialsAdapter.setSuggestAddPicIcon(R.drawable.icon_pic_add);
|
||||
mCredentialsPhotoRv.setLayoutManager(new GridLayoutManager(this, 5) {
|
||||
@ -506,7 +506,7 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
startActivityForResult(intent, MEDIA_STORE_SCREENSHOT_REQUEST);
|
||||
}
|
||||
});
|
||||
},null);
|
||||
mScreenshotAdapter.setPicItem(R.layout.game_upload_pic_item);
|
||||
mScreenshotAdapter.setSuggestAddPicIcon(R.drawable.icon_pic_add);
|
||||
mInfringementAppScreenshotRv.setLayoutManager(new GridLayoutManager(this, 5) {
|
||||
|
||||
@ -9,6 +9,7 @@ import android.webkit.*
|
||||
import android.widget.TextView
|
||||
import com.gh.base.fragment.BaseDialogFragment
|
||||
import com.gh.common.DefaultJsApi
|
||||
import com.gh.common.util.MtaHelper
|
||||
import com.gh.gamecenter.BuildConfig
|
||||
import com.gh.gamecenter.R
|
||||
import wendu.dsbridge.DWebView
|
||||
@ -58,10 +59,12 @@ class GameResourcePolicyDialogFragment : BaseDialogFragment() {
|
||||
mVebView?.addJavascriptObject(DefaultJsApi(requireContext()), null)
|
||||
mVebView?.loadUrl(requireContext().getString(R.string.upload_game_policy_url))
|
||||
containerView?.findViewById<View>(R.id.refuseTv)?.setOnClickListener {
|
||||
MtaHelper.onEvent("游戏上传", "开发者弹窗", "不同意")
|
||||
dismiss()
|
||||
requireActivity().finish()
|
||||
}
|
||||
containerView?.findViewById<View>(R.id.agreeTv)?.setOnClickListener {
|
||||
MtaHelper.onEvent("游戏上传", "开发者弹窗", "同意")
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
@ -80,7 +83,7 @@ class GameResourcePolicyDialogFragment : BaseDialogFragment() {
|
||||
|
||||
val window = createDialog.window
|
||||
window?.setGravity(Gravity.CENTER)
|
||||
window?.setWindowAnimations(R.style.community_publication_animation)
|
||||
// window?.setWindowAnimations(R.style.community_publication_animation)
|
||||
return createDialog
|
||||
}
|
||||
|
||||
|
||||
@ -71,12 +71,13 @@ class GameUploadFragment : NormalFragment() {
|
||||
|
||||
val factory = GameUploadViewModel.Factory(HaloApp.getInstance().application)
|
||||
mViewModel = ViewModelProviders.of(this, factory).get(GameUploadViewModel::class.java)
|
||||
mViewModel.upLoadSuccess.observe(this, Observer {
|
||||
mViewModel.upLoadSuccess.observe(viewLifecycleOwner, Observer {
|
||||
if (it) {
|
||||
toast("感谢您的分享")
|
||||
ToastUtils.showToast("上传成功")
|
||||
MtaHelper.onEvent("游戏上传", "游戏上传", "上传成功")
|
||||
mUploadDialog.dismiss()
|
||||
requireActivity().finish()
|
||||
}else{
|
||||
} else {
|
||||
mUploadDialog.uploadFail()
|
||||
}
|
||||
})
|
||||
@ -92,38 +93,44 @@ class GameUploadFragment : NormalFragment() {
|
||||
tv_game_intro.text = getString(R.string.upload_game_intro).fromHtml()
|
||||
tv_screenshot.text = getString(R.string.upload_game_pic).fromHtml()
|
||||
|
||||
val remindText = " 请勿分享违法违规/色情暴力等资源,违反者光环有权进行下架和封号处理。"
|
||||
remindTv.text = SpanBuilder(remindText).image(requireContext(), 0, 1, R.drawable.ic_game_upload_remind).build()
|
||||
mViewModel.uploadGameTips.observe(viewLifecycleOwner, Observer {
|
||||
remindTv.visibility = View.VISIBLE
|
||||
val remindText = " $it"
|
||||
remindTv.text = SpanBuilder(remindText).image(requireContext(), 0, 1, R.drawable.ic_game_upload_remind).build()
|
||||
})
|
||||
mViewModel.getUploadGamesTips()
|
||||
|
||||
rv_screenshot.apply {
|
||||
layoutManager = object : GridLayoutManager(context, 5) {
|
||||
layoutManager = object : GridLayoutManager(requireContext(), 5) {
|
||||
override fun canScrollVertically(): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
mAdapter = SuggestPicAdapter(context, object : OnListClickListener {
|
||||
mAdapter = SuggestPicAdapter(requireContext(), 5, object : OnListClickListener {
|
||||
override fun <T : Any?> onListClick(view: View?, position: Int, data: T) {
|
||||
MtaHelper.onEvent("游戏上传", "游戏图片", "添加图片")
|
||||
val intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
|
||||
startActivityForResult(intent, MEDIA_STORE_REQUEST)
|
||||
}
|
||||
})
|
||||
}, SuggestPicAdapter.OnItemDeleteListener { MtaHelper.onEvent("游戏上传", "游戏图片", "删除图片") })
|
||||
mAdapter?.setPicItem(R.layout.game_upload_pic_item)
|
||||
mAdapter?.setSuggestAddPicIcon(R.drawable.icon_pic_add)
|
||||
adapter = mAdapter
|
||||
}
|
||||
|
||||
gameIconRv.apply {
|
||||
layoutManager = object : GridLayoutManager(context, 5) {
|
||||
layoutManager = object : GridLayoutManager(requireContext(), 5) {
|
||||
override fun canScrollVertically(): Boolean {
|
||||
return false
|
||||
}
|
||||
}
|
||||
mIconAdapter = SuggestPicAdapter(context, 1, object : OnListClickListener {
|
||||
mIconAdapter = SuggestPicAdapter(requireContext(), 1, object : OnListClickListener {
|
||||
override fun <T : Any?> onListClick(view: View?, position: Int, data: T) {
|
||||
MtaHelper.onEvent("游戏上传", "游戏图标", "添加图片")
|
||||
val intent = Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI)
|
||||
startActivityForResult(intent, MEDIA_ICON_STORE_REQUEST)
|
||||
}
|
||||
})
|
||||
}, SuggestPicAdapter.OnItemDeleteListener { MtaHelper.onEvent("游戏上传", "游戏图标", "删除图片") })
|
||||
mIconAdapter?.setPicItem(R.layout.game_upload_pic_item)
|
||||
mIconAdapter?.setSuggestAddPicIcon(R.drawable.icon_pic_add)
|
||||
adapter = mIconAdapter
|
||||
@ -155,34 +162,60 @@ class GameUploadFragment : NormalFragment() {
|
||||
private fun initListener() {
|
||||
|
||||
chooseGameLl.setOnClickListener {
|
||||
MtaHelper.onEvent("游戏上传", "安装包", "点我选择")
|
||||
showSelectDialog()
|
||||
}
|
||||
gameIsNetworkingRg.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.gameNetworkingRb -> mIsOnline = AtomicBoolean(true)
|
||||
R.id.gameNoNetworkingRb -> mIsOnline = AtomicBoolean(false)
|
||||
R.id.gameNetworkingRb -> {
|
||||
mIsOnline = AtomicBoolean(true)
|
||||
MtaHelper.onEvent("游戏上传", "是否联网", "需要联网")
|
||||
}
|
||||
R.id.gameNoNetworkingRb -> {
|
||||
mIsOnline = AtomicBoolean(false)
|
||||
MtaHelper.onEvent("游戏上传", "是否联网", "无需联网")
|
||||
}
|
||||
}
|
||||
}
|
||||
gameLanguageRg.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.gameLanguageChineseRb -> mGameLanguage = "中文"
|
||||
R.id.gameLanguageEnglishRb -> mGameLanguage = "英文"
|
||||
R.id.gameLanguageOtherRb -> mGameLanguage = "其他"
|
||||
R.id.gameLanguageChineseRb -> {
|
||||
mGameLanguage = "中文"
|
||||
MtaHelper.onEvent("游戏上传", "游戏语言", "中文")
|
||||
}
|
||||
R.id.gameLanguageEnglishRb -> {
|
||||
mGameLanguage = "英文"
|
||||
MtaHelper.onEvent("游戏上传", "游戏语言", "英文")
|
||||
}
|
||||
R.id.gameLanguageOtherRb -> {
|
||||
mGameLanguage = "其他"
|
||||
MtaHelper.onEvent("游戏上传", "游戏语言", "其他")
|
||||
}
|
||||
}
|
||||
}
|
||||
gameTypeRg.setOnCheckedChangeListener { group, checkedId ->
|
||||
when (checkedId) {
|
||||
R.id.gameTypeLocalRb -> mGameType = "local"
|
||||
R.id.gameTypeOnlineRb -> mGameType = "online"
|
||||
R.id.gameTypeOtherRb -> mGameType = "other"
|
||||
R.id.gameTypeLocalRb -> {
|
||||
mGameType = "local"
|
||||
MtaHelper.onEvent("游戏上传", "游戏类型", "单机")
|
||||
}
|
||||
R.id.gameTypeOnlineRb -> {
|
||||
mGameType = "online"
|
||||
MtaHelper.onEvent("游戏上传", "游戏类型", "网游")
|
||||
}
|
||||
R.id.gameTypeOtherRb -> {
|
||||
mGameType = "other"
|
||||
MtaHelper.onEvent("游戏上传", "游戏类型", "其他")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
addGameLabeTv.setOnClickListener {
|
||||
MtaHelper.onEvent("游戏上传", "游戏标签", "添加标签")
|
||||
if (mTags.size < mMaxTagSize) {
|
||||
showAddTagDialog()
|
||||
} else {
|
||||
toast("游戏标签最多添加${mMaxTagSize}个")
|
||||
ToastUtils.showToast("游戏标签最多添加${mMaxTagSize}个")
|
||||
}
|
||||
}
|
||||
suggest_post_btn.setOnClickListener {
|
||||
@ -191,48 +224,49 @@ class GameUploadFragment : NormalFragment() {
|
||||
}
|
||||
|
||||
private fun commit() {
|
||||
MtaHelper.onEvent("游戏上传", "提交", "提交")
|
||||
if (TextUtils.isEmpty(tv_choose.text.toString())) {
|
||||
toast("请先选择游戏安装包")
|
||||
ToastUtils.showToast("请先选择游戏安装包")
|
||||
return
|
||||
}
|
||||
if (mIconAdapter!!.fileList.size == 0) {
|
||||
toast("请先选择游戏图标")
|
||||
ToastUtils.showToast("请先选择游戏图标")
|
||||
return
|
||||
}
|
||||
if (TextUtils.isEmpty(et_game_name.text.toString())) {
|
||||
toast("请先填写游戏名字")
|
||||
return
|
||||
}
|
||||
if (!::mIsOnline.isInitialized) {
|
||||
toast("请先选择游戏网络状态")
|
||||
return
|
||||
}
|
||||
if (mGameLanguage.isEmpty()) {
|
||||
toast("请先选择游戏语言")
|
||||
return
|
||||
}
|
||||
if (mGameType.isEmpty()) {
|
||||
toast("请先选择游戏类型")
|
||||
ToastUtils.showToast("请先填写游戏名字")
|
||||
return
|
||||
}
|
||||
if (mTags.isEmpty()) {
|
||||
toast("请先填写游戏标签")
|
||||
ToastUtils.showToast("请先填写游戏标签")
|
||||
return
|
||||
}
|
||||
if (!::mIsOnline.isInitialized) {
|
||||
ToastUtils.showToast("请先选择游戏网络状态")
|
||||
return
|
||||
}
|
||||
if (mGameLanguage.isEmpty()) {
|
||||
ToastUtils.showToast("请先选择游戏语言")
|
||||
return
|
||||
}
|
||||
if (mGameType.isEmpty()) {
|
||||
ToastUtils.showToast("请先选择游戏类型")
|
||||
return
|
||||
}
|
||||
if (TextUtils.isEmpty(et_game_intro.text.toString())) {
|
||||
toast("请先填写游戏简介")
|
||||
ToastUtils.showToast("请先填写游戏简介")
|
||||
return
|
||||
}
|
||||
if (TextUtils.isEmpty(gameDeveloperWordsEt.text.toString())) {
|
||||
toast("请先填写开发者的话")
|
||||
ToastUtils.showToast("请先填写开发者的话")
|
||||
return
|
||||
}
|
||||
if (mAdapter!!.fileList.size == 0) {
|
||||
toast("请先选择游戏截图")
|
||||
ToastUtils.showToast("请先选择游戏截图")
|
||||
return
|
||||
}
|
||||
if (!tv_protocol.isChecked) {
|
||||
toast("请先同意游戏资源协议")
|
||||
ToastUtils.showToast("请先同意开发者协议")
|
||||
return
|
||||
}
|
||||
if (!::mUploadDialog.isInitialized) {
|
||||
@ -379,8 +413,12 @@ class GameUploadFragment : NormalFragment() {
|
||||
show()
|
||||
}
|
||||
|
||||
back.setOnClickListener { mSelectGameDialog?.cancel() }
|
||||
back.setOnClickListener {
|
||||
MtaHelper.onEvent("游戏上传", "安装包", "关闭")
|
||||
mSelectGameDialog?.cancel()
|
||||
}
|
||||
manualBtn.setOnClickListener {
|
||||
MtaHelper.onEvent("游戏上传", "安装包", "从设备上选择")
|
||||
val intent = Intent(Intent.ACTION_GET_CONTENT)
|
||||
intent.type = "*/*"
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE)
|
||||
@ -419,40 +457,30 @@ class GameUploadFragment : NormalFragment() {
|
||||
try {
|
||||
val file = File(picturePath)
|
||||
if (file.length() > 5 * 1024 * 1024) {
|
||||
Utils.toast(requireContext(), getString(R.string.pic_max_hint, 5))
|
||||
ToastUtils.showToast(getString(R.string.pic_max_hint, 5))
|
||||
} else {
|
||||
if (requestCode == MEDIA_STORE_REQUEST) {
|
||||
// skip image crop
|
||||
val intent = CropImageActivity.getIntent(requireContext(), picturePath, 9 / 16F, mEntrance)
|
||||
startActivityForResult(intent, REQUEST_CODE_IMAGE_CROP)
|
||||
mAdapter!!.addFileList(picturePath)
|
||||
} else {
|
||||
val intent = CropImageActivity.getIntent(requireContext(), picturePath, 1F, mEntrance)
|
||||
startActivityForResult(intent, REQUEST_CODE_ICON_IMAGE_CROP)
|
||||
mIconAdapter!!.addFileList(picturePath)
|
||||
}
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Utils.toast(context, e.message)
|
||||
}
|
||||
} else if (requestCode == REQUEST_CODE_IMAGE_CROP || requestCode == REQUEST_CODE_ICON_IMAGE_CROP) {
|
||||
val imagePath = data.getStringExtra(CropImageActivity.RESULT_CLIP_PATH)
|
||||
if (requestCode == REQUEST_CODE_IMAGE_CROP) {
|
||||
mAdapter!!.addFileList(imagePath)
|
||||
} else {
|
||||
mIconAdapter!!.addFileList(imagePath)
|
||||
ToastUtils.showToast(e.message ?: "")
|
||||
}
|
||||
} else if (requestCode == MEDIA_APK_STORE_REQUEST) {
|
||||
val uri = data.data ?: return
|
||||
val apkPath = UriUtils.getPath(requireContext(), uri)
|
||||
if (apkPath.isNotEmpty()) {
|
||||
if (!apkPath.endsWith(".apk")) {
|
||||
Utils.toast(requireContext(), "请选择正确的安装包")
|
||||
ToastUtils.showToast("请选择正确的安装包")
|
||||
return
|
||||
}
|
||||
mSelectGameDialog?.cancel()
|
||||
try {
|
||||
val file = File(apkPath)
|
||||
if (file.length() > 5 * 1024 * 1024 * 1024) {
|
||||
Utils.toast(requireContext(), getString(R.string.apk_max_size_hint, 5))
|
||||
ToastUtils.showToast(getString(R.string.apk_max_size_hint, 5))
|
||||
} else {
|
||||
val packageName = PackageUtils.getPackageNameByPath(requireContext(), apkPath)
|
||||
val version = PackageUtils.getVersionByPackage(packageName)
|
||||
@ -467,7 +495,7 @@ class GameUploadFragment : NormalFragment() {
|
||||
tv_choose.text = packageName
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
Utils.toast(requireContext(), e.message)
|
||||
ToastUtils.showToast(e.message ?: "")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -512,7 +540,7 @@ class GameUploadFragment : NormalFragment() {
|
||||
Util_System_Keyboard.hideSoftKeyboard(context, input)
|
||||
dialog.dismiss()
|
||||
} else {
|
||||
toast(R.string.vote_empty_hint)
|
||||
ToastUtils.showToast(getString(R.string.vote_empty_hint))
|
||||
}
|
||||
}
|
||||
dialog.setOnDismissListener {
|
||||
@ -532,6 +560,7 @@ class GameUploadFragment : NormalFragment() {
|
||||
labelTv.text = tag
|
||||
labelView.findViewById<View>(R.id.picDelIv).setOnClickListener {
|
||||
if (mTags.contains(tag)) {
|
||||
MtaHelper.onEvent("游戏上传", "游戏标签", "删除标签")
|
||||
gameLabelFl.removeView(labelView)
|
||||
mTags.remove(tag)
|
||||
gameLabelFl.goneIf(mTags.isEmpty())
|
||||
@ -543,7 +572,7 @@ class GameUploadFragment : NormalFragment() {
|
||||
gameLabelFl.addView(labelView)
|
||||
addGameLabeTv.goneIf(mTags.size == mMaxTagSize)
|
||||
} else {
|
||||
toast("标签已存在")
|
||||
ToastUtils.showToast("标签已存在")
|
||||
}
|
||||
}
|
||||
|
||||
@ -552,8 +581,5 @@ class GameUploadFragment : NormalFragment() {
|
||||
const val MEDIA_STORE_REQUEST = 100
|
||||
const val MEDIA_ICON_STORE_REQUEST = 101
|
||||
const val MEDIA_APK_STORE_REQUEST = 102
|
||||
const val REQUEST_CODE_IMAGE_CROP = 103
|
||||
const val REQUEST_CODE_ICON_IMAGE_CROP = 104
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,17 @@
|
||||
package com.gh.gamecenter.game.upload
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.app.Application
|
||||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.gh.gamecenter.manager.UserManager
|
||||
import com.gh.gamecenter.retrofit.BiResponse
|
||||
import com.gh.gamecenter.retrofit.Response
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.gh.gamecenter.user.ApiResponse
|
||||
import com.google.gson.JsonObject
|
||||
import com.halo.assistant.HaloApp
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
@ -18,6 +21,8 @@ import okhttp3.ResponseBody
|
||||
class GameUploadViewModel(application: Application) : AndroidViewModel(application) {
|
||||
|
||||
val upLoadSuccess = MutableLiveData<Boolean>()
|
||||
val uploadGameTips = MutableLiveData<String>()
|
||||
|
||||
//上传游戏
|
||||
fun uploadGames(body: RequestBody) {
|
||||
RetrofitManager.getInstance(HaloApp.getInstance().application)
|
||||
@ -37,6 +42,22 @@ class GameUploadViewModel(application: Application) : AndroidViewModel(applicati
|
||||
})
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
fun getUploadGamesTips() {
|
||||
RetrofitManager.getInstance(HaloApp.getInstance().application)
|
||||
.api.uploadGamesTips()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(object : BiResponse<JsonObject>() {
|
||||
override fun onSuccess(data: JsonObject) {
|
||||
val tips = data.get("text").asString
|
||||
if(!tips.isNullOrEmpty()) {
|
||||
uploadGameTips.postValue(tips)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
class Factory(private val mApplication: Application) : ViewModelProvider.NewInstanceFactory() {
|
||||
override fun <T : ViewModel> create(modelClass: Class<T>): T {
|
||||
return GameUploadViewModel(mApplication) as T
|
||||
|
||||
@ -7,6 +7,7 @@ import android.view.ViewGroup
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import com.gh.base.fragment.BaseDialogFragment
|
||||
import com.gh.common.util.MtaHelper
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.databinding.DialogUploadScheduleBinding
|
||||
|
||||
@ -32,6 +33,7 @@ class UploadScheduleDialog : BaseDialogFragment() {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
binding.tvGiveUpUpload.setOnClickListener {
|
||||
onClickListener?.invoke(0)
|
||||
MtaHelper.onEvent("游戏上传", "游戏上传", "放弃上传")
|
||||
}
|
||||
binding.tvExit.setOnClickListener {
|
||||
onClickListener?.invoke(1)
|
||||
@ -62,6 +64,7 @@ class UploadScheduleDialog : BaseDialogFragment() {
|
||||
}*/
|
||||
|
||||
fun uploadFail(){
|
||||
MtaHelper.onEvent("游戏上传", "游戏上传", "上传失败")
|
||||
binding.isUploadSuccess = true
|
||||
binding.ivUpload.setImageDrawable(ContextCompat.getDrawable(requireContext(), R.drawable.ic_upload_failure))
|
||||
binding.tvUpload.text = "游戏上传失败"
|
||||
|
||||
@ -17,6 +17,7 @@ import com.gh.gamecenter.db.GameTrendsDao
|
||||
import com.gh.gamecenter.entity.FunctionalGroupEntity
|
||||
import com.gh.gamecenter.entity.FunctionalLinkEntity
|
||||
import com.gh.gamecenter.entity.FunctionalMessageType
|
||||
import com.gh.gamecenter.game.upload.GameSubmissionActivity
|
||||
import com.gh.gamecenter.gamedetail.myrating.MyRatingActivity
|
||||
import com.gh.gamecenter.history.HistoryActivity
|
||||
import com.gh.gamecenter.manager.UserManager
|
||||
@ -228,6 +229,15 @@ class PersonalFunctionAdapter(val context: Context, val groupName: String, var m
|
||||
CheckLoginUtils.checkLogin(context, "我的光环-个人中心") {}
|
||||
}
|
||||
}
|
||||
"游戏投稿" -> {
|
||||
if (UserManager.getInstance().isLoggedIn) {
|
||||
MtaHelper.onEvent("我的光环", "游戏投稿")
|
||||
context.startActivity(GameSubmissionActivity.getIntent(context, "(我的光环)", ""))
|
||||
} else {
|
||||
MtaHelper.onEvent("我的光环_新", "功能入口-跳转登录", "游戏投稿")
|
||||
CheckLoginUtils.checkLogin(context, "我的光环-游戏投稿") { }
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
DirectUtils.directToLinkPage(context, linkEntity, "", "我的光环")
|
||||
}
|
||||
|
||||
@ -2416,4 +2416,9 @@ public interface ApiService {
|
||||
@PUT("devices/{device_id}/applications")
|
||||
Single<ResponseBody> putInstalledApps(@Path("device_id") String deviceId, @Body RequestBody body);
|
||||
|
||||
/**
|
||||
* 获取游戏上传提示
|
||||
*/
|
||||
@GET("users/upload_games/tip")
|
||||
Single<JsonObject> uploadGamesTips();
|
||||
}
|
||||
@ -24,6 +24,7 @@ import androidx.recyclerview.widget.RecyclerView.ViewHolder;
|
||||
public class SuggestPicAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
|
||||
private OnListClickListener mListListener;
|
||||
private OnItemDeleteListener mDeleteListener;
|
||||
private List<String> picList;
|
||||
private int maxSize = 5;
|
||||
private int mPicItem = R.layout.suggest_pic_item;
|
||||
@ -35,9 +36,10 @@ public class SuggestPicAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
picList = new ArrayList<>();
|
||||
}
|
||||
|
||||
public SuggestPicAdapter(Context context, int maxSize, OnListClickListener listListener) {
|
||||
public SuggestPicAdapter(Context context, int maxSize, OnListClickListener listListener, OnItemDeleteListener deleteListener) {
|
||||
super(context);
|
||||
this.mListListener = listListener;
|
||||
this.mDeleteListener = deleteListener;
|
||||
picList = new ArrayList<>();
|
||||
this.maxSize = maxSize;
|
||||
}
|
||||
@ -70,6 +72,7 @@ public class SuggestPicAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
}
|
||||
|
||||
viewHolder.delete.setOnClickListener(v -> {
|
||||
if (mDeleteListener != null) mDeleteListener.onItemDelete(picList.get(holder.getAdapterPosition()));
|
||||
picList.remove(holder.getAdapterPosition());
|
||||
notifyDataSetChanged();
|
||||
});
|
||||
@ -97,4 +100,8 @@ public class SuggestPicAdapter extends BaseRecyclerAdapter<ViewHolder> {
|
||||
public List<String> getFileList() {
|
||||
return picList;
|
||||
}
|
||||
|
||||
public interface OnItemDeleteListener {
|
||||
void onItemDelete(String data);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user