当前位置: 首页>>代码示例>>Java>>正文


Java View.getRootView方法代码示例

本文整理汇总了Java中android.view.View.getRootView方法的典型用法代码示例。如果您正苦于以下问题:Java View.getRootView方法的具体用法?Java View.getRootView怎么用?Java View.getRootView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.View的用法示例。


在下文中一共展示了View.getRootView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onLayout

import android.view.View; //导入方法依赖的package包/类
@Override
public void onLayout(View target, View attachView)
{
    try
    {
        ViewGroup viewGroup = (ViewGroup)attachView.getRootView();
        if (target.getParent() != null && target.getParent() != viewGroup)
        {
            target.setVisibility(View.GONE);
            if (mFirstFocus)
                viewGroup.requestFocus();
        }
    }
    catch (Exception ex)
    {
        ex.printStackTrace();
    }
}
 
开发者ID:Dreamxiaoxuan,项目名称:AndroidTvDemo,代码行数:19,代码来源:BorderEffect.java

示例2: removeWindow

import android.view.View; //导入方法依赖的package包/类
/**
 * Invoke this method to unregister a view hierarchy.
 * 
 * @param view A view that belongs to the view hierarchy/window to unregister
 * 
 * @see #addWindow(View, String)
 */
public void removeWindow(View view) {
    View rootView;
    mWindowsLock.writeLock().lock();
    try {
        rootView = view.getRootView();
        mWindows.remove(rootView);
    } finally {
        mWindowsLock.writeLock().unlock();
    }
    mFocusLock.writeLock().lock();
    try {
        if (mFocusedWindow == rootView) {
            mFocusedWindow = null;
        }
    } finally {
        mFocusLock.writeLock().unlock();
    }
    fireWindowsChangedEvent();
}
 
开发者ID:yangchaojiang,项目名称:ZoomPreviewPicture,代码行数:27,代码来源:ViewServer.java

示例3: onClick

import android.view.View; //导入方法依赖的package包/类
@Override
public void onClick(View v) {
    View registrationLayoutView = v.getRootView();

    initializeViewComponents(registrationLayoutView);
    UserRegistrationTO userRegistrationTO = prepareUserRegistrationTO();

    boolean isValidUserRegistrationData = validateUserRegistrationData(v.getContext(), userRegistrationTO);

    if (isValidUserRegistrationData) {
        FirebaseAuth firebaseAuth = SessionManager.getFirebaseAuth();
        firebaseAuth.createUserWithEmailAndPassword(userRegistrationTO.getEmail(), userRegistrationTO.getPassword())
                .addOnCompleteListener(new RegistrationOnCompleteListener(v.getContext(), userRegistrationTO));
    }
}
 
开发者ID:lmnpWmi,项目名称:wirtualnaApteczka,代码行数:16,代码来源:RegisterNewUserOnClickListener.java

示例4: captureView

import android.view.View; //导入方法依赖的package包/类
public static Bitmap captureView(View view) {
  View rootView = view.getRootView();
  rootView.setDrawingCacheEnabled(true);
  Bitmap bitmap = Bitmap.createBitmap(rootView.getDrawingCache());
  rootView.setDrawingCacheEnabled(false);
  return bitmap;
}
 
开发者ID:mapbox,项目名称:mapbox-navigation-android,代码行数:8,代码来源:ViewUtils.java

示例5: getScreenShot

import android.view.View; //导入方法依赖的package包/类
public static Bitmap getScreenShot(View view) {
    View screenView = view.getRootView();
    screenView.setDrawingCacheEnabled(true);
    Bitmap bitmap = Bitmap.createBitmap(screenView.getDrawingCache());
    screenView.setDrawingCacheEnabled(false);
    return bitmap;
}
 
开发者ID:vikasdesale,项目名称:News24x7-news-from-every-part-of-the-world,代码行数:8,代码来源:DetailsFragment.java

示例6: setFocusedWindow

import android.view.View; //导入方法依赖的package包/类
/**
 * Invoke this method to change the currently focused window.
 * 
 * @param view A view that belongs to the view hierarchy/window that has focus,
 *             or null to remove focus
 */
public void setFocusedWindow(View view) {
    mFocusLock.writeLock().lock();
    try {
        mFocusedWindow = view == null ? null : view.getRootView();
    } finally {
        mFocusLock.writeLock().unlock();
    }
    fireFocusChangedEvent();
}
 
开发者ID:rtr-nettest,项目名称:open-rmbt,代码行数:16,代码来源:ViewServer.java

示例7: takeScreenshot

import android.view.View; //导入方法依赖的package包/类
public static void takeScreenshot(View v) {
    // create bitmap screen capture
    Bitmap bitmap;
    View v1 = v.getRootView();
    v1.setDrawingCacheEnabled(true);
    bitmap = Bitmap.createBitmap(v1.getDrawingCache());
    v1.setDrawingCacheEnabled(false);
}
 
开发者ID:victordiaz,项目名称:phonk,代码行数:9,代码来源:AndroidUtils.java

示例8: getRelativeTop

import android.view.View; //导入方法依赖的package包/类
public static int getRelativeTop(View view) {
    if (view.getParent() == view.getRootView())
        return view.getTop();
    else
        return view.getTop() + getRelativeTop((View) view.getParent());
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:7,代码来源:ViewUtil.java

示例9: getRelativeTop

import android.view.View; //导入方法依赖的package包/类
private int getRelativeTop(View myView) {
    if (myView.getParent() == myView.getRootView()) {
        return myView.getTop();
    } else {
        return myView.getTop() + getRelativeTop((View) myView.getParent());
    }
}
 
开发者ID:amarjain07,项目名称:StickyScrollView,代码行数:8,代码来源:StickyScrollView.java

示例10: ShadowViewHolder

import android.view.View; //导入方法依赖的package包/类
ShadowViewHolder(View itemView) {
    super(itemView);
    if (!Preferences.get(mContext).isShadowEnabled()) {
        View shadow = itemView.findViewById(R.id.shadow);
        shadow.setVisibility(View.GONE);

        View root = shadow.getRootView();
        root.setPadding(0, 0, 0, 0);
    }
}
 
开发者ID:danimahardhika,项目名称:wallpaperboard,代码行数:11,代码来源:AboutAdapter.java

示例11: getRelativeTop

import android.view.View; //导入方法依赖的package包/类
public static int getRelativeTop(View myView) {
    if (myView.getParent() == myView.getRootView()) {
        return myView.getTop();
    } else {
        return myView.getTop() + getRelativeTop((View) myView.getParent());
    }
}
 
开发者ID:PacktPublishing,项目名称:Expert-Android-Programming,代码行数:8,代码来源:ViewUtils.java

示例12: FooterViewHolder

import android.view.View; //导入方法依赖的package包/类
FooterViewHolder(View itemView) {
    super(itemView);
    if (!Preferences.get(mContext).isShadowEnabled()) {
        View shadow = itemView.findViewById(R.id.shadow);
        shadow.setVisibility(View.GONE);

        View root = shadow.getRootView();
        root.setPadding(0, 0, 0, 0);
    }
}
 
开发者ID:danimahardhika,项目名称:wallpaperboard,代码行数:11,代码来源:SettingsAdapter.java

示例13: getRelativeLeft

import android.view.View; //导入方法依赖的package包/类
public static int getRelativeLeft(View view) {
    if (view.getParent() == view.getRootView())
        return view.getLeft();
    else
        return view.getLeft() + getRelativeLeft((View) view.getParent());
}
 
开发者ID:SimonCherryGZ,项目名称:JewelryUI,代码行数:7,代码来源:ViewUtil.java

示例14: getRelativeLeft

import android.view.View; //导入方法依赖的package包/类
public static int getRelativeLeft(View myView) {
    if (myView.getParent() == myView.getRootView())
        return myView.getLeft();
    else
        return myView.getLeft() + getRelativeLeft((View) myView.getParent());
}
 
开发者ID:MohammadAlBanna,项目名称:Swift-Braille-Soft-keyboard,代码行数:7,代码来源:Common.java

示例15: getRelativeTop

import android.view.View; //导入方法依赖的package包/类
public static int getRelativeTop(View myView) {
    if (myView.getParent() == myView.getRootView())
        return myView.getTop();
    else
        return myView.getTop() + getRelativeTop((View) myView.getParent());
}
 
开发者ID:MohammadAlBanna,项目名称:Swift-Braille-Soft-keyboard,代码行数:7,代码来源:Common.java


注:本文中的android.view.View.getRootView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。