diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/AndroidNotificationNotifier.iml b/.idea/AndroidNotificationNotifier.iml new file mode 100644 index 00000000..d6ebd480 --- /dev/null +++ b/.idea/AndroidNotificationNotifier.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/AndroidApp/.idea/other.xml b/.idea/caches/deviceStreaming.xml similarity index 99% rename from AndroidApp/.idea/other.xml rename to .idea/caches/deviceStreaming.xml index a76f1180..821dc38d 100644 --- a/AndroidApp/.idea/other.xml +++ b/.idea/caches/deviceStreaming.xml @@ -1,6 +1,6 @@ - + diff --git a/AndroidApp/.idea/inspectionProfiles/Project_Default.xml b/AndroidApp/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..44ca2d9b --- /dev/null +++ b/AndroidApp/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,41 @@ + + + + \ No newline at end of file diff --git a/AndroidApp/.idea/kotlinc.xml b/AndroidApp/.idea/kotlinc.xml index d4b7accb..c224ad56 100644 --- a/AndroidApp/.idea/kotlinc.xml +++ b/AndroidApp/.idea/kotlinc.xml @@ -1,6 +1,6 @@ - \ No newline at end of file diff --git a/AndroidApp/.idea/migrations.xml b/AndroidApp/.idea/migrations.xml index 48052b24..f8051a6f 100644 --- a/AndroidApp/.idea/migrations.xml +++ b/AndroidApp/.idea/migrations.xml @@ -1,10 +1,10 @@ - - - - - + + + + + \ No newline at end of file diff --git a/AndroidApp/.idea/runConfigurations.xml b/AndroidApp/.idea/runConfigurations.xml new file mode 100644 index 00000000..16660f1d --- /dev/null +++ b/AndroidApp/.idea/runConfigurations.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/AndroidApp/.idea/studiobot.xml b/AndroidApp/.idea/studiobot.xml new file mode 100644 index 00000000..539e3b80 --- /dev/null +++ b/AndroidApp/.idea/studiobot.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/AndroidApp/README.md b/AndroidApp/README.md index 338d36d3..2cdc03fd 100644 --- a/AndroidApp/README.md +++ b/AndroidApp/README.md @@ -1 +1,21 @@ # Androidアプリ + +### テスト + +###### ユニットテスト + +- GitHub Actionsで自動実行 + +###### スクリーンショットによるテスト + +- Previewのスクリーンショット自動生成 + - `./gradlew :ui:updateDebugScreenshotTest` +- Previewのテスト + - `./gradlew :ui:validateDebugScreenshotTest` +- 結果 + - https://github.com/ptkNktq/AndroidNotificationNotifier/tree/develop/AndroidApp/ui/build/reports/screenshotTest/preview/debug/.html + +### 注意事項 + +- AGPの更新をするときはAndroid Studioとの互換性を確認すること + - https://developer.android.com/build/releases/gradle-plugin?hl=ja#android_gradle_plugin_and_android_studio_compatibility \ No newline at end of file diff --git a/AndroidApp/app/build.gradle.kts b/AndroidApp/app/build.gradle.kts index cf3c389e..dfb2da1f 100644 --- a/AndroidApp/app/build.gradle.kts +++ b/AndroidApp/app/build.gradle.kts @@ -14,6 +14,9 @@ android { packaging { resources.excludes.add("META-INF/DEPENDENCIES") } + kotlinOptions { + jvmTarget = "17" + } } dependencies { diff --git a/AndroidApp/data/repository/build.gradle.kts b/AndroidApp/data/repository/build.gradle.kts index b6139745..b371ea68 100644 --- a/AndroidApp/data/repository/build.gradle.kts +++ b/AndroidApp/data/repository/build.gradle.kts @@ -5,6 +5,10 @@ plugins { android { namespace = "me.nya_n.notificationnotifier.data.repository" + + kotlinOptions { + jvmTarget = "17" + } } dependencies { diff --git a/AndroidApp/domain/build.gradle.kts b/AndroidApp/domain/build.gradle.kts index 1b4dc242..e8cde834 100644 --- a/AndroidApp/domain/build.gradle.kts +++ b/AndroidApp/domain/build.gradle.kts @@ -4,6 +4,10 @@ plugins { android { namespace = "me.nya_n.notificationnotifier.domain" + + kotlinOptions { + jvmTarget = "17" + } } dependencies { diff --git a/AndroidApp/gradle.properties b/AndroidApp/gradle.properties index 4d15d015..27b42397 100644 --- a/AndroidApp/gradle.properties +++ b/AndroidApp/gradle.properties @@ -18,4 +18,5 @@ android.useAndroidX=true # Automatically convert third-party libraries to use AndroidX android.enableJetifier=true # Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official \ No newline at end of file +kotlin.code.style=official +android.experimental.enableScreenshotTest=true \ No newline at end of file diff --git a/AndroidApp/gradle/libs.versions.toml b/AndroidApp/gradle/libs.versions.toml index 5794070a..48b97048 100644 --- a/AndroidApp/gradle/libs.versions.toml +++ b/AndroidApp/gradle/libs.versions.toml @@ -11,6 +11,7 @@ androidx-compose-bom = "2024.09.03" androidx-compose-activity = "1.9.2" androidx-compose-viewmodel = "2.8.6" androidx-compose-navigation = "2.8.2" +androidx-compose-screenshot = "0.0.1-alpha07" junit = "4.13.2" com-google-truth = "1.4.4" androidx-test-ext = "1.2.1" @@ -28,6 +29,7 @@ org-jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.re compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } com-google-devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "com-google-devtools-ksp" } com-jaredsburrows-license = { id = "com.jaredsburrows.license", version.ref = "com-jaredsburrows-license" } +screenshot = { id = "com.android.compose.screenshot", version.ref = "androidx-compose-screenshot" } [libraries] # androidx diff --git a/AndroidApp/gradlew.bat b/AndroidApp/gradlew.bat index 9b42019c..9d21a218 100644 --- a/AndroidApp/gradlew.bat +++ b/AndroidApp/gradlew.bat @@ -1,94 +1,94 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem -@rem SPDX-License-Identifier: Apache-2.0 -@rem - -@if "%DEBUG%"=="" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%"=="" set DIRNAME=. -@rem This is normally unused -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if %ERRORLEVEL% equ 0 goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. 1>&2 -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 -echo. 1>&2 -echo Please set the JAVA_HOME variable in your environment to match the 1>&2 -echo location of your Java installation. 1>&2 - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if %ERRORLEVEL% equ 0 goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/AndroidApp/model/build.gradle.kts b/AndroidApp/model/build.gradle.kts index 977dd3fd..6dd51883 100644 --- a/AndroidApp/model/build.gradle.kts +++ b/AndroidApp/model/build.gradle.kts @@ -5,6 +5,10 @@ plugins { android { namespace = "me.nya_n.notificationnotifier.model" + + kotlinOptions { + jvmTarget = "17" + } } dependencies { diff --git a/AndroidApp/ui/.gitignore b/AndroidApp/ui/.gitignore index 42afabfd..81158829 100644 --- a/AndroidApp/ui/.gitignore +++ b/AndroidApp/ui/.gitignore @@ -1 +1,4 @@ -/build \ No newline at end of file +/build/* +!/build/reports +/build/reports/* +!/build/reports/screenshotTest \ No newline at end of file diff --git a/AndroidApp/ui/build.gradle.kts b/AndroidApp/ui/build.gradle.kts index cf5cd5a6..81a8b912 100644 --- a/AndroidApp/ui/build.gradle.kts +++ b/AndroidApp/ui/build.gradle.kts @@ -1,10 +1,16 @@ plugins { id("common.library.compose") alias(libs.plugins.com.jaredsburrows.license) + alias(libs.plugins.screenshot) } android { namespace = "me.nya_n.notificationnotifier.ui" + experimentalProperties["android.experimental.enableScreenshotTest"] = true + + kotlinOptions { + jvmTarget = "17" + } } dependencies { @@ -19,6 +25,7 @@ dependencies { implementation(composeBom) androidTestImplementation(composeBom) debugImplementation(libs.androidx.compose.ui.tooling) + screenshotTestImplementation(libs.androidx.compose.ui.tooling) implementation(libs.bundles.androidx.compose) // その他 diff --git a/AndroidApp/ui/build/reports/screenshotTest/preview/debug/.html b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/.html new file mode 100644 index 00000000..bfc78a26 --- /dev/null +++ b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/.html @@ -0,0 +1,104 @@ + + + + +Test results - Package + + + + + +
+

Package

+ +
+ + + + + +
+
+ + + + + + + + +
+
+
16
+

tests

+
+
+
+
0
+

errors

+
+
+
+
0
+

failures

+
+
+
+
0
+

skipped

+
+
+
+
1.805s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Classes

+ + + + + + + + + + + + + + + + + + + + + +
ClassTestsErrorsFailuresSkippedDurationSuccess rate
+me +160001.805s100%
+
+
+ +
+ \ No newline at end of file diff --git a/AndroidApp/ui/build/reports/screenshotTest/preview/debug/css/base-style.css b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/css/base-style.css new file mode 100644 index 00000000..e09a387f --- /dev/null +++ b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/css/base-style.css @@ -0,0 +1,162 @@ + +body { + margin: 0; + padding: 0; + font-family: sans-serif; + font-size: 12pt; +} + +body, a, a:visited { + color: #303030; +} + +#content { + padding-left: 50px; + padding-right: 50px; + padding-top: 30px; + padding-bottom: 30px; +} + +#content h1 { + font-size: 160%; + margin-bottom: 10px; +} + +#footer { + margin-top: 100px; + font-size: 80%; + white-space: nowrap; +} + +#footer, #footer a { + color: #a0a0a0; +} + +ul { + margin-left: 0; +} + +h1, h2, h3 { + white-space: nowrap; +} + +h2 { + font-size: 120%; +} + +ul.tabLinks { + padding-left: 0; + padding-top: 10px; + padding-bottom: 10px; + overflow: auto; + min-width: 800px; + width: auto !important; + width: 800px; +} + +ul.tabLinks li { + float: left; + height: 100%; + list-style: none; + padding-left: 10px; + padding-right: 10px; + padding-top: 5px; + padding-bottom: 5px; + margin-bottom: 0; + -moz-border-radius: 7px; + border-radius: 7px; + margin-right: 25px; + border: solid 1px #d4d4d4; + background-color: #f0f0f0; + behavior: url(css3-pie-1.0beta3.htc); +} + +ul.tabLinks li:hover { + background-color: #fafafa; +} + +ul.tabLinks li.selected { + background-color: #c5f0f5; + border-color: #c5f0f5; +} + +ul.tabLinks a { + font-size: 120%; + display: block; + outline: none; + text-decoration: none; + margin: 0; + padding: 0; +} + +ul.tabLinks li h2 { + margin: 0; + padding: 0; +} + +div.tab { +} + +div.selected { + display: block; +} + +div.deselected { + display: none; +} + +div.tab table { + min-width: 350px; + width: auto !important; + width: 350px; + border-collapse: collapse; +} + +div.tab th, div.tab table { + border-bottom: solid #d0d0d0 1px; +} + +div.tab th { + text-align: left; + white-space: nowrap; + padding-left: 6em; +} + +div.tab th:first-child { + padding-left: 0; +} + +div.tab td { + white-space: nowrap; + padding-left: 6em; + padding-top: 5px; + padding-bottom: 5px; +} + +div.tab td:first-child { + padding-left: 0; +} + +div.tab td.numeric, div.tab th.numeric { + text-align: right; +} + +span.code { + display: inline-block; + margin-top: 0em; + margin-bottom: 1em; +} + +span.code pre { + font-size: 11pt; + padding-top: 10px; + padding-bottom: 10px; + padding-left: 10px; + padding-right: 10px; + margin: 0; + background-color: #f7f7f7; + border: solid 1px #d0d0d0; + min-width: 700px; + width: auto !important; + width: 700px; +} diff --git a/AndroidApp/ui/build/reports/screenshotTest/preview/debug/css/style.css b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/css/style.css new file mode 100644 index 00000000..746cd0bf --- /dev/null +++ b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/css/style.css @@ -0,0 +1,85 @@ +#summary { + margin-top: 30px; + margin-bottom: 40px; +} + +#summary table { + border-collapse: collapse; +} + +#summary td { + vertical-align: top; +} + +.breadcrumbs, .breadcrumbs a { + color: #606060; +} + +.infoBox { + width: 110px; + padding-top: 15px; + padding-bottom: 15px; + text-align: center; +} + +.infoBox p { + margin: 0; +} + +.grid { + background: linear-gradient(-90deg, rgba(0, 0, 0, .05) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .05) 1px, transparent 1px), linear-gradient(-90deg, rgba(0, 0, 0, .04) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .04) 1px, transparent 1px), linear-gradient(transparent 3px, #f2f2f2 3px, #f2f2f2 98px, transparent 98px), linear-gradient(-90deg, #aaa 1px, transparent 1px), linear-gradient(-90deg, transparent 3px, #f2f2f2 3px, #f2f2f2 98px, transparent 98px), linear-gradient(#aaa 1px, transparent 1px), #f2f2f2; + background-size: 10px 10px, 10px 10px, 100px 100px, 100px 100px, 100px 100px, 100px 100px, 100px 100px, 100px 100px; +} + +.counter, .percent { + font-size: 120%; + font-weight: bold; + margin-bottom: 8px; +} + +#duration { + width: 125px; +} + +#successRate, .summaryGroup { + border: solid 2px #d0d0d0; + -moz-border-radius: 10px; + border-radius: 10px; + behavior: url(css3-pie-1.0beta3.htc); +} + +#successRate { + width: 140px; + margin-left: 35px; +} + +#successRate .percent { + font-size: 180%; +} + +.success, .success a { + color: #008000; +} + +div.success, #successRate.success { + background-color: #bbd9bb; + border-color: #008000; +} + +.failures, .failures a { + color: #b60808; +} + +div.failures, #successRate.failures { + background-color: #ecdada; + border-color: #b60808; +} + +ul.linkList { + padding-left: 0; +} + +ul.linkList li { + list-style: none; + margin-bottom: 5px; +} diff --git a/AndroidApp/ui/build/reports/screenshotTest/preview/debug/index.html b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/index.html new file mode 100644 index 00000000..f64aa950 --- /dev/null +++ b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/index.html @@ -0,0 +1,135 @@ + + + + +Test results - Test Summary + + + + + +
+

Test Summary

+
+ + + + + +
+
+ + + + + + + + +
+
+
16
+

tests

+
+
+
+
0
+

errors

+
+
+
+
0
+

failures

+
+
+
+
0
+

skipped

+
+
+
+
1.805s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Packages

+ + + + + + + + + + + + + + + + + + + + + + + +
PackageTestsErrorsFailuresSkippedDurationSuccess rate
+ +160001.805s100%
+
+
+

Classes

+ + + + + + + + + + + + + + + + + + + + + + +
ClassTestsErrorsFailuresSkippedDurationSuccess rate
+me +160001.805s100%
+
+
+ +
+ \ No newline at end of file diff --git a/AndroidApp/ui/build/reports/screenshotTest/preview/debug/js/report.js b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/js/report.js new file mode 100644 index 00000000..234fc2e0 --- /dev/null +++ b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/js/report.js @@ -0,0 +1,112 @@ +var tabs = new Object(); + +function initTabs() { + var container = document.getElementById('tabs'); + tabs.tabs = findTabs(container); + tabs.titles = findTitles(tabs.tabs); + tabs.headers = findHeaders(container); + tabs.select = select; + tabs.deselectAll = deselectAll; + // select tab if title param is provided in the URL + const urlParams = new URLSearchParams(window.location.search); + const titleParam = urlParams.get('title'); + if (titleParam) { + const index = tabs.titles.indexOf(titleParam); + if (index > -1) { + tabs.select(index); + return true; + } + } + // If no title or invalid title, select the first tab (default) + tabs.select(0); + return true; +} + +window.onload = initTabs; + +function switchTab() { + var id = this.id.substr(1); + for (var i = 0; i < tabs.tabs.length; i++) { + if (tabs.tabs[i].id == id) { + tabs.select(i); + break; + } + } + return false; +} + +function select(i) { + this.deselectAll(); + changeElementClass(this.tabs[i], 'tab selected'); + changeElementClass(this.headers[i], 'selected'); + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + var h2 = document.createElement('H2'); + h2.appendChild(document.createTextNode(this.titles[i])); + this.headers[i].appendChild(h2); +} + +function deselectAll() { + for (var i = 0; i < this.tabs.length; i++) { + changeElementClass(this.tabs[i], 'tab deselected'); + changeElementClass(this.headers[i], 'deselected'); + while (this.headers[i].firstChild) { + this.headers[i].removeChild(this.headers[i].firstChild); + } + var a = document.createElement('A'); + a.setAttribute('id', 'ltab' + i); + a.setAttribute('href', '#tab' + i); + a.onclick = switchTab; + a.appendChild(document.createTextNode(this.titles[i])); + this.headers[i].appendChild(a); + } +} + +function changeElementClass(element, classValue) { + if (element.getAttribute('className')) { + /* IE */ + element.setAttribute('className', classValue) + } else { + element.setAttribute('class', classValue) + } +} + +function findTabs(container) { + return findChildElements(container, 'DIV', 'tab'); +} + +function findHeaders(container) { + var owner = findChildElements(container, 'UL', 'tabLinks'); + return findChildElements(owner[0], 'LI', null); +} + +function findTitles(tabs) { + var titles = new Array(); + for (var i = 0; i < tabs.length; i++) { + var tab = tabs[i]; + var header = findChildElements(tab, 'H2', null)[0]; + header.parentNode.removeChild(header); + if (header.innerText) { + titles.push(header.innerText) + } else { + titles.push(header.textContent) + } + } + return titles; +} + +function findChildElements(container, name, targetClass) { + var elements = new Array(); + var children = container.childNodes; + for (var i = 0; i < children.length; i++) { + var child = children.item(i); + if (child.nodeType == 1 && child.nodeName == name) { + if (targetClass && child.className.indexOf(targetClass) < 0) { + continue; + } + elements.push(child); + } + } + return elements; +} diff --git a/AndroidApp/ui/build/reports/screenshotTest/preview/debug/me.html b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/me.html new file mode 100644 index 00000000..0170b187 --- /dev/null +++ b/AndroidApp/ui/build/reports/screenshotTest/preview/debug/me.html @@ -0,0 +1,497 @@ + + + + +Test results - Class me + + + + + +
+

Class me

+ +
+ + + + + +
+
+ + + + + + + + +
+
+
16
+

tests

+
+
+
+
0
+

errors

+
+
+
+
0
+

failures

+
+
+
+
0
+

skipped

+
+
+
+
1.805s
+

duration

+
+
+
+
+
+
100%
+

successful

+
+
+
+
+ +
+

Tests

+
+ +

nya_n.notificationnotifier.ScreenshotTest.AppListComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\AppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\AppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.AppOutlinedButtonComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\AppOutlinedButtonComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\AppOutlinedButtonComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.AppScaffoldComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\AppScaffoldComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\AppScaffoldComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.CategoryComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\CategoryComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\CategoryComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.CommonDialogComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\CommonDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\CommonDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.DetailContentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\DetailContentScreenshotTest_9a71c18a_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\DetailContentScreenshotTest_9a71c18a_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.EmptyAppListComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\EmptyAppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\EmptyAppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.EmptyViewComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\EmptyViewComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\EmptyViewComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.MainContentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\MainContentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\MainContentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.RequireNotificationPermissionDialogComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\RequireNotificationPermissionDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\RequireNotificationPermissionDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.RequirePackageVisibilityDialogComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\RequirePackageVisibilityDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\RequirePackageVisibilityDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.SelectionContentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\SelectionContentScreenshotTest_9a71c18a_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\SelectionContentScreenshotTest_9a71c18a_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.SettingsContentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\SettingsContentScreenshotTest_9a71c18a_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\SettingsContentScreenshotTest_9a71c18a_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.SubContentTopBarComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\SubContentTopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\SubContentTopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.TargetContentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\TargetContentScreenshotTest_9a71c18a_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\TargetContentScreenshotTest_9a71c18a_da39a3ee_0.png +Images match!
+
+
+
+ +

nya_n.notificationnotifier.ScreenshotTest.TopBarComponentScreenshotTest

+ + + + + + + + + + + + + + + + +
Reference ImageActual ImageDiff Image
+Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\src\debug\screenshotTest\reference\me\nya_n\notificationnotifier\ScreenshotTest\TopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png + +Error displaying image at E:\workspace\AndroidNotificationNotifier\AndroidApp\ui\build\outputs\screenshotTest-results\preview\debug\rendered\me\nya_n\notificationnotifier\ScreenshotTest\TopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png +Images match!
+
+
+
+
+ +
+ \ No newline at end of file diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png new file mode 100644 index 00000000..a8ac6e95 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppOutlinedButtonComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppOutlinedButtonComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..8a727a45 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppOutlinedButtonComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppScaffoldComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppScaffoldComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..090c6316 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/AppScaffoldComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/CategoryComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/CategoryComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..c3b6356f Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/CategoryComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/CommonDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/CommonDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..a3549158 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/CommonDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/DetailContentScreenshotTest_9a71c18a_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/DetailContentScreenshotTest_9a71c18a_da39a3ee_0.png new file mode 100644 index 00000000..a3e1ce41 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/DetailContentScreenshotTest_9a71c18a_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/EmptyAppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/EmptyAppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png new file mode 100644 index 00000000..5e6e7347 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/EmptyAppListComponentScreenshotTest_9a71c18a_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/EmptyViewComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/EmptyViewComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..1d8bc833 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/EmptyViewComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/MainContentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/MainContentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..41b71f9e Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/MainContentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/RequireNotificationPermissionDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/RequireNotificationPermissionDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..8b11516f Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/RequireNotificationPermissionDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/RequirePackageVisibilityDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/RequirePackageVisibilityDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..2509788c Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/RequirePackageVisibilityDialogComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SelectionContentScreenshotTest_9a71c18a_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SelectionContentScreenshotTest_9a71c18a_da39a3ee_0.png new file mode 100644 index 00000000..2b6b2768 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SelectionContentScreenshotTest_9a71c18a_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SettingsContentScreenshotTest_9a71c18a_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SettingsContentScreenshotTest_9a71c18a_da39a3ee_0.png new file mode 100644 index 00000000..87a86b5c Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SettingsContentScreenshotTest_9a71c18a_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SubContentTopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SubContentTopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..a984505f Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/SubContentTopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/TargetContentScreenshotTest_9a71c18a_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/TargetContentScreenshotTest_9a71c18a_da39a3ee_0.png new file mode 100644 index 00000000..9ca3664c Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/TargetContentScreenshotTest_9a71c18a_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/TopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/TopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png new file mode 100644 index 00000000..45e96870 Binary files /dev/null and b/AndroidApp/ui/src/debug/screenshotTest/reference/me/nya_n/notificationnotifier/ScreenshotTest/TopBarComponentScreenshotTest_da39a3ee_da39a3ee_0.png differ diff --git a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/detail/DetailScreen.kt b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/detail/DetailScreen.kt index 1f77eb40..debfb038 100644 --- a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/detail/DetailScreen.kt +++ b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/detail/DetailScreen.kt @@ -80,7 +80,7 @@ fun DetailScreen( /** 詳細画面のコンテンツ本体 */ @Composable -private fun DetailContent( +fun DetailContent( snackbarHostState: SnackbarHostState, app: InstalledApp, condition: String, diff --git a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/main/MainScreen.kt b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/main/MainScreen.kt index 3c36e3b4..ad3e01d1 100644 --- a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/main/MainScreen.kt +++ b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/main/MainScreen.kt @@ -78,7 +78,7 @@ fun MainScreen(navController: NavController) { /** メイン画面のコンテンツ本体 */ @Composable -private fun MainContent( +fun MainContent( snackbarHostState: SnackbarHostState, tabItems: List, pagerState: PagerState, @@ -127,7 +127,7 @@ private fun BottomBar( } /** BottomNavigationで表示する各タブの情報 */ -private data class TabItem( +data class TabItem( val label: String, val icon: ImageVector, /** このページで表示するコンテンツ diff --git a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/selection/SelectionScreen.kt b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/selection/SelectionScreen.kt index edd51963..c6d8b2e6 100644 --- a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/selection/SelectionScreen.kt +++ b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/selection/SelectionScreen.kt @@ -73,7 +73,7 @@ fun SelectionScreen( } @Composable -private fun SelectionContent( +fun SelectionContent( items: List, isLoading: Boolean, initQuery: String, diff --git a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/settings/SettingsScreen.kt b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/settings/SettingsScreen.kt index 826cb68f..f1949c59 100644 --- a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/settings/SettingsScreen.kt +++ b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/settings/SettingsScreen.kt @@ -126,7 +126,7 @@ fun SettingsScreen( /** 設定画面のコンテンツ本体 */ @Composable -private fun SettingsContent( +fun SettingsContent( address: String, versionCode: Int, versionName: String, diff --git a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/target/TargetScreen.kt b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/target/TargetScreen.kt index 9aca5fd1..ec8c9e96 100644 --- a/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/target/TargetScreen.kt +++ b/AndroidApp/ui/src/main/kotlin/me/nya_n/notificationnotifier/ui/screen/target/TargetScreen.kt @@ -45,7 +45,7 @@ fun TargetScreen( } @Composable -private fun TargetContent( +fun TargetContent( items: List, isLoading: Boolean, onAppSelected: (InstalledApp) -> Unit diff --git a/AndroidApp/ui/src/screenshotTest/kotlin/me/nya_n/notificationnotifier/ScreenshotTest.kt b/AndroidApp/ui/src/screenshotTest/kotlin/me/nya_n/notificationnotifier/ScreenshotTest.kt new file mode 100644 index 00000000..a40f3442 --- /dev/null +++ b/AndroidApp/ui/src/screenshotTest/kotlin/me/nya_n/notificationnotifier/ScreenshotTest.kt @@ -0,0 +1,240 @@ +package me.nya_n.notificationnotifier + +import androidx.compose.foundation.pager.rememberPagerState +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.rounded.List +import androidx.compose.material.icons.outlined.NotificationsActive +import androidx.compose.material.icons.outlined.Settings +import androidx.compose.material3.SnackbarHostState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.tooling.preview.Preview +import me.nya_n.notificationnotifier.model.InstalledApp +import me.nya_n.notificationnotifier.ui.common.AppList +import me.nya_n.notificationnotifier.ui.common.AppOutlinedButton +import me.nya_n.notificationnotifier.ui.common.AppScaffold +import me.nya_n.notificationnotifier.ui.common.Category +import me.nya_n.notificationnotifier.ui.common.CommonDialog +import me.nya_n.notificationnotifier.ui.common.EmptyView +import me.nya_n.notificationnotifier.ui.common.RequireNotificationPermissionDialog +import me.nya_n.notificationnotifier.ui.common.RequirePackageVisibilityDialog +import me.nya_n.notificationnotifier.ui.common.TopBar +import me.nya_n.notificationnotifier.ui.screen.detail.DetailContent +import me.nya_n.notificationnotifier.ui.screen.main.MainContent +import me.nya_n.notificationnotifier.ui.screen.main.TabItem +import me.nya_n.notificationnotifier.ui.screen.selection.SelectionContent +import me.nya_n.notificationnotifier.ui.screen.settings.SettingsContent +import me.nya_n.notificationnotifier.ui.screen.target.TargetContent +import me.nya_n.notificationnotifier.ui.theme.AppTheme +import me.nya_n.notificationnotifier.ui.util.Sample + +class ScreenshotTest { + + // region: 画面レベル + + @Preview + @Composable + fun MainContentScreenshotTest() { + val snackbarHostState = remember { SnackbarHostState() } + val tabItems = listOf( + TabItem("タブ1", Icons.Outlined.NotificationsActive), + TabItem("タブ2", Icons.AutoMirrored.Rounded.List), + TabItem("タブ3", Icons.Outlined.Settings), + ) + val pagerState = rememberPagerState(pageCount = { tabItems.size }) + AppTheme { + MainContent( + snackbarHostState = snackbarHostState, + tabItems = tabItems, + pagerState = pagerState + ) { } + } + } + + + @Preview(backgroundColor = 0xFFC7B5A8, showBackground = true) + @Composable + fun TargetContentScreenshotTest() { + val items = listOf( + InstalledApp("Sample App", "me.nya_n.notificationnotifier"), + InstalledApp("Sample App", "me.nya_n.notificationnotifier"), + InstalledApp("Sample App", "me.nya_n.notificationnotifier"), + ) + AppTheme { + TargetContent( + items = items, + isLoading = false, + onAppSelected = { } + ) + } + } + + @Preview(backgroundColor = 0xFFC7B5A8, showBackground = true) + @Composable + fun DetailContentScreenshotTest() { + val snackbarHostState = remember { SnackbarHostState() } + AppTheme { + DetailContent( + snackbarHostState = snackbarHostState, + app = InstalledApp("Sample App Name", "example.sample.test"), + condition = "^.*$", + onBack = { }, + onDeleteApp = { }, + onConditionChanged = { } + ) + } + } + + @Preview(backgroundColor = 0xFFC7B5A8, showBackground = true) + @Composable + fun SelectionContentScreenshotTest() { + AppTheme { + SelectionContent( + items = Sample.items, + isLoading = false, + onAppSelected = { }, + initQuery = "", + onQueryInputted = { } + ) + } + } + + @Preview(backgroundColor = 0xFFC7B5A8, showBackground = true) + @Composable + fun SettingsContentScreenshotTest() { + AppTheme { + SettingsContent( + address = "192.168.11.2:5555", + versionCode = 1, + versionName = "1.0", + onValueChange = { }, + onNotifyTest = { }, + onExportData = { }, + onImportData = { }, + onLicense = { }, + onAboutDeveloper = { } + ) + } + } + + // endregion + + // region: コンポーネントレベル + + @Preview(backgroundColor = 0xFFC7B5A8, showBackground = true) + @Composable + fun AppListComponentScreenshotTest() { + val items = listOf( + InstalledApp("Sample App", "me.nya_n.notificationnotifier"), + InstalledApp( + "Sample App Name So Looooooooooooooooong", + "me.nya_n.notificationnotifier" + ), + ) + AppTheme { + AppList( + items = items, + onAppSelected = { } + ) + } + } + + @Preview(backgroundColor = 0xFFC7B5A8, showBackground = true) + @Composable + fun EmptyAppListComponentScreenshotTest() { + AppTheme { + AppList( + items = emptyList(), + onAppSelected = { } + ) + } + } + + @Preview + @Composable + fun AppOutlinedButtonComponentScreenshotTest() { + AppTheme { + AppOutlinedButton("text") { } + } + } + + @Preview + @Composable + fun AppScaffoldComponentScreenshotTest() { + val snackbarHostState = remember { SnackbarHostState() } + AppTheme { + AppScaffold(snackbarHostState) { } + } + } + + @Preview + @Composable + fun CategoryComponentScreenshotTest() { + AppTheme { + Category("カテゴリ") + } + } + + @Preview + @Composable + fun CommonDialogComponentScreenshotTest() { + AppTheme { + CommonDialog( + message = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", + positiveButtonText = "YES", + negativeButtonText = "NO", + onPositiveDismissRequest = { }, + onNegativeDismissRequest = { } + ) + } + } + + @Preview + @Composable + fun RequireNotificationPermissionDialogComponentScreenshotTest() { + AppTheme { + RequireNotificationPermissionDialog( + onDismissRequest = { } + ) + } + } + + @Preview + @Composable + fun RequirePackageVisibilityDialogComponentScreenshotTest() { + AppTheme { + RequirePackageVisibilityDialog( + onDismissRequest = { } + ) + } + } + + @Preview + @Composable + fun EmptyViewComponentScreenshotTest() { + AppTheme { + EmptyView(message = "empty") + } + } + + @Preview + @Composable + fun TopBarComponentScreenshotTest() { + AppTheme { + TopBar() + } + } + + @Preview + @Composable + fun SubContentTopBarComponentScreenshotTest() { + AppTheme { + TopBar( + hasBackContent = true, + onBack = { } + ) + } + } + + // endregion +} \ No newline at end of file