本文整理汇总了Java中android.view.View.removeOnAttachStateChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java View.removeOnAttachStateChangeListener方法的具体用法?Java View.removeOnAttachStateChangeListener怎么用?Java View.removeOnAttachStateChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.removeOnAttachStateChangeListener方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addView
import android.view.View; //导入方法依赖的package包/类
/**
* 添加view到Window
*
* @param view
* @param params
*/
public void addView(View view, ViewGroup.LayoutParams params)
{
if (view == null)
{
return;
}
init(view);
if (containsView(view))
{
return;
}
if (params == null)
{
params = newLayoutParams();
}
getWindowManager().addView(view, params);
view.removeOnAttachStateChangeListener(mInternalOnAttachStateChangeListener);
view.addOnAttachStateChangeListener(mInternalOnAttachStateChangeListener);
mMapView.put(view, 0);
}
示例2: setTarget
import android.view.View; //导入方法依赖的package包/类
/**
* 设置目标view
*
* @param target
*/
public FPoper setTarget(View target)
{
final View old = getTarget();
if (old != target)
{
if (old != null)
{
old.removeOnAttachStateChangeListener(mOnAttachStateChangeListenerTarget);
}
if (target != null)
{
mTarget = new WeakReference<>(target);
target.removeOnAttachStateChangeListener(mOnAttachStateChangeListenerTarget);
target.addOnAttachStateChangeListener(mOnAttachStateChangeListenerTarget);
} else
{
mTarget = null;
removeUpdateListener();
}
}
return this;
}
示例3: onGlobalFocusChanged
import android.view.View; //导入方法依赖的package包/类
@Override
public void onGlobalFocusChanged(View oldFocus, View newFocus) {
if (newFocus == null) {
return;
}
if (oldFocus != null) {
oldFocus.removeOnAttachStateChangeListener(this);
}
Looper.myQueue().removeIdleHandler(this);
newFocus.addOnAttachStateChangeListener(this);
}
示例4: clearInputMethodManagerLeak
import android.view.View; //导入方法依赖的package包/类
@TargetApi(Build.VERSION_CODES.KITKAT)
private void clearInputMethodManagerLeak() {
try {
Object lock = mHField.get(inputMethodManager);
// This is highly dependent on the InputMethodManager implementation.
synchronized (lock) {
View servedView = (View) mServedViewField.get(inputMethodManager);
if (servedView != null) {
boolean servedViewAttached = servedView.getWindowVisibility() != View.GONE;
if (servedViewAttached) {
// The view held by the IMM was replaced without a global focus change. Let's make
// sure we get notified when that view detaches.
// Avoid double registration.
servedView.removeOnAttachStateChangeListener(this);
servedView.addOnAttachStateChangeListener(this);
} else {
// servedView is not attached. InputMethodManager is being stupid!
Activity activity = extractActivity(servedView.getContext());
if (activity == null || activity.getWindow() == null) {
// Unlikely case. Let's finish the input anyways.
finishInputLockedMethod.invoke(inputMethodManager);
} else {
View decorView = activity.getWindow().peekDecorView();
boolean windowAttached = decorView.getWindowVisibility() != View.GONE;
if (!windowAttached) {
finishInputLockedMethod.invoke(inputMethodManager);
} else {
decorView.requestFocusFromTouch();
}
}
}
}
}
} catch (IllegalAccessException | InvocationTargetException unexpected) {
Log.e("IMMLeaks", "Unexpected reflection exception", unexpected);
}
}
示例5: onGlobalFocusChanged
import android.view.View; //导入方法依赖的package包/类
@Override public void onGlobalFocusChanged(View oldFocus, View newFocus) {
if (newFocus == null) {
return;
}
if (oldFocus != null) {
oldFocus.removeOnAttachStateChangeListener(this);
}
Looper.myQueue().removeIdleHandler(this);
newFocus.addOnAttachStateChangeListener(this);
}
示例6: clearInputMethodManagerLeak
import android.view.View; //导入方法依赖的package包/类
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private void clearInputMethodManagerLeak() {
try {
Object lock = mHField.get(inputMethodManager);
// This is highly dependent on the InputMethodManager implementation.
synchronized (lock) {
View servedView = (View) mServedViewField.get(inputMethodManager);
if (servedView != null) {
boolean servedViewAttached = servedView.getWindowVisibility() != View.GONE;
if (servedViewAttached) {
// The view held by the IMM was replaced without a global focus change. Let's make
// sure we get notified when that view detaches.
// Avoid double registration.
servedView.removeOnAttachStateChangeListener(this);
servedView.addOnAttachStateChangeListener(this);
} else {
// servedView is not attached. InputMethodManager is being stupid!
Activity activity = extractActivity(servedView.getContext());
if (activity == null || activity.getWindow() == null) {
// Unlikely case. Let's finish the input anyways.
finishInputLockedMethod.invoke(inputMethodManager);
} else {
View decorView = activity.getWindow().peekDecorView();
boolean windowAttached = decorView.getWindowVisibility() != View.GONE;
if (!windowAttached) {
finishInputLockedMethod.invoke(inputMethodManager);
} else {
decorView.requestFocusFromTouch();
}
}
}
}
}
} catch (IllegalAccessException | InvocationTargetException unexpected) {
Log.e("IMMLeaks", "Unexpected reflection exception", unexpected);
}
}
示例7: onViewDetachedFromWindow
import android.view.View; //导入方法依赖的package包/类
@Override
public void onViewDetachedFromWindow(View v) {
if (DebugOverlay.DEBUG) {
Log.i(TAG, "onViewDetachedFromWindow");
}
windowManager.removeViewImmediate(_rootView);
v.removeOnAttachStateChangeListener(this);
}
示例8: onViewDetachedFromWindow
import android.view.View; //导入方法依赖的package包/类
@Override
public void onViewDetachedFromWindow(View v) {
v.removeOnAttachStateChangeListener(this);
checkVisibility(false);
}
示例9: onViewDetachedFromWindow
import android.view.View; //导入方法依赖的package包/类
@Override
public void onViewDetachedFromWindow(View v) {
v.removeOnAttachStateChangeListener(this);
Looper.myQueue().removeIdleHandler(this);
Looper.myQueue().addIdleHandler(this);
}
示例10: onViewDetachedFromWindow
import android.view.View; //导入方法依赖的package包/类
@Override
public void onViewDetachedFromWindow(View v)
{
v.removeOnAttachStateChangeListener(this);
mMapView.remove(v);
}
示例11: onViewDetachedFromWindow
import android.view.View; //导入方法依赖的package包/类
@Override public void onViewDetachedFromWindow(View v) {
v.removeOnAttachStateChangeListener(this);
Looper.myQueue().removeIdleHandler(this);
Looper.myQueue().addIdleHandler(this);
}