Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
fenix
Commits
a674c5df
Commit
a674c5df
authored
May 20, 2020
by
Jeff Boek
Browse files
For #10504 - cleans up tabLayout colors
parent
4e499e7a
Changes
7
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/browser/BaseBrowserFragment.kt
View file @
a674c5df
...
...
@@ -70,6 +70,7 @@ import org.mozilla.fenix.HomeActivity
import
org.mozilla.fenix.IntentReceiverActivity
import
org.mozilla.fenix.NavGraphDirections
import
org.mozilla.fenix.R
import
org.mozilla.fenix.browser.browsingmode.BrowsingMode
import
org.mozilla.fenix.browser.readermode.DefaultReaderModeController
import
org.mozilla.fenix.components.FenixSnackbar
import
org.mozilla.fenix.components.FindInPageIntegration
...
...
@@ -219,7 +220,8 @@ abstract class BaseBrowserFragment : Fragment(), UserInteractionHandler, Session
tabTrayDialog
.
dismiss
()
}
override
fun
onNewTabTapped
()
{
override
fun
onNewTabTapped
(
private
:
Boolean
)
{
(
activity
as
HomeActivity
).
browsingModeManager
.
mode
=
BrowsingMode
.
fromBoolean
(
private
)
tabTrayDialog
.
dismiss
()
findNavController
().
navigate
(
BrowserFragmentDirections
.
actionGlobalHome
())
}
...
...
app/src/main/java/org/mozilla/fenix/home/HomeFragment.kt
View file @
a674c5df
...
...
@@ -366,7 +366,8 @@ class HomeFragment : Fragment() {
(
activity
as
HomeActivity
).
openToBrowser
(
BrowserDirection
.
FromHome
)
}
override
fun
onNewTabTapped
()
{
override
fun
onNewTabTapped
(
private
:
Boolean
)
{
(
activity
as
HomeActivity
).
browsingModeManager
.
mode
=
BrowsingMode
.
fromBoolean
(
private
)
tabTrayDialog
.
dismiss
()
}
}
...
...
app/src/main/java/org/mozilla/fenix/tabtray/TabTrayDialogFragment.kt
View file @
a674c5df
...
...
@@ -19,7 +19,7 @@ import org.mozilla.fenix.R
class
TabTrayDialogFragment
:
AppCompatDialogFragment
(),
TabTrayInteractor
{
interface
Interactor
{
fun
onTabSelected
(
tab
:
Tab
)
fun
onNewTabTapped
()
fun
onNewTabTapped
(
private
:
Boolean
)
}
private
lateinit
var
tabTrayView
:
TabTrayView
...
...
@@ -62,7 +62,7 @@ class TabTrayDialogFragment : AppCompatDialogFragment(), TabTrayInteractor {
}
override
fun
onNewTabTapped
(
private
:
Boolean
)
{
interactor
?.
onNewTabTapped
()
interactor
?.
onNewTabTapped
(
private
)
}
override
fun
onTabTrayDismissed
()
{
...
...
app/src/main/res/color/tab_icon.xml
0 → 100644
View file @
a674c5df
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:color=
"?accent"
android:state_selected=
"true"
/>
<item
android:color=
"?secondaryText"
/>
</selector>
\ No newline at end of file
app/src/main/res/layout/component_tabstray.xml
View file @
a674c5df
...
...
@@ -11,8 +11,8 @@
android:layout_height=
"match_parent"
android:layout_width=
"match_parent"
android:layout_marginTop=
"40dp"
android:background=
"?foundation"
style=
"@style/BottomSheetModal"
android:backgroundTint=
"?foundation"
app:layout_behavior=
"com.google.android.material.bottomsheet.BottomSheetBehavior"
>
<View
android:id=
"@+id/handle"
...
...
@@ -28,7 +28,10 @@
android:id=
"@+id/tab_layout"
android:layout_width=
"0dp"
android:layout_height=
"80dp"
app:tabSelectedTextColor=
"?accent"
app:tabTextColor=
"?secondaryText"
app:tabIndicatorColor=
"?accent"
app:tabIconTint=
"@color/tab_icon"
app:tabRippleColor=
"@android:color/transparent"
app:layout_constraintWidth_percent=
"0.5"
app:layout_constraintTop_toBottomOf=
"@+id/handle"
...
...
@@ -45,7 +48,7 @@
android:id=
"@+id/private_tab_item"
android:layout_height=
"match_parent"
android:layout_width=
"0dp"
android:icon=
"@drawable/private_browsing
_button
"
android:icon=
"@drawable/
ic_
private_browsing"
android:text=
"Private"
/>
</com.google.android.material.tabs.TabLayout>
<ImageButton
...
...
@@ -69,7 +72,7 @@
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/tab_layout"
mozac:tabsTrayItemBackgroundColor=
"?
tabTrayItemBackground
"
mozac:tabsTrayItemBackgroundColor=
"?
foundation
"
mozac:tabsTrayItemTextColor=
"?tabTrayItemText"
mozac:tabsTraySelectedItemBackgroundColor=
"?tabTrayItemSelectedBackground"
mozac:tabsTraySelectedItemTextColor=
"?tabTrayItemText"
...
...
app/src/main/res/layout/component_tabstray_fab.xml
View file @
a674c5df
...
...
@@ -11,7 +11,7 @@
android:layout_height=
"wrap_content"
android:layout_gravity=
"bottom|end"
android:layout_margin=
"16dp"
android:backgroundTint=
"
@color/photonBlue50
"
android:backgroundTint=
"
?accent
"
android:contentDescription=
"TODO: Changeme"
app:srcCompat=
"@drawable/ic_new"
app:tint=
"@color/photonWhite"
/>
app/src/main/res/values/styles.xml
View file @
a674c5df
...
...
@@ -546,7 +546,9 @@
<item
name=
"cornerFamily"
>
rounded
</item>
<item
name=
"cornerSizeTopLeft"
>
16dp
</item>
<item
name=
"cornerSizeTopRight"
>
16dp
</item>
<item
name=
"colorSurface"
>
?foundation
</item>
<item
name=
"colorSurface"
>
@color/photonPurple50
</item>
<item
name=
"android:backgroundTint"
>
@color/photonPurple50
</item>
<item
name=
"android:colorBackground"
>
@color/photonPurple50
</item>
</style>
<style
name=
"BottomSheetModal"
parent=
"Widget.Design.BottomSheet.Modal"
>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment