New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add controls to set custom size. Add new preference storage model #16
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16 +/- ##
==========================================
- Coverage 24.79% 22.5% -2.3%
Complexity 61 61
==========================================
Files 52 64 +12
Lines 1105 1231 +126
Branches 137 149 +12
==========================================
+ Hits 274 277 +3
- Misses 801 923 +122
- Partials 30 31 +1
Continue to review full report at Codecov.
|
import com.devindi.wallpaper.settings.size.SizeViewHolder | ||
import com.devindi.wallpaper.source.OnItemClickListener | ||
|
||
class SettingsAdapter(private val clickListener: OnItemClickListener) : RecyclerView.Adapter<RecyclerView.ViewHolder>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceeded max line length (100) (cannot be auto-corrected) |
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder { | ||
val view = LayoutInflater.from(parent.context).inflate(R.layout.settings_simple_item, parent, false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceeded max line length (100) (cannot be auto-corrected) |
import com.devindi.wallpaper.settings.model.SettingsField | ||
import com.devindi.wallpaper.settings.model.SettingsManager | ||
|
||
class SettingsViewModel(private val settingsManager: SettingsManager): ViewModel() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing spacing before “:” |
|
||
private val map = HashMap<String, SettingsField<*>>() | ||
private val fieldLive = MutableLiveData<String>() | ||
private val sharedPreferenceChangeListener = SharedPreferences.OnSharedPreferenceChangeListener { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exceeded max line length (100) (cannot be auto-corrected) |
storage.registerOnSharedPreferenceChangeListener(sharedPreferenceChangeListener) | ||
} | ||
|
||
fun getIntField(key: String) : IntField { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected spacing before “:” |
return map[key] as IntField | ||
} | ||
|
||
fun fieldChange() : LiveData<String> = fieldLive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected spacing before “:” |
|
||
fun fieldChange() : LiveData<String> = fieldLive | ||
|
||
private fun addField(field : SettingsField<*>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected spacing before “:” |
No description provided.