-
-
-
method:PopupWindow ( Context context )
return type:PopupWindow
content:ใช้สร้าง Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
}
}
-
method:PopupWindow ( )
return type:PopupWindow
content:ใช้สร้าง Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( );
}
}
-
method:PopupWindow ( int width, int height )
return type:PopupWindow
content:ใช้สร้าง Object PopupWindow โดยมีการกำหนดขนาดความสูงและความกว้างเอาไว้
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( 300, 100 );
}
}
-
method:dismiss ( )
return type:void
content:ใช้ปิด popup window
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
if ( popup_window.isShowing ( ) )
{
popup_window.dismiss ( );
}
}
}
-
method:getAnimationStyle ( )
return type:int
content:ใช้คืนค่า animation style ของ Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
int animation_style = popup_window.getAnimationStyle ( );
}
}
-
method:getBackground ( )
return type:Drawable
content:ใช้คืนค่า background ของ Object PopupWindow โดยจะคืนค่ามาแบบ Drawable
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
Drawable background_drawable = popup_window.getBackground ( );
}
}
-
method:getHeight ( )
return type:int
content:ใช้คืนค่า ขนาดความสูง ของ Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
int popup_height = popup_window.getHeight ( );
}
}
-
method:getInputMethodMode ( )
return type:int
content:ใช้คืนค่า input method mode ของ Object PopupWindow
โดยค่าที่เป็นไปได้ ได้แก่ PopupWindow.INPUT_METHOD_FROM_FOCUSABLE,
PopupWindow.INPUT_METHOD_NEEDED และ PopupWindow.INPUT_METHOD_NOT_NEEDED
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
int input_method_mode = popup_window.getInputMethodMode ( );
}
}
-
method:getWidth ( )
return type:int
content:ใช้คืนค่า ขนาดความกว้าง ของ Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
int popup_width = popup_window.getWidth ( );
}
}
-
method:isFocusable ( )
return type:boolean
content:ใช้ตรวจสอบว่า Object PopupWindow สามารถได้รับ Focus ได้หรือไม่
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
if ( popup_window.isFocusable ( ) )
{
Toast.makeText ( this, "PopupWindow can be focused", Toast.LENGTH_SHORT ).show ( );
}
}
}
-
method:isShowing ( )
return type:boolean
content:ใช้ตรวจสอบว่า Object PopupWindow ถูกแสดงอยู่หรือไม่
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
if ( popup_window.isShowing ( ) )
{
Toast.makeText ( this, "PopupWindow can be showed", Toast.LENGTH_SHORT ).show ( );
}
}
}
-
method:isTouchable ( )
return type:boolean
content:ใช้ตรวจสอบว่า Object PopupWindow สามารถ touch ได้หรือไม่
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
if ( popup_window.isTouchable ( ) )
{
Toast.makeText ( this, "PopupWindow can be touched", Toast.LENGTH_SHORT ).show ( );
}
}
}
-
method:setFocusable ( boolean focusable )
return type:void
content:ใช้กำหนดว่า popup window สามารถได้รับ focus หรือไม่
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
if ( popup_window.isFocusable ( ) )
{
popup_window.setFocusable ( false );
}
}
}
-
method:setHeight ( int height )
return type:void
content:ใช้กำหนดค่า ขนาดความสุงของ Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
popup_window.setHeight ( 300 );
}
}
-
method:setInputMethodMode ( int mode )
return type:void
content:ใช้กำหนด input method mode ให้กับ Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
popup_window.setInputMethodMode ( PopupWindow.INPUT_METHOD_NEEDED );
}
}
-
method:setTouchable ( boolean touchable )
return type:void
content:ใช้กำหนดว่า popup window สามารถ touch ได้หรือไม่
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
if ( popup_window.isTouchable ( ) )
{
popup_window.setTouchable ( false );
}
}
}
-
method:setWidth ( int width )
return type:void
content:ใช้กำหนดค่า ขนาดความกว้าง ให้กับ Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
popup_window.setWidth ( 500 );
}
}
-
method:update ( int width, int height )
return type:void
content:ใช้เปลี่ยนแปลง ขนาดความกว้างและความสูง ของ Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
popup_window.update ( 500, 300 );
}
}
-
method:update ( int x, int y, int width, int height )
return type:void
content:ใช้เปลี่ยนแปลง ขนาดความกว้างและความสูง และแกน x และแกน y
ของ Object PopupWindow
example:public class AndroidBamboo extends Activity
{
public void onCreate( Bundle savedInstanceState )
{
super.onCreate ( savedInstanceState );
PopupWindow popup_window = new PopupWindow ( this );
popup_window.update ( 0, 0, 500, 300 );
}
}