Skip to content

Commit b27fe88

Browse files
authored
apply white menu (#136)
1 parent 1e77eaf commit b27fe88

File tree

7 files changed

+49
-11
lines changed

7 files changed

+49
-11
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import com.duckduckgo.app.privacymonitor.renderer.icon
4747
import com.duckduckgo.app.privacymonitor.ui.PrivacyDashboardActivity
4848
import com.duckduckgo.app.settings.SettingsActivity
4949
import kotlinx.android.synthetic.main.activity_browser.*
50-
import kotlinx.android.synthetic.main.popup_window_brower_menu.view.*
50+
import kotlinx.android.synthetic.main.popup_window_browser_menu.view.*
5151
import org.jetbrains.anko.doAsync
5252
import org.jetbrains.anko.toast
5353
import org.jetbrains.anko.uiThread

app/src/main/java/com/duckduckgo/app/browser/BrowserPopupMenu.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ class BrowserPopupMenu : PopupWindow {
3030
constructor(layoutInflater: LayoutInflater, view: View = BrowserPopupMenu.inflate(layoutInflater))
3131
: super(view, WRAP_CONTENT, WRAP_CONTENT, true) {
3232

33-
if (SDK_INT <= 21) {
34-
// popupwindow gets stuck on the screen on API 21 without a background color.
35-
// Adding it however garbles the elevation so we cannot have elevation here
33+
if (SDK_INT <= 22) {
34+
// popupwindow gets stuck on the screen on API 22 (tested on 23) without a background
35+
// color. Adding it however garbles the elevation so we cannot have elevation here.
3636
setBackgroundDrawable(ColorDrawable(Color.WHITE))
3737
} else {
3838
elevation = 6.toFloat()
@@ -54,7 +54,7 @@ class BrowserPopupMenu : PopupWindow {
5454
val margin = 30
5555

5656
fun inflate(layoutInflater: LayoutInflater): View {
57-
return layoutInflater.inflate(R.layout.popup_window_brower_menu, null)
57+
return layoutInflater.inflate(R.layout.popup_window_browser_menu, null)
5858
}
5959

6060
}

app/src/main/java/com/duckduckgo/app/home/HomeActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import com.duckduckgo.app.global.view.FireDialog
3535
import com.duckduckgo.app.settings.SettingsActivity
3636
import kotlinx.android.synthetic.main.activity_home.*
3737
import kotlinx.android.synthetic.main.content_home.*
38-
import kotlinx.android.synthetic.main.popup_window_brower_menu.view.*
38+
import kotlinx.android.synthetic.main.popup_window_browser_menu.view.*
3939
import org.jetbrains.anko.toast
4040
import javax.inject.Inject
4141
import javax.inject.Provider
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (c) 2018 DuckDuckGo
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
218
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3-
<item android:state_enabled="false" android:color="@color/paleOrange" />
4-
<item android:color="@color/white"/>
19+
<item android:color="@color/subtleGrey" android:state_enabled="false"/>
20+
<item android:color="@color/brownishGray"/>
521
</selector>

app/src/main/res/color/browser_menu_text.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
~ Copyright (c) 2018 DuckDuckGo
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
218
<selector xmlns:android="http://schemas.android.com/apk/res/android">
319
<item android:state_enabled="false" android:color="@color/paleBrownishGray" />
420
<item android:color="@color/brownishGray"/>

app/src/main/res/layout/popup_window_brower_menu.xml renamed to app/src/main/res/layout/popup_window_browser_menu.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
android:id="@+id/header"
2525
android:layout_width="match_parent"
2626
android:layout_height="50dp"
27-
android:background="@color/colorAccent"
27+
android:background="@color/white"
2828
android:gravity="center"
2929
android:orientation="horizontal">
3030

@@ -59,13 +59,19 @@
5959
android:src="@drawable/ic_bookmark_24px" />
6060

6161
</LinearLayout>
62+
63+
<FrameLayout
64+
android:layout_width="match_parent"
65+
android:layout_height="1dp"
66+
android:background="@color/white_two"
67+
app:layout_constraintBottom_toBottomOf="@+id/header" />
6268

6369
<LinearLayout
6470
android:layout_width="wrap_content"
6571
android:layout_height="wrap_content"
6672
android:orientation="vertical"
6773
android:paddingBottom="20dp"
68-
android:paddingTop="20dp"
74+
android:paddingTop="13dp"
6975
app:layout_constraintTop_toBottomOf="@id/header">
7076

7177
<TextView

app/src/main/res/values/colors.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<color name="subtleGrey">#f0f0f0</color>
2222
<color name="subtleGreyTwo">#D8D8D8</color>
2323

24-
<color name="paleOrange">#DA8E76</color>
2524
<color name="orange">#de5833</color>
2625
<color name="brickOrange">#d03a10</color>
2726

@@ -32,5 +31,6 @@
3231
<color name="muddyGreen">#58732e</color>
3332
<color name="midGreen">#3fa140</color>
3433

34+
<color name="white_two">#e4e4e4</color>
3535

3636
</resources>

0 commit comments

Comments
 (0)