Available Methods
- findViewById ( )
- getId ( )
- getLayoutParams ( )
- getTag ( )
- setTag ( )
- VISIBLE
- setVisibility ( )
- setOnClickListener ( )
- OnClickListener ( )
- getLeft ( )
- getHeight ( )
- getWidth ( )
- getTop ( )
- getVisibility ( )
- GONE
- setLayoutParams ( )
- getMeasuredHeight ( )
- inflate ( )
- getBottom ( )
- getMeasuredWidth ( )
- setBackgroundColor ( )
- getRight ( )
- measure ( )
- getParent ( )
- layout ( )
- getContext ( )
- setAlpha ( )
- setTranslationX ( )
- startAnimation ( )
- setScaleX ( )
- setScaleY ( )
- setPadding ( )
- setBackgroundResource ( )
- requestFocus ( )
- getLocationOnScreen ( )
- setTranslationY ( )
- setDrawingCacheEnabled ( )
- setPivotY ( )
- setOnLongClickListener ( )
- setPivotX ( )
- setBackground ( )
- INVISIBLE
- draw ( )
- setSystemUiVisibility ( )
- setBackgroundDrawable ( )
- equals ( )
- NO_ID
- getScrollY ( )
- OnLongClickListener ( )
- getBackground ( )
- postDelayed ( )
- setEnabled ( )
- setSelected ( )
- getY ( )
- requestLayout ( )
- getScrollX ( )
- setClickable ( )
- post ( )
- getDrawingCache ( )
- getTranslationY ( )
- setOnTouchListener ( )
- SYSTEM_UI_FLAG_FULLSCREEN
- destroyDrawingCache ( )
- SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- OnTouchListener ( )
- setRotation ( )
- getHitRect ( )
- getPaddingRight ( )
- setRotationY ( )
- invalidate ( )
- getPaddingBottom ( )
- buildDrawingCache ( )
- SYSTEM_UI_FLAG_HIDE_NAVIGATION
- LAYOUT_DIRECTION_RTL
- setId ( )
- setPressed ( )
- getLocationInWindow ( )
- clearAnimation ( )
- SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
- SYSTEM_UI_FLAG_LAYOUT_STABLE
- getPaddingLeft ( )
- getX ( )
- getTranslationX ( )
- getDrawingRect ( )
- FOCUS_UP
- getPaddingTop ( )
- SYSTEM_UI_FLAG_IMMERSIVE_STICKY
- setLayerType ( )
- getGlobalVisibleRect ( )
- setFocusable ( )
- setRotationX ( )
- FOCUS_RIGHT
- clearFocus ( )
- getViewTreeObserver ( )
- SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
- canScrollVertically ( )
- getRootView ( )
- dispatchPopulateAccessibilityEvent ( )
- postOnAnimation ( )
- isShown ( )
- setY ( )
- FOCUS_LEFT
- getSystemUiVisibility ( )
- offsetLeftAndRight ( )
- getWindowVisibleDisplayFrame ( )
- getResources ( )
- getScaleX ( )
- addTouchables ( )
- bringToFront ( )
- isEnabled ( )
- performClick ( )
- FOCUS_DOWN
- FOCUS_BACKWARD
- setX ( )
- setFitsSystemWindows ( )
- FOCUS_FORWARD
- SYSTEM_UI_FLAG_LOW_PROFILE
- getWindowToken ( )
- setAnimation ( )
- offsetTopAndBottom ( )
- setFocusableInTouchMode ( )
- generateViewId ( )
- isSelected ( )
- sendAccessibilityEvent ( )
- setOnCreateContextMenuListener ( )
- removeCallbacks ( )
- scrollTo ( )
- setMinimumWidth ( )
- isClickable ( )
- getLayerType ( )
- getAlpha ( )
- setOnSystemUiVisibilityChangeListener ( )
- addFocusables ( )
- isFocusable ( )
- getClass ( )
- setDrawingCacheBackgroundColor ( )
- dispatchTouchEvent ( )
- setActivated ( )
- SYSTEM_UI_FLAG_IMMERSIVE
- LAYER_TYPE_HARDWARE
- hashCode ( )
- setElevation ( )
- addOnLayoutChangeListener ( )
- setAccessibilityDelegate ( )
- OnFocusChangeListener ( )
- LAYER_TYPE_NONE
- isLayoutRequested ( )
- setCameraDistance ( )
- isPressed ( )
- getAnimation ( )
- getScaleY ( )
- getRotationY ( )
- setMinimumHeight ( )
- animate ( )
- getOverScrollMode ( )
- getRotationX ( )
- onTouchEvent ( )
- setContentDescription ( )
- getRotation ( )
- SYSTEM_UI_FLAG_VISIBLE
- setLongClickable ( )
- canScrollHorizontally ( )
- performHapticFeedback ( )
- hasFocus ( )
- removeOnAttachStateChangeListener ( )
- cancelLongPress ( )
- LAYOUT_DIRECTION_LTR
- OVER_SCROLL_NEVER
- isInEditMode ( )
- getLayoutDirection ( )
- playSoundEffect ( )
- getDrawingCacheBackgroundColor ( )
- setOutlineProvider ( )
- getDefaultSize ( )
- isAttachedToWindow ( )
- SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR
- setOnKeyListener ( )
- setWillNotCacheDrawing ( )
- hasTransientState ( )
- getLocalVisibleRect ( )
- startDrag ( )
- getPivotY ( )
- willNotCacheDrawing ( )
- LAYER_TYPE_SOFTWARE
- saveHierarchyState ( )
- findViewWithTag ( )
- performLongClick ( )
- requestFocusFromTouch ( )
- setOnApplyWindowInsetsListener ( )
- postInvalidateOnAnimation ( )
- isLongClickable ( )
- setTranslationZ ( )
- setOnFocusChangeListener ( )
- hasFocusable ( )
- setTop ( )
- addOnAttachStateChangeListener ( )
- postInvalidate ( )
- postInvalidateDelayed ( )
- onStartTemporaryDetach ( )
- removeOnLayoutChangeListener ( )
- getAccessibilityViewId ( )
- restoreHierarchyState ( )
- isHardwareAccelerated ( )
- setHasTransientState ( )
- getImportantForAccessibility ( )
- setBottom ( )
- setLeft ( )
- DragShadowBuilder ( )
- getBaseline ( )
- SCROLL_AXIS_VERTICAL
- setScrollX ( )
- isFocusableInTouchMode ( )
- forceLayout ( )
- setPaddingRelative ( )
- SCROLLBAR_POSITION_RIGHT
- setImportantForAccessibility ( )
- getPivotX ( )
- getContentDescription ( )
- announceForAccessibility ( )
- isDrawingCacheEnabled ( )
- showContextMenu ( )
- setDrawingCacheQuality ( )
- setRight ( )
- OnKeyListener ( )
- getFitsSystemWindows ( )
- OnLayoutChangeListener ( )
- getTransitionName ( )
- addView ( )
- dispatchApplyWindowInsets ( )
- onCheckIsTextEditor ( )
- setLayoutDirection ( )
- onFinishTemporaryDetach ( )
- setTransitionName ( )
- isFocused ( )
- getRootWindowInsets ( )
- jumpDrawablesToCurrentState ( )
- setClipToOutline ( )
- getWindowVisibility ( )
- getFocusedRect ( )
- IMPORTANT_FOR_ACCESSIBILITY_AUTO
- setScrollY ( )
- isActivated ( )
- STATUS_BAR_HIDDEN
- setOverScrollMode ( )
- setLabelFor ( )
- getMatrix ( )
- setHorizontalScrollBarEnabled ( )
- isOpaque ( )
- getParentForAccessibility ( )
- setLayerPaint ( )
- startDragAndDrop ( )
- setStateListAnimator ( )
- postOnAnimationDelayed ( )
- getPaddingStart ( )
- hasWindowFocus ( )
- getMinimumHeight ( )
- resolveSize ( )
- findFocus ( )
- AUTOFILL_TYPE_DATE
- setKeepScreenOn ( )
- focusSearch ( )
- getPaddingEnd ( )
- onInitializeAccessibilityNodeInfo ( )
- getViewRootImpl ( )
- isInTouchMode ( )
- getKeyDispatcherState ( )
- isLaidOut ( )
- scrollBy ( )
- AUTOFILL_TYPE_TEXT
- getTranslationZ ( )
- getWindowSystemUiVisibility ( )
- OVER_SCROLL_ALWAYS
- getMeasuredWidthAndState ( )
- performAccessibilityAction ( )
- AccessibilityDelegate ( )
- STATUS_BAR_TRANSLUCENT
- callOnClick ( )
- getAccessibilityLiveRegion ( )
- resolveSizeAndState ( )
- isImportantForAccessibility ( )
- getLabelFor ( )
- OnAttachStateChangeListener ( )
- getMeasuredHeightAndState ( )
- TEXT_ALIGNMENT_GRAVITY
- drawableHotspotChanged ( )
- getAccessibilityNodeProvider ( )
- onInitializeAccessibilityEvent ( )
- getZ ( )
- refreshDrawableState ( )
- IMPORTANT_FOR_ACCESSIBILITY_YES
- AUTOFILL_HINT_USERNAME
- setTagInternal ( )
- getHandler ( )
- getOnFocusChangeListener ( )
- isScrollContainer ( )
- getNextFocusRightId ( )
- IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
- getWindowId ( )
- TEXT_ALIGNMENT_VIEW_START
- onPopulateAccessibilityEvent ( )
- TRANSLATION_Y
- setWillNotDraw ( )
- setTextAlignment ( )
Related Classes
- java.io.File
- android.os.Bundle
- android.content.Context
- android.util.Log
- android.widget.TextView
- android.content.Intent
- android.view.ViewGroup
- android.app.Activity
- android.view.LayoutInflater
- android.os.Build
- android.widget.Toast
- android.widget.ImageView
- android.graphics.Color
- android.os.Handler
- android.net.Uri
- android.widget.Button
- android.graphics.Bitmap
- android.text.TextUtils
- android.view.MotionEvent
- android.graphics.drawable.Drawable
- android.widget.LinearLayout
- android.support.annotation.Nullable
- android.widget.EditText
- android.content.SharedPreferences
- android.support.annotation.NonNull
Java Code Examples for android.view.View#hasWindowFocus()
The following examples show how to use
android.view.View#hasWindowFocus() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ViewFetcher.java From AndroidRipper with GNU Affero General Public License v3.0 | 6 votes |
/** * Returns the most recent view container * * @param views the views to check * @return the most recent view container */ private final View getRecentContainer(View[] views) { View container = null; long drawingTime = 0; View view; for(int i = 0; i < views.length; i++){ view = views[i]; if (view != null && view.isShown() && view.hasWindowFocus() && view.getDrawingTime() > drawingTime) { container = view; drawingTime = view.getDrawingTime(); } } return container; }
Example 2
Source File: InAppInputManager.java From CatVision-io-SDK-Android with BSD 3-Clause "New" or "Revised" License | 6 votes |
private View obtainTargetView() { final Activity a = obtainActivity(); //Log.i(TAG, "obtainTargetView a:"+a); if (a == null) return null; View v = a.findViewById(android.R.id.content).getRootView(); //Log.i(TAG, "obtainTargetView vr:"+a); if (v == null) return null; if (v.hasWindowFocus()) return v; // Quick way List<View> lv = getWindowManagerViews(); for(View vi : lv) { //Log.i(TAG, "obtainTargetView vi:"+vi+" f:"+vi.hasWindowFocus()); if (vi.hasWindowFocus()) return vi; } return v; }
Example 3
Source File: NewsListFragment.java From 4pdaClient-plus with Apache License 2.0 | 6 votes |
@Override public void onItemClick(@NotNull AdapterView<?> adapterView, @NotNull View v, int position, long id) { if(!v.hasWindowFocus()) return; try { id = ListViewMethodsBridge.getItemId(getActivity(), position, id); if (id < 0 || getAdapter().getCount() <= id) return; Object o = getAdapter().getItem((int) id); if (o == null) return; final News news = (News) o; if (TextUtils.isEmpty(news.getId())) return; if(!IntentActivity.tryShowSpecial(news.getUrl())) MainActivity.addTab(news.getTitle().toString(), news.getUrl(), NewsFragment.newInstance(news.getUrl())); getAdapter().notifyDataSetChanged(); } catch (Throwable ex) { AppLog.e(getActivity(), ex); } }
Example 4
Source File: EspScreenshotToolPreJellyBeanMr2.java From espresso-macchiato with MIT License | 5 votes |
private static View getRecentContainer(View[] views) { View container = null; long drawingTime = 0; for (View view : views) { if (view != null && view.isShown() && view.hasWindowFocus() && view.getDrawingTime() > drawingTime) { container = view; drawingTime = view.getDrawingTime(); } } return container; }
Example 5
Source File: NotesListFragment.java From 4pdaClient-plus with Apache License 2.0 | 5 votes |
@Override public void onItemClick(AdapterView<?> adapterView, View v, int position, long id) { if(!v.hasWindowFocus()) return; id = ListViewMethodsBridge.getItemId(getActivity(), position, id); if (id < 0 || getAdapter().getCount() <= id) return; Object o = getAdapter().getItem((int) id); if (o == null) return; final IListItem topic = (IListItem) o; if (TextUtils.isEmpty(topic.getId())) return; try { Note note = NotesTable.getNote(topic.getId().toString()); if (note != null) { if (note.Url!=null) { IntentActivity.tryShowUrl((Activity) getContext(), getMHandler(), note.Url, true, false, null); }else { NoteFragment.showNote(topic.getId().toString()); } } } catch (IOException | ParseException e) { e.printStackTrace(); } }
Example 6
Source File: TopicsListFragment.java From 4pdaClient-plus with Apache License 2.0 | 5 votes |
@Override public void onItemClick(AdapterView<?> adapterView, View v, int position, long id) { if (!v.hasWindowFocus()) return; try { id = org.softeg.slartus.forpdaplus.tabs.ListViewMethodsBridge.getItemId(getActivity(), position, id); if (id < 0 || getAdapter().getCount() <= id) return; Object o = getAdapter().getItem((int) id); if (o == null) return; final IListItem topic = (IListItem) o; if (TextUtils.isEmpty(topic.getId())) return; if (tryCreatePost(topic)) return; if (!UserInfoRepository.Companion.getInstance().getLogined()) { Toast.makeText(getContext(), "Залогиньтесь для просмотра тем форума!", Toast.LENGTH_LONG).show(); } ActionSelectDialogFragment.INSTANCE.execute(getActivity(), getString(R.string.default_action), String.format("%s.navigate_action", getListName()), new CharSequence[]{getString(R.string.navigate_getfirstpost), getString(R.string.navigate_getlastpost), getString(R.string.navigate_getnewpost), getString(R.string.navigate_last_url)}, new CharSequence[]{Topic.NAVIGATE_VIEW_FIRST_POST, Topic.NAVIGATE_VIEW_LAST_POST, Topic.NAVIGATE_VIEW_NEW_POST, Topic.NAVIGATE_VIEW_LAST_URL}, value -> showTopicActivity(topic, TopicUtils.getUrlArgs(topic.getId(), value.toString(), Topic.NAVIGATE_VIEW_FIRST_POST.toString())), getString(R.string.default_action_notify) ); } catch (Throwable ex) { AppLog.e(getActivity(), ex); } }
Example 7
Source File: TestUtilities.java From google-authenticator-android with Apache License 2.0 | 5 votes |
/** Waits until the window which contains the provided view has focus. */ public static void waitForWindowFocus(View view) throws InterruptedException, TimeoutException { long deadline = SystemClock.uptimeMillis() + UI_ACTION_EFFECT_TIMEOUT_MILLIS; while (!view.hasWindowFocus()) { long millisTillDeadline = deadline - SystemClock.uptimeMillis(); if (millisTillDeadline < 0) { throw new TimeoutException("Timed out while waiting for window focus"); } Thread.sleep(50); } }
Example 8
Source File: InputMethodManager.java From android_9.0.0_r45 with Apache License 2.0 | 4 votes |
private static boolean canStartInput(View servedView) { // We can start input ether the servedView has window focus // or the activity is showing autofill ui. return servedView.hasWindowFocus() || isAutofillUIShowing(servedView); }
Example 9
Source File: TopBottomLocationManager.java From Shield with MIT License | 4 votes |
private void layoutTopNodes() { if (topContainer == null) { return; } ArrayList<View> inScreenTopViews = new ArrayList<>(); for (int i = 0; i < topContainer.getChildCount(); i++) { inScreenTopViews.add(topContainer.getChildAt(i)); } if (currentTopNodeList != null && currentTopNodeList.size() > 0) { SparseArray<ArrayList<ShieldDisplayNode>> topBucketLst = sortNodes(currentTopNodeList); for (int j = 0; j < topBucketLst.size(); j++) { ArrayList<ShieldDisplayNode> bucket = topBucketLst.valueAt(j); for (int k = bucket.size() - 1; k >= 0; k--) { ShieldDisplayNode node = bucket.get(k); if (node == null || node.view == null) { continue; } TopBottomNodeInfo info = nodeInfoMap.get(node); inScreenTopViews.remove(node.view); layoutToTopContainer(node, info ,getNodeHeight(node, 0)); } } } if (!inScreenTopViews.isEmpty()) { for (int i = 0; i < inScreenTopViews.size(); i++) { topContainer.removeView(inScreenTopViews.get(i)); } } boolean topFocus = false; for (int i = 0; i < topContainer.getChildCount(); i++) { View child = topContainer.getChildAt(i); if (child.hasWindowFocus() || child.hasFocus()) { topFocus = true; break; } } if (!topFocus) { topContainer.clearFocus(); } }
Example 10
Source File: ThreadedInputConnectionFactory.java From 365browser with Apache License 2.0 | 4 votes |
private void triggerDelayedOnCreateInputConnection(final View view) { if (DEBUG_LOGS) Log.i(TAG, "triggerDelayedOnCreateInputConnection"); // Prevent infinite loop when View methods trigger onCreateInputConnection // on some OEM phones. (crbug.com/636197) if (mReentrantTriggering) return; // We need to check this before creating invalidator. if (!view.hasFocus()) return; mCheckInvalidator = new CheckInvalidator(); if (!view.hasWindowFocus()) mCheckInvalidator.invalidate(); // We cannot reuse the existing proxy view, if any, due to crbug.com/664402. mProxyView = createProxyView(getHandler(), view); mReentrantTriggering = true; // This does not affect view focus of the real views. mProxyView.requestFocus(); mReentrantTriggering = false; view.getHandler().post(new Runnable() { @Override public void run() { // This is a hack to make InputMethodManager believe that the proxy view // now has a focus. As a result, InputMethodManager will think that mProxyView // is focused, and will call getHandler() of the view when creating input // connection. // Step 1: Set mProxyView as InputMethodManager#mNextServedView. // This does not affect the real window focus. mProxyView.onWindowFocusChanged(true); // Step 2: Have InputMethodManager focus in on mNextServedView. // As a result, IMM will call onCreateInputConnection() on mProxyView on the same // thread as mProxyView.getHandler(). It will also call subsequent InputConnection // methods on this IME thread. mInputMethodManagerWrapper.isActive(view); // Step 3: Check that the above hack worked. // Do not check until activation finishes inside InputMethodManager (on IME thread). getHandler().post(new Runnable() { @Override public void run() { postCheckRegisterResultOnUiThread(view, mCheckInvalidator, CHECK_REGISTER_RETRY); } }); } }); }
Example 11
Source File: RootMatchers.java From android-test with Apache License 2.0 | 4 votes |
@Override public boolean matchesSafely(View view) { return view.hasWindowFocus(); }