Commit 9fb6febd authored by jyx's avatar jyx

设置页添加注销功能

parent 7509c069
......@@ -156,17 +156,17 @@
<activity
android:name=".ui.activitys.Increasespeed2Activity"
android:launchMode="singleTop"
android:excludeFromRecents="true" />
android:excludeFromRecents="true"
android:launchMode="singleTop" />
<activity
android:name=".ui.activitys.IncreasespeedActivity"
android:launchMode="singleTop"
android:excludeFromRecents="true" />
android:excludeFromRecents="true"
android:launchMode="singleTop" />
<activity
android:name=".ui.activitys.CleanActivity"
android:launchMode="singleTop"
android:excludeFromRecents="true" />
android:excludeFromRecents="true"
android:launchMode="singleTop" />
<activity
android:name=".ui.activitys.keepalive.ScreenActivity"
......
......@@ -61,8 +61,6 @@ class InitAppService : IntentService("InitializeService") {
// PR下载附件
initPRDownloader()
// 一览视频
YlVideoManager.init(MintsApplication.getContext())
}
/**
......
......@@ -63,6 +63,8 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override fun getContentViewLayoutID() = R.layout.activity_main
override fun initViewsAndEvents() {
// 一览视频
YlVideoManager.init(MintsApplication.getContext())
WifiStateManager.instance.registerWifiReceiver(this)
......
......@@ -2,6 +2,8 @@ package com.mints.flowbox.ui.activitys
import android.annotation.SuppressLint
import android.app.Dialog
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.View
import android.widget.ImageView
......@@ -22,6 +24,7 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.DialogUtils
import com.mints.flowbox.utils.CacheUtil
import com.mints.flowbox.utils.SpanUtils
import com.mints.library.utils.json.JsonUtil
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_settings.*
......@@ -59,10 +62,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
@SuppressLint("CutPasteId")
private fun initLayout() {
if (!userManager.userIsLogin()) {
btn_switch.visibility = View.GONE
}
tv_title.text = "设置"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
......@@ -75,6 +74,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
item_privacyAgree.setOnClickListener(this)
item_aboutUs.setOnClickListener(this)
item_feedBack.setOnClickListener(this)
item_cancel.setOnClickListener(this)
btn_switch.setOnClickListener(this)
item_phone.findViewById<TextView>(R.id.tv_title).text = "手机号"
......@@ -154,6 +154,19 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
.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
item_cancel.findViewById<TextView>(R.id.tv_title).text = "注销账号"
val cancel = ContextCompat.getDrawable(this, R.mipmap.icon_settings_cancel)
cancel?.setBounds(0, 0, 56, 56)
item_cancel.findViewById<TextView>(R.id.tv_title)
.setCompoundDrawables(cancel, null, null, null)
item_cancel.findViewById<TextView>(R.id.tv_right).visibility = View.GONE
item_cancel.findViewById<ImageView>(R.id.iv_right).visibility = View.VISIBLE
if (!userManager.userIsLogin()) {
item_cancel.visibility = View.GONE
btn_switch.visibility = View.GONE
}
}
override fun getContentViewLayoutID() = R.layout.activity_settings
......@@ -176,7 +189,6 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
}
R.id.item_wechat -> {
if (userManager.wxOpenid.isEmpty()) {
val wechat = ShareSDK.getPlatform(Wechat.NAME)
if (!wechat.isClientValid) {
showToast("请先安装微信")
......@@ -215,9 +227,37 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
R.id.item_feedBack -> {
readyGo(FeedbackActivity::class.java)
}
R.id.item_cancel -> {
cancelAccount()
}
}
}
private fun cancelAccount() {
val address = "dev_support@tech-mints.cn"
DialogUtils.showDialog(
this,
SpanUtils()
.append("注销账户请发送邮件到\n")
.append(address)
.setForegroundColor(resources.getColor(R.color.color_main))
.create(),
"提示",
"确定",
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
dialog?.dismiss()
val uri = Uri.parse("mailto:$address")
val data = Intent(Intent.ACTION_SENDTO, uri)
data.putExtra(Intent.EXTRA_EMAIL, address)
data.putExtra(Intent.EXTRA_SUBJECT, "申请注销账户")
data.putExtra(Intent.EXTRA_TEXT, "申请注销账户ID:\n申请注销账户微信号:\n申请注销账户手机号:\n")
startActivity(Intent.createChooser(data, "选择邮箱"))
}
})
}
private fun backDialog() {
DialogUtils.showDialog(
this,
......@@ -226,6 +266,7 @@ class SettingsActivity : BaseActivity(), View.OnClickListener, OnLoginListener,
"确定",
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
dialog?.dismiss()
UserManager.getInstance().userLogout()
readyGoThenKill(MainActivity::class.java)
}
......
......@@ -93,6 +93,10 @@ public class CustomDialogAsApple extends BaseDialog {
dialog_tv_content.setText(s);
}
public TextView getContentTv() {
return dialog_tv_content;
}
/**
* Dialog显示content文字
*
......
......@@ -48,6 +48,10 @@
android:id="@+id/item_feedBack"
layout="@layout/item_settings" />
<include
android:id="@+id/item_cancel"
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