Skip to content

Rewards tipping tablet UI #20223

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

Merged
merged 1 commit into from
Oct 6, 2023
Merged

Conversation

sujitacharya2005
Copy link
Contributor

@sujitacharya2005 sujitacharya2005 commented Sep 19, 2023

Resolves brave/brave-browser#30371

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run lint, npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

Tablet Light Tablet Dark Mobile Light Mobile Dark
image image image image
image image image image
image image image image
image image image image
image image image image
image image image image

@sujitacharya2005 sujitacharya2005 marked this pull request as draft September 19, 2023 19:47
@sujitacharya2005 sujitacharya2005 force-pushed the 30371_rewards_tipping_tablet_ui branch 2 times, most recently from 30c3281 to 7b02948 Compare September 19, 2023 20:57
@sujitacharya2005 sujitacharya2005 added CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-ios Do not run CI builds for iOS CI/skip-windows-x86 CI/skip-windows-x64 Do not run CI builds for Windows x64 unused-CI/skip-linux-x64 Do not run CI builds for Linux x64 labels Sep 19, 2023
@sujitacharya2005 sujitacharya2005 marked this pull request as ready for review September 19, 2023 20:58
@sujitacharya2005 sujitacharya2005 force-pushed the 30371_rewards_tipping_tablet_ui branch from 7b02948 to 435978c Compare September 22, 2023 09:34
@deeppandya deeppandya requested a review from emerick September 22, 2023 18:28
@sujitacharya2005 sujitacharya2005 force-pushed the 30371_rewards_tipping_tablet_ui branch 3 times, most recently from 36ad97f to 656f0a1 Compare September 25, 2023 21:20
@sujitacharya2005
Copy link
Contributor Author

cc : @Miyayes
Please review this

@Override
public void onResume() {
super.onResume();

Copy link
Contributor

Choose a reason for hiding this comment

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

nit : we can remove the new line here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated


WindowManager.LayoutParams params = window.getAttributes();
boolean isLandscape = ConfigurationUtils.isLandscape(getActivity());
if (isLandscape) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can similar to below,
float widthRatio = isLandscape ? 0.8 : 0.96;
params.width = (int) (widthRatio*mDeviceWidth);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;

import com.bumptech.glide.Glide;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove glide usage here ? we need to move away from glide at some point so it's better to remove any usage we have.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This code is old, just moved from activity to fragment.
Do you want to use ImageLoader here?
Last time I tested same thing Image Loader is very slow and caching is not working.
Filed issue : brave/brave-browser#30136
Please let me know if anything update happened in ImageLoader recently.

Copy link
Contributor

Choose a reason for hiding this comment

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

let's update it with ImageLoader and add details to the issue if we have any performance issues. so we can look into it separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I will implement ImageLoader, even it's slow and caching is not working.
I will update details in the issue..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

}
}

private String getProvider(String provider) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can use android:inputType="textCapWords" for Textview instead of changing the text here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This same logic is used in desktop side
PCDN data will contain normal word and need to map proper format like
youtube -> YouTube

Copy link
Contributor

Choose a reason for hiding this comment

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

in that case, is it possible to use the same function as desktop through mojom ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sujitacharya2005 sujitacharya2005 force-pushed the 30371_rewards_tipping_tablet_ui branch from c629f63 to 9ddecfa Compare September 26, 2023 18:29
@sujitacharya2005 sujitacharya2005 force-pushed the 30371_rewards_tipping_tablet_ui branch 2 times, most recently from c8d5b1d to c743c3a Compare September 29, 2023 10:34
@deeppandya deeppandya self-requested a review October 3, 2023 17:13
<shape>
<corners android:radius="28dp" />
<solid android:color="@color/rewards_background_gradient_end_color"/>

Copy link
Contributor

Choose a reason for hiding this comment

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

nit : remove extra new line

android:startX="90"
android:startY="254"
android:type="linear" />>

Copy link
Contributor

Choose a reason for hiding this comment

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

nit : remove extra new line

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">

Copy link
Contributor

Choose a reason for hiding this comment

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

nit : remove extra new line

Copy link
Contributor

@deeppandya deeppandya left a comment

Choose a reason for hiding this comment

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

LGTM

@sujitacharya2005 sujitacharya2005 force-pushed the 30371_rewards_tipping_tablet_ui branch from c743c3a to 0df6ff4 Compare October 3, 2023 18:36
</shape>
</item>
</layer-list>

Copy link
Contributor

Choose a reason for hiding this comment

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

nit : remove extra new line

Copy link
Contributor

@tapanmodh tapanmodh left a comment

Choose a reason for hiding this comment

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

LGTM

@sujitacharya2005 sujitacharya2005 force-pushed the 30371_rewards_tipping_tablet_ui branch from 0df6ff4 to 8f40543 Compare October 5, 2023 12:47
@sujitacharya2005 sujitacharya2005 added CI/skip-windows-x64 Do not run CI builds for Windows x64 and removed CI/skip-windows-x64 Do not run CI builds for Windows x64 labels Oct 5, 2023
@deeppandya deeppandya merged commit 506948a into master Oct 6, 2023
@deeppandya deeppandya deleted the 30371_rewards_tipping_tablet_ui branch October 6, 2023 19:37
@github-actions github-actions bot added this to the 1.61.x - Nightly milestone Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/skip-ios Do not run CI builds for iOS CI/skip-macos-x64 Do not run CI builds for macOS x64 CI/skip-windows-x64 Do not run CI builds for Windows x64 unused-CI/skip-linux-x64 Do not run CI builds for Linux x64
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Android Tablet] Implement Contribution Banner 3.0 for Tablet
6 participants