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

New Drawer module #252

Merged
merged 4 commits into from
Jul 26, 2023
Merged

New Drawer module #252

merged 4 commits into from
Jul 26, 2023

Conversation

PabloOQ
Copy link
Collaborator

@PabloOQ PabloOQ commented Jun 24, 2023

Solves #224.

Not much to explain really, modules that can be hidden are in a separate layout that can change its visibility. The module itself has a button to toggle the visibility.

@github-actions github-actions bot added the Core Change the core code label Jun 24, 2023
@github-actions
Copy link
Contributor

This PR builds correctly, here is the generated apk.
This unsigned version can be installed alongside the original app and should only be used for testing the changes, not for daily usage.

Download testing apk

You must be logged in for the link to work.
The link will expire at 2023-07-08T18:22:18Z.


This is an automatic comment created by a Github Action

@@ -165,7 +166,8 @@

// ------------------- initialize -------------------

private LinearLayout ll_mods;
private LinearLayout ll_shown_mods;
private LinearLayout ll_hidden_mods;

Check warning

Code scanning / Pmd (reported by Codacy)

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
@@ -165,7 +166,8 @@

// ------------------- initialize -------------------

private LinearLayout ll_mods;
private LinearLayout ll_shown_mods;

Check warning

Code scanning / Pmd (reported by Codacy)

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
@TrianguloY
Copy link
Owner

Looks good! Although I wonder if it could be possible with just one linear layout, maybe it was harder to manage the modules own visibility? Probably

I played with it a bit and it behaves as expected, but I think it would need to detect when there are no visible modules on the drawer, to hide it (otherwise clicking the arrow does nothing).

Another improvement would be to replace the arrow with something else (maybe two arrows?) It doesn't look bad, but it feels like it's missing something...

I'll test some things, but feel free to try yourself too.

Thanks!

@Murilogs1910
Copy link
Contributor

Didn't see it, but I guess two arrows would look weird. Maybe Expand Drawer and Collapse Drawer instead? Or Open/Close, or Show/Hide, or whatever, but with text?

@PabloOQ
Copy link
Collaborator Author

PabloOQ commented Jun 26, 2023

Didn't see it, but I guess two arrows would look weird. Maybe Expand Drawer and Collapse Drawer instead? Or Open/Close, or Show/Hide, or whatever, but with text?

I like it, but from other PRs it seems like we are moving away from text in favor of icons.

Another improvement would be to replace the arrow with something else (maybe two arrows?) It doesn't look bad, but it feels like it's missing something...

What about this?

Or maybe using three horizontal dots (meatball, horizontal ellipsis)?

Looks good! Although I wonder if it could be possible with just one linear layout, maybe it was harder to manage the modules own visibility? Probably

Yeah, I tried that. Because the modules are responsible of its own visibility they needed to know if they were in the drawer and the state of the drawer, it would also require tweaking each one to add extra logic in their respective onDisplayUrl(), aside from that each one would need to be notified when opening or closing the drawer.

I played with it a bit and it behaves as expected, but I think it would need to detect when there are no visible modules on the drawer, to hide it (otherwise clicking the arrow does nothing).

I have a fix on my local branch now!

@Murilogs1910
Copy link
Contributor

Murilogs1910 commented Jun 26, 2023

I like it, but from other PRs it seems like we are moving away from text in favor of icons.

Then is it really needed to change it? I personally like the current UI, a single arrow and nothing more. It looks clean. Although I guess in the end it's up to you.

@TrianguloY
Copy link
Owner

I prefer to use icons, yes. It's more of a personal decision, but I think it also has benefits related to translations (an icon is more 'universal', and even though the icon must have a text description, it's less important). I'm open to discussion though.

Anyway, your second screenshot seems more cluttered. What about these? Ranked from top (my favorite) to bottom (less favorite)

imageimage

imageimage

imageimage

@Murilogs1910
Copy link
Contributor

Ohh, I like the first one! Both hands can easily reach the buttons, and it's still clean.

As for the second one, I don't think it has any advantages over the current one. It's still in the middle and looks a bit worse, imo.

The last one leaves a lot of free space in the middle, so it looks clean, that's for sure. But I guess it can be a bit hard to press if the border of the menu is too close to the end of the screen.

@TrianguloY
Copy link
Owner

TrianguloY commented Jun 27, 2023

On the three options (on all of them to be precise, Pablo's included) the full row is clickable, the icons placement is just visual.

Even in that case, the first one does looks more "clean", I agree.

@Murilogs1910
Copy link
Contributor

Murilogs1910 commented Jun 27, 2023

On the three options the full row is clickable, the icons placement is just visual.

Oh, I see. Even so, I think that placement is better, as a user will usually try to press the icon there, just like you press the button in other modules (like the Status module and a few others).

Edit: "(on all of them to be precise, Pablo's included)" Oh 🤡

@github-actions
Copy link
Contributor

This PR builds correctly, here is the generated apk.
This unsigned version can be installed alongside the original app and should only be used for testing the changes, not for daily usage.

Download testing apk

You must be logged in for the link to work.
The link will expire at 2023-07-11T15:52:13Z.


This is an automatic comment created by a Github Action

@PabloOQ
Copy link
Collaborator Author

PabloOQ commented Jun 27, 2023

I pushed the fix, no changes in the UI there.

Ohh, I like the first one! Both hands can easily reach the buttons, and it's still clean.

But I guess it can be a bit hard to press

This is why I wanted to put the border of the button, so the user clearly knows the whole module is a button and can comfortably press the button.

Ranked from top (my favorite) to bottom (less favorite)

I also like the first one.

Later I´m going to try something that I think it could work, if not, the best option is probably triangulo's first screenshot.

@PabloOQ
Copy link
Collaborator Author

PabloOQ commented Jun 27, 2023

The button is still the whole module, but it doesn't take the whole space visually so it doesn't feel cramped, I don't think many people will feel the need of tapping on the right/left of the module. The colors are muted so it doesn't stand out. Also is smaller in height.

@TrianguloY
Copy link
Owner

I...don't like the full button border, I prefer it to be invisible. Or maybe tint all the background with a 25% or so transparency? I need to check that.

What I really like is the horizontal line, in fact I tried to do it but didn't know how to do it properly, how did you make it??

For the muted colors, I have tried to make everything that is interactable colored, and everything that isn't grayscale (not everything follows this logic, I know, but most of it does and my idea is to change what doesn't). That button feels like it's disabled somehow, maybe it's just me.

@PabloOQ
Copy link
Collaborator Author

PabloOQ commented Jun 28, 2023

What I really like is the horizontal line, in fact I tried to do it but didn't know how to do it properly, how did you make it??

Well, I wouldn't say I did it properly, I was hoping to get it sorted out later if we went that way😅. The height of the separator is forced to 3px, and to keep it centered is just a bunch of space.
image

That button feels like it's disabled somehow, maybe it's just me.

Agh, you are right, didn't think of it but it does give that feel indeed.

@TrianguloY
Copy link
Owner

Oh! That seems much easier, I though the line was inside the button somehow. In any case that may be even easier, I don't think you need any extra space views, just set the gravity to center and apply some padding.

Btw, I won't be able to work on the app for a couple weeks, and I would like to review properly before merging, sorry. I just published version 2.12 to avoid taking more time, but on my return this is the first thing I'll check. If you want to develop other changes you can either create a new branch from master (in parallel, so the drawer code won't be there) or just create it from this one (in series, as if this one was master). In any case I can later merge/rebase as necessary, so don't worry about that and just do whichever you are more comfortable with. Great job in any case! and sorry again

@TrianguloY
Copy link
Owner

And the last tests I wanted to make. I prefer the first, but I don't dislike the second one.

imageimage

imageimage

@PabloOQ
Copy link
Collaborator Author

PabloOQ commented Jun 28, 2023

Btw, I won't be able to work on the app for a couple weeks, and I would like to review properly before merging, sorry.

No worries! I'll move on to the incognito issue then.

And the last tests I wanted to make. I prefer the first, but I don't dislike the second one.

I prefer the second one. The first one... I just can't unsee it, to me it looks like an emoji >_<

@Murilogs1910
Copy link
Contributor

I'm not a fan of the tinted background, so I prefer the first one. But I guess in the end both are fine.

The first one... I just can't unsee it, to me it looks like an emoji >_<

It's been decided, we must go with the first one.

@github-actions
Copy link
Contributor

This PR builds correctly, here is the generated apk.
This unsigned version can be installed alongside the original app and should only be used for testing the changes, not for daily usage.

Download testing apk

You must be logged in for the link to work.
The link will expire at 2023-08-06T19:13:06Z.


This is an automatic comment created by a Github Action

/**
* Last call for any update a module may need (like the drawer module needing to know how many modules are visible).
*/
public void onFinishUrl(UrlData urlData) {

Check warning

Code scanning / Pmd (reported by Codacy)

Document empty method body

Document empty method body
@@ -165,7 +178,8 @@

// ------------------- initialize -------------------

private LinearLayout ll_mods;
private LinearLayout ll_main;
private LinearLayout ll_drawer;

Check warning

Code scanning / Pmd (reported by Codacy)

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
@@ -165,7 +178,8 @@

// ------------------- initialize -------------------

private LinearLayout ll_mods;
private LinearLayout ll_main;

Check warning

Code scanning / Pmd (reported by Codacy)

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.

Fields should be declared at the top of the class, before any method declarations, constructors, initializers or inner classes.
@TrianguloY
Copy link
Owner

Ok, so... Hi! I'm back.

Let me be honest, I don't like how the drawer module requires 'special' features, maybe it should have been better to add it as a built-in feature, I don't know. I still like it being a module though.

I tried to extract the logic, move it to a different file, even using callbacks; but everything was just worse because your solution is both simple and easy.

So, I just made some minor renames and cleanups, and made a special callback for the visibility problem (I don't like the modules to be ordered, they were in the past and it had a lot of issues) and kept your logic.

I'll test this version on my device for a couple days, if I don't see anything strange I'll merge it!
Anyone is encouraged to test it and give their opinion too.

@PabloOQ
Copy link
Collaborator Author

PabloOQ commented Jul 24, 2023

Let me be honest, I don't like how the drawer module requires 'special' features, maybe it should have been better to add it as a built-in feature, I don't know. I still like it being a module though.

I feel the same but it required minimal changes. At the very least it needs a way to be visualized in the modules screen, that would mean either add it as a module or make changes to the module screen, which, among other things, I felt it would take more time.

So, I just made some minor renames and cleanups, and made a special callback for the visibility problem (I don't like the modules to be ordered, they were in the past and it had a lot of issues) and kept your logic.

I did two versions of this, as I wasn't conviced either on sorting the modules, but the other one, while minimal, required changes in all modules, as I wanted to reuse the module ids, but that is currently not possible from the AModuleDialog class. You can check it out here if you want (there is a stream that needed changing as it should not work on lower android versions).

Btw, I'm still working on the incognito issue, but don't expect it soon as it is taking me some time.

@TrianguloY
Copy link
Owner

After some daily usage, it is stable and working.
No one (if any has tested) hasn't said anything either, so...

Merged! 🥳

@TrianguloY TrianguloY merged commit f4c4944 into TrianguloY:master Jul 26, 2023
@PabloOQ PabloOQ deleted the separator-module branch January 20, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Change the core code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants