forked from upstream-mirrors/quik
Updated colours
This commit is contained in:
@@ -49,11 +49,11 @@ class MessagesAdapter(data: OrderedRealmCollection<Message>?) : RealmRecyclerVie
|
|||||||
when (viewType) {
|
when (viewType) {
|
||||||
VIEWTYPE_ME -> {
|
VIEWTYPE_ME -> {
|
||||||
layoutRes = R.layout.message_list_item_out
|
layoutRes = R.layout.message_list_item_out
|
||||||
bubbleColor = themeManager.color
|
bubbleColor = themeManager.bubbleColor
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
layoutRes = R.layout.message_list_item_in
|
layoutRes = R.layout.message_list_item_in
|
||||||
bubbleColor = themeManager.bubbleColor
|
bubbleColor = themeManager.color
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,17 @@ import android.util.AttributeSet
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.FrameLayout
|
import android.widget.FrameLayout
|
||||||
import com.moez.QKSMS.R
|
import com.moez.QKSMS.R
|
||||||
|
import com.moez.QKSMS.common.di.AppComponentManager
|
||||||
import com.moez.QKSMS.common.util.GlideApp
|
import com.moez.QKSMS.common.util.GlideApp
|
||||||
import com.moez.QKSMS.common.util.extensions.getColorCompat
|
import com.moez.QKSMS.common.util.ThemeManager
|
||||||
import com.moez.QKSMS.data.model.Contact
|
import com.moez.QKSMS.data.model.Contact
|
||||||
import kotlinx.android.synthetic.main.avatar_view.view.*
|
import kotlinx.android.synthetic.main.avatar_view.view.*
|
||||||
|
import javax.inject.Inject
|
||||||
|
|
||||||
class AvatarView(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : FrameLayout(context, attrs, defStyleAttr) {
|
class AvatarView(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : FrameLayout(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
|
@Inject lateinit var themeManager: ThemeManager
|
||||||
|
|
||||||
var contact: Contact? = null
|
var contact: Contact? = null
|
||||||
set(value) {
|
set(value) {
|
||||||
field = value
|
field = value
|
||||||
@@ -25,13 +29,14 @@ class AvatarView(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : Fr
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
View.inflate(context, R.layout.avatar_view, this)
|
View.inflate(context, R.layout.avatar_view, this)
|
||||||
|
AppComponentManager.appComponent.inject(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onFinishInflate() {
|
override fun onFinishInflate() {
|
||||||
super.onFinishInflate()
|
super.onFinishInflate()
|
||||||
setBackgroundResource(R.drawable.circle)
|
setBackgroundResource(R.drawable.circle)
|
||||||
clipToOutline = true
|
clipToOutline = true
|
||||||
backgroundTintList = ColorStateList.valueOf(context.getColorCompat(R.color.bubbleLight))
|
backgroundTintList = ColorStateList.valueOf(themeManager.color)
|
||||||
|
|
||||||
if (!isInEditMode) {
|
if (!isInEditMode) {
|
||||||
updateView()
|
updateView()
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
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="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:background="@color/list_separator"
|
|
||||||
tools:parentTag="com.moez.QKSMS.presentation.view.AvatarView">
|
tools:parentTag="com.moez.QKSMS.presentation.view.AvatarView">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@@ -14,6 +13,7 @@
|
|||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textAllCaps="true"
|
android:textAllCaps="true"
|
||||||
|
android:textColor="@color/textPrimaryLight"
|
||||||
tools:text="M" />
|
tools:text="M" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|||||||
@@ -52,7 +52,9 @@
|
|||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
tools:text="Hey! How's it going?" />
|
android:textColor="@color/textPrimaryLight"
|
||||||
|
tools:backgroundTint="@color/tools_theme"
|
||||||
|
tools:text="@tools:sample/lorem/random" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/status"
|
android:id="@+id/status"
|
||||||
|
|||||||
@@ -44,8 +44,8 @@
|
|||||||
android:paddingEnd="12dp"
|
android:paddingEnd="12dp"
|
||||||
android:paddingStart="12dp"
|
android:paddingStart="12dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:textColor="@color/textPrimaryLight"
|
android:textColor="@color/textPrimary"
|
||||||
tools:backgroundTint="#0BAE9F"
|
tools:backgroundTint="@color/white"
|
||||||
tools:text="Hey! How's it going?" />
|
tools:text="Hey! How's it going?" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
@@ -12,9 +12,12 @@
|
|||||||
|
|
||||||
<color name="bubbleLight">#F4F4F4</color>
|
<color name="bubbleLight">#F4F4F4</color>
|
||||||
|
|
||||||
<color name="backgroundLight">#f8f8f8</color>
|
<color name="backgroundLight">#F2F2F2</color>
|
||||||
<color name="statusLight">#F1F1F1</color>
|
<color name="statusLight">#F1F1F1</color>
|
||||||
|
|
||||||
<color name="list_separator">#F2F2F2</color>
|
<color name="list_separator">#F2F2F2</color>
|
||||||
<color name="row_selected">#F5F5F5</color>
|
<color name="row_selected">#F5F5F5</color>
|
||||||
|
|
||||||
|
<!-- This colour should only ever be used for attrs with the tools tag -->
|
||||||
|
<color name="tools_theme">#008389</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user