本文整理汇总了Java中android.view.View.OnAttachStateChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java View.OnAttachStateChangeListener方法的具体用法?Java View.OnAttachStateChangeListener怎么用?Java View.OnAttachStateChangeListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.View
的用法示例。
在下文中一共展示了View.OnAttachStateChangeListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bind
import android.view.View; //导入方法依赖的package包/类
@UiThread
public static void bind(View view, KolibriProvider provider) {
final KolibriCoordinator coordinator = provider.provideCoordinator(view);
if (coordinator == null) {
return;
}
View.OnAttachStateChangeListener binding = new Binding(view, coordinator);
view.addOnAttachStateChangeListener(binding);
// Sometimes we missed the first attach because the child's already been added.
// Sometimes we didn't. The binding keeps track to avoid double attachment of the Coordinator,
// and to guard against attachment to two different views simultaneously.
binding.onViewAttachedToWindow(view);
}
示例2: CompatAttachStateChangeListener
import android.view.View; //导入方法依赖的package包/类
CompatAttachStateChangeListener(View view, View.OnAttachStateChangeListener listener) {
mView = view;
mListener = listener;
myAttached = isAttachedToWindow(mView);
yourAttached = false;
if (myAttached) mView.getViewTreeObserver().addOnPreDrawListener(this);
mView.addOnAttachStateChangeListener(this);
update();
}
示例3: addOnAttachStateChangeListener
import android.view.View; //导入方法依赖的package包/类
public static void addOnAttachStateChangeListener(View view, View.OnAttachStateChangeListener listener) {
CompatAttachStateChangeListener.addOnAttachStateChangeListener(view, listener);
}
示例4: getAttachStateChangeListeners
import android.view.View; //导入方法依赖的package包/类
/**
* Manually retrieve the view's attach state change listeners of an event. Robolectric
* doesn't currently support manually firing these, and it would seem the events are not called
* in normal Robolectric usage either.
*
* @param view View with listeners to notify
*/
static CopyOnWriteArrayList<View.OnAttachStateChangeListener> getAttachStateChangeListeners(View view) {
Object listenerInfo = ReflectionHelpers.callInstanceMethod(view, "getListenerInfo");
return ReflectionHelpers.getField(listenerInfo, "mOnAttachStateChangeListeners");
}
示例5: addOnAttachStateChangeListener
import android.view.View; //导入方法依赖的package包/类
/**
* Delegiert von android.widget.Button
*
* @param listener siehe {@link Button}
*/
public void addOnAttachStateChangeListener(View.OnAttachStateChangeListener listener) {
b.addOnAttachStateChangeListener(listener);
}
示例6: removeOnAttachStateChangeListener
import android.view.View; //导入方法依赖的package包/类
/**
* Delegiert von android.widget.Button
*
* @param listener siehe {@link Button}
*/
public void removeOnAttachStateChangeListener(View.OnAttachStateChangeListener listener) {
b.removeOnAttachStateChangeListener(listener);
}