本文整理汇总了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();
}
}