ScrollView scrollTo - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:scrollTo
						scrollView.scrollTo(0, display.getHeight() + 100);
					} 
				}); 
				handler.postDelayed(new Runnable() {
					public void run() { 
						scrollView.scrollTo(0, display.getHeight());
					} 
				}, 300); 
			} 
		} catch (IOException e) {
			Log.e(LilDebi.TAG, "", e);
		} 
	} 
} 
5
CodeRank
This code example shows how to use the following methods:scrollTo
 
    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) {
        out.putSerializable(SCROLL_VIEW_STATE, new ScrollViewState(scrollView));
    } 
 
    public static void restoreState(@Nonnull Bundle in, @Nonnull final ScrollView scrollView) {
        final Object o = in.getSerializable(SCROLL_VIEW_STATE);
        if (o instanceof ScrollViewState) {
            ((ScrollViewState) o).restoreState(scrollView);
        } 
5
CodeRank
This code example shows how to use the following methods:getScrollY, getWindowVisibleDisplayFrame, scrollTo
 
	@Override 
	public void scrollUp() { 
		// TODO Auto-generated method stub 
		Rect outRect = new Rect();
		mScrollView.getWindowVisibleDisplayFrame(outRect);
		int y = mScrollView.getScrollY() - 50;
		y = y < 50 ? 0 : y;
		mScrollView.scrollTo(0, y);
	} 
 
	@Override 
	public void scrollDown() { 
		// TODO Auto-generated method stub 
		int y = mScrollView.getScrollY() + 10;
		mScrollView.scrollTo(0, y);
	} 
	 
	public void setScrollView(ScrollView view) {
		mScrollView = view;
5
CodeRank
This code example shows how to use the following methods:getTop, scrollTo
 
	@Override 
	protected void onScrollChanged(int l, int t, int oldl, int oldt) {
		super.onScrollChanged(l, t, oldl, oldt);
		if (delegateScrollView != null) {
			delegateScrollView.scrollTo(l, t + delegateScrollView.getTop());
		} 
	} 
	 
	public static Point gapFromParentView(View v) {
		RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams) v.getLayoutParams();
		return new Point(params.leftMargin, params.topMargin);
	} 
} 
5
CodeRank
This code example shows how to use the following methods:getScrollY, scrollTo
        test = (Button) findViewById(R.id.test);
        test.setOnClickListener(new Button.OnClickListener() {
            @Override 
            public void onClick(View v) {
                // TODO Auto-generated method stub 
                sv.scrollTo(0, 2222);
                DisplayToast(sv.getScrollY() + "");
 
            } 
 
        }); 
 
    } 
 
    protected void onScrollChanged(int l, int t, int oldl, int oldt)
    { 
        DisplayToast("123"); 
    } 
 
    public String getinfo(String path)
4
CodeRank
This code example shows how to use the following methods:scrollTo
            scrollLayout.post(new Runnable() 
            {  
                public void run()  
                {  
                    //get the Y position of entryToFocus and scroll to it 
                    scrollLayout.scrollTo(0, (int)entryToFocus.getY()); 
                }  
            }); 
        } 
    }//end printScores() 
     
    //**************************storageIsAvailable()**************************** 
    /** Task: this method checks to see if the SD card is available and  
    *         writable.  
    *          
    * @return true is storage is available and writable 
    */ 
    public boolean storageIsAvailable() 
    {    
        //check storage >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
3
CodeRank
This code example shows how to use the following methods:scrollTo
		timelineView = (TimelineView) findViewById(R.id.timeline);
	} 
 
	@Override 
	protected void onScrollChanged(int l, int t, int oldl, int oldt) {
		synchScrollView.scrollTo(l, t);
	} 
 
	@Override 
	public boolean onInterceptTouchEvent(MotionEvent ev) {
		if (timelineView.isConsumingTouchEvent()) {
			return false; 
		} 
		boolean intercept = true;
		try { 
			intercept = super.onInterceptTouchEvent(ev);
		} catch (Exception e) {
			// can happen sporadically 
		} 
		return intercept;
4
CodeRank
This code example shows how to use the following methods:scrollTo
	// focuses on view 
	private final void focusOnView(final View v){
        new Handler().post(new Runnable() {
            @Override 
            public void run() { 
                sv.scrollTo(0, v.getTop());
            } 
        }); 
    } 
	 
	 
	public void saveExProgress(String key, long val)
	{ 
		edit.putLong(key, val);
		edit.commit();
	} 
     
    public void saveExProgress(String key, String val)
    { 
    	edit.putString(key, val);
3
CodeRank
This code example shows how to use the following methods:getHeight, getScrollY, scrollTo
			/*	} */ 
				_handler.post(new Runnable(){
					@Override 
					public void run() { 
						sTextView.setText(showStr);
						Log.d(TAG, "ScrollY: " + mScrollView.getScrollY());   
			            int off = sTextView.getMeasuredHeight() - mScrollView.getHeight();   
			            if (off > 0) {   
			                mScrollView.scrollTo(0, off);   
			            }                           
					} 
				}); 
			} 
		}.start();
	} 
	 
	 
 
	public void onButtonClicksend(View view) {
		String editText = "f";
4
CodeRank
This code example shows how to use the following methods:scrollTo
        log(sb.toString());
    } 
     
    public void adjustScroll( ) // not working!  
    { 
        mScroll.scrollTo(0, tv.getHeight() + 10); 
    }     
     
    void clearInfo() 
    { 
        tv.setText("");
    } 
 
    @Override 
    public void onClick(View v)
    { 
        if ( v == mCalibrate )
        { 
            calibrate(); 
        } 
3
CodeRank

Related ScrollView scrollTo Questions & Answers:

scrollTo Method Overview
Set the scrolled position of your view. This version also clamps the scrolling to the bounds of our child.
See Code Examples for other Android ScrollView Methods: