107 lines
3.5 KiB
Java
107 lines
3.5 KiB
Java
package com.gh.gamecenter;
|
||
|
||
import android.content.Context;
|
||
import android.content.Intent;
|
||
import android.os.Bundle;
|
||
import android.text.TextUtils;
|
||
import android.view.View;
|
||
import android.widget.TextView;
|
||
|
||
import com.gh.base.ToolBarActivity;
|
||
import com.gh.common.constant.Config;
|
||
import com.gh.common.util.DirectUtils;
|
||
import com.gh.common.util.ShareUtils;
|
||
import com.gh.gamecenter.entity.SettingsEntity;
|
||
import com.gh.gamecenter.suggest.SuggestType;
|
||
|
||
import androidx.annotation.NonNull;
|
||
import butterknife.BindView;
|
||
import butterknife.OnClick;
|
||
|
||
/**
|
||
* Created by khy on 2017/3/31.
|
||
*/
|
||
public class SuggestSelectActivity extends ToolBarActivity {
|
||
|
||
public final static int SUGGEST_TYPE_REQUEST = 11; // 只要进入反馈页面(下一个), 无论怎么回退当前页面都会退出
|
||
|
||
@BindView(R.id.suggest_qqun)
|
||
public TextView qQun;
|
||
|
||
private SettingsEntity mSettings;
|
||
|
||
@NonNull
|
||
public static Intent getIntent(Context context) {
|
||
Intent intent = new Intent(context, SuggestSelectActivity.class);
|
||
return intent;
|
||
}
|
||
|
||
@Override
|
||
protected int getLayoutId() {
|
||
return R.layout.activity_suggest_select;
|
||
}
|
||
|
||
@Override
|
||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||
super.onActivityResult(requestCode, resultCode, data);
|
||
if (requestCode == SUGGEST_TYPE_REQUEST && resultCode == SUGGEST_TYPE_REQUEST) {
|
||
finish();
|
||
}
|
||
}
|
||
|
||
@Override
|
||
protected void onCreate(Bundle savedInstanceState) {
|
||
super.onCreate(savedInstanceState);
|
||
setNavigationTitle(getString(R.string.title_suggest_select));
|
||
|
||
mSettings = Config.getSettings();
|
||
if (mSettings != null && mSettings.getSupport() != null &&
|
||
!TextUtils.isEmpty(mSettings.getSupport().getQQun())) {
|
||
qQun.setText(mSettings.getSupport().getQQun());
|
||
}
|
||
}
|
||
|
||
@OnClick({R.id.suggest_type1, R.id.suggest_type2, R.id.suggest_type3, R.id.suggest_type4,
|
||
R.id.suggest_type5, R.id.suggest_type6, R.id.suggest_qqun_rl})
|
||
public void OnClick(View view) {
|
||
SuggestType type = SuggestType.normal;
|
||
switch (view.getId()) {
|
||
case R.id.suggest_type1:
|
||
type = SuggestType.normal;
|
||
break;
|
||
case R.id.suggest_type2:
|
||
type = SuggestType.crash;
|
||
break;
|
||
case R.id.suggest_type3:
|
||
type = SuggestType.gameQuestion;
|
||
break;
|
||
case R.id.suggest_type4:
|
||
type = SuggestType.gameCollect;
|
||
break;
|
||
case R.id.suggest_type5:
|
||
type = SuggestType.functionSuggest;
|
||
break;
|
||
case R.id.suggest_type6:
|
||
type = SuggestType.articleCollect;
|
||
break;
|
||
case R.id.suggest_qqun_rl:
|
||
if (ShareUtils.isQQClientAvailable(this)) {
|
||
String groupNumber = "vd754P2_uNUJqDcgX4V-pyXEGZZVH0DE";
|
||
if (mSettings != null && mSettings.getSupport() != null &&
|
||
!TextUtils.isEmpty(mSettings.getSupport().getQQunKey())) {
|
||
groupNumber = mSettings.getSupport().getQQunKey();
|
||
}
|
||
DirectUtils.directToQqGroup(this, groupNumber); // Q群:367541038 KEY
|
||
}else{
|
||
toast("请先安装QQ");
|
||
}
|
||
|
||
return;
|
||
}
|
||
|
||
Intent intent = SuggestionActivity.getIntent(this, type);
|
||
startActivityForResult(intent, SUGGEST_TYPE_REQUEST);
|
||
|
||
}
|
||
}
|