Merge branch 'master' into message-db

This commit is contained in:
Kevin Hester
2020-09-27 13:05:33 -07:00
committed by GitHub
4 changed files with 6 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ fun getInitials(nameIn: String): String {
val initials = when (words.size) {
in 0..minchars - 1 -> {
val nm = name.filterNot { c -> c.toLowerCase() in "aeiou" }
val nm = name.first() + name.drop(1).filterNot { c -> c.toLowerCase() in "aeiou" }
if (nm.length >= nchars) nm else name
}
else -> words.map { it.first() }.joinToString("")

View File

@@ -5,6 +5,7 @@ import android.content.Context
import android.os.Build
import android.os.DeadObjectException
import android.os.Handler
import android.os.Looper
import com.geeksville.android.GeeksvilleApplication
import com.geeksville.android.Logging
import com.geeksville.concurrent.CallbackContinuation
@@ -97,7 +98,7 @@ class SafeBluetooth(private val context: Context, private val device: BluetoothD
* skanky hack to restart BLE if it says it is hosed
* https://stackoverflow.com/questions/35103701/ble-android-onconnectionstatechange-not-being-called
*/
private val mHandler: Handler = Handler()
private val mHandler: Handler = Handler(Looper.getMainLooper())
fun restartBle() {
GeeksvilleApplication.analytics.track("ble_restart") // record # of times we needed to use this nasty hack

View File

@@ -1,7 +1,6 @@
package com.geeksville.mesh.ui
import android.os.Bundle
import android.text.format.DateFormat
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@@ -22,6 +21,7 @@ import com.geeksville.mesh.service.MeshService
import com.google.android.material.chip.Chip
import kotlinx.android.synthetic.main.adapter_message_layout.view.*
import kotlinx.android.synthetic.main.messages_fragment.*
import java.text.DateFormat
import java.util.*
// Allows usage like email.on(EditorInfo.IME_ACTION_NEXT, { confirm() })
@@ -40,7 +40,7 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
private val model: UIViewModel by activityViewModels()
private lateinit var dateTimeFormat : java.text.DateFormat
private val dateTimeFormat: DateFormat = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM)
// Provide a direct reference to each of the views within a data item
// Used to cache the views within the item layout for fast access
@@ -173,7 +173,6 @@ class MessagesFragment : ScreenFragment("Messages"), Logging {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
dateTimeFormat = DateFormat.getTimeFormat(context)
messageInputText.on(EditorInfo.IME_ACTION_DONE) {
debug("did IME action")