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
#!/bin/bash | |
# Snippet from https://github.com/girst/hardpass-sendHID/blob/master/README.md . In which, the following notice was left: | |
# this is a stripped down version of https://github.com/ckuethe/usbarmory/wiki/USB-Gadgets - I don't claim any rights | |
modprobe libcomposite | |
cd /sys/kernel/config/usb_gadget/ | |
mkdir -p g1 | |
cd g1 | |
echo 0x1d6b > idVendor # Linux Foundation |
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 com.android.build.gradle.internal.tasks.factory.dependsOn | |
plugins { | |
id("com.android.application") | |
jacoco | |
} | |
// Register the main JaCoCo task to later depend on the per-variant tasks | |
val jacocoTestReport = tasks.register("jacocoTestReport") |
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
/** | |
* A [WindowInsetsAnimation.Callback] and [OnApplyWindowInsetsListener] for nicely handling IME animations. | |
* | |
* When the keyboard is opened and closed, [onProgress] will be called with a float value between 0 and 1 that | |
* corresponds to how far the IME has opened, where 0 means the IME is closed and 1 means the IME is fully open. | |
* | |
* [windowInsetsListener] will be forwarded on by the implementation of [OnApplyWindowInsetsListener]. | |
* | |
* This approach is loosely based on the | |
* [WindowInsetsAnimation](https://github.com/android/user-interface-samples/tree/master/WindowInsetsAnimation) sample. |
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 2021 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 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 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
/** | |
* Remembers the [Size] in pixels of the window corresponding to the current window | |
* metrics. | |
*/ | |
@Composable | |
fun Activity.rememberWindowSize(): Size { | |
val configuration = LocalConfiguration.current | |
// WindowMetricsCalculator implicitly depends on the configuration |
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 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
enum class WindowSize { Compact, Medium, Expanded } | |
/** | |
* Remembers the [WindowSize] class for the window corresponding to the | |
* current window metrics. | |
*/ | |
@Composable |
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 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
val isExpandedScreen = windowSize == WindowSize.Expanded | |
ModalDrawer( | |
drawerContent = { | |
AppDrawer(/* ... */) | |
}, | |
// Only enable opening the drawer via gestures if the screen is not expanded |
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 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
@Composable | |
private fun InterestsTabRow( | |
selectedTabIndex: Int, | |
updateSection: (Sections) -> Unit, | |
tabContent: List<TabContent>, | |
isExpandedScreen: Boolean | |
) { |
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 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
@Composable | |
fun HomeRoute( | |
isExpandedScreen: Boolean, | |
isArticleOpen: Boolean, | |
selectedArticleId: String, | |
onSelectArticle: (String) -> Unit, | |
onArticleBackPress: () -> Unit, |
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 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
@Composable | |
fun HomeRoute( | |
isExpandedScreen: Boolean, | |
isArticleOpen: Boolean, | |
selectedArticleId: String, | |
onSelectArticle: (String) -> Unit, | |
onArticleBackPress: () -> Unit, |
OlderNewer