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.pacakge; | |
import android.net.Uri; | |
import com.koushikdutta.async.DataEmitter; | |
import com.koushikdutta.async.DataSink; | |
import com.koushikdutta.async.Util; | |
import com.koushikdutta.async.callback.CompletedCallback; | |
import com.koushikdutta.async.http.AsyncHttpClient; | |
import com.koushikdutta.async.http.AsyncHttpRequest; | |
import com.koushikdutta.async.http.AsyncHttpResponse; |
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
PutDataMapRequest putDataMapReq = PutDataMapRequest.create(PATH); | |
DataMap dataMap = putDataMapReq.getDataMap(); | |
// I checked and the Asset gets created correctly | |
Asset asset = Asset.createFromUri(Uri.parse(uri)); | |
dataMap.putAsset(<some_key>, asset); | |
PutDataRequest putDataReq = putDataMapReq.asPutDataRequest(); | |
Wearable.DataApi.putDataItem(apiClient, putDataReq).setResultCallback(new ResultCallback<DataApi.DataItemResult>() { | |
@Override | |
public void onResult(DataApi.DataItemResult dataItemResult) { | |
Status status = dataItemResult.getStatus(); |
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.support.annotation.Nullable; | |
import android.text.TextUtils; | |
import android.util.Log; | |
import com.google.android.exoplayer.C; | |
import com.google.android.exoplayer.upstream.DataSpec; | |
import com.google.android.exoplayer.upstream.HttpDataSource; | |
import com.google.android.exoplayer.upstream.TransferListener; | |
import com.google.android.exoplayer.util.Assertions; | |
import okhttp3.Headers; | |
import okhttp3.OkHttpClient; |
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
class FlipOnAccess( | |
private val initialValue: Boolean = false, | |
private val onlyFirstAccess: Boolean = false | |
) : ReadOnlyProperty<Any?, Boolean> { | |
private val flipper = AtomicInteger(1) | |
private val Int.isEven get() = and(1) == 0 | |
override fun getValue(thisRef: Any?, property: KProperty<*>) = | |
with(flipper.getAndIncrement()) { |
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 androidx.compose.ui.input.key.Key | |
import androidx.compose.ui.input.key.KeysSet | |
import androidx.compose.ui.input.key.ShortcutsBuilderScope | |
import androidx.compose.ui.input.key.plus | |
import androidx.compose.ui.text.TextRange | |
import java.awt.Toolkit | |
import java.awt.datatransfer.DataFlavor | |
import java.awt.datatransfer.StringSelection | |
import java.awt.event.KeyEvent | |
import java.util.Stack |
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.gradle.api.DefaultTask | |
import org.gradle.api.Project | |
import org.gradle.api.artifacts.Configuration | |
import org.gradle.api.artifacts.ConfigurationContainer | |
import org.gradle.api.artifacts.Dependency | |
import org.gradle.api.artifacts.ExternalModuleDependency | |
import org.gradle.api.artifacts.ProjectDependency | |
import org.gradle.api.artifacts.dsl.DependencyHandler | |
import org.gradle.api.artifacts.result.ResolvedArtifactResult | |
import org.gradle.api.artifacts.result.UnresolvedArtifactResult |