当前位置: 首页>>代码示例>>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;未经允许,请勿转载。