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

Use consistent naming & constructors in custom views #1540

Merged
merged 1 commit into from Mar 21, 2022

Conversation

nielsvanvelzen
Copy link
Member

@nielsvanvelzen nielsvanvelzen commented Mar 20, 2022

We have quite a bit custom views. A lot of them, unfortunately, still written in Java. This PR only focusses on the Kotlin based views.

Changes

  • Use consistent naming for custom views
    • End with "Layout" for layouting (FadeViewSwitcherLayout)
    • End with "Preference" for preferences
    • End with "View" for all other views
  • Always use this particular constructor, with defStyleRes omitted if the extended view does not support it (like AppCompatTextView)
     class MyAwesomeCustomView @JvmOverloads constructor(
    	context: Context,
    	attrs: AttributeSet? = null,
    	defStyleAttr: Int = 0,
    	defStyleRes: Int = 0,
    ) : View(context, attrs, defStyleAttr, defStyleRes)

Issues

@nielsvanvelzen nielsvanvelzen added this to In progress in v0.14.0 via automation Mar 20, 2022
v0.14.0 automation moved this from In progress to Reviewer approved Mar 21, 2022
@nielsvanvelzen nielsvanvelzen merged commit bd64d14 into jellyfin:master Mar 21, 2022
v0.14.0 automation moved this from Reviewer approved to Done Mar 21, 2022
@nielsvanvelzen nielsvanvelzen deleted the view-consistency branch March 21, 2022 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
v0.14.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants