Add fake filter view + refine UI
This commit is contained in:
parent
55efd226bb
commit
ec27951850
@ -1,12 +1,12 @@
|
|||||||
package im.vector.riotredesign.core.platform
|
package im.vector.riotredesign.core.platform
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.support.constraint.ConstraintLayout
|
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.Checkable
|
import android.widget.Checkable
|
||||||
|
import android.widget.FrameLayout
|
||||||
|
|
||||||
class CheckableConstraintLayout : ConstraintLayout, Checkable {
|
class CheckableFrameLayout : FrameLayout, Checkable {
|
||||||
|
|
||||||
private var mChecked = false
|
private var mChecked = false
|
||||||
|
|
@ -64,10 +64,10 @@ class RoomDetailFragment : RiotFragment(), TimelineEventAdapter.Callback {
|
|||||||
layoutManager.stackFromEnd = true
|
layoutManager.stackFromEnd = true
|
||||||
timelineAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
|
timelineAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() {
|
||||||
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
|
override fun onItemRangeInserted(positionStart: Int, itemCount: Int) {
|
||||||
/*if (layoutManager.findFirstVisibleItemPosition() == 0) {
|
if (layoutManager.findFirstVisibleItemPosition() == 0) {
|
||||||
layoutManager.scrollToPosition(0)
|
layoutManager.scrollToPosition(0)
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
recyclerView.layoutManager = layoutManager
|
recyclerView.layoutManager = layoutManager
|
||||||
|
@ -5,7 +5,7 @@ import android.widget.ImageView
|
|||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import im.vector.riotredesign.R
|
import im.vector.riotredesign.R
|
||||||
import im.vector.riotredesign.core.epoxy.KotlinModel
|
import im.vector.riotredesign.core.epoxy.KotlinModel
|
||||||
import im.vector.riotredesign.core.platform.CheckableConstraintLayout
|
import im.vector.riotredesign.core.platform.CheckableFrameLayout
|
||||||
|
|
||||||
|
|
||||||
data class RoomSummaryItem(
|
data class RoomSummaryItem(
|
||||||
@ -17,11 +17,11 @@ data class RoomSummaryItem(
|
|||||||
|
|
||||||
private val titleView by bind<TextView>(R.id.titleView)
|
private val titleView by bind<TextView>(R.id.titleView)
|
||||||
private val avatarImageView by bind<ImageView>(R.id.avatarImageView)
|
private val avatarImageView by bind<ImageView>(R.id.avatarImageView)
|
||||||
private val rootView by bind<CheckableConstraintLayout>(R.id.itemRoomLayout)
|
private val rootView by bind<CheckableFrameLayout>(R.id.itemRoomLayout)
|
||||||
|
|
||||||
override fun bind() {
|
override fun bind() {
|
||||||
rootView.isChecked = isSelected
|
rootView.isChecked = isSelected
|
||||||
titleView.setOnClickListener { listener?.invoke() }
|
rootView.setOnClickListener { listener?.invoke() }
|
||||||
titleView.text = title
|
titleView.text = title
|
||||||
avatarImageView.setImageDrawable(avatarDrawable)
|
avatarImageView.setImageDrawable(avatarDrawable)
|
||||||
}
|
}
|
||||||
|
@ -1,18 +1,15 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
<item android:state_pressed="true">
|
|
||||||
<shape>
|
|
||||||
<solid android:color="@android:color/white"/>
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
<item android:state_checked="true">
|
<item android:state_checked="true">
|
||||||
<shape>
|
<shape>
|
||||||
<solid android:color="@android:color/white"/>
|
<solid android:color="@android:color/white" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<shape>
|
<shape>
|
||||||
<solid android:color="@android:color/transparent"/>
|
<solid android:color="@android:color/transparent" />
|
||||||
</shape>
|
</shape>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
5
app/src/main/res/drawable/bg_search_edit_text.xml
Normal file
5
app/src/main/res/drawable/bg_search_edit_text.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/light_blue_grey" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/toolbarTitleView"
|
android:id="@+id/toolbarTitleView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:layout_marginStart="8dp"
|
android:layout_marginStart="8dp"
|
||||||
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/toolbarSubtitleView"
|
android:id="@+id/toolbarSubtitleView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="8dp"
|
android:layout_marginBottom="8dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
|
@ -1,13 +1,47 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<im.vector.riotredesign.core.platform.StateView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/stateView"
|
|
||||||
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/pale_grey">
|
android:background="@color/pale_grey">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/filterRoomView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="32dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:layout_marginStart="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:background="@drawable/bg_search_edit_text"
|
||||||
|
android:drawableLeft="@drawable/ic_search_white"
|
||||||
|
android:drawablePadding="8dp"
|
||||||
|
android:drawableTint="#9fa9ba"
|
||||||
|
android:hint="Filter by name..."
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
app:layout_constraintBottom_toTopOf="@+id/stateView"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<im.vector.riotredesign.core.platform.StateView
|
||||||
|
android:id="@+id/stateView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginBottom="0dp"
|
||||||
|
android:layout_marginEnd="0dp"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/filterRoomView">
|
||||||
|
|
||||||
<com.airbnb.epoxy.EpoxyRecyclerView
|
<com.airbnb.epoxy.EpoxyRecyclerView
|
||||||
android:id="@+id/epoxyRecyclerView"
|
android:id="@+id/epoxyRecyclerView"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="match_parent" />
|
||||||
|
|
||||||
</im.vector.riotredesign.core.platform.StateView>
|
</im.vector.riotredesign.core.platform.StateView>
|
||||||
|
|
||||||
|
</android.support.constraint.ConstraintLayout>
|
@ -1,12 +1,23 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<im.vector.riotredesign.core.platform.CheckableConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<im.vector.riotredesign.core.platform.CheckableFrameLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/itemRoomLayout"
|
android:id="@+id/itemRoomLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="8dp"
|
||||||
|
android:paddingRight="16dp"
|
||||||
|
android:foreground="?attr/selectableItemBackground"
|
||||||
android:background="@drawable/bg_room_item"
|
android:background="@drawable/bg_room_item"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true">
|
||||||
|
|
||||||
|
<android.support.constraint.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:duplicateParentState="true"
|
||||||
android:minHeight="48dp">
|
android:minHeight="48dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@ -33,4 +44,6 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent"
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
tools:text="@tools:sample/full_names" />
|
tools:text="@tools:sample/full_names" />
|
||||||
|
|
||||||
</im.vector.riotredesign.core.platform.CheckableConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
||||||
|
|
||||||
|
</im.vector.riotredesign.core.platform.CheckableFrameLayout>
|
@ -4,20 +4,22 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:clickable="true"
|
||||||
|
android:focusable="true"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:minHeight="24dp"
|
android:minHeight="24dp"
|
||||||
android:padding="16dp"
|
android:padding="16dp"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
tools:background="@color/pale_grey">
|
tools:background="@color/pale_grey">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/roomCategoryTitleView"
|
android:id="@+id/roomCategoryTitleView"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:layout_marginEnd="8dp"
|
android:layout_marginEnd="8dp"
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:drawableLeft="@drawable/ic_expand_more_white"
|
android:drawableLeft="@drawable/ic_expand_more_white"
|
||||||
android:drawableTint="@color/bluey_grey_two"
|
android:drawableTint="@color/bluey_grey_two"
|
||||||
android:foregroundTint="@color/bluey_grey_two"
|
android:gravity="center_vertical"
|
||||||
android:text="DIRECT MESSAGES"
|
android:text="DIRECT MESSAGES"
|
||||||
android:textColor="@color/bluey_grey_two"
|
android:textColor="@color/bluey_grey_two"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@ -28,9 +30,9 @@
|
|||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/roomCategoryAddButton"
|
android:id="@+id/roomCategoryAddButton"
|
||||||
android:layout_width="24dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="24dp"
|
android:layout_height="32dp"
|
||||||
android:layout_marginEnd="8dp"
|
|
||||||
android:scaleType="centerInside"
|
android:scaleType="centerInside"
|
||||||
android:src="@drawable/ic_add_circle_white"
|
android:src="@drawable/ic_add_circle_white"
|
||||||
android:tint="@color/bluey_grey_two"
|
android:tint="@color/bluey_grey_two"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user