當前位置: 首頁>>代碼示例>>Java>>正文


Java ViewParent.getParent方法代碼示例

本文整理匯總了Java中android.view.ViewParent.getParent方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewParent.getParent方法的具體用法?Java ViewParent.getParent怎麽用?Java ViewParent.getParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.ViewParent的用法示例。


在下文中一共展示了ViewParent.getParent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreateInputConnection

import android.view.ViewParent; //導入方法依賴的package包/類
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
  final InputConnection ic = super.onCreateInputConnection(outAttrs);
  if (ic != null && outAttrs.hintText == null) {
    // If we don't have a hint and our parent is a TextInputLayout, use it's hint for the
    // EditorInfo. This allows us to display a hint in 'extract mode'.
    ViewParent parent = getParent();
    while (parent instanceof View) {
      if (parent instanceof TextInputLayout) {
        outAttrs.hintText = ((TextInputLayout) parent).getHint();
        break;
      }
      parent = parent.getParent();
    }
  }
  return ic;
}
 
開發者ID:commonsguy,項目名稱:cwac-crossport,代碼行數:18,代碼來源:TextInputEditText.java

示例2: setStayPressed

import android.view.ViewParent; //導入方法依賴的package包/類
void setStayPressed(boolean stayPressed) {
    mStayPressed = stayPressed;
    if (!stayPressed) {
        HolographicOutlineHelper.obtain(getContext()).recycleShadowBitmap(mPressedBackground);
        mPressedBackground = null;
    } else {
        if (mPressedBackground == null) {
            mPressedBackground = mOutlineHelper.createMediumDropShadow(this);
        }
    }

    // Only show the shadow effect when persistent pressed state is set.
    ViewParent parent = getParent();
    if (parent != null && parent.getParent() instanceof BubbleTextShadowHandler) {
        ((BubbleTextShadowHandler) parent.getParent()).setPressedIcon(
                this, mPressedBackground);
    }

    updateIconState();
}
 
開發者ID:TeamBrainStorm,項目名稱:SimpleUILauncher,代碼行數:21,代碼來源:BubbleTextView.java

示例3: onStopTrackingTouch

import android.view.ViewParent; //導入方法依賴的package包/類
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
    Log.i(TAG, "bottomProgress onStopTrackingTouch [" + this.hashCode() + "] ");
    onEvent(JCUserAction.ON_SEEK_POSITION);
    startProgressTimer();
    ViewParent vpup = getParent();
    while (vpup != null) {
        vpup.requestDisallowInterceptTouchEvent(false);
        vpup = vpup.getParent();
    }
    if (currentState != CURRENT_STATE_PLAYING &&
            currentState != CURRENT_STATE_PAUSE) return;
    int time = seekBar.getProgress() * getDuration() / 100;
    JCMediaManager.instance().mediaPlayer.seekTo(time);
    Log.i(TAG, "seekTo " + time + " [" + this.hashCode() + "] ");
}
 
開發者ID:snowwolf10285,項目名稱:PicShow-zhaipin,代碼行數:17,代碼來源:JCVideoPlayer.java

示例4: onStopTrackingTouch

import android.view.ViewParent; //導入方法依賴的package包/類
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
    Log.i(TAG, "bottomProgress onStopTrackingTouch [" + this.hashCode() + "] ");
    onEvent(JCBuriedPoint.ON_SEEK_POSITION);
    startProgressTimer();
    ViewParent vpup = getParent();
    while (vpup != null) {
        vpup.requestDisallowInterceptTouchEvent(false);
        vpup = vpup.getParent();
    }
    if (currentState != CURRENT_STATE_PLAYING &&
            currentState != CURRENT_STATE_PAUSE) return;
    int time = seekBar.getProgress() * getDuration() / 100;
    JCMediaManager.instance().mediaPlayer.seekTo(time);
    Log.i(TAG, "seekTo " + time + " [" + this.hashCode() + "] ");
}
 
開發者ID:wp521,項目名稱:MyFire,代碼行數:17,代碼來源:JCVideoPlayer.java

示例5: onCreateInputConnection

import android.view.ViewParent; //導入方法依賴的package包/類
@Override
public InputConnection onCreateInputConnection(EditorInfo outAttrs) {
    final InputConnection ic = super.onCreateInputConnection(outAttrs);
    if (ic != null && outAttrs.hintText == null) {
        // If we don't have a hint and our parent is a TextInputLayout, use it's hint for the
        // EditorInfo. This allows us to display a hint in 'extract mode'.
        ViewParent parent = getParent();
        while (parent instanceof View) {
            if (parent instanceof TextInputLayout) {
                outAttrs.hintText = ((TextInputLayout) parent).getHint();
                break;
            }
            parent = parent.getParent();
        }
    }
    return ic;
}
 
開發者ID:eltos,項目名稱:SimpleDialogFragments,代碼行數:18,代碼來源:TextInputAutoCompleteTextView.java

示例6: onStopTrackingTouch

import android.view.ViewParent; //導入方法依賴的package包/類
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
    Log.i(TAG, "bottomProgress onStopTrackingTouch [" + this.hashCode() + "] ");
    onEvent(JZUserAction.ON_SEEK_POSITION);
    startProgressTimer();
    ViewParent vpup = getParent();
    while (vpup != null) {
        vpup.requestDisallowInterceptTouchEvent(false);
        vpup = vpup.getParent();
    }
    if (currentState != CURRENT_STATE_PLAYING &&
            currentState != CURRENT_STATE_PAUSE) return;
    long time = seekBar.getProgress() * getDuration() / 100;
    JZMediaManager.seekTo(time);
    Log.i(TAG, "seekTo " + time + " [" + this.hashCode() + "] ");
}
 
開發者ID:monkeywiiu,項目名稱:Discover,代碼行數:17,代碼來源:JZVideoPlayer.java

示例7: onStartTrackingTouch

import android.view.ViewParent; //導入方法依賴的package包/類
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
    Log.i(TAG, "bottomProgress onStartTrackingTouch [" + this.hashCode() + "] ");
    cancelProgressTimer();
    ViewParent vpdown = getParent();
    while (vpdown != null) {
        vpdown.requestDisallowInterceptTouchEvent(true);
        vpdown = vpdown.getParent();
    }
}
 
開發者ID:snowwolf10285,項目名稱:PicShow-zhaipin,代碼行數:11,代碼來源:JCVideoPlayer.java

示例8: getStickyNavLayout

import android.view.ViewParent; //導入方法依賴的package包/類
public static BGAStickyNavLayout getStickyNavLayout(View view) {
    ViewParent viewParent = view.getParent();
    while (viewParent != null) {
        if (viewParent instanceof BGAStickyNavLayout) {
            return (BGAStickyNavLayout) viewParent;
        }
        viewParent = viewParent.getParent();
    }
    return null;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:11,代碼來源:BGARefreshScrollingUtil.java

示例9: isViewDescendant

import android.view.ViewParent; //導入方法依賴的package包/類
protected boolean isViewDescendant(View v) {
    ViewParent parent = v.getParent();
    while (parent != null) {
        if (parent == this) {
            return true;
        }

        parent = parent.getParent();
    }

    return false;
}
 
開發者ID:ultrasonic,項目名稱:ultrasonic,代碼行數:13,代碼來源:MenuDrawer.java

示例10: getLayoutDepth

import android.view.ViewParent; //導入方法依賴的package包/類
/**
 * Procedure returns the layout depth of this term related to mainView
 */
public static int getLayoutDepth(LinearLayout l)
{
    int retValue = 0;
    if (l == null)
    {
        return retValue;
    }
    ViewParent p = l.getParent();
    while (p != null)
    {
        if (p instanceof TwoDScrollView)
        {
            if (((TwoDScrollView) p).getId() == R.id.main_scroll_view)
            {
                break;
            }
        }
        if (p instanceof FormulaBase && p.getParent() == null)
        {
            retValue += 2;
            break;
        }
        retValue++;
        p = p.getParent();
    }
    return retValue;
}
 
開發者ID:mkulesh,項目名稱:microMathematics,代碼行數:31,代碼來源:ViewUtils.java

示例11: onAttachedToWindow

import android.view.ViewParent; //導入方法依賴的package包/類
/**
 * Stores a reference to the {@link WorkspaceView} containing this BlockView.
 */
@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();

    mWorkspaceView = null;
    ViewParent parent = getParent();
    while (parent != null && parent instanceof ViewGroup) {
        if (parent instanceof WorkspaceView) {
            mWorkspaceView = (WorkspaceView) parent;
            return;
        }
        parent = parent.getParent();
    }
}
 
開發者ID:Axe-Ishmael,項目名稱:Blockly,代碼行數:18,代碼來源:AbstractBlockView.java

示例12: isDescendantOf

import android.view.ViewParent; //導入方法依賴的package包/類
/**
 * Tests whether this subject is a descendant, directly or indirectly, of {@code ancestor}.
 *
 * @param ancestor The expected ancestor in the view tree.
 */
public void isDescendantOf(ViewParent ancestor) {
    View subject = actual();

    ViewParent parent = subject.getParent();
    while (parent != null) {
        if (ancestor == parent) {
            return;  // Success
        }
        parent = parent.getParent();
    }
    fail("is descendant of", ancestor);
}
 
開發者ID:Axe-Ishmael,項目名稱:Blockly,代碼行數:18,代碼來源:ViewSubject.java

示例13: onStartTrackingTouch

import android.view.ViewParent; //導入方法依賴的package包/類
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
    cancelProgressTimer();
    ViewParent vpdown = getParent();
    while (vpdown != null) {
        vpdown.requestDisallowInterceptTouchEvent(true);
        vpdown = vpdown.getParent();
    }
}
 
開發者ID:qq1210514049,項目名稱:ListVideoPlayer,代碼行數:10,代碼來源:ListVideoPlayer.java

示例14: isInScrollingContainer

import android.view.ViewParent; //導入方法依賴的package包/類
public static boolean isInScrollingContainer(ViewParent p) {
    while (p != null && p instanceof ViewGroup) {
        if (((ViewGroup) p).shouldDelayChildPressedState()) {
            return true;
        }
        p = p.getParent();
    }
    return false;
}
 
開發者ID:DuanJiaNing,項目名稱:Musicoco,代碼行數:10,代碼來源:SeekBarCompatDontCrash.java

示例15: onAttachedToWindow

import android.view.ViewParent; //導入方法依賴的package包/類
@Override
protected void onAttachedToWindow() {
    super.onAttachedToWindow();
    ViewParent parent = getParent();
    while (parent != null && (parent instanceof View)) {
        if (parent instanceof QMUICollapsingTopBarLayout) {
            makeSureTitleContainerView();
            return;
        }
        parent = parent.getParent();
    }
}
 
開發者ID:QMUI,項目名稱:QMUI_Android,代碼行數:13,代碼來源:QMUITopBar.java


注:本文中的android.view.ViewParent.getParent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。