mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-02 17:07:41 +08:00
新增:手机短信
发送通道的 接收手机
允许插入 {{来源号码}}
标签来实现短信自动回复(短信/来电场景) #211
This commit is contained in:
parent
33cbc841b3
commit
657eb41547
@ -155,6 +155,7 @@ class SmsFragment : BaseFragment<FragmentSendersSmsBinding?>(), View.OnClickList
|
||||
}
|
||||
|
||||
override fun initListeners() {
|
||||
binding!!.btInsertSender.setOnClickListener(this)
|
||||
binding!!.btnTest.setOnClickListener(this)
|
||||
binding!!.btnDel.setOnClickListener(this)
|
||||
binding!!.btnSave.setOnClickListener(this)
|
||||
@ -165,6 +166,10 @@ class SmsFragment : BaseFragment<FragmentSendersSmsBinding?>(), View.OnClickList
|
||||
override fun onClick(v: View) {
|
||||
try {
|
||||
when (v.id) {
|
||||
R.id.bt_insert_sender -> {
|
||||
CommonUtils.insertOrReplaceText2Cursor(binding!!.etMobiles, getString(R.string.tag_from))
|
||||
return
|
||||
}
|
||||
R.id.btn_test -> {
|
||||
mCountDownHelper?.start()
|
||||
Thread {
|
||||
|
@ -54,9 +54,12 @@ class SmsUtils {
|
||||
}
|
||||
Log.d(TAG, App.SimInfoList.toString())
|
||||
|
||||
//替换 {{来源号码}} 标签
|
||||
val mobiles = setting.mobiles.replace(ResUtils.getString(R.string.tag_from), msgInfo.from)
|
||||
|
||||
//TODO:取不到卡槽信息时,采用默认卡槽发送
|
||||
val mSubscriptionId: Int = App.SimInfoList[simSlotIndex]?.mSubscriptionId ?: -1
|
||||
val res: String? = PhoneUtils.sendSms(mSubscriptionId, setting.mobiles, content)
|
||||
val res: String? = PhoneUtils.sendSms(mSubscriptionId, mobiles, content)
|
||||
if (res == null) {
|
||||
SendUtils.updateLogs(logId, 2, ResUtils.getString(R.string.request_succeeded))
|
||||
} else {
|
||||
|
@ -99,13 +99,33 @@
|
||||
android:text="@string/SmsMobiles"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
|
||||
android:id="@+id/et_mobiles"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="@string/SmsMobilesTips"
|
||||
android:singleLine="true"
|
||||
app:met_clearButton="true" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.xuexiang.xui.widget.edittext.materialedittext.MaterialEditText
|
||||
android:id="@+id/et_mobiles"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="5"
|
||||
android:singleLine="true"
|
||||
app:met_clearButton="true" />
|
||||
|
||||
<com.xuexiang.xui.widget.button.shadowbutton.RippleShadowShadowButton
|
||||
android:id="@+id/bt_insert_sender"
|
||||
style="@style/insertButtonStyle"
|
||||
android:layout_marginStart="5dp"
|
||||
android:text="@string/insert_sender" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/SmsMobilesTips"
|
||||
android:textSize="10sp"
|
||||
tools:ignore="SmallSp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
@ -337,7 +337,7 @@
|
||||
<string name="SmsSimSlot">SIM Slot</string>
|
||||
<string name="same_source">Same source</string>
|
||||
<string name="SmsMobiles">Receive Mobile Phone Numbers</string>
|
||||
<string name="SmsMobilesTips">Separated by ; , e.g. 15888888888;19999999999</string>
|
||||
<string name="SmsMobilesTips">Tips:\n1.Separated by ; , e.g. 15888888888;19999999999\n2.Allow to insert `{{FROM}}` tag to realize SMS auto-reply (SMS/Call scenario)</string>
|
||||
<string name="OnlyNoNetwork">Enable only when no network</string>
|
||||
<!--SettingActivity-->
|
||||
<string name="notify_content">Notify Content</string>
|
||||
|
@ -338,7 +338,7 @@
|
||||
<string name="SmsSimSlot">发送卡槽</string>
|
||||
<string name="same_source">原进原出</string>
|
||||
<string name="SmsMobiles">接收手机</string>
|
||||
<string name="SmsMobilesTips">多个号码以半角分号分隔,例如:15888888888;19999999999</string>
|
||||
<string name="SmsMobilesTips">Tips:\n1.多个号码以半角分号分隔,例如:15888888888;19999999999\n2.允许插入`{{来源号码}}`标签来实现短信自动回复(短信/来电场景)</string>
|
||||
<string name="OnlyNoNetwork">仅当无网络时启用</string>
|
||||
<!--SettingActivity-->
|
||||
<string name="notify_content">通知文案</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user