Valere's review
This commit is contained in:
parent
0ecc53f59c
commit
7eb1be4633
|
@ -81,18 +81,14 @@ class StateView @JvmOverloads constructor(context: Context, attrs: AttributeSet?
|
|||
emptyImageView.setImageDrawable(newState.image)
|
||||
emptyMessageView.text = newState.message
|
||||
emptyTitleView.text = newState.title
|
||||
if (contentView != null) {
|
||||
contentView!!.visibility = View.INVISIBLE
|
||||
}
|
||||
contentView?.visibility = View.INVISIBLE
|
||||
}
|
||||
is State.Error -> {
|
||||
progressBar.visibility = View.INVISIBLE
|
||||
errorView.visibility = View.VISIBLE
|
||||
emptyView.visibility = View.INVISIBLE
|
||||
errorMessageView.text = newState.message
|
||||
if (contentView != null) {
|
||||
contentView!!.visibility = View.INVISIBLE
|
||||
}
|
||||
contentView?.visibility = View.INVISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
package im.vector.riotredesign.features.home
|
||||
|
||||
import android.os.Bundle
|
||||
import im.vector.matrix.android.api.Matrix
|
||||
import im.vector.matrix.android.api.session.Session
|
||||
import im.vector.riotredesign.R
|
||||
import im.vector.riotredesign.core.extensions.observeK
|
||||
import im.vector.riotredesign.core.extensions.replaceChildFragment
|
||||
import im.vector.riotredesign.core.platform.VectorBaseFragment
|
||||
import im.vector.riotredesign.features.home.group.GroupListFragment
|
||||
import im.vector.riotredesign.features.settings.VectorSettingsActivity
|
||||
import kotlinx.android.synthetic.main.fragment_home_drawer.*
|
||||
import org.koin.android.ext.android.inject
|
||||
|
||||
class HomeDrawerFragment : VectorBaseFragment() {
|
||||
|
||||
|
@ -35,6 +35,8 @@ class HomeDrawerFragment : VectorBaseFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
val session by inject<Session>()
|
||||
|
||||
override fun getLayoutResId() = R.layout.fragment_home_drawer
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
|
@ -43,7 +45,7 @@ class HomeDrawerFragment : VectorBaseFragment() {
|
|||
val groupListFragment = GroupListFragment.newInstance()
|
||||
replaceChildFragment(groupListFragment, R.id.homeDrawerGroupListContainer)
|
||||
}
|
||||
val session = Matrix.getInstance().currentSession ?: return
|
||||
|
||||
session.observeUser(session.sessionParams.credentials.userId).observeK(this) { user ->
|
||||
if (user != null) {
|
||||
AvatarRenderer.render(user.avatarUrl, user.userId, user.displayName, homeDrawerHeaderAvatarView)
|
||||
|
|
|
@ -479,11 +479,7 @@ class RoomDetailFragment :
|
|||
override fun onEventLongClicked(informationData: MessageInformationData, messageContent: MessageContent, view: View): Boolean {
|
||||
view.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
|
||||
val roomId = roomDetailArgs.roomId
|
||||
if (roomId.isBlank()) {
|
||||
// Benoit to Valere: can this happen?
|
||||
Timber.e("Missing RoomId, cannot open bottomsheet")
|
||||
return false
|
||||
}
|
||||
|
||||
this.view?.hideKeyboard()
|
||||
MessageActionsBottomSheet
|
||||
.newInstance(roomId, informationData)
|
||||
|
|
|
@ -18,7 +18,7 @@ package im.vector.riotredesign.features.home.room.list
|
|||
|
||||
import androidx.recyclerview.widget.DefaultItemAnimator
|
||||
|
||||
private const val ANIM_DURATION_IN_MILLIS = 100L
|
||||
private const val ANIM_DURATION_IN_MILLIS = 200L
|
||||
|
||||
class RoomListAnimator : DefaultItemAnimator() {
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ object RoomSummaryFormatter {
|
|||
*/
|
||||
fun formatUnreadMessagesCounter(count: Int): String {
|
||||
return if (count > 999) {
|
||||
"${count / 1000}.${count % 1000 / 100}K"
|
||||
"${count / 1000}.${count % 1000 / 100}k"
|
||||
} else {
|
||||
count.toString()
|
||||
}
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="40dp" />
|
||||
|
||||
<solid android:color="@color/rosy_pink" />
|
||||
</shape>
|
|
@ -1,6 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval">
|
||||
android:shape="rectangle">
|
||||
|
||||
<corners android:radius="40dp" />
|
||||
|
||||
<solid android:color="@color/grey_lynch" />
|
||||
</shape>
|
Loading…
Reference in New Issue