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
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.
30 changes: 9 additions & 21 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,10 @@
<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"/>
<vector xmlns:android="http://schemas.android.com/apk/res/android" xmlns:aapt="http://schemas.android.com/aapt"
android:viewportWidth="34"
android:viewportHeight="24"
android:width="200dp"
android:height="180dp">
<path
android:pathData="M0 8.09196L9.00282 0H24.9972L34 8.09196L17.0479 24L0 8.09196ZM10.0085 2.48276H14.893L25.3324 12.7356L17 20.5517L3.73521 8.13794L10.0085 2.48276Z"
android:fillType="evenOdd"
android:fillColor="#1161fe" />
</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">#1161fe</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
2 changes: 1 addition & 1 deletion 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">#1161fe</color>
<color name="palette_element_orange">#D9B072</color>
<color name="palette_white">#FFFFFF</color>
<color name="palette_vermilion">#FF5B55</color>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,13 @@ fun User.toMatrixItem() = MatrixItem.UserItem(userId, displayName, avatarUrl)
fun RoomSummary.toMatrixItem() = if (roomType == RoomType.SPACE) {
MatrixItem.SpaceItem(roomId, displayName, avatarUrl)
} else {
MatrixItem.RoomItem(roomId, displayName, avatarUrl)
if(displayName.startsWith("[TG]")){
MatrixItem.RoomItem(roomId, displayName.substring(5), avatarUrl)

}else{
MatrixItem.RoomItem(roomId, displayName, avatarUrl)
}

}

fun RoomSummary.toRoomAliasMatrixItem() = MatrixItem.RoomAliasItem(canonicalAlias ?: roomId, displayName, avatarUrl)
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,3 @@
<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"/>
<vector xmlns:aapt="http://schemas.android.com/aapt" xmlns:android="http://schemas.android.com/apk/res/android" android:height="94dp" android:viewportHeight="94.0" android:viewportWidth="120.0" android:width="120dp">
<path android:fillColor="#FFFFFFFF" android:fillType="evenOdd" android:pathData="M 25.62 43.941 L 43.166 27.333 L 74.339 27.333 L 91.888 43.941 L 58.847 76.595 L 25.62 43.941 Z M 45.125 32.428 L 54.647 32.428 L 74.993 53.472 L 58.753 69.516 L 32.9 44.036 L 45.125 32.428 Z "/>
</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">#1161fe</color>
</resources>
7 changes: 3 additions & 4 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.com</string>

<!-- Rageshake configuration -->
<string name="bug_report_url" translatable="false">https://riot.im/bugreports/submit</string>
Expand Down Expand Up @@ -36,10 +36,9 @@
<!-- 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 @@ -21,24 +21,28 @@ import im.vector.app.core.resources.StringProvider
import im.vector.app.features.autocomplete.AutocompleteClickListener
import im.vector.app.features.command.Command
import javax.inject.Inject
import timber.log.Timber

class AutocompleteCommandController @Inject constructor(private val stringProvider: StringProvider) : TypedEpoxyController<List<Command>>() {

var listener: AutocompleteClickListener<Command>? = null

override fun buildModels(data: List<Command>?) {
if (data.isNullOrEmpty()) {
return
}
val host = this
data.forEach { command ->
autocompleteCommandItem {
id(command.command)
name(command.command)
parameters(command.parameters)
description(host.stringProvider.getString(command.description))
clickListener { host.listener?.onItemClick(command) }
}
}
return

// if (data.isNullOrEmpty()) {
// return
// }
// val host = this

// data.forEach { command ->
// autocompleteCommandItem {
// id(command.command)
// name(command.command)
// parameters(command.parameters)
// description(host.stringProvider.getString(command.description))
// clickListener { host.listener?.onItemClick(command) }
// }
// }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class CommandParser @Inject constructor(
return if (!message.startsWith("/")) {
ParsedCommand.ErrorNotACommand
} else {

// "/" only
if (message.length == 1) {
return ParsedCommand.ErrorEmptySlashCommand
Expand Down Expand Up @@ -411,8 +412,10 @@ class CommandParser @Inject constructor(
throw RuntimeException("Application crashed from user demand")
}
else -> {

// Unknown command
ParsedCommand.ErrorUnknownSlashCommand(slashCommand)
ParsedCommand.ErrorNotACommand
//ParsedCommand.ErrorUnknownSlashCommand(slashCommand)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,7 @@ class TimelineFragment :
avatarRenderer.render(matrixItem, views.includeThreadToolbar.roomToolbarThreadImageView)
views.includeThreadToolbar.roomToolbarThreadShieldImageView.render(it.roomEncryptionTrustLevel)
views.includeThreadToolbar.roomToolbarThreadSubtitleTextView.text = it.displayName

}
views.includeThreadToolbar.roomToolbarThreadTitleTextView.text = resources.getText(R.string.thread_timeline_title)
}
Expand All @@ -1253,7 +1254,14 @@ class TimelineFragment :
views.includeRoomToolbar.roomToolbarContentView.isClickable = false
} else {
views.includeRoomToolbar.roomToolbarContentView.isClickable = roomSummary.membership == Membership.JOIN
views.includeRoomToolbar.roomToolbarTitleView.text = roomSummary.displayName
if(roomSummary.displayName.startsWith("[TG]")){
views.includeRoomToolbar.roomToolbarTitleView.text = roomSummary.displayName.substring(4)

views.includeRoomToolbar.tokenGatedDecorationToolbarImageView.setImageResource(R.drawable.tokengated_room)

}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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import org.matrix.android.sdk.api.extensions.orFalse
import org.matrix.android.sdk.api.session.room.model.RoomSummary
import org.matrix.android.sdk.api.session.room.model.localecho.RoomLocalEcho
import org.matrix.android.sdk.api.util.toMatrixItem
import timber.log.Timber

@EpoxyModelClass
abstract class MergedRoomCreationItem : BasedMergedItem<MergedRoomCreationItem.Holder>(R.layout.item_timeline_event_base_noinfo) {
Expand Down Expand Up @@ -175,8 +176,14 @@ abstract class MergedRoomCreationItem : BasedMergedItem<MergedRoomCreationItem.H
private fun bindCreationSummaryTile(holder: Holder) {
val roomDisplayName = roomSummary?.displayName
val membersCount = roomSummary?.otherMemberIds?.size ?: 0
if (roomDisplayName?.startsWith("[TG]") == true){

holder.roomNameText.setTextOrHide(roomDisplayName.substring(4))
holder.tokenGated.setImageResource(R.drawable.tokengated_room)
}else{
holder.roomNameText.setTextOrHide(roomDisplayName)
}

holder.roomNameText.setTextOrHide(roomDisplayName)
renderRoomDescription(holder)
renderRoomTopic(holder)

Expand Down Expand Up @@ -229,7 +236,12 @@ 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)
if (roomDisplayName.startsWith("[TG]")){
holder.view.resources.getString(R.string.this_is_the_beginning_of_room, roomDisplayName.substring(4))
}else{
holder.view.resources.getString(R.string.this_is_the_beginning_of_room, roomDisplayName)
}

}
}
holder.roomDescriptionText.text = description
Expand Down Expand Up @@ -281,6 +293,7 @@ abstract class MergedRoomCreationItem : BasedMergedItem<MergedRoomCreationItem.H
val roomAvatarImageView by bind<ImageView>(R.id.creationTileRoomAvatarImageView)
val addPeopleButton by bind<View>(R.id.creationTileAddPeopleButton)
val setAvatarButton by bind<View>(R.id.creationTileSetAvatarButton)
val tokenGated by bind<ImageView>(R.id.tokenGatedRoomDecorationImageView)
}

companion object {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,12 @@ class ThreadListFragment :
avatarRenderer.render(matrixItem, views.includeThreadListToolbar.roomToolbarThreadImageView)
views.includeThreadListToolbar.roomToolbarThreadShieldImageView.render(threadListArgs.roomEncryptionTrustLevel)
views.includeThreadListToolbar.roomToolbarThreadTitleTextView.text = resources.getText(R.string.thread_list_title)
views.includeThreadListToolbar.roomToolbarThreadSubtitleTextView.text = threadListArgs.displayName
if(threadListArgs.displayName?.startsWith("[TG]") == true){
views.includeThreadListToolbar.roomToolbarThreadSubtitleTextView.text = threadListArgs.displayName?.substring(4)
views.includeThreadListToolbar.tokenGatedDecorationToolbarImageView.setImageResource(R.drawable.tokengated_room)
}else{
views.includeThreadListToolbar.roomToolbarThreadSubtitleTextView.text = threadListArgs.displayName
}
}

override fun onThreadSummaryClicked(threadSummary: ThreadSummary) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import im.vector.app.features.themes.ThemeUtils
import me.gujun.android.span.span
import org.matrix.android.sdk.api.session.room.model.RoomType
import org.matrix.android.sdk.api.util.MatrixItem
import timber.log.Timber
import javax.inject.Inject

/**
Expand Down Expand Up @@ -198,6 +199,7 @@ class RoomPreviewNoPreviewFragment :
views.roomPreviewNoPreviewToolbarAvatar.isVisible = false
views.roomPreviewNoPreviewAvatar.isVisible = false
}
Timber.w("Display Name in Preview No Preview Fragment ${roomName}")
views.roomPreviewNoPreviewToolbarTitle.text = roomName

// Screen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ class RoomProfileFragment :
listOf(
views.matrixProfileToolbarAvatarImageView,
views.matrixProfileToolbarTitleView,
views.matrixProfileDecorationToolbarAvatarImageView
views.matrixProfileDecorationToolbarAvatarImageView,
views.tokenGatedDecorationToolbarImageView
)
)
views.matrixProfileAppBarLayout.addOnOffsetChangedListener(appBarStateChangeListener)
Expand Down Expand Up @@ -224,6 +225,22 @@ class RoomProfileFragment :
} else {
headerViews.roomProfileNameView.text = it.displayName
views.matrixProfileToolbarTitleView.text = it.displayName

if (it.displayName.startsWith("[TG]")) {
headerViews.roomProfileNameView.text = it.displayName.substring(4)
views.matrixProfileToolbarTitleView.text = it.displayName.substring(4)

headerViews.tokenGatedRoomDecorationImageView.setImageResource(R.drawable.tokengated_room)
views.tokenGatedDecorationToolbarImageView.setImageResource(R.drawable.tokengated_room)
}

if (it.displayName.startsWith("$")) {
headerViews.roomProfileNameView.text = it.displayName.substring(1)
views.matrixProfileToolbarTitleView.text = it.displayName.substring(1)
headerViews.communityRoomDecorationImageView.setImageResource(R.drawable.community_room)
views.tokenGatedDecorationToolbarImageView.setImageResource(R.drawable.community_room)
}

headerViews.roomProfileAliasView.setTextOrHide(it.canonicalAlias)
val matrixItem = it.toMatrixItem()
avatarRenderer.render(matrixItem, headerViews.roomProfileAvatarView)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import org.matrix.android.sdk.api.session.room.alias.RoomAliasError
import org.matrix.android.sdk.api.session.room.model.RoomDirectoryVisibility
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
import timber.log.Timber

@AndroidEntryPoint
class RoomAliasFragment :
Expand Down Expand Up @@ -133,7 +134,13 @@ class RoomAliasFragment :

private fun renderRoomSummary(state: RoomAliasViewState) {
state.roomSummary()?.let {
views.roomSettingsToolbarTitleView.text = it.displayName
if (it.displayName.startsWith("[TG]")){
views.roomSettingsToolbarTitleView.text = it.displayName.substring(4)
views.tokenGatedDecorationToolbarImageView.setImageResource(R.drawable.tokengated_room)
}else{
views.roomSettingsToolbarTitleView.text = it.displayName

}
avatarRenderer.render(it.toMatrixItem(), views.roomSettingsToolbarAvatarImageView)
views.roomSettingsDecorationToolbarAvatarImageView.render(it.roomEncryptionTrustLevel)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import im.vector.app.features.roomprofile.RoomProfileArgs
import org.matrix.android.sdk.api.session.room.model.RoomMemberSummary
import org.matrix.android.sdk.api.util.toMatrixItem
import javax.inject.Inject
import timber.log.Timber

@AndroidEntryPoint
class RoomBannedMemberListFragment :
Expand Down Expand Up @@ -117,7 +118,13 @@ class RoomBannedMemberListFragment :

private fun renderRoomSummary(state: RoomBannedMemberListViewState) {
state.roomSummary()?.let {
views.roomSettingsToolbarTitleView.text = it.displayName
if (it.displayName.startsWith("[TG]")){
views.roomSettingsToolbarTitleView.text = it.displayName.substring(4)
views.tokenGatedDecorationToolbarImageView.setImageResource(R.drawable.tokengated_room)
}else{
views.roomSettingsToolbarTitleView.text = it.displayName

}
avatarRenderer.render(it.toMatrixItem(), views.roomSettingsToolbarAvatarImageView)
views.roomSettingsDecorationToolbarAvatarImageView.render(it.roomEncryptionTrustLevel)
}
Expand Down
Loading