material-components / material-components/material-components-android
[RatingBar] Request: offer a new class instead of what we have of RatingBar, being able to have width and/or height boundaries for it, to let it scale accordingly to them
Nessuno ha ancora preso questa issue.
- Lingua principale
- Java
- Stelle
- 17.4k
- Fork
- 3.2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Is your feature request related to a problem? Please describe.
Yes. Currently all we can do is either use a large one of a small one by styles:
style="?android:attr/ratingBarStyleSmall"
style="?android:attr/ratingBarStyle"
But if you want it to be smaller/larger, you can't do it using normal ways like on other Views.
I think it's time for this to be more flexible and consistent with the rest of the Views.
Describe the solution you'd like
Be able to make it auto-scale according to the width and/or height that we enforce to it, just like any other View, such as ImageView, etc...
Not to mention it ruins the View itself (if you make it smaller by half, it reaches a point it shows 3 stars instead of 5, for example).
Describe alternatives you've considered
We can use "scaleX" and "scaleY", but those aren't recommended for this, and you lose the point of using real dimensions and constraints this way.
Additional context
Can be useful for native ads, for example:
https://support.google.com/admob/answer/6329638#zippy=%2Csee-examples-of-each-standard-native-ad-format:~:text=video%20content%20ad-,Native%20app%20install%20ad,-Native%20video%20app
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
La issue nomina la RatingBar esistente, ma non indica file di implementazione né test. Inizia individuando la sua implementazione e gli attuali test di dimensionamento, quindi definisci il comportamento supportato per larghezza e altezza e verifica che le istanze soggette a vincoli mantengano la visualizzazione prevista delle stelle.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android, java
- Ambito
- mobile
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100