Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
e
os
GmsCore
Commits
91b0f689
Verified
Commit
91b0f689
authored
Mar 18, 2021
by
Marvin W.
🐿
Browse files
GCM: Fix confirm dialog in dark theme
parent
5eb04b44
Changes
3
Hide whitespace changes
Inline
Side-by-side
play-services-core/src/main/java/org/microg/gms/ui/AskPushPermission.java
View file @
91b0f689
...
@@ -4,9 +4,16 @@ import android.app.Activity;
...
@@ -4,9 +4,16 @@ import android.app.Activity;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.ApplicationInfo
;
import
android.content.pm.ApplicationInfo
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
import
android.graphics.Typeface
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.ResultReceiver
;
import
android.os.ResultReceiver
;
import
android.text.Html
;
import
android.text.Html
;
import
android.text.Spannable
;
import
android.text.SpannableString
;
import
android.text.SpannableStringBuilder
;
import
android.text.Spanned
;
import
android.text.SpannedString
;
import
android.text.style.StyleSpan
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -58,9 +65,12 @@ public class AskPushPermission extends FragmentActivity {
...
@@ -58,9 +65,12 @@ public class AskPushPermission extends FragmentActivity {
try
{
try
{
PackageManager
pm
=
getPackageManager
();
PackageManager
pm
=
getPackageManager
();
final
ApplicationInfo
info
=
pm
.
getApplicationInfo
(
packageName
,
0
);
final
ApplicationInfo
info
=
pm
.
getApplicationInfo
(
packageName
,
0
);
CharSequence
label
=
pm
.
getApplicationLabel
(
info
);
String
label
=
pm
.
getApplicationLabel
(
info
).
toString
();
String
raw
=
getString
(
R
.
string
.
gcm_allow_app_popup
,
label
);
SpannableString
s
=
new
SpannableString
(
raw
);
s
.
setSpan
(
new
StyleSpan
(
Typeface
.
BOLD
),
raw
.
indexOf
(
label
),
raw
.
indexOf
(
label
)
+
label
.
length
(),
Spannable
.
SPAN_INCLUSIVE_INCLUSIVE
);
((
TextView
)
findViewById
(
R
.
id
.
permission_message
)).
setText
(
Html
.
fromHtml
(
"Allow <b>"
+
label
+
"</b> to register for push notifications?"
)
);
((
TextView
)
findViewById
(
R
.
id
.
permission_message
)).
setText
(
s
);
findViewById
(
R
.
id
.
permission_allow_button
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
findViewById
(
R
.
id
.
permission_allow_button
).
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
...
...
play-services-core/src/main/res/layout/ask_gcm.xml
View file @
91b0f689
...
@@ -14,88 +14,87 @@
...
@@ -14,88 +14,87 @@
limitations under the License.
limitations under the License.
-->
-->
<
FrameLayout
<
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:
clipChildren=
"false
"
android:
layout_width=
"match_parent
"
android:
clipToPadding=
"false
"
>
android:
layout_height=
"match_parent
"
>
<LinearLayout
<LinearLayout
android:id=
"@+id/dialog_container"
android:id=
"@+id/dialog_container"
android:layout_width=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"?android:attr/colorBackground"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<FrameLayout
<LinearLayout
android:id=
"@+id/desc_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingStart=
"20dip"
android:gravity=
"center"
android:paddingLeft=
"20dip"
android:orientation=
"vertical"
android:paddingTop=
"18dip"
android:paddingLeft=
"24dp"
android:paddingEnd=
"16dip"
android:paddingTop=
"18dp"
android:paddingRight=
"16dip"
>
android:paddingRight=
"24dp"
android:paddingBottom=
"24dp"
>
<LinearLayout
android:id=
"@+id/perm_desc_root"
<ImageView
android:layout_width=
"wrap_content"
android:id=
"@+id/permission_icon"
android:layout_width=
"24dp"
android:layout_height=
"24dp"
android:layout_marginBottom=
"12dp"
android:scaleType=
"fitCenter"
android:src=
"@drawable/ic_cloud_bell"
app:tint=
"?attr/colorAccent"
>
</ImageView>
<TextView
android:id=
"@+id/permission_message"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:gravity=
"center"
android:text=
"@string/gcm_allow_app_popup"
<ImageView
android:textSize=
"18sp"
>
android:id=
"@+id/permission_icon"
</TextView>
android:layout_width=
"36dip"
android:layout_height=
"36dip"
</LinearLayout>
android:scaleType=
"fitCenter"
android:src=
"@drawable/ic_cloud_bell"
<View
app:tint=
"?attr/colorAccent"
>
android:layout_width=
"match_parent"
</ImageView>
android:layout_height=
"0.25dp"
android:background=
"?android:attr/textColorSecondary"
/>
<TextView
android:id=
"@+id/permission_message"
style=
"@style/TextAppearance.AppCompat.Subhead"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:paddingStart=
"16dip"
android:paddingLeft=
"16dip"
android:text=
"Allow {appName} to register for push notifications?"
android:textSize=
"20sp"
>
</TextView>
</LinearLayout>
</FrameLayout>
<LinearLayout
<LinearLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"end"
android:orientation=
"vertical"
>
android:orientation=
"horizontal"
android:paddingStart=
"20dip"
android:paddingLeft=
"20dip"
android:paddingEnd=
"16dip"
android:paddingRight=
"16dip"
>
<Button
<Button
android:id=
"@+id/permission_deny_button"
android:id=
"@+id/permission_allow_button"
style=
"?attr/buttonBarButtonStyle"
android:layout_width=
"match_parent"
android:layout_width=
"wrap_content"
android:layout_height=
"56dp"
android:layout_height=
"wrap_content"
android:background=
"?android:attr/selectableItemBackground"
android:text=
"@string/deny"
>
android:paddingLeft=
"8dp"
android:paddingRight=
"8dp"
android:text=
"@string/allow"
>
</Button>
</Button>
<View
android:layout_width=
"match_parent"
android:layout_height=
"0.25dp"
android:background=
"?android:attr/textColorSecondary"
/>
<Button
<Button
android:id=
"@+id/permission_allow_button"
android:id=
"@+id/permission_deny_button"
style=
"?attr/buttonBarButtonStyle"
android:layout_width=
"match_parent"
android:layout_width=
"wrap_content"
android:layout_height=
"56dp"
android:layout_height=
"wrap_content"
android:background=
"?android:attr/selectableItemBackground"
android:text=
"@string/allow"
>
android:paddingLeft=
"8dp"
android:paddingRight=
"8dp"
android:text=
"@string/deny"
>
</Button>
</Button>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</
FrameLayout
>
</
ScrollView
>
play-services-core/src/main/res/values/strings.xml
View file @
91b0f689
...
@@ -171,6 +171,7 @@ This can take a couple of minutes."</string>
...
@@ -171,6 +171,7 @@ This can take a couple of minutes."</string>
<string
name=
"gcm_network_state_disconnected"
>
Disconnected
</string>
<string
name=
"gcm_network_state_disconnected"
>
Disconnected
</string>
<string
name=
"gcm_network_state_connected"
>
Connected since
<xliff:g
example=
"2 hours ago"
>
%1$s
</xliff:g></string>
<string
name=
"gcm_network_state_connected"
>
Connected since
<xliff:g
example=
"2 hours ago"
>
%1$s
</xliff:g></string>
<string
name=
"gcm_enable_switch"
>
Receive push notifications
</string>
<string
name=
"gcm_enable_switch"
>
Receive push notifications
</string>
<string
name=
"gcm_allow_app_popup"
>
Allow
<xliff:g
example=
"F-Droid"
>
%1$s
</xliff:g>
to register for push notifications?
</string>
<string
name=
"pref_push_app_allow_register_title"
>
Allow registration
</string>
<string
name=
"pref_push_app_allow_register_title"
>
Allow registration
</string>
<string
name=
"pref_push_app_allow_register_summary"
>
Allow the app to register for push notifications.
</string>
<string
name=
"pref_push_app_allow_register_summary"
>
Allow the app to register for push notifications.
</string>
...
...
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