Java 类android.widget.TextView.OnEditorActionListener 实例源码

项目:xumoqi    文件:EnterableEditText.java   
public static void setupEditText(Activity activity, final Enterable ent, EditText et) {
    OnEditorActionListener tveal = new OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (actionId == EditorInfo.IME_ACTION_SEND || 
                    (event.getKeyCode() == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_DOWN)) {
                    ent.onEnter();
                    return true;
                }
                return false;
            }
        };

    et.setOnEditorActionListener(tveal);
    et.requestFocus();

    activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
项目:LoginRegisterFramework    文件:SignUpActivity.java   
private void initViews() {

        getVerifiCodeButton = getView(R.id.btn_send_verifi_code);
        getVerifiCodeButton.setOnClickListener(this);
        phoneEdit = getView(R.id.et_phone);
        phoneEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);// 下一步
        verifyCodeEdit = getView(R.id.et_verifiCode);
        verifyCodeEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);// 下一步
        passwordEdit = getView(R.id.et_password);
        passwordEdit.setImeOptions(EditorInfo.IME_ACTION_DONE);
        passwordEdit.setImeOptions(EditorInfo.IME_ACTION_GO);
        passwordEdit.setOnEditorActionListener(new OnEditorActionListener() {

            @Override
            public boolean onEditorAction(TextView v, int actionId,
                                          KeyEvent event) {
                // 点击虚拟键盘的done
                if (actionId == EditorInfo.IME_ACTION_DONE
                        || actionId == EditorInfo.IME_ACTION_GO) {
                    commit();
                }
                return false;
            }
        });
    }
项目:FMTech    文件:PurchaseAuthenticationChallengeBaseStep.java   
protected void createPasswordPinView(int paramInt1, int paramInt2)
{
  this.mMainView.findViewById(2131755690).setVisibility(0);
  this.mPasswordView = ((EditText)this.mMainView.findViewById(paramInt1));
  this.mPasswordView.setVisibility(0);
  this.mPasswordView.setOnEditorActionListener(new TextView.OnEditorActionListener()
  {
    public final boolean onEditorAction(TextView paramAnonymousTextView, int paramAnonymousInt, KeyEvent paramAnonymousKeyEvent)
    {
      if (paramAnonymousInt == 6)
      {
        PurchaseAuthenticationChallengeBaseStep.this.logClickAndSubmitResponse(true);
        return true;
      }
      return false;
    }
  });
  this.mPasswordView.setHintTextColor(ContextCompat.getColor(((PurchaseFragment)this.mParentFragment).getContext(), 2131689798));
  this.mHelpToggleView = ((ImageView)this.mMainView.findViewById(2131755691));
  this.mHelpToggleView.setOnClickListener(this);
  this.mHelpToggleView.setContentDescription(getString(paramInt2));
  this.mErrorView = ((TextView)this.mMainView.findViewById(2131755481));
  if (!TextUtils.isEmpty(this.mErrorMessage)) {
    showErrorMessage(this.mErrorMessage);
  }
}
项目:A-week-to-develop-android-app-plan    文件:SignUpActivity.java   
private void initViews() {

        getVerifiCodeButton = getView(R.id.btn_send_verifi_code);
        getVerifiCodeButton.setOnClickListener(this);
        phoneEdit = getView(R.id.et_phone);
        phoneEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);// 下一步
        verifyCodeEdit = getView(R.id.et_verifiCode);
        verifyCodeEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);// 下一步
        passwordEdit = getView(R.id.et_password);
        passwordEdit.setImeOptions(EditorInfo.IME_ACTION_DONE);
        passwordEdit.setImeOptions(EditorInfo.IME_ACTION_GO);
        passwordEdit.setOnEditorActionListener(new OnEditorActionListener() {

            @Override
            public boolean onEditorAction(TextView v, int actionId,
                                          KeyEvent event) {
                // 点击虚拟键盘的done
                if (actionId == EditorInfo.IME_ACTION_DONE
                        || actionId == EditorInfo.IME_ACTION_GO) {
                    commit();
                }
                return false;
            }
        });
    }
项目:A-week-to-develop-android-app-plan    文件:SignUpActivity.java   
private void initViews() {

        getVerifiCodeButton = getView(R.id.btn_send_verifi_code);
        getVerifiCodeButton.setOnClickListener(this);
        phoneEdit = getView(R.id.et_phone);
        phoneEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);// 下一步
        verifyCodeEdit = getView(R.id.et_verifiCode);
        verifyCodeEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);// 下一步
        passwordEdit = getView(R.id.et_password);
        passwordEdit.setImeOptions(EditorInfo.IME_ACTION_DONE);
        passwordEdit.setImeOptions(EditorInfo.IME_ACTION_GO);
        passwordEdit.setOnEditorActionListener(new OnEditorActionListener() {

            @Override
            public boolean onEditorAction(TextView v, int actionId,
                                          KeyEvent event) {
                // 点击虚拟键盘的done
                if (actionId == EditorInfo.IME_ACTION_DONE
                        || actionId == EditorInfo.IME_ACTION_GO) {
                    commit();
                }
                return false;
            }
        });
    }
项目:cloud-cup-android    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Firebase.setAndroidContext(this);
    setContentView(R.layout.activity_main);

    mGoogleApiClient = new GoogleApiClient.Builder(this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Plus.API)
            .addScope(Plus.SCOPE_PLUS_LOGIN)
            .build();

    firebase = new Firebase(Consts.FIREBASE_URL);
    username = (TextView) findViewById(R.id.username);
    userImage = (ImageView) findViewById(R.id.user_image);
    code = (EditText) findViewById(R.id.code);
    code.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            join();
            return true;
        }
    });
    code.requestFocus();
}
项目:TankMMBaseNew    文件:DialogInputNumber.java   
private void initView() {
    View view = LayoutInflater.from(getContext()).inflate(R.layout.dialog_input_number, null);
    et_number = (EditText) view.findViewById(R.id.et_number);
    tv_name = (TextView) view.findViewById(R.id.tv_name);
    view.findViewById(R.id.btn_ok).setOnClickListener(this);
    view.findViewById(R.id.btn_close).setOnClickListener(this);
    addView(view, new LayoutParams(LayoutParams.MATCH_PARENT,
            LayoutParams.MATCH_PARENT));    
    et_number.setOnEditorActionListener(new OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            // TODO Auto-generated method stub
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                inputOk();
            }
            return false;
        }
    });

}
项目:xumoqi    文件:EnterableEditText.java   
public static void setupEditText(Activity activity, final Enterable ent, EditText et) {
    OnEditorActionListener tveal = new OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if (actionId == EditorInfo.IME_ACTION_SEND || 
                    (event.getKeyCode() == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_DOWN)) {
                    ent.onEnter();
                    return true;
                }
                return false;
            }
        };

    et.setOnEditorActionListener(tveal);
    et.requestFocus();

    activity.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
}
项目:Flucso    文件:EntryFragment.java   
private void setCommentView() {
    if (entry.canComment()) {
        edtNewCom.setEnabled(true);
        edtNewCom.setOnEditorActionListener(new OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                if ((actionId == EditorInfo.IME_ACTION_SEND && !TextUtils.isEmpty(edtNewCom.getText().toString())) ||
                    (actionId == EditorInfo.IME_NULL && event != null && event.getAction() == KeyEvent.ACTION_DOWN &&
                    event.getKeyCode() == KeyEvent.KEYCODE_ENTER))
                    doInsComment(edtNewCom.getText().toString());
                return false;
            }
        });
    } else {
        edtNewCom.setEnabled(false);
        edtNewCom.setOnEditorActionListener(null);
        edtNewCom.setText(R.string.entry_cant_comm);
    }
}
项目:Ironhide    文件:DelegatingEditText.java   
public DelegatingEditText(Context context, AttributeSet attrs) {
    super(context, attrs);
    setOrientation(VERTICAL);
    mContext = context;
    LayoutInflater inflater = LayoutInflater.from(context);
    inflater.inflate(R.layout.delegating_edit_text, this, /* attachToRoot */ true);
    messageView = (TextView) findViewById(R.id.edit_text_message);
    delegateEditText = (EditText) findViewById(R.id.delegate_edit_text);
    delegateEditText.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionCode, KeyEvent event) {
            messageView.setText("typed: " + delegateEditText.getText());
            messageView.setVisibility(View.VISIBLE);
            InputMethodManager imm =
                    (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(delegateEditText.getWindowToken(), 0);
            return true;
        }
    });
}
项目:yiim_v2    文件:ViewChatRecordActivity.java   
@Override
protected void installListeners() {
    // TODO Auto-generated method stub
    mEditText.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId,
                KeyEvent event) {
            // TODO Auto-generated method stub
            if (actionId == EditorInfo.IME_ACTION_GO) {
                try {
                    Integer page = Integer.valueOf(mEditText.getText()
                            .toString());
                    if (page > 0 && page <= mMaxPages) {
                        mCurrentPage = page;
                        loadPage();
                    }
                } catch (Exception e) {
                    // TODO: handle exception
                }
            }
            return false;
        }
    });
}
项目:android-test-kit    文件:DelegatingEditText.java   
public DelegatingEditText(Context context, AttributeSet attrs) {
  super(context, attrs);
  setOrientation(VERTICAL);
  mContext = context;
  LayoutInflater inflater = LayoutInflater.from(context);
  inflater.inflate(R.layout.delegating_edit_text, this, /* attachToRoot */ true);
  messageView = (TextView) findViewById(R.id.edit_text_message);
  delegateEditText = (EditText) findViewById(R.id.delegate_edit_text);
  delegateEditText.setOnEditorActionListener(new OnEditorActionListener() {
    @Override
    public boolean onEditorAction(TextView v, int actionCode, KeyEvent event) {
      messageView.setText("typed: " + delegateEditText.getText());
      messageView.setVisibility(View.VISIBLE);
      InputMethodManager imm =
          (InputMethodManager) mContext.getSystemService(Context.INPUT_METHOD_SERVICE);
      imm.hideSoftInputFromWindow(delegateEditText.getWindowToken(), 0);
      return true;
    }
  });
}
项目:Graphs    文件:MainActivity.java   
@Override
public View onCreateActionView() {
    // Inflate the action view to be shown on the action bar.
    LayoutInflater layoutInflater = LayoutInflater.from(mContext);
    View view = layoutInflater.inflate(R.layout.edit_weight_layout,
            null);
    text = (EditText) view.findViewById(R.id.weightText);
    text.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId,
                KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                if (text.getText().toString() != null) {
                    weight = Integer
                            .parseInt(text.getText().toString());
                }

            }
            return false;
        }
    });
    return view;

}
项目:AndroidClient    文件:GoalPostsAdapter.java   
private void populateNewCommentInputView(View newCommentView, final Post post) {
    // User's image
    ImageView ivPosterProfile = (ImageView) newCommentView.findViewById(R.id.ivPosterProfile);
    ivPosterProfile.setImageResource(ModelUtils.getImageResourceForUser((User) User
            .getCurrentUser()));

    final EditText etComment = (EditText) newCommentView.findViewById(R.id.etComment);

    etComment.setOnEditorActionListener(new OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            boolean handled = false;
            if (actionId == EditorInfo.IME_ACTION_SEND) {
                SaveCommentListener saveCommentListener = (SaveCommentListener) (LCDetailsActivity) getContext();
                saveCommentListener.onSaveComment(
                        post.getObjectId(), etComment.getText().toString());
                handled = true;
            }
            return handled;
        }
    });

}
项目:Android-FoursquareSearchVenues    文件:VenueSearchActivity.java   
private void initDataToComponent(String query ){
    if(editTextVenue == null) {
        editTextVenue = ( EditText) findViewById( R.id.editTextVenue);
    }
    if(query!=null && !query.equals( "")) {
        editTextVenue.setText( query);
        editTextVenue.setTextIsSelectable( true);

        editTextVenue.setFocusable( true);
        editTextVenue.setFocusableInTouchMode( true);

    }
    editTextVenue.setOnEditorActionListener( new OnEditorActionListener( ){

        @Override
        public boolean onEditorAction( TextView v, int actionId, KeyEvent event){

            searchVenue( editTextVenue.getText( ).toString( ), lat, lng);

            return false;
        }
    });
}
项目:lollipopfx-kitkatjelly    文件:LayoutChangesActivity.java   
@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_layout_changes);

      mContainerView = (ViewGroup) findViewById(R.id.container);
      edittext = (EditText) findViewById(R.id.editbox);

      edittext.setOnEditorActionListener(new OnEditorActionListener() {
    @Override
    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if(!edittext.getEditableText().toString().trim().equals(""))
        {
            mylist.add(edittext.getEditableText().toString());
            addItem(mylist.size()-1);
            edittext.setText("");
        }
        return true;
    }
});
  }
项目:co_nomad    文件:MainActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    /* Verification du mot de passe lors du clic sur 'Ok' du clavier */
    ((EditText) findViewById(R.id.motDePasse))
            .setOnEditorActionListener(new OnEditorActionListener() {
                @Override
                public boolean onEditorAction(TextView v, int actionId,
                        KeyEvent event) {
                    toMenu(v);
                    return true;
                }
    });
    manageFileProcedureUsed();
}
项目:Graphs    文件:MainActivity.java   
@Override
public View onCreateActionView() {
    // Inflate the action view to be shown on the action bar.
    LayoutInflater layoutInflater = LayoutInflater.from(mContext);
    View view = layoutInflater.inflate(R.layout.edit_weight_layout,
            null);
    text = (EditText) view.findViewById(R.id.weightText);
    text.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId,
                KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                if (text.getText().toString() != null) {
                    weight = Integer
                            .parseInt(text.getText().toString());
                }

            }
            return false;
        }
    });
    return view;

}
项目:TheGamesDB-Android-app    文件:SearchActivity.java   
private void setSearchBarEnterAction() {
final EditText searchBar = (EditText) findViewById(R.id.searchBar);
searchBar.setOnEditorActionListener(new OnEditorActionListener() {

      public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
        if (actionId == EditorInfo.IME_ACTION_DONE) {
          searchQuery = searchBar.getText().toString();
          cleanSearchQuery();
          sendSearchRequest();
          return true;
        } else {
          return false;
        }
     }
});
  }
项目:CSipSimple    文件:PickupSipUri.java   
@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.pickup_uri);


        //Set window size
//      LayoutParams params = getWindow().getAttributes();
//      params.width = LayoutParams.FILL_PARENT;
//      getWindow().setAttributes((android.view.WindowManager.LayoutParams) params);

        //Set title
        // TODO -- use dialog instead
//      ((TextView) findViewById(R.id.my_title)).setText(R.string.pickup_sip_uri);
//      ((ImageView) findViewById(R.id.my_icon)).setImageResource(android.R.drawable.ic_menu_call);


        okBtn = (Button) findViewById(R.id.ok);
        okBtn.setOnClickListener(this);
        Button btn = (Button) findViewById(R.id.cancel);
        btn.setOnClickListener(this);


        sipUri = (EditSipUri) findViewById(R.id.sip_uri);
        sipUri.getTextField().setOnEditorActionListener(new OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView tv, int action, KeyEvent arg2) {
                if(action == EditorInfo.IME_ACTION_GO) {
                    sendPositiveResult();
                    return true;
                }
                return false;
            }
        });
        sipUri.setShowExternals(false);


    }
项目:chromium-for-android-56-debug-video    文件:PassphraseCreationDialogFragment.java   
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    super.onCreateDialog(savedInstanceState);
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.sync_custom_passphrase, null);
    mEnterPassphrase = (EditText) view.findViewById(R.id.passphrase);
    mConfirmPassphrase = (EditText) view.findViewById(R.id.confirm_passphrase);

    mConfirmPassphrase.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                tryToSubmitPassphrase();
            }
            return false;
        }
    });

    TextView instructionsView =
            (TextView) view.findViewById(R.id.custom_passphrase_instructions);
    instructionsView.setMovementMethod(LinkMovementMethod.getInstance());
    instructionsView.setText(getInstructionsText());

    AlertDialog dialog = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme)
            .setView(view)
            .setTitle(R.string.sync_passphrase_type_custom_dialog_title)
            .setPositiveButton(R.string.save, null)
            .setNegativeButton(R.string.cancel, null)
            .create();
    dialog.getDelegate().setHandleNativeActionModesEnabled(false);
    return dialog;
}
项目:Android-SerialPort-API    文件:ConsoleActivity.java   
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.console);

    //      setTitle("Loopback test");
    mReception = (EditText) findViewById(R.id.EditTextReception);

    EditText Emission = (EditText) findViewById(R.id.EditTextEmission);
    Emission.setOnEditorActionListener(new OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            int i;
            CharSequence t = v.getText();
            char[] text = new char[t.length()];
            for (i = 0; i < t.length(); i++) {
                text[i] = t.charAt(i);
            }
            try {
                mOutputStream.write(new String(text).getBytes());
                mOutputStream.write('\n');
            } catch (IOException e) {
                e.printStackTrace();
            }
            return false;
        }
    });
}
项目:AndroidChromium    文件:PassphraseCreationDialogFragment.java   
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    super.onCreateDialog(savedInstanceState);
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.sync_custom_passphrase, null);
    mEnterPassphrase = (EditText) view.findViewById(R.id.passphrase);
    mConfirmPassphrase = (EditText) view.findViewById(R.id.confirm_passphrase);

    mConfirmPassphrase.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                tryToSubmitPassphrase();
            }
            return false;
        }
    });

    TextView instructionsView =
            (TextView) view.findViewById(R.id.custom_passphrase_instructions);
    instructionsView.setMovementMethod(LinkMovementMethod.getInstance());
    instructionsView.setText(getInstructionsText());

    AlertDialog dialog = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme)
            .setView(view)
            .setTitle(R.string.sync_passphrase_type_custom_dialog_title)
            .setPositiveButton(R.string.save, null)
            .setNegativeButton(R.string.cancel, null)
            .create();
    dialog.getDelegate().setHandleNativeActionModesEnabled(false);
    return dialog;
}
项目:SimpleFlickrSearch    文件:SearchFragment.java   
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {

    View rootView = inflater.inflate(R.layout.search_fragment, container, false);

       searchBarIV = (ImageView) rootView.findViewById(R.id.search);
       searchBarIV.setOnClickListener(this);
       iconIV = (ImageView) rootView.findViewById(R.id.searchIcon);
       iconIV.setOnClickListener(this);
       text = (TextView) rootView.findViewById(R.id.text);
       text.setOnEditorActionListener(new OnEditorActionListener() {
           public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
               if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) || (actionId == EditorInfo.IME_ACTION_DONE)) {
                   Bundle searchTag = new Bundle();
                   searchTag.putString(SEARCH_TAG_KEY, text.getText().toString().trim());
                ((MainActivity)getActivity()).moveToPhotosFragment(searchTag);
                //startActivity(new Intent(getActivity(), FriendsActivity.class));
               }    
               return false;
           }
       });
       searchToBar = (AnimatedVectorDrawable) getResources().getDrawable(R.drawable.anim_search_to_bar);
       barToSearch = (AnimatedVectorDrawable) getResources().getDrawable(R.drawable.anim_bar_to_search);
       interp = AnimationUtils.loadInterpolator(this.getActivity(), android.R.interpolator.linear_out_slow_in);
       duration = getResources().getInteger(R.integer.duration_bar);
       // iv is sized to hold the search+bar so when only showing the search icon, translate the
       // whole view left by half the difference to keep it centered
       offset = -71f * (int) getResources().getDisplayMetrics().scaledDensity;
       searchBarIV.setTranslationX(offset);

       rootView.setOnClickListener(this);

       return rootView;
   }
项目:Vafrinn    文件:PassphraseCreationDialogFragment.java   
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    super.onCreateDialog(savedInstanceState);
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.sync_custom_passphrase, null);
    mEnterPassphrase = (EditText) view.findViewById(R.id.passphrase);
    mConfirmPassphrase = (EditText) view.findViewById(R.id.confirm_passphrase);

    mConfirmPassphrase.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                tryToSubmitPassphrase();
            }
            return false;
        }
    });

    AlertDialog dialog = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme)
            .setView(view)
            .setTitle(R.string.sync_passphrase_type_custom)
            .setPositiveButton(R.string.ok, null)
            .setNegativeButton(R.string.cancel, null)
            .create();
    dialog.getDelegate().setHandleNativeActionModesEnabled(false);
    return dialog;
}
项目:MVPAndroidBootstrap    文件:EditTextUtil.java   
public static OnEditorActionListener getSoftInputHideEditorActionListener(final Context context, final EditText editText) {
    OnEditorActionListener hideEditorListener = new OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                EditTextUtil.hideSoftInPut(editText, context);
                return true;
            }
            return false;
        }
    };

    return hideEditorListener;
}
项目:RxAndroidBootstrap    文件:EditTextUtil.java   
public static OnEditorActionListener getSoftInputHideEditorActionListener(final Context context, final EditText editText) {
    OnEditorActionListener hideEditorListener = new OnEditorActionListener() {

        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                EditTextUtil.hideSoftInPut(editText, context);
                return true;
            }
            return false;
        }
    };

    return hideEditorListener;
}
项目:365browser    文件:PassphraseCreationDialogFragment.java   
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    super.onCreateDialog(savedInstanceState);
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.sync_custom_passphrase, null);
    mEnterPassphrase = (EditText) view.findViewById(R.id.passphrase);
    mConfirmPassphrase = (EditText) view.findViewById(R.id.confirm_passphrase);

    mConfirmPassphrase.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
            if (actionId == EditorInfo.IME_ACTION_DONE) {
                tryToSubmitPassphrase();
            }
            return false;
        }
    });

    TextView instructionsView =
            (TextView) view.findViewById(R.id.custom_passphrase_instructions);
    instructionsView.setMovementMethod(LinkMovementMethod.getInstance());
    instructionsView.setText(getInstructionsText());

    AlertDialog dialog = new AlertDialog.Builder(getActivity(), R.style.AlertDialogTheme)
            .setView(view)
            .setTitle(R.string.sync_passphrase_type_custom_dialog_title)
            .setPositiveButton(R.string.save, null)
            .setNegativeButton(R.string.cancel, null)
            .create();
    dialog.getDelegate().setHandleNativeActionModesEnabled(false);
    return dialog;
}
项目:BotLibre    文件:EditText.java   
public void setOnEditorActionListener(OnEditorActionListener listener) {
    ((JTextField)this.component).addActionListener(new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            listener.onEditorAction(EditText.this, 0, new KeyEvent());
        }
    });
}
项目:BotLibre    文件:EditText.java   
public void setOnEditorActionListener(OnEditorActionListener listener) {
    ((JTextField)this.component).addActionListener(new AbstractAction() {
        @Override
        public void actionPerformed(ActionEvent arg0) {
            listener.onEditorAction(EditText.this, 0, new KeyEvent());
        }
    });
}
项目:Passbook    文件:HomeActivity.java   
private void popInput() {
    if(mPwdEdit!=null) {
        mPwdEdit.postDelayed(new Runnable() {
            @Override
            public void run() {
                mPwdEdit.requestFocus();
                InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                imm.showSoftInput(mPwdEdit, InputMethodManager.SHOW_FORCED);
            }                
        }, 100);

        OnEditorActionListener eal = new OnEditorActionListener() {
            @Override
            public boolean onEditorAction(TextView edit, int id, KeyEvent event) {
                if(id == EditorInfo.IME_ACTION_DONE) {
                    onConfirm(null);
                    return true;
                }
                return false;
            }
        };
        EditText et_confirm = (EditText)findViewById(R.id.confirm);
        if(et_confirm.getVisibility() == View.VISIBLE) {
            mPwdEdit.setImeOptions(EditorInfo.IME_ACTION_NEXT);
            et_confirm.setOnEditorActionListener(eal);
        }
        else {
            mPwdEdit.setOnEditorActionListener(eal);
        }
    }        
}
项目:AndJie    文件:JieEditTextDel.java   
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    for (OnEditorActionListener l : mOnEditorActionListener) {
        l.onEditorAction(v, actionId, event);
        return true;
    }
    return false;
}
项目:yiim_v2    文件:FriendAddActivity.java   
@Override
protected void installListeners() {
    // TODO Auto-generated method stub
    mSearchEditText.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId,
                KeyEvent event) {
            // TODO Auto-generated method stub
            if (actionId == EditorInfo.IME_ACTION_GO) {
                onSearchClick(null);
            }
            return false;
        }
    });
}
项目:imovil2014    文件:LogicOperationExerciseFragment.java   
private void inicializarEditText() {
    mEtRespuesta.setOnEditorActionListener(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView v, int actionId,
                KeyEvent event) {
            if (EditorInfo.IME_ACTION_DONE == actionId) {
                checkSolution();
            }
            return false;
        }
    });
}
项目:android-shared    文件:ViewsFinder.java   
/**
 * @param runnable
 * @param imeActionId
 * @param views
 */
public void onEditorAction(final EditTextRunnable runnable, final int imeActionId, final EditText... views) {
    onEditorAction(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
            return imeActionId == actionId && runnable.run();

        }
    }, views);
}
项目:android-shared    文件:ViewsFinder.java   
/**
 * @param runnable
 * @param imeActionId
 * @param views
 */
public void onEditorAction(final EditTextRunnable runnable, final int imeActionId,
                           final FloatLabelAutoCompleteTextView... views) {
    onEditorAction(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
            return imeActionId == actionId && runnable.run();

        }
    }, views);
}
项目:android-shared    文件:ViewsFinder.java   
/**
 * @param listener
 * @param views
 */
public void onEditorAction(final OnEditorActionListener listener, final FloatLabelAutoCompleteTextView... views) {
    for (final FloatLabelAutoCompleteTextView view : views) {
        if (view != null) {
            view.setOnEditorActionListener(listener);
        }
    }
}
项目:android-shared    文件:ViewsFinder.java   
/**
 * @param runnable
 * @param imeActionId
 * @param views
 */
public void onEditorAction(final EditTextRunnable runnable, final int imeActionId,
                           final FloatLabelEditText... views) {
    onEditorAction(new OnEditorActionListener() {
        @Override
        public boolean onEditorAction(final TextView v, final int actionId, final KeyEvent event) {
            return imeActionId == actionId && runnable.run();
        }
    }, views);
}
项目:android-shared    文件:ViewsFinder.java   
/**
 * @param listener
 * @param views
 */
public void onEditorAction(final OnEditorActionListener listener, final FloatLabelEditText... views) {
    for (final FloatLabelEditText view : views) {
        if (view != null) {
            view.setOnEditorActionListener(listener);
        }
    }
}
项目:android-shared    文件:ViewsFinder.java   
/**
 * @param listener
 * @param views
 */
public void onEditorAction(final OnEditorActionListener listener, final EditText... views) {
    for (final EditText view : views) {
        if (view != null) {
            view.setOnEditorActionListener(listener);
        }
    }
}