Deck 7: Touches and Swipes
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
سؤال
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/22
العب
ملء الشاشة (f)
Deck 7: Touches and Swipes
1
Touching the screen can be detected on Android devices.
True
2
To handle touch events, one of the things we must do is define a class that implements View.OnTouchListener and overrides its ____________ method.
onTouch
3
The public field of the ViewGroup.MarginLayoutParams class defining a right margin is ____________.
rightMargin
4
The onTouch method on View.OnTouchListener has this API:
boolean onTouch( View v, MotionEvent event )
The second parameter, v, represents the current touch event.
boolean onTouch( View v, MotionEvent event )
The second parameter, v, represents the current touch event.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
5
The rgb ____________ method of the Color class can be used to create a Color.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
6
It is possible that two Views overlap, in which case one View is stacked above the other View.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
7
The onSingleTapUp method of the GestureDetector.OnGestureListener interface is called on a(n) ____________ action when a touch occurs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
8
It is possible for a device to detect taps.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
9
Which method of the GestureDetector class should we call from the onTouchEvent method of the Activity class to dispatch a touch event to the appropriate method of the listener interfaces?
A) onTouchEvent
B) onDispatch
C) dispatch
D) callListener
A) onTouchEvent
B) onDispatch
C) dispatch
D) callListener
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
10
It is possible to adjust the font size of a TextView depending on the text contained inside the TextView.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
11
What does the getRawX method of MouseEvent return?
A) The x coordinate of the touch within the screen
B) The x coordinate of the touch within the View where the touch happened
C) The x coordinate of the top of the screen
D) The x coordinate of the top of the View where the touch happened
A) The x coordinate of the touch within the screen
B) The x coordinate of the touch within the View where the touch happened
C) The x coordinate of the top of the screen
D) The x coordinate of the top of the View where the touch happened
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
12
What does the getAction method of MouseEvent return?
A) A double
B) A float
C) An int, the x coordinate of the touch within the screen
D) An int, representing the type of action that occurred
A) A double
B) A float
C) An int, the x coordinate of the touch within the screen
D) An int, representing the type of action that occurred
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
13
We want to be able to compare the starting coordinate of a touch with the ending coordinate of a touch. How can we do it?
A) We cannot compare those coordinates.
B) We can compare them inside the onTouch method when it is called; nothing additional needed.
C) Store the ending coordinate in an instance variable and compare it to the starting coordinate of the touch inside the onTouch method.
D) Store the starting coordinate in an instance variable and compare it to the ending coordinate of the touch inside the onTouch method.
A) We cannot compare those coordinates.
B) We can compare them inside the onTouch method when it is called; nothing additional needed.
C) Store the ending coordinate in an instance variable and compare it to the starting coordinate of the touch inside the onTouch method.
D) Store the starting coordinate in an instance variable and compare it to the ending coordinate of the touch inside the onTouch method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
14
The getX method of MouseEvent returns:
A) the x coordinate of the touch within the screen.
B) the x coordinate of the touch within the View where the touch occurred.
C) the x coordinate of the top of the screen.
D) the x coordinate of the top of the View where the touch occurred.
A) the x coordinate of the touch within the screen.
B) the x coordinate of the touch within the View where the touch occurred.
C) the x coordinate of the top of the screen.
D) the x coordinate of the top of the View where the touch occurred.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
15
We can enable the user to move a TextView.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
16
One of the things we must do to handle touch events is create an object of a class that __________________ View.OnTouchListener.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
17
One of the things we must do to handle touch events is register an object of a class that implements View.OnTouchListener on one or more __________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
18
The public field of the ViewGroup.MarginLayoutParams class defining a bottom margin is __________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
19
The public field of the ViewGroup.MarginLayoutParams class defining a top margin is __________________.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
20
The __________________ interface notifies us of double taps or confirmed single taps.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
21
The onDown method of the GestureDetector.OnGestureListener interface is called on a(n) __________________ action when a touch occurs.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck
22
If a TextView has not been displayed yet, it is possible to retrieve measurements about its width and height using the __________________ method.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 22 في هذه المجموعة.
فتح الحزمة
k this deck

