增加视频上传urlscheme参数
This commit is contained in:
@ -13,6 +13,7 @@ import com.gh.common.util.DirectUtils.directToVideoDetail
|
||||
import com.gh.common.util.EntranceUtils
|
||||
import com.gh.gamecenter.*
|
||||
import com.gh.gamecenter.entity.CommunityEntity
|
||||
import com.gh.gamecenter.entity.SimpleGameEntity
|
||||
import com.gh.gamecenter.entity.SubjectRecommendEntity
|
||||
import com.gh.gamecenter.entity.VideoLinkEntity
|
||||
import com.gh.gamecenter.subject.SubjectActivity
|
||||
@ -125,11 +126,11 @@ object DefaultUrlHandler {
|
||||
val categoryId = uri.getQueryParameter("category_id") ?: ""
|
||||
val link = uri.getQueryParameter("link") ?: ""
|
||||
val linkEntity = VideoLinkEntity(title, categoryId, link)
|
||||
// if (!CheckLoginUtils.isLogin()) {
|
||||
// HaloApp.put(EntranceUtils.HOST_UPLOAD_VIDEO, linkEntity)
|
||||
// }
|
||||
val gameId = uri.getQueryParameter("gameId") ?: ""
|
||||
val gameName = uri.getQueryParameter("gameName") ?: ""
|
||||
val simpleGameEntity = SimpleGameEntity(gameId, gameName)
|
||||
CheckLoginUtils.checkLogin(context, null, true, EntranceUtils.ENTRANCE_BROWSER) {
|
||||
DirectUtils.directToVideoManager(context, linkEntity, EntranceUtils.ENTRANCE_BROWSER, "")
|
||||
DirectUtils.directToVideoManager(context, linkEntity, simpleGameEntity, EntranceUtils.ENTRANCE_BROWSER, "")
|
||||
}
|
||||
}
|
||||
EntranceUtils.HOST_USERHOME -> {
|
||||
@ -215,7 +216,7 @@ object DefaultUrlHandler {
|
||||
}
|
||||
|
||||
EntranceUtils.HOST_GAME_UPLOAD -> {
|
||||
DirectUtils.directGameUpload(context,entrance = entrance, path = "")
|
||||
DirectUtils.directGameUpload(context, entrance = entrance, path = "")
|
||||
}
|
||||
|
||||
else -> DialogUtils.showLowVersionDialog(context)
|
||||
|
||||
@ -677,10 +677,11 @@ object DirectUtils {
|
||||
* 跳转至上传视频
|
||||
*/
|
||||
@JvmStatic
|
||||
fun directToVideoManager(context: Context, linkEntity: VideoLinkEntity, entrance: String? = null, path: String? = "") {
|
||||
fun directToVideoManager(context: Context, linkEntity: VideoLinkEntity,simpleGameEntity: SimpleGameEntity, entrance: String? = null, path: String? = "") {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(KEY_PATH, path)
|
||||
bundle.putParcelable(VideoLinkEntity::class.java.simpleName, linkEntity)
|
||||
bundle.putParcelable(SimpleGameEntity::class.java.simpleName, simpleGameEntity)
|
||||
bundle.putString(KEY_TO, VideoManagerActivity::class.java.name)
|
||||
bundle.putString(KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
jumpActivity(context, bundle)
|
||||
|
||||
@ -12,6 +12,7 @@ import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.common.util.PlatformUtils;
|
||||
import com.gh.common.util.RunningUtils;
|
||||
import com.gh.gamecenter.entity.CommunityEntity;
|
||||
import com.gh.gamecenter.entity.SimpleGameEntity;
|
||||
import com.gh.gamecenter.entity.SubjectRecommendEntity;
|
||||
import com.gh.gamecenter.entity.VideoLinkEntity;
|
||||
import com.gh.gamecenter.manager.UserManager;
|
||||
@ -97,7 +98,7 @@ public class SkipActivity extends BaseActivity {
|
||||
DirectUtils.directToArticle(this, path, ENTRANCE_BROWSER);
|
||||
break;
|
||||
case HOST_GAME:
|
||||
DirectUtils.directToGameDetail(this, path, ENTRANCE_BROWSER, false, "libao".equals(to),null);
|
||||
DirectUtils.directToGameDetail(this, path, ENTRANCE_BROWSER, false, "libao".equals(to), null);
|
||||
break;
|
||||
case HOST_COLUMN:
|
||||
DirectUtils.directToSubject(this, path, uri.getQueryParameter(KEY_NAME), ENTRANCE_BROWSER);
|
||||
@ -182,11 +183,12 @@ public class SkipActivity extends BaseActivity {
|
||||
String categoryId = uri.getQueryParameter("category_id");
|
||||
String link = uri.getQueryParameter("link");
|
||||
VideoLinkEntity linkEntity = new VideoLinkEntity(title, categoryId, link);
|
||||
// if (!CheckLoginUtils.isLogin()) {
|
||||
// HaloApp.put(HOST_UPLOAD_VIDEO, linkEntity);
|
||||
// }
|
||||
Bundle nextToBundle = VideoManagerActivity.getVideoManagerBundle(linkEntity, EntranceUtils.ENTRANCE_BROWSER, "");
|
||||
CheckLoginUtils.checkLogin(this, nextToBundle, true, EntranceUtils.ENTRANCE_BROWSER, null);
|
||||
gameId = uri.getQueryParameter("gameId");
|
||||
String gameName = uri.getQueryParameter("gameName");
|
||||
SimpleGameEntity simpleGameEntity = new SimpleGameEntity(gameId, gameName, "");
|
||||
Bundle nextToBundle = VideoManagerActivity.getVideoManagerBundle(linkEntity, simpleGameEntity, EntranceUtils.ENTRANCE_BROWSER, "");
|
||||
CheckLoginUtils.checkLogin(this, nextToBundle, true, EntranceUtils.ENTRANCE_BROWSER, () ->
|
||||
DirectUtils.directToVideoManager(SkipActivity.this, linkEntity, simpleGameEntity, EntranceUtils.ENTRANCE_BROWSER, "浏览器"));
|
||||
break;
|
||||
case HOST_VIDEO_SINGLE:
|
||||
DirectUtils.directToVideoDetail(this, path, VideoDetailContainerViewModel.Location.SINGLE_VIDEO.getValue(),
|
||||
@ -283,7 +285,7 @@ public class SkipActivity extends BaseActivity {
|
||||
break;
|
||||
|
||||
case EntranceUtils.HOST_SERVER_BLOCK:
|
||||
DirectUtils.directToGameServers(this,ENTRANCE_BROWSER, "浏览器");
|
||||
DirectUtils.directToGameServers(this, ENTRANCE_BROWSER, "浏览器");
|
||||
break;
|
||||
|
||||
case EntranceUtils.HOST_AMWAY_BLOCK:
|
||||
|
||||
@ -164,6 +164,11 @@ class UploadVideoActivity : ToolBarActivity() {
|
||||
} else {
|
||||
setNavigationTitle("视频上传")
|
||||
}
|
||||
mViewModel.gameEntity = intent.getParcelableExtra(SimpleGameEntity::class.java.simpleName)
|
||||
if (mViewModel.gameEntity != null) {
|
||||
mBinding.gameName.text = mViewModel.gameEntity?.name ?: ""
|
||||
mBinding.gameName.setTextColor(resources.getColor(R.color.text_333333))
|
||||
}
|
||||
}
|
||||
|
||||
private fun initViewModel() {
|
||||
@ -751,12 +756,14 @@ class UploadVideoActivity : ToolBarActivity() {
|
||||
fun getIntent(context: Context,
|
||||
videoPath: String,
|
||||
linkEntity: VideoLinkEntity,
|
||||
simpleGameEntity: SimpleGameEntity? = null,
|
||||
entrance: String,
|
||||
path: String): Intent {
|
||||
val intent = Intent(context, UploadVideoActivity::class.java)
|
||||
intent.putExtra(EntranceUtils.KEY_ENTRANCE, mergeEntranceAndPath(entrance, path))
|
||||
intent.putExtra(EntranceUtils.KEY_PATH, path)
|
||||
intent.putExtra(VideoLinkEntity::class.java.simpleName, linkEntity)
|
||||
intent.putExtra(SimpleGameEntity::class.java.simpleName, simpleGameEntity)
|
||||
intent.putExtra(EntranceUtils.KEY_PATH_VIDEO, videoPath)
|
||||
return intent
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@ import com.gh.base.BaseActivity
|
||||
import com.gh.base.BaseActivity_TabLayout
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.entity.SimpleGameEntity
|
||||
import com.gh.gamecenter.entity.VideoLinkEntity
|
||||
import com.gh.gamecenter.video.upload.view.UploadVideoActivity
|
||||
import com.zhihu.matisse.Matisse
|
||||
@ -20,6 +21,7 @@ import com.zhihu.matisse.internal.utils.PathUtils
|
||||
class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
|
||||
private var mVideoLink: VideoLinkEntity? = null
|
||||
private var mSimpleGameEntity: SimpleGameEntity? = null
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
@ -28,7 +30,7 @@ class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
if (uris.size > 0) {
|
||||
val videoPath = PathUtils.getPath(this, uris[0]) ?: ""
|
||||
val intent = if (mVideoLink != null) {
|
||||
UploadVideoActivity.getIntent(this, videoPath, mVideoLink!!, mEntrance, "视频投稿")
|
||||
UploadVideoActivity.getIntent(this, videoPath, mVideoLink!!, mSimpleGameEntity, mEntrance, "视频投稿")
|
||||
} else {
|
||||
UploadVideoActivity.getIntent(this, videoPath, mEntrance, "视频投稿")
|
||||
}
|
||||
@ -47,6 +49,7 @@ class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
setNavigationTitle("视频投稿")
|
||||
setToolbarMenu(R.menu.menu_text)
|
||||
mVideoLink = intent.getParcelableExtra(VideoLinkEntity::class.java.simpleName)
|
||||
mSimpleGameEntity = intent.getParcelableExtra(SimpleGameEntity::class.java.simpleName)
|
||||
|
||||
val menuItem = getMenuItem(R.id.menu_text)
|
||||
val container = menuItem.actionView.findViewById<View>(R.id.menu_text)
|
||||
@ -106,10 +109,11 @@ class VideoManagerActivity : BaseActivity_TabLayout() {
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun getVideoManagerBundle(linkEntity: VideoLinkEntity, entrance: String? = null, path: String? = ""): Bundle {
|
||||
fun getVideoManagerBundle(linkEntity: VideoLinkEntity, simpleGameEntity: SimpleGameEntity, entrance: String? = null, path: String? = ""): Bundle {
|
||||
val bundle = Bundle()
|
||||
bundle.putString(EntranceUtils.KEY_PATH, path)
|
||||
bundle.putParcelable(VideoLinkEntity::class.java.simpleName, linkEntity)
|
||||
bundle.putParcelable(SimpleGameEntity::class.java.simpleName, simpleGameEntity)
|
||||
bundle.putString(EntranceUtils.KEY_TO, VideoManagerActivity::class.java.name)
|
||||
bundle.putString(EntranceUtils.KEY_ENTRANCE, BaseActivity.mergeEntranceAndPath(entrance, path))
|
||||
return bundle
|
||||
|
||||
Reference in New Issue
Block a user