當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。