Android, setting background color of button loses ripple effect

You can add the ripple effect & background color with an additionnal ripple drawable: your layout : <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:orientation=”vertical” android:layout_width=”match_parent” android:layout_height=”match_parent”> <Button android:id=”@+id/button_connect” android:layout_width=”fill_parent” android:layout_height=”wrap_content” android:layout_marginTop=”20dip” android:fontFamily=”sans-serif” android:text=”Connect” android:background=”@drawable/ripple” android:textColor=”#FFFFFF” android:textSize=”18sp” /> </LinearLayout> ripple.xml (this is where you can add background color in addition to the ripple effect) : <?xml version=”1.0″ … Read more

In unity3D, Click = Touch?

Short answer: yes, touch may be handled with Input.GetMouseButtonDown(). Input.GetMouseButtonDown(), Input.mousePosition, and associated functions work as tap on the touch screen (which is kind of odd, but welcome). If you don’t have a multi-touch game, this is a good way to keep the in-editor game functioning well while still keeping touch input for devices. (source: … Read more

Cancel click event in the mouseup event handler

Use the event capture phase Put an element around the element you want to cancel the click event for, and add a capture event handler to it. var btnElm = document.querySelector(‘button’); btnElm.addEventListener(‘mouseup’, function(e){ console.log(‘mouseup’); window.addEventListener( ‘click’, captureClick, true // <– This registeres this listener for the capture // phase instead of the bubbling phase! ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)