Example usage for android.view.inputmethod EditorInfo IME_ACTION_DONE

List of usage examples for android.view.inputmethod EditorInfo IME_ACTION_DONE

Introduction

In this page you can find the example usage for android.view.inputmethod EditorInfo IME_ACTION_DONE.

Prototype

int IME_ACTION_DONE

To view the source code for android.view.inputmethod EditorInfo IME_ACTION_DONE.

Click Source Link

Document

Bits of #IME_MASK_ACTION : the action key performs a "done" operation, typically meaning there is nothing more to input and the IME will be closed.

Usage

From source file:com.waz.zclient.newreg.fragments.EmailSignInFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup viewGroup, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_signin__with_email, viewGroup, false);
    guidedEditTextEmail = ViewUtils.getView(view, R.id.get__sign_in__email);
    guidedEditTextPassword = ViewUtils.getView(view, R.id.get__sign_in__password);
    resetPasswordTextView = ViewUtils.getView(view, R.id.ttv_signin_forgot_password);
    tabIndicatorLayout = ViewUtils.getView(view, R.id.til__app_entry);

    textViewGoToPhoneSignIn = ViewUtils.getView(view, R.id.ttv__new_reg__sign_in__go_to__phone);
    signInButton = ViewUtils.getView(view, R.id.pcb__signin__email);

    buttonBack = ViewUtils.getView(view, R.id.ll__activation_button__back);

    // as there is supposed to be another version of the signup screen in 12.2015
    // I am keeping the basic structure of the layouts and I am switching the elements
    // that are not visible so far
    buttonBack.setVisibility(View.GONE);

    guidedEditTextEmail.setResource(R.layout.guided_edit_text_sign_in__email);
    guidedEditTextEmail.setValidator(EmailValidator.newInstanceAcceptingEverything());
    guidedEditTextEmail.getEditText().addTextChangedListener(this);

    guidedEditTextPassword.setResource(R.layout.guided_edit_text_sign_in__password);
    guidedEditTextPassword.setValidator(PasswordValidator.instanceLegacy(getActivity()));
    guidedEditTextPassword.getEditText().addTextChangedListener(this);
    guidedEditTextPassword.getEditText().setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override//from  w  w  w. j  a v a 2  s.c  om
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                signIn();
                return true;
            } else {
                return false;
            }
        }
    });

    // reset password
    resetPasswordTextView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            getContainer().onOpenUrl(getResources().getString(R.string.url_password_reset));
            getControllerFactory().getTrackingController()
                    .tagEvent(new ResetPassword(ResetPassword.Location.FROM_SIGN_IN));
        }
    });

    return view;
}

From source file:org.wheelmap.android.fragment.SearchDialogFragment.java

@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (EditorInfo.IME_ACTION_DONE == actionId) {
        sendSearchInstructions();//from  ww w  .  j  a  va  2s  .  c o  m
        dismiss();
        return true;
    }

    return false;
}

From source file:com.skalski.websocketsclient.ActivityMain.java

@Override
protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    Wrappers wrappers = new Wrappers();
    wrappers.add(onClickWrapperExit);/*from   w w w  .j a va 2  s  .  c  om*/
    SuperActivityToast.onRestoreState(savedInstanceState, ActivityMain.this, wrappers);

    hostname = (EditText) findViewById(R.id.hostname);
    portNumber = (EditText) findViewById(R.id.port);
    timeout = (EditText) findViewById(R.id.timeout);

    cmdInput = (EditText) findViewById(R.id.cmdInput);
    cmdOutput = (TextView) findViewById(R.id.cmdOutput);
    connectButton = (CircularProgressButton) findViewById(R.id.btnConnect);

    cmdOutput.setMovementMethod(new ScrollingMovementMethod());
    connectButton.setIndeterminateProgressMode(true);

    /*
     * connectButton - onClickListener()
     */
    connectButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {

            if (connectButton.getProgress() == 0) {
                connectButton.setProgress(50);

                if ((hostname.getText().toString().equals("")) || (portNumber.getText().toString().equals(""))
                        || (timeout.getText().toString().equals(""))) {

                    Log.e(TAG_LOG, "Invalid connection settings");
                    show_info(getResources().getString(R.string.info_msg_1), false);
                    connectButton.setProgress(-1);
                    return;
                }

                /* save last settings */
                ActivitySettings.pref_set_hostname(getBaseContext(), hostname.getText().toString());
                ActivitySettings.pref_set_port_number(getBaseContext(), portNumber.getText().toString());
                ActivitySettings.pref_set_timeout(getBaseContext(), timeout.getText().toString());

                /* connect */
                if (!wsConnect()) {
                    show_info(getResources().getString(R.string.info_msg_2), false);
                    connectButton.setProgress(-1);
                }

            } else if (connectButton.getProgress() == -1) {
                connectButton.setProgress(0);
            }
        }
    });

    /*
     * cmdInput - OnEditorActionListener()
     */
    cmdInput.setOnEditorActionListener(new EditText.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {

                /* send data to server */
                wsSend();
                return true;
            }
            return false;
        }
    });
}

From source file:com.skubit.satoshidice.placebet.PlaceBetFragment.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.place_bet_fragment, null);

    mBetBtn = (Button) view.findViewById(R.id.betBtn);

    mRollEdit = (BetEditText) view.findViewById(R.id.underEdit);
    mPayoutEdit = (BetEditText) view.findViewById(R.id.payoutEdit);
    mWinEdit = (BetEditText) view.findViewById(R.id.winEdit);
    mProfitEdit = (BetEditText) view.findViewById(R.id.profitEdit);
    mBetAmountEdit = (BetEditText) view.findViewById(R.id.betAmountEdit);

    mRollEdit.setEventIntent(new Intent("updateRollField"));
    mPayoutEdit.setEventIntent(new Intent("updatePayoutField"));
    mWinEdit.setEventIntent(new Intent("updateWinField"));
    mProfitEdit.setEventIntent(new Intent("updateProfitField"));
    mBetAmountEdit.setEventIntent(new Intent("updateBetAmountField"));

    mProfitEdit.setFocusable(false);//from  w w w . j a v a 2  s . c  om
    mProfitEdit.setFocusableInTouchMode(false);

    mRollEdit.setOnEditorActionListener(new OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
                updateRollField();
            }
            return false;

        }
    });

    mPayoutEdit.setOnEditorActionListener(new OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
                updatePayoutField();
            }
            return false;

        }
    });

    mWinEdit.setOnEditorActionListener(new OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
                updateWinField();
            }
            return false;

        }
    });

    mBetAmountEdit.setOnEditorActionListener(new OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
                updateBetAmountField();
            }
            return false;

        }
    });

    mSeekbar = (SeekBar) view.findViewById(R.id.betParameters);
    mSeekbar.setMax(64225);
    mSeekbar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {

        @Override
        public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
            if (fromUser) {
                BetParameters bp = BetParameters.calculateWithNumberToRollUnder(progress);
                setTextFields(bp);
            }
        }

        @Override
        public void onStartTrackingTouch(SeekBar seekBar) {
            mRollEdit.clearFocus();
            mPayoutEdit.clearFocus();
            mWinEdit.clearFocus();
        }

        @Override
        public void onStopTrackingTouch(SeekBar seekBar) {

        }
    });

    mBetBtn.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            if (TextUtils.isEmpty(mRollEdit.getText().toString())
                    || TextUtils.isEmpty(mBetAmountEdit.getText().toString())
                    || TextUtils.isEmpty(mProfitEdit.getText().toString())) {
                Toast.makeText(getActivity(), "Enter in bet parameters first", Toast.LENGTH_SHORT).show();
                return;
            }

            int roll = Integer.valueOf(mRollEdit.getText().toString());

            Satoshi betAmount = new Satoshi(new Bitcoin(mBetAmountEdit.getText().toString()));
            long betInSatoshis = betAmount.getValueAsLong();

            Satoshi profitAmount = new Satoshi(new Bitcoin(mProfitEdit.getText().toString()));
            long profit = profitAmount.getValueAsLong();

            PlaceBetData data = new PlaceBetData();
            data.setBetInSatoshis(betInSatoshis);
            data.setRoll(roll);
            data.setProfit(profit);

            Intent intent = PlaceBetActivity.newIntent(data);
            getActivity().startActivity(intent);

            // String serverHash = mRoundResponse.getHash();
            // String id = String.valueOf(mRoundResponse.getId());

        }
    });
    return view;
}

From source file:com.inmovilizaciones.activity.LoginActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    try {/*ww w.  j a  v a 2 s  .c  o  m*/
        UtilidadesGenerales.context = this;
        app = (AplicacionInmovilizaciones) getApplicationContext();
        daoSession = app.getDaoSession();
        departamentosDao = daoSession.getDepartamentoDao();
        municipioDao = daoSession.getMunicipioDao();
        infraccionDao = daoSession.getInfraccionDao();
        parqueaderoDao = daoSession.getParqueaderoDao();
        zonasDao = daoSession.getZonasDao();
        tipoIdentificacionDao = daoSession.getTipoIdentificacionDao();
        gruasDao = daoSession.getGruaDao();
        coloresDao = daoSession.getColorDao();
        tipoServicioDao = daoSession.getTipoServicioDao();
        claseVehiculoDao = daoSession.getClaseVehiculoDao();
        personasDao = daoSession.getPersonaDao();
        vehiculoDao = daoSession.getVehiculoDao();
        setContentView(R.layout.login_activity);
        mMessage = (TextView) findViewById(R.id.message);
        mUsernameEdit = (EditText) findViewById(R.id.username_edit);
        mPasswordEdit = (EditText) findViewById(R.id.password_edit);
        mPasswordEdit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (actionId == EditorInfo.IME_ACTION_DONE) {
                    startLogin();
                    return true;
                } else {
                    return false;
                }
            }
        });

        if (app.getIdPersona() != -1) {
            Persona persona = personasDao.queryBuilder()
                    .where(PersonaDao.Properties.Id_persona.eq(app.getIdPersona())).unique();
            {
                if (persona != null) {
                    app.setUsuario(persona.getNombre1() + " " + persona.getNombre2() + " "
                            + persona.getApellido1() + " " + persona.getApellido2());
                    Intent listarInmovilizaciones = new Intent(LoginActivity.this,
                            ListarInmovilizacionesActivity.class);
                    startActivity(listarInmovilizaciones);
                    finish();
                } else {
                    app.setUsuario("");
                    app.setIdUsuario(-1);
                }
            }
        }
    } catch (Exception ex) {
        ex.printStackTrace();
    }
}

From source file:com.waz.zclient.newreg.fragments.EmailRegisterFragment.java

@Override
public void onResume() {
    super.onResume();
    backButton.setOnClickListener(this);
    signInButton.setOnClickListener(this);
    textViewName.addTextChangedListener(this);
    textViewEmail.addTextChangedListener(this);
    textViewPassword.addTextChangedListener(this);
    textViewPassword.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override/*from  ww  w  .j  a  v  a  2  s  . co m*/
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            return actionId == EditorInfo.IME_ACTION_DONE && areFieldsValid();
        }
    });
}

From source file:com.silentcircle.accounts.AccountStep1.java

private void updateVisibility() {
    if (loginSso) {
        mPasswordLayout.setVisibility(View.INVISIBLE);
        mShowPassword.setVisibility(View.INVISIBLE);
        mForgotPassword.setVisibility(View.INVISIBLE);
        mRegisterNew.setVisibility(View.GONE);
        mLoginExisting.setText("Login SSO");
        mUsernameInput.setImeOptions(EditorInfo.IME_ACTION_DONE);
    } else {/*from  www . j a  v  a2 s. c  om*/
        mPasswordLayout.setVisibility(View.VISIBLE);
        mShowPassword.setVisibility(View.VISIBLE);
        mForgotPassword.setVisibility(View.VISIBLE);
        // FIXME: Uncomment when account creation is enabled
        // mRegisterNew.setVisibility(View.VISIBLE);
        mLoginExisting.setText(mLoginSavedText);
        mUsernameInput.setImeOptions(EditorInfo.IME_ACTION_NEXT);
    }
    // setting input type refreshes keyboard display
    mUsernameInput.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
}

From source file:org.sufficientlysecure.keychain.ui.dialog.AddKeyserverDialogFragment.java

/**
 * Creates dialog//from   w  ww . ja v  a 2s . com
 */
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Activity activity = getActivity();

    mMessenger = getArguments().getParcelable(ARG_MESSENGER);

    CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity);

    alert.setTitle(R.string.add_keyserver_dialog_title);

    LayoutInflater inflater = activity.getLayoutInflater();
    View view = inflater.inflate(R.layout.add_keyserver_dialog, null);
    alert.setView(view);

    mKeyserverEditText = (EditText) view.findViewById(R.id.keyserver_url_edit_text);
    mVerifyKeyserverCheckBox = (CheckBox) view.findViewById(R.id.verify_keyserver_checkbox);

    // we don't want dialog to be dismissed on click, thereby requiring the hack seen below
    // and in onStart
    alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int id) {
            // we need to have an empty listener to prevent errors on some devices as mentioned
            // at http://stackoverflow.com/q/13746412/3000919
            // actual listener set in onStart
        }
    });

    alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int id) {
            dismiss();
        }
    });

    // Hack to open keyboard.
    // This is the only method that I found to work across all Android versions
    // http://turbomanage.wordpress.com/2012/05/02/show-soft-keyboard-automatically-when-edittext-receives-focus/
    // Notes: * onCreateView can't be used because we want to add buttons to the dialog
    //        * opening in onActivityCreated does not work on Android 4.4
    mKeyserverEditText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            mKeyserverEditText.post(new Runnable() {
                @Override
                public void run() {
                    InputMethodManager imm = (InputMethodManager) getActivity()
                            .getSystemService(Context.INPUT_METHOD_SERVICE);
                    imm.showSoftInput(mKeyserverEditText, InputMethodManager.SHOW_IMPLICIT);
                }
            });
        }
    });
    mKeyserverEditText.requestFocus();

    mKeyserverEditText.setImeActionLabel(getString(android.R.string.ok), EditorInfo.IME_ACTION_DONE);
    mKeyserverEditText.setOnEditorActionListener(this);

    return alert.show();
}

From source file:de.enlightened.peris.SocialFragment.java

@Override
public void onStart() {

    super.onStart();

    this.chatForum = this.application.getSession().getServer().chatForum;
    this.chatThread = this.application.getSession().getServer().chatThread;
    this.socialList = (ListView) getActivity().findViewById(R.id.social_list_view);
    this.socialList.setDivider(null);
    this.updateStatusButton = (Button) getActivity().findViewById(R.id.social_submit_status);
    this.newStatus = (EditText) getActivity().findViewById(R.id.social_status);

    if (this.application.getSession().getServer().serverColor.contains("#")) {
        this.updateStatusButton
                .setTextColor(Color.parseColor(this.application.getSession().getServer().serverColor));
    }/*from w  w  w. ja  v  a 2 s  . c  o  m*/

    if (this.application.getSession().getServer().serverTextColor.contains("#")) {
        this.newStatus
                .setTextColor(Color.parseColor(this.application.getSession().getServer().serverTextColor));

        if (this.application.getSession().getServer().serverColor
                .contentEquals(this.application.getSession().getServer().serverBoxColor)) {
            this.updateStatusButton
                    .setTextColor(Color.parseColor(this.application.getSession().getServer().serverTextColor));
        }
    }

    final Bundle bundle = getArguments();
    final String sharedText = bundle.getString("shared_text");
    if (sharedText.length() > 1) {
        this.newStatus.setText(sharedText);
    }
    this.newStatus.setOnEditorActionListener(new OnEditorActionListener() {

        @Override
        @SuppressWarnings("checkstyle:requirethis")
        public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                submitPost();
                return true;
            }
            return false;
        }

    });

    this.updateStatusButton.setOnClickListener(this.clickListener);

    String boxColor = getString(R.string.default_element_background);

    if (this.application.getSession().getServer().serverBoxColor != null) {
        boxColor = this.application.getSession().getServer().serverBoxColor;
    }

    if (boxColor.contains("#")) {
        final LinearLayout chatInputArea = (LinearLayout) getActivity().findViewById(R.id.chat_input_area);
        chatInputArea.setBackgroundColor(Color.parseColor(boxColor));
    }

}

From source file:org.cafemember.messenger.mytg.fragments.TransfareActivity.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    context = getContext();//from   w ww . j a v a  2s.  c o m
    //        View layout = inflater.inflate(R.layout.channels_layout, null);
    /*this.context = context;
    actionBar.setBackButtonImage(R.drawable.ic_ab_back);
    actionBar.setAllowOverlayTitle(true);
    actionBar.setTitle(LocaleController.getString("MenuTransfare", R.string.MenuTransfare));
    actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
    @Override
    public void onItemClick(int id) {
        if (id == -1) {
            finishFragment();
        } else if (id == done_button) {
            saveName();
        }else if (id == contact_button) {
            getContacts();
        }
    }
    });
            
    ActionBarMenu menu = actionBar.createMenu();
    contactsButton = menu.addItemWithWidth(contact_button, R.drawable.user_profile, AndroidUtilities.dp(56));
    doneButton = menu.addItemWithWidth(done_button, R.drawable.ic_done, AndroidUtilities.dp(56));
    */

    LinearLayout fragmentView = new LinearLayout(context);
    ((LinearLayout) fragmentView).setOrientation(LinearLayout.VERTICAL);
    fragmentView.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            return true;
        }
    });
    TextView ruleTextView = new TextView(context);
    ruleTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
    ruleTextView.setTextColor(0xff212121);
    ruleTextView.setGravity(Gravity.RIGHT);
    //        ruleTextView.setText(AndroidUtilities.replaceTags(LocaleController.getString("ShareText", R.string.ShareText)));
    ruleTextView.setText(LocaleController.getString("transfare_rule", R.string.transfare_rule));
    ((LinearLayout) fragmentView).addView(ruleTextView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT,
            LayoutHelper.WRAP_CONTENT, Gravity.CENTER, 24, 10, 24, 30));

    phoneField = new EditText(context);
    phoneField.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
    phoneField.setHintTextColor(0xff979797);
    phoneField.setTextColor(0xff212121);
    phoneField.setMaxLines(1);
    phoneField.setLines(1);
    phoneField.setGravity(Gravity.RIGHT);
    phoneField.setPadding(0, 0, 0, 0);
    phoneField.setSingleLine(true);
    phoneField.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT);
    phoneField.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_TEXT_FLAG_MULTI_LINE
            | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT);
    phoneField.setImeOptions(EditorInfo.IME_ACTION_DONE);
    phoneField.setHint(LocaleController.getString("TransfareUserHint", R.string.TransfareUserHint));
    AndroidUtilities.clearCursorDrawable(phoneField);

    amountField = new EditText(context);
    amountField.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 18);
    amountField.setHintTextColor(0xff979797);
    amountField.setTextColor(0xff212121);
    amountField.setMaxLines(1);
    amountField.setGravity(Gravity.RIGHT);
    amountField.setLines(1);
    amountField.setPadding(0, 0, 0, 0);
    amountField.setSingleLine(true);
    amountField.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT);
    amountField.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_TEXT_FLAG_MULTI_LINE
            | InputType.TYPE_TEXT_FLAG_AUTO_CORRECT);
    amountField.setImeOptions(EditorInfo.IME_ACTION_DONE);
    amountField.setHint(LocaleController.getString("TransfareAmountHint", R.string.TransfareAmountHint));
    AndroidUtilities.clearCursorDrawable(amountField);

    phoneField.setOnEditorActionListener(new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
            if (i == EditorInfo.IME_ACTION_DONE && doneButton != null) {
                doneButton.performClick();
                return true;
            }
            return false;
        }
    });

    ((LinearLayout) fragmentView).addView(phoneField,
            LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 36, 24, 24, 24, 0));

    checkTextView = new TextView(context);
    checkTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
    checkTextView.setGravity(Gravity.RIGHT);
    ((LinearLayout) fragmentView).addView(checkTextView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT,
            LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, 24, 12, 24, 0));

    Button button = new Button(context);

    button.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
    button.setTextColor(0xff6d6d72);
    button.setGravity(Gravity.CENTER);
    TextView helpTextView = new TextView(context);
    helpTextView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 15);
    helpTextView.setTextColor(0xff6d6d72);
    helpTextView.setGravity(Gravity.RIGHT);
    helpTextView.setText(AndroidUtilities.replaceTags(LocaleController.getString("RefHelp", R.string.RefHelp)));
    button.setText("");
    button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            saveName();
        }
    });
    ((LinearLayout) fragmentView).addView(helpTextView, LayoutHelper.createLinear(LayoutHelper.WRAP_CONTENT,
            LayoutHelper.WRAP_CONTENT, LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT, 24, 10, 24, 0));
    ((LinearLayout) fragmentView).addView(amountField,
            LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 36, 24, 24, 24, 0));
    ((LinearLayout) fragmentView).addView(button,
            LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, 24, 24, 24, 0));

    /*View v = LayoutInflater.from(context).inflate(R.layout.transfare_type, null);
    typeJoin = (RadioButton)v.findViewById(R.id.joinRadio);
    typeView = (RadioButton)v.findViewById(R.id.viewRadio);
    ((LinearLayout) fragmentView).addView(v, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 36, 24, 24, 24, 0));*/
    phoneField.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {

        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
            checkUserName(phoneField.getText().toString(), false);
        }

        @Override
        public void afterTextChanged(Editable editable) {

        }
    });

    checkTextView.setVisibility(View.GONE);
    FontManager.instance().setTypefaceImmediate(fragmentView);

    return fragmentView;
}