mirror of
https://github.com/yggdrasil-network/crispa-android.git
synced 2024-11-09 20:11:01 +00:00
1. old core fix, clipboard fix, GUI fix
This commit is contained in:
parent
b04ca172f4
commit
317e040e1b
@ -72,11 +72,11 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
val copyAddressButton = findViewById<Button>(R.id.copyIp)
|
val copyAddressButton = findViewById<Button>(R.id.copyIp)
|
||||||
copyAddressButton.setOnClickListener {
|
copyAddressButton.setOnClickListener {
|
||||||
val ipLabel = findViewById<TextView>(R.id.ipLabel)
|
val ip = findViewById<TextView>(R.id.ip)
|
||||||
val clipboard: ClipboardManager =
|
val clipboard: ClipboardManager =
|
||||||
getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||||
val clip =
|
val clip =
|
||||||
ClipData.newPlainText("IP address", ipLabel.text.toString())
|
ClipData.newPlainText("IP address", ip.text.toString())
|
||||||
clipboard.setPrimaryClip(clip)
|
clipboard.setPrimaryClip(clip)
|
||||||
showToast(getString(R.string.address_copied))
|
showToast(getString(R.string.address_copied))
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,11 @@
|
|||||||
android:paddingLeft="20dp"
|
android:paddingLeft="20dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:animateLayoutChanges="true"
|
android:animateLayoutChanges="true">
|
||||||
android:visibility="gone">
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ipLabel"
|
android:id="@+id/ipLabel"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -28,12 +30,21 @@
|
|||||||
android:elevation="8dp"
|
android:elevation="8dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:text="IP address:"
|
android:text="IP address:"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:textColor="@color/dark_30" />
|
android:textColor="@color/dark_30" />
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<Button
|
||||||
android:layout_width="match_parent"
|
android:id="@+id/copyIp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
app:layout_constraintTop_toTopOf="parent">
|
android:layout_height="match_parent"
|
||||||
|
android:text="COPY"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
android:background="@android:color/transparent"/>
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ip"
|
android:id="@+id/ip"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -47,15 +58,6 @@
|
|||||||
app:layout_constraintEnd_toStartOf="@+id/copyIp"
|
app:layout_constraintEnd_toStartOf="@+id/copyIp"
|
||||||
android:text=""
|
android:text=""
|
||||||
android:textColor="@color/white"/>
|
android:textColor="@color/white"/>
|
||||||
<Button
|
|
||||||
android:id="@+id/copyIp"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:text="COPY"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
android:background="@android:color/transparent"/>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user