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