android-classic icon indicating copy to clipboard operation
android-classic copied to clipboard

Tablet layout

Open noelbautista91 opened this issue 7 years ago • 3 comments

1 minute Demo incoming standard-notes-tablet-demo-gif

~There are some crashes happening with this PR, all of what I found are related to configuration changes (rotation, multiwindow, etc)~ Crashes related to rotation and configuration changes are squashed! Please report if you find any

Please feel free to comment/modify to this PR whatever it needs to be ready for production!

I would rather have us fix all related issues before merging in this PR. it's a good size and can potentially introduce a lot of issues. On the surface this PR seems to change a lot of classes, but a good number of them is just modifying layouts, menu xmls, renaming some ids, etc to enable tablet layout.

I've added UI tests for tablet ~(in a separate test). You could probably annotate this test to only run on tablet layouts.~ Given the similarities of phone vs tablet layout, they are packed into one suite of tests.

Syncing seems to work fine, thanks to the well abstracted data store classes :D

TODO:

  • Test different scenarios for orientation changes

More photos: screen shot 2017-03-10 at 5 51 11 pm screen shot 2017-03-10 at 5 51 21 pm

noelbautista91 avatar Mar 10 '17 20:03 noelbautista91

@deftelf Implemented some of your comments, I have yet to try out the solution you suggested for the action bar stuff.

Changing to w600dp now shows the "tablet" layout for a phablet (Pixel XL) in landscape mode.

This broke our tests (just for phablets in landscape mode), I think because "phones" do not present the home screen / menu in landscape the way tablet does. If you run the test suite, you'd see that whenever the stuff in @Before is called, the app actually starts up another instance of itself in portrait mode and then rotates to landscape. This adds a weird delay in our test suite, making it fail.

Not sure what a proper solution is (but I was considering making the test wait.. D:) But maybe our tests need some refactoring. Maybe we don't need to have the signin stuff in Before and the logout stuff in @After. Instead we could just call these manually at the beginning and end of each test (tagSomething, createNote, etc).

This way, the app wouldn't have to create a new instance of itself for each test. The tests would each have to logout and bring itself back to the LoginActivity by calling logout() at the end of each test instead of using @After. They would also have to begin with signin() instead having signin() in @Before, and move the line that starts an instance of the StarterActivity to somewhere else that gets called only when the StarterActivityTest is run.

There is a way to make Espresso only call @Before and @After only before and after the start of the test class, instead of each test method. I propose we do that and have our IdlingResource register and unregister there, as well as starting StarterActivity in @Before.

noelbautista91 avatar Mar 15 '17 05:03 noelbautista91

Just rebased this branch the latest code.

I played around with the test last night to get it to pass on a Pixel XL emulator on landscape, but to no success. If anyone would wanna take a stab at it please feel free. Tests pass on portrait mode for phones, and in landscape mode for tablets. Doesn't seem to pass on landscape modes for phablets.

What would get this feature to be merged? It looks pretty ready, maybe some more real world testing.

noelbautista91 avatar Mar 22 '17 15:03 noelbautista91

Looking good. I would like to get the encryption change out first this weekend as a 1.0 release, then probably load this and test it over the week and put out as 1.1

deftelf avatar Mar 22 '17 16:03 deftelf