-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
android: Convert progress indicator to Compose UI #46353
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,7 +21,7 @@ | |
| android:id="@+id/urlfield" | ||
| style="@android:style/Widget.Material.EditText" | ||
| android:layout_width="0dp" | ||
| android:layout_height="match_parent" | ||
| android:layout_height="wrap_content" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is required, otherwise the field is clipped vertically when the progress indicator is visible. It's a bit counterintuitive. It's been so long since I've dealt extensively with Android Views, so I'm not really sure why this works, just that it does.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this no longer matters anyway after full migration in the future. |
||
| android:layout_weight="1" | ||
| android:autofillHints="url" | ||
| android:hint="@string/url_or_search" | ||
|
|
@@ -31,14 +31,10 @@ | |
| android:singleLine="true" | ||
| android:layout_marginEnd="10dp" /> | ||
|
|
||
| <com.google.android.material.progressindicator.CircularProgressIndicator | ||
| <androidx.compose.ui.platform.ComposeView | ||
| android:id="@+id/progressbar" | ||
| android:layout_width="0dp" | ||
| android:layout_height="match_parent" | ||
| android:layout_marginEnd="10dp" | ||
| android:indeterminate="true" | ||
| android:visibility="gone" | ||
| app:indicatorSize="20dp" /> | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" /> | ||
|
|
||
| </LinearLayout> | ||
| </com.google.android.material.appbar.MaterialToolbar> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. There's no concept of margin but only padding in Compose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it depends on which order around the
paddingandsizeis. If the function calls were flipped, then it acts like padding.