Skip to content

Commit

Permalink
Fixed ktlint issues and added codeStyleConfig.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasschuerg committed Feb 10, 2019
1 parent 5fd0a03 commit d74c352
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 27 deletions.
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@

*.iml
.idea/libraries
.idea/misc.xml
.idea/modules.xml
.idea/runConfigurations.xml
.idea/vcs.xml
.idea/workspace.xml
.idea/caches/build_file_checksums.ser
.idea/gradle.xml


.gradle
/local.properties
/.idea
.DS_Store
/build
/captures
Expand Down
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import de.tobiasschuerg.weekview.data.Event
import de.tobiasschuerg.weekview.data.EventConfig
import de.tobiasschuerg.weekview.data.WeekData
import de.tobiasschuerg.weekview.view.EventView
import kotlinx.android.synthetic.main.activity_sample.*
import kotlinx.android.synthetic.main.activity_sample.week_view_foo
import org.threeten.bp.DayOfWeek
import org.threeten.bp.LocalDate
import org.threeten.bp.LocalTime
import java.util.*
import java.util.Random
import kotlin.math.absoluteValue

class SampleActivity : AppCompatActivity() {
Expand All @@ -30,7 +30,6 @@ class SampleActivity : AppCompatActivity() {
private val minEventLength = 30
private val maxEventLength = 90


private val data: WeekData by lazy {
WeekData().apply {
var startTime: LocalTime
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 28
versionCode 3
versionName "1.4.0"
versionCode 4
versionName "1.4.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

Expand Down
24 changes: 12 additions & 12 deletions library/src/main/java/de/tobiasschuerg/weekview/data/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ sealed class Event {
abstract val shortTitle: String

data class Single(
override val id: Long,
override val date: LocalDate,
override val title: String,
override val shortTitle: String,
val subTitle: String?,
override val id: Long,
override val date: LocalDate,
override val title: String,
override val shortTitle: String,
val subTitle: String?,

val day: DayOfWeek,
val startTime: LocalTime,
val endTime: LocalTime,
val day: DayOfWeek,
val startTime: LocalTime,
val endTime: LocalTime,

val upperText: String?,
val lowerText: String?,
val upperText: String?,
val lowerText: String?,

val textColor: Int,
val backgroundColor: Int
val textColor: Int,
val backgroundColor: Int
) : Event() {
val duration: Duration = Duration.between(startTime, endTime)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package de.tobiasschuerg.weekview.util

import org.threeten.bp.DayOfWeek
import org.threeten.bp.temporal.WeekFields
import java.util.*
import java.util.Locale

internal object DayOfWeekUtil {

Expand Down Expand Up @@ -84,5 +84,4 @@ internal object DayOfWeekUtil {
else -> throw IllegalStateException("$firstDayOfTheWeek das is not supported as start day")
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ import de.tobiasschuerg.weekview.util.toLocalString
/** this view is only constructed during runtime. */
@SuppressLint("ViewConstructor")
class EventView(
context: Context,
val event: Event.Single,
val config: EventConfig,
var scalingFactor: Float = 1f
context: Context,
val event: Event.Single,
val config: EventConfig,
var scalingFactor: Float = 1f

) : View(context) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import org.threeten.bp.LocalTime
import org.threeten.bp.format.TextStyle
import org.threeten.bp.temporal.ChronoUnit
import org.threeten.bp.temporal.WeekFields
import java.util.*
import java.util.Locale
import kotlin.math.roundToInt

internal class WeekBackgroundView constructor(context: Context) : View(context) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import org.threeten.bp.DayOfWeek
import org.threeten.bp.Duration
import org.threeten.bp.LocalDate
import org.threeten.bp.LocalTime
import java.util.*
import java.util.ArrayList
import kotlin.math.roundToInt

class WeekView(context: Context, attributeSet: AttributeSet) : RelativeLayout(context, attributeSet) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package de.tobiasschuerg.weekview.util
import org.junit.Assert.assertEquals
import org.junit.Test
import org.threeten.bp.DayOfWeek
import java.util.*
import java.util.Locale

class DayOfWeekUtilTest {

Expand Down

0 comments on commit d74c352

Please sign in to comment.