Skip to content

Commit

Permalink
Apply spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
MohamedRejeb committed Dec 28, 2023
1 parent b50c962 commit e4bac88
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 38 deletions.
38 changes: 34 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,42 @@ root = true

[*]
charset = utf-8
end_of_line=lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 100
trim_trailing_whitespace = true

[*.{kt,kts}]
ij_kotlin_imports_layout = *
ij_kotlin_allow_trailing_comma = true
ij_kotlin_allow_trailing_comma_on_call_site = true
ij_kotlin_allow_trailing_comma=true
ij_kotlin_allow_trailing_comma_on_call_site=true
ij_kotlin_imports_layout=*

ktlint_standard_annotation=disabled
ktlint_standard_blank-line-before-declaration=disabled
ktlint_standard_discouraged-comment-location=disabled
ktlint_standard_filename=disabled
ktlint_standard_function-naming=disabled
ktlint_standard_function-signature=disabled
ktlint_standard_indent=disabled
ktlint_standard_max-line-length=disabled
ktlint_standard_no-blank-line-in-list=disabled
ktlint_standard_no-empty-first-line-in-class-body=disabled
ktlint_standard_property-naming=disabled
ktlint_standard_spacing-between-declarations-with-annotations=disabled
ktlint_standard_string-template-indent=disabled
ktlint_standard_try-catch-finally-spacing=disabled

# Wrapping
ktlint_standard_argument-list-wrapping=disabled
ktlint_standard_context-receiver-wrapping=disabled
ktlint_standard_enum-wrapping=disabled
ktlint_standard_if-else-wrapping=disabled
ktlint_standard_multiline-expression-wrapping=disabled
ktlint_standard_parameter-wrapping=disabled
ktlint_standard_parameter-list-wrapping=disabled
ktlint_standard_property-wrapping=disabled
ktlint_standard_statement-wrapping=disabled
ktlint_standard_trailing-comma-on-call-site=disabled
ktlint_standard_trailing-comma-on-declaration-site=disabled
ktlint_standard_wrapping=disabled
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
include:
- target: allTests
os: ubuntu-latest
- target: spotlessCheck
os: ubuntu-latest
# - target: spotlessCheck
# os: ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -38,4 +38,4 @@ jobs:
- name: Build with Gradle
uses: gradle/gradle-build-action@ce999babab2de1c4b649dc15f0ee67e6246c994f
with:
arguments: ${{ matrix.target }}
arguments: ${{ matrix.target }}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ package com.mohamedrejeb.compose.dnd.reorder
import androidx.compose.animation.core.AnimationSpec
import androidx.compose.animation.core.SpringSpec
import androidx.compose.foundation.layout.Box
import androidx.compose.runtime.*
import androidx.compose.runtime.Composable
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.remember
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.DisposableEffect
import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.input.pointer.pointerInput
Expand Down Expand Up @@ -103,7 +107,7 @@ fun <T> ReorderableItem(
)

state.dndState.addOrUpdateDraggableItem(
state = draggableItemState
state = draggableItemState,
)
}
.pointerInput(key, state) {
Expand All @@ -122,7 +126,7 @@ fun <T> ReorderableItem(
onDragEnter = onDragEnter,
onDragExit = onDragExit,
)
.then(modifier)
.then(modifier),
) {
with(reorderableItemScopeImpl) {
content()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
import java.io.File
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.Jar
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.`maven-publish`

plugins {
id("com.diffplug.spotless")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ui

import androidx.compose.foundation.border
import androidx.compose.foundation.gestures.animateScrollBy
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
Expand All @@ -17,11 +16,8 @@ import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import com.mohamedrejeb.compose.dnd.DragAndDropContainer
import com.mohamedrejeb.compose.dnd.annotation.ExperimentalDndApi
import com.mohamedrejeb.compose.dnd.drag.DraggableItem
import com.mohamedrejeb.compose.dnd.drop.dropTarget
import com.mohamedrejeb.compose.dnd.rememberDragAndDropState
import com.mohamedrejeb.compose.dnd.reorder.ReorderContainer
import com.mohamedrejeb.compose.dnd.reorder.ReorderableItem
import com.mohamedrejeb.compose.dnd.reorder.rememberReorderState
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ui

import androidx.compose.foundation.border
import androidx.compose.foundation.gestures.animateScrollBy
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
Expand All @@ -11,7 +10,6 @@ import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.unit.dp
Expand All @@ -22,10 +20,7 @@ import com.mohamedrejeb.compose.dnd.DragAndDropContainer
import com.mohamedrejeb.compose.dnd.drag.DraggableItem
import com.mohamedrejeb.compose.dnd.drop.dropTarget
import com.mohamedrejeb.compose.dnd.rememberDragAndDropState
import com.mohamedrejeb.compose.dnd.reorder.ReorderContainer
import com.mohamedrejeb.compose.dnd.reorder.ReorderableItem
import components.RedBox
import kotlinx.coroutines.launch

object ListToListWithoutReorderScreen: Screen {

Expand Down
12 changes: 1 addition & 11 deletions sample/common/src/commonMain/kotlin/ui/ReorderListScreen.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package ui

import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
Expand Down Expand Up @@ -63,15 +62,12 @@ object ReorderListScreen: Screen {
}
}

@OptIn(ExperimentalFoundationApi::class)
@Composable
private fun ReorderScreenContent(
modifier: Modifier = Modifier,
) {
val scope = rememberCoroutineScope()
val reorderState = rememberReorderState<String>(
dragAfterLongPress = true
)
val reorderState = rememberReorderState<String>()
var items by remember {
mutableStateOf(
listOf(
Expand All @@ -84,12 +80,6 @@ private fun ReorderScreenContent(
"item7",
"item8",
"item9",
"item10",
"item11",
"item12",
"item13",
"item14",
"item15",
)
)
}
Expand Down
2 changes: 1 addition & 1 deletion sample/common/src/iosMain/kotlin/MainViewController.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import androidx.compose.ui.window.ComposeUIViewController

fun MainViewController() = ComposeUIViewController { App() }
fun mainViewController() = ComposeUIViewController { App() }
2 changes: 1 addition & 1 deletion sample/iosApp/iosApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Common

struct ComposeView: UIViewControllerRepresentable {
func makeUIViewController(context: Context) -> UIViewController {
MainViewControllerKt.MainViewController()
MainViewControllerKt.mainViewController()
}

func updateUIViewController(_ uiViewController: UIViewController, context: Context) {}
Expand Down

0 comments on commit e4bac88

Please sign in to comment.