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

This commit is contained in:
jack
2021-09-28 15:31:48 +08:00
12 changed files with 37 additions and 48 deletions

View File

@ -382,7 +382,8 @@ abstract class BaseRichEditorActivity<VM : BaseRichEditorViewModel> : ToolBarAct
this,
"警告",
"当前使用移动网络,上传图片会消耗手机流量",
"我知道了", "", { startMediaStore() }
"我知道了", "", { startMediaStore() },
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
return
}

View File

@ -85,7 +85,7 @@ object DownloadObserver {
SuggestType.gameQuestion, "notfound",
StringUtils.buildString(downloadEntity.name, ",问题反馈:下载链接失效"),
SimpleGameEntity(gameId, downloadEntity.name, ""))
})
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
return
} else if (DownloadStatus.neterror == downloadEntity.status || DownloadStatus.timeout == downloadEntity.status) {
if (downloadEntity.meta[Constants.MARK_RETRY_DOWNLOAD].isNullOrEmpty()

View File

@ -141,7 +141,8 @@ object ErrorHelper {
context,
"提醒",
"提问过于频繁,请先休息一下哦",
"知道了", ""
"知道了", "",
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true)
)
} else {
Utils.toast(context, R.string.comment_failed_toofrequent)

View File

@ -14,7 +14,7 @@ class GhMatisseVideoApplyFilter : ApplyFilter() {
DialogHelper.showDialog(context, "提示",
"您当前正在使用移动网络上传视频,确定继续上传吗?",
"继续上传", "暂时不了",
{ callBack.onApply() })
{ callBack.onApply() }, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
} else {
callBack.onApply()
}

View File

@ -1398,7 +1398,7 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
public <T> void onListClick(View view, int position, T data) {
if (!mAgreePostPic && !NetworkUtils.isWifiConnected(this)) {
mAgreePostPic = true;
DialogHelper.showDialog(this,
DialogHelper.showCenterDialog(this,
"警告",
"当前使用移动网络,上传图片会消耗手机流量",
"我知道了", "", () -> {
@ -1408,7 +1408,7 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
intent.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
startActivityForResult(intent, MEDIA_STORE_REQUEST);
}
}, () -> { }, false, "", "");
}, () -> { });
return;
}
List<String> picList = (List<String>) data;

View File

@ -125,7 +125,7 @@ public class AnswerAdapter extends ListAdapter<AnswerEntity> implements ISyncAda
}
private void showDeleteDialog(String answerId) {
DialogHelper.showDialog(mContext, "提示"
DialogHelper.showCenterDialog(mContext, "提示"
, "内容已被删除,是否取消收藏?"
, "取消收藏", "暂不"
, () -> CollectionUtils.INSTANCE.deleteCollection(mContext, answerId
@ -141,7 +141,7 @@ public class AnswerAdapter extends ListAdapter<AnswerEntity> implements ISyncAda
Utils.toast(mContext, R.string.collection_cancel_failure);
}
}), () -> {
}, false, "", "");
});
}

View File

@ -83,7 +83,7 @@ public class ArticleFragment extends ListFragment<NewsEntity, ArticleViewModel>
}
private void showDeleteDialog(String articleId) {
DialogHelper.showDialog(requireContext(), "提示"
DialogHelper.showCenterDialog(requireContext(), "提示"
, "内容已被删除,是否取消收藏?"
, "取消收藏", "暂不"
, () -> CollectionUtils.INSTANCE.deleteCollection(requireContext(), articleId
@ -99,6 +99,6 @@ public class ArticleFragment extends ListFragment<NewsEntity, ArticleViewModel>
toast(R.string.collection_cancel_failure);
}
}), () -> {
}, false, "", "");
});
}
}

View File

@ -83,7 +83,7 @@ class CommunityArticleAdapter(context: Context,
} else {
DialogHelper.showDialog(mContext, "提示", "内容已被删除,是否取消收藏?", "取消收藏", "暂不", {
mViewModel.deleteCollection(entity.community.id, entity.id)
})
}, extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
}
}

View File

@ -289,7 +289,7 @@ class Libao3FragmentAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder>
}
private void showDeleteDialog(LibaoEntity libaoEntity) {
DialogHelper.showWarningDialog(mContext, "删除礼包", Html.fromHtml(mContext.getString(R.string.libao_delete_dialog))
DialogHelper.showCenterWarningDialog(mContext, "删除礼包", Html.fromHtml(mContext.getString(R.string.libao_delete_dialog))
, "取消", "确定删除"
, () -> {
LibaoUtils.deleteLibaoCode(mContext, libaoEntity.getCode(), new LibaoUtils.PostLibaoListener() {

View File

@ -778,9 +778,9 @@ abstract class BaseCommentAdapter(
binding.root.context,
"提示",
"是否将此条评论置顶?",
"取消",
"确认",
cancelClickCallback = {
"取消",
confirmClickCallback = {
commentTop(
binding.root.context,
viewModel,
@ -933,8 +933,8 @@ abstract class BaseCommentAdapter(
binding.root.context,
"提示",
"是否将此条评论置顶?",
"取消",
"确认",
"取消",
confirmClickCallback = {
commentTop(
binding.root.context,

View File

@ -14,7 +14,6 @@ import com.gh.common.view.GridSpacingItemDecoration
import com.gh.gamecenter.R
import com.gh.gamecenter.databinding.FragmentLocalMediaBinding
import com.gh.gamecenter.entity.LocalVideoEntity
import com.lightgame.utils.Utils
import com.zhihu.matisse.internal.entity.Album
import com.zhihu.matisse.internal.model.AlbumMediaCollection
import com.zhihu.matisse.internal.utils.PathUtils
@ -69,40 +68,27 @@ class LocalMediaFragment : BaseFragment<Any>(), AlbumMediaCollection.AlbumMediaC
}
mBinding.confirmTv.setOnClickListener {
NewLogUtils.logChooseMedia("click_confirm", publishContentType, publishMediaType)
if (!NetworkUtils.isNetworkConnected(context)) {
Utils.toast(context, "网络异常,请检查手机网络状态")
} else if (!NetworkUtils.isWifiConnected(context)) {
DialogHelper.showDialog(requireContext(), "提示",
"您当前正在使用移动网络上传视频,确定继续上传吗?",
"继续上传", "暂时不了",
{ uploadVideo() })
} else {
uploadVideo()
}
}
}
private fun uploadVideo() {
val intent = Intent()
if (mChooseType == LocalMediaActivity.ChooseType.VIDEO.value) {
val localVideoList = arrayListOf<LocalVideoEntity>()
mAdapter.getSelectedMediaList().forEach {
val path = PathUtils.getPath(requireContext(), it.contentUri)
if (path == null) {
toast("视频已不存在,请重新选择")
return
val intent = Intent()
if (mChooseType == LocalMediaActivity.ChooseType.VIDEO.value) {
val localVideoList = arrayListOf<LocalVideoEntity>()
mAdapter.getSelectedMediaList().forEach {
val path = PathUtils.getPath(requireContext(), it.contentUri)
if (path == null) {
toast("视频已不存在,请重新选择")
return@forEach
}
val id = MD5Utils.getUrlMD5(path) + System.currentTimeMillis()
val format = getFileFormat(it.mimeType)
localVideoList.add(LocalVideoEntity(id, path, contentUri = it.contentUri, duration = it.duration, format = format, size = it.size))
}
val id = MD5Utils.getUrlMD5(path) + System.currentTimeMillis()
val format = getFileFormat(it.mimeType)
localVideoList.add(LocalVideoEntity(id, path, contentUri = it.contentUri, duration = it.duration, format = format, size = it.size))
intent.putExtra(LocalVideoEntity::class.java.name, localVideoList)
} else {
val data = mAdapter.getSelectedMediaList().map { it.contentUri }.toList()
intent.putParcelableArrayListExtra(MatisseActivity.EXTRA_RESULT_SELECTION, ArrayList<Uri>(data))
}
intent.putExtra(LocalVideoEntity::class.java.name, localVideoList)
} else {
val data = mAdapter.getSelectedMediaList().map { it.contentUri }.toList()
intent.putParcelableArrayListExtra(MatisseActivity.EXTRA_RESULT_SELECTION, ArrayList<Uri>(data))
requireActivity().setResult(Activity.RESULT_OK, intent)
requireActivity().finish()
}
requireActivity().setResult(Activity.RESULT_OK, intent)
requireActivity().finish()
}
private fun getFileFormat(mimeType: String?): String {

View File

@ -138,7 +138,8 @@ class SimulatorManagementAdapter(context: Context,
confirmClickCallback = { unInstallSimulator() },
uiModificationCallback = { binding ->
binding.contentTv.setTextColor(R.color.text_333333.toColor())
})
},
extraConfig = DialogHelper.Config(centerTitle = true, centerContent = true))
}
}
}