本文整理匯總了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;
}
示例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();
}
示例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() + "] ");
}
示例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() + "] ");
}
示例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;
}
示例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() + "] ");
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
}
示例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);
}
示例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();
}
}
示例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;
}
示例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();
}
}