Skip to content

Commit

Permalink
Update volcano-compose module, spotless script
Browse files Browse the repository at this point in the history
  • Loading branch information
taewooyo committed Nov 3, 2023
1 parent 810e81c commit 7d8fd29
Show file tree
Hide file tree
Showing 27 changed files with 467 additions and 256 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/com/example/volcano/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 bn-tw2020
* 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.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_launcher_background.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/drawable/ic_launcher_foreground.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/backup_rules.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/xml/data_extraction_rules.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ kotlin = "1.9.10"
kotlinBinaryCompatibility = "0.13.2"
androidxComposeBom = "2023.10.01"
androidxComposeCompiler = "1.5.3"
jvmTarget = "11"
androidxComposeConstraintLayout = "1.0.1"
androidxMaterial = "1.10.0"
androidxAppcompat = "1.6.1"
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ dependencyResolutionManagement {
rootProject.name = "volcano"
include(":app")
include(":volcano")
include(":volcano-compose")
2 changes: 1 addition & 1 deletion spotless/spotless.license.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 bn-tw2020
* 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.
Expand Down
2 changes: 1 addition & 1 deletion spotless/spotless.license.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 2023 bn-tw2020
Designed and developed by 2023 taewooyo
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
1 change: 1 addition & 0 deletions volcano-compose/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
64 changes: 64 additions & 0 deletions volcano-compose/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import com.example.buildsrc.Configuration

@Suppress("DSL_SCOPE_VIOLATION")
plugins {
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
}

android {
compileSdk = Configuration.compileSdk
namespace = "com.example.volcano.compose"

defaultConfig {
minSdk = Configuration.minSdk
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get()
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

kotlinOptions {
jvmTarget = libs.versions.jvmTarget.get()
}

packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}
}

lint {
abortOnError = false
}
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.freeCompilerArgs += listOf(
"-Xexplicit-api=strict",
"-opt-in=com.skydoves.balloon.annotations.InternalBalloonApi",
)
}

tasks.withType(JavaCompile::class.java).configureEach {
this.targetCompatibility = libs.versions.jvmTarget.get()
this.sourceCompatibility = libs.versions.jvmTarget.get()
}

dependencies {
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.material)
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.activity.compose)
implementation(libs.androidx.lifecycle)
}
Empty file.
21 changes: 21 additions & 0 deletions volcano-compose/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
17 changes: 17 additions & 0 deletions volcano-compose/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Designed and developed by 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.
-->
<manifest package="com.example.volcano.compose" />
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
/*
* 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.example.volcano.configuration

enum class LayoutOrientation {
VERTICAL,
HORIZONTAL;
VERTICAL,
HORIZONTAL,
;

fun toggle(layoutOrientation: LayoutOrientation): LayoutOrientation =
if (layoutOrientation == HORIZONTAL) VERTICAL else HORIZONTAL
}
fun toggle(layoutOrientation: LayoutOrientation): LayoutOrientation =
if (layoutOrientation == HORIZONTAL) VERTICAL else HORIZONTAL
}
19 changes: 17 additions & 2 deletions volcano/src/main/kotlin/com/example/volcano/squarified/Measurer.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
/*
* 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.example.volcano.squarified

interface Measurer {

fun measureNodes(values: List<Double>, width: Int, height: Int): List<TreemapNode>
}
fun measureNodes(values: List<Double>, width: Int, height: Int): List<TreemapNode>
}
Loading

0 comments on commit 7d8fd29

Please sign in to comment.