java – does not work check if the button is pressed

I try to create a button that only works when you press and hold it: if you press and move the button to another area, it will stop working and if you tap another area and hold your finger down, point it at the button, it will work. On stackoverflow.com, a user responded and wrote onTouchListener:

btn.setOnTouchListener (new View.OnTouchListener () {
@Override
public boolean onTouch (View v, MotionEvent event) {
if (v.getLeft () <= event.getX () && v.getRight ()> = event.getX () && v.getTop () <= event.getY () && v.getBottom ()> = event. getY ()) {
if (event.getAction () == MotionEvent.ACTION_DOWN)
Log.d ("LOG", "pressed");
if (event.getAction () == MotionEvent.ACTION_UP)
Log.d ("LOG", "published");
if (event.getAction () == MotionEvent.ACTION_MOVE)
Log.d ("LOG", "in motion");
}
other
{
Log.d ("LOG", "out of area");
}
returns false;
}
});

I tried this code, but it did not work: Code Logs

By the way, if you do not use this check if (v.getLeft () <= event.getX () && v.getRight ()> = event.getX () && v.getTop () <= event.getY () && v .getBottom ()> = event.getY ()) {, the button works, but not as it should be (without checking the button presses)

gmail – I pressed the selection button and all my emails are gone. How can I get them back or where are they?

Battery Exchange Network

The Stack Exchange network includes 176 question and answer communities, including Stack Overflow, the largest and most reliable online community on which developers can learn, share knowledge and build their careers.

Visit Stack Exchange

automation – Automate Mouseclick when a keyboard button is pressed

Battery Exchange Network

The Stack Exchange network includes 176 question and answer communities, including Stack Overflow, the largest and most reliable online community on which developers can learn, share knowledge and build their careers.

Visit Stack Exchange

user interface – Add a widget on the mouse pressed in the GUI – kivy python

I have problems adding and displaying an image to the layout each time I press the screen using the mouse.

Myszka class (ClickAndGo, Widget):

def on_touch_down (auto, touch):
Great (). build ()
flaga_path = os.path.join (self.img_path, "test.png")
x, y = touch.pos
self.flaga = Image (source = float_path, size_hint = (None, None), size = (64, 64),
pos = (round (x, 1), round (y, 1)))
self.camlayout.add_widget (self.flaga)
print (touch.pos)
  • Current results:
    only the touch position is printed, the image has not been displayed.
  • Expected results:
    The image should have been displayed each time the mouse is lowered.

ios – The button does not hide when the button is pressed

I arrive at a problem where I have a button called checkInbtn where I want to hide it when you press a button. But for some reason, the checkInbtn appears when my other button appears. I've tried debugging, and nothing useful comes up. Anyone can help me solve this problem. Thanks for the help.

import UIKit

CheckInViewController class: UIViewController {
@IBOutlet low var checkInbtn: UIButton!
@IBOutlet low var timerLeft: UILabel!
@IBOutlet low checkOutBtn: UIButton!

var seconds = 0
var timer = Timer ()
var isTimerRunning = false

replace func viewDidLoad () {
super.viewDidLoad ()

checkOutBtn.isHidden = true
timerLeft.isHidden = true
}

@IBAction func checkInBtnWasTapped (_ sender: N any) {
runTimer ()

checkOutBtn.isHidden = false
timerLeft.isHidden = false

checkInbtn.isHidden = true
}

@IBAction func checkOutBtnWasTapped (_ sender: N any) {
if timer! = nil {
timer.invalidate ()
}

checkInbtn.isHidden = true
checkOutBtn.isHidden = true
timerLeft.isHidden = true

let alert = UIAlertController (title: "Preview", message: "You have been checked out", preferredStyle: .alert)

alert.addAction (UIAlertAction (title: "OK", style: .default, manager: nil))

self.present (alert, animated: true)
}

func runTimer () {
timer = Timer.scheduledTimer (timeInterval: 1, target: self, selector: (#selector (CheckInViewController.updateTimer))), userInfo: nil, repeats: true
}

@objc func updateTimer () {
seconds + = 1
timerLeft.text = " (seconds)"
}
}

In a python calculator, how do I create a button that, when pressed, enlarges the letter of all buttons?

I need all the letters to increase, including the same button.
And then a button that does the opposite process: decreases the size of the sources.

macbook – "t" key still pressed on mac

For some reason, my Mac keyboard still thinks that the "t" key is still depressed. However, as you can see, I can still type the letter t, but its output is delayed compared to the other keys. I think this is a software bug because the key still works well, but on some pages, the t key is simply spammed. Curiously, shift + t will not give me a capital t, but all the other letters work well (and my capital lock has been converted to a backspace, so I can not test it (by choice)). this has already occurred before, but usually disappears after a reboot, but this time, a reboot did not help.

Edit: currently on Macbook Air (1 generation ago)

android – unknown ACTION of this NavController when the back button is pressed

I'm implementing the Navigation component in my project in Java.
I have 1 activity and several fragments. My first fragment (login) performs some validations on the employee information and redirects you to the fragment of the menu.

loginViewModel.statusAsignacion.observe (this, loginResult -> {
Log.d (TAG, "result =" + loginResult);
binding.textViewLoginError.setText (loginResult);
if (loginResult.equals (ASIGNACION_EXITOSA)) {
NavHostFragment.findNavController (this) .navigate (R.id.action_loginFragment_to_menuFragment); // this is line 92
}
});

The animation is done correctly and I enter the menu without problems, but when I press the back button, I get the error navigation destination xxxxxx: id / action_loginFragment_to_menuFragment is unknown for this NavController.

java.lang.IllegalArgumentException: navigation destination xxxxx: id / action_loginFragment_to_menuFragment is unknown for this NavController.
at androidx.navigation.NavController.navigate (NavController.java:803)
at androidx.navigation.NavController.navigate (NavController.java:744)
at androidx.navigation.NavController.navigate (NavController.java:730)
at androidx.navigation.NavController.navigate (NavController.java:718)
at com.wsircam.adn.mvvm.app.login.LoginFragment.lambda $ onViewCreated $ 1 (LoginFragment.java:92)

In my navigation graph, the action is defined.



    


unit – When the motion button is pressed, the shape of the character changes and always moves in the left direction

have a good day. When you press the motion button, the shape of the character changes and always moves in the left direction.

Why does this happen and what is the solution?

enter the description of the image here

enter the description of the image here

Press two buttons to move to the left and the shape changes.

using System.Collections;
using System.Collections.Generic;
use UnityEngine;

Public class PlayerKontrol: MonoBehaviour {

float public karakterHizi = 8f, maxSurat = 4f;
Private Rigidbody2D myRigidbody;
Private animator myAnimator;


private bool solaGit, sagaGit;

empty Awake () {
myRigidbody = GetComponent ();
myAnimator = GetComponent ();

}

void FixedUpdate () {
if (solaGit) {

SolaGit ();
}

if (sagaGit) {

SagaGit ();
}
}

AyarlaSolaGit (bool solaGit)
{
this.solaGit = solaGit;
this.sagaGit =! solaGit;
}

public void HareketiDurdur () {
solaGit = sagaGit = false;
myAnimator.SetBool ("run", false);
}

void SolaGit () {

float Xdurdur = 0f;
float surat = Mathf.Abs (myRigidbody.velocity.x);

if (surat <maxSurat)
Xdurdur = -karakterHizi;

Vector3 yon = transform.localScale;
yon.x = -0.3f;
transform.localScale = yon;

myAnimator.SetBool ("run", true);

myRigidbody.AddForce (new Vector2 (Xdurdur, 0));

}

void SagaGit () {

float Xdurdur = 0f;
float surat = Mathf.Abs (myRigidbody.velocity.x);

if (surat <maxSurat)
Xdurdur = -karakterHizi;

Vector3 yon = transform.localScale;
yon.x = 0.3f;
transform.localScale = yon;

myAnimator.SetBool ("run", true);

myRigidbody.AddForce (new Vector2 (Xdurdur, 0));

}

}

After installing lubuntu in my computer, I restarted it. He showed a black screen after startup. Then I pressed Ctrl + Alt + F1. So what should I do?

![My pc::- pentium 4, 2gb ram, 32 bit, currently no OS]
After installing Lubuntu 14.04.5 from bootable usb, I found myself stuck after startup. I pressed the CTRL + ALT + F1 key combination. But being beginner, I do not know what to do ?? Plz help me !!
Text displayed ——-

lubuntu @ lubuntu: ~ $