类android.view.ViewTreeObserver.OnScrollChangedListener源码实例Demo

下面列出了怎么用android.view.ViewTreeObserver.OnScrollChangedListener的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: CSipSimple   文件: PopupWindowCompat.java
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
 
源代码2 项目: 365browser   文件: IncognitoBottomSheetContent.java
/**
 * Constructs a new IncognitoBottomSheetContent.
 * @param activity The {@link Activity} displaying this bottom sheet content.
 */
public IncognitoBottomSheetContent(final Activity activity) {
    LayoutInflater inflater = LayoutInflater.from(activity);
    mView = inflater.inflate(R.layout.incognito_bottom_sheet_content, null);

    View learnMore = mView.findViewById(R.id.learn_more);
    learnMore.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            HelpAndFeedback.getInstance(activity).show(activity,
                    activity.getString(R.string.help_context_incognito_learn_more),
                    Profile.getLastUsedProfile(), null);
        }
    });

    final FadingShadowView shadow = (FadingShadowView) mView.findViewById(R.id.shadow);
    shadow.init(
            ApiCompatibilityUtils.getColor(mView.getResources(), R.color.toolbar_shadow_color),
            FadingShadow.POSITION_TOP);

    mScrollView = (ScrollView) mView.findViewById(R.id.scroll_view);
    mScrollView.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {
        @Override
        public void onScrollChanged() {
            boolean shadowVisible = mScrollView.canScrollVertically(-1);
            shadow.setVisibility(shadowVisible ? View.VISIBLE : View.GONE);
        }
    });
}
 
源代码3 项目: zen4android   文件: PopupWindowCompat.java
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
 
源代码4 项目: zhangshangwuda   文件: PopupWindowCompat.java
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
 
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
 
 类所在包
 同包方法