Skip to content

Commit d74c352

Browse files
committed
Fixed ktlint issues and added codeStyleConfig.
1 parent 5fd0a03 commit d74c352

File tree

11 files changed

+69
-27
lines changed

11 files changed

+69
-27
lines changed

.gitignore

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
12
*.iml
3+
.idea/libraries
4+
.idea/misc.xml
5+
.idea/modules.xml
6+
.idea/runConfigurations.xml
7+
.idea/vcs.xml
8+
.idea/workspace.xml
9+
.idea/caches/build_file_checksums.ser
10+
.idea/gradle.xml
11+
12+
213
.gradle
314
/local.properties
4-
/.idea
515
.DS_Store
616
/build
717
/captures

.idea/codeStyles/Project.xml

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/codeStyles/codeStyleConfig.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/main/java/de/tobiasschuerg/weekview/sample/SampleActivity.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import de.tobiasschuerg.weekview.data.Event
1414
import de.tobiasschuerg.weekview.data.EventConfig
1515
import de.tobiasschuerg.weekview.data.WeekData
1616
import de.tobiasschuerg.weekview.view.EventView
17-
import kotlinx.android.synthetic.main.activity_sample.*
17+
import kotlinx.android.synthetic.main.activity_sample.week_view_foo
1818
import org.threeten.bp.DayOfWeek
1919
import org.threeten.bp.LocalDate
2020
import org.threeten.bp.LocalTime
21-
import java.util.*
21+
import java.util.Random
2222
import kotlin.math.absoluteValue
2323

2424
class SampleActivity : AppCompatActivity() {
@@ -30,7 +30,6 @@ class SampleActivity : AppCompatActivity() {
3030
private val minEventLength = 30
3131
private val maxEventLength = 90
3232

33-
3433
private val data: WeekData by lazy {
3534
WeekData().apply {
3635
var startTime: LocalTime

library/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
defaultConfig {
1111
minSdkVersion 16
1212
targetSdkVersion 28
13-
versionCode 3
14-
versionName "1.4.0"
13+
versionCode 4
14+
versionName "1.4.1"
1515

1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717

library/src/main/java/de/tobiasschuerg/weekview/data/Event.kt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ sealed class Event {
1313
abstract val shortTitle: String
1414

1515
data class Single(
16-
override val id: Long,
17-
override val date: LocalDate,
18-
override val title: String,
19-
override val shortTitle: String,
20-
val subTitle: String?,
16+
override val id: Long,
17+
override val date: LocalDate,
18+
override val title: String,
19+
override val shortTitle: String,
20+
val subTitle: String?,
2121

22-
val day: DayOfWeek,
23-
val startTime: LocalTime,
24-
val endTime: LocalTime,
22+
val day: DayOfWeek,
23+
val startTime: LocalTime,
24+
val endTime: LocalTime,
2525

26-
val upperText: String?,
27-
val lowerText: String?,
26+
val upperText: String?,
27+
val lowerText: String?,
2828

29-
val textColor: Int,
30-
val backgroundColor: Int
29+
val textColor: Int,
30+
val backgroundColor: Int
3131
) : Event() {
3232
val duration: Duration = Duration.between(startTime, endTime)
3333
}

library/src/main/java/de/tobiasschuerg/weekview/util/DayOfWeekUtil.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package de.tobiasschuerg.weekview.util
22

33
import org.threeten.bp.DayOfWeek
44
import org.threeten.bp.temporal.WeekFields
5-
import java.util.*
5+
import java.util.Locale
66

77
internal object DayOfWeekUtil {
88

@@ -84,5 +84,4 @@ internal object DayOfWeekUtil {
8484
else -> throw IllegalStateException("$firstDayOfTheWeek das is not supported as start day")
8585
}
8686
}
87-
8887
}

library/src/main/java/de/tobiasschuerg/weekview/view/EventView.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import de.tobiasschuerg.weekview.util.toLocalString
2424
/** this view is only constructed during runtime. */
2525
@SuppressLint("ViewConstructor")
2626
class EventView(
27-
context: Context,
28-
val event: Event.Single,
29-
val config: EventConfig,
30-
var scalingFactor: Float = 1f
27+
context: Context,
28+
val event: Event.Single,
29+
val config: EventConfig,
30+
var scalingFactor: Float = 1f
3131

3232
) : View(context) {
3333

library/src/main/java/de/tobiasschuerg/weekview/view/WeekBackgroundView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import org.threeten.bp.LocalTime
1717
import org.threeten.bp.format.TextStyle
1818
import org.threeten.bp.temporal.ChronoUnit
1919
import org.threeten.bp.temporal.WeekFields
20-
import java.util.*
20+
import java.util.Locale
2121
import kotlin.math.roundToInt
2222

2323
internal class WeekBackgroundView constructor(context: Context) : View(context) {

library/src/main/java/de/tobiasschuerg/weekview/view/WeekView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import org.threeten.bp.DayOfWeek
2121
import org.threeten.bp.Duration
2222
import org.threeten.bp.LocalDate
2323
import org.threeten.bp.LocalTime
24-
import java.util.*
24+
import java.util.ArrayList
2525
import kotlin.math.roundToInt
2626

2727
class WeekView(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {

library/src/test/java/de/tobiasschuerg/weekview/util/DayOfWeekUtilTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package de.tobiasschuerg.weekview.util
33
import org.junit.Assert.assertEquals
44
import org.junit.Test
55
import org.threeten.bp.DayOfWeek
6-
import java.util.*
6+
import java.util.Locale
77

88
class DayOfWeekUtilTest {
99

0 commit comments

Comments
 (0)