Search in sources :

Example 91 with EditText

use of android.widget.EditText in project android by owncloud.

the class RenameFileDialogFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    mTargetFile = getArguments().getParcelable(ARG_TARGET_FILE);
    // Inflate the layout for the dialog
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View v = inflater.inflate(R.layout.edit_box_dialog, null);
    // Setup layout 
    String currentName = mTargetFile.getFileName();
    EditText inputText = ((EditText) v.findViewById(R.id.user_input));
    inputText.setText(currentName);
    int selectionStart = 0;
    int extensionStart = mTargetFile.isFolder() ? -1 : currentName.lastIndexOf(".");
    int selectionEnd = (extensionStart >= 0) ? extensionStart : currentName.length();
    if (selectionStart >= 0 && selectionEnd >= 0) {
        inputText.setSelection(Math.min(selectionStart, selectionEnd), Math.max(selectionStart, selectionEnd));
    }
    inputText.requestFocus();
    // Build the dialog  
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setView(v).setPositiveButton(R.string.common_ok, this).setNegativeButton(R.string.common_cancel, this).setTitle(R.string.rename_dialog_title);
    Dialog d = builder.create();
    d.getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
    return d;
}
Also used : EditText(android.widget.EditText) AlertDialog(android.support.v7.app.AlertDialog) Dialog(android.app.Dialog) AlertDialog(android.support.v7.app.AlertDialog) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) View(android.view.View)

Example 92 with EditText

use of android.widget.EditText in project android by owncloud.

the class CreateFolderDialogFragment method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    mParentFolder = getArguments().getParcelable(ARG_PARENT_FOLDER);
    // Inflate the layout for the dialog
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View v = inflater.inflate(R.layout.edit_box_dialog, null);
    // Setup layout 
    EditText inputText = ((EditText) v.findViewById(R.id.user_input));
    inputText.setText("");
    inputText.requestFocus();
    // Build the dialog  
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setView(v).setPositiveButton(R.string.common_ok, this).setNegativeButton(R.string.common_cancel, this).setTitle(R.string.uploader_info_dirname);
    Dialog d = builder.create();
    d.getWindow().setSoftInputMode(LayoutParams.SOFT_INPUT_STATE_VISIBLE);
    return d;
}
Also used : EditText(android.widget.EditText) AlertDialog(android.support.v7.app.AlertDialog) Dialog(android.app.Dialog) AlertDialog(android.support.v7.app.AlertDialog) LayoutInflater(android.view.LayoutInflater) TextView(android.widget.TextView) View(android.view.View)

Example 93 with EditText

use of android.widget.EditText in project mobile-android by photo.

the class MemePanel method beginEditText.

/**
	 * Begin edit text.
	 * 
	 * @param view
	 *           the view
	 */
private void beginEditText(final DrawableHighlightView view) {
    mLogger.info("beginEditText", view);
    EditText editText = null;
    if (view == topHv) {
        editText = editTopText;
    } else if (view == bottomHv) {
        editText = editBottomText;
    }
    if (editText != null) {
        mEditTextWatcher.view = null;
        editText.removeTextChangedListener(mEditTextWatcher);
        final EditableDrawable editable = (EditableDrawable) view.getContent();
        final String oldText = (String) editable.getText();
        editText.setText(oldText);
        editText.setSelection(editText.length());
        editText.setImeOptions(EditorInfo.IME_ACTION_DONE);
        editText.requestFocusFromTouch();
        Handler handler = new Handler();
        ResultReceiver receiver = new ResultReceiver(handler);
        if (!mInputManager.showSoftInput(editText, 0, receiver)) {
            // TODO: verify
            mInputManager.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
        }
        mEditTextWatcher.view = view;
        editText.setOnEditorActionListener(this);
        editText.addTextChangedListener(mEditTextWatcher);
        ((ImageViewDrawableOverlay) mImageView).setSelectedHighlightView(view);
        ((EditableDrawable) view.getContent()).setText(((EditableDrawable) view.getContent()).getText());
        view.forceUpdate();
    }
}
Also used : EditText(android.widget.EditText) ImageViewDrawableOverlay(com.aviary.android.feather.widget.ImageViewDrawableOverlay) EditableDrawable(com.aviary.android.feather.library.graphics.drawable.EditableDrawable) Handler(android.os.Handler) ResultReceiver(android.os.ResultReceiver)

Example 94 with EditText

use of android.widget.EditText in project mobile-android by photo.

the class MemePanel method endEditText.

/**
	 * End edit text.
	 * 
	 * @param view
	 *           the view
	 */
private void endEditText(final DrawableHighlightView view) {
    mLogger.info("endEditText", view);
    mEditTextWatcher.view = null;
    EditText editText = null;
    if (view == topHv)
        editText = editTopText;
    else if (view == bottomHv)
        editText = editBottomText;
    if (editText != null) {
        editText.removeTextChangedListener(mEditTextWatcher);
        if (mInputManager.isActive(editText)) {
            mInputManager.hideSoftInputFromWindow(editText.getWindowToken(), 0);
        }
        editText.clearFocus();
    }
// this will send the focus to the bottom panel
// but also creating a bad visual effect
//mOptionView.requestFocus();
}
Also used : EditText(android.widget.EditText)

Example 95 with EditText

use of android.widget.EditText in project mobile-android by photo.

the class AccountLogin method forgotPasswordButtonAction.

public void forgotPasswordButtonAction(View view) {
    CommonUtils.debug(TAG, "Recover user password");
    TrackerUtils.trackButtonClickEvent("forgot_password_button", AccountLogin.this);
    EditText editText = (EditText) findViewById(R.id.edit_email);
    String email = editText.getText().toString();
    if (!GuiUtils.validateBasicTextData(new String[] { email }, new int[] { R.string.field_email })) {
        return;
    }
    getRecoverPasswordFragment().recoverPassword(email);
}
Also used : EditText(android.widget.EditText)

Aggregations

EditText (android.widget.EditText)613 View (android.view.View)288 TextView (android.widget.TextView)204 DialogInterface (android.content.DialogInterface)131 Button (android.widget.Button)120 AlertDialog (android.app.AlertDialog)114 Intent (android.content.Intent)90 LinearLayout (android.widget.LinearLayout)74 ImageView (android.widget.ImageView)59 AlertDialog (android.support.v7.app.AlertDialog)48 ScrollView (android.widget.ScrollView)47 AdapterView (android.widget.AdapterView)44 ViewGroup (android.view.ViewGroup)42 LayoutInflater (android.view.LayoutInflater)41 Editable (android.text.Editable)39 ListView (android.widget.ListView)38 RecyclerView (android.support.v7.widget.RecyclerView)36 Context (android.content.Context)34 Bundle (android.os.Bundle)34 KeyEvent (android.view.KeyEvent)34