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
| @Composable | |
| fun InteractiveCanvas(maxWidth: Int, maxHeight: Int) { | |
| val random = remember { Random.Default } | |
| var touchPosition by remember { mutableStateOf(Offset.Unspecified) } | |
| val heartSize = 75F | |
| val heartPath = createHeartPath(heartSize) | |
| val heartOffsets = remember { mutableStateListOf<Offset>() } | |
| val heartColors = remember { mutableStateListOf<Color>() } | |
| if (heartOffsets.isEmpty()) { |
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
| @Composable | |
| fun DraggableLineDrawing() { | |
| Box(modifier = Modifier.fillMaxSize()) { | |
| val buttonSize = 50.dp | |
| val buttonRadius = buttonSize.value / 2 | |
| val buttonsState = remember { List(10) { mutableStateOf(Offset.Zero) } } | |
| val explodedState = remember { mutableStateListOf<Boolean>().apply { repeat(10) { add(false) } } } | |
| val secondaryColor = MaterialTheme.colorScheme.secondary | |
| val brush = Brush.horizontalGradient(listOf(Color.Red, Color.Blue)) | |
| val brushSecond = Brush.horizontalGradient(listOf(Color.Gray, Color.Black)) |
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
| package com.sam016.vsflatomation.service.ble; | |
| import java.util.HashMap; | |
| import java.util.UUID; | |
| public class AllGattCharacteristics { | |
| private static HashMap<String, String> attributes = new HashMap(); | |
| static { | |
| attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name"); |
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
| package com.github.arekolek.diffutil | |
| import android.arch.lifecycle.* | |
| import android.os.Bundle | |
| import android.support.v7.app.AppCompatActivity | |
| import android.support.v7.util.DiffUtil | |
| import android.support.v7.widget.RecyclerView | |
| import android.util.Log | |
| import android.view.LayoutInflater | |
| import android.view.View |
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 android.content.Context; | |
| import android.net.Uri; | |
| import android.util.Log; | |
| import com.fernandocejas.frodo.annotation.RxLogObservable; | |
| import com.squareup.okhttp.OkHttpClient; | |
| import com.squareup.okhttp.Request; | |
| import com.squareup.okhttp.Response; | |
| import okio.BufferedSink; | |
| import okio.BufferedSource; | |
| import okio.Okio; |
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 org.junit.After; | |
| import org.junit.Before; | |
| import rx.Scheduler; | |
| import rx.android.plugins.RxAndroidPlugins; | |
| import rx.android.plugins.RxAndroidSchedulersHook; | |
| import rx.schedulers.Schedulers; | |
| /** | |
| * JUnit Tests. | |
| * |
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
| apply plugin: 'com.android.application' | |
| apply plugin: 'android-apt' | |
| android { | |
| compileSdkVersion versions.compileSdk | |
| buildToolsVersion versions.buildTools | |
| defaultConfig { | |
| applicationId "samples.linhtruong.com.ui_reactive_rxjava_realm" | |
| minSdkVersion versions.minSdk |
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 android.content.Context; | |
| import android.util.AttributeSet; | |
| import android.widget.EditText; | |
| /** | |
| * Original: | |
| * An EditText, which notifies when something was cut/copied/pasted inside it. | |
| * @author Lukas Knuth | |
| * @version 1.0 | |
| * |
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 static java.lang.Math.acos; | |
| import static java.lang.Math.cos; | |
| import static java.lang.Math.sin; | |
| /** | |
| * Calculate distance between coordinates. | |
| */ | |
| public class DistanceCalculator { | |
| static double PI_RAD = Math.PI / 180.0; |
NewerOlder