Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matthew Finkel
fenix
Commits
86706753
Commit
86706753
authored
Jul 12, 2019
by
Emily Kager
Committed by
Emily Kager
Jul 12, 2019
Browse files
For #3568 - Use correct styling for QR and Share Alert Dialogs
parent
ef8d9604
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/src/main/java/org/mozilla/fenix/search/SearchFragment.kt
View file @
86706753
...
...
@@ -11,7 +11,6 @@ import android.graphics.Typeface.BOLD
import
android.graphics.Typeface.ITALIC
import
android.os.Bundle
import
android.text.style.StyleSpan
import
android.view.ContextThemeWrapper
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -134,12 +133,7 @@ class SearchFragment : Fragment(), BackHandler {
onScanResult
=
{
result
->
search_scan_button
.
isChecked
=
false
activity
?.
let
{
AlertDialog
.
Builder
(
ContextThemeWrapper
(
it
,
R
.
style
.
DialogStyle
)
).
apply
{
AlertDialog
.
Builder
(
it
).
apply
{
val
spannable
=
resources
.
getSpannable
(
R
.
string
.
qr_scanner_confirmation_dialog_message
,
listOf
(
...
...
app/src/main/java/org/mozilla/fenix/share/ShareFragment.kt
View file @
86706753
...
...
@@ -10,7 +10,6 @@ import android.content.Intent.EXTRA_TEXT
import
android.content.Intent.FLAG_ACTIVITY_NEW_TASK
import
android.os.Bundle
import
android.os.Parcelable
import
android.view.ContextThemeWrapper
import
android.view.LayoutInflater
import
android.view.View
import
android.view.ViewGroup
...
...
@@ -41,7 +40,11 @@ class ShareFragment : AppCompatDialogFragment() {
setStyle
(
STYLE_NO_TITLE
,
R
.
style
.
ShareDialogStyle
)
}
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?):
View
?
{
override
fun
onCreateView
(
inflater
:
LayoutInflater
,
container
:
ViewGroup
?,
savedInstanceState
:
Bundle
?
):
View
?
{
val
view
=
inflater
.
inflate
(
R
.
layout
.
fragment_share
,
container
,
false
)
val
args
=
ShareFragmentArgs
.
fromBundle
(
arguments
!!
)
if
(
args
.
url
==
null
&&
args
.
tabs
.
isNullOrEmpty
())
{
...
...
@@ -77,31 +80,31 @@ class ShareFragment : AppCompatDialogFragment() {
dismiss
()
}
ShareAction
.
SignInClicked
->
{
val
directions
=
ShareFragmentDirections
.
actionShareFragmentToTurnOnSyncFragment
()
val
directions
=
ShareFragmentDirections
.
actionShareFragmentToTurnOnSyncFragment
()
nav
(
R
.
id
.
shareFragment
,
directions
)
dismiss
()
}
ShareAction
.
AddNewDeviceClicked
->
{
AlertDialog
.
Builder
(
ContextThemeWrapper
(
context
,
R
.
style
.
DialogStyle
)
).
apply
{
setMessage
(
R
.
string
.
sync_connect_device_dialog
)
setPositiveButton
(
R
.
string
.
sync_confirmation_button
)
{
dialog
,
_
->
dialog
.
cancel
()
}
create
()
}.
show
()
context
?.
let
{
AlertDialog
.
Builder
(
it
).
apply
{
setMessage
(
R
.
string
.
sync_connect_device_dialog
)
setPositiveButton
(
R
.
string
.
sync_confirmation_button
)
{
dialog
,
_
->
dialog
.
cancel
()
}
create
()
}.
show
()
}
}
is
ShareAction
.
ShareDeviceClicked
->
{
val
authAccount
=
requireComponents
.
backgroundServices
.
accountManager
.
authenticatedAccount
()
val
authAccount
=
requireComponents
.
backgroundServices
.
accountManager
.
authenticatedAccount
()
authAccount
?.
run
{
sendSendTab
(
this
,
it
.
device
.
id
,
tabs
)
}
dismiss
()
}
is
ShareAction
.
SendAllClicked
->
{
val
authAccount
=
requireComponents
.
backgroundServices
.
accountManager
.
authenticatedAccount
()
val
authAccount
=
requireComponents
.
backgroundServices
.
accountManager
.
authenticatedAccount
()
authAccount
?.
run
{
it
.
devices
.
forEach
{
device
->
sendSendTab
(
this
,
device
.
id
,
tabs
)
...
...
app/src/main/res/values/styles.xml
View file @
86706753
...
...
@@ -53,19 +53,19 @@
<style
name=
"NormalTheme"
parent=
"NormalThemeBase"
/>
<style
name=
"DialogStyle"
parent=
"Theme.MaterialComponents.Dialog.Alert"
>
<style
name=
"
Base
DialogStyle"
parent=
"Theme.MaterialComponents.Dialog.Alert"
>
<item
name=
"dialogCornerRadius"
>
@dimen/tab_corner_radius
</item>
<item
name=
"android:colorBackground"
>
?above
</item>
<item
name=
"colorAccent"
>
?accent
</item>
<item
name=
"android:textColorPrimary"
>
?primaryText
</item>
</style>
<style
name=
"DialogStyleLight"
parent=
"DialogStyle"
>
<style
name=
"DialogStyleLight"
parent=
"
Base
DialogStyle"
>
<item
name=
"buttonBarNegativeButtonStyle"
>
@style/DialogButtonStyleLight
</item>
<item
name=
"buttonBarPositiveButtonStyle"
>
@style/DialogButtonStyleLight
</item>
</style>
<style
name=
"DialogStyleDark"
parent=
"DialogStyle"
>
<style
name=
"DialogStyleDark"
parent=
"
Base
DialogStyle"
>
<item
name=
"buttonBarNegativeButtonStyle"
>
@style/DialogButtonStyleDark
</item>
<item
name=
"buttonBarPositiveButtonStyle"
>
@style/DialogButtonStyleDark
</item>
</style>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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