Skip to content

Conversation

@mrahimygk
Copy link
Contributor

Title

"Skip Tutorial" button moved to parent view so that it does not animate by swipes.

Description

I noticed that the button moves by swipes, so I moved it to the parent view.
And I saw that the tutorial is not showing after I started the app again (and I didn't follow the tut, so I needed it again) , I moved the code that says "it is not the first run from now on" to the appropriate activity.

Tests performed

Tested on:

API level 19 : Samsung Grand Prime.
android 8 : Huawei mate 10 lite

Screenshots showing what changed

http://leyth.persiangig.com/github/Screenshot_2018-10-20-19-29-26.png

Now it starts welcome screen after not finishing the pager. Moved "Skip Tutorial" button here so it does not animate by swipe.
Putting  "Skip Tutorial" button here so that it does not animate by swipes.
Removing the set of "first run " flag from here. we set it after the buttons press or on WelcomeActivity's finish()
removing "skip tut" button from here.
Removing  "Skip Tutorial" button from here so that it does not animate by swipes.
Removing  "Skip Tutorial" button from here so that it does not animate by swipes.
Removing  "Skip Tutorial" button from here so that it does not animate by swipes.
the "welcomyesButton" is removed from the child views in pager, so it is optional now.
@codecov-io
Copy link

codecov-io commented Oct 20, 2018

Codecov Report

Merging #1945 into master will increase coverage by 1.16%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1945      +/-   ##
=========================================
+ Coverage    4.36%   5.53%   +1.16%     
=========================================
  Files         211     233      +22     
  Lines       10643   11582     +939     
  Branches      954    1075     +121     
=========================================
+ Hits          465     641     +176     
- Misses      10143   10888     +745     
- Partials       35      53      +18
Impacted Files Coverage Δ
...n/java/fr/free/nrw/commons/auth/LoginActivity.java 0% <ø> (ø) ⬆️
.../java/fr/free/nrw/commons/WelcomePagerAdapter.java 0% <0%> (ø) ⬆️
...main/java/fr/free/nrw/commons/WelcomeActivity.java 0% <0%> (ø) ⬆️
...s/ui/LongTitlePreferences/LongTitlePreference.java 18.18% <0%> (-36.37%) ⬇️
.../free/nrw/commons/di/CommonsApplicationModule.java 27.5% <0%> (-18.34%) ⬇️
app/src/main/java/fr/free/nrw/commons/Utils.java 24.39% <0%> (-8.95%) ⬇️
...a/fr/free/nrw/commons/utils/ContributionUtils.java 7.14% <0%> (-4.98%) ⬇️
...n/java/fr/free/nrw/commons/CommonsApplication.java 41.77% <0%> (-2.14%) ⬇️
...free/nrw/commons/theme/NavigationBaseActivity.java 24.26% <0%> (-1.12%) ⬇️
...ain/java/fr/free/nrw/commons/upload/FileUtils.java 2.13% <0%> (-1.09%) ⬇️
... and 92 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7b7d17a...f224c50. Read the comment docs.

@albendz
Copy link
Contributor

albendz commented Oct 22, 2018

Will test.

@albendz
Copy link
Contributor

albendz commented Oct 23, 2018

Sorry, can't test. Failing builds from PR and master. Will need to figure this out separately.

@maskaravivek
Copy link
Contributor

The PR works well for me but I just noticed that on a fresh install the WelcomeActivity isn't launched(both on master and this PR branch). The PR fixes the issue where "Skip tutorial" used to animate on swiping the page but we need to check why WelcomeActivity isn't being shown on fresh installs.

Copy link
Member

@domdomegg domdomegg left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Just a couple of comments:

  • I'd add a couple of missing JavaDocs - I think it would be useful to explain rationale behind onBackPressed (would basically be same as comment on L98) and finishTutorial
  • Not required for this PR, but it might be an idea to rename the id for the skip button. I believe it used to be a yes/no choice but now as it's just a skip button it should have a name to reflect that.

@commons-app commons-app deleted a comment Nov 4, 2018
@domdomegg
Copy link
Member

@m-rahimy You've made good changes - are you able to make the changes I've requested?

@maskaravivek
Copy link
Contributor

@domdomegg I think @m-rahimy is away and if the functionality added by the PR is fine, we can probably merge the PR and open separate issues for the comments that you have added. :)

@domdomegg
Copy link
Member

domdomegg commented Dec 12, 2018

Digging deeper, we also probably want the same behavior on landscape so those layouts need to be updated too. Have added Javadoc, and happy @maskaravivek to merge.

@maskaravivek
Copy link
Contributor

@domdomegg Can you open an issue for landscape mode?

@domdomegg
Copy link
Member

@domdomegg Can you open an issue for landscape mode?

#2103

Copy link
Member

@domdomegg domdomegg left a comment

Choose a reason for hiding this comment

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

Doing some more testing this crashes the beta version as it looks for the welcomeYesButton in the page layout which doesn't exist, causing a NPE when it tries to set visibility. Will try to fix myself.

@domdomegg domdomegg mentioned this pull request Dec 16, 2018
@domdomegg
Copy link
Member

Will need someone else to merge given that I've worked on this.

Tests performed

All automated tests pass

2.8.5-debug-pr-1945~f224c50a (beta) on Samsung Galaxy S6 at API level 25
2.8.5-debug-pr-1945~f224c50a (prod) on Samsung Galaxy S6 at API level 25
2.8.5-debug-pr-1945~f224c50a (beta) on Galaxy Nexus (simulator) at API level 28
2.8.5-debug-pr-1945~f224c50a (prod) on Galaxy Nexus (simulator) at API level 28

Things that work:

  • Skip tutorial button on first page (beta only)
  • Skip tutorial button on last page (beta only)
  • Skip tutorial button not present (prod only)
  • "YES!" button on last page
  • More information button on last page
  • Can't back out of tutorial on first run
  • Press back out of tutorial if not first run

@neslihanturan
Copy link
Collaborator

Thanks both @m-rahimy and @domdomegg ! This works as expected.

@neslihanturan neslihanturan merged commit f79456e into commons-app:master Dec 17, 2018
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.

6 participants