Skip to content
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

Merged
merged 5 commits into from Oct 16, 2018

Conversation

devindi
Copy link
Owner

@devindi devindi commented Oct 1, 2018

No description provided.

@codecov
Copy link

codecov bot commented Oct 9, 2018

Codecov Report

Merging #16 into master will decrease coverage by 2.29%.
The diff coverage is 3.03%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ Complexity Δ
.../com/devindi/wallpaper/model/map/MapAreaManager.kt 72.72% <ø> (ø) 10 <0> (ø) ⬇️
.../devindi/wallpaper/settings/size/SizeViewHolder.kt 0% <0%> (ø) 0 <0> (?)
...devindi/wallpaper/misc/AfterTextChangedListener.kt 0% <0%> (ø) 0 <0> (?)
...evindi/wallpaper/settings/model/SettingsManager.kt 0% <0%> (ø) 0 <0> (?)
...a/com/devindi/wallpaper/settings/model/IntField.kt 0% <0%> (ø) 0 <0> (?)
...java/com/devindi/wallpaper/misc/NonNullLiveData.kt 0% <0%> (ø) 0 <0> (?)
...wallpaper/settings/size/edit/EditSizeController.kt 0% <0%> (ø) 0 <0> (?)
...om/devindi/wallpaper/settings/model/StringField.kt 0% <0%> (ø) 0 <0> (?)
...m/devindi/wallpaper/model/map/MapImageGenerator.kt 0% <0%> (ø) 0 <0> (?)
...indi/wallpaper/misc/SimpleSeekBarChangeListener.kt 0% <0%> (ø) 0 <0> (?)
... and 18 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fdd63e2...7b9415c. Read the comment docs.

import com.devindi.wallpaper.settings.size.SizeViewHolder
import com.devindi.wallpaper.source.OnItemClickListener

class SettingsAdapter(private val clickListener: OnItemClickListener) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
Copy link
Owner Author

@devindi devindi Oct 13, 2018

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)
Copy link
Owner Author

@devindi devindi Oct 13, 2018

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() {
Copy link
Owner Author

@devindi devindi Oct 13, 2018

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 {
Copy link
Owner Author

@devindi devindi Oct 13, 2018

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 {
Copy link
Owner Author

@devindi devindi Oct 13, 2018

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
Copy link
Owner Author

@devindi devindi Oct 13, 2018

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<*>) {
Copy link
Owner Author

@devindi devindi Oct 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Unexpected spacing before “:”

@devindi devindi merged commit eb40a23 into master Oct 16, 2018
@devindi devindi mentioned this pull request Oct 23, 2018
@devindi devindi deleted the custom_size branch October 23, 2018 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant