版权申诉UI
This commit is contained in:
@ -6,6 +6,7 @@ import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
@ -21,15 +22,10 @@ import android.widget.CheckedTextView;
|
||||
import android.widget.EditText;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.ScrollView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.gh.base.OnListClickListener;
|
||||
import com.gh.base.OnRequestCallBackListener;
|
||||
import com.gh.base.ToolBarActivity;
|
||||
@ -89,6 +85,11 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import butterknife.BindView;
|
||||
import butterknife.OnClick;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@ -153,12 +154,53 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
TextView mLinkEt;
|
||||
@BindView(R.id.suggest_link_container)
|
||||
View mLinkContainer;
|
||||
@BindView(R.id.contactMethodContainer)
|
||||
View mContactMethodContainer;
|
||||
@BindView(R.id.picContainer)
|
||||
View mPicContainer;
|
||||
|
||||
@BindView(R.id.copyrightContainer)
|
||||
View mCopyrightContainer;
|
||||
@BindView(R.id.suggestIdentityRg)
|
||||
RadioGroup mSuggestIdentityRg;
|
||||
@BindView(R.id.suggestIdentityTv)
|
||||
TextView mSuggestIdentityTv;
|
||||
@BindView(R.id.credentialsCodeTv)
|
||||
TextView mCredentialsCodeTv;
|
||||
@BindView(R.id.credentialsCodeEt)
|
||||
EditText mCredentialsCodeEt;
|
||||
@BindView(R.id.credentialsPhotoTv)
|
||||
TextView mCredentialsPhotoTv;
|
||||
@BindView(R.id.credentialsPhotoRv)
|
||||
RecyclerView mCredentialsPhotoRv;
|
||||
@BindView(R.id.appNameTv)
|
||||
TextView mAppNameTv;
|
||||
@BindView(R.id.appNameEt)
|
||||
EditText mAppNameEt;
|
||||
@BindView(R.id.infringementAppScreenshotTv)
|
||||
TextView mInfringementAppScreenshotTv;
|
||||
@BindView(R.id.infringementAppScreenshotRv)
|
||||
RecyclerView mInfringementAppScreenshotRv;
|
||||
@BindView(R.id.explanationTv)
|
||||
TextView mExplanationTv;
|
||||
@BindView(R.id.explanationEt)
|
||||
EditText mExplanationEt;
|
||||
@BindView(R.id.contactMethodTv)
|
||||
TextView mContactMethodTv;
|
||||
@BindView(R.id.contactMethodEt)
|
||||
EditText mContactMethodEt;
|
||||
@BindView(R.id.lookDetailDesTv)
|
||||
TextView mLookDetailDesTv;
|
||||
|
||||
public static final int MEDIA_STORE_REQUEST = 1;
|
||||
public static final int MEDIA_STORE_CREDENTIALS_REQUEST = 2;
|
||||
public static final int MEDIA_STORE_SCREENSHOT_REQUEST = 3;
|
||||
public static final String SUGGESTION_HINT_TYPE = "SUGGESTION_HINT_TYPE";
|
||||
public static final String FROM_RATING_KEY = "from_rating_key";
|
||||
|
||||
private SuggestPicAdapter mAdapter;
|
||||
private SuggestPicAdapter mCredentialsAdapter;
|
||||
private SuggestPicAdapter mScreenshotAdapter;
|
||||
|
||||
private Dialog selectGameDialog;
|
||||
private WaitingDialogFragment postDialog;
|
||||
@ -187,6 +229,8 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
|
||||
private String mCollectCancelPkgName = "";
|
||||
|
||||
private String mSuggestIdentity = "个人";//版权方身份
|
||||
|
||||
@NonNull
|
||||
public static Intent getIntent(Context context, SuggestType suggestType) {
|
||||
Intent intent = new Intent(context, SuggestionActivity.class);
|
||||
@ -247,7 +291,8 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (data != null && requestCode == MEDIA_STORE_REQUEST) {
|
||||
if (data == null) return;
|
||||
if (requestCode == MEDIA_STORE_REQUEST || requestCode == MEDIA_STORE_CREDENTIALS_REQUEST || requestCode == MEDIA_STORE_SCREENSHOT_REQUEST) {
|
||||
Uri selectedImage = data.getData();
|
||||
if (selectedImage == null) {
|
||||
return;
|
||||
@ -272,7 +317,13 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
long count = ImageUtils.getUploadFileMaxSize() / 1024 / 1024;
|
||||
Utils.toast(this, getString(R.string.pic_max_hint, count));
|
||||
} else {
|
||||
mAdapter.addFileList(picturePath);
|
||||
if (requestCode == MEDIA_STORE_REQUEST) {
|
||||
mAdapter.addFileList(picturePath);
|
||||
} else if (requestCode == MEDIA_STORE_CREDENTIALS_REQUEST) {
|
||||
mCredentialsAdapter.addFileList(picturePath);
|
||||
} else {
|
||||
mScreenshotAdapter.addFileList(picturePath);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Utils.toast(this, e.getMessage());
|
||||
@ -419,14 +470,61 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
mSuggestGameName.setVisibility(View.VISIBLE);
|
||||
mSuggestGameLl.setEnabled(false);
|
||||
}
|
||||
|
||||
mSuggestContentEt.setFocusable(true);
|
||||
mSuggestContentEt.setFocusableInTouchMode(true);
|
||||
mSuggestContentEt.requestFocus();
|
||||
mSuggestContentEt.setFilters(new InputFilter[]{TextHelper.getFilter(256, "最多输入256个字")});
|
||||
mSuggestEmailEt.setFilters(new InputFilter[]{TextHelper.getFilter(64, "最多输入64个字")});
|
||||
mTypeOtherName.setFilters(new InputFilter[]{TextHelper.getFilter(30, " 最多输入30个字")});
|
||||
Util_System_Keyboard.showSoftKeyboard(this, mSuggestContentEt);
|
||||
if (mSuggestType != SuggestType.copyright) {
|
||||
mSuggestContentEt.setFocusable(true);
|
||||
mSuggestContentEt.setFocusableInTouchMode(true);
|
||||
mSuggestContentEt.requestFocus();
|
||||
} else {
|
||||
mCredentialsAdapter = new SuggestPicAdapter(this, 5, new OnListClickListener() {
|
||||
@Override
|
||||
public <T> void onListClick(View view, int position, T data) {
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
startActivityForResult(intent, MEDIA_STORE_CREDENTIALS_REQUEST);
|
||||
}
|
||||
});
|
||||
mCredentialsAdapter.setPicItem(R.layout.game_upload_pic_item);
|
||||
mCredentialsAdapter.setSuggestAddPicIcon(R.drawable.icon_pic_add);
|
||||
mCredentialsPhotoRv.setLayoutManager(new GridLayoutManager(this, 5) {
|
||||
@Override
|
||||
public boolean canScrollVertically() {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
mCredentialsPhotoRv.setAdapter(mCredentialsAdapter);
|
||||
|
||||
mScreenshotAdapter = new SuggestPicAdapter(this, 5, new OnListClickListener() {
|
||||
@Override
|
||||
public <T> void onListClick(View view, int position, T data) {
|
||||
Intent intent = new Intent(Intent.ACTION_PICK, MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
|
||||
startActivityForResult(intent, MEDIA_STORE_SCREENSHOT_REQUEST);
|
||||
}
|
||||
});
|
||||
mScreenshotAdapter.setPicItem(R.layout.game_upload_pic_item);
|
||||
mScreenshotAdapter.setSuggestAddPicIcon(R.drawable.icon_pic_add);
|
||||
mInfringementAppScreenshotRv.setLayoutManager(new GridLayoutManager(this, 5) {
|
||||
@Override
|
||||
public boolean canScrollVertically() {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
mInfringementAppScreenshotRv.setAdapter(mScreenshotAdapter);
|
||||
|
||||
mSuggestIdentityRg.setOnCheckedChangeListener((group, checkedId) -> {
|
||||
if (checkedId == R.id.suggestPersonalRb) {
|
||||
mSuggestIdentity = "个人";
|
||||
mCredentialsCodeEt.setHint("请填写身份证号或护照号");
|
||||
mCredentialsPhotoTv.setText(Html.fromHtml(getString(R.string.suggestion_credentials_pic)));
|
||||
} else if (checkedId == R.id.suggestCompanyRb) {
|
||||
mSuggestIdentity = "公司或组织";
|
||||
mCredentialsCodeEt.setHint("请填写公司营业执照或组织代码等");
|
||||
mCredentialsPhotoTv.setText(Html.fromHtml(getString(R.string.suggestion_company_pic)));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void initSuggest(SuggestType type) {
|
||||
@ -434,12 +532,15 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
mSuggestContentEt.setHint("请详细描述你遇到的问题... \n ↓↓你还可以上传截图");
|
||||
mSuggestTypeContainer.setVisibility(View.GONE);
|
||||
mSuggestGameLl.setVisibility(View.GONE);
|
||||
mCopyrightContainer.setVisibility(View.GONE);
|
||||
} else if (type == SuggestType.crash) {
|
||||
mSuggestContentEt.setHint("请详细描述闪退之前你所进行的操作... \n ↓↓你还可以上传截图");
|
||||
mSuggestTypeContainer.setVisibility(View.GONE);
|
||||
mSuggestGameLl.setVisibility(View.GONE);
|
||||
mCopyrightContainer.setVisibility(View.GONE);
|
||||
} else if (type == SuggestType.gameQuestion) {
|
||||
mSuggestTypeContainer.setVisibility(View.GONE);
|
||||
mCopyrightContainer.setVisibility(View.GONE);
|
||||
if (!EntranceUtils.KEY_PLUGIN.equals(mSuggestHintType)) {
|
||||
mSuggestContentEt.setHint("请描述具体遇到的问题... \n ↓↓你还可以上传截图");
|
||||
mSuggestGameLl.setVisibility(View.VISIBLE);
|
||||
@ -458,6 +559,7 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
mSuggestTypeContainer.setVisibility(View.GONE);
|
||||
mSuggestContentEt.setHint("请在上方选择或填写游戏名↑↑ \n 在此处可输入补充信息(例如游戏的平台版本等)");
|
||||
mEmailName.setText(Html.fromHtml(getString(R.string.suggestion_contact)));
|
||||
mCopyrightContainer.setVisibility(View.GONE);
|
||||
} else if (type == SuggestType.functionSuggest) {
|
||||
mSuggestContentEt.setHint("请详细描述你的建议... \n ↓↓你还可以上传截图");
|
||||
mSuggestTypeContainer.setVisibility(View.VISIBLE);
|
||||
@ -465,10 +567,29 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
mGameNameTitle.setText(Html.fromHtml(getString(R.string.suggestion_game_name)));
|
||||
mTypeName.setText(Html.fromHtml(getString(R.string.suggestion_function)));
|
||||
mEmailName.setText(Html.fromHtml(getString(R.string.suggestion_contact)));
|
||||
mCopyrightContainer.setVisibility(View.GONE);
|
||||
} else if (type == SuggestType.articleCollect) {
|
||||
mSuggestContentEt.setHint("简单介绍文章内容,别忘了填写文章链接哦 \n ↓↓你还可以上传截图");
|
||||
mSuggestTypeContainer.setVisibility(View.GONE);
|
||||
mSuggestGameLl.setVisibility(View.GONE);
|
||||
mCopyrightContainer.setVisibility(View.GONE);
|
||||
} else if (type == SuggestType.copyright) {
|
||||
mSuggestGameLl.setVisibility(View.GONE);
|
||||
mSuggestTypeContainer.setVisibility(View.GONE);
|
||||
mPlatformContainer.setVisibility(View.GONE);
|
||||
mLinkContainer.setVisibility(View.GONE);
|
||||
mContactMethodContainer.setVisibility(View.GONE);
|
||||
mPicContainer.setVisibility(View.GONE);
|
||||
mCopyrightContainer.setVisibility(View.VISIBLE);
|
||||
mCredentialsCodeEt.requestFocus();
|
||||
mSuggestIdentityTv.setText(Html.fromHtml(getString(R.string.suggestion_identity)));
|
||||
mCredentialsCodeTv.setText(Html.fromHtml(getString(R.string.suggestion_credentials_code)));
|
||||
mCredentialsPhotoTv.setText(Html.fromHtml(getString(R.string.suggestion_credentials_pic)));
|
||||
mAppNameTv.setText(Html.fromHtml(getString(R.string.suggestion_app_name)));
|
||||
mInfringementAppScreenshotTv.setText(Html.fromHtml(getString(R.string.suggestion_infringement)));
|
||||
mExplanationTv.setText(Html.fromHtml(getString(R.string.suggestion_explanation)));
|
||||
mContactMethodTv.setText(Html.fromHtml(getString(R.string.suggestion_contact_method)));
|
||||
mLookDetailDesTv.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
|
||||
}
|
||||
}
|
||||
|
||||
@ -545,63 +666,73 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
}
|
||||
|
||||
@OnClick({R.id.suggest_post_btn, R.id.suggest_game_container, R.id.type_accelerate, R.id.type_material,
|
||||
R.id.type_other, R.id.type_standalone})
|
||||
R.id.type_other, R.id.type_standalone, R.id.lookDetailDesTv})
|
||||
public void onViewClicked(View view) {
|
||||
switch (view.getId()) {
|
||||
case R.id.suggest_post_btn:
|
||||
String email = mSuggestEmailEt.getText().toString().trim();
|
||||
|
||||
if (TextUtils.isEmpty(mSuggestContentEt.getText().toString()) &&
|
||||
mSuggestType != SuggestType.functionSuggest &&
|
||||
mSuggestType != SuggestType.gameCollect) {
|
||||
toast("请输入反馈内容");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSuggestGameLl.getVisibility() == View.VISIBLE &&
|
||||
TextUtils.isEmpty(mSuggestGameName.getText().toString())) {
|
||||
toast("请选择游戏");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSuggestTypeContainer.getVisibility() == View.VISIBLE) {
|
||||
if (mFunctionType == 3 && TextUtils.isEmpty(mTypeOtherName.getText().toString().trim())) {
|
||||
toast("请选择功能需求");
|
||||
return;
|
||||
}
|
||||
if (mFunctionType == -1) {
|
||||
toast("请选择功能需求");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (mPlatformContainer.getVisibility() == View.VISIBLE &&
|
||||
TextUtils.isEmpty(mPlatformEt.getText().toString())) {
|
||||
toast("请填写游戏平台");
|
||||
return;
|
||||
}
|
||||
|
||||
String entrance = "我的光环-反馈-[提交]";
|
||||
if (!TextUtils.isEmpty(mSuggestContent)) {
|
||||
switch (mSuggestContent) {
|
||||
case "问题投诉":
|
||||
entrance = "问题详情-投诉-提交反馈";
|
||||
break;
|
||||
case "回答投诉":
|
||||
entrance = "回答详情-投诉-提交反馈";
|
||||
break;
|
||||
case "文章投诉":
|
||||
entrance = "社区文章详情-投诉-提交反馈";
|
||||
break;
|
||||
if (mSuggestType != SuggestType.copyright) {
|
||||
String email = mSuggestEmailEt.getText().toString().trim();
|
||||
|
||||
if (TextUtils.isEmpty(mSuggestContentEt.getText().toString()) &&
|
||||
mSuggestType != SuggestType.functionSuggest &&
|
||||
mSuggestType != SuggestType.gameCollect) {
|
||||
toast("请输入反馈内容");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSuggestGameLl.getVisibility() == View.VISIBLE &&
|
||||
TextUtils.isEmpty(mSuggestGameName.getText().toString())) {
|
||||
toast("请选择游戏");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSuggestTypeContainer.getVisibility() == View.VISIBLE) {
|
||||
if (mFunctionType == 3 && TextUtils.isEmpty(mTypeOtherName.getText().toString().trim())) {
|
||||
toast("请选择功能需求");
|
||||
return;
|
||||
}
|
||||
if (mFunctionType == -1) {
|
||||
toast("请选择功能需求");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (mPlatformContainer.getVisibility() == View.VISIBLE &&
|
||||
TextUtils.isEmpty(mPlatformEt.getText().toString())) {
|
||||
toast("请填写游戏平台");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!TextUtils.isEmpty(mSuggestContent)) {
|
||||
switch (mSuggestContent) {
|
||||
case "问题投诉":
|
||||
entrance = "问题详情-投诉-提交反馈";
|
||||
break;
|
||||
case "回答投诉":
|
||||
entrance = "回答详情-投诉-提交反馈";
|
||||
break;
|
||||
case "文章投诉":
|
||||
entrance = "社区文章详情-投诉-提交反馈";
|
||||
break;
|
||||
}
|
||||
}
|
||||
// 闪退反馈不需要反馈(由闪退提示框跳转)
|
||||
if (mSuggestType == SuggestType.crash && !mHideHint.isEmpty()) {
|
||||
readPostSuggestion(email);
|
||||
} else {
|
||||
CheckLoginUtils.checkLogin(this, entrance, () -> {
|
||||
readPostSuggestion(email);
|
||||
});
|
||||
}
|
||||
}
|
||||
// 闪退反馈不需要反馈(由闪退提示框跳转)
|
||||
if (mSuggestType == SuggestType.crash && !mHideHint.isEmpty()) {
|
||||
readPostSuggestion(email);
|
||||
} else {
|
||||
CheckLoginUtils.checkLogin(this, entrance, () -> {
|
||||
readPostSuggestion(email);
|
||||
if (checkCopyrightData()) {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
break;
|
||||
case R.id.suggest_game_container:
|
||||
@ -639,9 +770,45 @@ public class SuggestionActivity extends ToolBarActivity implements OnRequestCall
|
||||
mFunctionType = 3;
|
||||
mTypeOtherName.requestFocus();
|
||||
break;
|
||||
case R.id.lookDetailDesTv:
|
||||
startActivity(WebActivity.getUploadPolicyIntent(this));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkCopyrightData() {
|
||||
if (TextUtils.isEmpty(mSuggestIdentity)) {
|
||||
toast("请先选择版权方身份");
|
||||
return false;
|
||||
} else {
|
||||
if (TextUtils.isEmpty(mCredentialsCodeEt.getText().toString())) {
|
||||
toast(mSuggestIdentity.equals("个人") ? "请填写身份证号或护照号等" : "请填写公司营业执照或组织代码等");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (mCredentialsAdapter.getFileList().size() == 0) {
|
||||
toast("请先添加版权证明文件");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mAppNameEt.getText().toString())) {
|
||||
toast("请先填写侵权的应用名字");
|
||||
return false;
|
||||
}
|
||||
if (mScreenshotAdapter.getFileList().size() == 0) {
|
||||
toast("请先添加侵权应用截图");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mExplanationEt.getText().toString())) {
|
||||
toast("请先填写说明");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mContactMethodEt.getText().toString())) {
|
||||
toast("请先填写联系方式");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void readPostSuggestion(String email) {
|
||||
if (TextUtils.isEmpty(email)) {
|
||||
if (mSuggestType == SuggestType.functionSuggest || mSuggestType == SuggestType.gameCollect) {
|
||||
|
||||
Reference in New Issue
Block a user