Commit d5a5a9be authored by karthyks's avatar karthyks

fix wildcard imports

fix indentation
handle nullable in PushManager parcelable methods
move textview extension in widget file
parent 0685f5fa
......@@ -8,7 +8,7 @@ import androidx.core.view.isInvisible
import androidx.core.view.isVisible
import chat.rocket.android.R
import chat.rocket.android.chatrooms.adapter.model.RoomUiModel
import chat.rocket.android.util.extensions.setTextViewAppearance
import chat.rocket.android.util.extension.setTextViewAppearance
import chat.rocket.common.model.RoomType
import chat.rocket.common.model.UserStatus
import kotlinx.android.synthetic.main.item_chat.view.*
......
package chat.rocket.android.createchannel.ui
import android.os.Bundle
import android.view.*
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.view.ActionMode
import androidx.core.view.isVisible
......
......@@ -11,7 +11,7 @@ import kotlinx.android.synthetic.main.avatar.view.*
import kotlinx.android.synthetic.main.item_member.view.*
class MembersAdapter(
private val listener: (MemberUiModel) -> Unit
private val listener: (MemberUiModel) -> Unit
) : RecyclerView.Adapter<MembersAdapter.ViewHolder>() {
private var dataSet: List<MemberUiModel> = ArrayList()
......
......@@ -231,8 +231,8 @@ class PushManager @Inject constructor(
@RequiresApi(Build.VERSION_CODES.O)
private fun createBaseNotificationBuilder(
pushMessage: PushMessage,
grouped: Boolean = false
pushMessage: PushMessage,
grouped: Boolean = false
): NotificationCompat.Builder {
return with(pushMessage) {
val id = notificationId.toInt()
......@@ -299,10 +299,10 @@ class PushManager @Inject constructor(
}
private fun getContentIntent(
context: Context,
notificationId: Int,
pushMessage: PushMessage,
grouped: Boolean = false
context: Context,
notificationId: Int,
pushMessage: PushMessage,
grouped: Boolean = false
): PendingIntent {
val roomId = if (!grouped) pushMessage.info.roomId else null
val notificationIntent = context.changeServerIntent(pushMessage.info.host, chatRoomId = roomId)
......@@ -395,12 +395,12 @@ data class PushMessage(
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString()!!,
parcel.readString()!!,
parcel.readParcelable(PushMessage::class.java.classLoader)!!,
parcel.readString() ?: "",
parcel.readString() ?: "",
parcel.readParcelable(PushMessage::class.java.classLoader) ?: PushInfo.EMPTY,
parcel.readString(),
parcel.readString(),
parcel.readString()!!,
parcel.readString()?: "",
parcel.readString(),
parcel.readString())
......
package chat.rocket.android.util.extensions
import android.content.Context
import android.os.Build
import android.widget.TextView
fun TextView.setTextViewAppearance(context: Context, style: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
setTextAppearance(style)
} else {
setTextAppearance(context, style)
}
}
\ No newline at end of file
package chat.rocket.android.util.extension
import android.content.Context
import android.os.Build
import android.widget.TextView
import androidx.appcompat.widget.SearchView
fun SearchView.onQueryTextListener(queryListener: (String) -> Unit) {
......@@ -14,4 +17,12 @@ fun SearchView.onQueryTextListener(queryListener: (String) -> Unit) {
return true
}
})
}
fun TextView.setTextViewAppearance(context: Context, style: Int) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
setTextAppearance(style)
} else {
setTextAppearance(context, style)
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment