Merge branch 'dev' of gitlab.ghzs.com:halo/assistant-android into dev
This commit is contained in:
@ -13,6 +13,9 @@ import com.gh.common.util.DisplayUtils;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.gamecenter.entity.GameEntity;
|
||||
import com.gh.gamecenter.gamedetail.GameDetailFragment;
|
||||
import com.halo.assistant.HaloApp;
|
||||
|
||||
import static com.gh.gamecenter.gamedetail.fuli.answer.GameDetailAnswerAdapter.GAME_DETAIL_COME_IN;
|
||||
|
||||
/**
|
||||
* Created by khy on 2017/3/24.
|
||||
@ -163,4 +166,10 @@ public class GameDetailActivity extends NormalActivity {
|
||||
protected boolean showDownloadMenu() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
HaloApp.remove(GAME_DETAIL_COME_IN);
|
||||
}
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ class GameUploadFragment : NormalFragment() {
|
||||
private var selectGameDialog: Dialog? = null
|
||||
private lateinit var gameEntity: InstallGameEntity
|
||||
private lateinit var uploadDialog: UploadScheduleDialog
|
||||
private lateinit var mViewModel:GameUploadViewModel
|
||||
private lateinit var mViewModel: GameUploadViewModel
|
||||
private var disposable: Disposable? = null
|
||||
val pathMap = LinkedHashMap<String, String>()
|
||||
|
||||
@ -59,7 +59,7 @@ class GameUploadFragment : NormalFragment() {
|
||||
val factory = GameUploadViewModel.Factory(HaloApp.getInstance().application)
|
||||
mViewModel = ViewModelProviders.of(this, factory).get(GameUploadViewModel::class.java)
|
||||
mViewModel.upLoadSuccess.observe(this, Observer {
|
||||
if (it){
|
||||
if (it) {
|
||||
uploadDialog.uploadSuccess(true)
|
||||
}
|
||||
})
|
||||
@ -111,7 +111,7 @@ class GameUploadFragment : NormalFragment() {
|
||||
startActivity(WebActivity.getUploadPolicyIntent(context!!))
|
||||
}
|
||||
}, privacyContent.length - 21, privacyContent.length - 11, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
|
||||
tv_protocol.text=privacyContent
|
||||
tv_protocol.text = privacyContent
|
||||
tv_protocol.movementMethod = LinkMovementMethod()
|
||||
|
||||
initListener()
|
||||
@ -207,14 +207,14 @@ class GameUploadFragment : NormalFragment() {
|
||||
}
|
||||
|
||||
//上传游戏
|
||||
private fun uploadGames(){
|
||||
val imageList=ArrayList<String>()
|
||||
private fun uploadGames() {
|
||||
val imageList = ArrayList<String>()
|
||||
for ((_, value) in pathMap) {
|
||||
imageList.add(value)
|
||||
}
|
||||
val requestMap = HashMap<String, Any>()
|
||||
requestMap["package_name"] = tv_choose.text.toString()
|
||||
requestMap["size"] = gameEntity.gameSize
|
||||
requestMap["size"] = gameEntity.gameSize / 1024
|
||||
requestMap["name"] = et_game_name.text.toString()
|
||||
requestMap["des"] = et_game_intro.text.toString()
|
||||
requestMap["images"] = imageList
|
||||
|
||||
@ -13,6 +13,7 @@ import com.gh.gamecenter.qa.entity.AnswerEntity
|
||||
import com.gh.gamecenter.qa.entity.Questions
|
||||
import com.gh.gamecenter.qa.questions.detail.QuestionsDetailActivity
|
||||
import com.gh.gamecenter.qa.recommends.AskQuestionsRecommendsViewHolder
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.adapter.BaseRecyclerAdapter
|
||||
|
||||
class GameDetailAnswerAdapter(context: Context,
|
||||
@ -21,6 +22,11 @@ class GameDetailAnswerAdapter(context: Context,
|
||||
private val mEntrance: String)
|
||||
: BaseRecyclerAdapter<AskQuestionsRecommendsViewHolder>(context) {
|
||||
|
||||
companion object {
|
||||
//从游戏详情进入
|
||||
const val GAME_DETAIL_COME_IN = "game_detail_come_in"
|
||||
}
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): AskQuestionsRecommendsViewHolder {
|
||||
val view = mLayoutInflater.inflate(R.layout.ask_questions_hot_item, parent, false)
|
||||
return AskQuestionsRecommendsViewHolder(view)
|
||||
@ -39,6 +45,7 @@ class GameDetailAnswerAdapter(context: Context,
|
||||
val path = "游戏详情-动态"
|
||||
holder.initQuestionsHotViewHolder(mContext, entity, mEntrance, path)
|
||||
holder.mAskTitle.setOnClickListener {
|
||||
HaloApp.put(GAME_DETAIL_COME_IN,true)
|
||||
if ("community_article" == entity.type) {
|
||||
mContext.startActivity(ArticleDetailActivity.getIntent(mContext, CommunityEntity(entity.communityId!!, ""), entity.id!!, mEntrance, path))
|
||||
} else {
|
||||
@ -48,6 +55,7 @@ class GameDetailAnswerAdapter(context: Context,
|
||||
|
||||
}
|
||||
holder.itemView.setOnClickListener {
|
||||
HaloApp.put(GAME_DETAIL_COME_IN,true)
|
||||
if ("community_article" == entity.type) {
|
||||
mContext.startActivity(ArticleDetailActivity.getIntent(mContext, CommunityEntity(entity.communityId!!, ""), entity.id!!, mEntrance, path))
|
||||
} else {
|
||||
|
||||
@ -8,6 +8,9 @@ import androidx.annotation.NonNull;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.gamecenter.NormalActivity;
|
||||
import com.gh.gamecenter.entity.SpecialColumn;
|
||||
import com.halo.assistant.HaloApp;
|
||||
|
||||
import static com.gh.gamecenter.gamedetail.fuli.answer.GameDetailAnswerAdapter.GAME_DETAIL_COME_IN;
|
||||
|
||||
/**
|
||||
* Created by khy on 10/04/18.
|
||||
@ -16,6 +19,15 @@ import com.gh.gamecenter.entity.SpecialColumn;
|
||||
public class AnswerDetailActivity extends NormalActivity {
|
||||
public static final String TAG = "AnswerDetailActivity";
|
||||
|
||||
@Override
|
||||
public boolean showToolbarAtLeft() {
|
||||
|
||||
if (HaloApp.get(GAME_DETAIL_COME_IN, false)!=null){
|
||||
return true;
|
||||
}
|
||||
return super.showToolbarAtLeft();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Intent getIntent(Context context, String answerId, String entrance, String path) {
|
||||
return getIntent(context, answerId, entrance, path, false, null);
|
||||
|
||||
@ -38,6 +38,7 @@ import com.gh.gamecenter.*
|
||||
import com.gh.gamecenter.databinding.FragmentAnswerDetailBinding
|
||||
import com.gh.gamecenter.entity.*
|
||||
import com.gh.gamecenter.eventbus.EBReuse
|
||||
import com.gh.gamecenter.gamedetail.fuli.answer.GameDetailAnswerAdapter
|
||||
import com.gh.gamecenter.normal.NormalFragment
|
||||
import com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG
|
||||
import com.gh.gamecenter.qa.answer.edit.AnswerEditActivity
|
||||
@ -48,6 +49,7 @@ import com.gh.gamecenter.qa.entity.EditorInsertEntity
|
||||
import com.gh.gamecenter.qa.entity.Questions
|
||||
import com.gh.gamecenter.qa.questions.detail.QuestionsDetailActivity
|
||||
import com.gh.gamecenter.suggest.SuggestType
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.utils.Utils
|
||||
import com.qq.gdt.action.ActionType
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
@ -616,6 +618,10 @@ class AnswerDetailFragment : NormalFragment() {
|
||||
override fun onMenuItemClick(menuItem: MenuItem) {
|
||||
when (menuItem.itemId) {
|
||||
R.id.menu_more -> mViewModel.answerDetail?.let { showMoreItemDialog(it) }
|
||||
R.id.menu_question_and_answer->{
|
||||
HaloApp.remove(GameDetailAnswerAdapter.GAME_DETAIL_COME_IN)
|
||||
DirectUtils.directToCommunity(context!!, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -992,6 +998,8 @@ class AnswerDetailFragment : NormalFragment() {
|
||||
(requireActivity() as BaseToolBarActivity).clearMenu()
|
||||
|
||||
initMenu(R.menu.menu_answer)
|
||||
val itemMenu = getItemMenu(R.id.menu_question_and_answer)
|
||||
itemMenu.isVisible = HaloApp.get(GameDetailAnswerAdapter.GAME_DETAIL_COME_IN, false) != null
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -31,6 +31,8 @@ import com.gh.gamecenter.entity.CommunityEntity
|
||||
import com.gh.gamecenter.entity.Permissions
|
||||
import com.gh.gamecenter.entity.SpecialColumn
|
||||
import com.gh.gamecenter.eventbus.EBReuse
|
||||
import com.gh.gamecenter.gamedetail.fuli.answer.GameDetailAnswerAdapter
|
||||
import com.gh.gamecenter.gamedetail.fuli.answer.GameDetailAnswerAdapter.Companion.GAME_DETAIL_COME_IN
|
||||
import com.gh.gamecenter.manager.UserManager
|
||||
import com.gh.gamecenter.mvvm.Status
|
||||
import com.gh.gamecenter.personal.PersonalFragment
|
||||
@ -41,6 +43,7 @@ import com.gh.gamecenter.qa.entity.ArticleDetailEntity
|
||||
import com.gh.gamecenter.qa.entity.EditorInsertEntity
|
||||
import com.gh.gamecenter.suggest.SuggestType
|
||||
import com.google.android.flexbox.FlexboxLayout
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.qq.gdt.action.ActionType
|
||||
import kotterknife.bindView
|
||||
import org.greenrobot.eventbus.Subscribe
|
||||
@ -66,6 +69,13 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
|
||||
private var mSpecialColumn: SpecialColumn? = null
|
||||
|
||||
override fun showToolbarAtLeft(): Boolean {
|
||||
|
||||
return if (HaloApp.get(GAME_DETAIL_COME_IN, false) != null) {
|
||||
true
|
||||
} else super.showToolbarAtLeft()
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (requestCode == ARTICLE_PATCH_REQUEST && resultCode == Activity.RESULT_OK) {
|
||||
@ -105,6 +115,10 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setToolbarMenu(R.menu.menu_answer)
|
||||
|
||||
val itemMenu = getMenuItem(R.id.menu_question_and_answer)
|
||||
itemMenu.isVisible = HaloApp.get(GAME_DETAIL_COME_IN, false) != null
|
||||
|
||||
setNavigationTitle(getString(R.string.community_article_detail_title))
|
||||
mNoDataText.setText(R.string.content_delete_hint)
|
||||
|
||||
@ -255,6 +269,10 @@ class ArticleDetailActivity : BaseActivity() {
|
||||
if (mViewModel.detailEntity != null) {
|
||||
when (item?.itemId) {
|
||||
R.id.menu_more -> showMoreItemDialog()
|
||||
R.id.menu_question_and_answer->{
|
||||
HaloApp.remove(GAME_DETAIL_COME_IN)
|
||||
DirectUtils.directToCommunity(this, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onMenuItemClick(item)
|
||||
|
||||
@ -7,6 +7,9 @@ import android.os.Bundle;
|
||||
import com.gh.common.util.EntranceUtils;
|
||||
import com.gh.gamecenter.NormalActivity;
|
||||
import com.gh.gamecenter.entity.SpecialColumn;
|
||||
import com.halo.assistant.HaloApp;
|
||||
|
||||
import static com.gh.gamecenter.gamedetail.fuli.answer.GameDetailAnswerAdapter.GAME_DETAIL_COME_IN;
|
||||
|
||||
/**
|
||||
* Created by khy on 10/04/18.
|
||||
@ -16,6 +19,14 @@ public class QuestionsDetailActivity extends NormalActivity {
|
||||
|
||||
public static final String TAG = "QuestionsDetailActivity";
|
||||
|
||||
@Override
|
||||
public boolean showToolbarAtLeft() {
|
||||
if (HaloApp.get(GAME_DETAIL_COME_IN, false)!=null){
|
||||
return true;
|
||||
}
|
||||
return super.showToolbarAtLeft();
|
||||
}
|
||||
|
||||
public static Intent getIntent(Context context, String questionId, String entrance, String path) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(EntranceUtils.KEY_QUESTIONS_ID, questionId);
|
||||
|
||||
@ -31,6 +31,7 @@ import com.gh.gamecenter.baselist.LoadType
|
||||
import com.gh.gamecenter.entity.Permissions
|
||||
import com.gh.gamecenter.entity.SpecialColumn
|
||||
import com.gh.gamecenter.eventbus.EBReuse
|
||||
import com.gh.gamecenter.gamedetail.fuli.answer.GameDetailAnswerAdapter.Companion.GAME_DETAIL_COME_IN
|
||||
import com.gh.gamecenter.mvvm.Status
|
||||
import com.gh.gamecenter.personal.PersonalFragment.LOGIN_TAG
|
||||
import com.gh.gamecenter.qa.answer.detail.AnswerDetailActivity
|
||||
@ -47,6 +48,7 @@ import com.gh.gamecenter.qa.questions.invite.QuestionsInviteActivity
|
||||
import com.gh.gamecenter.retrofit.Response
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager
|
||||
import com.gh.gamecenter.suggest.SuggestType
|
||||
import com.halo.assistant.HaloApp
|
||||
import com.lightgame.utils.Utils
|
||||
import com.qq.gdt.action.ActionType
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
@ -124,6 +126,8 @@ class QuestionsDetailFragment :
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
super.onActivityCreated(savedInstanceState)
|
||||
initMenu(R.menu.menu_questions_detail)
|
||||
val itemMenu = getItemMenu(R.id.menu_question_and_answer)
|
||||
itemMenu.isVisible = HaloApp.get(GAME_DETAIL_COME_IN, false) != null
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
@ -327,6 +331,10 @@ class QuestionsDetailFragment :
|
||||
if (mQuestionsDetailEntity == null) return
|
||||
when (menuItem.itemId) {
|
||||
R.id.menu_more -> showMoreItemDialog()
|
||||
R.id.menu_question_and_answer->{
|
||||
HaloApp.remove(GAME_DETAIL_COME_IN)
|
||||
DirectUtils.directToCommunity(context!!, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
13
app/src/main/res/drawable/button_border_1383eb_oval.xml
Normal file
13
app/src/main/res/drawable/button_border_1383eb_oval.xml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android = "http://schemas.android.com/apk/res/android"
|
||||
android:shape = "rectangle" >
|
||||
|
||||
<stroke
|
||||
android:width = "1dp"
|
||||
android:color = "@color/text_1383EB" />
|
||||
|
||||
<corners android:radius = "999dp" />
|
||||
|
||||
<solid android:color = "@android:color/transparent" />
|
||||
|
||||
</shape >
|
||||
19
app/src/main/res/layout/layout_menu_question_and_answer.xml
Normal file
19
app/src/main/res/layout/layout_menu_question_and_answer.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android = "http://schemas.android.com/apk/res/android"
|
||||
android:layout_width = "wrap_content"
|
||||
android:layout_height = "wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id = "@+id/menu_question_and_answer"
|
||||
android:layout_width = "wrap_content"
|
||||
android:layout_height = "22dp"
|
||||
android:layout_centerInParent = "true"
|
||||
android:gravity = "center"
|
||||
android:textColor = "@color/text_1383EB"
|
||||
android:textSize = "12sp"
|
||||
android:paddingLeft="10dp"
|
||||
android:paddingRight="10dp"
|
||||
android:background="@drawable/button_border_1383eb_oval"
|
||||
android:text = "问答" />
|
||||
|
||||
</RelativeLayout >
|
||||
@ -2,6 +2,12 @@
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_question_and_answer"
|
||||
app:actionLayout="@layout/layout_menu_question_and_answer"
|
||||
android:title="问答"
|
||||
app:showAsAction="always" />
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_more"
|
||||
android:icon="@drawable/menu_more"
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<item
|
||||
android:id="@+id/menu_question_and_answer"
|
||||
app:actionLayout="@layout/layout_menu_question_and_answer"
|
||||
android:title="问答"
|
||||
app:showAsAction="always" />
|
||||
<item
|
||||
android:id="@+id/menu_more"
|
||||
android:icon="@drawable/menu_ic_more"
|
||||
|
||||
@ -124,5 +124,7 @@
|
||||
<color name="text_e6f3ff">#e6f3ff</color>
|
||||
<color name="text_2496FF">#2496FF</color>
|
||||
<color name="text_1F89EC">#1F89EC</color>
|
||||
<color name="text_1383EB">#1383EB</color>
|
||||
<color name="text_EEF5FB">#EEF5FB</color>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user