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)
|
||||
copyAddressButton.setOnClickListener {
|
||||
val ipLabel = findViewById<TextView>(R.id.ipLabel)
|
||||
val ip = findViewById<TextView>(R.id.ip)
|
||||
val clipboard: ClipboardManager =
|
||||
getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
|
||||
val clip =
|
||||
ClipData.newPlainText("IP address", ipLabel.text.toString())
|
||||
ClipData.newPlainText("IP address", ip.text.toString())
|
||||
clipboard.setPrimaryClip(clip)
|
||||
showToast(getString(R.string.address_copied))
|
||||
}
|
||||
|
@ -17,9 +17,11 @@
|
||||
android:paddingLeft="20dp"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:animateLayoutChanges="true"
|
||||
android:visibility="gone">
|
||||
|
||||
android:animateLayoutChanges="true">
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<TextView
|
||||
android:id="@+id/ipLabel"
|
||||
android:layout_width="match_parent"
|
||||
@ -28,12 +30,21 @@
|
||||
android:elevation="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="IP address:"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
android:textColor="@color/dark_30" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
<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>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ip"
|
||||
android:layout_width="match_parent"
|
||||
@ -47,15 +58,6 @@
|
||||
app:layout_constraintEnd_toStartOf="@+id/copyIp"
|
||||
android:text=""
|
||||
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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user