Skip to content

Conversation

wassupluke
Copy link
Contributor

@wassupluke wassupluke commented Jun 8, 2025

for #83

In general, this limits buttons to 320dp, per Material Design "best practice"(?), but this "best practice" may be changing according to this issue thread here.

Also increases touch target size to a more accessible 48dp.

Without things crashing, I couldn't find a clean way to get the app drawer list off the left edge of the screen (on larger screens). This likely has to do with how the ImageView and TextViews for the apps are expected somewhere upstream when the drawer is launched, but I don't have the time or brainpower to trace that one out yet.

@wassupluke
Copy link
Contributor Author

Visual Summary of Changes

activity_pin_shortcut

before

Screenshot from 2025-06-07 22-20-40

after

Screenshot from 2025-06-07 22-17-47

activity_report_crash

before

Screenshot from 2025-06-07 22-21-17

after

Screenshot from 2025-06-07 22-18-28

dialog_choose_color

before

Screenshot from 2025-06-07 22-21-56

after

Screenshot from 2025-06-07 22-18-38

dialog_report_bug

before

Screenshot from 2025-06-07 22-22-27

after

Screenshot from 2025-06-07 22-18-45

dialog_select_lock_method

before

Screenshot from 2025-06-07 22-23-01

after

Screenshot from 2025-06-07 22-18-54

list_apps

before

Screenshot from 2025-06-07 22-23-23

after

Screenshot from 2025-06-07 22-19-02

settings_actions

before

Screenshot from 2025-06-07 22-24-20

after

Screenshot from 2025-06-07 22-19-47

settings_meta

before

Screenshot from 2025-06-07 22-24-43

after

Screenshot from 2025-06-07 22-19-56

@jrpie
Copy link
Owner

jrpie commented Jun 8, 2025

Thank you! I think in the long run an entirely different layout for tablets would be needed, but this is definitely an improvement over those extremely wide buttons 👍🏼

@jrpie
Copy link
Owner

jrpie commented Jun 8, 2025

Not sure whether we need to be as strict as 320dp, I think that looks a bit weird on the large screens. Perhaps 400dp or even 500dp might be fine?

@wassupluke
Copy link
Contributor Author

Up to you. I just went with 320 because anything over that got Android Studio fussing at me with a soft "warning" that >320dp is too wide. 🤷🏻‍♂️ Again, the 320 number might be updated or removed entirely once the Material Design folks figure their documentation out.

@wassupluke
Copy link
Contributor Author

wassupluke commented Jun 8, 2025

I also updated the touch target size to 48dp so things are easier to hit with a finger (most noticeable on the color selector)

@jrpie
Copy link
Owner

jrpie commented Jun 8, 2025

Up to you. I just went with 320 because anything over that got Android Studio fussing at me with a soft "warning" that >320dp is too wide. 🤷🏻‍♂️ Again, the 320 number might be updated or removed entirely once the Material Design folks figure their documentation out.

Maybe create a value @dimen/max_button_width so it can be changed easily? I think I'd go with 400dp

@wassupluke
Copy link
Contributor Author

The widest view show in my visual summaries is a desktop screen, which I highly doubt anyone will be using anything that large, so you can probably disregard the largest samples above lol

@wassupluke
Copy link
Contributor Author

Having a single place to define the value would be amazing and should be way easier to maintain.

@wassupluke
Copy link
Contributor Author

wassupluke commented Jun 8, 2025

I found maxWidth limitation to be unnecessary in the dialog layouts, as they're already pretty nicely contained to the popup. Removed those constraints from the XML for simplicity.

activity_report_crash is a little goofy with being all left-aligned right now. I'm working on that next, to make it prettier, but it does what it needs to as before, just without spanning buttons across the entire screen.

@wassupluke
Copy link
Contributor Author

Yeah, I can't get the activity_report_crash layout to center cleanly, so I'm leaving it alone.

app:layout_constraintTop_toBottomOf="@id/pin_shortcut_appbar">

<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
Copy link
Owner

Choose a reason for hiding this comment

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

I think changing the LinearLayout to a ConstraintLayout makes the layout rather hard to read and hard to maintain.
Every child of the ConstraintLayout needs to "know" the one before, i.e. when adding or removing something those references need to be updated. Furthermore the constraintWidth_max is repeated again and again.

What about wrapping the LinearLayout in a ConstraintLayout like this?

<androidx.constraintlayout.widget.ConstraintLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:orientation="vertical"

                android:padding="10dp"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                app:layout_constraintWidth_max="500dp">
...

That way the contents of the LinearLayout don't need to be modified.

Copy link
Owner

Choose a reason for hiding this comment

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

Alternatively, one could restrict the width of the LinearLayout like this and use android:layout_gravity="center_horizontal".
I think that is the cleanest solution, since it doesn't require nesting the layouts.

@jrpie jrpie force-pushed the master branch 4 times, most recently from dc3bebb to 2cda589 Compare September 14, 2025 19:10
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.

2 participants