Skip to content
Open
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "disabled"
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="@integer/rtl_mirror_flip"
android:endColor="#330DBD8B"
android:startColor="#33B972DA" />
android:endColor="#5E50F480"
android:startColor="#AB4EE380" />
</shape>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="@integer/rtl_mirror_flip"
android:endColor="#33BBE7CF"
android:startColor="#330DBD8B" />
android:endColor="#5E50F480"
android:startColor="#AB4EE380" />
</shape>
34 changes: 14 additions & 20 deletions library/ui-styles/src/main/res/drawable/element_logo_green.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="64"
android:viewportHeight="64">
<path
android:pathData="M23.04,3.84C23.04,1.7192 24.7593,0 26.88,0C41.0185,0 52.48,11.4615 52.48,25.6C52.48,27.7208 50.7608,29.44 48.64,29.44C46.5193,29.44 44.8,27.7208 44.8,25.6C44.8,15.7031 36.777,7.68 26.88,7.68C24.7593,7.68 23.04,5.9608 23.04,3.84Z"
android:fillColor="#0DBD8B"
android:fillType="evenOdd"/>
<path
android:pathData="M40.96,60.16C40.96,62.2808 39.2407,64 37.12,64C22.9815,64 11.52,52.5385 11.52,38.4C11.52,36.2792 13.2392,34.56 15.36,34.56C17.4807,34.56 19.2,36.2792 19.2,38.4C19.2,48.2969 27.223,56.32 37.12,56.32C39.2407,56.32 40.96,58.0392 40.96,60.16Z"
android:fillColor="#0DBD8B"
android:fillType="evenOdd"/>
<path
android:pathData="M3.84,40.96C1.7192,40.96 -0,39.2407 -0,37.12C-0,22.9815 11.4615,11.52 25.6,11.52C27.7208,11.52 29.44,13.2392 29.44,15.36C29.44,17.4807 27.7208,19.2 25.6,19.2C15.7031,19.2 7.68,27.223 7.68,37.12C7.68,39.2407 5.9608,40.96 3.84,40.96Z"
android:fillColor="#0DBD8B"
android:fillType="evenOdd"/>
<path
android:pathData="M60.16,23.04C62.2808,23.04 64,24.7593 64,26.88C64,41.0185 52.5385,52.48 38.4,52.48C36.2792,52.48 34.56,50.7608 34.56,48.64C34.56,46.5193 36.2792,44.8 38.4,44.8C48.2969,44.8 56.32,36.777 56.32,26.88C56.32,24.7593 58.0392,23.04 60.16,23.04Z"
android:fillColor="#0DBD8B"
android:fillType="evenOdd"/>
android:width="50dp"
android:height="30dp"
android:viewportWidth="50"
android:viewportHeight="80">
<group
android:translateX="10.4899"
android:translateY="20.173">
<group
android:translateY="0.0000000000000002220446">
<path
android:pathData="M18.734 1.173L13.522 2.062L13.097 5.085C11.83 5.423 10.714 6.011 9.621 6.85C7.775 8.267 6.692 10.117 6.371 12.399C6.221 13.465 6.269 14.115 6.432 14.943C6.592 15.783 6.876 16.467 7.283 16.993C7.676 17.533 8.155 17.997 8.721 18.386C9.273 18.787 9.874 19.107 10.524 19.345C11.16 19.596 11.807 19.815 12.464 20.003C12.795 20.1 13.041 20.195 13.283 20.288C13.511 20.377 13.736 20.463 14.026 20.549C14.607 20.737 15.123 20.944 15.572 21.17C16.009 21.395 16.341 21.69 16.569 22.054C16.796 22.417 16.875 22.85 16.804 23.352C16.675 24.267 16.266 24.969 15.577 25.459C14.873 25.96 13.977 26.211 12.888 26.211C11.799 26.211 10.984 25.929 10.442 25.364C9.932 24.833 9.727 24.095 9.826 23.151L4.493 24.06C4.442 25.963 5.024 27.539 6.238 28.788C7.111 29.703 8.198 30.338 9.498 30.692L8.982 34.364L14.194 33.475L14.569 30.807C16.149 30.497 17.565 29.862 18.817 28.901C20.649 27.484 21.726 25.634 22.047 23.352C22.195 22.298 22.187 21.364 22.023 20.549C21.857 19.746 21.575 19.094 21.177 18.592C20.766 18.091 20.283 17.658 19.726 17.294C19.156 16.931 18.551 16.642 17.91 16.429C17.256 16.216 16.606 16.022 15.959 15.846C15.313 15.67 14.699 15.489 14.117 15.3C13.312 15.045 12.203 14.437 11.82 13.691C11.668 13.395 11.55 12.988 11.633 12.399C11.762 11.483 12.171 10.781 12.86 10.292C13.549 9.803 14.139 9.558 15.228 9.558C16.317 9.558 17.139 9.841 17.693 10.405C18.086 10.815 18.298 11.347 18.329 12.002L23.619 11.1C23.545 9.465 22.972 8.086 21.9 6.963C20.924 5.959 19.691 5.295 18.2 4.973L18.734 1.173Z"
android:fillColor="#FFFFFF" />
</group>
</group>
</vector>
2 changes: 1 addition & 1 deletion library/ui-styles/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
<color name="vctr_live_location_dark">@color/palette_prune</color>

<!-- Shield colors -->
<color name="shield_color_trust">#0DBD8B</color>
<color name="shield_color_trust">#6147FF</color>
<color name="shield_color_trust_background">#0F0DBD8B</color>
<color name="shield_color_black">#17191C</color>
<color name="shield_color_gray">#91A1C0</color>
Expand Down
4 changes: 2 additions & 2 deletions library/ui-styles/src/main/res/values/palette.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<color name="palette_polly">#E64F7A</color>
<color name="palette_melon">#FF812D</color>

<color name="palette_element_green">#0DBD8B</color>
<color name="palette_element_green">#6147FF</color>
<color name="palette_element_orange">#D9B072</color>
<color name="palette_white">#FFFFFF</color>
<color name="palette_vermilion">#FF5B55</color>
Expand All @@ -42,6 +42,6 @@
<color name="palette_gray_400">#6F7882</color>
<color name="palette_gray_450">#394049</color>
<color name="palette_black_800">#15191E</color>
<color name="palette_black_950">#21262C</color>
<color name="palette_black_950">#21262C</color>

</resources>
3 changes: 2 additions & 1 deletion library/ui-styles/src/main/res/values/palette_mobile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@
<color name="element_room_01">@color/palette_verde</color>
<color name="element_room_02">@color/palette_azure</color>
<color name="element_room_03">@color/palette_grape</color>
</resources>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ sealed class MatrixItem(
is RoomAliasItem -> roomDisplayName ?: displayName
else -> displayName
}
return (displayName?.takeIf { it.isNotBlank() } ?: id)
return (displayName?.takeIf { it.isNotBlank() }?.replace("\\[TG] ".toRegex(), "")?.replace("\\$".toRegex(), "") ?: id)
.let { dn ->
var startIndex = 0
val initial = dn[startIndex]
Expand Down
4 changes: 2 additions & 2 deletions vector-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ android {
debug {
applicationIdSuffix ".debug"
signingConfig signingConfigs.debug
resValue "string", "app_name", "Element - dbg"
resValue "string", "app_name", "Superhero - dbg"

if (project.hasProperty("coverage")) {
testCoverageEnabled = coverage == "true"
}
}

release {
resValue "string", "app_name", "Element"
resValue "string", "app_name", "Superhero"
postprocessing {
// FIXME Set to true.
removeUnusedCode false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:pathData="M47.28,32.88C47.28,31.289 48.569,30 50.16,30C60.764,30 69.36,38.596 69.36,49.2C69.36,50.791 68.071,52.08 66.48,52.08C64.89,52.08 63.6,50.791 63.6,49.2C63.6,41.777 57.583,35.76 50.16,35.76C48.569,35.76 47.28,34.471 47.28,32.88Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
<path
android:pathData="M60.72,75.12C60.72,76.711 59.431,78 57.84,78C47.236,78 38.64,69.404 38.64,58.8C38.64,57.209 39.929,55.92 41.52,55.92C43.111,55.92 44.4,57.209 44.4,58.8C44.4,66.223 50.417,72.24 57.84,72.24C59.431,72.24 60.72,73.529 60.72,75.12Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
<path
android:pathData="M32.88,60.72C31.289,60.72 30,59.431 30,57.84C30,47.236 38.596,38.64 49.2,38.64C50.791,38.64 52.08,39.929 52.08,41.52C52.08,43.111 50.791,44.4 49.2,44.4C41.777,44.4 35.76,50.417 35.76,57.84C35.76,59.431 34.471,60.72 32.88,60.72Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
<path
android:pathData="M75.12,47.28C76.711,47.28 78,48.569 78,50.16C78,60.764 69.404,69.36 58.8,69.36C57.209,69.36 55.92,68.071 55.92,66.48C55.92,64.89 57.209,63.6 58.8,63.6C66.223,63.6 72.24,57.583 72.24,50.16C72.24,48.569 73.529,47.28 75.12,47.28Z"
android:fillColor="#ffffff"
android:fillType="evenOdd"/>
android:width="50dp"
android:height="30dp"
android:viewportWidth="50"
android:viewportHeight="80">
<group
android:translateX="10.4899"
android:translateY="20.173">
<group
android:translateY="0.0000000000000002220446">
<path
android:pathData="M18.734 1.173L13.522 2.062L13.097 5.085C11.83 5.423 10.714 6.011 9.621 6.85C7.775 8.267 6.692 10.117 6.371 12.399C6.221 13.465 6.269 14.115 6.432 14.943C6.592 15.783 6.876 16.467 7.283 16.993C7.676 17.533 8.155 17.997 8.721 18.386C9.273 18.787 9.874 19.107 10.524 19.345C11.16 19.596 11.807 19.815 12.464 20.003C12.795 20.1 13.041 20.195 13.283 20.288C13.511 20.377 13.736 20.463 14.026 20.549C14.607 20.737 15.123 20.944 15.572 21.17C16.009 21.395 16.341 21.69 16.569 22.054C16.796 22.417 16.875 22.85 16.804 23.352C16.675 24.267 16.266 24.969 15.577 25.459C14.873 25.96 13.977 26.211 12.888 26.211C11.799 26.211 10.984 25.929 10.442 25.364C9.932 24.833 9.727 24.095 9.826 23.151L4.493 24.06C4.442 25.963 5.024 27.539 6.238 28.788C7.111 29.703 8.198 30.338 9.498 30.692L8.982 34.364L14.194 33.475L14.569 30.807C16.149 30.497 17.565 29.862 18.817 28.901C20.649 27.484 21.726 25.634 22.047 23.352C22.195 22.298 22.187 21.364 22.023 20.549C21.857 19.746 21.575 19.094 21.177 18.592C20.766 18.091 20.283 17.658 19.726 17.294C19.156 16.931 18.551 16.642 17.91 16.429C17.256 16.216 16.606 16.022 15.959 15.846C15.313 15.67 14.699 15.489 14.117 15.3C13.312 15.045 12.203 14.437 11.82 13.691C11.668 13.395 11.55 12.988 11.633 12.399C11.762 11.483 12.171 10.781 12.86 10.292C13.549 9.803 14.139 9.558 15.228 9.558C16.317 9.558 17.139 9.841 17.693 10.405C18.086 10.815 18.298 11.347 18.329 12.002L23.619 11.1C23.545 9.465 22.972 8.086 21.9 6.963C20.924 5.959 19.691 5.295 18.2 4.973L18.734 1.173Z"
android:fillColor="#FFFFFF" />
</group>
</group>
</vector>
2 changes: 1 addition & 1 deletion vector-app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="launcher_background">#0DBD8B</color>
<color name="launcher_background">#6147FF</color>
</resources>
9 changes: 4 additions & 5 deletions vector-config/src/main/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<!-- "app_name" is now defined in build.gradle -->

<!-- server urls -->
<string name="matrix_org_server_url" translatable="false">https://matrix.org</string>
<string name="matrix_org_server_url" translatable="false">https://matrix.superhero.chat</string>

<!-- Rageshake configuration -->
<string name="bug_report_url" translatable="false">https://riot.im/bugreports/submit</string>
Expand All @@ -29,17 +29,16 @@
<string name="preferred_jitsi_domain" translatable="false">meet.element.io</string>

<string-array name="room_directory_servers" translatable="false">
<item>matrix.org</item>
<item>matrix.superhero.chat</item>
<item>gitter.im</item>
</string-array>

<!-- Permalink config -->
<string-array name="permalink_supported_hosts" translatable="false">
<!-- Regular Element Web instance -->
<item>app.element.io</item>
<item>chat.superhero.com</item>
<!-- Other known instances of Element Web -->
<item>develop.element.io</item>
<item>staging.element.io</item>
<item>chat.superhero.chat</item>
<!-- Previous Web instance, kept for compatibility reason -->
<item>riot.im</item>
</string-array>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,26 @@ fun MatrixItem.getBestName(): String {
// Best name is the id, and we keep the displayName of the room for the case we need the first letter
id
} else {
displayName
// displayName
// ?.takeIf { it.isNotBlank() }?.replace("[TG] ","")?.replace("$","")
// ?: VectorMatrixItemDisplayNameFallbackProvider.getDefaultName(this).replace("[TG] ","").replace("$","")
val modifiedDisplayName = displayName
?.takeIf { it.isNotBlank() }
?: VectorMatrixItemDisplayNameFallbackProvider.getDefaultName(this)
?.let {
when {
it.startsWith("[TG] ") -> {
it.replaceFirst("[TG] ", "") // Remove [TG] from the beginning
}
it.contains("$") -> {
it.replace("$", "") // Remove $ from the string
}
else -> it
}
}
?: VectorMatrixItemDisplayNameFallbackProvider.getDefaultName(this).replace("[TG] ","").replace("$","")

modifiedDisplayName.replace("[TG] ", "").replace("$","")

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class AvatarRenderer @Inject constructor(
val matrixItem = MatrixItem.UserItem(
// Need an id starting with @
id = profileInfo.matrixId,
displayName = profileInfo.displayName,
displayName = profileInfo.displayName?.replace("[TG] ","")?.replace("$",""),
)

val placeholder = getPlaceholderDrawable(matrixItem)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,27 @@ class TimelineFragment :
views.includeRoomToolbar.roomToolbarContentView.isClickable = false
} else {
views.includeRoomToolbar.roomToolbarContentView.isClickable = roomSummary.membership == Membership.JOIN
views.includeRoomToolbar.roomToolbarTitleView.text = roomSummary.displayName
// views.includeRoomToolbar.roomToolbarTitleView.text = roomSummary.displayName.replace("[TG] ","").replace("$","")
if (roomSummary.displayName.startsWith("[TG]") && roomSummary.displayName.contains("$")) {
// Remove [TG] from the beginning
val modifiedString = roomSummary.displayName.replace("[TG] ", "")
// Update the roomToolbarTitleView.text with the modified string
views.includeRoomToolbar.roomToolbarTitleView.text = modifiedString
} else if (roomSummary.displayName.startsWith("$") && roomSummary.displayName.contains("[TG]")) {
// Remove $ from the beginning
val modifiedString = roomSummary.displayName.replace("$", "")
// Update the roomToolbarTitleView.text with the modified string
views.includeRoomToolbar.roomToolbarTitleView.text = modifiedString
} else if (roomSummary.displayName.startsWith("[TG] ")){
val modifiedString = roomSummary.displayName.replace("[TG] ","")
views.includeRoomToolbar.roomToolbarTitleView.text = modifiedString
} else if (roomSummary.displayName.startsWith("$")) {
val modifiedString = roomSummary.displayName.replace("$","")
views.includeRoomToolbar.roomToolbarTitleView.text = modifiedString
} else {
views.includeRoomToolbar.roomToolbarTitleView.text = roomSummary.displayName
}

avatarRenderer.render(roomSummary.toMatrixItem(), views.includeRoomToolbar.roomToolbarAvatarImageView)
val showPresence = roomSummary.isDirect
views.includeRoomToolbar.roomToolbarPresenceImageView.render(showPresence, roomSummary.directUserPresence)
Expand All @@ -1265,6 +1285,7 @@ class TimelineFragment :
}
}


private fun displayE2eError(withHeldCode: WithHeldCode?) {
val msgId = when (withHeldCode) {
WithHeldCode.BLACKLISTED -> R.string.crypto_error_withheld_blacklisted
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,23 @@ abstract class MergedRoomCreationItem : BasedMergedItem<MergedRoomCreationItem.H
}

private fun bindCreationSummaryTile(holder: Holder) {
val roomDisplayName = roomSummary?.displayName
val roomDisplayName = roomSummary?.displayName?.replace("[TG] ","")?.replace("$","")
val membersCount = roomSummary?.otherMemberIds?.size ?: 0

holder.roomNameText.setTextOrHide(roomDisplayName)
if (roomSummary?.displayName!!.contains("[TG]")) {
holder.roomNameText.setTextOrHide(roomDisplayName!!.replace("[TG] ",""))
holder.roomNameText.setCompoundDrawablesWithIntrinsicBounds(R.drawable.chatimg, 0,0,0)
holder.roomNameText.setCompoundDrawablePadding(10)
}
if (roomSummary?.displayName!!.startsWith("$")) {
holder.roomNameText.setTextOrHide(roomDisplayName!!.replace("$",""))
holder.roomNameText.setCompoundDrawablesWithIntrinsicBounds(R.drawable.dollar, 0,0,0)
holder.roomNameText.setCompoundDrawablePadding(10)
} else {
holder.roomNameText.setTextOrHide(roomDisplayName)
}


renderRoomDescription(holder)
renderRoomTopic(holder)

Expand Down Expand Up @@ -229,7 +242,7 @@ abstract class MergedRoomCreationItem : BasedMergedItem<MergedRoomCreationItem.H
holder.view.resources.getString(R.string.this_is_the_beginning_of_room_no_name)
}
else -> {
holder.view.resources.getString(R.string.this_is_the_beginning_of_room, roomDisplayName)
holder.view.resources.getString(R.string.this_is_the_beginning_of_room, roomDisplayName.replace("[TG] ","").replace("$",""))
}
}
holder.roomDescriptionText.text = description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ abstract class RoomSummaryCenteredItem : VectorEpoxyModel<RoomSummaryCenteredIte
it.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS)
itemLongClickListener?.onLongClick(it) ?: false
}
if (matrixItem.displayName!!.contains("[TG] ")){
holder.titleView.setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.chatimg, 0,0,0)
} else if (matrixItem.displayName!!.contains("$")) {
holder.titleView.setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.dollar,0,0,0)
} else {
holder.titleView.setCompoundDrawablesRelativeWithIntrinsicBounds(0,0,0,0)
}
// if (matrixItem.displayName!!.contains("$")) {
// holder.titleView.setCompoundDrawablesRelativeWithIntrinsicBounds(R.drawable.dollar,0,0,0)
// } else {
//
// }
holder.titleView.invalidate()
holder.titleView.text = matrixItem.getBestName()
avatarRenderer.render(matrixItem, holder.avatarImageView)
holder.roomAvatarDecorationImageView.render(encryptionTrustLevel)
Expand Down
Loading