Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions apps/flipcash/core/src/main/res/drawable/ic_existing_contact.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M9.999,1.667C7.928,1.667 6.249,3.346 6.249,5.417C6.249,7.488 7.928,9.167 9.999,9.167C12.071,9.167 13.749,7.488 13.749,5.417C13.749,3.346 12.071,1.667 9.999,1.667Z"
android:fillColor="#ffffff" />
<path
android:pathData="M14.716,12.246L13.587,14.128L11.917,12.875L9.667,15.875L11.833,17.5H3.063L3.128,16.817C3.418,13.731 5.479,11.175 8.557,10.557C8.687,10.531 8.818,10.509 8.95,10.49L9.007,10.482L9.01,10.482L9.064,10.475C9.243,10.452 9.425,10.436 9.609,10.427C9.694,10.422 9.78,10.419 9.866,10.418C9.91,10.417 9.955,10.417 10,10.417C10.04,10.417 10.08,10.417 10.119,10.418L10.134,10.418L11.887,10.662C11.93,10.674 11.973,10.686 12.015,10.698C13.061,11.002 13.972,11.539 14.716,12.246Z"
android:fillColor="#ffffff" />
<path
android:pathData="M10.134,10.418C10.406,10.422 10.674,10.442 10.936,10.475L10.945,10.476C11.018,10.485 11.09,10.495 11.162,10.507C11.209,10.514 11.255,10.522 11.302,10.531L11.321,10.534C11.374,10.544 11.427,10.554 11.479,10.565L11.52,10.573C11.623,10.595 11.724,10.619 11.824,10.645L10.134,10.418Z"
android:fillColor="#ffffff" />
<path
android:pathData="M14.304,17.791L17.733,12.077L16.66,11.434L13.946,15.959L12.167,14.625L11.417,15.625L14.304,17.791Z"
android:fillColor="#ffffff" />
</vector>
51 changes: 51 additions & 0 deletions apps/flipcash/core/src/main/res/drawable/ic_unknown_contact.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="20"
android:viewportHeight="20">
<path
android:pathData="M9.999,8.75C9.999,8.98 9.812,9.169 9.583,9.144C7.708,8.937 6.249,7.347 6.249,5.417C6.249,3.486 7.708,1.897 9.583,1.69C9.812,1.665 9.999,1.854 9.999,2.084V8.75Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M9.999,17.084C9.999,17.314 9.812,17.5 9.582,17.5H3.687C3.342,17.5 3.059,17.22 3.088,16.876C3.368,13.513 5.891,10.631 9.582,10.428C9.812,10.416 9.999,10.604 9.999,10.834V17.084Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M11.668,3.458C12.082,3.458 12.418,3.122 12.418,2.708C12.418,2.294 12.082,1.958 11.668,1.958C11.254,1.958 10.918,2.294 10.918,2.708C10.918,3.122 11.254,3.458 11.668,3.458Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M11.668,6.166C12.082,6.166 12.418,5.83 12.418,5.416C12.418,5.002 12.082,4.666 11.668,4.666C11.254,4.666 10.918,5.002 10.918,5.416C10.918,5.83 11.254,6.166 11.668,6.166Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M14.167,4.792C14.512,4.792 14.792,4.512 14.792,4.167C14.792,3.822 14.512,3.542 14.167,3.542C13.821,3.542 13.542,3.822 13.542,4.167C13.542,4.512 13.821,4.792 14.167,4.792Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M14.167,7.292C14.512,7.292 14.792,7.012 14.792,6.667C14.792,6.322 14.512,6.042 14.167,6.042C13.821,6.042 13.542,6.322 13.542,6.667C13.542,7.012 13.821,7.292 14.167,7.292Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M11.668,8.875C12.082,8.875 12.418,8.539 12.418,8.125C12.418,7.711 12.082,7.375 11.668,7.375C11.254,7.375 10.918,7.711 10.918,8.125C10.918,8.539 11.254,8.875 11.668,8.875Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M11.668,11.583C12.082,11.583 12.418,11.247 12.418,10.833C12.418,10.419 12.082,10.083 11.668,10.083C11.254,10.083 10.918,10.419 10.918,10.833C10.918,11.247 11.254,11.583 11.668,11.583Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M14.167,11.458C14.512,11.458 14.792,11.178 14.792,10.833C14.792,10.488 14.512,10.208 14.167,10.208C13.821,10.208 13.542,10.488 13.542,10.833C13.542,11.178 13.821,11.458 14.167,11.458Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M16.667,14.375C17.012,14.375 17.292,14.095 17.292,13.75C17.292,13.405 17.012,13.125 16.667,13.125C16.322,13.125 16.042,13.405 16.042,13.75C16.042,14.095 16.322,14.375 16.667,14.375Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M11.668,14.5C12.082,14.5 12.418,14.164 12.418,13.75C12.418,13.336 12.082,13 11.668,13C11.254,13 10.918,13.336 10.918,13.75C10.918,14.164 11.254,14.5 11.668,14.5Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M14.168,14.5C14.582,14.5 14.918,14.164 14.918,13.75C14.918,13.336 14.582,13 14.168,13C13.754,13 13.418,13.336 13.418,13.75C13.418,14.164 13.754,14.5 14.168,14.5Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M11.668,17.416C12.082,17.416 12.418,17.08 12.418,16.666C12.418,16.252 12.082,15.916 11.668,15.916C11.254,15.916 10.918,16.252 10.918,16.666C10.918,17.08 11.254,17.416 11.668,17.416Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M14.168,17.416C14.582,17.416 14.918,17.08 14.918,16.666C14.918,16.252 14.582,15.916 14.168,15.916C13.754,15.916 13.418,16.252 13.418,16.666C13.418,17.08 13.754,17.416 14.168,17.416Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M16.668,17.416C17.082,17.416 17.418,17.08 17.418,16.666C17.418,16.252 17.082,15.916 16.668,15.916C16.254,15.916 15.918,16.252 15.918,16.666C15.918,17.08 16.254,17.416 16.668,17.416Z"
android:fillColor="#FFFFFF"/>
</vector>
1 change: 1 addition & 0 deletions apps/flipcash/core/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -771,5 +771,6 @@
<string name="label_chatReceipt_delivered">Delivered</string>
<string name="label_chatReceipt_read">Read %1$s</string>
<string name="label_chatReceipt_yesterday">Yesterday</string>
<string name="label_chatSeparator_today">Today</string>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ internal class SendFlowViewModel @Inject constructor(
val formattedPhone = phone?.let { phoneUtils.formatNumber(it) }
val displayName = otherMember.userProfile.displayName?.takeIf { it.isNotBlank() }
?: formattedPhone
?: "Unknown Contact"
?: return@mapNotNull null // filter out anonymous chats

val unknown = DeviceContact.unknownContact(
e164 = phone.orEmpty(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,30 +315,12 @@ private fun ContactRowItem(
} else {
Box(modifier = Modifier.requiredWidth(CodeTheme.dimens.inset))
}
if (isNonContactDm && contact.photoUri == null) {
Box(
modifier = Modifier
.requiredSize(CodeTheme.dimens.staticGrid.x8)
.clip(CircleShape)
.background(Brush.linearGradient(CodeTheme.colors.contactAvatar.colors)),
contentAlignment = Alignment.Center,
) {
Icon(
imageVector = Icons.Default.Person,
contentDescription = null,
tint = CodeTheme.colors.textSecondary,
modifier = Modifier.size(CodeTheme.dimens.staticGrid.x5),
)
}
} else {
ContactAvatar(
photoUri = contact.photoUri,
displayName = contact.displayName,
modifier = Modifier
.requiredSize(CodeTheme.dimens.staticGrid.x8)
.clip(CircleShape),
)
}
ContactAvatar(
contact = contact,
modifier = Modifier
.requiredSize(CodeTheme.dimens.staticGrid.x8)
.clip(CircleShape),
)
}

Column(modifier = Modifier.weight(1f)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import com.getcode.opencode.model.financial.Limits
import com.getcode.opencode.model.financial.SendLimit
import com.getcode.opencode.model.financial.Token
import com.getcode.solana.keys.PublicKey
import com.getcode.util.DateUtils
import com.getcode.util.resources.ResourceHelper
import com.getcode.utils.trace
import com.getcode.view.BaseViewModel
Expand Down Expand Up @@ -205,7 +204,7 @@ internal class ChatViewModel @Inject constructor(
}.insertSeparators { before: ChatListItem.ContentBubble?, after: ChatListItem.ContentBubble? ->
if (before == null) return@insertSeparators null
if (after == null || separatorConfig.shouldSeparate(before.timestamp, after.timestamp)) {
ChatListItem.DateSeparator(formatDateLabel(before.timestamp))
ChatListItem.DateSeparator(before.timestamp)
} else null
}
}.cachedIn(viewModelScope)
Expand Down Expand Up @@ -616,10 +615,6 @@ internal class ChatViewModel @Inject constructor(
}

companion object {
private fun formatDateLabel(instant: Instant): String {
return DateUtils.getDateWithToday(instant.toEpochMilliseconds())
}

val updateStateForEvent: (Event) -> ((State) -> State) = { event ->
when (event) {
is Event.OnChatOpened -> { state -> state }
Expand Down
Loading
Loading