update 推送小程序;高级选项页
This commit is contained in:
@@ -54,6 +54,11 @@
|
|||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:theme="@style/AppTheme">
|
android:theme="@style/AppTheme">
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name="org.yameida.worktool.activity.SettingsAdvanceActivity"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:theme="@style/AppTheme">
|
||||||
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name="org.yameida.worktool.activity.BrowserActivity"
|
android:name="org.yameida.worktool.activity.BrowserActivity"
|
||||||
android:windowSoftInputMode="adjustUnspecified|stateHidden"
|
android:windowSoftInputMode="adjustUnspecified|stateHidden"
|
||||||
|
|||||||
@@ -18,19 +18,52 @@ object Constant {
|
|||||||
var key = "9876543210abcdef".toByteArray()
|
var key = "9876543210abcdef".toByteArray()
|
||||||
var iv = "0123456789abcdef".toByteArray()
|
var iv = "0123456789abcdef".toByteArray()
|
||||||
val transformation = "AES/CBC/PKCS7Padding"
|
val transformation = "AES/CBC/PKCS7Padding"
|
||||||
val weworkCorpId = ""
|
var weworkCorpId: String
|
||||||
val weworkAgentId = ""
|
get() = SPUtils.getInstance().getString("weworkCorpId", "")
|
||||||
val weworkSchema = ""
|
set(value) {
|
||||||
var encryptType = SPUtils.getInstance().getInt("encryptType", 1)
|
SPUtils.getInstance().put("weworkCorpId", value)
|
||||||
var autoReply = SPUtils.getInstance().getInt("autoReply", 1)
|
}
|
||||||
var groupStrict = false
|
var weworkAgentId: String
|
||||||
var friendRemarkStrict = false
|
get() = SPUtils.getInstance().getString("weworkAgentId", "")
|
||||||
|
set(value) {
|
||||||
|
SPUtils.getInstance().put("weworkAgentId", value)
|
||||||
|
}
|
||||||
|
var weworkSchema: String
|
||||||
|
get() = SPUtils.getInstance().getString("weworkSchema", "")
|
||||||
|
set(value) {
|
||||||
|
SPUtils.getInstance().put("weworkSchema", value)
|
||||||
|
}
|
||||||
|
var weworkMP: String
|
||||||
|
get() = SPUtils.getInstance().getString("weworkMP", "")
|
||||||
|
set(value) {
|
||||||
|
SPUtils.getInstance().put("weworkMP", value)
|
||||||
|
}
|
||||||
|
var encryptType: Int = SPUtils.getInstance().getInt("encryptType", 1)
|
||||||
|
var autoReply: Int = SPUtils.getInstance().getInt("autoReply", 1)
|
||||||
|
var groupStrict: Boolean
|
||||||
|
get() = SPUtils.getInstance().getBoolean("groupStrict", false)
|
||||||
|
set(value) = SPUtils.getInstance().put("groupStrict", value)
|
||||||
|
var friendRemarkStrict: Boolean
|
||||||
|
get() = SPUtils.getInstance().getBoolean("friendRemarkStrict", false)
|
||||||
|
set(value) = SPUtils.getInstance().put("friendRemarkStrict", value)
|
||||||
var pushImage = false
|
var pushImage = false
|
||||||
var autoPublishComment = false
|
var autoPublishComment: Boolean
|
||||||
var groupQrCode = false
|
get() = SPUtils.getInstance().getBoolean("autoPublishComment", true)
|
||||||
|
set(value) = SPUtils.getInstance().put("autoPublishComment", value)
|
||||||
|
var groupQrCode: Boolean
|
||||||
|
get() = SPUtils.getInstance().getBoolean("groupQrCode", false)
|
||||||
|
set(value) = SPUtils.getInstance().put("groupQrCode", value)
|
||||||
var enableMediaProject = false
|
var enableMediaProject = false
|
||||||
var enableSdkShare = false
|
var enableSdkShare = false
|
||||||
var fullGroupName = false
|
var fullGroupName: Boolean
|
||||||
|
get() = SPUtils.getInstance().getBoolean("fullGroupName", true)
|
||||||
|
set(value) = SPUtils.getInstance().put("fullGroupName", value)
|
||||||
|
var customLink: Boolean
|
||||||
|
get() = SPUtils.getInstance().getBoolean("customLink", false)
|
||||||
|
set(value) = SPUtils.getInstance().put("customLink", value)
|
||||||
|
var customMP: Boolean
|
||||||
|
get() = SPUtils.getInstance().getBoolean("customMP", false)
|
||||||
|
set(value) = SPUtils.getInstance().put("customMP", value)
|
||||||
var robotId: String
|
var robotId: String
|
||||||
get() = SPUtils.getInstance().getString("robotId", SPUtils.getInstance().getString("LISTEN_CHANNEL_ID", ""))
|
get() = SPUtils.getInstance().getString("robotId", SPUtils.getInstance().getString("LISTEN_CHANNEL_ID", ""))
|
||||||
set(value) {
|
set(value) {
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
package org.yameida.worktool.activity
|
package org.yameida.worktool.activity
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.DialogInterface
|
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.provider.Settings
|
import android.provider.Settings
|
||||||
import android.text.InputType
|
|
||||||
import android.view.WindowManager
|
import android.view.WindowManager
|
||||||
import android.widget.CompoundButton
|
import android.widget.CompoundButton
|
||||||
import androidx.appcompat.app.AlertDialog
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.blankj.utilcode.util.*
|
import com.blankj.utilcode.util.*
|
||||||
import com.lzy.okgo.OkGo
|
import com.lzy.okgo.OkGo
|
||||||
@@ -25,7 +22,7 @@ import org.yameida.worktool.utils.*
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录页
|
* 设置页
|
||||||
*/
|
*/
|
||||||
class SettingsActivity : AppCompatActivity() {
|
class SettingsActivity : AppCompatActivity() {
|
||||||
|
|
||||||
@@ -69,9 +66,9 @@ class SettingsActivity : AppCompatActivity() {
|
|||||||
SPUtils.getInstance().put("autoReply", Constant.autoReply)
|
SPUtils.getInstance().put("autoReply", Constant.autoReply)
|
||||||
})
|
})
|
||||||
rl_reply_strategy.setOnClickListener { showReplyStrategyDialog() }
|
rl_reply_strategy.setOnClickListener { showReplyStrategyDialog() }
|
||||||
rl_qa_url.setOnClickListener { showQaUrlDialog() }
|
|
||||||
rl_donate.setOnClickListener { showDonateDialog() }
|
rl_donate.setOnClickListener { showDonateDialog() }
|
||||||
rl_share.setOnClickListener { showShareDialog() }
|
rl_share.setOnClickListener { showShareDialog() }
|
||||||
|
rl_advance.setOnClickListener { SettingsAdvanceActivity.enterActivity(this) }
|
||||||
freshOpenFlow()
|
freshOpenFlow()
|
||||||
bt_open_flow.setOnClickListener {
|
bt_open_flow.setOnClickListener {
|
||||||
freshOpenFlow()
|
freshOpenFlow()
|
||||||
@@ -119,33 +116,6 @@ class SettingsActivity : AppCompatActivity() {
|
|||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showQaUrlDialog() {
|
|
||||||
val builder = QMUIDialog.EditTextDialogBuilder(this)
|
|
||||||
builder.setTitle("消息回调地址")
|
|
||||||
.setPlaceholder("请输入回调接口地址")
|
|
||||||
.setDefaultText(Constant.qaUrl)
|
|
||||||
.setInputType(InputType.TYPE_CLASS_TEXT)
|
|
||||||
.addAction(getString(R.string.delete)) { dialog, index ->
|
|
||||||
dialog.dismiss()
|
|
||||||
updateRobotQaUrl("")
|
|
||||||
}
|
|
||||||
.addAction(getString(R.string.cancel)) { dialog, index -> dialog.dismiss() }
|
|
||||||
.addAction(getString(R.string.add)) { dialog, index ->
|
|
||||||
val text = builder.editText.text
|
|
||||||
if (text != null) {
|
|
||||||
if (text.matches("https?://[^/]+.*".toRegex())) {
|
|
||||||
dialog.dismiss()
|
|
||||||
updateRobotQaUrl(text.toString().trim())
|
|
||||||
} else {
|
|
||||||
ToastUtils.showLong("格式异常!")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ToastUtils.showLong("请勿为空!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.create(R.style.QMUI_Dialog).show()
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun showDonateDialog() {
|
private fun showDonateDialog() {
|
||||||
DonateUtil.zfbDonate(this)
|
DonateUtil.zfbDonate(this)
|
||||||
}
|
}
|
||||||
@@ -183,40 +153,6 @@ class SettingsActivity : AppCompatActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun updateRobotQaUrl(callbackUrl: String) {
|
|
||||||
try {
|
|
||||||
val json = hashMapOf<String, Any>()
|
|
||||||
json["robotId"] = Constant.robotId
|
|
||||||
if (callbackUrl.isEmpty()) {
|
|
||||||
json["openCallback"] = 0
|
|
||||||
} else {
|
|
||||||
json["openCallback"] = 1
|
|
||||||
json["callbackUrl"] = callbackUrl
|
|
||||||
}
|
|
||||||
val requestBody = RequestBody.create(
|
|
||||||
MediaType.parse("application/json;charset=UTF-8"),
|
|
||||||
GsonUtils.toJson(json)
|
|
||||||
)
|
|
||||||
val call = object : StringCallback() {
|
|
||||||
override fun onSuccess(response: Response<String>?) {
|
|
||||||
if (response != null && JSONObject(response.body()).getInt("code") == 200) {
|
|
||||||
Constant.qaUrl = callbackUrl
|
|
||||||
ToastUtils.showLong(if (callbackUrl.isEmpty()) "关闭成功" else "更新成功")
|
|
||||||
} else {
|
|
||||||
onError(response)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun onError(response: Response<String>?) {
|
|
||||||
ToastUtils.showLong(if (callbackUrl.isEmpty()) "关闭失败,请稍后再试~" else "更新失败,请稍后再试~")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
OkGo.post<String>(Constant.getRobotUpdateUrl()).upRequestBody(requestBody).execute(call)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
throw RuntimeException(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun updateRobotReplyStrategy(type: Int) {
|
private fun updateRobotReplyStrategy(type: Int) {
|
||||||
try {
|
try {
|
||||||
val json = hashMapOf<String, Any>()
|
val json = hashMapOf<String, Any>()
|
||||||
|
|||||||
@@ -0,0 +1,228 @@
|
|||||||
|
package org.yameida.worktool.activity
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import android.text.InputType
|
||||||
|
import android.view.View
|
||||||
|
import android.view.WindowManager
|
||||||
|
import android.widget.CompoundButton
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import com.blankj.utilcode.util.*
|
||||||
|
import com.lzy.okgo.OkGo
|
||||||
|
import com.lzy.okgo.callback.StringCallback
|
||||||
|
import com.lzy.okgo.model.Response
|
||||||
|
import com.qmuiteam.qmui.widget.dialog.QMUIDialog
|
||||||
|
import kotlinx.android.synthetic.main.activity_settings_advance.*
|
||||||
|
import okhttp3.MediaType
|
||||||
|
import okhttp3.RequestBody
|
||||||
|
import org.json.JSONObject
|
||||||
|
import org.yameida.worktool.Constant
|
||||||
|
import org.yameida.worktool.R
|
||||||
|
import org.yameida.worktool.utils.*
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高级选项页
|
||||||
|
*/
|
||||||
|
class SettingsAdvanceActivity : AppCompatActivity() {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
fun enterActivity(context: Context) {
|
||||||
|
LogUtils.d("SettingsAdvanceActivity.enterActivity")
|
||||||
|
context.startActivity(Intent(context, SettingsAdvanceActivity::class.java).apply {
|
||||||
|
this.flags = Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
|
||||||
|
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
|
||||||
|
setContentView(R.layout.activity_settings_advance)
|
||||||
|
|
||||||
|
initView()
|
||||||
|
initData()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initView() {
|
||||||
|
iv_back_left.setOnClickListener { finish() }
|
||||||
|
sw_full_name.isChecked = Constant.fullGroupName
|
||||||
|
sw_full_name.setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener { buttonView, isChecked ->
|
||||||
|
LogUtils.i("sw_full_name onCheckedChanged: $isChecked")
|
||||||
|
Constant.fullGroupName = isChecked
|
||||||
|
})
|
||||||
|
sw_qr_code.isChecked = Constant.groupQrCode
|
||||||
|
sw_qr_code.setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener { buttonView, isChecked ->
|
||||||
|
LogUtils.i("sw_qr_code onCheckedChanged: $isChecked")
|
||||||
|
Constant.groupQrCode = isChecked
|
||||||
|
})
|
||||||
|
sw_auto_publish.isChecked = Constant.autoPublishComment
|
||||||
|
sw_auto_publish.setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener { buttonView, isChecked ->
|
||||||
|
LogUtils.i("sw_auto_publish onCheckedChanged: $isChecked")
|
||||||
|
Constant.autoPublishComment = isChecked
|
||||||
|
})
|
||||||
|
ll_corp_param.visibility = if (Constant.customLink) View.VISIBLE else View.GONE
|
||||||
|
rl_username.visibility = if (Constant.customMP) View.VISIBLE else View.GONE
|
||||||
|
rl_qa_url.setOnClickListener { showQaUrlDialog() }
|
||||||
|
rl_corp.setOnClickListener { showCorpIdDialog() }
|
||||||
|
rl_agent.setOnClickListener { showAgentIdDialog() }
|
||||||
|
rl_schema.setOnClickListener { showSchemaDialog() }
|
||||||
|
rl_username.setOnClickListener { showUserNameDialog() }
|
||||||
|
rl_signature.setOnClickListener { showSignatureDialog() }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initData() {
|
||||||
|
HttpUtil.getMyConfig()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showQaUrlDialog() {
|
||||||
|
val builder = QMUIDialog.EditTextDialogBuilder(this)
|
||||||
|
builder.setTitle("消息回调地址")
|
||||||
|
.setPlaceholder("请输入回调接口地址")
|
||||||
|
.setDefaultText(Constant.qaUrl)
|
||||||
|
.setInputType(InputType.TYPE_CLASS_TEXT)
|
||||||
|
.addAction(getString(R.string.delete)) { dialog, index ->
|
||||||
|
dialog.dismiss()
|
||||||
|
updateRobotQaUrl("")
|
||||||
|
}
|
||||||
|
.addAction(getString(R.string.cancel)) { dialog, index -> dialog.dismiss() }
|
||||||
|
.addAction(getString(R.string.add)) { dialog, index ->
|
||||||
|
val text = builder.editText.text
|
||||||
|
if (text != null) {
|
||||||
|
if (text.matches("https?://[^/]+.*".toRegex())) {
|
||||||
|
dialog.dismiss()
|
||||||
|
updateRobotQaUrl(text.toString().trim())
|
||||||
|
} else {
|
||||||
|
ToastUtils.showLong("格式异常!")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ToastUtils.showLong("请勿为空!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.create(R.style.QMUI_Dialog).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateRobotQaUrl(callbackUrl: String) {
|
||||||
|
try {
|
||||||
|
val json = hashMapOf<String, Any>()
|
||||||
|
json["robotId"] = Constant.robotId
|
||||||
|
if (callbackUrl.isEmpty()) {
|
||||||
|
json["openCallback"] = 0
|
||||||
|
} else {
|
||||||
|
json["openCallback"] = 1
|
||||||
|
json["callbackUrl"] = callbackUrl
|
||||||
|
}
|
||||||
|
val requestBody = RequestBody.create(
|
||||||
|
MediaType.parse("application/json;charset=UTF-8"),
|
||||||
|
GsonUtils.toJson(json)
|
||||||
|
)
|
||||||
|
val call = object : StringCallback() {
|
||||||
|
override fun onSuccess(response: Response<String>?) {
|
||||||
|
if (response != null && JSONObject(response.body()).getInt("code") == 200) {
|
||||||
|
Constant.qaUrl = callbackUrl
|
||||||
|
ToastUtils.showLong(if (callbackUrl.isEmpty()) "关闭成功" else "更新成功")
|
||||||
|
} else {
|
||||||
|
onError(response)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onError(response: Response<String>?) {
|
||||||
|
ToastUtils.showLong(if (callbackUrl.isEmpty()) "关闭失败,请稍后再试~" else "更新失败,请稍后再试~")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OkGo.post<String>(Constant.getRobotUpdateUrl()).upRequestBody(requestBody).execute(call)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
throw RuntimeException(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showCorpIdDialog() {
|
||||||
|
val builder = QMUIDialog.EditTextDialogBuilder(this)
|
||||||
|
builder.setTitle("CorpId")
|
||||||
|
.setDefaultText(Constant.weworkCorpId)
|
||||||
|
.setInputType(InputType.TYPE_CLASS_TEXT)
|
||||||
|
.addAction(getString(R.string.cancel)) { dialog, index -> dialog.dismiss() }
|
||||||
|
.addAction(getString(R.string.add)) { dialog, index ->
|
||||||
|
val text = builder.editText.text
|
||||||
|
if (text != null) {
|
||||||
|
dialog.dismiss()
|
||||||
|
Constant.weworkCorpId = text.toString().trim()
|
||||||
|
} else {
|
||||||
|
ToastUtils.showLong("请勿为空!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.create(R.style.QMUI_Dialog).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showAgentIdDialog() {
|
||||||
|
val builder = QMUIDialog.EditTextDialogBuilder(this)
|
||||||
|
builder.setTitle("AgentId")
|
||||||
|
.setDefaultText(Constant.weworkAgentId)
|
||||||
|
.setInputType(InputType.TYPE_CLASS_TEXT)
|
||||||
|
.addAction(getString(R.string.cancel)) { dialog, index -> dialog.dismiss() }
|
||||||
|
.addAction(getString(R.string.add)) { dialog, index ->
|
||||||
|
val text = builder.editText.text
|
||||||
|
if (text != null) {
|
||||||
|
dialog.dismiss()
|
||||||
|
Constant.weworkAgentId = text.toString().trim()
|
||||||
|
} else {
|
||||||
|
ToastUtils.showLong("请勿为空!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.create(R.style.QMUI_Dialog).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showSchemaDialog() {
|
||||||
|
val builder = QMUIDialog.EditTextDialogBuilder(this)
|
||||||
|
builder.setTitle("Schema")
|
||||||
|
.setDefaultText(Constant.weworkSchema)
|
||||||
|
.setInputType(InputType.TYPE_CLASS_TEXT)
|
||||||
|
.addAction(getString(R.string.cancel)) { dialog, index -> dialog.dismiss() }
|
||||||
|
.addAction(getString(R.string.add)) { dialog, index ->
|
||||||
|
val text = builder.editText.text
|
||||||
|
if (text != null) {
|
||||||
|
dialog.dismiss()
|
||||||
|
Constant.weworkSchema = text.toString().trim()
|
||||||
|
} else {
|
||||||
|
ToastUtils.showLong("请勿为空!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.create(R.style.QMUI_Dialog).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showUserNameDialog() {
|
||||||
|
val builder = QMUIDialog.EditTextDialogBuilder(this)
|
||||||
|
builder.setTitle("UserName")
|
||||||
|
.setDefaultText(Constant.weworkMP)
|
||||||
|
.setInputType(InputType.TYPE_CLASS_TEXT)
|
||||||
|
.addAction(getString(R.string.cancel)) { dialog, index -> dialog.dismiss() }
|
||||||
|
.addAction(getString(R.string.add)) { dialog, index ->
|
||||||
|
val text = builder.editText.text
|
||||||
|
if (text != null) {
|
||||||
|
dialog.dismiss()
|
||||||
|
Constant.weworkMP = text.toString().trim()
|
||||||
|
} else {
|
||||||
|
ToastUtils.showLong("请勿为空!")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.create(R.style.QMUI_Dialog).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun showSignatureDialog() {
|
||||||
|
val signature = AppUtils.getAppSignaturesMD5().firstOrNull()?.replace(":", "")?.toLowerCase(Locale.ROOT)
|
||||||
|
val builder = QMUIDialog.EditTextDialogBuilder(this)
|
||||||
|
builder.setTitle("Signature")
|
||||||
|
.setDefaultText(signature)
|
||||||
|
.setInputType(InputType.TYPE_NULL)
|
||||||
|
.addAction(getString(R.string.copy)) { dialog, index ->
|
||||||
|
dialog.dismiss()
|
||||||
|
ClipboardUtils.copyText(signature)
|
||||||
|
ToastUtils.showLong("复制成功")
|
||||||
|
}
|
||||||
|
.create(R.style.QMUI_Dialog).show()
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -294,19 +294,25 @@ object WeworkController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送任意小程序
|
* 推送小程序
|
||||||
* @see WeworkMessageBean.PUSH_MICROPROGRAM
|
* @see WeworkMessageBean.PUSH_MICROPROGRAM
|
||||||
* @param message#titleList 待发送姓名列表
|
* @param message#titleList 待发送姓名列表
|
||||||
* @param message#objectName 小程序名称
|
* @param message#objectName 小程序名称
|
||||||
|
* @param message#receivedContent 小程序描述
|
||||||
|
* @param message#originalContent 小程序链接地址
|
||||||
|
* @param message#fileUrl 图片地址
|
||||||
* @param message#extraText 附加留言 可选
|
* @param message#extraText 附加留言 可选
|
||||||
*/
|
*/
|
||||||
@RequestMapping
|
@RequestMapping
|
||||||
fun pushMicroprogram(message: WeworkMessageBean): Boolean {
|
fun pushMicroprogram(message: WeworkMessageBean): Boolean {
|
||||||
LogUtils.d("pushMicroprogram(): ${message.titleList} ${message.objectName} ${message.extraText}")
|
LogUtils.d("pushMicroprogram(): ${message.titleList} ${message.objectName} ${message.receivedContent} ${message.originalContent} ${message.fileUrl} ${message.extraText}")
|
||||||
return WeworkOperationImpl.pushMicroprogram(
|
return WeworkOperationImpl.pushMicroprogram(
|
||||||
message,
|
message,
|
||||||
message.titleList,
|
message.titleList,
|
||||||
message.objectName,
|
message.objectName,
|
||||||
|
message.receivedContent,
|
||||||
|
message.originalContent,
|
||||||
|
message.fileUrl,
|
||||||
message.extraText
|
message.extraText
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -517,19 +517,40 @@ object WeworkOperationImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推送任意小程序(不推荐)
|
* 推送小程序
|
||||||
|
* @see WeworkMessageBean.PUSH_MICROPROGRAM
|
||||||
* @param titleList 待发送姓名列表
|
* @param titleList 待发送姓名列表
|
||||||
* @param objectName 小程序名称
|
* @param objectName 小程序名称
|
||||||
* @param extraText 附加留言 可选
|
* @param receivedContent 小程序描述
|
||||||
|
* @param originalContent 小程序链接地址
|
||||||
|
* @param fileUrl 图片地址
|
||||||
|
* @param extraText 附加留言 可选
|
||||||
*/
|
*/
|
||||||
fun pushMicroprogram(
|
fun pushMicroprogram(
|
||||||
message: WeworkMessageBean,
|
message: WeworkMessageBean,
|
||||||
titleList: List<String>,
|
titleList: List<String>,
|
||||||
objectName: String,
|
objectName: String,
|
||||||
extraText: String? = null
|
receivedContent: String,
|
||||||
|
originalContent: String,
|
||||||
|
fileUrl: String,
|
||||||
|
extraText: String? = null,
|
||||||
|
maxRetryCount: Int? = null
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val startTime = System.currentTimeMillis()
|
val startTime = System.currentTimeMillis()
|
||||||
return false
|
if (IWWAPIUtil.sendMicroProgram(fileUrl, originalContent, objectName, receivedContent)) {
|
||||||
|
if (relaySelectTarget(titleList, extraText)) {
|
||||||
|
uploadCommandResult(message, ExecCallbackBean.SUCCESS, "", startTime, titleList, listOf())
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
LogUtils.e("转发失败")
|
||||||
|
uploadCommandResult(message, ExecCallbackBean.ERROR_RELAY, "转发失败", startTime, listOf(), titleList)
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LogUtils.e("非法操作")
|
||||||
|
uploadCommandResult(message, ExecCallbackBean.ERROR_ILLEGAL_OPERATION, "非法操作", startTime, listOf(), titleList)
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,16 +3,18 @@ package org.yameida.worktool.utils
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Bitmap
|
import android.graphics.Bitmap
|
||||||
import android.graphics.drawable.BitmapDrawable
|
import android.graphics.drawable.BitmapDrawable
|
||||||
import android.widget.Toast
|
import com.blankj.utilcode.util.*
|
||||||
import com.blankj.utilcode.util.AppUtils
|
import com.lzy.okgo.OkGo
|
||||||
import com.blankj.utilcode.util.LogUtils
|
|
||||||
import com.blankj.utilcode.util.Utils
|
|
||||||
import com.tencent.wework.api.IWWAPI
|
import com.tencent.wework.api.IWWAPI
|
||||||
import com.tencent.wework.api.WWAPIFactory
|
import com.tencent.wework.api.WWAPIFactory
|
||||||
import com.tencent.wework.api.model.WWMediaLink
|
import com.tencent.wework.api.model.WWMediaLink
|
||||||
import com.tencent.wework.api.model.WWMediaMiniProgram
|
import com.tencent.wework.api.model.WWMediaMiniProgram
|
||||||
import com.tencent.wework.api.model.WWSimpleRespMessage
|
|
||||||
import org.yameida.worktool.Constant
|
import org.yameida.worktool.Constant
|
||||||
|
import org.yameida.worktool.R
|
||||||
|
import java.io.ByteArrayOutputStream
|
||||||
|
import java.io.File
|
||||||
|
import java.text.SimpleDateFormat
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
object IWWAPIUtil {
|
object IWWAPIUtil {
|
||||||
@@ -38,35 +40,48 @@ object IWWAPIUtil {
|
|||||||
return iwwapi?.sendMessage(link) ?: false
|
return iwwapi?.sendMessage(link) ?: false
|
||||||
}
|
}
|
||||||
|
|
||||||
fun sendMicroProgram() {
|
fun sendMicroProgram(imageUrl: String?, webpageUrl: String?, title: String?, description: String?): Boolean {
|
||||||
val miniProgram = WWMediaMiniProgram()
|
val miniProgram = WWMediaMiniProgram()
|
||||||
miniProgram.appPkg = AppUtils.getAppPackageName()
|
miniProgram.appPkg = AppUtils.getAppPackageName()
|
||||||
miniProgram.appName = AppUtils.getAppName()
|
miniProgram.appName = AppUtils.getAppName()
|
||||||
miniProgram.appId = Constant.weworkCorpId
|
miniProgram.appId = Constant.weworkCorpId
|
||||||
miniProgram.agentId = Constant.weworkAgentId
|
miniProgram.agentId = Constant.weworkAgentId
|
||||||
miniProgram.schema = Constant.weworkSchema
|
miniProgram.schema = Constant.weworkSchema
|
||||||
miniProgram.username = "gh_dde54cb88ce7@app" //必须是应用关联的小程序,注意要有@app后缀
|
miniProgram.username = Constant.weworkMP //必须是应用关联的小程序,注意要有@app后缀
|
||||||
miniProgram.description = "dddddd"
|
miniProgram.description = description
|
||||||
miniProgram.path = "/pages/plugin/index.html?plugid=1cbd3b7c8674e61769436b5e354ddb2f"
|
miniProgram.path = webpageUrl
|
||||||
// val bitmap = (getDrawable(R.drawable.test) as BitmapDrawable).bitmap
|
miniProgram.title = title
|
||||||
// val stream = ByteArrayOutputStream()
|
|
||||||
// bitmap.compress(Bitmap.CompressFormat.JPEG, 0, stream)
|
|
||||||
// val byteArray: ByteArray = stream.toByteArray()
|
|
||||||
|
|
||||||
// miniProgram.hdImageData = byteArray
|
val bitmap = (Utils.getApp().getDrawable(R.mipmap.ic_launcher) as BitmapDrawable).bitmap
|
||||||
miniProgram.title = "测试_MaHow"
|
val stream = ByteArrayOutputStream()
|
||||||
iwwapi!!.sendMessage(miniProgram) { resp ->
|
bitmap.compress(Bitmap.CompressFormat.JPEG, 0, stream)
|
||||||
if (resp is WWSimpleRespMessage) {
|
miniProgram.hdImageData = stream.toByteArray()
|
||||||
val rsp = resp as WWSimpleRespMessage
|
if (imageUrl != null) {
|
||||||
var t: String? = ""
|
LogUtils.i("下载开始 $imageUrl")
|
||||||
Toast.makeText(
|
val execute = OkGo.get<File>(imageUrl).execute()
|
||||||
Utils.getApp(),
|
LogUtils.i("下载完成 $imageUrl")
|
||||||
"发小程序," + rsp.errCode + "," + rsp.errMsg.also {
|
val body = execute.body()
|
||||||
t = it
|
if (body != null) {
|
||||||
},
|
val df = SimpleDateFormat("yyyy-MM-dd")
|
||||||
Toast.LENGTH_LONG
|
val filePath = "${
|
||||||
).show()
|
Utils.getApp().getExternalFilesDir("mp_image_cache")
|
||||||
|
}/${df.format(Date())}/${imageUrl.split("/").lastOrNull()}"
|
||||||
|
val newFile = File(filePath)
|
||||||
|
val create = FileUtils.createFileByDeleteOldFile(newFile)
|
||||||
|
if (create && newFile.canWrite()) {
|
||||||
|
newFile.writeBytes(body.bytes())
|
||||||
|
LogUtils.i("文件存储本地成功 $filePath")
|
||||||
|
val bitmap = ImageUtils.bytes2Bitmap(File(filePath).readBytes())
|
||||||
|
val stream = ByteArrayOutputStream()
|
||||||
|
bitmap.compress(Bitmap.CompressFormat.JPEG, 0, stream)
|
||||||
|
miniProgram.hdImageData = stream.toByteArray()
|
||||||
|
} else {
|
||||||
|
LogUtils.e("文件存储本地失败 $filePath")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
LogUtils.e("文件下载失败")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return iwwapi?.sendMessage(miniProgram) ?: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,7 +51,7 @@
|
|||||||
android:background="@color/background"
|
android:background="@color/background"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<!-- 视频 -->
|
<!-- 配置 -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -117,59 +117,6 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:id="@+id/rl_qa_url"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:paddingStart="@dimen/setting_start_padding"
|
|
||||||
android:paddingTop="@dimen/setting_vertical_padding"
|
|
||||||
android:paddingEnd="@dimen/setting_end_padding"
|
|
||||||
android:paddingBottom="@dimen/setting_vertical_padding">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/iv_qa_url_"
|
|
||||||
android:layout_width="@dimen/setting_start_image_width"
|
|
||||||
android:layout_height="@dimen/setting_start_image_width"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:src="@drawable/settings_fps" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_select_fps"
|
|
||||||
android:layout_width="@dimen/setting_end_font_width"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginStart="@dimen/setting_end_start_padding"
|
|
||||||
android:textColor="@color/float_time_color"
|
|
||||||
android:textSize="@dimen/setting_end_font_size"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginStart="@dimen/setting_start_padding"
|
|
||||||
android:layout_toStartOf="@id/tv_select_fps"
|
|
||||||
android:layout_toEndOf="@id/iv_qa_url_"
|
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="消息回调"
|
|
||||||
android:textColor="@color/color_333333"
|
|
||||||
android:textSize="@dimen/setting_start_font_size" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="设置回调地址来接收和处理新消息"
|
|
||||||
android:textColor="@color/color_999999"
|
|
||||||
android:textSize="@dimen/setting_end_font_size" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</RelativeLayout>
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:id="@+id/rl_rec_orientation"
|
android:id="@+id/rl_rec_orientation"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -405,6 +352,60 @@
|
|||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_advance"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_rec_advance_"
|
||||||
|
android:layout_width="@dimen/setting_start_image_width"
|
||||||
|
android:layout_height="@dimen/setting_start_image_width"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@drawable/settings_language" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_select_advance"
|
||||||
|
android:layout_width="@dimen/setting_end_font_width"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_end_start_padding"
|
||||||
|
android:textColor="@color/float_time_color"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:layout_toStartOf="@id/tv_select_advance"
|
||||||
|
android:layout_toEndOf="@id/iv_rec_advance_"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="高级选项"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="点击查看更多高级选项"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
<!-- 其他 -->
|
<!-- 其他 -->
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|||||||
612
app/src/main/res/layout/activity_settings_advance.xml
Normal file
612
app/src/main/res/layout/activity_settings_advance.xml
Normal file
@@ -0,0 +1,612 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout 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/background">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_bar"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:text="高级选项"
|
||||||
|
android:textColor="@color/color_dashen"
|
||||||
|
android:textSize="22sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_back_left"
|
||||||
|
android:layout_width="25dp"
|
||||||
|
android:layout_height="25dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_marginBottom="10dp"
|
||||||
|
android:src="@drawable/back_icon" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0.5dp"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:background="@color/list_divider_line" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/rl_bar">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/background"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 配置 -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_start_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding"
|
||||||
|
android:text="配置"
|
||||||
|
android:textColor="@color/float_time_color"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_full_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/sw_full_name"
|
||||||
|
android:layout_width="@dimen/setting_end_font_width"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_end_start_padding" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:layout_toStartOf="@id/sw_full_name"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="获取群聊全称"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="群聊过长时仍获取群聊全称(性能会降低)"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_qr_code"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/sw_qr_code"
|
||||||
|
android:layout_width="@dimen/setting_end_font_width"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_end_start_padding" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:layout_toStartOf="@id/sw_qr_code"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="获取群二维码"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="更新群信息时回调二维码(性能会降低)"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_auto_publish"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<Switch
|
||||||
|
android:id="@+id/sw_auto_publish"
|
||||||
|
android:layout_width="@dimen/setting_end_font_width"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_end_start_padding" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:layout_toStartOf="@id/sw_auto_publish"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="自动发布朋友圈"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="收到朋友圈发布任务时自动发送"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_qa_url"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_select_fps"
|
||||||
|
android:layout_width="@dimen/setting_end_font_width"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_end_start_padding"
|
||||||
|
android:textColor="@color/float_time_color"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:layout_toStartOf="@id/tv_select_fps"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="消息回调"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="设置回调地址接收处理新消息(详见文档)"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_rec_orientation"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_rec_orientation_"
|
||||||
|
android:layout_width="@dimen/setting_start_image_width"
|
||||||
|
android:layout_height="@dimen/setting_start_image_width"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@drawable/settings_orientation" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_select_orientation"
|
||||||
|
android:layout_width="@dimen/setting_end_font_width"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_end_start_padding"
|
||||||
|
android:textColor="@color/float_time_color"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:layout_toStartOf="@id/tv_select_orientation"
|
||||||
|
android:layout_toEndOf="@id/iv_rec_orientation_"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="方向"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_rec_location"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_rec_location_"
|
||||||
|
android:layout_width="@dimen/setting_start_image_width"
|
||||||
|
android:layout_height="@dimen/setting_start_image_width"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@drawable/settings_directory" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_select_location"
|
||||||
|
android:layout_width="@dimen/setting_end_font_width"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_end_start_padding"
|
||||||
|
android:textColor="@color/float_time_color"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:layout_toStartOf="@id/tv_select_location"
|
||||||
|
android:layout_toEndOf="@id/iv_rec_location_"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="save_location"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_save_location_tip"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="video_default_path"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_corp_param"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/background"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 企微后台 -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_start_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding"
|
||||||
|
android:text="企微后台参数"
|
||||||
|
android:textColor="@color/float_time_color"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_corp"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_start_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="CorpId"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="企微后台的企业id"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_agent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_start_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="AgentId"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="企微后台应用的AgentId"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_schema"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_start_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Schema"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="企微后台应用的Schema"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_username"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_start_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="UserName"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="企微绑定的小程序UserName"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_signature"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_start_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Signature"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_signature"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="企微后台使用的APP签名"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<!-- 其他 -->
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_start_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding"
|
||||||
|
android:text="其他"
|
||||||
|
android:textColor="@color/float_time_color"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/rl_language"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingStart="@dimen/setting_start_padding"
|
||||||
|
android:paddingTop="@dimen/setting_vertical_padding"
|
||||||
|
android:paddingEnd="@dimen/setting_end_padding"
|
||||||
|
android:paddingBottom="@dimen/setting_vertical_padding"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_rec_language_"
|
||||||
|
android:layout_width="@dimen/setting_start_image_width"
|
||||||
|
android:layout_height="@dimen/setting_start_image_width"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@drawable/settings_language" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_select_language"
|
||||||
|
android:layout_width="@dimen/setting_end_font_width"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_end_start_padding"
|
||||||
|
android:textColor="@color/float_time_color"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="@dimen/setting_start_padding"
|
||||||
|
android:layout_toStartOf="@id/tv_select_language"
|
||||||
|
android:layout_toEndOf="@id/iv_rec_language_"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="language"
|
||||||
|
android:textColor="@color/color_333333"
|
||||||
|
android:textSize="@dimen/setting_start_font_size" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="language_tips"
|
||||||
|
android:textColor="@color/color_999999"
|
||||||
|
android:textSize="@dimen/setting_end_font_size"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
<string name="input_new_host">请输入新的host</string>
|
<string name="input_new_host">请输入新的host</string>
|
||||||
<string name="delete">删除</string>
|
<string name="delete">删除</string>
|
||||||
<string name="cancel">取消</string>
|
<string name="cancel">取消</string>
|
||||||
|
<string name="copy">复制</string>
|
||||||
<string name="confirm">确认</string>
|
<string name="confirm">确认</string>
|
||||||
<string name="add">新增</string>
|
<string name="add">新增</string>
|
||||||
<string name="host_list">host列表</string>
|
<string name="host_list">host列表</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user