Skip to content

Commit

Permalink
Check Spotless(Code Convention)
Browse files Browse the repository at this point in the history
  • Loading branch information
taewooyo committed Apr 17, 2024
1 parent 474d10a commit d7fe548
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 19 deletions.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!--
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
17 changes: 16 additions & 1 deletion app/src/main/kotlin/com/taewooyo/volcano/MainApplication.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
/*
* Copyright (C) 2023 taewooyo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.taewooyo.volcano

import android.app.Application
import dagger.hilt.android.HiltAndroidApp

@HiltAndroidApp
class MainApplication : Application()
class MainApplication : Application()
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 taewooyo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.taewooyo.volcano.core.assets

import android.content.Context
Expand All @@ -18,4 +33,4 @@ class AssetLoader @Inject constructor(private val context: Context) {
String(bytes)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 taewooyo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.taewooyo.volcano.core.assets.di

import android.content.Context
Expand All @@ -16,4 +31,4 @@ internal object AssetModule {
@Provides
@Singleton
fun provideAssetLoader(@ApplicationContext context: Context): AssetLoader = AssetLoader(context)
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 taewooyo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.taewooyo.volcano.core.data.di

import com.taewooyo.volcano.core.data.stock.StockRepository
Expand All @@ -13,4 +28,4 @@ internal interface DataModule {

@Binds
fun bindsStockRepository(stockRepositoryImpl: StockRepositoryImpl): StockRepository
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
/*
* Copyright (C) 2023 taewooyo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.taewooyo.volcano.core.data.stock

import com.taewooyo.volcano.core.model.Stocks
import kotlinx.coroutines.flow.Flow

interface StockRepository {

fun fetchStockList(): Stocks?
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 taewooyo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.taewooyo.volcano.core.data.stock

import com.google.gson.Gson
Expand All @@ -6,12 +21,12 @@ import com.taewooyo.volcano.core.model.Stocks
import javax.inject.Inject

class StockRepositoryImpl @Inject constructor(
private val assetLoader: AssetLoader
private val assetLoader: AssetLoader,
) : StockRepository {
override fun fetchStockList(): Stocks? {
val gson = Gson()
return assetLoader.getJsonString("stock.json")?.let { jsonString ->
gson.fromJson(jsonString, Stocks::class.java)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
package com.taewooyo.volcano.core.model

data class Stocks(
val stocks: List<StockItem>
val stocks: List<StockItem>,
)

data class StockItem(
val name: String,
val value: Double,
val oldValue: Double,
val type: String,
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class MainActivity : ComponentActivity() {
}
}


Box(modifier = Modifier.fillMaxSize()) {
Volcano(
modifier = Modifier,
Expand Down
19 changes: 17 additions & 2 deletions app/src/main/kotlin/com/taewooyo/volcano/ui/MainViewModel.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
/*
* Copyright (C) 2023 taewooyo
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.taewooyo.volcano.ui

import androidx.lifecycle.ViewModel
Expand All @@ -13,7 +28,7 @@ import javax.inject.Inject

@HiltViewModel
class MainViewModel @Inject constructor(
private val stockRepository: StockRepository
private val stockRepository: StockRepository,
) : ViewModel() {

private val _stocks: MutableStateFlow<Stocks> = MutableStateFlow(value = Stocks(emptyList()))
Expand All @@ -29,4 +44,4 @@ class MainViewModel @Inject constructor(
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package com.taewooyo.volcano.compose

import androidx.compose.animation.animateContentSize
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
Expand All @@ -30,7 +29,6 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
Expand All @@ -40,16 +38,13 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.Layout
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
Expand Down

0 comments on commit d7fe548

Please sign in to comment.