Merge "Fixed a crash when loading Bluetooth Settings." into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ebe496ea7b
53
res/layout/bluetooth_device_settings.xml
Normal file
53
res/layout/bluetooth_device_settings.xml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Copyright (C) 2014 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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:gravity="center">
|
||||||
|
|
||||||
|
<LinearLayout android:id="@+id/dialog_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="@dimen/bluetooth_dialog_padding"
|
||||||
|
style="@style/bt_item" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/bluetooth_preference_paired_dialog_name_label"
|
||||||
|
android:textDirection="locale"
|
||||||
|
android:textColor="?android:attr/colorAccent"
|
||||||
|
style="@style/bt_item_label" />
|
||||||
|
|
||||||
|
<EditText android:id="@+id/name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textNoSuggestions"
|
||||||
|
android:maxLength="@integer/bluetooth_name_length"
|
||||||
|
android:singleLine="true"
|
||||||
|
style="@style/bt_item_edit_content" />
|
||||||
|
|
||||||
|
<fragment android:id="@+id/bluetooth_fragment_settings"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
class="com.android.settings.bluetooth.DeviceProfilesSettings" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@@ -196,6 +196,29 @@
|
|||||||
<item name="android:textColor">?android:attr/colorAccent</item>
|
<item name="android:textColor">?android:attr/colorAccent</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<style name="bt_item">
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:layout_marginTop">8dip</item>
|
||||||
|
<item name="android:layout_marginStart">16dip</item>
|
||||||
|
<item name="android:layout_marginEnd">16dip</item>
|
||||||
|
<item name="android:orientation">vertical</item>
|
||||||
|
<item name="android:gravity">start</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="bt_item_label">
|
||||||
|
<item name="android:layout_width">wrap_content</item>
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:textSize">14sp</item>
|
||||||
|
<item name="android:textAlignment">viewStart</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="bt_item_edit_content">
|
||||||
|
<item name="android:layout_width">match_parent</item>
|
||||||
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
<item name="android:textSize">18sp</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
<style name="wifi_item">
|
<style name="wifi_item">
|
||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:layout_height">wrap_content</item>
|
<item name="android:layout_height">wrap_content</item>
|
||||||
|
@@ -393,7 +393,7 @@ public final class BluetoothSettings extends DeviceListPreferenceFragment implem
|
|||||||
}
|
}
|
||||||
if (profileFrag == null) {
|
if (profileFrag == null) {
|
||||||
LayoutInflater inflater = getActivity().getLayoutInflater();
|
LayoutInflater inflater = getActivity().getLayoutInflater();
|
||||||
mSettingsDialogView = inflater.inflate(R.layout.bluetooth_device_picker, null);
|
mSettingsDialogView = inflater.inflate(R.layout.bluetooth_device_settings, null);
|
||||||
profileFrag = (DeviceProfilesSettings)activity.getFragmentManager()
|
profileFrag = (DeviceProfilesSettings)activity.getFragmentManager()
|
||||||
.findFragmentById(R.id.bluetooth_fragment_settings);
|
.findFragmentById(R.id.bluetooth_fragment_settings);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user