-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Feature/david/contrast colors change #838
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
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
a52858d
fixed colors for dialogs in settings screen
malmstein 3ce15a2
change app icon dialog styling
malmstein 903a2f7
changed dialog for report broken site
malmstein 94e2a2d
fixing edit bookmark dialog theming
malmstein 2c387cf
no need to set the theme per dialog, it inherits from the theme
malmstein e5bdd59
using the new popup menu
malmstein 0f72ed5
added new popup menu
malmstein c5714de
added popup layout
malmstein e996e4a
added support for dark theme in fire dialog
malmstein 7830d75
Merge branch 'develop' into feature/david/dark_theme_dialog
malmstein 20e2414
Merge branch 'develop' into feature/david/bookmarks_popup_menu
malmstein 1203c39
Merge branch 'develop' into feature/david/fire_bottom_sheet_dark_theme
malmstein dd69615
all dialogs are using the same theme
malmstein d379849
using white instead of grayish
malmstein 3e8d5a7
Merge branch 'develop' into feature/david/dark_theme_dialog
malmstein 7906331
Merge branch 'feature/david/dark_theme_dialog' into feature/david/con…
malmstein b96c37a
changed text and icon colors in light and dark mode
malmstein 675f91f
adding new colors for contrast
malmstein 6184c98
Merge branch 'feature/david/fire_bottom_sheet_dark_theme' into featur…
malmstein efc01e2
Merge branch 'feature/david/bookmarks_popup_menu' into feature/david/…
malmstein 6a35ddd
cleaning up bad color
malmstein 4ea61ca
updated bg color in fire dialog
malmstein e19f596
adding colors so we pass the color contrast test
malmstein 926c086
final tweaks to the toolbar, removing elevation and adding custom shadow
malmstein a1e186b
back to it's proper experiment definition
malmstein 1c9d4c9
Merge branch 'develop' into feature/david/contrast_colors_change
malmstein 3bc6986
last ui review changes
malmstein 90663a0
clean up bottom bar background color
malmstein bcbd582
fixed version for release
malmstein f027138
Merge branch 'develop' into feature/david/contrast_colors_change
malmstein a70f5f2
experiment back to original value
malmstein f15c94d
applying ktlint
malmstein 375d0f6
adding text color for the dialogs
malmstein 52e7233
revert changes to dialogs, they don't belong here
malmstein 31b62a8
remove unnecessary imports
malmstein 2d0c50c
more cleanup reveryting changes
malmstein 5abac58
revert change in bookmarks
malmstein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
app/src/main/java/com/duckduckgo/app/bookmarks/ui/BookmarksPopupMenu.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /* | ||
| * Copyright (c) 2020 DuckDuckGo | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.duckduckgo.app.bookmarks.ui | ||
|
|
||
| import android.graphics.Color | ||
| import android.graphics.drawable.ColorDrawable | ||
| import android.os.Build.VERSION.SDK_INT | ||
| import android.view.Gravity | ||
| import android.view.LayoutInflater | ||
| import android.view.View | ||
| import android.view.ViewGroup.LayoutParams.WRAP_CONTENT | ||
| import android.widget.PopupWindow | ||
| import com.duckduckgo.app.browser.R | ||
|
|
||
| class BookmarksPopupMenu(layoutInflater: LayoutInflater, view: View = inflate(layoutInflater, R.layout.popup_window_bookmarks_menu)) : | ||
| PopupWindow(view, WRAP_CONTENT, WRAP_CONTENT, true) { | ||
|
|
||
| init { | ||
| if (SDK_INT <= 22) { | ||
| // popupwindow gets stuck on the screen on API 22 (tested on 23) without a background | ||
| // color. Adding it however garbles the elevation so we cannot have elevation here. | ||
| setBackgroundDrawable(ColorDrawable(Color.WHITE)) | ||
| } else { | ||
| elevation = ELEVATION | ||
| } | ||
| animationStyle = android.R.style.Animation_Dialog | ||
| } | ||
|
|
||
| fun onMenuItemClicked(menuView: View, onClick: () -> Unit) { | ||
| menuView.setOnClickListener { | ||
| onClick() | ||
| dismiss() | ||
| } | ||
| } | ||
|
|
||
| fun show(rootView: View, anchorView: View) { | ||
| val anchorLocation = IntArray(2) | ||
| anchorView.getLocationOnScreen(anchorLocation) | ||
| val x = MARGIN | ||
| val y = anchorLocation[1] + MARGIN | ||
marcosholgado marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| showAtLocation(rootView, Gravity.TOP or Gravity.END, x, y) | ||
| } | ||
|
|
||
| companion object { | ||
|
|
||
| private const val MARGIN = 30 | ||
| private const val ELEVATION = 6f | ||
|
|
||
| fun inflate(layoutInflater: LayoutInflater, resourceId: Int): View { | ||
| return layoutInflater.inflate(resourceId, null) | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,13 +43,13 @@ | |
| <item> | ||
| <shape android:shape="rectangle"> | ||
| <padding android:top="1dp"/> | ||
| <solid android:color="#50CCCCCC" /> | ||
| <solid android:color="?attr/toolbarBgBorderColor" /> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are preliminary changes, https://app.asana.com/0/1157893581871903/1176799629392268 will make sure to update these changes should the experiment move forward |
||
| </shape> | ||
| </item> | ||
| <item> | ||
| <shape | ||
| android:shape="rectangle"> | ||
| <solid android:color="?attr/colorPrimary"/> | ||
| <solid android:color="?attr/toolbarBgColor"/> | ||
| </shape> | ||
| </item> | ||
| </layer-list> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <!-- | ||
| ~ Copyright (c) 2020 DuckDuckGo | ||
| ~ | ||
| ~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
| ~ you may not use this file except in compliance with the License. | ||
| ~ You may obtain a copy of the License at | ||
| ~ | ||
| ~ http://www.apache.org/licenses/LICENSE-2.0 | ||
| ~ | ||
| ~ Unless required by applicable law or agreed to in writing, software | ||
| ~ distributed under the License is distributed on an "AS IS" BASIS, | ||
| ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| ~ See the License for the specific language governing permissions and | ||
| ~ limitations under the License. | ||
| --> | ||
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <item android:id="@android:id/background"> | ||
| <shape> | ||
| <solid | ||
| android:color="?toolbarBgColor" /> | ||
| </shape> | ||
| </item> | ||
|
|
||
| <item | ||
| android:id="@android:id/progress"> | ||
| <clip> | ||
| <shape> | ||
| <solid | ||
| android:color="?colorAccent" /> | ||
| </shape> | ||
| </clip> | ||
| </item> | ||
|
|
||
| </layer-list> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, need to change the PopupMenu colors