@@ -2,14 +2,12 @@ package com.neko.v2ray.ui
2
2
3
3
import android.os.Bundle
4
4
import android.text.TextUtils
5
- import android.util.Log
6
5
import android.view.Menu
7
6
import android.view.MenuItem
8
7
import androidx.appcompat.app.AlertDialog
9
8
import androidx.lifecycle.lifecycleScope
10
9
import com.google.android.material.appbar.MaterialToolbar
11
10
import com.google.android.material.appbar.CollapsingToolbarLayout
12
- import com.google.gson.Gson
13
11
import com.neko.v2ray.R
14
12
import com.neko.v2ray.databinding.ActivityRoutingEditBinding
15
13
import com.neko.v2ray.dto.RulesetItem
@@ -114,9 +112,9 @@ class RoutingEditActivity : BaseActivity() {
114
112
val rulesetItem = SettingsManager .getRoutingRuleset(position) ? : RulesetItem ()
115
113
116
114
rulesetItem.remarks = binding.etRemarks.text.toString()
117
- binding.etDomain.text.toString().let { rulesetItem.domain = if (it.isEmpty()) null else it.split(' , ' ) }
118
- binding.etIp.text.toString().let { rulesetItem.ip = if (it.isEmpty()) null else it.split(' , ' ) }
119
- binding.etProtocol.text.toString().let { rulesetItem.protocol = if (it.isEmpty()) null else it.split(' , ' ) }
115
+ binding.etDomain.text.toString().let { rulesetItem.domain = if (it.isEmpty()) null else it.split(" , " ).map { itt -> itt.trim() }.filter { itt -> itt.isNotEmpty() } }
116
+ binding.etIp.text.toString().let { rulesetItem.ip = if (it.isEmpty()) null else it.split(" , " ).map { itt -> itt.trim() }.filter { itt -> itt.isNotEmpty() } }
117
+ binding.etProtocol.text.toString().let { rulesetItem.protocol = if (it.isEmpty()) null else it.split(" , " ).map { itt -> itt.trim() }.filter { itt -> itt.isNotEmpty() } }
120
118
binding.etPort.text.toString().let { rulesetItem.port = it.ifEmpty { null } }
121
119
binding.etNetwork.text.toString().let { rulesetItem.network = it.ifEmpty { null } }
122
120
rulesetItem.outboundTag = outbound_tag[binding.spOutboundTag.selectedItemPosition]
0 commit comments