Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0206284a authored by Jake Hamby's avatar Jake Hamby Committed by Android (Google) Code Review
Browse files

Merge "Fix Bluetooth enable dialog to match Android style guide." into jb-mr1.1-dev

parents af604801 95c1003f
Loading
Loading
Loading
Loading
+0 −33
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2009, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
**     http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
-->

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_height="match_parent"
    android:layout_width="match_parent">

    <TextView
        android:id="@+id/message"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="20dip"
        android:paddingEnd="20dip"
        android:gravity="center_horizontal"
        android:textAppearance="?android:attr/textAppearanceMedium" />
</ScrollView>
+15 −18
Original line number Diff line number Diff line
@@ -23,6 +23,12 @@
    <!-- Strings for Dialog create button -->
    <string name="create">Create</string>

    <!-- Strings for Dialog allow button -->
    <string name="allow">Allow</string>

    <!-- Strings for Dialog deny button -->
    <string name="deny">Deny</string>

    <!-- Device Info --> <skip />
    <!-- Device Info screen. Used for a status item's value when the proper value is not known -->
    <string name="device_info_default">Unknown</string>
@@ -216,8 +222,6 @@

    <!-- Used as setting title (for checkbox) on second screen after selecting Bluetooth settings -->
    <string name="bluetooth">Bluetooth</string>
    <!-- Bluetooth settings screen, check box label when the Bluetooth device can be seen by others -->
    <string name="bluetooth_visibility">Discoverable</string>
    <!-- Bluetooth settings screen, summary after selecting Discoverable check box [CHAR LIMIT=50] -->
    <string name="bluetooth_is_discoverable">Visible to all nearby Bluetooth devices (<xliff:g id="discoverable_time_period">%1$s</xliff:g>)</string>
    <!-- Bluetooth settings screen, summary when Discoverable duration is set to "forever" [CHAR LIMIT=50] -->
@@ -226,12 +230,8 @@
    <string name="bluetooth_not_visible_to_other_devices">Not visible to other Bluetooth devices</string>
    <!-- Bluetooth settings screen, summary text when not discoverable with paired devices [CHAR LIMIT=50] -->
    <string name="bluetooth_only_visible_to_paired_devices">Only visible to paired devices</string>
    <!-- Bluetooth settings screen, Discoverable checkbox summary text -->
    <string name="bluetooth_not_discoverable">Make device discoverable</string>
    <!-- Bluetooth settings screen, option name to pick discoverability timeout duration (a list dialog comes up) -->
    <string name="bluetooth_visibility_timeout">Visibility timeout</string>
    <!-- Bluetooth settings screen, Discoverable timout list dialog summary text -->
    <string name="bluetooth_visibility_timeout_summary">Set how long device will be discoverable</string>
    <!-- Bluetooth settings screen, check box label whether or not to allow
        bluetooth voice dialing when lock screen is up-->
    <string name="bluetooth_lock_voice_dialing">Lock voice dialing</string>
@@ -303,29 +303,26 @@
    <!-- Strings for BluetoothDevicePicker -->
    <string name="device_picker">Bluetooth device chooser</string>

    <!-- Strings for dialog title when asking to the user whether to allow an app to enable discovery mode -->
    <string name="bluetooth_permission_request">"Bluetooth permission request"</string>

    <!-- Strings for asking to the user whether to allow an app to enable bluetooth -->
    <string name="bluetooth_ask_enablement">"An app wants to turn on Bluetooth. Allow?"</string>
    <string name="bluetooth_ask_enablement">An app wants to turn on Bluetooth.</string>

    <!-- Strings for asking to the user whether to allow an app to enable discovery mode -->
    <string name="bluetooth_ask_discovery" product="tablet">"An app on your tablet wants to make your tablet discoverable by other Bluetooth devices for <xliff:g id="timeout">%1$d</xliff:g> seconds. Allow?"</string>
    <string name="bluetooth_ask_discovery" product="tablet">An app wants to make your tablet visible to other Bluetooth devices for <xliff:g id="timeout">%1$d</xliff:g> seconds.</string>
    <!-- Strings for asking to the user whether to allow an app to enable discovery mode -->
    <string name="bluetooth_ask_discovery" product="default">"An app on your phone wants to make your phone discoverable by other Bluetooth devices for <xliff:g id="timeout">%1$d</xliff:g> seconds. Allow?"</string>
    <string name="bluetooth_ask_discovery" product="default">An app wants to make your phone visible to other Bluetooth devices for <xliff:g id="timeout">%1$d</xliff:g> seconds.</string>

    <!-- Strings for asking to the user whether to allow an app to enable lasting discovery mode  -->
    <string name="bluetooth_ask_lasting_discovery" product="tablet">"An app on your tablet wants to make your tablet \u201calways discoverable\u201d by other Bluetooth devices. Allow?"</string>
    <string name="bluetooth_ask_lasting_discovery" product="default">"An app on your phone wants to make your phone \u201calways discoverable\u201d by other Bluetooth devices. Allow?"</string>
    <string name="bluetooth_ask_lasting_discovery" product="tablet">An app wants to make your tablet visible to other Bluetooth devices. You can change this later in Bluetooth settings.</string>
    <string name="bluetooth_ask_lasting_discovery" product="default">An app wants to make your phone visible to other Bluetooth devices. You can change this later in Bluetooth settings.</string>

    <!-- Strings for asking to the user whether to allow an app to enable bluetooth and discovery mode -->
    <string name="bluetooth_ask_enablement_and_discovery" product="tablet">"An app on your tablet wants to turn on Bluetooth and make your tablet discoverable by other devices for <xliff:g id="timeout">%1$d</xliff:g> seconds. Allow?"</string>
    <string name="bluetooth_ask_enablement_and_discovery" product="tablet">An app wants to turn on Bluetooth and make your tablet visible to other devices for <xliff:g id="timeout">%1$d</xliff:g> seconds.</string>
    <!-- Strings for asking to the user whether to allow an app to enable bluetooth and discovery mode -->
    <string name="bluetooth_ask_enablement_and_discovery" product="default">"An app on your phone wants to turn on Bluetooth and make your phone discoverable by other devices for <xliff:g id="timeout">%1$d</xliff:g> seconds. Allow?"</string>
    <string name="bluetooth_ask_enablement_and_discovery" product="default">An app wants to turn on Bluetooth and make your phone visible to other devices for <xliff:g id="timeout">%1$d</xliff:g> seconds.</string>

    <!-- Strings for asking to the user whether to allow an app to enable bluetooth and discovery mode -->
    <string name="bluetooth_ask_enablement_and_lasting_discovery" product="tablet">"An app on your tablet wants to turn on Bluetooth and make your tablet discoverable by other devices. Allow?"</string>
    <string name="bluetooth_ask_enablement_and_lasting_discovery" product="default">"An app on your phone wants to turn on Bluetooth and make your phone discoverable by other devices. Allow?"</string>
    <string name="bluetooth_ask_enablement_and_lasting_discovery" product="tablet">An app wants to turn on Bluetooth and make your tablet visible to other devices. You can change this later in Bluetooth settings.</string>
    <string name="bluetooth_ask_enablement_and_lasting_discovery" product="default">An app wants to turn on Bluetooth and make your phone visible to other devices. You can change this later in Bluetooth settings.</string>

    <!-- Strings for msg to display to user while bluetooth is turning on [CHAR LIMIT=60] -->
    <string name="bluetooth_turning_on">"Turning Bluetooth on\u2026"</string>
+2 −4
Original line number Diff line number Diff line
@@ -149,8 +149,6 @@ public class RequestPermissionActivity extends Activity implements

    private void createDialog() {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setIcon(android.R.drawable.ic_dialog_info);
        builder.setTitle(getString(R.string.bluetooth_permission_request));

        if (mNeededToEnableBluetooth) {
            // RequestPermissionHelperActivity has gotten confirmation from user
@@ -167,8 +165,8 @@ public class RequestPermissionActivity extends Activity implements
                builder.setMessage(
                        getString(R.string.bluetooth_ask_discovery, mTimeout));
            }
            builder.setPositiveButton(getString(R.string.yes), this);
            builder.setNegativeButton(getString(R.string.no), this);
            builder.setPositiveButton(getString(R.string.allow), this);
            builder.setNegativeButton(getString(R.string.deny), this);
        }

        mDialog = builder.create();
+5 −11
Original line number Diff line number Diff line
@@ -72,26 +72,20 @@ public class RequestPermissionHelperActivity extends AlertActivity implements

    void createDialog() {
        final AlertController.AlertParams p = mAlertParams;
        p.mIconId = android.R.drawable.ic_dialog_info;
        p.mTitle = getString(R.string.bluetooth_permission_request);

        View view = getLayoutInflater().inflate(R.layout.bluetooth_discoverable, null);
        p.mView = view;
        TextView tv = (TextView) view.findViewById(R.id.message);

        if (mEnableOnly) {
            tv.setText(getString(R.string.bluetooth_ask_enablement));
            p.mMessage = getString(R.string.bluetooth_ask_enablement);
        } else {
            if (mTimeout == BluetoothDiscoverableEnabler.DISCOVERABLE_TIMEOUT_NEVER) {
                tv.setText(getString(R.string.bluetooth_ask_enablement_and_lasting_discovery));
                p.mMessage = getString(R.string.bluetooth_ask_enablement_and_lasting_discovery);
            } else {
                tv.setText(getString(R.string.bluetooth_ask_enablement_and_discovery, mTimeout));
                p.mMessage = getString(R.string.bluetooth_ask_enablement_and_discovery, mTimeout);
            }
        }

        p.mPositiveButtonText = getString(R.string.yes);
        p.mPositiveButtonText = getString(R.string.allow);
        p.mPositiveButtonListener = this;
        p.mNegativeButtonText = getString(R.string.no);
        p.mNegativeButtonText = getString(R.string.deny);
        p.mNegativeButtonListener = this;

        setupAlert();
+3 −3
Original line number Diff line number Diff line
@@ -32,19 +32,19 @@
        style="@android:style/ButtonBar">

        <Button android:id="@+id/enable"
            android:layout_width="0dip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/enable" />

        <Button android:id="@+id/discoverable"
            android:layout_width="0dip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/discoverable" />

        <Button android:id="@+id/scan"
            android:layout_width="0dip"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="@string/start_scan" />
Loading