ontouch

Chrome on android: touchevent not work on a-entity click

删除回忆录丶 提交于 2021-02-11 14:02:39
问题 The problem of question is: click event via touch click on mobile from VR mode not work from android Chrome 79+. Otherwords touchstart event does not fired on entity from VR mode. Google Vr services are installed and enabled. The goal a-entity should be clickable in Chrome latest 79+ on user click (VR mode touch click from mobile) Links to whole code: here 2 config simple app: https://4dkly.csb.app/ (config: fuse 3.6sec; but click on entity does Not work from chrome vr) https://codesandbox.io

Touch event.getAction does not work under service class in android studio

笑着哭i 提交于 2021-01-12 06:30:32
问题 I developed an App to collect touch events under the foreground service class. The app has a main activity to input user's information (e.g., name and age). Then a foreground service starts to collect touch events, and a notification is launched to inform the user that the service is running. This is the main activity code public class MainActivity extends AppCompatActivity implements View.OnClickListener { @Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent; switch

Touch event.getAction does not work under service class in android studio

删除回忆录丶 提交于 2021-01-12 06:27:23
问题 I developed an App to collect touch events under the foreground service class. The app has a main activity to input user's information (e.g., name and age). Then a foreground service starts to collect touch events, and a notification is launched to inform the user that the service is running. This is the main activity code public class MainActivity extends AppCompatActivity implements View.OnClickListener { @Override public boolean onOptionsItemSelected(MenuItem item) { Intent intent; switch

Prevent Swiping of ViewPager2 when onTouch of inner view

家住魔仙堡 提交于 2020-04-30 11:44:54
问题 I have a ViewPager2 with a fragment inside, in the fragment, I have a custom view with certain touch logic that involves moving the finger. how do I prevent the ViewPager from swiping while the inner view intercepts the touch event? override fun onTouchEvent(event: MotionEvent?): Boolean { if (event?.action == MotionEvent.ACTION_DOWN || event?.action == MotionEvent.ACTION_MOVE) { //Do some stuff here } return true } while swiping this view the view pager still swipes to other pages. 回答1: Set

Prevent Swiping of ViewPager2 when onTouch of inner view

荒凉一梦 提交于 2020-04-30 11:44:06
问题 I have a ViewPager2 with a fragment inside, in the fragment, I have a custom view with certain touch logic that involves moving the finger. how do I prevent the ViewPager from swiping while the inner view intercepts the touch event? override fun onTouchEvent(event: MotionEvent?): Boolean { if (event?.action == MotionEvent.ACTION_DOWN || event?.action == MotionEvent.ACTION_MOVE) { //Do some stuff here } return true } while swiping this view the view pager still swipes to other pages. 回答1: Set

How to detect swipe between views to make path across them in android java?

末鹿安然 提交于 2020-04-07 07:35:28
问题 I am trying to make game for which there are buttons with alphabets and if user swipes over them then it should detect the views as well as make a line across them. I searched many tutorials, examples and questions but unable to get the idea. I have attached image to help understand the question. Here are the codes: MainActivity.java package com.example.detecttouch; import androidx.appcompat.app.AppCompatActivity; import android.graphics.Rect; import android.os.Bundle; import android.util.Log

How to Pass foreground touch to background touch in between layout

断了今生、忘了曾经 提交于 2020-01-07 06:57:19
问题 I have a requirement where i am having in foreground there is LinearLayout and in background relativelayout is there, foreground is for swiping and background is for simple tap/touch but not swipe, and onTouch() is in foreground and on Tapping at foreground user should be able to go background relativelayout. 来源: https://stackoverflow.com/questions/32318705/how-to-pass-foreground-touch-to-background-touch-in-between-layout

Camera Preview Session setRepeatingRequest focus issue, focuses only first time ontouch

怎甘沉沦 提交于 2019-12-25 16:09:36
问题 i have a textureview where i have implemented ontouch listener, i want when i touch the display to be able to focus, but there's a problem when setting setRepeatingRequest to build the display, it focuses only first time when i touch and after that i can touch 100x but still it has no effect, i want to enable flash on focusing and on capture but the flash stays on all the time as the camera does not focus, please help me, i'm stuck for 5 days at this task ! Here is my code : /

Camera Preview Session setRepeatingRequest focus issue, focuses only first time ontouch

大兔子大兔子 提交于 2019-12-25 16:09:15
问题 i have a textureview where i have implemented ontouch listener, i want when i touch the display to be able to focus, but there's a problem when setting setRepeatingRequest to build the display, it focuses only first time when i touch and after that i can touch 100x but still it has no effect, i want to enable flash on focusing and on capture but the flash stays on all the time as the camera does not focus, please help me, i'm stuck for 5 days at this task ! Here is my code : /

Swift UIButton background change on OnTouchUp and OnTouchDown?

人走茶凉 提交于 2019-12-25 03:44:28
问题 I am using swift and in my app there is a UIButton, for which I want to change background color and border color on key down and key up. 回答1: You can just create two functions and connect them to appropriate events. Like this: @IBAction func up(){ myButton.backgroundColor = UIColor.whiteColor() } @IBAction func down(){ myButton.backgroundColor = UIColor.blackColor() } Now just connect them in interface builder. Function up() connect to Touch Up Inside and Touch Up Outside. Function down() to