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

项目:boohee_v5.6    文件:RadarActivity.java   
private void initView() {
    this.scrollView.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {
        int HEIGHT = RadarActivity.this.getResources().getDisplayMetrics().heightPixels;
        int[] area = new int[2];

        public void onScrollChanged() {
            RadarActivity.this.nutritionLayout.getLocationOnScreen(this.area);
            if (this.area[1] + RadarActivity.this.nutritionLayout.getHeight() < this.HEIGHT) {
                RadarActivity.this.nutritionLayout.startAnim();
            }
            RadarActivity.this.sportLayout.getLocationOnScreen(this.area);
            if (this.area[1] + RadarActivity.this.sportLayout.getHeight() < this.HEIGHT) {
                RadarActivity.this.sportLayout.startAnim();
            }
            RadarActivity.this.ringNutrition.getLocationOnScreen(this.area);
            if (this.area[1] + RadarActivity.this.ringNutrition.getHeight() < this.HEIGHT) {
                RadarActivity.this.ringNutrition.startAnim();
            }
            RadarActivity.this.ringHeat.getLocationInWindow(this.area);
            if (this.area[1] + RadarActivity.this.ringHeat.getHeight() < this.HEIGHT) {
                RadarActivity.this.ringHeat.startAnim();
            }
        }
    });
}
项目:KTA-Editor    文件:KTAEditor.java   
private void setScrollView(){
    sv.getViewTreeObserver().addOnScrollChangedListener(new OnScrollChangedListener() {

            @Override
            public void onScrollChanged() {
                int scrollY = sv.getScrollY(); //for verticalScrollView
                mHeader.setTranslationY(Math.max(-scrollY, mMinHeaderTranslation));
                //header_logo --> actionbar icon
                float ratio = clamp(mHeader.getTranslationY() / mMinHeaderTranslation, 0.0f, 1.0f);
                interpolate(mHeaderLogo, getActionBarIconView(), mSmoothInterpolator.getInterpolation(ratio));
                interpolate2(sp, getActionBarIconView(), mSmoothInterpolator.getInterpolation(ratio));
                //actionbar title alpha
                //getActionBarTitleView().setAlpha(clamp(5.0F * ratio - 4.0F, 0.0F, 1.0F));
                //---------------------------------
                //better way thanks to @cyrilmottier
                setTitleAlpha(clamp(5.0F * ratio - 4.0F, 0.0F, 1.0F));

            }
        });
}
项目:CSipSimple    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:solved-hacking-problem    文件:az.java   
private static void m2531a(PopupWindow popupWindow) {
    try {
        Field declaredField = PopupWindow.class.getDeclaredField("mAnchor");
        declaredField.setAccessible(true);
        Field declaredField2 = PopupWindow.class.getDeclaredField("mOnScrollChangedListener");
        declaredField2.setAccessible(true);
        declaredField2.set(popupWindow, new ba(declaredField, popupWindow, (OnScrollChangedListener) declaredField2.get(popupWindow)));
    } catch (Throwable e) {
        Log.d("AppCompatPopupWindow", "Exception while installing workaround OnScrollChangedListener", e);
    }
}
项目:solved-hacking-problem    文件:az.java   
private static void m2531a(PopupWindow popupWindow) {
    try {
        Field declaredField = PopupWindow.class.getDeclaredField("mAnchor");
        declaredField.setAccessible(true);
        Field declaredField2 = PopupWindow.class.getDeclaredField("mOnScrollChangedListener");
        declaredField2.setAccessible(true);
        declaredField2.set(popupWindow, new ba(declaredField, popupWindow, (OnScrollChangedListener) declaredField2.get(popupWindow)));
    } catch (Throwable e) {
        Log.d("AppCompatPopupWindow", "Exception while installing workaround OnScrollChangedListener", e);
    }
}
项目:Red-Calorie    文件:ViewTreeScrollChangedListener.java   
@Override
public void call(final Subscriber<? super ViewScrollChangeEvent> subscriber) {
    final ViewTreeObserver viewTreeObserver = view.getViewTreeObserver();

    final OnScrollChangedListener listener = new OnScrollChangedListener() {
        int oldX, oldY;

        @Override
        public void onScrollChanged() {
            if (!subscriber.isUnsubscribed()) {
                int scrollX = view.getScrollX();
                int scrollY = view.getScrollY();
                subscriber.onNext(ViewScrollChangeEvent.create(view, scrollX, scrollY, oldX, oldY));
                oldX = scrollX;
                oldY = scrollY;
            }
        }
    };
    viewTreeObserver.addOnScrollChangedListener(listener);

    subscriber.add(new MainThreadSubscription() {
        @Override
        protected void onUnsubscribe() {
            viewTreeObserver.removeOnScrollChangedListener(listener);
        }
    });
}
项目:aptoide-backup-apps    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:PalmCampus    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:FMTech    文件:zziq.java   
public static void zza(Activity paramActivity, ViewTreeObserver.OnScrollChangedListener paramOnScrollChangedListener)
{
  Window localWindow = paramActivity.getWindow();
  if ((localWindow != null) && (localWindow.getDecorView() != null) && (localWindow.getDecorView().getViewTreeObserver() != null)) {
    localWindow.getDecorView().getViewTreeObserver().addOnScrollChangedListener(paramOnScrollChangedListener);
  }
}
项目:FMTech    文件:zziq.java   
public static void zzb(Activity paramActivity, ViewTreeObserver.OnScrollChangedListener paramOnScrollChangedListener)
{
  Window localWindow = paramActivity.getWindow();
  if ((localWindow != null) && (localWindow.getDecorView() != null) && (localWindow.getDecorView().getViewTreeObserver() != null)) {
    localWindow.getDecorView().getViewTreeObserver().removeOnScrollChangedListener(paramOnScrollChangedListener);
  }
}
项目: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);
        }
    });
}
项目:MinMinGuard    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:DoubanOnline    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:travelinfo    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:BitcoinAuthenticator-Android    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:MonsterHunter3UDatabase    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:OurDailyBread    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:itmarry    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:github-v2    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:kaorisan    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:appdeck-android    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:tournama    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:NyanNyanGuard    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:ApkDownloader    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:ActionBarTest    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:TwitterFeedReaderSample    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:BlockchainSearch    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:PopupMenuCompat    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:beautyClock    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:upes-academics    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:danmaku-project    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:zen4android    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:NeXT_pyp    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:lastfm-for-android    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:BuscaML    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:zhangshangwuda    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:Open-Battery-Saver    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:TextBack-android    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:wifiLazooo-android    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}
项目:Rogo    文件:PopupWindowCompat.java   
private void init() {
    if (superListenerField != null) {
        try {
            mSuperScrollListener = (OnScrollChangedListener) superListenerField.get(this);
            superListenerField.set(this, NOP);
        } catch (Exception e) {
            mSuperScrollListener = null;
        }
    }
}