mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Fix layout bug
This commit is contained in:
parent
9efa528377
commit
5c8bbc161b
@ -7,6 +7,7 @@ import android.widget.LinearLayout
|
||||
import kotlinx.android.synthetic.main.view_device.view.*
|
||||
import network.loki.messenger.R
|
||||
import org.thoughtcrime.securesms.devicelist.Device
|
||||
import org.thoughtcrime.securesms.loki.toPx
|
||||
|
||||
class DeviceView : LinearLayout {
|
||||
var device: Device? = null
|
||||
@ -38,6 +39,10 @@ class DeviceView : LinearLayout {
|
||||
// region Updating
|
||||
fun bind(device: Device) {
|
||||
titleTextView.text = if (!device.name.isNullOrBlank()) device.name else "Unnamed Device"
|
||||
// FIXME: Hacky way of getting the view to be screen width
|
||||
val titleTextViewLayoutParams = titleTextView.layoutParams
|
||||
titleTextViewLayoutParams.width = resources.displayMetrics.widthPixels - toPx(32, resources)
|
||||
titleTextView.layoutParams = titleTextViewLayoutParams
|
||||
subtitleTextView.text = device.shortId
|
||||
}
|
||||
// endregion
|
||||
|
Loading…
Reference in New Issue
Block a user