This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.util.function.Function; | |
| import static java.lang.Math.*; | |
| // https://easings.net/ | |
| // https://gist.github.com/dev-hydrogen/21a66f83f0386123e0c0acf107254843 | |
| public enum Easing { | |
| easeInSine(x -> 1 - cos(x * PI) / 2), | |
| easeOutSine(x -> sin(x * PI) / 2), | |
| easeInOutSine(x -> -(cos(PI * x) - 1) / 2), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Create a BroadcastReceiver for ACTION_FOUND and ACTION_DISCOVERY_FINISHED | |
| private final BroadcastReceiver mDeviceDiscoverReceiver = new BroadcastReceiver() { | |
| int cnt = 0; | |
| public void onReceive(Context context, Intent intent) { | |
| String action = intent.getAction(); | |
| // When discovery finds a device | |
| if (BluetoothDevice.ACTION_FOUND.equals(action)) { | |
| // Get the BluetoothDevice object from the Intent | |
| BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE); |