| Scroller() | ใช้สร้าง Object Scroller |
|---|---|
| abortAnimation() | ใช้หยุด animation ของการ scroll |
| getCurrX() | ใช้คืนค่า ตำแหน่งแกน x ปัจจุบัน ของ scroll |
| getCurrY() | ใช้คืนค่า ตำแหน่งแกน y ปัจจุบัน ของ scroll |
| getDuration() | ใช้คืนค่า ระยะเวลาของการ scroll ของ scroll โดยมีหน่วยคือ milliseconds |
| getFinalX() | ใช้คืนค่า ตำแหน่งแกน x ที่เป็นจุดสิ้นสุด ของ scroll |
| getFinalY() | ใช้คืนค่า ตำแหน่งแกน y ที่เป็นจุดสิ้นสุด ของ scroll |
| getStartX() | ใช้คืนค่า ตำแหน่งแกน x ที่เป็นจุดเริ่มต้น ของ scroll |
| getStartY() | ใช้คืนค่า ตำแหน่งแกน y ที่เป็นจุดเริ่มต้น ของ scroll |
| isFinished() | ใช้ตรวจสอบว่า การ scroll สิ้นสุดลงหรือยัง |
| setFinalX() | ใช้กำหนด ตำแหน่งแกน x ที่เป็นจุดสิ้นสุด ของ scroll |
| setFinalY() | ใช้กำหนด ตำแหน่งแกน y ที่เป็นจุดสิ้นสุด ของ scroll |
| startScroll() | ใช้กำหนดให้มีการ scroll จากตำแหน่งที่กำหนด ไปตามจำนวนที่กำหนด |
method:Scroller ( Context context )
return type:Scroller
content:ใช้สร้าง Object Scroller
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:abortAnimation ( )
return type:void
content:ใช้หยุด animation ของการ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); scroller.abortAnimation ( ); setContentView ( text_view ); } }
method:getCurrX ( )
return type:int
content:ใช้คืนค่า ตำแหน่งแกน x ปัจจุบัน ของ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); int current_x = scroller.getCurrX ( ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:getCurrY ( )
return type:int
content:ใช้คืนค่า ตำแหน่งแกน y ปัจจุบัน ของ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); int current_y = scroller.getCurrY ( ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:getDuration ( )
return type:int
content:ใช้คืนค่า ระยะเวลาของการ scroll ของ scroll โดยมีหน่วยคือ milliseconds
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); int duration = scroller.getDuration ( ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:getFinalX ( )
return type:int
content:ใช้คืนค่า ตำแหน่งแกน x ที่เป็นจุดสิ้นสุด ของ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); int final_x = scroller.getFinalX ( ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:getFinalY ( )
return type:int
content:ใช้คืนค่า ตำแหน่งแกน y ที่เป็นจุดสิ้นสุด ของ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); int final_y = scroller.getFinalY ( ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:getStartX ( )
return type:int
content:ใช้คืนค่า ตำแหน่งแกน x ที่เป็นจุดเริ่มต้น ของ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); int start_x = scroller.getStartX ( ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:getStartY ( )
return type:int
content:ใช้คืนค่า ตำแหน่งแกน y ที่เป็นจุดเริ่มต้น ของ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); int start_y = scroller.getStartY ( ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:isFinished ( )
return type:boolean
content:ใช้ตรวจสอบว่า การ scroll สิ้นสุดลงหรือยัง
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); int start_y = scroller.getStartY ( ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); if ( ! scroller.isFinished ( ) ) { Toast.makeText ( this, "Scroll running", Toast.LENGTH_SHORT ).show ( ); } setContentView ( text_view ); } }
method:setFinalX ( int newX )
return type:void
content:ใช้กำหนด ตำแหน่งแกน x ที่เป็นจุดสิ้นสุด ของ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); scroller.setFinalX ( 300 ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:setFinalY ( int newY )
return type:void
content:ใช้กำหนด ตำแหน่งแกน y ที่เป็นจุดสิ้นสุด ของ scroll
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); scroller.setFinalY ( 50 ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); } }
method:startScroll ( int startX, int startY, int dx, int dy )
return type:void
content:ใช้กำหนดให้มีการ scroll จากตำแหน่งที่กำหนด ไปตามจำนวนที่กำหนด
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); Scroller scroller = new Scroller ( this ); TextView text_view = new TextView ( this ); text_view.setScroller ( scroller ); setContentView ( text_view ); scroller.startScroll ( 0, 0, 100, 0 ); } }