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

Pressing the Android back button should call servo.goBack instead of hiding the app #21401

Closed
paulrouget opened this issue Aug 14, 2018 · 11 comments · Fixed by #21439
Closed
Labels
C-assigned There is someone working on resolving the issue E-less-complex Straightforward. Recommended for a new contributor. P-android Android devices

Comments

@paulrouget
Copy link
Contributor

… and if we can't go back, it should hide the app.

@paulrouget paulrouget added P-android Android devices E-less-complex Straightforward. Recommended for a new contributor. labels Aug 14, 2018
@highfive
Copy link

Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the #servo channel in IRC.

If you intend to work on this issue, then add @highfive: assign me to your comment, and I'll assign this to you. 😄

@paulrouget
Copy link
Contributor Author

All that needs to be done here is to override onBackPressed, and call mServoView.goBack if we can go back (see onHistoryChanged) or super.onBackPressed if we can't.

@carloabelli
Copy link

I'll try this out.

@highfive: assign me

@highfive highfive added the C-assigned There is someone working on resolving the issue label Aug 15, 2018
@highfive
Copy link

Hey @carloabelli! Thanks for your interest in working on this issue. It's now assigned to you!

@paulrouget
Copy link
Contributor Author

@carloabelli you might want to look at this: https://github.com/servo/servo/wiki/Building-for-Android#working-on-the-user-interface-without-building-servo

@carloabelli
Copy link

Following the build instructions, when trying to compile using gradlew I get the following error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':servoapp:lintVitalMainArmv7Release'.
> Could not resolve all artifacts for configuration ':servoapp:googlevrX86DebugRuntimeClasspath'.
   > Could not find :GVRService:.
     Searched in the following locations:
         file:/home/carloabelli/Documents/dev/servo/target/android_aar/GVRService-.aar
         file:/home/carloabelli/Documents/dev/servo/target/android_aar/GVRService.aar
     Required by:
         project :servoapp > project :servoview

Is there another aar I should download besides servo-latest.aar?

@paulrouget
Copy link
Contributor Author

@carloabelli did you select the build variant "mainArmv7Debug"?

@paulrouget
Copy link
Contributor Author

@carloabelli it looks like :servoview is being built, not :servoview-local? Does Android Studio shows servoview or servoview-local in the sidebar?

@paulrouget
Copy link
Contributor Author

also, make sure to checkout the latest version of servo.

@paulrouget
Copy link
Contributor Author

I've updated the instructions for the command line builds: https://github.com/servo/servo/wiki/Building-for-Android#working-on-the-user-interface-without-building-servo

@carloabelli
Copy link

Okay I will try building it again tonight using the new command line instructions. I'll also make sure to get the lastest version

bors-servo pushed a commit that referenced this issue Aug 21, 2018
Fix Android back button behavior

Pressing the back button should call mServoView.goBack if possible.

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [X] These changes fix #21401  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21439)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-assigned There is someone working on resolving the issue E-less-complex Straightforward. Recommended for a new contributor. P-android Android devices
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants