Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename some function to avoid name clash #3705

Merged
merged 3 commits into from
Oct 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fun ActionListView(
onDismissRequest = ::onDismiss,
modifier = modifier,
) {
SheetContent(
ActionListViewContent(
state = state,
onActionClick = ::onItemActionClick,
onEmojiReactionClick = ::onEmojiReactionClick,
Expand All @@ -161,7 +161,7 @@ fun ActionListView(
}

@Composable
private fun SheetContent(
private fun ActionListViewContent(
state: ActionListState,
onActionClick: (TimelineItemAction) -> Unit,
onEmojiReactionClick: (String) -> Unit,
Expand Down Expand Up @@ -442,10 +442,10 @@ private fun EmojiButton(

@PreviewsDayNight
@Composable
internal fun SheetContentPreview(
internal fun ActionListViewContentPreview(
@PreviewParameter(ActionListStateProvider::class) state: ActionListState
) = ElementPreview {
SheetContent(
ActionListViewContent(
state = state,
onActionClick = {},
onEmojiReactionClick = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@
sheetState = sheetState,
modifier = modifier
) {
SheetContent(summary = state.target)
ReactionSummaryViewContent(summary = state.target)

Check warning on line 92 in features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt

View check run for this annotation

Codecov / codecov/patch

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/components/reactionsummary/ReactionSummaryView.kt#L92

Added line #L92 was not covered by tests
}
}
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun SheetContent(
private fun ReactionSummaryViewContent(
summary: ReactionSummaryState.Summary,
) {
val animationScope = rememberCoroutineScope()
Expand Down Expand Up @@ -274,8 +274,8 @@

@PreviewsDayNight
@Composable
internal fun SheetContentPreview(
internal fun ReactionSummaryViewContentPreview(
@PreviewParameter(ReactionSummaryStateProvider::class) state: ReactionSummaryState
) = ElementPreview {
SheetContent(summary = state.target as ReactionSummaryState.Summary)
ReactionSummaryViewContent(summary = state.target as ReactionSummaryState.Summary)
}
31 changes: 31 additions & 0 deletions tools/test/generateAllScreenshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import re
import sys
import time

from util import compare


Expand Down Expand Up @@ -100,6 +101,34 @@ def computeDarkFileName(lightFileName):
return match.group(1) + "_Night_" + match.group(2) + "_" + match.group(3)
return ""


def checkForScreenshotNameDuplication():
__doc__ = "Check for screenshots name duplication"
print("Check for screenshots name duplication...")
files = os.listdir("tests/uitests/src/test/snapshots/images/")
dict = {}
for file in files:
start = file.find("_") + 1
end = file.find("_", start)
screenshotName = file[start:end]
if screenshotName in dict:
dict[screenshotName].append(file[:end])
else:
dict[screenshotName] = [file[:end]]
error = 0
for key in dict:
if key in ["Icon", "RoundIcon"]:
continue
values = set(dict[key])
if len(values) > 1:
print("Duplicated screenshot name: %s" % key)
for value in values:
print(" - %s" % value)
error += 1
if error:
print("Warning: %d duplicated screenshot name(s) found" % error)


def generateJavascriptFile():
__doc__ = "Generate a javascript file to load the screenshots"
print("Generating javascript file...")
Expand Down Expand Up @@ -151,11 +180,13 @@ def generateJavascriptFile():


def main():
checkForScreenshotNameDuplication()
generateAllScreenshots(readArguments())
lang = detectLanguages()
for l in lang:
deleteDuplicatedScreenshots(l)
moveScreenshots(l)
generateJavascriptFile()


main()
Loading