Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
halo
packages_apps_Browser
Commits
8844d19f
Commit
8844d19f
authored
15 years ago
by
Steve Block
Browse files
Options
Download
Email Patches
Plain Diff
Makes Geolocation permissions prompt pretty.
Change-Id: I237fc0845de2297babc7da448a2199c5344e2e83
parent
c46f828c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
21 deletions
+27
-21
res/layout/geolocation_permissions_prompt.xml
res/layout/geolocation_permissions_prompt.xml
+14
-12
res/layout/tab.xml
res/layout/tab.xml
+5
-3
res/values/colors.xml
res/values/colors.xml
+1
-1
res/values/strings.xml
res/values/strings.xml
+4
-4
src/com/android/browser/GeolocationPermissionsPrompt.java
src/com/android/browser/GeolocationPermissionsPrompt.java
+3
-1
No files found.
res/layout/geolocation_permissions_prompt.xml
View file @
8844d19f
...
...
@@ -14,7 +14,6 @@
limitations under the License.
This is the layout for the Geolocation permissions prompt.
FIXME: Make this looks pretty.
-->
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
...
...
@@ -28,6 +27,7 @@
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/geolocation_permissions_prompt_background"
android:padding=
"6dip"
android:visibility=
"gone"
>
<!-- 'google.com wants to know your location' -->
...
...
@@ -35,7 +35,15 @@
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:textSize=
"14dip"
android:textColor=
"@color/white"
/>
android:textColor=
"@color/black"
/>
<!-- Checkbox -->
<CheckBox
android:id=
"@+id/remember"
android:text=
"@string/geolocation_permissions_prompt_remember"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"14dip"
android:textColor=
"@color/black"
/>
<!-- Buttons -->
<LinearLayout
...
...
@@ -43,21 +51,15 @@
android:layout_height=
"wrap_content"
>
<Button
android:id=
"@+id/share_button"
android:text=
"@string/geolocation_permissions_prompt_share"
android:layout_width=
"wrap_content"
android:layout_weight=
"1"
android:layout_width=
"0dip"
android:layout_height=
"wrap_content"
/>
<Button
android:id=
"@+id/dont_share_button"
android:text=
"@string/geolocation_permissions_prompt_dont_share"
android:layout_width=
"wrap_content"
android:layout_weight=
"1"
android:layout_width=
"0dip"
android:layout_height=
"wrap_content"
/>
</LinearLayout>
<CheckBox
android:id=
"@+id/remember"
android:text=
"@string/geolocation_permissions_prompt_remember"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:drawablePadding=
"10dip"
android:textSize=
"16dip"
android:textColor=
"@color/white"
/>
</LinearLayout>
</LinearLayout>
This diff is collapsed.
Click to expand it.
res/layout/tab.xml
View file @
8844d19f
...
...
@@ -19,7 +19,8 @@
Currently, the only such element is the Geolocation permissions prompt.
-->
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:fitsSystemWindows=
"true"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
>
...
...
@@ -27,7 +28,8 @@
<!-- Wrapper layout for the WebView, which must be in a FrameLayout. -->
<FrameLayout
android:id=
"@+id/webview_wrapper"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
/>
android:layout_height=
"0dip"
android:layout_weight=
"1"
/>
<!-- Geolocation permissions prompt -->
<com.android.browser.GeolocationPermissionsPrompt
...
...
@@ -35,4 +37,4 @@
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
/>
</
Frame
Layout>
</
Linear
Layout>
This diff is collapsed.
Click to expand it.
res/values/colors.xml
View file @
8844d19f
...
...
@@ -34,6 +34,6 @@
<color
name=
"gray"
>
#ffbbbbbb
</color>
<color
name=
"dark_gray"
>
#ff777777
</color>
<color
name=
"geolocation_permissions_prompt_background"
>
#
CC888888
</color>
<color
name=
"geolocation_permissions_prompt_background"
>
#
ffdddddd
</color>
</resources>
This diff is collapsed.
Click to expand it.
res/values/strings.xml
View file @
8844d19f
...
...
@@ -736,10 +736,10 @@
<!-- Geolocation -->
<!-- Permissions prompt -->
<string
name=
"geolocation_permissions_prompt_message"
><xliff:g
id=
"web
page"
example=
"Google Maps
"
>
%s
</xliff:g>
wants to know your location
</string>
<string
name=
"geolocation_permissions_prompt_share"
>
Share
</string>
<string
name=
"geolocation_permissions_prompt_dont_share"
>
D
on\'t shar
e
</string>
<string
name=
"geolocation_permissions_prompt_remember"
>
Remember
</string>
<string
name=
"geolocation_permissions_prompt_message"
><xliff:g
id=
"web
site origin"
example=
"maps.google.com
"
>
%s
</xliff:g>
wants to know your location
</string>
<string
name=
"geolocation_permissions_prompt_share"
>
Share
location
</string>
<string
name=
"geolocation_permissions_prompt_dont_share"
>
D
eclin
e
</string>
<string
name=
"geolocation_permissions_prompt_remember"
>
Remember
preference
</string>
<!-- Settings page, Advanced Settings -> Website settings -> <origin> -->
<string
name=
"geolocation_settings_page_title"
>
Clear location access
</string>
<string
name=
"geolocation_settings_page_summary_allowed"
>
This site can currently access your location
</string>
...
...
This diff is collapsed.
Click to expand it.
src/com/android/browser/GeolocationPermissionsPrompt.java
View file @
8844d19f
...
...
@@ -18,6 +18,7 @@ package com.android.browser;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.net.Uri
;
import
android.util.AttributeSet
;
import
android.view.LayoutInflater
;
import
android.view.View
;
...
...
@@ -61,7 +62,8 @@ public class GeolocationPermissionsPrompt extends LinearLayout {
public
void
show
(
String
origin
,
GeolocationPermissions
.
Callback
callback
)
{
mOrigin
=
origin
;
mCallback
=
callback
;
setMessage
(
mOrigin
);
Uri
uri
=
Uri
.
parse
(
mOrigin
);
setMessage
(
"http"
.
equals
(
uri
.
getScheme
())
?
mOrigin
.
substring
(
7
)
:
mOrigin
);
showDialog
(
true
);
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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