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
| /** | |
| * Creates a DataStore-to-DataStore migration that optionally remaps keys from old names to new names. | |
| * | |
| * Useful when migrating from a legacy DataStore to a new unified DataStore. | |
| * Unlike [SharedPreferencesMigration], this can read from another DataStore (Protocol Buffer format). | |
| * | |
| * This migration creates a temporary DataStore instance to read the legacy data, then closes it | |
| * automatically after migration completes. This prevents keeping unused DataStore instances open. | |
| * | |
| * @param context The application context |
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
| androidComponents.onVariants { variant -> | |
| generateCopyValuesTask(variant, "values-sr-rRS", "values-b+sr+Latn", "copySerbianValuesTaskFor") | |
| generateCopyValuesTask(variant, "values-es", "values-ca", "copySpanishValuesTaskFor") | |
| generateCopyValuesTask(variant, "values-iw", "values-he", "copyHebrewValuesTaskFor") | |
| } | |
| fun generateCopyValuesTask(variant: LibraryVariant, sourceLocale: String, targetLocale: String, taskName: String) { | |
| variant.sources.res?.let { source: SourceDirectories.Layered -> | |
| val assetCreationTask = | |
| project.tasks.register<CopyLocalizedResTask>("$taskName${variant.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
| import android.content.Context | |
| import android.util.AttributeSet | |
| import android.view.View | |
| import android.widget.LinearLayout | |
| import androidx.core.view.children | |
| import kotlin.math.roundToInt | |
| /** | |
| * Layout manager that will simply render everything inside in requested size | |
| * and then scale down it to fit the parent size. |
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
| /* | |
| * Copyright 2020 The Android Open Source Project | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * https://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
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 com.android.annotations.NonNull | |
| import com.android.build.api.artifact.BuildableArtifact | |
| import com.android.build.gradle.api.ApkVariant | |
| import com.android.build.gradle.api.ApkVariantOutput | |
| import com.google.common.io.Files | |
| import org.gradle.api.Action | |
| import org.gradle.api.DefaultTask | |
| import org.gradle.api.GradleException | |
| import org.gradle.api.Project |
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
| /** | |
| * View that can be used with this adapter must implement this interfaces. | |
| */ | |
| public interface ISettableView<T> { | |
| void setData(T item); | |
| void setEventListener(RecylerViewAdapter.ViewItemEventListener<T> listener); | |
| } |
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
| #include <Adafruit_NeoPixel.h> | |
| #ifdef __AVR__ | |
| #include <avr/power.h> | |
| #endif | |
| #define PIN 6 | |
| #define LEDS 9 | |
| #define SUBSTEPS 8 | |
| #define DELAY 75 |
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
| /* | |
| * Example of use ESP8266 library | |
| * https://github.com/Diaoul/arduino-ESP8266 | |
| * | |
| * Created: 12/30/2014 7:29:04 PM | |
| * Author: Tomáš Procházka | |
| */ | |
| #include <SoftwareSerial.h> | |
| //#include <AltSoftSerial.h> |
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
| /** | |
| * Will return version from properties file and replace -SNAPSHOT by GIT commit hash | |
| * to recognize origin commit for the every build. | |
| */ | |
| project.ext.evalVersionName = { | |
| def ideBuild = project.properties['android.injected.invoked.from.ide'] | |
| if (ideBuild) { | |
| logger.info("IDE build"); | |
| return "dev" | |
| } else if (project.VERSION.toUpperCase().contains("SNAPSHOT")) { |
NewerOlder