View getScrollX - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for View getScrollX method.

This code example shows how to use the following methods:getScrollX, getScrollY, getLayout, getTotalPaddingLeft, getTotalPaddingTop
This code example shows how to use the following methods:getScrollX, scrollTo
        return view.getScrollY();
    } 
    public void setScrollY(int value) {
        View view = mView.get();
        if (view != null) {
            view.scrollTo(view.getScrollX(), value);
        } 
    } 
 
    public float getTranslationX() { 
        return mTranslationX;
    } 
    public void setTranslationX(float translationX) {
        if (mTranslationX != translationX) {
            prepareForUpdate(); 
            mTranslationX = translationX;
            invalidateAfterUpdate(); 
        } 
    } 
    public float getTranslationY() { 
7
CodeRank
This code example shows how to use the following methods:getScrollX, getScrollY, getScale
    public void clearTouchMetaState() { 
        mTouchMetaState = 0;
    } 
 
    private int contentsToWindowX(int x) {
        return Math.round(x * mWebView.getScale()) - mWebView.getScrollX();
    } 
 
    private int contentsToWindowY(int y) {
        return Math.round(y * mWebView.getScale()) - mWebView.getScrollY();
    } 
 
    private WebView mWebView = null;
    private int mouseX;
    private int mouseY;
 
    private class TouchPoint { 
        private int mId;
        private int mX;
        private int mY;
6
CodeRank
This code example shows how to use the following methods:getScrollX, getScrollY, getLayout, getTotalPaddingLeft, getTotalPaddingTop
        if (action == MotionEvent.ACTION_UP ||
                action == MotionEvent.ACTION_DOWN) {
            int x = (int) event.getX();
            int y = (int) event.getY();
 
            x -= widget.getTotalPaddingLeft();
            y -= widget.getTotalPaddingTop();
 
            x += widget.getScrollX();
            y += widget.getScrollY();
 
            Layout layout = widget.getLayout();
            int line = layout.getLineForVertical(y);
            int off = layout.getOffsetForHorizontal(line, x);
 
            MyURLSpan[] link = buffer.getSpans(off, off, MyURLSpan.class);
 
            if (link.length != 0) {
                if (action == MotionEvent.ACTION_UP) {
                    if (!mHasPerformedLongPress) {

8
CodeRank
This code example shows how to use the following methods:getScrollX, getScrollY
 
    public ScrollViewState() { 
    } 
 
    public ScrollViewState(@Nonnull ScrollView scrollView) {
        this.scrollX = scrollView.getScrollX();
        this.scrollY = scrollView.getScrollY();
    } 
 
    public void restoreState(@Nonnull final ScrollView scrollView) {
        scrollView.post(new Runnable() {
            @Override 
            public void run() { 
                scrollView.scrollTo(scrollX, scrollY);
            } 
        }); 
 
    } 
 
    public static void saveState(@Nonnull Bundle out, @Nonnull final ScrollView scrollView) {
6
CodeRank
This code example shows how to use the following methods:getScrollX
        static void setScaleY(View view, float scaleY) {
            view.setScaleY(scaleY);
        } 
 
        static float getScrollX(View view) {
            return view.getScrollX();
        } 
 
        static void setScrollX(View view, int scrollX) {
            view.setScrollX(scrollX);
        } 
 
        static float getScrollY(View view) {
            return view.getScrollY();
        } 
 
        static void setScrollY(View view, int scrollY) {
            view.setScrollY(scrollY);
        } 
 
6
CodeRank
This code example shows how to use the following methods:getHeight, getScrollX, getScrollY, getWidth, getWebTextSelectionControls
 
         this.createToolTip();
         WebView var6 = this.getTopWindow();
         if(var6 == null) {
            return; 
         } else if(var6.getWebTextSelectionControls() == null) {
            return; 
         } else { 
            Rect var7 = var6.getWebTextSelectionControls().getSelectionRect();
            new Point(0, 0);
            StringBuilder var9 = (new StringBuilder()).append("onSelectionChanged : rtSelection ");
            int var10 = var7.left;
            StringBuilder var11 = var9.append(var10).append(", ");
            int var12 = var7.right;
            StringBuilder var13 = var11.append(var12).append(", ");
            int var14 = var7.top;
            StringBuilder var15 = var13.append(var14).append(", ");
            int var16 = var7.bottom;
            String var17 = var15.append(var16).toString();
            int var18 = Log.v("TextSelector", var17);

6
CodeRank
This code example shows how to use the following methods:getScrollX
    public int getScrollX() { 
        View view = mView.get();
        if (view == null) {
            return 0; 
        } 
        return view.getScrollX();
    } 
    public void setScrollX(int value) {
        View view = mView.get();
        if (view != null) {
            view.scrollTo(value, view.getScrollY());
        } 
    } 
    public int getScrollY() { 
        View view = mView.get();
        if (view == null) {
            return 0; 
        } 
        return view.getScrollY();
    } 
6
CodeRank
This code example shows how to use the following methods:getScrollX, getScrollY, getScale
            return mY;
        } 
    } 
 
    private Point createViewPointFromContentCoordinates(int x, int y) {
        return new Point(Math.round(x * mWebView.getScale()) - mWebView.getScrollX(),
                         Math.round(y * mWebView.getScale()) - mWebView.getScrollY());
    } 
 
    public static class TouchPoint { 
        private int mId;
        private Point mPoint;
        private long mDownTime;
        private boolean mReleased = false;
        private boolean mMoved = false;
        private boolean mCancelled = false;
 
        public TouchPoint(int id, Point point) {
            mId = id;
            mPoint = point;
7
CodeRank
This code example shows how to use the following methods:getScrollX, getScrollY, getWidth, invalidate, EditText.invalidate
 
    public void setState(int state) {
        switch (state) {
            case STATE_NONE:
                mHandler.removeCallbacks(mScrollFade);
                mList.invalidate();
                break; 
            case STATE_VISIBLE:
                if (mState != STATE_VISIBLE) { // Optimization
                    resetThumbPos(); 
                } 
                // Fall through 
            case STATE_DRAGGING:
                mHandler.removeCallbacks(mScrollFade);
                break; 
            case STATE_EXIT:
                int viewWidth = mList.getWidth();
                mList.invalidate(viewWidth - mThumbW, mThumbY, viewWidth, mThumbY + mThumbH);
                break; 
        } 

6
CodeRank

Related View getScrollX Questions & Answers:

getScrollX Method Overview
Return the scrolled left position of this view.
See Code Examples for other Android View Methods: