Merge pull request #3705 from element-hq/feature/bma/sheetContentPreview
Rename some function to avoid name clash
This commit is contained in:
commit
61aeef7ec7
31 changed files with 39 additions and 8 deletions
|
|
@ -146,7 +146,7 @@ fun ActionListView(
|
||||||
onDismissRequest = ::onDismiss,
|
onDismissRequest = ::onDismiss,
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
) {
|
) {
|
||||||
SheetContent(
|
ActionListViewContent(
|
||||||
state = state,
|
state = state,
|
||||||
onActionClick = ::onItemActionClick,
|
onActionClick = ::onItemActionClick,
|
||||||
onEmojiReactionClick = ::onEmojiReactionClick,
|
onEmojiReactionClick = ::onEmojiReactionClick,
|
||||||
|
|
@ -161,7 +161,7 @@ fun ActionListView(
|
||||||
}
|
}
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
private fun SheetContent(
|
private fun ActionListViewContent(
|
||||||
state: ActionListState,
|
state: ActionListState,
|
||||||
onActionClick: (TimelineItemAction) -> Unit,
|
onActionClick: (TimelineItemAction) -> Unit,
|
||||||
onEmojiReactionClick: (String) -> Unit,
|
onEmojiReactionClick: (String) -> Unit,
|
||||||
|
|
@ -442,10 +442,10 @@ private fun EmojiButton(
|
||||||
|
|
||||||
@PreviewsDayNight
|
@PreviewsDayNight
|
||||||
@Composable
|
@Composable
|
||||||
internal fun SheetContentPreview(
|
internal fun ActionListViewContentPreview(
|
||||||
@PreviewParameter(ActionListStateProvider::class) state: ActionListState
|
@PreviewParameter(ActionListStateProvider::class) state: ActionListState
|
||||||
) = ElementPreview {
|
) = ElementPreview {
|
||||||
SheetContent(
|
ActionListViewContent(
|
||||||
state = state,
|
state = state,
|
||||||
onActionClick = {},
|
onActionClick = {},
|
||||||
onEmojiReactionClick = {},
|
onEmojiReactionClick = {},
|
||||||
|
|
|
||||||
|
|
@ -89,14 +89,14 @@ fun ReactionSummaryView(
|
||||||
sheetState = sheetState,
|
sheetState = sheetState,
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
) {
|
) {
|
||||||
SheetContent(summary = state.target)
|
ReactionSummaryViewContent(summary = state.target)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@OptIn(ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalFoundationApi::class)
|
||||||
@Composable
|
@Composable
|
||||||
private fun SheetContent(
|
private fun ReactionSummaryViewContent(
|
||||||
summary: ReactionSummaryState.Summary,
|
summary: ReactionSummaryState.Summary,
|
||||||
) {
|
) {
|
||||||
val animationScope = rememberCoroutineScope()
|
val animationScope = rememberCoroutineScope()
|
||||||
|
|
@ -274,8 +274,8 @@ private fun SenderRow(
|
||||||
|
|
||||||
@PreviewsDayNight
|
@PreviewsDayNight
|
||||||
@Composable
|
@Composable
|
||||||
internal fun SheetContentPreview(
|
internal fun ReactionSummaryViewContentPreview(
|
||||||
@PreviewParameter(ReactionSummaryStateProvider::class) state: ReactionSummaryState
|
@PreviewParameter(ReactionSummaryStateProvider::class) state: ReactionSummaryState
|
||||||
) = ElementPreview {
|
) = ElementPreview {
|
||||||
SheetContent(summary = state.target as ReactionSummaryState.Summary)
|
ReactionSummaryViewContent(summary = state.target as ReactionSummaryState.Summary)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from util import compare
|
from util import compare
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -100,6 +101,34 @@ def computeDarkFileName(lightFileName):
|
||||||
return match.group(1) + "_Night_" + match.group(2) + "_" + match.group(3)
|
return match.group(1) + "_Night_" + match.group(2) + "_" + match.group(3)
|
||||||
return ""
|
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():
|
def generateJavascriptFile():
|
||||||
__doc__ = "Generate a javascript file to load the screenshots"
|
__doc__ = "Generate a javascript file to load the screenshots"
|
||||||
print("Generating javascript file...")
|
print("Generating javascript file...")
|
||||||
|
|
@ -151,6 +180,7 @@ def generateJavascriptFile():
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
checkForScreenshotNameDuplication()
|
||||||
generateAllScreenshots(readArguments())
|
generateAllScreenshots(readArguments())
|
||||||
lang = detectLanguages()
|
lang = detectLanguages()
|
||||||
for l in lang:
|
for l in lang:
|
||||||
|
|
@ -158,4 +188,5 @@ def main():
|
||||||
moveScreenshots(l)
|
moveScreenshots(l)
|
||||||
generateJavascriptFile()
|
generateJavascriptFile()
|
||||||
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue