View setFocusableInTouchMode - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for View setFocusableInTouchMode method.

This code example shows how to use the following methods:setFocusable, setFocusableInTouchMode, setLayoutParams, setOnKeyListener, getImeOptions
This code example shows how to use the following methods:getParent, setFocusableInTouchMode, setVisibility
			} 
		} 
		final View wd = w != null ? w.getDecorView() : null;
 
		if (wd != null) {
			final ViewParent parent = wd.getParent();
			if (parent != null) {
				final ViewGroup v = (ViewGroup) parent;
				v.removeView(wd);
			} 
 
			wd.setVisibility(View.VISIBLE);
			wd.setFocusableInTouchMode(true);
			if (wd instanceof ViewGroup) {
				((ViewGroup) wd).setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
			} 
		} 
		return wd;
	} 
 
7
CodeRank
This code example shows how to use the following methods:getHolder, setFocusable, setFocusableInTouchMode, setOnTouchListener
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		mPreview = new SurfaceView(this);
		setContentView(mPreview);
		 
		init(); 
		 
		initViews(); 
	} 
	 
	private void initViews() { 
		mPreview.setFocusable(true);
		mPreview.setFocusableInTouchMode(true);
		mPreview.setOnTouchListener(this);
		 
		/* 得到SurfaceHolder对象 */ 
		mHolder = mPreview.getHolder();

7
CodeRank
This code example shows how to use the following methods:requestFocus, setFocusable, setFocusableInTouchMode, setId, setLayoutParams
    public boolean actionIdentifierUp = false;
    public boolean actionIdentifierDown = false;
 
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        View layout = new LinearLayout(this);
        layout.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
        layout.setId(CONTENT_VIEW_ID);
 
        layout.setOnKeyListener(new OnKeyListener() {
 
            @Override 
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                keyIdentifier = keyCode;
 
                if (event.getAction() == KeyEvent.ACTION_DOWN)
                    actionIdentifierDown = true;
                else if (event.getAction() == KeyEvent.ACTION_UP)
                    actionIdentifierUp = true;
                return true; 

7
CodeRank
This code example shows how to use the following methods:getParent, setFocusableInTouchMode, setVisibility
    @SuppressWarnings("deprecation") 
    final Window w = getLocalActivityManager().startActivity(ACTIVITY_TAG, intent);
    final View wd = w != null ? w.getDecorView() : null;
 
    if (wd != null) {
      ViewParent parent = wd.getParent();
      if(parent != null) {
        ViewGroup v = (ViewGroup)parent;
        v.removeView(wd);
      } 
 
      wd.setVisibility(View.VISIBLE);
      wd.setFocusableInTouchMode(true);
      if(wd instanceof ViewGroup) {
        ((ViewGroup) wd).setDescendantFocusability(ViewGroup.FOCUS_AFTER_DESCENDANTS);
      } 
    } 
    return wd;
  } 
} 
7
CodeRank
This code example shows how to use the following methods:requestFocus, setFocusableInTouchMode, setText
This code example shows how to use the following methods:setFocusable, setFocusableInTouchMode, setId, setLayoutParams, setPadding
     * @param toLeftOf Align the new textview to the right of the argument 
     * @return TextView The that represents the digit 
     */ 
    private TextView createTimerDigit(int id, int textSize, TextView toRigthOf) {
        // Create the TextView 
        TextView digit = new TextView(getContext());
        digit.setId(id);
        RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
                android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
        if (toRigthOf != null) {
            params.addRule(RelativeLayout.RIGHT_OF, toRigthOf.getId());
            params.addRule(RelativeLayout.ALIGN_BASELINE, toRigthOf.getId());
        } 
        digit.setLayoutParams(params);
        digit.setPadding(0, this.mPadding, 0, this.mPadding);
        digit.setTextSize(TypedValue.COMPLEX_UNIT_SP, textSize);
        digit.setTextColor(this.mColor);
        digit.setFocusable(false);
        digit.setFocusableInTouchMode(false);

7
CodeRank
This code example shows how to use the following methods:setClickable, setFocusable, setFocusableInTouchMode, setMinimumHeight, setMinimumWidth
		num = n;
	} 
 
	// create a new ImageView for each item referenced by the Adapter 
    public View getView(int position, View convertView, ViewGroup parent) {
    	LinearLayout l = new LinearLayout(context);
    	l.setMinimumHeight(250);
    	l.setMinimumWidth(150);
    	ProgressBar s = new ProgressBar(context);
    	l.setGravity(Gravity.CENTER);
    	l.addView(s);
    	 
    	l.setFocusable(false);
    	l.setFocusableInTouchMode(false);
    	l.setClickable(false);
 
    	s.setFocusable(false);
    	s.setFocusableInTouchMode(false);
    	s.setClickable(false);
    	 
6
CodeRank
This code example shows how to use the following methods:setClickable, setFocusableInTouchMode, setId, setOnClickListener, setText
    public void onCreate(Bundle savedInstanceState) 
    { 
        super.onCreate(savedInstanceState);
        final ButtonActivity instance = this;
              
        final Button myButton = new Button(this);
        myButton.setClickable(true);
        myButton.setText("Keyboard UP!");
        myButton.setId(BUTTON_ID);
        myButton.setFocusableInTouchMode(true);
        myButton.setOnClickListener(new View.OnClickListener()
        { 
            public void onClick (View v)
            { 
                InputMethodManager imm = InputMethodManager.getInstance(instance);
                if (mKeyboardIsActive)
                { 
                    imm.hideSoftInputFromInputMethod(v.getWindowToken(), 0);
                    myButton.setText("Keyboard UP!");
             
8
CodeRank
This code example shows how to use the following methods:setFocusable, setFocusableInTouchMode, clearFocus, hasFocus, getValue
6
CodeRank

Related View setFocusableInTouchMode Questions & Answers:

setFocusableInTouchMode Method Overview
Set whether this view can receive focus while in touch mode.
See Code Examples for other Android View Methods: