Java Code Examples for android.view.inputmethod.EditorInfo.IME_NULL

The following are Jave code examples for showing how to use IME_NULL of the android.view.inputmethod.EditorInfo class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: PeSanKita-android   File: PassphrasePromptActivity.java   View Source Code Vote up 6 votes
@Override
public boolean onEditorAction(TextView exampleView, int actionId, KeyEvent keyEvent) {
  if ((keyEvent == null && actionId == EditorInfo.IME_ACTION_DONE) ||
      (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_DOWN &&
          (actionId == EditorInfo.IME_NULL)))
  {
    handlePassphrase();
    return true;
  } else if (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_UP &&
             actionId == EditorInfo.IME_NULL)
  {
    return true;
  }

  return false;
}
 
Example 2
Project: IdeaTrackerPlus   File: MainActivity.java   View Source Code Vote up 6 votes
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {

    if (actionId == EditorInfo.IME_ACTION_GO
            || actionId == EditorInfo.IME_ACTION_DONE
            || actionId == EditorInfo.IME_ACTION_NEXT
            || actionId == EditorInfo.IME_ACTION_SEND
            || actionId == EditorInfo.IME_ACTION_SEARCH
            || actionId == EditorInfo.IME_NULL) {

        switch ((int) v.getTag()) {
            case 1:
                mNoteField.requestFocus();
                break;

            case 2:
                sendIdeaFromDialog();
                break;

            default:
                break;
        }
        return true;
    }
    return false;
}
 
Example 3
Project: Cable-Android   File: PassphrasePromptActivity.java   View Source Code Vote up 6 votes
@Override
public boolean onEditorAction(TextView exampleView, int actionId, KeyEvent keyEvent) {
  if ((keyEvent == null && actionId == EditorInfo.IME_ACTION_DONE) ||
      (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_DOWN &&
          (actionId == EditorInfo.IME_NULL)))
  {
    handlePassphrase();
    return true;
  } else if (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_UP &&
             actionId == EditorInfo.IME_NULL)
  {
    return true;
  }

  return false;
}
 
Example 4
Project: bluetooth-chat-appliction   File: BluetoothChatFragment.java   View Source Code Vote up 5 votes
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        sendMessage(message);
    }
    return true;
}
 
Example 5
Project: SecretTalk   File: BluetoothChatFragment.java   View Source Code Vote up 5 votes
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        sendMessage(message);
    }
    return true;
}
 
Example 6
Project: buildAPKsApps   File: BluetoothChat.java   View Source Code Vote up 5 votes
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        sendMessage(message);
    }
    if(D) Log.i(TAG, "END onEditorAction");
    return true;
}
 
Example 7
Project: wulkanowy   File: LoginActivity.java   View Source Code Vote up 5 votes
private TextView.OnEditorActionListener getTextViewSignInListener() {
    return new TextView.OnEditorActionListener() {
        @Override
        public boolean onEditorAction(TextView textView, int id, KeyEvent keyEvent) {
            if (id == EditorInfo.IME_ACTION_DONE || id == EditorInfo.IME_NULL) {
                attemptLogin();
                return true;
            }
            return false;
        }
    };
}
 
Example 8
Project: buildAPKsSamples   File: BluetoothChat.java   View Source Code Vote up 5 votes
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        sendMessage(message);
    }
    if(D) Log.i(TAG, "END onEditorAction");
    return true;
}
 
Example 9
Project: IdeaTrackerPlus   File: RecyclerOnClickListener.java   View Source Code Vote up 5 votes
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_GO
            || actionId == EditorInfo.IME_ACTION_DONE
            || actionId == EditorInfo.IME_ACTION_NEXT
            || actionId == EditorInfo.IME_ACTION_SEND
            || actionId == EditorInfo.IME_ACTION_SEARCH
            || actionId == EditorInfo.IME_NULL) {
        mNoteField.requestFocus();
    }
    return true;
}
 
Example 10
Project: IdeaTrackerPlus   File: RecyclerOnClickListener.java   View Source Code Vote up 5 votes
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == EditorInfo.IME_ACTION_GO
            || actionId == EditorInfo.IME_ACTION_DONE
            || actionId == EditorInfo.IME_ACTION_NEXT
            || actionId == EditorInfo.IME_ACTION_SEND
            || actionId == EditorInfo.IME_ACTION_SEARCH
            || actionId == EditorInfo.IME_NULL) {
        sendEditIdea();
    }
    return true;
}
 
Example 11
Project: Ghost-Android   File: PasswordAuthFragment.java   View Source Code Vote up 5 votes
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == getResources().getInteger(R.integer.ime_action_id_signin)
            || actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
        onSignInClicked();
        // don't consume the event, so the keyboard can also be hidden
        // http://stackoverflow.com/questions/2342620/how-to-hide-keyboard-after-typing-in-edittext-in-android#comment20849208_10184099
        return false;
    }
    return false;
}
 
Example 12
Project: Ghost-Android   File: LoginUrlFragment.java   View Source Code Vote up 5 votes
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
    if (actionId == getResources().getInteger(R.integer.ime_action_id_next)
            || actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_NULL) {
        onNextClicked();
        // don't consume the event, so the keyboard can also be hidden
        // http://stackoverflow.com/questions/2342620/how-to-hide-keyboard-after-typing-in-edittext-in-android#comment20849208_10184099
        return false;
    }
    return false;
}
 
Example 13
Project: dab-iot   File: BluetoothChatFragment.java   View Source Code Vote up 5 votes
public boolean onEditorAction(TextView view, int actionId, KeyEvent event) {
    // If the action is a key-up event on the return key, send the message
    if (actionId == EditorInfo.IME_NULL && event.getAction() == KeyEvent.ACTION_UP) {
        String message = view.getText().toString();
        sendMessage(message);
    }
    return true;
}
 
Example 14
Project: buildAPKsApps   File: ManualActivity.java   View Source Code Vote up 4 votes
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	setContentView(R.layout.main);

	this.manPages = initPages();
	ArrayAdapter<Page> manPagesAdapter = new ArrayAdapter<Page>(this,
			android.R.layout.simple_list_item_1, manPages);
	ArrayAdapter<Page> manPagesCompleteAdapter = new ArrayAdapter<Page>(
			this, android.R.layout.simple_dropdown_item_1line, manPages);

	// Main list of all manpages
	ListView manPagesView = (ListView) findViewById(R.id.pages_names);
	manPagesView.setAdapter(manPagesAdapter);
	manPagesView.setOnItemClickListener(new OnManpageClickListener(this));

	// List of manpages displayed in the text field suggestions
	AutoCompleteTextView manPagesCompleteTextView = (AutoCompleteTextView) findViewById(R.id.search_input);
	manPagesCompleteTextView.setAdapter(manPagesCompleteAdapter);
	manPagesCompleteTextView
			.setOnItemClickListener(new OnManpageClickListener(this));

	// Check the availability of files on external storage
	if (!checkPageFilesOnExternalStorage(null))
		suggestDownload();

	// Handle the Enter key in the TextView
	// Get the input TextView
	AutoCompleteTextView input = (AutoCompleteTextView) findViewById(R.id.search_input);
	// Create a new handler for the Enter key ("Go" key here)
	TextView.OnEditorActionListener enterKeyListener = new TextView.OnEditorActionListener() {
		@Override
		public boolean onEditorAction(TextView v, int actionId,
				KeyEvent event) {
			// If search key was hit, search for this manpage
			if (actionId == EditorInfo.IME_ACTION_SEARCH
					|| actionId == EditorInfo.IME_NULL) {
				Page p = getManpageCalled(v.getText().toString());
				if (p != null) {
					// display it if found,
					displayManpage(p);
				} else {
					// else display an error message
					Toast.makeText(getApplicationContext(),
							"This manpage does not exist...",
							Toast.LENGTH_LONG).show();
				}
			}
			return true;
		}
	};
	input.setOnEditorActionListener(enterKeyListener);
}