Merge "Fix layout for edit quick response dialog."

This commit is contained in:
Mindy Pereira 2011-12-02 11:14:22 -08:00 committed by Android (Google) Code Review
commit dc931441d8
2 changed files with 35 additions and 3 deletions

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2011 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.
-->
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:padding="8dip">
<EditText
android:id="@+id/quick_response_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</RelativeLayout>

View File

@ -30,6 +30,8 @@ import android.content.DialogInterface;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.EditText;
@ -71,8 +73,9 @@ public class EditQuickResponseDialog extends DialogFragment
public Dialog onCreateDialog(Bundle savedInstanceState) {
final Context context = getActivity();
mQuickResponse = (QuickResponse) getArguments().getParcelable(QUICK_RESPONSE);
mQuickResponseEditText = new EditText(context);
View wrapper = LayoutInflater.from(context)
.inflate(R.layout.quick_response_edit_dialog, null);
mQuickResponseEditText = (EditText) wrapper.findViewById(R.id.quick_response_text);
if (savedInstanceState != null) {
String quickResponseSavedString =
savedInstanceState.getString(QUICK_RESPONSE_EDITED_STRING);
@ -87,7 +90,7 @@ public class EditQuickResponseDialog extends DialogFragment
final AlertDialog.Builder b = new AlertDialog.Builder(context);
b.setTitle(getResources().getString(R.string.edit_quick_response_dialog))
.setView(mQuickResponseEditText)
.setView(wrapper)
.setNegativeButton(R.string.cancel_action, this)
.setPositiveButton(R.string.save_action, this);
mDialog = b.create();