mirror of
https://github.com/yggdrasil-network/yggdrasil-android.git
synced 2025-04-27 21:55:08 +03:00
UI fixes, DNS infos. (#31)
This commit is contained in:
parent
c9476a7b00
commit
ee81f4e902
12 changed files with 103 additions and 148 deletions
|
@ -13,7 +13,6 @@ import com.google.android.material.textfield.TextInputEditText
|
||||||
|
|
||||||
const val KEY_DNS_SERVERS = "dns_servers"
|
const val KEY_DNS_SERVERS = "dns_servers"
|
||||||
const val KEY_ENABLE_CHROME_FIX = "enable_chrome_fix"
|
const val KEY_ENABLE_CHROME_FIX = "enable_chrome_fix"
|
||||||
const val DEFAULT_DNS_SERVERS = "302:7991::53,302:db60::53,300:6223::53,301:1088::53"
|
|
||||||
|
|
||||||
class DnsActivity : AppCompatActivity() {
|
class DnsActivity : AppCompatActivity() {
|
||||||
private lateinit var config: ConfigurationProxy
|
private lateinit var config: ConfigurationProxy
|
||||||
|
@ -28,6 +27,8 @@ class DnsActivity : AppCompatActivity() {
|
||||||
private lateinit var servers: MutableList<String>
|
private lateinit var servers: MutableList<String>
|
||||||
private lateinit var preferences: SharedPreferences
|
private lateinit var preferences: SharedPreferences
|
||||||
|
|
||||||
|
private lateinit var defaultDnsServers: HashMap<String, Pair<String, String>>
|
||||||
|
|
||||||
@SuppressLint("ApplySharedPref")
|
@SuppressLint("ApplySharedPref")
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -36,6 +37,15 @@ class DnsActivity : AppCompatActivity() {
|
||||||
config = ConfigurationProxy(applicationContext)
|
config = ConfigurationProxy(applicationContext)
|
||||||
inflater = LayoutInflater.from(this)
|
inflater = LayoutInflater.from(this)
|
||||||
|
|
||||||
|
val descriptionRevertron = getString(R.string.dns_server_info_revertron)
|
||||||
|
// Here we can add some other DNS servers in a future
|
||||||
|
defaultDnsServers = hashMapOf(
|
||||||
|
"302:7991::53" to Pair(getString(R.string.location_amsterdam), descriptionRevertron),
|
||||||
|
"302:db60::53" to Pair(getString(R.string.location_prague), descriptionRevertron),
|
||||||
|
"300:6223::53" to Pair(getString(R.string.location_bratislava), descriptionRevertron),
|
||||||
|
"301:1088::53" to Pair(getString(R.string.location_buffalo), descriptionRevertron),
|
||||||
|
)
|
||||||
|
|
||||||
serversTableLayout = findViewById(R.id.configuredDnsTableLayout)
|
serversTableLayout = findViewById(R.id.configuredDnsTableLayout)
|
||||||
serversTableLabel = findViewById(R.id.configuredDnsLabel)
|
serversTableLabel = findViewById(R.id.configuredDnsLabel)
|
||||||
serversTableHint = findViewById(R.id.configuredDnsHint)
|
serversTableHint = findViewById(R.id.configuredDnsHint)
|
||||||
|
@ -70,6 +80,11 @@ class DnsActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val enableChromeFixPanel = findViewById<TableRow>(R.id.enableChromeFixPanel)
|
||||||
|
enableChromeFixPanel.setOnClickListener {
|
||||||
|
enableChromeFix.toggle()
|
||||||
|
}
|
||||||
|
|
||||||
preferences = androidx.preference.PreferenceManager.getDefaultSharedPreferences(this.baseContext)
|
preferences = androidx.preference.PreferenceManager.getDefaultSharedPreferences(this.baseContext)
|
||||||
val serverString = preferences.getString(KEY_DNS_SERVERS, "")
|
val serverString = preferences.getString(KEY_DNS_SERVERS, "")
|
||||||
servers = if (serverString!!.isNotEmpty()) {
|
servers = if (serverString!!.isNotEmpty()) {
|
||||||
|
@ -132,10 +147,10 @@ class DnsActivity : AppCompatActivity() {
|
||||||
@SuppressLint("ApplySharedPref")
|
@SuppressLint("ApplySharedPref")
|
||||||
private fun updateUsableServers() {
|
private fun updateUsableServers() {
|
||||||
val usableTableLayout: TableLayout = findViewById(R.id.usableDnsTableLayout)
|
val usableTableLayout: TableLayout = findViewById(R.id.usableDnsTableLayout)
|
||||||
val defaultServers = DEFAULT_DNS_SERVERS.split(",")
|
|
||||||
|
|
||||||
defaultServers.forEach {
|
defaultDnsServers.forEach {
|
||||||
val server = it
|
val server = it.key
|
||||||
|
val infoPair = it.value
|
||||||
val view = inflater.inflate(R.layout.dns_server_usable, null)
|
val view = inflater.inflate(R.layout.dns_server_usable, null)
|
||||||
view.findViewById<TextView>(R.id.serverValue).text = server
|
view.findViewById<TextView>(R.id.serverValue).text = server
|
||||||
val addButton = view.findViewById<ImageButton>(R.id.addButton)
|
val addButton = view.findViewById<ImageButton>(R.id.addButton)
|
||||||
|
@ -152,7 +167,7 @@ class DnsActivity : AppCompatActivity() {
|
||||||
view.setOnLongClickListener {
|
view.setOnLongClickListener {
|
||||||
val builder: AlertDialog.Builder = AlertDialog.Builder(this)
|
val builder: AlertDialog.Builder = AlertDialog.Builder(this)
|
||||||
builder.setTitle(getString(R.string.dns_server_info_dialog_title))
|
builder.setTitle(getString(R.string.dns_server_info_dialog_title))
|
||||||
builder.setMessage(getText(R.string.dns_server_info_revertron))
|
builder.setMessage("${infoPair.first}\n\n${infoPair.second}")
|
||||||
builder.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
builder.setPositiveButton(getString(R.string.ok)) { dialog, _ ->
|
||||||
dialog.dismiss()
|
dialog.dismiss()
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,6 +78,11 @@ class MainActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val enableYggdrasilPanel = findViewById<TableRow>(R.id.enableYggdrasilPanel)
|
||||||
|
enableYggdrasilPanel.setOnClickListener {
|
||||||
|
enabledSwitch.toggle()
|
||||||
|
}
|
||||||
|
|
||||||
peersRow.isClickable = true
|
peersRow.isClickable = true
|
||||||
peersRow.setOnClickListener {
|
peersRow.setOnClickListener {
|
||||||
val intent = Intent(this, PeersActivity::class.java)
|
val intent = Intent(this, PeersActivity::class.java)
|
||||||
|
|
|
@ -54,6 +54,15 @@ class PeersActivity : AppCompatActivity() {
|
||||||
multicastListenSwitch.isChecked = config.multicastListen
|
multicastListenSwitch.isChecked = config.multicastListen
|
||||||
multicastBeaconSwitch.isChecked = config.multicastBeacon
|
multicastBeaconSwitch.isChecked = config.multicastBeacon
|
||||||
|
|
||||||
|
val multicastBeaconPanel = findViewById<TableRow>(R.id.enableMulticastBeaconPanel)
|
||||||
|
multicastBeaconPanel.setOnClickListener {
|
||||||
|
multicastBeaconSwitch.toggle()
|
||||||
|
}
|
||||||
|
val multicastListenPanel = findViewById<TableRow>(R.id.enableMulticastListenPanel)
|
||||||
|
multicastListenPanel.setOnClickListener {
|
||||||
|
multicastListenSwitch.toggle()
|
||||||
|
}
|
||||||
|
|
||||||
addPeerButton = findViewById(R.id.addPeerButton)
|
addPeerButton = findViewById(R.id.addPeerButton)
|
||||||
addPeerButton.setOnClickListener {
|
addPeerButton.setOnClickListener {
|
||||||
val view = inflater.inflate(R.layout.dialog_addpeer, null)
|
val view = inflater.inflate(R.layout.dialog_addpeer, null)
|
||||||
|
|
|
@ -194,13 +194,8 @@
|
||||||
android:showDividers="middle">
|
android:showDividers="middle">
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/enableChromeFixPanel"
|
||||||
android:layout_height="match_parent"
|
style="@style/SelectableSwitchItemStyle">
|
||||||
android:clickable="true"
|
|
||||||
android:paddingStart="4pt"
|
|
||||||
android:paddingTop="2pt"
|
|
||||||
android:paddingEnd="4pt"
|
|
||||||
android:paddingBottom="4pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -71,14 +71,8 @@
|
||||||
android:showDividers="middle">
|
android:showDividers="middle">
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/enableYggdrasilPanel"
|
||||||
android:layout_height="wrap_content"
|
style="@style/SelectableSwitchItemStyle">
|
||||||
android:layout_marginStart="4pt"
|
|
||||||
android:layout_marginLeft="4pt"
|
|
||||||
android:layout_marginTop="6pt"
|
|
||||||
android:layout_marginEnd="4pt"
|
|
||||||
android:layout_marginRight="4pt"
|
|
||||||
android:layout_marginBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/enableYggdrasilLabel"
|
android:id="@+id/enableYggdrasilLabel"
|
||||||
|
@ -100,20 +94,14 @@
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow style="@style/SelectableItemStyle">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginStart="4pt"
|
|
||||||
android:layout_marginLeft="4pt"
|
|
||||||
android:layout_marginTop="6pt"
|
|
||||||
android:layout_marginEnd="4pt"
|
|
||||||
android:layout_marginRight="4pt"
|
|
||||||
android:layout_marginBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/yggdrasilStatusLabel"
|
android:id="@+id/yggdrasilStatusLabel"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="2dp"
|
||||||
|
android:paddingBottom="2dp"
|
||||||
android:text="@string/main_disabled"
|
android:text="@string/main_disabled"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
@ -160,15 +148,7 @@
|
||||||
android:paddingBottom="2pt"
|
android:paddingBottom="2pt"
|
||||||
android:showDividers="middle">
|
android:showDividers="middle">
|
||||||
|
|
||||||
<TableRow
|
<TableRow style="@style/SelectableItemStyle">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginStart="4pt"
|
|
||||||
android:layout_marginLeft="4pt"
|
|
||||||
android:layout_marginTop="6pt"
|
|
||||||
android:layout_marginEnd="4pt"
|
|
||||||
android:layout_marginRight="4pt"
|
|
||||||
android:layout_marginBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ipAddressLabel"
|
android:id="@+id/ipAddressLabel"
|
||||||
|
@ -194,15 +174,7 @@
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow style="@style/SelectableItemStyle">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginStart="4pt"
|
|
||||||
android:layout_marginLeft="4pt"
|
|
||||||
android:layout_marginTop="6pt"
|
|
||||||
android:layout_marginEnd="4pt"
|
|
||||||
android:layout_marginRight="4pt"
|
|
||||||
android:layout_marginBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/subnetLabel"
|
android:id="@+id/subnetLabel"
|
||||||
|
@ -229,15 +201,7 @@
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow style="@style/SelectableItemStyle">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginStart="4pt"
|
|
||||||
android:layout_marginLeft="4pt"
|
|
||||||
android:layout_marginTop="6pt"
|
|
||||||
android:layout_marginEnd="4pt"
|
|
||||||
android:layout_marginRight="4pt"
|
|
||||||
android:layout_marginBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/coordinatesLabel"
|
android:id="@+id/coordinatesLabel"
|
||||||
|
@ -305,14 +269,7 @@
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:id="@+id/peersTableRow"
|
android:id="@+id/peersTableRow"
|
||||||
android:layout_width="match_parent"
|
style="@style/SelectableItemStyle">
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:paddingStart="4pt"
|
|
||||||
android:paddingTop="6pt"
|
|
||||||
android:paddingEnd="4pt"
|
|
||||||
android:paddingBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/multicastLabel"
|
android:id="@+id/multicastLabel"
|
||||||
|
@ -349,14 +306,7 @@
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:id="@+id/dnsTableRow"
|
android:id="@+id/dnsTableRow"
|
||||||
android:layout_width="match_parent"
|
style="@style/SelectableItemStyle">
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:paddingStart="4pt"
|
|
||||||
android:paddingTop="6pt"
|
|
||||||
android:paddingEnd="4pt"
|
|
||||||
android:paddingBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/dnsLabel"
|
android:id="@+id/dnsLabel"
|
||||||
|
@ -393,13 +343,7 @@
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:id="@+id/settingsTableRow"
|
android:id="@+id/settingsTableRow"
|
||||||
android:layout_width="match_parent"
|
style="@style/SelectableItemStyle">
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:paddingStart="4pt"
|
|
||||||
android:paddingTop="6pt"
|
|
||||||
android:paddingEnd="4pt"
|
|
||||||
android:paddingBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/settingsLabel"
|
android:id="@+id/settingsLabel"
|
||||||
|
@ -431,15 +375,7 @@
|
||||||
|
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow style="@style/SelectableItemStyle">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginStart="4pt"
|
|
||||||
android:layout_marginLeft="4pt"
|
|
||||||
android:layout_marginTop="6pt"
|
|
||||||
android:layout_marginEnd="4pt"
|
|
||||||
android:layout_marginRight="4pt"
|
|
||||||
android:layout_marginBottom="6pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/versionLabel"
|
android:id="@+id/versionLabel"
|
||||||
|
|
|
@ -111,9 +111,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="8pt"
|
android:layout_marginStart="8pt"
|
||||||
android:layout_marginLeft="8pt"
|
|
||||||
android:layout_marginEnd="8pt"
|
android:layout_marginEnd="8pt"
|
||||||
android:layout_marginRight="8pt"
|
|
||||||
android:background="@drawable/rounded"
|
android:background="@drawable/rounded"
|
||||||
android:divider="#46878787"
|
android:divider="#46878787"
|
||||||
android:dividerPadding="4pt"
|
android:dividerPadding="4pt"
|
||||||
|
@ -167,7 +165,6 @@
|
||||||
android:layout_marginEnd="8pt"
|
android:layout_marginEnd="8pt"
|
||||||
android:layout_marginRight="8pt"
|
android:layout_marginRight="8pt"
|
||||||
android:background="@drawable/rounded"
|
android:background="@drawable/rounded"
|
||||||
android:clickable="true"
|
|
||||||
android:divider="#46878787"
|
android:divider="#46878787"
|
||||||
android:dividerPadding="4pt"
|
android:dividerPadding="4pt"
|
||||||
android:paddingLeft="4pt"
|
android:paddingLeft="4pt"
|
||||||
|
@ -177,13 +174,8 @@
|
||||||
android:showDividers="middle">
|
android:showDividers="middle">
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/enableMulticastBeaconPanel"
|
||||||
android:layout_height="match_parent"
|
style="@style/SelectableSwitchItemStyle">
|
||||||
android:clickable="true"
|
|
||||||
android:paddingStart="4pt"
|
|
||||||
android:paddingTop="2pt"
|
|
||||||
android:paddingEnd="4pt"
|
|
||||||
android:paddingBottom="4pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -204,13 +196,8 @@
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/enableMulticastListenPanel"
|
||||||
android:layout_height="match_parent"
|
style="@style/SelectableSwitchItemStyle">
|
||||||
android:clickable="true"
|
|
||||||
android:paddingStart="4pt"
|
|
||||||
android:paddingTop="4pt"
|
|
||||||
android:paddingEnd="4pt"
|
|
||||||
android:paddingBottom="2pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -162,13 +162,7 @@
|
||||||
android:paddingBottom="2pt"
|
android:paddingBottom="2pt"
|
||||||
android:showDividers="middle">
|
android:showDividers="middle">
|
||||||
|
|
||||||
<TableRow
|
<TableRow style="@style/SelectableItemStyle">
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_marginLeft="4pt"
|
|
||||||
android:layout_marginTop="4pt"
|
|
||||||
android:layout_marginRight="4pt"
|
|
||||||
android:layout_marginBottom="4pt">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -242,11 +236,7 @@
|
||||||
|
|
||||||
<TableRow
|
<TableRow
|
||||||
android:id="@+id/resetConfigurationRow"
|
android:id="@+id/resetConfigurationRow"
|
||||||
android:layout_width="match_parent"
|
style="@style/SelectableItemStyle">
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
android:clickable="true"
|
|
||||||
android:padding="4pt">
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
|
@ -10,10 +10,11 @@
|
||||||
android:id="@+id/serverValue"
|
android:id="@+id/serverValue"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="18dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginEnd="18dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="4dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text=""
|
android:text=""
|
||||||
|
@ -21,24 +22,16 @@
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/addButton"
|
app:layout_constraintEnd_toStartOf="@+id/addButton"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/space" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<Space
|
|
||||||
android:id="@+id/space"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/addButton"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/addButton"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/serverValue"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/addButton" />
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/addButton"
|
android:id="@+id/addButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/tableRow"
|
android:id="@+id/tableRow"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -9,10 +10,11 @@
|
||||||
android:id="@+id/addressValue"
|
android:id="@+id/addressValue"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="18dp"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_marginEnd="18dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:layout_marginBottom="12dp"
|
android:layout_marginBottom="4dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:text=""
|
android:text=""
|
||||||
|
@ -20,24 +22,16 @@
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/deletePeerButton"
|
app:layout_constraintEnd_toStartOf="@+id/deletePeerButton"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@+id/space" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
<Space
|
|
||||||
android:id="@+id/space"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/deletePeerButton"
|
|
||||||
app:layout_constraintEnd_toStartOf="@+id/deletePeerButton"
|
|
||||||
app:layout_constraintStart_toEndOf="@+id/addressValue"
|
|
||||||
app:layout_constraintTop_toTopOf="@+id/deletePeerButton" />
|
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/deletePeerButton"
|
android:id="@+id/deletePeerButton"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:layout_marginEnd="4dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginBottom="10dp"
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
android:background="@android:color/transparent"
|
android:background="@android:color/transparent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -65,4 +65,8 @@
|
||||||
<string name="public_key_hint">Ваш публичный ключ идентифицирует вас в сети. Его распространение безопасно.</string>
|
<string name="public_key_hint">Ваш публичный ключ идентифицирует вас в сети. Его распространение безопасно.</string>
|
||||||
<string name="reset_configuration">Сбросить настройки</string>
|
<string name="reset_configuration">Сбросить настройки</string>
|
||||||
<string name="reset_configuration_hint">Сброс создаст полностью новые настройки. Это изменит ваш публичный ключ и адрес IP.</string>
|
<string name="reset_configuration_hint">Сброс создаст полностью новые настройки. Это изменит ваш публичный ключ и адрес IP.</string>
|
||||||
|
<string name="location_amsterdam">Амстердам, Нидерланды</string>
|
||||||
|
<string name="location_prague">Прага, Чехия</string>
|
||||||
|
<string name="location_bratislava">Братислава, Словакия</string>
|
||||||
|
<string name="location_buffalo">Баффало, США</string>
|
||||||
</resources>
|
</resources>
|
|
@ -65,4 +65,8 @@
|
||||||
<string name="public_key_hint">Your public key forms your identity on the network. It is safe to be shared.</string>
|
<string name="public_key_hint">Your public key forms your identity on the network. It is safe to be shared.</string>
|
||||||
<string name="reset_configuration">Reset configuration</string>
|
<string name="reset_configuration">Reset configuration</string>
|
||||||
<string name="reset_configuration_hint">Resetting will overwrite with newly generated configuration. Your public keys and IP address on the network will change.</string>
|
<string name="reset_configuration_hint">Resetting will overwrite with newly generated configuration. Your public keys and IP address on the network will change.</string>
|
||||||
|
<string name="location_amsterdam">Amsterdam, NL</string>
|
||||||
|
<string name="location_prague">Prague, CZ</string>
|
||||||
|
<string name="location_bratislava">Bratislava, SK</string>
|
||||||
|
<string name="location_buffalo">Buffalo, US</string>
|
||||||
</resources>
|
</resources>
|
23
app/src/main/res/values/styles.xml
Normal file
23
app/src/main/res/values/styles.xml
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
|
||||||
|
<style name="SelectableItemStyle">
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
<item name="android:layout_height">match_parent</item>
|
||||||
|
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||||
|
<item name="android:paddingStart">8dp</item>
|
||||||
|
<item name="android:paddingEnd">8dp</item>
|
||||||
|
<item name="android:paddingTop">10dp</item>
|
||||||
|
<item name="android:paddingBottom">10dp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="SelectableSwitchItemStyle">
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
<item name="android:layout_height">match_parent</item>
|
||||||
|
<item name="android:background">?android:attr/selectableItemBackground</item>
|
||||||
|
<item name="android:paddingStart">8dp</item>
|
||||||
|
<item name="android:paddingEnd">8dp</item>
|
||||||
|
<item name="android:paddingTop">8dp</item>
|
||||||
|
<item name="android:paddingBottom">8dp</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
Loading…
Add table
Add a link
Reference in a new issue