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

Fix#2140: Fix username's cutoff in Home Page #2396

Merged
merged 27 commits into from
Jan 21, 2021

Conversation

prayutsu
Copy link
Contributor

@prayutsu prayutsu commented Jan 5, 2021

Explanation

Fixes #2140:
If the username is too long then the username is displayed in the next line.

Short Names on WSVGA Tablet (Screen size - 7.00'')-

Before After
before-tablet-port-short after-tablet-port-short
before-tablet-land-short after-tablet-land-short

Long Names on WSVGA Tablet (Screen size - 7.00'')-

Before After
before-tablet-portrait-long after-tablet-port-long
before-tablet-land-long after-tablet-land-long

Short Names on QVGA Phone (Screen size - 3.20'')-

Before After
before-phone-port-short after-phone-port-short
before-phone-land-short png after-phone-land-short

Long Names on QVGA Phone (Screen size - 3.20'')-

Before After
before-phone-port-long after-phone-port-long
before-phone-land-long after-phone-land-long

Newly Added Test cases passing on Espresso -
Screenshot from 2021-01-14 16-51-45

Newly Added Test cases passing on Robolectric -
Screenshot from 2021-01-14 16-43-21

Newly Added Test cases failing on Espresso(before making changes) -
Screenshot from 2021-01-14 17-04-17

Newly Added Test cases passing on Robolectric(before making changes) -
Screenshot from 2021-01-14 17-06-19

Fixed failed tests of other files -

ProfileChooserFragmentTest on ESPRESSO -
Screenshot from 2021-01-15 15-11-29

ProfileEditActivityTest on ESPRESSO -
Screenshot from 2021-01-15 15-09-01

ProfileEditActivityTest on Robolectric -
Screenshot from 2021-01-15 15-04-36

ProfileChooserFragmentTest on Robolectric -
Screenshot from 2021-01-15 15-25-41

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@prayutsu prayutsu requested a review from rt4914 as a code owner January 5, 2021 21:23
@prayutsu prayutsu marked this pull request as draft January 5, 2021 21:23
@anandwana001
Copy link
Contributor

Also, test cases are need to test the fix.

@anandwana001 anandwana001 assigned prayutsu and unassigned rt4914 Jan 5, 2021
Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

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

Thanks @prayutsu
For orange line thing, I think the earlier. pr which is closed now for this issue has a reference on how the orange line should be aligned.

app/BUILD.bazel Outdated Show resolved Hide resolved
app/build.gradle Show resolved Hide resolved
app/src/main/res/layout/welcome.xml Outdated Show resolved Hide resolved
@Arjupta
Copy link
Contributor

Arjupta commented Jan 6, 2021

@prayutsu can I know what is the problem with the orange line, I think it is correct if it shown like this, as the username expands

@prayutsu
Copy link
Contributor Author

prayutsu commented Jan 6, 2021

Also, test cases are need to test the fix.

Yes, I'll be introducing test cases once we finalize the implementaton

@prayutsu
Copy link
Contributor Author

prayutsu commented Jan 6, 2021

@prayutsu can I know what is the problem with the orange line, I think it is correct if it shown like this, as the username expands

@Arjupta Actually, earlier the orange lie was below the salutation and its width matched the salutation. See this for refernce

@prayutsu
Copy link
Contributor Author

prayutsu commented Jan 6, 2021

According to this comment, we always want the orange line aligned to be left and below the salutation or username.
@mschanteltc @Arjupta @rt4914 @anandwana001 What should be the ideal width of the orange line?

@Arjupta
Copy link
Contributor

Arjupta commented Jan 6, 2021

According to this comment, we always want the orange line aligned to be left and below the salutation or username.
@mschanteltc @Arjupta @rt4914 @anandwana001 What should be the ideal width of the orange line?

I think the orange line must be having 40% of screen width , its just good to view. You can achieve this by using constraint percent. like this-

    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_constraintWidth_percent="0.4"

@prayutsu
Copy link
Contributor Author

prayutsu commented Jan 6, 2021

@Arjupta Even I had the same thought to make the width of the line about 50%. But we also have another option to keep it as wide as the flexboxlayout
@mschanteltc @rt4914 @anandwana001 WDYT?

@mschanteltc
Copy link

@Arjupta Even I had the same thought to make the width of the line about 50%. But we also have another option to keep it as wide as the flexboxlayout
@mschanteltc @rt4914 @anandwana001 WDYT?

Is it possible to make the width of the orange line equal to the width of the greeting? I understand that the greeting may vary, so this would mean that the width would change depending on the time of the day.

If not possible, then let's make the width 172 dp just like it is in the mock.

@prayutsu
Copy link
Contributor Author

prayutsu commented Jan 7, 2021

I did some research but couldn't figure out any way to dynamically change the width of the line according to the greeting's width because they are not siblings.
@BenHenning Could you help us here?

@prayutsu prayutsu removed their assignment Jan 7, 2021
@rt4914
Copy link
Contributor

rt4914 commented Jan 7, 2021

@prayutsu Have a look at this https://github.com/oppia/oppia-android/pull/2186/files in which the author has used two separate profile_name_text_views to handle the required functionality.

@rt4914 rt4914 assigned prayutsu and unassigned rt4914 Jan 7, 2021
@prayutsu
Copy link
Contributor Author

prayutsu commented Jan 7, 2021

Thanks, @rt4914
Actually, I already took a look at the previous PR, and there I saw this comment by Ben.
So, I dropped the idea of using two textviews.

@prayutsu prayutsu changed the title Fix#2140: Fix username's cutoff in Home Page Fix#2140: Fix username's cutoff in Home Page [WIP] Jan 8, 2021
@anandwana001
Copy link
Contributor

as Rajat and Arjun keeping update in this PR, unassigning myself.

@anandwana001 anandwana001 removed their assignment Jan 11, 2021
@prayutsu
Copy link
Contributor Author

@rt4914 I have enabled Reformat Code on committing, so it has automatically fixed some lint errors that were changed in the Binding Adapter commit, so it is okay, or do I need to revert these?

@rt4914
Copy link
Contributor

rt4914 commented Jan 20, 2021

@rt4914 I have enabled Reformat Code on committing, so it has automatically fixed some lint errors that were changed in the Binding Adapter commit, so it is okay, or do I need to revert these?

You can keep these changes and at the same time I suggest merging with latest develop too. Keeping your branch up-to-date is a nice practice.

@prayutsu
Copy link
Contributor Author

@rt4914 I have enabled Reformat Code on committing, so it has automatically fixed some lint errors that were changed in the Binding Adapter commit, so it is okay, or do I need to revert these?

You can keep these changes and at the same time I suggest merging with latest develop too. Keeping your branch up-to-date is a nice practice.

Done, thanks

@prayutsu
Copy link
Contributor Author

prayutsu commented Jan 20, 2021

@rt4914 PTAL

@prayutsu
Copy link
Contributor Author

Screenshots updated in PR description.

@prayutsu prayutsu removed their assignment Jan 20, 2021
Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

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

nit changes

@anandwana001 anandwana001 removed their assignment Jan 20, 2021
Copy link
Contributor Author

@prayutsu prayutsu left a comment

Choose a reason for hiding this comment

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

PTAL

@prayutsu prayutsu assigned anandwana001 and unassigned prayutsu Jan 21, 2021
Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

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

Left nit changes.

Find 2 issues, @rt4914 are there any issues filed for this?

Correct one

Incorrect

@anandwana001 anandwana001 removed their assignment Jan 21, 2021
Copy link
Contributor

@anandwana001 anandwana001 left a comment

Choose a reason for hiding this comment

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

LGTM

@anandwana001 anandwana001 removed their assignment Jan 21, 2021
@rt4914
Copy link
Contributor

rt4914 commented Jan 21, 2021

Left nit changes.

Find 2 issues, @rt4914 are there any issues filed for this?

Correct one

Incorrect

Just filed. #2529

Copy link
Contributor

@rt4914 rt4914 left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks.

@rt4914 rt4914 merged commit e22bcb3 into oppia:develop Jan 21, 2021
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.

User's Name is Cutoff in Home Page
6 participants