-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make MapType to pure class to prepare KMP (#118)
* Make MapType to pure class to prepare KMP * Add test codes to compare * generate metalava
- Loading branch information
Showing
11 changed files
with
176 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
naver-map-compose/src/androidTest/java/com/naver/maps/map/compose/ClassTestUtil.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright 2024 SOUP | ||
* | ||
* 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 | ||
* | ||
* https://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.naver.maps.map.compose | ||
|
||
/** | ||
* The list of the immediate subclasses if this class is a sealed class, or an empty list otherwise. | ||
*/ | ||
internal inline fun <reified T> sealedSubclasses(): List<T> { | ||
return T::class.sealedSubclasses.mapNotNull { it.objectInstance } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
naver-map-compose/src/main/java/com/naver/maps/map/compose/MapType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright 2024 SOUP | ||
* | ||
* 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 | ||
* | ||
* https://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.naver.maps.map.compose | ||
|
||
import androidx.compose.runtime.Immutable | ||
|
||
/** | ||
* μ§λμ μ νμ λνλ΄λ μ΄κ±°ν. | ||
*/ | ||
@Immutable | ||
public sealed interface MapType { | ||
/** | ||
* μΌλ° μ§λ. | ||
*/ | ||
public data object Basic : MapType | ||
|
||
/** | ||
* λ΄λΉκ²μ΄μ μ§λ. | ||
*/ | ||
public data object Navi : MapType | ||
|
||
/** | ||
* μμ± μ§λ. | ||
*/ | ||
public data object Satellite : MapType | ||
|
||
/** | ||
* μμ± μ§λ(κ²Ήμ³λ³΄κΈ°). | ||
*/ | ||
public data object Hybrid : MapType | ||
|
||
/** | ||
* λ΄λΉκ²μ΄μ μ© μμ± μ§λ(κ²Ήμ³λ³΄κΈ°). | ||
*/ | ||
public data object NaviHybrid : MapType | ||
|
||
/** | ||
* μ§νλ. | ||
*/ | ||
public data object Terrain : MapType | ||
|
||
/** | ||
* μμ. μ§λλ λνλμ§ μκ³ μ€λ²λ μ΄λ§μ΄ λνλ©λλ€. | ||
*/ | ||
public data object None : MapType | ||
} |
Oops, something went wrong.