Skip to content

Commit

Permalink
Merge pull request #6807 from brave/pr6795_android_touch_to_fill_1.15.x
Browse files Browse the repository at this point in the history
[Android] Removed image in touch to fill dialog (uplift to 1.15.x)
  • Loading branch information
kjozwiak committed Oct 7, 2020
2 parents dc8ba0e + b18a6ce commit 76f402d
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2020 The Brave Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->

<!-- Please update R.dimens.touch_to_fill_sheet_height_single_credential
when modifying the margins image or text sizes. -->
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_marginBottom="16dp"
android:orientation="vertical">

<!-- <ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:importantForAccessibility="no"
app:srcCompat="@drawable/touch_to_fill_header_image" /> -->

<org.chromium.ui.widget.TextViewWithLeading
android:id="@+id/touch_to_fill_sheet_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.Headline.Primary" />

<org.chromium.ui.widget.TextViewWithLeading
android:id="@+id/touch_to_fill_sheet_subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:textAppearance="@style/TextAppearance.TextMedium.Secondary" />
</LinearLayout>
35 changes: 35 additions & 0 deletions browser/touch_to_fill/android/internal/java/res/values/dimens.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2020 The Brave Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. -->

<resources>
<dimen name="touch_to_fill_favicon_size">24dp</dimen>
<dimen name="touch_to_fill_sheet_margin">16dp</dimen>

<!-- Below are the different Half-state peeking heights. The height is the
sum of all components. It varies depending on the suggestion count. The
base height is 298dp:
Bottom sheet shadows and padding (18dp)
+ Handlebar (16dp)
+ Title size and margin (48+16dp)
+ First suggestion (72dp) -->
<dimen name="touch_to_fill_sheet_height_single_credential">170dp</dimen>

<!-- Top padding between RecyclerView elements (8 dp)
+ Extra suggestion height (72 dp). -->
<dimen name="touch_to_fill_sheet_height_second_credential">80dp</dimen>

<!-- Top padding between RecyclerView elements (8 dp)
+ Top margin (2 dp)
+ button height (48 dp)
+ Bottom margin (2 dp) -->
<dimen name="touch_to_fill_sheet_height_button">60dp</dimen>

<!-- Depending on the experiments that are active we might show a call to
action button or branding message to the users, at which point we need
different bottom paddings. They are exposed here, so that they can be
added dynamically, depending on the state of the experiments. -->
<dimen name="touch_to_fill_sheet_bottom_padding_credentials">16dp</dimen>
<dimen name="touch_to_fill_sheet_bottom_padding_button">8dp</dimen>
</resources>
5 changes: 4 additions & 1 deletion build/commands/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,13 +340,16 @@ const util = {
const androidResTemplateDest = path.join(config.srcDir, 'chrome', 'android', 'java', 'res_template')
const androidContentPublicResSource = path.join(config.braveCoreDir, 'content', 'public', 'android', 'java', 'res')
const androidContentPublicResDest = path.join(config.srcDir, 'content', 'public', 'android', 'java', 'res')
const androidTouchtoFillResSource = path.join(config.braveCoreDir, 'browser', 'touch_to_fill', 'android', 'internal', 'java', 'res')
const androidTouchtoFillResDest = path.join(config.srcDir, 'chrome', 'browser', 'touch_to_fill', 'android', 'internal', 'java', 'res')

// Mapping for copying Brave's Android resource into chromium folder.
const copyAndroidResourceMapping = {
[androidIconSource]: [androidIconDest],
[androidResSource]: [androidResDest],
[androidResTemplateSource]: [androidResTemplateDest],
[androidContentPublicResSource]: [androidContentPublicResDest]
[androidContentPublicResSource]: [androidContentPublicResDest],
[androidTouchtoFillResSource]: [androidTouchtoFillResDest]
}

console.log('copy Android app icons and app resources')
Expand Down

0 comments on commit 76f402d

Please sign in to comment.