Merge "Fix layout for edit quick response dialog."
This commit is contained in:
commit
dc931441d8
29
res/layout/quick_response_edit_dialog.xml
Normal file
29
res/layout/quick_response_edit_dialog.xml
Normal 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>
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user