Skip to content

Commit 2803fab

Browse files
committed
Format content following spotless rules
1 parent 04a1c9e commit 2803fab

File tree

6 files changed

+42
-40
lines changed

6 files changed

+42
-40
lines changed

app/src/main/java/net/opatry/adoptacat/MainActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ import androidx.compose.material.Divider
3535
import androidx.compose.material.MaterialTheme
3636
import androidx.compose.material.Surface
3737
import androidx.compose.runtime.Composable
38-
import androidx.compose.runtime.mutableStateOf
3938
import androidx.compose.runtime.getValue
39+
import androidx.compose.runtime.mutableStateOf
4040
import androidx.compose.runtime.saveable.rememberSaveable
4141
import androidx.compose.runtime.setValue
4242
import androidx.compose.ui.Modifier

app/src/main/java/net/opatry/adoptacat/ui/CatDetailsScreen.kt

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
2020
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
*/
22-
2322
package net.opatry.adoptacat.ui
2423

2524
import android.text.format.DateUtils
@@ -102,8 +101,7 @@ fun CatDetailsNone() {
102101
Modifier
103102
.fillMaxWidth()
104103
.fillMaxHeight(0.5f)
105-
.padding(16.dp)
106-
,
104+
.padding(16.dp),
107105
verticalArrangement = Arrangement.Center,
108106
horizontalAlignment = Alignment.CenterHorizontally,
109107
) {
@@ -121,12 +119,12 @@ fun CatDetailsNone() {
121119

122120
@Composable
123121
fun CatDetailsContent(cat: CatModel) {
124-
Column(Modifier
122+
Column(
123+
Modifier
125124
.fillMaxWidth()
126125
.fillMaxHeight()
127126
.verticalScroll(rememberScrollState())
128-
.padding(16.dp)
129-
,
127+
.padding(16.dp),
130128
horizontalAlignment = Alignment.CenterHorizontally,
131129
) {
132130
Row(verticalAlignment = Alignment.CenterVertically) {
@@ -137,8 +135,7 @@ fun CatDetailsContent(cat: CatModel) {
137135
stringResource(cat.gender.stringRes),
138136
Modifier
139137
.padding(start = 12.dp)
140-
.size(36.dp)
141-
,
138+
.size(36.dp),
142139
cat.gender.color,
143140
)
144141
}
@@ -147,7 +144,8 @@ fun CatDetailsContent(cat: CatModel) {
147144
BreedView(cat.breed, Modifier.padding(vertical = 8.dp))
148145

149146
Row(verticalAlignment = Alignment.CenterVertically) {
150-
Box(Modifier
147+
Box(
148+
Modifier
151149
.size(16.dp)
152150
.clip(CircleShape)
153151
.background(cat.pillColor)
@@ -206,8 +204,7 @@ fun CatPictureView(pictureUrl: String, compact: Boolean) {
206204
Modifier
207205
.padding(picturePadding)
208206
.size(pictureSize)
209-
.fillMaxHeight()
210-
,
207+
.fillMaxHeight(),
211208
requestBuilder = {
212209
transformations(
213210
if (compact) {
@@ -235,8 +232,7 @@ fun CatPictureView(pictureUrl: String, compact: Boolean) {
235232
Modifier
236233
.padding(picturePadding)
237234
.size(pictureSize)
238-
.fillMaxHeight()
239-
,
235+
.fillMaxHeight(),
240236
colorFilter = ColorFilter.tint(MaterialTheme.colors.error),
241237
)
242238
}
@@ -252,10 +248,9 @@ fun BreedView(breed: CatBreed, modifier: Modifier = Modifier) {
252248
Modifier
253249
.padding(end = 8.dp)
254250
.size(16.dp)
255-
.rotate(45f)
256-
,
251+
.rotate(45f),
257252
MaterialTheme.colors.secondary,
258253
)
259254
Text(stringResource(breed.stringRes), style = typography.caption)
260255
}
261-
}
256+
}

app/src/main/java/net/opatry/adoptacat/ui/CatModelUIExt.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
2020
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
*/
22-
2322
package net.opatry.adoptacat.ui
2423

2524
import androidx.annotation.StringRes

app/src/main/java/net/opatry/adoptacat/ui/CatsScreen.kt

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,15 @@ fun CatsScreen(viewModel: CatsViewModel, selectedCat: CatModel?, onCatSelected:
6060
Scaffold(
6161
topBar = {
6262
TopAppBar(
63-
navigationIcon = { Icon(Icons.Outlined.Pets, contentDescription = null,
64-
Modifier
65-
.size(48.dp)
66-
.rotate(45f)
67-
.padding(12.dp)) },
63+
navigationIcon = {
64+
Icon(
65+
Icons.Outlined.Pets, contentDescription = null,
66+
Modifier
67+
.size(48.dp)
68+
.rotate(45f)
69+
.padding(12.dp)
70+
)
71+
},
6872
title = { Text(stringResource(R.string.app_name)) },
6973
)
7074
},
@@ -87,20 +91,23 @@ fun CatsStateDispatcher(uiState: CatsScreenState, selectedCat: CatModel?, onCatS
8791

8892
@Composable
8993
fun LoadingCatsContent() {
90-
Box(Modifier.fillMaxWidth().fillMaxHeight(.6f),
91-
contentAlignment = Alignment.Center) {
94+
Box(
95+
Modifier.fillMaxWidth().fillMaxHeight(.6f),
96+
contentAlignment = Alignment.Center
97+
) {
9298
CircularProgressIndicator(Modifier.align(Alignment.Center))
9399
}
94100
}
95101

96102
@Composable
97103
fun ErrorCatsContent(cause: Exception) {
98-
Box(Modifier
104+
Box(
105+
Modifier
99106
.fillMaxWidth()
100107
.fillMaxHeight(.6f)
101-
.padding(8.dp)
102-
,
103-
contentAlignment = Alignment.Center) {
108+
.padding(8.dp),
109+
contentAlignment = Alignment.Center
110+
) {
104111
Text(
105112
stringResource(R.string.cats_list_error, cause.message ?: ""),
106113
color = MaterialTheme.colors.error,
@@ -111,8 +118,10 @@ fun ErrorCatsContent(cause: Exception) {
111118

112119
@Composable
113120
fun EmptyCatsContent() {
114-
Box(Modifier.fillMaxWidth().fillMaxHeight(.6f),
115-
contentAlignment = Alignment.Center) {
121+
Box(
122+
Modifier.fillMaxWidth().fillMaxHeight(.6f),
123+
contentAlignment = Alignment.Center
124+
) {
116125
Text(
117126
stringResource(R.string.cats_list_empty),
118127
style = typography.body1,
@@ -131,10 +140,11 @@ fun LoadedCatsContent(cats: List<CatModel>, selectedCat: CatModel?, onCatSelecte
131140

132141
@Composable
133142
fun CatView(cat: CatModel, isSelected: Boolean, onCatSelected: (CatModel) -> Unit) {
134-
Row(modifier = Modifier
135-
.clickable { onCatSelected(cat) }
136-
.background(if (isSelected) MaterialTheme.colors.secondary.copy(alpha = .2f) else Color.Transparent)
137-
.padding(8.dp)
143+
Row(
144+
modifier = Modifier
145+
.clickable { onCatSelected(cat) }
146+
.background(if (isSelected) MaterialTheme.colors.secondary.copy(alpha = .2f) else Color.Transparent)
147+
.padding(8.dp)
138148
) {
139149
CatPictureView(cat.pictureUrl, compact = true)
140150
Column(
@@ -149,8 +159,7 @@ fun CatView(cat: CatModel, isSelected: Boolean, onCatSelected: (CatModel) -> Uni
149159
stringResource(cat.gender.stringRes),
150160
Modifier
151161
.padding(start = 8.dp)
152-
.size(24.dp)
153-
,
162+
.size(24.dp),
154163
cat.gender.color,
155164
)
156165
}

app/src/main/java/net/opatry/adoptacat/ui/GenderUIExt.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
2020
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
*/
22-
2322
package net.opatry.adoptacat.ui
2423

2524
import androidx.annotation.StringRes
@@ -47,4 +46,4 @@ val Gender.stringRes: Int
4746
get() = when (this) {
4847
Gender.Male -> R.string.gender_male
4948
Gender.Female -> R.string.gender_female
50-
}
49+
}

app/src/main/java/net/opatry/adoptacat/ui/theme/Color.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ val quinacridoneMagenta = Color(0xff993955)
2828
val pearlyPurple = Color(0xffae76a6)
2929
val paleCerulean = Color(0xffa3c3d9)
3030
val lightPeriwinkle = Color(0xffccd6eb)
31-
val ghostWhite = Color(0xffe9ecf5)
31+
val ghostWhite = Color(0xffe9ecf5)

0 commit comments

Comments
 (0)