kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
node list is ugly but it kinda works
rodzic
0ff97ba3c4
commit
9e9cfae829
|
@ -292,8 +292,12 @@ class MainActivity : AppCompatActivity(), Logging,
|
|||
}.attach()
|
||||
|
||||
model.isConnected.observe(this, Observer { connected ->
|
||||
val image =
|
||||
if (connected != MeshService.ConnectionState.DISCONNECTED) R.drawable.cloud_on else R.drawable.cloud_off
|
||||
val image = when (connected) {
|
||||
MeshService.ConnectionState.CONNECTED -> R.drawable.cloud_on
|
||||
MeshService.ConnectionState.DEVICE_SLEEP -> R.drawable.ic_twotone_cloud_upload_24
|
||||
MeshService.ConnectionState.DISCONNECTED -> R.drawable.cloud_off
|
||||
}
|
||||
|
||||
connectStatusImage.setImageDrawable(getDrawable(image))
|
||||
})
|
||||
}
|
||||
|
|
|
@ -128,27 +128,7 @@ class UsersFragment : ScreenFragment("Users"), Logging {
|
|||
|
||||
|
||||
/*
|
||||
@Composable
|
||||
fun UsersContent() {
|
||||
Column {
|
||||
Row {
|
||||
fun connected() = UIState.isConnected.value != MeshService.ConnectionState.DISCONNECTED
|
||||
VectorImage(
|
||||
id = if (connected()) R.drawable.cloud_on else R.drawable.cloud_off,
|
||||
tint = palette.onBackground,
|
||||
modifier = LayoutPadding(start = 8.dp)
|
||||
)
|
||||
|
||||
Column {
|
||||
|
||||
Text(
|
||||
when (UIState.isConnected.value) {
|
||||
MeshService.ConnectionState.CONNECTED -> "Connected"
|
||||
MeshService.ConnectionState.DISCONNECTED -> "Disconnected"
|
||||
MeshService.ConnectionState.DEVICE_SLEEP -> "Power Saving"
|
||||
},
|
||||
modifier = LayoutPadding(start = 8.dp)
|
||||
)
|
||||
|
||||
if (false) { // hide the firmware update button for now, it is kinda ugly and users don't need it yet
|
||||
/// Create a software update button
|
||||
|
@ -169,9 +149,6 @@ fun UsersContent() {
|
|||
}
|
||||
}
|
||||
|
||||
NodeDB.nodes.values.forEach {
|
||||
NodeInfoCard(it)
|
||||
}
|
||||
|
||||
|
||||
/* FIXME - doens't work yet - probably because I'm not using release keys
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.21,12.04l-1.53,-0.11 -0.3,-1.5C16.88,7.86 14.62,6 12,6 9.94,6 8.08,7.14 7.12,8.96l-0.5,0.95 -1.07,0.11C3.53,10.24 2,11.95 2,14c0,2.21 1.79,4 4,4h13c1.65,0 3,-1.35 3,-3 0,-1.55 -1.22,-2.86 -2.79,-2.96zM13.45,13v3h-2.91v-3L8,13l4,-4 4,4h-2.55z"
|
||||
android:strokeAlpha="0.3"
|
||||
android:fillAlpha="0.3"/>
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M19.35,10.04C18.67,6.59 15.64,4 12,4 9.11,4 6.6,5.64 5.35,8.04 2.34,8.36 0,10.91 0,14c0,3.31 2.69,6 6,6h13c2.76,0 5,-2.24 5,-5 0,-2.64 -2.05,-4.78 -4.65,-4.96zM19,18H6c-2.21,0 -4,-1.79 -4,-4 0,-2.05 1.53,-3.76 3.56,-3.97l1.07,-0.11 0.5,-0.95C8.08,7.14 9.94,6 12,6c2.62,0 4.88,1.86 5.39,4.43l0.3,1.5 1.53,0.11c1.56,0.1 2.78,1.41 2.78,2.96 0,1.65 -1.35,3 -3,3zM8,13h2.55v3h2.9v-3H16l-4,-4z"/>
|
||||
</vector>
|
|
@ -1,25 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/Widget.App.CardView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="5dp">
|
||||
android:layout_margin="8dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/Widget.App.CardView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:contentPadding="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nodeNameView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="Unknown Username"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/nodeNameView"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="@string/unknown_username"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</LinearLayout>
|
|
@ -8,4 +8,5 @@
|
|||
<string name="unset">Unset</string>
|
||||
<string name="connection_status">Connection status</string>
|
||||
<string name="application_icon">application icon</string>
|
||||
<string name="unknown_username">Unknown Username</string>
|
||||
</resources>
|
||||
|
|
Ładowanie…
Reference in New Issue