Added Library Poster Size Slider#2714
Added Library Poster Size Slider#2714AryanMir15 wants to merge 4 commits intorecloudstream:masterfrom
Conversation
fire-light42
left a comment
There was a problem hiding this comment.
Good idea, you just need to fix many small details.
| val baseSpanCount = context.getSpanCount() | ||
| val adjustedSpanCount = maxOf(1, (baseSpanCount / (1.0f + scale * 0.1f)).roundToInt()) | ||
| // Update the RecyclerView's spanCount | ||
| resView.spanCount = adjustedSpanCount |
There was a problem hiding this comment.
This breaks when users rotate their phones back and forth.
|
|
||
| <SeekBarPreference | ||
| android:defaultValue="0" | ||
| android:defaultValue="5" |
There was a problem hiding this comment.
Why change the default value here?
There was a problem hiding this comment.
The duplicate defaultValue was already removed in a previous commit the current file only has one defaultValue per SeekBarPreference. Though im also confused as to why its not flagging this as outdated. Or maybe the change is too small to be flagged as outdated
There was a problem hiding this comment.
It is not removed? You still have android:defaultValue="5", please change it back to 0. 😕
Luna712
left a comment
There was a problem hiding this comment.
e: file:///home/runner/work/cloudstream/cloudstream/app/src/main/java/com/lagradost/cloudstream3/ui/library/PageAdapter.kt:36:54 Unresolved reference 'getInt'.
- Replace deprecated PreferenceManager with androidx version - Change slider to directly control grid columns (1-10) - Remove unnecessary activity.recreate() call - Update slider defaults: min=1, max=10, default=3 - Remove incorrect .gitignore entries
8fca68e to
0fd233b
Compare
| true | ||
| } | ||
|
|
||
| getPref(R.string.library_poster_size_key)?.setOnPreferenceChangeListener { _, newValue -> |
There was a problem hiding this comment.
This entire block is unnecessary
fire-light42
left a comment
There was a problem hiding this comment.
Remember to also fix the previous unaddressed comments.
| <string name="poster_size_settings_des">Changes size of posters</string> | ||
| <string name="poster_size_settings">Poster size</string> | ||
| <string name="library_poster_size_settings_des">Changes size of library posters</string> | ||
| <string name="library_poster_size_settings">Library poster size</string> |
There was a problem hiding this comment.
These are now inaccurate, please update the accordingly.
fire-light42
left a comment
There was a problem hiding this comment.
Please read what you contribute before requesting a review.
Your latest changes frankly do not make sense and would have been caught if you reviewed your own code before requesting a review. Read rule 2 of our AI policy.
I expect a baseline level of effort from contributors, since reviewing code takes a lot of time and effort.
If this continues I will be forced to close the pull request. It is okay if you make mistakes, new programmers are welcome, but you need to try your best.
| private val coverHeight: Int get() = (resView.itemWidth / 0.68).roundToInt() | ||
|
|
||
| companion object { | ||
| fun updatePosterSize(resView: AutofitRecyclerView?, context: Context, value: Int? = null) { |
There was a problem hiding this comment.
This makes no sense as a companion object function since you are affecting the PageAdapter's AutofitRecyclerView.
There was a problem hiding this comment.
I am SO sorry for my behavior and thank you so much for being patient with me, the next time i request a review, i wont disappoint, and im very new to open source and i dont wanna force my code into cloudstream, i will fix all of these in the next review.
| } | ||
|
|
||
| getPref(R.string.library_poster_size_key)?.setOnPreferenceChangeListener { _, newValue -> | ||
| context?.let { PageAdapter.updatePosterSize(null, it, newValue as? Int) } |
There was a problem hiding this comment.
This makes no sense as a piece of code, it will only waste CPU cycles.
This will do null?.spanCount = newValue which is a no-op.
| <string name="poster_size_settings_des">Changes size of posters</string> | ||
| <string name="poster_size_settings">Poster size</string> | ||
| <string name="poster_size_settings_des">Changes the number of poster columns</string> | ||
| <string name="poster_size_settings">Poster columns</string> |
There was a problem hiding this comment.
This is just false, poster size does not change the poster columns.
There was a problem hiding this comment.
I am sorry but that actually IS what i had the setting do, i swapped from size to column count which automatically resizes the posters, should i revert back to slider up > poster size increase?
|
|
||
| <SeekBarPreference | ||
| android:defaultValue="0" | ||
| android:defaultValue="5" |
There was a problem hiding this comment.
It is not removed? You still have android:defaultValue="5", please change it back to 0. 😕
Implemented library poster scaling via RecyclerView span count adjustment. Leveraged AI assistance for code review and optimization of the layout logic to ensure the slider transitions are smooth and performant.
Also adds gitignore rules for app/prerelease/ and app/stable/ folders to prevent committing release APK files.
