Improve chat design

This commit is contained in:
Phillip Thelen 2018-08-09 14:37:53 +02:00
parent 5cd2177c0e
commit 333d08e11c
15 changed files with 560 additions and 163 deletions

View file

@ -125,6 +125,7 @@ dependencies {
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.nex3z:flow-layout:1.2.2'
}

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/brand_700" />
<corners android:radius="@dimen/bar_radius"/>
<padding android:left="0dip" android:top="0dip" android:right="0dip" android:bottom="0dip" />
</shape>

View file

@ -8,7 +8,7 @@
android:paddingRight="@dimen/chat_horizontal_inset"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:background="@color/gray_600">
android:background="@color/gray_700">
<TextView
android:background="@drawable/system_chat_background"
android:id="@+id/text_view"

View file

@ -5,7 +5,7 @@
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="horizontal"
android:background="@color/gray_600"
android:background="@color/gray_700"
android:paddingLeft="@dimen/chat_horizontal_inset"
android:paddingRight="@dimen/chat_horizontal_inset"
android:paddingTop="@dimen/spacing_small"
@ -26,6 +26,7 @@
app:showPet="false" />
</com.habitrpg.android.habitica.ui.RoundedFrameLayout>
<LinearLayout
android:id="@+id/message_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
@ -46,18 +47,6 @@
android:clickable="true"
tools:text="Username"
android:focusable="true" />
<TextView
android:id="@+id/ago_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:lines="1"
android:ellipsize="end"
tools:text="2d ago"
android:textSize="12sp"
android:textColor="@color/gray_300"
android:layout_marginLeft="@dimen/spacing_medium"
android:layout_marginStart="@dimen/spacing_medium"/>
<View
android:layout_width="0dp"
android:layout_height="1dp"
@ -84,6 +73,16 @@
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/ago_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:lines="1"
android:ellipsize="end"
tools:text="2d ago"
android:textSize="12sp"
android:textColor="@color/gray_300"/>
<net.pherth.android.emoji_library.EmojiTextView
android:id="@+id/message_text"
android:layout_width="match_parent"
@ -91,42 +90,50 @@
android:layout_margin="8dp"
android:lineSpacingMultiplier="1.0"
tools:text="This is the chat message"/>
<LinearLayout
<com.nex3z.flowlayout.FlowLayout
android:id="@+id/buttons_wrapper"
android:layout_width="match_parent"
android:layout_height="36dp">
android:layout_height="wrap_content">
<Button
android:id="@+id/reply_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="36dp"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:textSize="12sp"
android:textColor="@color/gray_300"
android:text="@string/reply" />
android:text="@string/reply"
android:gravity="center_vertical"
android:drawablePadding="@dimen/spacing_small"/>
<Button
android:id="@+id/copy_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="36dp"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:textSize="12sp"
android:textColor="@color/gray_300"
android:text="@string/copy" />
android:text="@string/copy"
android:gravity="center_vertical"
android:drawablePadding="@dimen/spacing_small" />
<Button
android:id="@+id/report_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="36dp"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:textSize="12sp"
android:textColor="@color/gray_300"
android:text="@string/report" />
android:text="@string/report"
android:gravity="center_vertical"
android:drawablePadding="@dimen/spacing_small" />
<Button
android:id="@+id/delete_button"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_height="36dp"
style="@style/Base.Widget.AppCompat.Button.Borderless"
android:textSize="12sp"
android:textColor="@color/gray_300"
android:text="@string/delete" />
</LinearLayout>
android:text="@string/delete"
android:gravity="center_vertical"
android:drawablePadding="@dimen/spacing_small"/>
</com.nex3z.flowlayout.FlowLayout>
</LinearLayout>
</LinearLayout>

View file

@ -156,7 +156,7 @@
<string name="new_checklist_item">new checklist item</string>
<string name="add_checklist_item">Add</string>
<string name="reminder_title">Remember to check off your Dailies!</string>
<string name="reminder_title">Remember to check off your tasks!</string>
<string name="skill_progress_title">Using Skill</string>
<string name="coming_soon">Coming Soon</string>
<string name="chat_flag_confirmation">Are you sure you want to report this message for violation?</string>

View file

@ -42,7 +42,7 @@ open class ChatMessage : RealmObject() {
var user: String? = null
var sent: String? = null
var sent: Boolean = false
var groupId: String? = null
@ -57,27 +57,22 @@ open class ChatMessage : RealmObject() {
get() = likes?.size ?: 0
fun getAgoString(res: Resources): String {
val diff = Date().time - timestamp!!
val diff = Date().time - (timestamp ?: 0)
val diffMinutes = diff / (60 * 1000) % 60
val diffHours = diff / (60 * 60 * 1000) % 24
val diffDays = diff / (24 * 60 * 60 * 1000)
if (diffDays != 0L) {
return if (diffDays == 1L) {
return when {
diffDays != 0L -> if (diffDays == 1L) {
res.getString(R.string.ago_1day)
} else res.getString(R.string.ago_days, diffDays)
}
if (diffHours != 0L) {
return if (diffHours == 1L) {
diffHours != 0L -> if (diffHours == 1L) {
res.getString(R.string.ago_1hour)
} else res.getString(R.string.ago_hours, diffHours)
diffMinutes == 1L -> res.getString(R.string.ago_1Minute)
else -> res.getString(R.string.ago_minutes, diffMinutes)
}
return if (diffMinutes == 1L) {
res.getString(R.string.ago_1Minute)
} else res.getString(R.string.ago_minutes, diffMinutes)
}
fun userLikesMessage(userId: String?): Boolean {

View file

@ -79,8 +79,7 @@ public class NotificationPublisher extends WakefulBroadcastReceiver {
Notification notification;
Notification.Builder builder = new Notification.Builder(context);
builder.setContentTitle(context.getString(R.string.app_name));
builder.setContentText(context.getString(R.string.reminder_title));
builder.setContentTitle(context.getString(R.string.reminder_title));
builder.setSmallIcon(R.drawable.ic_gryphon_white);
Intent notificationIntent = new Intent(context, MainActivity.class);

View file

@ -562,7 +562,7 @@ open class MainActivity : BaseActivity(), TutorialView.OnTutorialReaction {
}
@Subscribe
fun openGemPurchaseFragment(cmd: OpenGemPurchaseFragmentCommand?) {
fun openGemPurchaseFragment(event: OpenGemPurchaseFragmentCommand?) {
drawerFragment?.setSelection(NavigationDrawerFragment.SIDEBAR_PURCHASE, true)
}

View file

@ -2,6 +2,7 @@ package com.habitrpg.android.habitica.ui.adapter.social
import android.content.Context
import android.content.res.Resources
import android.graphics.drawable.BitmapDrawable
import android.support.v4.content.ContextCompat
import android.support.v7.widget.RecyclerView
import android.text.method.LinkMovementMethod
@ -11,14 +12,14 @@ import android.widget.Button
import android.widget.LinearLayout
import android.widget.TextView
import com.habitrpg.android.habitica.R
import com.habitrpg.android.habitica.extensions.inflate
import com.habitrpg.android.habitica.extensions.notNull
import com.habitrpg.android.habitica.extensions.*
import com.habitrpg.android.habitica.models.social.ChatMessage
import com.habitrpg.android.habitica.models.user.User
import com.habitrpg.android.habitica.ui.AvatarView
import com.habitrpg.android.habitica.ui.helpers.DataBindingUtils
import com.habitrpg.android.habitica.ui.helpers.MarkdownParser
import com.habitrpg.android.habitica.ui.helpers.bindView
import com.habitrpg.android.habitica.ui.views.HabiticaIconsHelper
import com.habitrpg.android.habitica.ui.views.social.UsernameLabel
import io.reactivex.BackpressureStrategy
import io.reactivex.Flowable
@ -32,7 +33,6 @@ import net.pherth.android.emoji_library.EmojiTextView
class ChatRecyclerViewAdapter(data: OrderedRealmCollection<ChatMessage>?, autoUpdate: Boolean, private val user: User?, private val isTavern: Boolean) : RealmRecyclerViewAdapter<ChatMessage, RecyclerView.ViewHolder>(data, autoUpdate) {
private var uuid: String = ""
private var sendingUser: User? = null
private var expandedMessageId: String? = null
private val likeMessageEvents = PublishSubject.create<ChatMessage>()
@ -46,10 +46,6 @@ class ChatRecyclerViewAdapter(data: OrderedRealmCollection<ChatMessage>?, autoUp
this.uuid = user?.id ?: ""
}
fun setSendingUser(user: User?) {
this.sendingUser = user
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return if (viewType == 0) {
SystemChatMessageViewHolder(parent.inflate(R.layout.system_chat_message))
@ -107,13 +103,14 @@ class ChatRecyclerViewAdapter(data: OrderedRealmCollection<ChatMessage>?, autoUp
inner class ChatRecyclerViewHolder(itemView: View, private val userId: String, private val isTavern: Boolean) : RecyclerView.ViewHolder(itemView) {
private val messageWrapper: ViewGroup by bindView(R.id.message_wrapper)
private val avatarView: AvatarView by bindView(R.id.avatar_view)
private val userLabel: UsernameLabel by bindView(R.id.user_label)
private val messageText: EmojiTextView by bindView(R.id.message_text)
private val agoLabel: TextView by bindView(R.id.ago_label)
private val likeBackground: LinearLayout by bindView(R.id.like_background_layout)
private val tvLikes: TextView by bindView(R.id.tvLikes)
private val buttonsWrapper: LinearLayout by bindView(R.id.buttons_wrapper)
private val buttonsWrapper: ViewGroup by bindView(R.id.buttons_wrapper)
private val replyButton: Button by bindView(R.id.reply_button)
private val copyButton: Button by bindView(R.id.copy_button)
private val reportButton: Button by bindView(R.id.report_button)
@ -134,10 +131,18 @@ class ChatRecyclerViewAdapter(data: OrderedRealmCollection<ChatMessage>?, autoUp
}
tvLikes.setOnClickListener { chatMessage.notNull { likeMessageEvents.onNext(it) } }
userLabel.setOnClickListener { chatMessage?.uuid.notNull {userLabelClickEvents.onNext(it) } }
replyButton.setOnClickListener { chatMessage?.user.notNull { replyMessageEvents.onNext("@$it ") } }
replyButton.setOnClickListener { chatMessage?.user.notNull { replyMessageEvents.onNext(it) } }
replyButton.setCompoundDrawablesWithIntrinsicBounds(BitmapDrawable(res, HabiticaIconsHelper.imageOfChatReplyIcon()),
null, null, null)
copyButton.setOnClickListener { chatMessage.notNull { copyMessageEvents.onNext(it) } }
copyButton.setCompoundDrawablesWithIntrinsicBounds(BitmapDrawable(res, HabiticaIconsHelper.imageOfChatCopyIcon()),
null, null, null)
reportButton.setOnClickListener { chatMessage.notNull { flagMessageEvents.onNext(it) } }
reportButton.setCompoundDrawablesWithIntrinsicBounds(BitmapDrawable(res, HabiticaIconsHelper.imageOfChatReportIcon()),
null, null, null)
deleteButton.setOnClickListener { chatMessage.notNull { deleteMessageEvents.onNext(it) } }
deleteButton.setCompoundDrawablesWithIntrinsicBounds(BitmapDrawable(res, HabiticaIconsHelper.imageOfChatDeleteIcon()),
null, null, null)
}
fun bind(msg: ChatMessage) {
@ -145,19 +150,23 @@ class ChatRecyclerViewAdapter(data: OrderedRealmCollection<ChatMessage>?, autoUp
setLikeProperties()
if (msg.sent != null && msg.sent == "true" && sendingUser != null) {
userLabel.tier = sendingUser?.contributor?.level ?: 0
val name = user?.profile?.name
if (messageWasSent() && user != null) {
userLabel.tier = user.contributor?.level ?: 0
userLabel.username = name
} else {
userLabel.tier = msg.contributor?.level ?: 0
userLabel.username = msg.user
}
if (msg.sent != null && msg.sent == "true") {
userLabel.username = sendingUser?.profile?.name
if (messageWasSent()) {
avatarView.visibility = View.GONE
itemView.setPadding(64.dpToPx(context), itemView.paddingTop, itemView.paddingRight, itemView.paddingBottom)
} else {
if (msg.user != null && msg.user?.isNotEmpty() == true) {
userLabel.username = msg.user
} else {
userLabel.username = context.getString(R.string.system)
avatarView.visibility = View.VISIBLE
itemView.setPadding(16.dpToPx(context), itemView.paddingTop, itemView.paddingRight, itemView.paddingBottom)
msg.userStyles.notNull {
avatarView.setAvatar(it)
}
}
@ -175,21 +184,29 @@ class ChatRecyclerViewAdapter(data: OrderedRealmCollection<ChatMessage>?, autoUp
}
this.messageText.movementMethod = LinkMovementMethod.getInstance()
agoLabel.text = msg.getAgoString(res)
msg.userStyles.notNull {
avatarView.setAvatar(it)
if (name != null && msg.text?.contains(name) == true) {
messageWrapper.backgroundCompat = ContextCompat.getDrawable(context, R.drawable.layout_rounded_bg_brand_700)
} else {
messageWrapper.backgroundCompat = ContextCompat.getDrawable(context, R.drawable.layout_rounded_bg)
}
messageWrapper.setScaledPadding(context, 8, 8, 8, 8)
agoLabel.text = msg.getAgoString(res)
if (expandedMessageId == msg.id) {
buttonsWrapper.visibility = View.VISIBLE
deleteButton.visibility = if (shouldShowDelete()) View.VISIBLE else View.GONE
replyButton.visibility = if (chatMessage?.isInboxMessage == true) View.GONE else View.VISIBLE
reportButton.visibility = if (chatMessage?.uuid == userId) View.GONE else View.VISIBLE
} else {
buttonsWrapper.visibility = View.GONE
}
}
private fun messageWasSent(): Boolean {
return chatMessage?.sent == true || chatMessage?.uuid == userId
}
private fun setLikeProperties() {
likeBackground.visibility = if (isTavern) View.VISIBLE else View.INVISIBLE
tvLikes.text = "+" + chatMessage?.likeCount

View file

@ -27,10 +27,8 @@ import com.habitrpg.android.habitica.ui.activities.MainActivity
import com.habitrpg.android.habitica.ui.adapter.social.ChatRecyclerViewAdapter
import com.habitrpg.android.habitica.ui.fragments.BaseFragment
import com.habitrpg.android.habitica.ui.helpers.SafeDefaultItemAnimator
import com.habitrpg.android.habitica.ui.views.HabiticaSnackbar
import com.habitrpg.android.habitica.ui.views.HabiticaSnackbar.Companion.showSnackbar
import com.habitrpg.android.habitica.ui.views.HabiticaSnackbar.SnackbarDisplayType
import io.reactivex.functions.Action
import io.reactivex.functions.Consumer
import io.realm.RealmResults
import kotlinx.android.synthetic.main.fragment_chat.*
@ -114,7 +112,7 @@ class ChatListFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener {
}, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(it.getDeleteMessageFlowable().subscribe(Consumer { this.showDeleteConfirmationDialog(it) }, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(it.getFlagMessageClickFlowable().subscribe(Consumer { this.showFlagConfirmationDialog(it) }, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(it.getReplyMessageEvents().subscribe(Consumer{ chatEditText.setText(it, TextView.BufferType.EDITABLE) }, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(it.getReplyMessageEvents().subscribe(Consumer{ setReplyTo(it) }, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(it.getCopyMessageFlowable().subscribe(Consumer { this.copyMessageToClipboard(it) }, RxErrorHandler.handleEmptyError()))
compositeSubscription.add(it.getLikeMessageFlowable().flatMap<ChatMessage> { socialRepository.likeMessage(it) }.subscribe(Consumer { }, RxErrorHandler.handleEmptyError()))
}
@ -143,6 +141,13 @@ class ChatListFragment : BaseFragment(), SwipeRefreshLayout.OnRefreshListener {
onRefresh()
}
private fun setReplyTo(username: String?) {
val previousText = chatEditText.text.toString()
if (previousText.contains("@$username")) {
return
}
chatEditText.setText("@$username $previousText", TextView.BufferType.EDITABLE)
}
override fun onRefresh() {
refreshLayout.isRefreshing = true

View file

@ -57,7 +57,6 @@ class InboxMessageListFragment : BaseMainFragment(), SwipeRefreshLayout.OnRefres
recyclerView.layoutManager = layoutManager
chatAdapter = ChatRecyclerViewAdapter(null, true, user, false)
chatAdapter?.setSendingUser(this.user)
recyclerView.adapter = chatAdapter
recyclerView.itemAnimator = SafeDefaultItemAnimator()
chatAdapter.notNull {

View file

@ -78,7 +78,7 @@ class ChallengeDetailFragment: BaseMainFragment() {
super.onViewCreated(view, savedInstanceState)
gemAmountIconView?.setImageBitmap(HabiticaIconsHelper.imageOfGem_36())
memberCountIconView?.setImageBitmap(HabiticaIconsHelper.imageOfParticipantIcon())
memberCountIconView?.setImageBitmap(HabiticaIconsHelper.imageOfParticipantsIcon())
challengeDescription?.movementMethod = LinkMovementMethod.getInstance()
challengeID.notNull {id ->

View file

@ -26,7 +26,7 @@ import java.lang.ref.WeakReference;
/**
* Created by Phillip Thelen on 17. Jul 2018.
* Created by Phillip Thelen on 9. Aug 2018.
* Copyright © 2018 HabitRPG Inc.. All rights reserved.
*
* Generated by PaintCode
@ -88,13 +88,13 @@ public class HabiticaIcons {
Paint paint = CacheForHeart.paint;
// Local Colors
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor2 = Color.argb(255, 255, 97, 101);
int heartDarkBackground = Color.argb(178, 255, 255, 255);
int fillColor4 = Color.argb(89, 181, 36, 40);
int fillColor2 = Color.argb(255, 255, 97, 101);
int heartLightBackground = Color.argb(255, 247, 78, 82);
int fillColor6 = Color.argb(128, 181, 36, 40);
int fillColor3 = Color.argb(128, 255, 255, 255);
int heartLightBackground = Color.argb(255, 247, 78, 82);
int fillColor5 = Color.argb(64, 255, 255, 255);
// Local Variables
int expression = darkBackground ? heartDarkBackground : heartLightBackground;
@ -368,11 +368,11 @@ public class HabiticaIcons {
Paint paint = CacheForExperience.paint;
// Local Colors
int fillColor12 = Color.argb(128, 191, 125, 26);
int fillColor3 = Color.argb(128, 255, 255, 255);
int fillColor11 = Color.argb(64, 191, 125, 26);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor10 = Color.argb(255, 255, 166, 35);
int fillColor12 = Color.argb(128, 191, 125, 26);
// Resize to Target Frame
canvas.save();
@ -599,11 +599,11 @@ public class HabiticaIcons {
Paint paint = CacheForMagic.paint;
// Local Colors
int fillColor3 = Color.argb(128, 255, 255, 255);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor9 = Color.argb(64, 31, 112, 154);
int fillColor8 = Color.argb(255, 80, 181, 233);
int fillColor7 = Color.argb(255, 41, 149, 205);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor3 = Color.argb(128, 255, 255, 255);
// Resize to Target Frame
canvas.save();
@ -1531,14 +1531,14 @@ public class HabiticaIcons {
Paint paint = CacheForWarrior.paint;
// Local Colors
int fillColor23 = Color.argb(255, 229, 65, 77);
int fillColor20 = Color.argb(255, 255, 181, 183);
int fillColor43 = Color.argb(255, 200, 43, 43);
int fillColor21 = Color.argb(255, 255, 182, 184);
int fillColor22 = Color.argb(255, 242, 123, 134);
int fillColor41 = Color.argb(255, 255, 149, 152);
int fillColor = Color.argb(255, 240, 97, 102);
int fillColor42 = Color.argb(255, 255, 149, 152);
int fillColor23 = Color.argb(255, 229, 65, 77);
int fillColor41 = Color.argb(255, 255, 149, 152);
int fillColor22 = Color.argb(255, 242, 123, 134);
int fillColor = Color.argb(255, 240, 97, 102);
int fillColor43 = Color.argb(255, 200, 43, 43);
int fillColor20 = Color.argb(255, 255, 181, 183);
int fillColor21 = Color.argb(255, 255, 182, 184);
// Local Variables
boolean lightBackground = !darkBackground;
@ -2706,8 +2706,8 @@ public class HabiticaIcons {
public static void drawDifficultyStars(Canvas canvas, RectF targetFrame, ResizingBehavior resizing, float difficulty) {
// Local Variables
float _4StarDifficulty = difficulty >= 4f ? 1f : (difficulty >= 3.5f ? 0.5f : 0f);
float _3StarDifficulty = difficulty >= 3f ? 1f : (difficulty >= 2.5f ? 0.5f : 0f);
float _1StarDifficulty = difficulty >= 1f ? 1f : (difficulty >= 0.5f ? 0.5f : 0f);
float _3StarDifficulty = difficulty >= 3f ? 1f : (difficulty >= 2.5f ? 0.5f : 0f);
float _2StarDifficulty = difficulty >= 2f ? 1f : (difficulty >= 1.5f ? 0.5f : 0f);
// Resize to Target Frame
@ -3442,10 +3442,10 @@ public class HabiticaIcons {
Paint paint = CacheForStarMedium.paint;
// Local Colors
int fillColor34 = Color.argb(38, 229, 220, 255);
int fillColor27 = Color.argb(255, 229, 220, 255);
int fillColor33 = Color.argb(77, 229, 220, 255);
int fillColor32 = Color.argb(153, 229, 220, 255);
int fillColor34 = Color.argb(38, 229, 220, 255);
// Resize to Target Frame
canvas.save();
@ -3772,8 +3772,8 @@ public class HabiticaIcons {
Paint paint = CacheForAddRemovePin.paint;
// Local Colors
int fillColor2 = Color.argb(255, 255, 97, 101);
int fillColor36 = Color.argb(255, 97, 51, 180);
int fillColor2 = Color.argb(255, 255, 97, 101);
// Local Variables
int pinColor = addPin ? fillColor36 : fillColor2;
@ -3972,12 +3972,12 @@ public class HabiticaIcons {
Paint paint = CacheForItemIndicator.paint;
// Local Colors
int shadowTint = Color.argb(255, 26, 24, 29);
int fillColor38 = Color.argb(255, 165, 161, 172);
int fillColor39 = Color.argb(255, 189, 168, 255);
int strokeColor = Color.argb(255, 97, 51, 180);
int indicatorLocked = Color.argb(255, 237, 236, 238);
int strokeColor2 = Color.argb(255, 189, 168, 255);
int shadowTint = Color.argb(255, 26, 24, 29);
int strokeColor = Color.argb(255, 97, 51, 180);
int fillColor39 = Color.argb(255, 189, 168, 255);
int indicatorLocked = Color.argb(255, 237, 236, 238);
int fillColor38 = Color.argb(255, 165, 161, 172);
// Local Shadows
PaintCodeShadow shadow = CacheForItemIndicator.shadow.get(PaintCodeColor.colorByChangingAlpha(shadowTint, (int) (Color.alpha(shadowTint) * 0.12f * 255f)), 0f, 1f, 1f);
@ -4362,10 +4362,10 @@ public class HabiticaIcons {
// Local Colors
int fillColor36 = Color.argb(255, 97, 51, 180);
int fillColor47 = Color.argb(255, 198, 182, 228);
int fillColor44 = Color.argb(255, 204, 190, 237);
int fillColor19 = Color.argb(255, 79, 42, 147);
int fillColor46 = Color.argb(255, 122, 84, 192);
int fillColor48 = Color.argb(255, 137, 102, 199);
int fillColor19 = Color.argb(255, 79, 42, 147);
int fillColor44 = Color.argb(255, 204, 190, 237);
int fillColor45 = Color.argb(255, 155, 129, 226);
// Local Variables
@ -5157,18 +5157,18 @@ public class HabiticaIcons {
Paint paint = CacheForHealer.paint;
// Local Colors
int fillColor10 = Color.argb(255, 255, 166, 35);
int fillColor58 = Color.argb(255, 229, 144, 37);
int fillColor49 = Color.argb(255, 255, 215, 168);
int fillColor59 = Color.argb(255, 255, 228, 201);
int fillColor52 = Color.argb(255, 253, 198, 126);
int fillColor57 = Color.argb(255, 255, 221, 181);
int fillColor51 = Color.argb(255, 229, 144, 37);
int fillColor56 = Color.argb(255, 255, 166, 35);
int fillColor54 = Color.argb(255, 207, 130, 41);
int fillColor55 = Color.argb(255, 253, 198, 126);
int fillColor53 = Color.argb(255, 206, 129, 41);
int fillColor58 = Color.argb(255, 229, 144, 37);
int fillColor50 = Color.argb(255, 226, 158, 69);
int fillColor57 = Color.argb(255, 255, 221, 181);
int fillColor49 = Color.argb(255, 255, 215, 168);
int fillColor56 = Color.argb(255, 255, 166, 35);
int fillColor55 = Color.argb(255, 253, 198, 126);
int fillColor54 = Color.argb(255, 207, 130, 41);
int fillColor10 = Color.argb(255, 255, 166, 35);
int fillColor53 = Color.argb(255, 206, 129, 41);
int fillColor52 = Color.argb(255, 253, 198, 126);
// Local Variables
boolean lightBackground = !darkBackground;
@ -5998,13 +5998,13 @@ public class HabiticaIcons {
int fillColor70 = Color.argb(255, 132, 207, 242);
int fillColor62 = Color.argb(255, 83, 180, 229);
int fillColor67 = Color.argb(255, 83, 180, 229);
int fillColor60 = Color.argb(255, 182, 225, 247);
int fillColor64 = Color.argb(255, 77, 178, 214);
int fillColor69 = Color.argb(255, 169, 219, 245);
int fillColor61 = Color.argb(255, 39, 138, 191);
int fillColor66 = Color.argb(255, 107, 196, 233);
int fillColor63 = Color.argb(255, 42, 160, 207);
int fillColor68 = Color.argb(255, 31, 110, 162);
int fillColor60 = Color.argb(255, 182, 225, 247);
// Local Variables
boolean lightBackground = !darkBackground;
@ -6815,10 +6815,10 @@ public class HabiticaIcons {
Paint paint = CacheForAttributeSparklesLeft.paint;
// Local Colors
int fillColor73 = Color.argb(255, 255, 180, 69);
int fillColor72 = Color.argb(255, 255, 97, 101);
int fillColor71 = Color.argb(255, 80, 181, 233);
int fillColor18 = Color.argb(255, 154, 98, 255);
int fillColor71 = Color.argb(255, 80, 181, 233);
int fillColor73 = Color.argb(255, 255, 180, 69);
// Resize to Target Frame
canvas.save();
@ -7193,37 +7193,37 @@ public class HabiticaIcons {
Paint paint = CacheForContributorBadge.paint;
// Local Colors
int fillColor80 = Color.argb(255, 63, 218, 162);
int fillColor78 = Color.argb(255, 255, 148, 76);
int strokeColor3 = Color.argb(255, 253, 124, 127);
int fillColor2 = Color.argb(255, 255, 97, 101);
int strokeColor12 = Color.argb(255, 0, 87, 55);
int strokeColor9 = Color.argb(255, 52, 181, 193);
int strokeColor7 = Color.argb(255, 238, 145, 9);
int strokeColor11 = Color.argb(255, 106, 52, 204);
int strokeColor5 = Color.argb(255, 225, 22, 27);
int strokeColor11 = Color.argb(255, 106, 52, 204);
int fillColor76 = Color.argb(255, 255, 182, 184);
int fillColor81 = Color.argb(255, 94, 221, 233);
int fillColor79 = Color.argb(255, 255, 190, 93);
int fillColor7 = Color.argb(255, 41, 149, 205);
int strokeColor4 = Color.argb(255, 136, 10, 10);
int fillColor83 = Color.argb(255, 119, 244, 199);
int fillColor82 = Color.argb(255, 154, 98, 255);
int fillColor7 = Color.argb(255, 41, 149, 205);
int strokeColor8 = Color.argb(255, 28, 163, 114);
int strokeColor6 = Color.argb(255, 236, 109, 23);
int strokeColor12 = Color.argb(255, 0, 87, 55);
int fillColor77 = Color.argb(255, 201, 43, 43);
int fillColor82 = Color.argb(255, 154, 98, 255);
int strokeColor10 = Color.argb(255, 5, 112, 168);
int fillColor80 = Color.argb(255, 63, 218, 162);
int fillColor78 = Color.argb(255, 255, 148, 76);
int fillColor2 = Color.argb(255, 255, 97, 101);
int fillColor83 = Color.argb(255, 119, 244, 199);
int strokeColor3 = Color.argb(255, 253, 124, 127);
int strokeColor9 = Color.argb(255, 52, 181, 193);
// Local Variables
boolean isTier5 = contributorTier == 5f && !isNPC;
boolean isTier4 = contributorTier == 4f && !isNPC;
boolean isTier7 = contributorTier == 7f && !isNPC;
boolean isTier6 = contributorTier == 6f && !isNPC;
boolean isTier3 = contributorTier == 3f && !isNPC;
boolean isTier7 = contributorTier == 7f && !isNPC;
boolean isTier8 = contributorTier == 8f && !isNPC;
boolean isTier9 = contributorTier == 9f && !isNPC;
boolean isTier2 = contributorTier == 2f && !isNPC;
boolean isTier1 = contributorTier == 1f && !isNPC;
boolean isTier2 = contributorTier == 2f && !isNPC;
boolean isTier3 = contributorTier == 3f && !isNPC;
boolean isTier4 = contributorTier == 4f && !isNPC;
boolean isTier5 = contributorTier == 5f && !isNPC;
// Resize to Target Frame
canvas.save();
@ -7566,8 +7566,8 @@ public class HabiticaIcons {
Paint paint = CacheForChatLikeIcon.paint;
// Local Colors
int fillColor82 = Color.argb(255, 154, 98, 255);
int fillColor25 = Color.argb(255, 225, 224, 227);
int fillColor82 = Color.argb(255, 154, 98, 255);
// Local Variables
int expression2 = wasLiked ? fillColor82 : fillColor25;
@ -8064,18 +8064,18 @@ public class HabiticaIcons {
Paint paint = CacheForDamage.paint;
// Local Colors
int fillColor84 = Color.argb(255, 240, 97, 102);
int fillColor35 = Color.argb(255, 195, 192, 199);
int fillColor85 = Color.argb(255, 237, 236, 238);
int fillColor40 = Color.argb(255, 165, 161, 172);
int fillColor75 = Color.argb(255, 135, 129, 144);
int fillColor86 = Color.argb(255, 213, 200, 255);
int fillColor90 = Color.argb(179, 78, 74, 87);
int fillColor87 = Color.argb(255, 189, 168, 255);
int fillColor37 = Color.argb(255, 255, 255, 255);
int fillColor88 = Color.argb(255, 179, 98, 19);
int fillColor89 = Color.argb(255, 227, 143, 61);
int fillColor88 = Color.argb(255, 179, 98, 19);
int fillColor40 = Color.argb(255, 165, 161, 172);
int fillColor87 = Color.argb(255, 189, 168, 255);
int fillColor35 = Color.argb(255, 195, 192, 199);
int fillColor86 = Color.argb(255, 213, 200, 255);
int fillColor85 = Color.argb(255, 237, 236, 238);
int fillColor25 = Color.argb(255, 225, 224, 227);
int fillColor75 = Color.argb(255, 135, 129, 144);
int fillColor84 = Color.argb(255, 240, 97, 102);
// Resize to Target Frame
canvas.save();
@ -8648,10 +8648,10 @@ public class HabiticaIcons {
Paint paint = CacheForRageStrikeInactive.paint;
// Local Colors
int textForeground = Color.argb(255, 183, 90, 28);
int fillColor91 = Color.argb(255, 255, 200, 167);
int strokeColor14 = Color.argb(255, 255, 148, 76);
int strokeColor13 = Color.argb(255, 244, 120, 37);
int textForeground = Color.argb(255, 183, 90, 28);
// Resize to Target Frame
canvas.save();
@ -8953,13 +8953,13 @@ public class HabiticaIcons {
Paint paint = CacheForRage.paint;
// Local Colors
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor15 = Color.argb(89, 27, 153, 107);
int fillColor92 = Color.argb(255, 90, 228, 178);
int fillColor94 = Color.argb(89, 180, 89, 27);
int fillColor93 = Color.argb(255, 244, 120, 37);
int fillColor14 = Color.argb(255, 36, 204, 143);
int fillColor3 = Color.argb(128, 255, 255, 255);
int fillColor93 = Color.argb(255, 244, 120, 37);
int fillColor92 = Color.argb(255, 90, 228, 178);
int fillColor5 = Color.argb(64, 255, 255, 255);
int fillColor94 = Color.argb(89, 180, 89, 27);
// Resize to Target Frame
canvas.save();
@ -9267,9 +9267,9 @@ public class HabiticaIcons {
public static void drawTaskDifficultyStars(Canvas canvas, RectF targetFrame, ResizingBehavior resizing, int taskTintColor, float difficulty, boolean isActive) {
// Local Variables
boolean isEasy = difficulty == 1f;
boolean isHard = difficulty == 2f;
boolean isMedium = difficulty == 1.5f;
boolean isEasy = difficulty == 1f;
boolean isTrivial = difficulty == 0.1f;
// Resize to Target Frame
@ -9420,12 +9420,12 @@ public class HabiticaIcons {
Paint paint = CacheForTaskFormDifficultyStar.paint;
// Local Colors
int strokeColor15 = Color.argb(255, 195, 192, 199);
int transparent = Color.argb(0, 204, 82, 82);
int strokeColor15 = Color.argb(255, 195, 192, 199);
// Local Variables
int starFillColor = isActive ? taskTintColor : transparent;
int borderColor = isActive ? taskTintColor : strokeColor15;
int starFillColor = isActive ? taskTintColor : transparent;
// Resize to Target Frame
canvas.save();
@ -9489,13 +9489,13 @@ public class HabiticaIcons {
// Local Colors
int fillColor37 = Color.argb(255, 255, 255, 255);
int strokeColor15 = Color.argb(255, 195, 192, 199);
int transparent = Color.argb(0, 204, 82, 82);
int strokeColor15 = Color.argb(255, 195, 192, 199);
// Local Variables
int controlFillColor = isActive ? fillColor37 : strokeColor15;
int starFillColor = isActive ? taskTintColor : transparent;
int borderColor = isActive ? taskTintColor : strokeColor15;
int controlFillColor = isActive ? fillColor37 : strokeColor15;
// Resize to Target Frame
canvas.save();
@ -9577,13 +9577,13 @@ public class HabiticaIcons {
// Local Colors
int fillColor37 = Color.argb(255, 255, 255, 255);
int strokeColor15 = Color.argb(255, 195, 192, 199);
int transparent = Color.argb(0, 204, 82, 82);
int strokeColor15 = Color.argb(255, 195, 192, 199);
// Local Variables
int controlFillColor = isActive ? fillColor37 : strokeColor15;
int starFillColor = isActive ? taskTintColor : transparent;
int borderColor = isActive ? taskTintColor : strokeColor15;
int controlFillColor = isActive ? fillColor37 : strokeColor15;
// Resize to Target Frame
canvas.save();
@ -9839,10 +9839,6 @@ public class HabiticaIcons {
Paint paint = CacheForGuildCrest.paint;
// Local Colors
int crestGold2 = Color.argb(255, 255, 210, 145);
int crestBronze6 = Color.argb(255, 179, 98, 19);
int crestGold1 = Color.argb(255, 255, 188, 90);
int crestBronze5 = Color.argb(255, 179, 98, 19);
int crestSilver2 = Color.argb(255, 217, 217, 217);
int crestBronze4 = Color.argb(255, 215, 122, 32);
int crestSilver5 = Color.argb(255, 141, 141, 141);
@ -9852,20 +9848,24 @@ public class HabiticaIcons {
int crestBronze2 = Color.argb(255, 244, 165, 89);
int crestGold6 = Color.argb(255, 223, 145, 30);
int crestSilver4 = Color.argb(255, 175, 175, 175);
int crestBronze1 = Color.argb(255, 234, 140, 49);
int crestGold4 = Color.argb(255, 255, 166, 35);
int crestSilver3 = Color.argb(255, 141, 141, 141);
int crestBronze1 = Color.argb(255, 234, 140, 49);
int crestGold3 = Color.argb(255, 223, 145, 30);
int crestSilver1 = Color.argb(255, 194, 194, 194);
int crestBronze6 = Color.argb(255, 179, 98, 19);
int crestGold2 = Color.argb(255, 255, 210, 145);
int crestGold1 = Color.argb(255, 255, 188, 90);
int crestBronze5 = Color.argb(255, 179, 98, 19);
// Local Variables
boolean isPrivate = !isPublic;
int crestColor1 = memberCount < 100f ? crestBronze1 : (memberCount < 1000f ? crestSilver1 : crestGold1);
int crestColor6 = memberCount < 100f ? crestBronze6 : (memberCount < 1000f ? crestSilver6 : crestGold6);
int crestColor3 = memberCount < 100f ? crestBronze3 : (memberCount < 1000f ? crestSilver3 : crestGold3);
int crestColor4 = memberCount < 100f ? crestBronze4 : (memberCount < 1000f ? crestSilver4 : crestGold4);
int crestColor2 = memberCount < 100f ? crestBronze2 : (memberCount < 1000f ? crestSilver2 : crestGold2);
int crestColor5 = memberCount < 100f ? crestBronze5 : (memberCount < 1000f ? crestSilver5 : crestGold5);
int crestColor4 = memberCount < 100f ? crestBronze4 : (memberCount < 1000f ? crestSilver4 : crestGold4);
int crestColor3 = memberCount < 100f ? crestBronze3 : (memberCount < 1000f ? crestSilver3 : crestGold3);
int crestColor1 = memberCount < 100f ? crestBronze1 : (memberCount < 1000f ? crestSilver1 : crestGold1);
int crestColor2 = memberCount < 100f ? crestBronze2 : (memberCount < 1000f ? crestSilver2 : crestGold2);
// Resize to Target Frame
canvas.save();
@ -10367,9 +10367,6 @@ public class HabiticaIcons {
Paint paint = CacheForGuildCrestMedium.paint;
// Local Colors
int crestGold2 = Color.argb(255, 255, 210, 145);
int crestBronze6 = Color.argb(255, 179, 98, 19);
int crestGold1 = Color.argb(255, 255, 188, 90);
int crestSilver2 = Color.argb(255, 217, 217, 217);
int crestBronze4 = Color.argb(255, 215, 122, 32);
int crestBronze3 = Color.argb(255, 179, 98, 19);
@ -10377,18 +10374,21 @@ public class HabiticaIcons {
int crestBronze2 = Color.argb(255, 244, 165, 89);
int crestGold6 = Color.argb(255, 223, 145, 30);
int crestSilver4 = Color.argb(255, 175, 175, 175);
int crestBronze1 = Color.argb(255, 234, 140, 49);
int crestGold4 = Color.argb(255, 255, 166, 35);
int crestSilver3 = Color.argb(255, 141, 141, 141);
int crestBronze1 = Color.argb(255, 234, 140, 49);
int crestGold3 = Color.argb(255, 223, 145, 30);
int crestSilver1 = Color.argb(255, 194, 194, 194);
int crestBronze6 = Color.argb(255, 179, 98, 19);
int crestGold2 = Color.argb(255, 255, 210, 145);
int crestGold1 = Color.argb(255, 255, 188, 90);
// Local Variables
int crestColor3 = memberCount < 100f ? crestBronze3 : (memberCount < 1000f ? crestSilver3 : crestGold3);
int crestColor4 = memberCount < 100f ? crestBronze4 : (memberCount < 1000f ? crestSilver4 : crestGold4);
int crestColor6 = memberCount < 100f ? crestBronze6 : (memberCount < 1000f ? crestSilver6 : crestGold6);
int crestColor1 = memberCount < 100f ? crestBronze1 : (memberCount < 1000f ? crestSilver1 : crestGold1);
int crestColor4 = memberCount < 100f ? crestBronze4 : (memberCount < 1000f ? crestSilver4 : crestGold4);
int crestColor2 = memberCount < 100f ? crestBronze2 : (memberCount < 1000f ? crestSilver2 : crestGold2);
int crestColor3 = memberCount < 100f ? crestBronze3 : (memberCount < 1000f ? crestSilver3 : crestGold3);
// Resize to Target Frame
canvas.save();
@ -10568,10 +10568,10 @@ public class HabiticaIcons {
Paint paint = CacheForGuildCrestSmall.paint;
// Local Colors
int fillColor37 = Color.argb(255, 255, 255, 255);
int crestGold4 = Color.argb(255, 255, 166, 35);
int crestSilver4 = Color.argb(255, 175, 175, 175);
int crestBronze4 = Color.argb(255, 215, 122, 32);
int fillColor37 = Color.argb(255, 255, 255, 255);
// Local Variables
int crestColor4 = memberCount < 100f ? crestBronze4 : (memberCount < 1000f ? crestSilver4 : crestGold4);
@ -10684,12 +10684,12 @@ public class HabiticaIcons {
// Local Colors
int guildHeaderDark2 = PaintCodeColor.colorByChangingValue(guildHeader, 0.7f);
int guildHeaderDark6 = PaintCodeColor.colorByApplyingHighlight(guildHeaderDark2, 0.3f);
int guildHeaderDark8 = PaintCodeColor.colorByApplyingHighlight(guildHeaderDark2, 0.4f);
int guildHeaderDark7 = PaintCodeColor.colorByChangingValue(guildHeaderDark8, 1f);
int guildHeaderDark6 = PaintCodeColor.colorByApplyingHighlight(guildHeaderDark2, 0.3f);
int guildHeaderDark3 = PaintCodeColor.colorByChangingValue(guildHeader, 1f);
int guildHeaderDark5 = PaintCodeColor.colorByApplyingHighlight(guildHeaderDark3, 0.7f);
int guildHeaderDark4 = PaintCodeColor.colorByApplyingHighlight(guildHeaderDark3, 0.15f);
int guildHeaderDark5 = PaintCodeColor.colorByApplyingHighlight(guildHeaderDark3, 0.7f);
int textForeground2 = Color.argb(255, 255, 255, 255);
// Resize to Target Frame
@ -11628,9 +11628,9 @@ public class HabiticaIcons {
int strokeColor19 = Color.argb(255, 154, 98, 255);
// Local Variables
float filterNode1Position = 3f + 10f * percentage;
float filterNode2Position = 13f - 10f * percentage;
float filterNode3Position = 3f + 5f * percentage;
float filterNode2Position = 13f - 10f * percentage;
float filterNode1Position = 3f + 10f * percentage;
// Resize to Target Frame
canvas.save();
@ -11896,8 +11896,8 @@ public class HabiticaIcons {
Paint paint = CacheForBuffIcon.paint;
// Local Colors
int fillColor85 = Color.argb(255, 237, 236, 238);
int fillColor18 = Color.argb(255, 154, 98, 255);
int fillColor85 = Color.argb(255, 237, 236, 238);
// Resize to Target Frame
canvas.save();
@ -11977,9 +11977,9 @@ public class HabiticaIcons {
Paint paint = CacheForParticipantsIcon.paint;
// Local Colors
int fillColor39 = Color.argb(255, 189, 168, 255);
int fillColor25 = Color.argb(255, 225, 224, 227);
int fillColor104 = Color.argb(255, 249, 249, 249);
int fillColor39 = Color.argb(255, 189, 168, 255);
// Resize to Target Frame
canvas.save();
@ -12106,6 +12106,317 @@ public class HabiticaIcons {
canvas.restore();
}
private static class CacheForChatReplyIcon {
private static Paint paint = new Paint();
private static RectF originalFrame = new RectF(0f, 0f, 17f, 17f);
private static RectF resizedFrame = new RectF();
private static RectF group = new RectF();
private static Path clipPath = new Path();
private static RectF bezierRect = new RectF();
private static Path bezierPath = new Path();
}
public static void drawChatReplyIcon(Canvas canvas) {
HabiticaIcons.drawChatReplyIcon(canvas, new RectF(0f, 0f, 17f, 17f), ResizingBehavior.AspectFit);
}
public static void drawChatReplyIcon(Canvas canvas, RectF targetFrame, ResizingBehavior resizing) {
// General Declarations
Paint paint = CacheForChatReplyIcon.paint;
// Local Colors
int strokeColor15 = Color.argb(255, 195, 192, 199);
// Resize to Target Frame
canvas.save();
RectF resizedFrame = CacheForChatReplyIcon.resizedFrame;
HabiticaIcons.resizingBehaviorApply(resizing, CacheForChatReplyIcon.originalFrame, targetFrame, resizedFrame);
canvas.translate(resizedFrame.left, resizedFrame.top);
canvas.scale(resizedFrame.width() / 17f, resizedFrame.height() / 17f);
// Group
{
RectF group = CacheForChatReplyIcon.group;
group.set(-10f, -9f, 27f, 26f);
canvas.save();
// Clip
Path clipPath = CacheForChatReplyIcon.clipPath;
clipPath.reset();
clipPath.moveTo(-10f, -9f);
clipPath.lineTo(27f, -9f);
clipPath.lineTo(27f, 26f);
clipPath.lineTo(-10f, 26f);
clipPath.lineTo(-10f, -9f);
clipPath.close();
clipPath.moveTo(6.54f, 3f);
clipPath.lineTo(2f, 7.58f);
clipPath.lineTo(6.54f, 12.16f);
clipPath.lineTo(6.54f, 8.72f);
clipPath.cubicTo(11.46f, 8.24f, 14.24f, 10f, 14.9f, 14f);
clipPath.cubicTo(15.57f, 8.67f, 12.78f, 6.15f, 6.54f, 6.44f);
clipPath.lineTo(6.54f, 3f);
clipPath.close();
canvas.clipPath(clipPath);
// Bezier
RectF bezierRect = CacheForChatReplyIcon.bezierRect;
bezierRect.set(2f, 3f, 15f, 14f);
Path bezierPath = CacheForChatReplyIcon.bezierPath;
bezierPath.reset();
bezierPath.moveTo(6.54f, 3f);
bezierPath.lineTo(2f, 7.58f);
bezierPath.lineTo(6.54f, 12.16f);
bezierPath.lineTo(6.54f, 8.72f);
bezierPath.cubicTo(11.46f, 8.24f, 14.24f, 10f, 14.9f, 14f);
bezierPath.cubicTo(15.57f, 8.67f, 12.78f, 6.15f, 6.54f, 6.44f);
bezierPath.lineTo(6.54f, 3f);
bezierPath.close();
paint.reset();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
paint.setStrokeWidth(4f);
paint.setStrokeJoin(Paint.Join.ROUND);
paint.setStrokeMiter(10f);
canvas.save();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(strokeColor15);
canvas.drawPath(bezierPath, paint);
canvas.restore();
canvas.restore();
}
canvas.restore();
}
private static class CacheForChatCopyIcon {
private static Paint paint = new Paint();
private static RectF originalFrame = new RectF(0f, 0f, 17f, 17f);
private static RectF resizedFrame = new RectF();
private static RectF bezierRect = new RectF();
private static Path bezierPath = new Path();
}
public static void drawChatCopyIcon(Canvas canvas) {
HabiticaIcons.drawChatCopyIcon(canvas, new RectF(0f, 0f, 17f, 17f), ResizingBehavior.AspectFit);
}
public static void drawChatCopyIcon(Canvas canvas, RectF targetFrame, ResizingBehavior resizing) {
// General Declarations
Paint paint = CacheForChatCopyIcon.paint;
// Local Colors
int fillColor35 = Color.argb(255, 195, 192, 199);
// Resize to Target Frame
canvas.save();
RectF resizedFrame = CacheForChatCopyIcon.resizedFrame;
HabiticaIcons.resizingBehaviorApply(resizing, CacheForChatCopyIcon.originalFrame, targetFrame, resizedFrame);
canvas.translate(resizedFrame.left, resizedFrame.top);
canvas.scale(resizedFrame.width() / 17f, resizedFrame.height() / 17f);
// Bezier
RectF bezierRect = CacheForChatCopyIcon.bezierRect;
bezierRect.set(0f, 1f, 16f, 17f);
Path bezierPath = CacheForChatCopyIcon.bezierPath;
bezierPath.reset();
bezierPath.moveTo(6f, 15f);
bezierPath.lineTo(14f, 15f);
bezierPath.lineTo(14f, 5f);
bezierPath.lineTo(6f, 5f);
bezierPath.lineTo(6f, 15f);
bezierPath.close();
bezierPath.moveTo(2f, 13f);
bezierPath.lineTo(2f, 3f);
bezierPath.lineTo(6f, 3f);
bezierPath.cubicTo(4.89f, 3f, 4f, 3.9f, 4f, 5f);
bezierPath.lineTo(4f, 13f);
bezierPath.lineTo(2f, 13f);
bezierPath.close();
bezierPath.moveTo(14f, 3f);
bezierPath.lineTo(12f, 3f);
bezierPath.cubicTo(12f, 1.9f, 11.11f, 1f, 10f, 1f);
bezierPath.lineTo(2f, 1f);
bezierPath.cubicTo(0.9f, 1f, 0f, 1.9f, 0f, 3f);
bezierPath.lineTo(0f, 13f);
bezierPath.cubicTo(0f, 14.11f, 0.9f, 15f, 2f, 15f);
bezierPath.lineTo(4f, 15f);
bezierPath.cubicTo(4f, 16.11f, 4.89f, 17f, 6f, 17f);
bezierPath.lineTo(14f, 17f);
bezierPath.cubicTo(15.11f, 17f, 16f, 16.11f, 16f, 15f);
bezierPath.lineTo(16f, 5f);
bezierPath.cubicTo(16f, 3.9f, 15.11f, 3f, 14f, 3f);
bezierPath.lineTo(14f, 3f);
bezierPath.close();
paint.reset();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
bezierPath.setFillType(Path.FillType.EVEN_ODD);
paint.setStyle(Paint.Style.FILL);
paint.setColor(fillColor35);
canvas.drawPath(bezierPath, paint);
canvas.restore();
}
private static class CacheForChatReportIcon {
private static Paint paint = new Paint();
private static RectF originalFrame = new RectF(0f, 0f, 17f, 18f);
private static RectF resizedFrame = new RectF();
private static RectF bezierRect = new RectF();
private static Path bezierPath = new Path();
}
public static void drawChatReportIcon(Canvas canvas) {
HabiticaIcons.drawChatReportIcon(canvas, new RectF(0f, 0f, 17f, 18f), ResizingBehavior.AspectFit);
}
public static void drawChatReportIcon(Canvas canvas, RectF targetFrame, ResizingBehavior resizing) {
// General Declarations
Paint paint = CacheForChatReportIcon.paint;
// Local Colors
int fillColor35 = Color.argb(255, 195, 192, 199);
// Resize to Target Frame
canvas.save();
RectF resizedFrame = CacheForChatReportIcon.resizedFrame;
HabiticaIcons.resizingBehaviorApply(resizing, CacheForChatReportIcon.originalFrame, targetFrame, resizedFrame);
canvas.translate(resizedFrame.left, resizedFrame.top);
canvas.scale(resizedFrame.width() / 17f, resizedFrame.height() / 18f);
// Bezier
RectF bezierRect = CacheForChatReportIcon.bezierRect;
bezierRect.set(0f, 1f, 16f, 17f);
Path bezierPath = CacheForChatReportIcon.bezierPath;
bezierPath.reset();
bezierPath.moveTo(6f, 13f);
bezierPath.lineTo(14f, 13f);
bezierPath.lineTo(14f, 7f);
bezierPath.lineTo(6f, 7f);
bezierPath.lineTo(6f, 13f);
bezierPath.close();
bezierPath.moveTo(4f, 10f);
bezierPath.lineTo(2f, 10f);
bezierPath.lineTo(2f, 4f);
bezierPath.lineTo(9f, 4f);
bezierPath.lineTo(9f, 5f);
bezierPath.lineTo(6f, 5f);
bezierPath.cubicTo(4.89f, 5f, 4f, 5.9f, 4f, 7f);
bezierPath.lineTo(4f, 10f);
bezierPath.close();
bezierPath.moveTo(14f, 5f);
bezierPath.lineTo(11f, 5f);
bezierPath.lineTo(11f, 4f);
bezierPath.cubicTo(11f, 2.9f, 10.11f, 2f, 9f, 2f);
bezierPath.lineTo(2f, 2f);
bezierPath.cubicTo(2f, 1.45f, 1.55f, 1f, 1f, 1f);
bezierPath.cubicTo(0.45f, 1f, 0f, 1.45f, 0f, 2f);
bezierPath.lineTo(0f, 4f);
bezierPath.lineTo(0f, 17f);
bezierPath.lineTo(2f, 17f);
bezierPath.lineTo(2f, 12f);
bezierPath.lineTo(4f, 12f);
bezierPath.lineTo(4f, 13f);
bezierPath.cubicTo(4f, 14.11f, 4.89f, 15f, 6f, 15f);
bezierPath.lineTo(14f, 15f);
bezierPath.cubicTo(15.11f, 15f, 16f, 14.11f, 16f, 13f);
bezierPath.lineTo(16f, 7f);
bezierPath.cubicTo(16f, 5.9f, 15.11f, 5f, 14f, 5f);
bezierPath.lineTo(14f, 5f);
bezierPath.close();
paint.reset();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
bezierPath.setFillType(Path.FillType.EVEN_ODD);
paint.setStyle(Paint.Style.FILL);
paint.setColor(fillColor35);
canvas.drawPath(bezierPath, paint);
canvas.restore();
}
private static class CacheForChatDeleteIcon {
private static Paint paint = new Paint();
private static RectF originalFrame = new RectF(0f, 0f, 17f, 17f);
private static RectF resizedFrame = new RectF();
private static RectF bezierRect = new RectF();
private static Path bezierPath = new Path();
}
public static void drawChatDeleteIcon(Canvas canvas) {
HabiticaIcons.drawChatDeleteIcon(canvas, new RectF(0f, 0f, 17f, 17f), ResizingBehavior.AspectFit);
}
public static void drawChatDeleteIcon(Canvas canvas, RectF targetFrame, ResizingBehavior resizing) {
// General Declarations
Paint paint = CacheForChatDeleteIcon.paint;
// Local Colors
int fillColor35 = Color.argb(255, 195, 192, 199);
// Resize to Target Frame
canvas.save();
RectF resizedFrame = CacheForChatDeleteIcon.resizedFrame;
HabiticaIcons.resizingBehaviorApply(resizing, CacheForChatDeleteIcon.originalFrame, targetFrame, resizedFrame);
canvas.translate(resizedFrame.left, resizedFrame.top);
canvas.scale(resizedFrame.width() / 17f, resizedFrame.height() / 17f);
// Bezier
RectF bezierRect = CacheForChatDeleteIcon.bezierRect;
bezierRect.set(1f, 1f, 15f, 17f);
Path bezierPath = CacheForChatDeleteIcon.bezierPath;
bezierPath.reset();
bezierPath.moveTo(4f, 15f);
bezierPath.lineTo(12f, 15f);
bezierPath.lineTo(12f, 5f);
bezierPath.lineTo(4f, 5f);
bezierPath.lineTo(4f, 15f);
bezierPath.close();
bezierPath.moveTo(15f, 5f);
bezierPath.lineTo(14f, 5f);
bezierPath.lineTo(14f, 15f);
bezierPath.cubicTo(14f, 16.11f, 13.11f, 17f, 12f, 17f);
bezierPath.lineTo(4f, 17f);
bezierPath.cubicTo(2.9f, 17f, 2f, 16.11f, 2f, 15f);
bezierPath.lineTo(2f, 5f);
bezierPath.lineTo(1f, 5f);
bezierPath.lineTo(1f, 3f);
bezierPath.lineTo(2f, 3f);
bezierPath.lineTo(5f, 3f);
bezierPath.lineTo(5f, 2f);
bezierPath.cubicTo(5f, 1.45f, 5.45f, 1f, 6f, 1f);
bezierPath.lineTo(10f, 1f);
bezierPath.cubicTo(10.55f, 1f, 11f, 1.45f, 11f, 2f);
bezierPath.lineTo(11f, 3f);
bezierPath.lineTo(14f, 3f);
bezierPath.lineTo(15f, 3f);
bezierPath.lineTo(15f, 5f);
bezierPath.close();
bezierPath.moveTo(9f, 13f);
bezierPath.lineTo(10f, 13f);
bezierPath.lineTo(10f, 7f);
bezierPath.lineTo(9f, 7f);
bezierPath.lineTo(9f, 13f);
bezierPath.close();
bezierPath.moveTo(6f, 13f);
bezierPath.lineTo(7f, 13f);
bezierPath.lineTo(7f, 7f);
bezierPath.lineTo(6f, 7f);
bezierPath.lineTo(6f, 13f);
bezierPath.close();
paint.reset();
paint.setFlags(Paint.ANTI_ALIAS_FLAG);
bezierPath.setFillType(Path.FillType.EVEN_ODD);
paint.setStyle(Paint.Style.FILL);
paint.setColor(fillColor35);
canvas.drawPath(bezierPath, paint);
canvas.restore();
}
// Canvas Images
// Tab
@ -12918,6 +13229,7 @@ class PaintCodeDashPathEffect {
}
}
class PaintCodeStaticLayout {
private StaticLayout layout;
private int width;

View file

@ -589,7 +589,7 @@ public class HabiticaIconsHelper {
}
private static Bitmap imageOfParticipantsIcon = null;
public static Bitmap imageOfParticipantIcon() {
public static Bitmap imageOfParticipantsIcon() {
if (imageOfParticipantsIcon != null)
return imageOfParticipantsIcon;
@ -601,4 +601,60 @@ public class HabiticaIconsHelper {
return imageOfParticipantsIcon;
}
private static Bitmap imageOfChatReplyIcon = null;
public static Bitmap imageOfChatReplyIcon() {
if (imageOfChatReplyIcon != null)
return imageOfChatReplyIcon;
int size = scaleSize(17);
imageOfChatReplyIcon = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(imageOfChatReplyIcon);
canvas.scale(displayDensity, displayDensity);
HabiticaIcons.drawChatReplyIcon(canvas);
return imageOfChatReplyIcon;
}
private static Bitmap imageOfChatCopyIcon = null;
public static Bitmap imageOfChatCopyIcon() {
if (imageOfChatCopyIcon != null)
return imageOfChatCopyIcon;
int size = scaleSize(17);
imageOfChatCopyIcon = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(imageOfChatCopyIcon);
canvas.scale(displayDensity, displayDensity);
HabiticaIcons.drawChatCopyIcon(canvas);
return imageOfChatCopyIcon;
}
private static Bitmap imageOfChatReportIcon = null;
public static Bitmap imageOfChatReportIcon() {
if (imageOfChatReportIcon != null)
return imageOfChatReportIcon;
int size = scaleSize(17);
imageOfChatReportIcon = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(imageOfChatReportIcon);
canvas.scale(displayDensity, displayDensity);
HabiticaIcons.drawChatReportIcon(canvas);
return imageOfChatReportIcon;
}
private static Bitmap imageOfChatDeleteIcon = null;
public static Bitmap imageOfChatDeleteIcon() {
if (imageOfChatDeleteIcon != null)
return imageOfChatDeleteIcon;
int size = scaleSize(17);
imageOfChatDeleteIcon = Bitmap.createBitmap(size, size, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(imageOfChatDeleteIcon);
canvas.scale(displayDensity, displayDensity);
HabiticaIcons.drawChatDeleteIcon(canvas);
return imageOfChatDeleteIcon;
}
}

View file

@ -62,7 +62,7 @@ class ChatMessageDeserializer : JsonDeserializer<ChatMessage> {
}
if (obj.has("sent")) {
message.sent = obj.get("sent").asString
message.sent = obj.get("sent").asBoolean
}
if (obj.has("userStyles")) {