Skip to content

Added Library Poster Size Slider#2714

Open
AryanMir15 wants to merge 4 commits intorecloudstream:masterfrom
AryanMir15:clean-implementation
Open

Added Library Poster Size Slider#2714
AryanMir15 wants to merge 4 commits intorecloudstream:masterfrom
AryanMir15:clean-implementation

Conversation

@AryanMir15
Copy link
Copy Markdown

@AryanMir15 AryanMir15 commented Apr 22, 2026

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.
Screenshot_2026-04-22-17-15-16-71_bba4627ecec1346e77f282610a5b88e8

Copy link
Copy Markdown
Collaborator

@fire-light42 fire-light42 left a comment

Choose a reason for hiding this comment

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

Good idea, you just need to fix many small details.

Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/library/PageAdapter.kt Outdated
Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/library/PageAdapter.kt Outdated
val baseSpanCount = context.getSpanCount()
val adjustedSpanCount = maxOf(1, (baseSpanCount / (1.0f + scale * 0.1f)).roundToInt())
// Update the RecyclerView's spanCount
resView.spanCount = adjustedSpanCount
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This breaks when users rotate their phones back and forth.

Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/library/PageAdapter.kt Outdated
Comment thread app/src/main/java/com/lagradost/cloudstream3/ui/settings/SettingsUI.kt Outdated

<SeekBarPreference
android:defaultValue="0"
android:defaultValue="5"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why change the default value here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is not removed? You still have android:defaultValue="5", please change it back to 0. 😕

Comment thread .gitignore Outdated
Copy link
Copy Markdown
Contributor

@Luna712 Luna712 left a comment

Choose a reason for hiding this comment

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

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
true
}

getPref(R.string.library_poster_size_key)?.setOnPreferenceChangeListener { _, newValue ->
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This entire block is unnecessary

@AryanMir15 AryanMir15 requested a review from Luna712 April 23, 2026 08:03
Copy link
Copy Markdown
Collaborator

@fire-light42 fire-light42 left a comment

Choose a reason for hiding this comment

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

Remember to also fix the previous unaddressed comments.

Comment thread app/src/main/res/values/strings.xml Outdated
<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>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

These are now inaccurate, please update the accordingly.

@AryanMir15 AryanMir15 requested a review from fire-light42 April 24, 2026 17:17
Copy link
Copy Markdown
Collaborator

@fire-light42 fire-light42 left a comment

Choose a reason for hiding this comment

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

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) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This makes no sense as a companion object function since you are affecting the PageAdapter's AutofitRecyclerView.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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) }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is just false, poster size does not change the poster columns.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It is not removed? You still have android:defaultValue="5", please change it back to 0. 😕

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.

3 participants