ViewCompositionStrategy |
Description |
|---|---|
DisposeOnDetachedFromWindow |
The Composition will be disposed when the underlying ComposeView is detached from the window. Has since been superseded by DisposeOnDetachedFromWindowOrReleasedFromPool.Interop scenario: * ComposeView whether it’s the sole element in the View hierarchy, or in the context of a mixed View/Compose screen (not in Fragment). |
DisposeOnDetachedFromWindowOrReleasedFromPool (Default) |
Similar to DisposeOnDetachedFromWindow, when the Composition is not in a pooling container, such as a RecyclerView. If it is in a pooling container, it will dispose when either the pooling container itself detaches from the window |
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.Intent | |
| import android.graphics.PixelFormat | |
| import android.os.IBinder | |
| import android.view.Gravity | |
| import android.view.WindowManager | |
| import androidx.compose.foundation.gestures.detectDragGestures | |
| import androidx.compose.foundation.layout.Box | |
| import androidx.compose.foundation.layout.BoxScope | |
| import androidx.compose.runtime.Composable | |
| import androidx.compose.runtime.getValue |
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
| #!/usr/bin/env bash | |
| shopt -s nullglob | |
| lastgroup="" | |
| for g in `find /sys/kernel/iommu_groups/* -maxdepth 0 -type d | sort -V`; do | |
| for d in $g/devices/*; do | |
| if [ "${g##*/}" != "$lastgroup" ]; then | |
| echo -en "Group ${g##*/}:\t" | |
| else | |
| echo -en "\t\t" |
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.os.Bundle | |
| import androidx.lifecycle.Lifecycle | |
| import androidx.lifecycle.LifecycleRegistry | |
| import androidx.savedstate.SavedStateRegistry | |
| import androidx.savedstate.SavedStateRegistryController | |
| import androidx.savedstate.SavedStateRegistryOwner | |
| internal class MyLifecycleOwner : SavedStateRegistryOwner { | |
| private var mLifecycleRegistry: LifecycleRegistry = LifecycleRegistry(this) | |
| private var mSavedStateRegistryController: SavedStateRegistryController = SavedStateRegistryController.create(this) |
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
| #!/bin/bash | |
| export __NV_PRIME_RENDER_OFFLOAD=1 | |
| export __GLX_VENDOR_LIBRARY_NAME=nvidia | |
| export __VK_LAYER_NV_optimus=NVIDIA_only | |
| export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json | |
| exec "$@" |
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 'dart:math'; | |
| import 'package:flutter/material.dart'; | |
| //Colors | |
| Color crossColor = const Color(0xFF1ABDD5); | |
| Color circleColor = const Color(0xFFD8B9FA); | |
| Color accentColor = const Color(0xFF90A4AE); | |
| void main() => runApp(MyApp()); |
The android emulator doesn't support all usb devices because they are disabled in the kernel. So we need to build it with another configuration. My goal was to build the same version as it was before, but with just configuration modifications.
Start the emulator without modifications, go into
Configuration > System > About emulated device > Android version
You should not use the Open SSH client that comes with Git for Windows. Instead, Windows 10 has its own implementation of Open SSH that is integrated with the system. To achieve this:
- Start the
ssh-agentfrom Windows Services:
- Type
Servicesin theStart MenuorWin+Rand then typeservices.mscto launch the Services window; - Find the
OpenSSH Authentication Agentin the list and double click on it; - In the
OpenSSH Authentication Agent Propertieswindow that appears, chooseAutomaticfrom theStartup type:dropdown and clickStartfromService status:. Make sure it now saysService status: Running.
- Configure Git to use the Windows 10 implementation of OpenSSH by issuing the following command in Powershell:
git config --global core.sshCommand C:/Windows/System32/OpenSSH/ssh.exe
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
| #!/bin/bash | |
| for d in $(find /sys/kernel/iommu_groups/ -type l | sort -n -k5 -t/); do | |
| n=${d#*/iommu_groups/*}; n=${n%%/*} | |
| printf 'IOMMU Group %s ' "$n" | |
| lspci -nns "${d##*/}" | |
| done; |
This will require only one dependency, and one line added to your package.json and it's super fast.
- Create an app wih create-react-app.
- Install
node-sass. - Create your base sass file inside
src/sass. - Add a new script to package json that will watch the file, process sass and compile it into
src/css. - Include the compiled css into React via
require, this way your app will reload whenever the new css is compiled. - ran the new script along with
npm start.
NewerOlder