Skip to content

Commit 2408eca

Browse files
committed
Change code formatting
1 parent 625867f commit 2408eca

File tree

31 files changed

+194
-173
lines changed

31 files changed

+194
-173
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,19 @@ about: Create a report to help us improve
2626

2727
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
2828
<!--- reproduce this bug. Include code to reproduce, if relevant -->
29-
1.
30-
2.
31-
3.
32-
4.
29+
30+
1. step
31+
2. step
32+
3. step
3333

3434
## 📷 Screenshots
35+
3536
<!-- If applicable, add screenshots to help explain your problem. -->
3637

3738
## 📱 Your Environment
3839

3940
<!--- Include as many relevant details about the environment you experienced the bug in -->
4041

41-
* Library/App Version used: <!-- e.g. 1.0.0 -->
42-
* Operating System and version (desktop or mobile): <!-- e.g. Android 12 -->
43-
* Device: <!-- e.g. Nexus 5 -->
42+
- Library/App Version used: <!-- e.g. 1.0.0 -->
43+
- Operating System and version (desktop or mobile): <!-- e.g. Android 12 -->
44+
- Device: <!-- e.g. Nexus 5 -->

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ Please refer to the [ISC License][license] for more information.
124124

125125
## Acknowledgements
126126

127-
* [Best README Template](https://github.com/othneildrew/Best-README-Template)
128-
* [Issue and Pull Request Template](https://www.talater.com/open-source-templates/#/)
129-
* [Reaktive - Project configuration with Gradle Plugins](https://github.com/badoo/Reaktive)
130-
* [Jetpack Compose Theme by Jetsnack](https://github.com/android/compose-samples/tree/main/Jetsnack)
127+
- [Best README Template](https://github.com/othneildrew/Best-README-Template)
128+
- [Issue and Pull Request Template](https://www.talater.com/open-source-templates/#/)
129+
- [Reaktive - Project configuration with Gradle Plugins](https://github.com/badoo/Reaktive)
130+
- [Jetpack Compose Theme by Jetsnack](https://github.com/android/compose-samples/tree/main/Jetsnack)
131131

132132
<!--readme-end-->

TEMPLATE_CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ See [changeset](PROJECT_GITHUB_LINK/compare/v0.0.1...main)
4545

4646
- for explanation how to migrate when BREAKING changes got introduced
4747

48-
4948
## [0.1.0](PROJECT_GITHUB_LINK//releases/tag/v0.1.0)
5049

5150
Example release

TEMPLATE_README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ PROJECT_DESCRIPTION
4444

4545
This is a blank template to get started. First replace following placeholders:
4646

47-
* PROJECT_TITLE
48-
* PROJECT_DESCRIPTION
49-
* PROJECT_GITHUB_LINK
50-
* PROJECT_WEBPAGE_URL
51-
* PROJECT_SONARCLOUD_NAME
47+
- PROJECT_TITLE
48+
- PROJECT_DESCRIPTION
49+
- PROJECT_GITHUB_LINK
50+
- PROJECT_WEBPAGE_URL
51+
- PROJECT_SONARCLOUD_NAME
5252

5353
Assets could be placed under `docs/src/assets/` folder and images should be placed in `docs/src/assets/images/`.
5454

app-android/src/main/kotlin/eu/upwolf/mobile/blueprint/android/ui/reuse/AppScaffold.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import com.google.accompanist.insets.rememberInsetsPaddingValues
3131
import com.google.accompanist.insets.ui.TopAppBar
3232
import eu.upwolf.mobile.blueprint.android.R
3333
import eu.upwolf.mobile.blueprint.common.ui.theme.AppTheme
34-
import eu.upwolf.mobile.blueprint.common.ui.theme.AppThemeDimension
3534

3635
@OptIn(ExperimentalMaterial3Api::class)
3736
@Composable
@@ -61,12 +60,12 @@ fun AppScaffold(
6160

6261
@Preview(
6362
name = "Light preview",
64-
showBackground = true,
63+
showBackground = true
6564
)
6665
@Preview(
6766
name = "Dark preview",
6867
showBackground = true,
69-
uiMode = Configuration.UI_MODE_NIGHT_YES,
68+
uiMode = Configuration.UI_MODE_NIGHT_YES
7069
)
7170
@Composable
7271
fun DefaultPreview() {

app-desktop/src/desktopMain/kotlin/eu/upwolf/mobile/blueprint/desktop/ui/MainApp.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,7 @@
1919
package eu.upwolf.mobile.blueprint.desktop.ui
2020

2121
import androidx.compose.desktop.ui.tooling.preview.Preview
22-
import androidx.compose.foundation.layout.Column
23-
import androidx.compose.foundation.layout.Spacer
24-
import androidx.compose.foundation.layout.fillMaxSize
25-
import androidx.compose.foundation.layout.height
26-
import androidx.compose.foundation.layout.padding
2722
import androidx.compose.runtime.Composable
28-
import androidx.compose.runtime.mutableStateOf
29-
import androidx.compose.runtime.remember
30-
import androidx.compose.ui.Alignment
31-
import androidx.compose.ui.Modifier
32-
import eu.upwolf.mobile.blueprint.common.ui.system.AppSurface
33-
import eu.upwolf.mobile.blueprint.common.ui.system.HeadlineLarge
34-
import eu.upwolf.mobile.blueprint.common.ui.system.ThemeOverview
35-
import eu.upwolf.mobile.blueprint.common.ui.system.ThemeSwitch
36-
import eu.upwolf.mobile.blueprint.common.ui.theme.AppTheme
37-
import eu.upwolf.mobile.blueprint.common.ui.theme.AppThemeMain
3823

3924
@Preview
4025
@Composable

common/ui/foundation/src/androidMain/kotlin/eu/upwolf/mobile/blueprint/common/ui/foundation/painter/AndroidVectorResources.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,4 @@ internal object AndroidVectorResources {
8989
intArrayOf(android.R.attr.name, android.R.attr.pathData)
9090
val STYLEABLE_VECTOR_DRAWABLE_CLIP_PATH_NAME = 0
9191
val STYLEABLE_VECTOR_DRAWABLE_CLIP_PATH_PATH_DATA = 1
92-
9392
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* ISC License
3+
*
4+
* Copyright (c) 2022. Wolf-Martell Montwé (bitfunk)
5+
*
6+
* Permission to use, copy, modify, and/or distribute this software for any
7+
* purpose with or without fee is hereby granted, provided that the above
8+
* copyright notice and this permission notice appear in all copies.
9+
*
10+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15+
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
* PERFORMANCE OF THIS SOFTWARE.
17+
*/
18+
19+
package eu.upwolf.mobile.blueprint.common.ui.foundation.painter
20+
21+
import android.content.res.Configuration
22+
import android.content.res.Resources
23+
import androidx.compose.ui.graphics.vector.ImageVector
24+
import java.lang.ref.WeakReference
25+
26+
internal class ImageVectorCache {
27+
/**
28+
* Key that binds the corresponding theme with the resource identifier for the vector asset
29+
*/
30+
data class Key(
31+
val theme: Resources.Theme,
32+
val id: String
33+
)
34+
35+
/**
36+
* Tuple that contains the [ImageVector] as well as the corresponding configuration flags
37+
* that the [ImageVector] depends on. That is if there is a configuration change that updates
38+
* the parameters in the flag, this vector should be regenerated from the current configuration
39+
*/
40+
data class ImageVectorEntry(
41+
val imageVector: ImageVector,
42+
val configFlags: Int
43+
)
44+
45+
private val map = HashMap<Key, WeakReference<ImageVectorEntry>>()
46+
47+
operator fun get(key: Key): ImageVectorEntry? = map[key]?.get()
48+
49+
fun prune(configChanges: Int) {
50+
val it = map.entries.iterator()
51+
while (it.hasNext()) {
52+
val entry = it.next()
53+
val imageVectorEntry = entry.value.get()
54+
if (imageVectorEntry == null ||
55+
Configuration.needNewResources(configChanges, imageVectorEntry.configFlags)
56+
) {
57+
it.remove()
58+
}
59+
}
60+
}
61+
62+
operator fun set(key: Key, imageVectorEntry: ImageVectorEntry) {
63+
map[key] = WeakReference<ImageVectorEntry>(imageVectorEntry)
64+
}
65+
66+
fun clear() {
67+
map.clear()
68+
}
69+
}

common/ui/foundation/src/androidMain/kotlin/eu/upwolf/mobile/blueprint/common/ui/foundation/painter/PainterResources.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ private fun loadVectorResource(
6565
val key = ImageVectorCache.Key(theme, fileName)
6666
var imageVectorEntry = imageVectorCache[key]
6767
if (imageVectorEntry == null) {
68-
@Suppress("ResourceType") val parser = assets.openXmlResourceParser(fileName)
68+
@Suppress("ResourceType")
69+
val parser = assets.openXmlResourceParser(fileName)
6970
if (parser.seekToStartTag().name != "vector") {
7071
throw IllegalArgumentException(errorMessage)
7172
}

common/ui/foundation/src/androidMain/kotlin/eu/upwolf/mobile/blueprint/common/ui/foundation/painter/VectorResources.kt

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@
1818

1919
package eu.upwolf.mobile.blueprint.common.ui.foundation.painter
2020

21-
import android.content.res.Configuration
2221
import android.content.res.Resources
2322
import android.content.res.XmlResourceParser
2423
import android.util.Xml
25-
import androidx.compose.ui.graphics.vector.ImageVector
2624
import org.xmlpull.v1.XmlPullParserException
27-
import java.lang.ref.WeakReference
2825

2926
/**
3027
* Taken from androidx.compose.ui.res.VectorResources.android.kt
@@ -56,48 +53,3 @@ internal fun loadVectorResourceInner(
5653
}
5754
return ImageVectorCache.ImageVectorEntry(builder.build(), resourceParser.config)
5855
}
59-
60-
internal class ImageVectorCache {
61-
/**
62-
* Key that binds the corresponding theme with the resource identifier for the vector asset
63-
*/
64-
data class Key(
65-
val theme: Resources.Theme,
66-
val id: String
67-
)
68-
69-
/**
70-
* Tuple that contains the [ImageVector] as well as the corresponding configuration flags
71-
* that the [ImageVector] depends on. That is if there is a configuration change that updates
72-
* the parameters in the flag, this vector should be regenerated from the current configuration
73-
*/
74-
data class ImageVectorEntry(
75-
val imageVector: ImageVector,
76-
val configFlags: Int
77-
)
78-
79-
private val map = HashMap<Key, WeakReference<ImageVectorEntry>>()
80-
81-
operator fun get(key: Key): ImageVectorEntry? = map[key]?.get()
82-
83-
fun prune(configChanges: Int) {
84-
val it = map.entries.iterator()
85-
while (it.hasNext()) {
86-
val entry = it.next()
87-
val imageVectorEntry = entry.value.get()
88-
if (imageVectorEntry == null ||
89-
Configuration.needNewResources(configChanges, imageVectorEntry.configFlags)
90-
) {
91-
it.remove()
92-
}
93-
}
94-
}
95-
96-
operator fun set(key: Key, imageVectorEntry: ImageVectorEntry) {
97-
map[key] = WeakReference<ImageVectorEntry>(imageVectorEntry)
98-
}
99-
100-
fun clear() {
101-
map.clear()
102-
}
103-
}

0 commit comments

Comments
 (0)