mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-25 10:57:21 +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 kotlinx.android.synthetic.main.view_device.view.*
|
||||||
import network.loki.messenger.R
|
import network.loki.messenger.R
|
||||||
import org.thoughtcrime.securesms.devicelist.Device
|
import org.thoughtcrime.securesms.devicelist.Device
|
||||||
|
import org.thoughtcrime.securesms.loki.toPx
|
||||||
|
|
||||||
class DeviceView : LinearLayout {
|
class DeviceView : LinearLayout {
|
||||||
var device: Device? = null
|
var device: Device? = null
|
||||||
@ -38,6 +39,10 @@ class DeviceView : LinearLayout {
|
|||||||
// region Updating
|
// region Updating
|
||||||
fun bind(device: Device) {
|
fun bind(device: Device) {
|
||||||
titleTextView.text = if (!device.name.isNullOrBlank()) device.name else "Unnamed 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
|
subtitleTextView.text = device.shortId
|
||||||
}
|
}
|
||||||
// endregion
|
// endregion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user