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.kazukinr.android.ui.sample | |
import androidx.lifecycle.DefaultLifecycleObserver | |
import androidx.lifecycle.LifecycleOwner | |
import androidx.lifecycle.ViewModel | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.SupervisorJob | |
import kotlinx.coroutines.cancel | |
import java.io.Closeable |
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
{ | |
"@@locale": "es", | |
"helloWorld": "Hola Mundo", | |
"hello": "Hola $world", | |
"greeting": "$hello $world" | |
"helloWorlds": "{count,plural, =0{Hola}=1{Hola mundo}=2{Hola dos mundos}few{Hola {count} mundos}many{Hola todos {count} mundos}other{Hola otros {count} mundos}}", | |
} |
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
{ | |
"@@locale": "en", | |
"helloWorld": "Hello World", | |
"@helloWorld": { | |
"description": "The conventional newborn programmer greeting" | |
}, | |
"hello": "Hello {world}", | |
"@hello": { |
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
var orginalCallback; | |
void main() { | |
runApp(...); | |
orginalCallback = window.onReportTimings; | |
window.onReportTimings = onReportTimings; | |
} | |
const maxframes = 60; | |
final lastFrames = ListQueue<FrameTiming>(maxframes); |
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
// ignore_for_file: public_member_api_docs | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/widgets.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:provider/single_child_widget.dart'; | |
/// A provider that exposes a [ValueNotifier] in two independent pieces. | |
/// | |
/// [StoreProvider] will expose both [ValueNotifier] and [ValueNotifier.value] independently | |
/// to its dependents. |
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 kotlinx.coroutines.Dispatchers | |
import kotlinx.coroutines.test.TestCoroutineDispatcher | |
import kotlinx.coroutines.test.TestCoroutineScope | |
import kotlinx.coroutines.test.resetMain | |
import kotlinx.coroutines.test.setMain | |
import org.junit.jupiter.api.extension.AfterAllCallback | |
import org.junit.jupiter.api.extension.AfterEachCallback | |
import org.junit.jupiter.api.extension.BeforeAllCallback | |
import org.junit.jupiter.api.extension.ExtendWith | |
import org.junit.jupiter.api.extension.ExtensionContext |
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
diff --git a/app/build.gradle b/app/build.gradle | |
index d1b7792..dd96f56 100644 | |
--- a/app/build.gradle | |
+++ b/app/build.gradle | |
@@ -47,3 +47,15 @@ dependencies { | |
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4' | |
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4' | |
} | |
+ | |
+ |
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
public class OwnPushService extends FirebaseMessagingService { | |
private List<FirebaseMessagingService> messagingServices = new ArrayList<>(2); | |
public GCPushService() { | |
messagingServices.add(new AirshipFirebaseMessagingService()); | |
messagingServices.add(new TLFirebaseMessagingService()); | |
} |
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
fun encrypt(context:Context, strToEncrypt: String): ByteArray { | |
val plainText = strToEncrypt.toByteArray(Charsets.UTF_8) | |
val keygen = KeyGenerator.getInstance("AES") | |
keygen.init(256) | |
val key = keygen.generateKey() | |
saveSecretKey(context, key) | |
val cipher = Cipher.getInstance("AES/CBC/PKCS5PADDING") | |
cipher.init(Cipher.ENCRYPT_MODE, key) | |
val cipherText = cipher.doFinal(plainText) |
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
fun <T> Class<Any>.invoke(methodName: String , vararg args: Pair<Class<*>, *>): T? { | |
return try { | |
getMethod(methodName, *(args.map { it.first }.toTypedArray())) | |
?.invoke(this, *(args.map { it.second }.toTypedArray())) as? T | |
} catch (e: Throwable) { | |
e.printStackTrace() | |
null | |
} | |
} |