This file contains 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
// ==UserScript== | |
// @name Type Guard | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Chuang Yu | |
// @match *://*/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com | |
// @grant none | |
// ==/UserScript== |
This file contains 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.draw.drawWithCache | |
import androidx.compose.ui.geometry.CornerRadius | |
import androidx.compose.ui.geometry.Offset | |
import androidx.compose.ui.geometry.Rect | |
import androidx.compose.ui.geometry.Size | |
import androidx.compose.ui.graphics.BlendMode | |
import androidx.compose.ui.graphics.Brush | |
import androidx.compose.ui.graphics.Color | |
import androidx.compose.ui.graphics.ColorFilter | |
import androidx.compose.ui.graphics.ImageBitmap |
This file contains 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.content.res.ColorStateList | |
import android.content.res.TypedArray | |
import android.graphics.drawable.Drawable | |
import androidx.annotation.StyleableRes | |
import androidx.appcompat.content.res.AppCompatResources | |
/** | |
* Utility methods for extracting [ColorStateList]s and [Drawable]s from a [TypedArray]. |
This file contains 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 (C) 2018 Square, Inc. | |
* | |
* 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 | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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
tasks.withType<Jar> { | |
manifest { | |
attributes["Main-Class"] = "com.example.MainKt" | |
} | |
} |
This file contains 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/dexlayout/Android.bp b/dexlayout/Android.bp | |
index 33ba58f..f3b2a7e 100644 | |
--- a/dexlayout/Android.bp | |
+++ b/dexlayout/Android.bp | |
@@ -74,6 +74,13 @@ cc_defaults { | |
], | |
} | |
+cc_defaults { | |
+ name: "compact_dex_converter_defaults", |
This file contains 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 ProjectUtils { | |
/*** | |
* Force MediaScanner to update its media database for recently added files. | |
* @param context the calling context. | |
* @param filePathForScan File path which will request the media scanner to rescan and add it | |
* to the media database. | |
*/ | |
public static void forceUpdateMediaScanner(Context context, String filePathForScan) { | |
if (context != null) { | |
new SingleMediaScanner(context, new File(filePathForScan)); |
This file contains 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 (c) 2018 Zhang Hai <[email protected]> | |
* | |
* 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 | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains 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
@file:Suppress("PackageDirectoryMismatch") // root package looks great when importing, ie. `import exhaustive` | |
/** | |
* Allows requiring an exhaustive mapping in a `when` block when used with the [rangeTo] operator. | |
* @sample [exhaustive_when_example] | |
*/ | |
@Suppress("ClassName") // lowercase because it should look like a keyword | |
object exhaustive { |
This file contains 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.v7.widget.RecyclerView | |
/** | |
* @author drakeet | |
*/ | |
class QuickReturnDelegate(private val scrollSlop: Int = 12) : RecyclerView.OnScrollListener() { | |
private lateinit var callback: (hide: Boolean) -> Unit | |
private var scrollY: Int = 0 |
NewerOlder