Skip to content

Commit

Permalink
Code style
Browse files Browse the repository at this point in the history
  • Loading branch information
devindi committed Oct 16, 2018
1 parent 264baa3 commit 5f08a7b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
Expand Up @@ -9,10 +9,10 @@ class AfterTextChangedListener(val observer: (text: String) -> Unit) : TextWatch
}

override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
//do nothing
// do nothing
}

override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
//do nothing
// do nothing
}
}
Expand Up @@ -13,16 +13,18 @@ import android.widget.SeekBar
* })
*
*/
class SimpleSeekBarChangeListener(private val observer: (progress: Int, fromUser: Boolean) -> Unit) : SeekBar.OnSeekBarChangeListener {
class SimpleSeekBarChangeListener(
private val observer: (progress: Int, fromUser: Boolean) -> Unit
) : SeekBar.OnSeekBarChangeListener {
override fun onProgressChanged(seekBar: SeekBar?, progress: Int, fromUser: Boolean) {
observer(progress, fromUser)
}

override fun onStartTrackingTouch(seekBar: SeekBar?) {
//do nothing
// do nothing
}

override fun onStopTrackingTouch(seekBar: SeekBar?) {
//do nothing
// do nothing
}
}
Expand Up @@ -3,7 +3,11 @@ package com.devindi.wallpaper.settings.model
import android.content.SharedPreferences
import android.support.annotation.StringRes

class IntField(private val storage: SharedPreferences, @StringRes public val titleId: Int, override val key: String): SettingsField<Int> {
class IntField(
private val storage: SharedPreferences,
@StringRes public val titleId: Int,
override val key: String
) : SettingsField<Int> {

override fun get(): Int {
return get(0)
Expand Down
Expand Up @@ -2,7 +2,10 @@ package com.devindi.wallpaper.settings.model

import android.content.SharedPreferences

class StringField(private val storage: SharedPreferences, override val key: String) : SettingsField<String> {
class StringField(
private val storage: SharedPreferences,
override val key: String
) : SettingsField<String> {

override fun get(): String {
return get("")
Expand Down
Expand Up @@ -7,13 +7,16 @@ import com.devindi.wallpaper.settings.model.IntField
import com.devindi.wallpaper.source.OnItemClickListener
import kotlinx.android.synthetic.main.settings_simple_item.view.*

class SizeViewHolder(view: View, clickListener: OnItemClickListener) : RecyclerView.ViewHolder(view) {
class SizeViewHolder(
view: View,
clickListener: OnItemClickListener
) : RecyclerView.ViewHolder(view) {

private val titleLabel: TextView = view.settings_title
private val valueLabel: TextView = view.settings_value

init {
view.setOnClickListener{
view.setOnClickListener {
clickListener.onItemClick(adapterPosition, it)
}
}
Expand Down
Expand Up @@ -20,7 +20,7 @@ class EditSizeViewModel(private val settingsManager: SettingsManager) : ViewMode
field.set(value)
}

fun wallpaperSize() : LiveData<Int> {
fun wallpaperSize(): LiveData<Int> {
return wallpaperSize
}
}

0 comments on commit 5f08a7b

Please sign in to comment.