Commit 0d2ff9a2 authored by mengcuiguang's avatar mengcuiguang

优化好免混淆, 添加问题反馈

parent 27048e0a
......@@ -380,12 +380,41 @@
-keep class com.yilan.sdk.**{
*;
}
-dontwarn javax.annotation.**
-dontwarn sun.misc.Unsafe
-dontwarn org.conscrypt.*
-dontwarn okio.**
###阿里云混淆
-keep class com.alibaba.sdk.android.**{*;}
-keep class com.ut.**{*;}
-keep class com.ta.**{*;}
###其他混淆
-keep class android.support.v4.**{
public *;
}
-keep class android.support.v7.**{
public *;
}
-keep class org.chromium.** {*;}
-keep class org.chromium.** { *; }
-keep class aegon.chrome.** { *; }
-keep class com.kwai.**{ *; }
-dontwarn com.kwai.**
-dontwarn com.kwad.**
-dontwarn com.ksad.**
-dontwarn aegon.chrome.**
-keepclassmembers class * extends android.app.Activity { public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class com.baidu.mobads.*.** { *; }
# ======================= 一览视频 END ================
......
......@@ -166,6 +166,9 @@
<activity
android:name=".ui.activitys.FriendsActivity"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activitys.FeedbackActivity"
android:screenOrientation="portrait" />
<service
android:name=".service.UpdateService"
......
package com.mints.goodmoney.mvp.presenters
import com.mints.goodmoney.manager.AppHttpManager
import com.mints.goodmoney.mvp.model.BaseResponse
import com.mints.goodmoney.mvp.model.MorningClockBean
import com.mints.goodmoney.mvp.views.FeedbackView
import com.mints.library.net.neterror.BaseSubscriber
import com.mints.library.net.neterror.Throwable
import java.util.*
class FeedbackPresenter : BasePresenter<FeedbackView>() {
open fun feedback(type: String, content: String) {
val vo = HashMap<String, Any>()
vo["type"] = type
vo["content"] = content
AppHttpManager.getInstance(loanApplication)
.call(loanService.feedback(vo),
object : BaseSubscriber<BaseResponse<MorningClockBean>>() {
override fun onCompleted() {
if (isLinkView) return
view.hideLoading()
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.hideLoading()
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<MorningClockBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> view.feedbackSuc()
else -> view.showToast(message)
}
}
})
}
}
\ No newline at end of file
package com.mints.goodmoney.mvp.views
import com.mints.goodmoney.mvp.model.MorningClockBean
interface FeedbackView : BaseView {
fun feedbackSuc()
}
package com.mints.goodmoney.ui.activitys
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.View
import android.widget.RadioGroup
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.presenters.FeedbackPresenter
import com.mints.goodmoney.mvp.views.FeedbackView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import kotlinx.android.synthetic.main.activity_feekback.*
import kotlinx.android.synthetic.main.header_layout.*
/**
* 描述:意见反馈
* 作者:孟崔广
* 时间:2020/11/18 19:19
*/
class FeedbackActivity : BaseActivity()
, View.OnClickListener, FeedbackView {
private val feedbackPresenter by lazy { FeedbackPresenter() }
private var typeName = "界面"
private val maxLength = 150
private val minLength = 5
override fun getContentViewLayoutID() = R.layout.activity_feekback
override fun isApplyKitKatTranslucency() = false
override fun initViewsAndEvents() {
tv_title.text = "意见反馈"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
initListener()
feedbackPresenter.attachView(this)
}
private fun initListener() {
iv_left_icon.setOnClickListener(this)
btn_feedback_next.setOnClickListener(this)
radioGroup.setOnCheckedChangeListener(RadioGroup.OnCheckedChangeListener { group: RadioGroup?, checkedId: Int ->
when (checkedId) {
R.id.btn_opinion_type_1 -> typeName = "界面"
R.id.btn_opinion_type_2 -> typeName = "体验"
R.id.btn_opinion_type_3 -> typeName = "功能"
R.id.btn_opinion_type_4 -> typeName = "其他"
}
})
etFeedbackContent.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
if (s.toString().trim { it <= ' ' }.length > maxLength) {
etFeedbackContent.setText(s.toString().substring(0, maxLength))
etFeedbackContent.setSelection(maxLength)
showToast("您最多能输入150个字")
}
tvFeedbackCount.setText(etFeedbackContent.getText().toString().length.toString() + "/150")
}
override fun afterTextChanged(s: Editable) {}
})
}
override fun onDestroy() {
super.onDestroy()
feedbackPresenter.detachView()
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_left_icon -> finish()
R.id.btn_feedback_next -> {
val opinion = etFeedbackContent.text.toString().trim { it <= ' ' }
if (TextUtils.isEmpty(opinion)) {
showToast("请输入反馈内容")
return
}
if (opinion.length < minLength) {
showToast("字数太少")
return
}
if (opinion.length > maxLength) {
showToast("字数太多")
return
}
feedbackPresenter.feedback(typeName, opinion)
}
}
}
override fun feedbackSuc() {
showToast("提交成功")
etFeedbackContent.setText("")
}
}
\ No newline at end of file
......@@ -76,6 +76,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_userAgree.setOnClickListener(this)
item_privacyAgree.setOnClickListener(this)
item_aboutUs.setOnClickListener(this)
item_feedBack.setOnClickListener(this)
btn_switch.setOnClickListener(this)
item_phone.findViewById<TextView>(R.id.tv_title).text = "手机号"
......@@ -138,6 +139,13 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_aboutUs.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(aboutUs, null, null, null)
item_aboutUs.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_aboutUs.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
item_feedBack.findViewById<TextView>(R.id.tv_title).text = "问题反馈"
val feedBack = resources.getDrawable(R.mipmap.icon_settings_feedback)
feedBack.setBounds(0, 0, 56, 56)
item_feedBack.findViewById<TextView>(R.id.tv_title).setCompoundDrawables(feedBack, null, null, null)
item_feedBack.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_feedBack.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
}
override fun getContentViewLayoutID() = R.layout.activity_settings
......@@ -189,18 +197,20 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
readyGo(AboutusActivity::class.java)
}
R.id.btn_switch -> {
// readyGo(LoginActivity::class.java)
backDialog()
}
R.id.iv_left_icon -> {
onBackPressed()
}
R.id.item_feedBack -> {
readyGo(FeedbackActivity::class.java)
}
}
}
private fun backDialog() {
cdaa = CustomDialogAsApple(context, object : DialogListener() {
override fun onClick(v: View) {
override fun onClick(v: View) {
if (cdaa.isShowing) {
cdaa.dismiss()
}
......
......@@ -201,6 +201,7 @@ class MainFragment : BaseFragment(), HomeView, View.OnClickListener {
cdvvYilanTime?.start()
}
} else {
cdvvYilanTime?.stopRedbox()
stopDownloadTime()
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="345dp" android:height="44dp">
<shape android:shape="rectangle">
<solid android:color="#fffeb63d" />
<corners android:radius="50dp" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<stroke
android:width="4pt"
android:color="@android:color/white" />
<solid android:color="#fffeb63d" />
<corners android:radius="6dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="345dp" android:height="44dp">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="#fffeb63d" />
<solid android:color="#ffffff" />
<corners android:radius="50dp" />
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@android:color/white" android:drawable="@drawable/btn_index_submit" android:state_checked="true"></item>
<item android:color="@color/tv_loan_bg" android:drawable="@drawable/btn_index_submit_unchecked" android:state_checked="false"></item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_color"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="14dp"
android:background="@color/white"
android:gravity="center_vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:text="反馈类型"
android:textColor="@android:color/black"
android:textSize="15dp" />
<RadioGroup
android:id="@+id/radioGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<RadioButton
android:id="@+id/btn_opinion_type_1"
style="?android:attr/borderlessButtonStyle"
android:layout_width="58dp"
android:layout_height="25dp"
android:layout_marginLeft="5dp"
android:background="@drawable/rb_opinion_selected"
android:button="@null"
android:checked="true"
android:text="界面"
android:textColor="@drawable/rb_opinion_selected"
android:textSize="12dp" />
<RadioButton
android:id="@+id/btn_opinion_type_2"
style="?android:attr/borderlessButtonStyle"
android:layout_width="58dp"
android:layout_height="25dp"
android:layout_marginLeft="5dp"
android:background="@drawable/rb_opinion_selected"
android:button="@null"
android:text="体验"
android:textColor="@drawable/rb_opinion_selected"
android:textSize="12dp" />
<RadioButton
android:id="@+id/btn_opinion_type_3"
style="?android:attr/borderlessButtonStyle"
android:layout_width="58dp"
android:layout_height="25dp"
android:layout_marginLeft="5dp"
android:background="@drawable/rb_opinion_selected"
android:button="@null"
android:text="功能"
android:textColor="@drawable/rb_opinion_selected"
android:textSize="12dp" />
<RadioButton
android:id="@+id/btn_opinion_type_4"
style="?android:attr/borderlessButtonStyle"
android:layout_width="58dp"
android:layout_height="25dp"
android:layout_marginLeft="5dp"
android:background="@drawable/rb_opinion_selected"
android:button="@null"
android:text="其他"
android:textColor="@drawable/rb_opinion_selected"
android:textSize="12dp" />
</RadioGroup>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="235dp"
android:layout_marginTop="13dp"
android:background="@color/white"
android:orientation="vertical"
android:padding="15dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="10dp"
android:layout_weight="1">
<EditText
android:id="@+id/etFeedbackContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="top"
android:hint="请留下您的批评、表扬或者建议,我们会虚心听取, 认真改正。(请保持在5-150字内)"
android:textSize="13dp" />
<TextView
android:id="@+id/tvFeedbackCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:text="0/150"
android:textSize="10dp" />
</RelativeLayout>
</LinearLayout>
<TextView
android:id="@+id/btn_feedback_next"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="40dp"
android:layout_marginTop="30dp"
android:layout_marginRight="40dp"
android:background="@drawable/shape_main"
android:gravity="center"
android:text="提交"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
......@@ -44,6 +44,9 @@
android:id="@+id/item_aboutUs"
layout="@layout/item_settings" />
<include
android:id="@+id/item_feedBack"
layout="@layout/item_settings" />
<Button
android:id="@+id/btn_switch"
android:layout_width="200dp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment