Skip to content

Instantly share code, notes, and snippets.

View AfzalivE's full-sized avatar

Afzal Najam AfzalivE

View GitHub Profile
@AfzalivE
AfzalivE / private ime options samsung keyboard.txt
Created September 25, 2023 21:42
Samsung Keyboard private IME options
customInputConnection,
customSymbols,
customSymbolsForCMSymbolKey,
customSymbolsForPeriodKey,
disableAllToolbarItems,
disableAmbiguousMode,
disableAutoCorrection,
disableBackspaceKey,
disableCandidateExpand,
disableClipboard,
@AfzalivE
AfzalivE / sideberry styles.css
Last active September 6, 2023 19:53
Sideberry collapsible styles
#root.root {--tabs-activated-shadow: box-shadow: 0 0 1px rgba(128, 128, 142, 0.9);;}
#root {
--tabs-font: 1rem -apple-system;
--tabs-count-font: .625rem -apple-system;
--bookmarks-bookmark-font: .875rem -apple-system;
--bookmarks-folder-font: 9pt -apple-system;
--nav-btn-width: 30px;
--nav-btn-height: 30px;
--tabs-inner-gap: 8px;
}
@AfzalivE
AfzalivE / sidebery styles.css
Created September 6, 2023 13:40
Sidebery my first settings
#root.root {--tabs-font: 1rem -apple-system;}
#root.root {--tabs-indent: 12px;}
#root.root {--tabs-inner-gap: 5px;}
#root.root {--tabs-count-font: 0.625rem -apple-system;}
#root.root {--general-border-radius: 8px;}
#root.root {--d-fast: 0.1s;}
@AfzalivE
AfzalivE / userChrome.css
Created September 6, 2023 13:38 — forked from lucaspar/userChrome.css
Stylesheets for collapsible vertical tabs for Firefox. Tabs expand horizontally when hovered, similar to Edge's.
/*
How to use this CSS:
0. Install the Sidebery extension: https://addons.mozilla.org/en-US/firefox/addon/sidebery/.
1. In Sidebery settings:
a. Set the title preface must as "[S] " (without quotes).
This is used by CSS rules below to identify when Sidebery is active.
b. Set 'Tabs tree structure' to false -- this stylesheet doesn't adapt to
multiple tab levels, but feel free to tweak it!
c. Copy and paste the "SIDEBERY STYLES" section below as a custom
@AfzalivE
AfzalivE / NumberPicker.kt
Created August 20, 2023 01:10
AndroidView NumberPicker type in test
import android.widget.NumberPicker
import android.widget.Toast
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.semantics.setText
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.viewinterop.AndroidView
@AfzalivE
AfzalivE / Readme.md
Last active February 6, 2023 15:49
Figma to Drawable folder Transnomino recipe

This is a recipe for Transnomino app on Mac to rename and move files exported from Figma to an Android app's drawable folders.

There's one assumption here that layer names in figma are something like Light/Layer Name and Dark/Layer Name. Although, I imagine it'd be trivial to change it to something that's separated by a character other than /.

In Figma, the layer suffixes needs to be either

  1. HDPI, MDPI, XHDPI, XXHDPI, XXXHDPI
  2. -hdpi, -mdpi, -xhdpi, -xxhdpi, -xxxhdpi

If using #2, disable the 3rd step (Hyphenate suffix).

@AfzalivE
AfzalivE / CustomTestRunner.kt
Last active August 3, 2022 22:30
Disable soft-keyboards for tests
import androidx.test.runner.AndroidJUnitRunner
class CustomJunitRunner : AndroidJUnitRunner() {
private var enabledImes = emptyList<String>()
override fun callApplicationOnCreate(app: Application?) {
super.callApplicationOnCreate(app)
enabledImes = getEnabledImes()
disableSoftKeyboards(enabledImes)
@AfzalivE
AfzalivE / ComposeLayoutPreviewHelper.kt
Last active February 9, 2023 14:37
AbstractComposeView layout preview helper
package com.yourpackage
import android.os.Bundle
import android.view.View
import androidx.compose.runtime.MonotonicFrameClock
import androidx.compose.runtime.PausableMonotonicFrameClock
import androidx.compose.runtime.Recomposer
import androidx.compose.ui.InternalComposeUiApi
import androidx.compose.ui.platform.AbstractComposeView
import androidx.compose.ui.platform.AndroidUiDispatcher
@AfzalivE
AfzalivE / androidx-M1.patch
Last active February 12, 2022 03:42
androidx-on-M1-Mac
This patch allows building androidx-main on a Mac with M1 Apple Silicon.
After following the instructions in the repository (https://github.com/androidx/androidx/blob/androidx-main/README.md)
to sync the repo, edit the patch below to replace YOUR_JDK_FOLDER_HERE with an arm64 JDK path, then apply this patch.
In prebuilts/androidx/external/com/google/protobuf folder, for the dependencies that
needs to be updated to version 3.19.4 because it supports aarch64,
create a 3.19.4 folder inside their folders. Here are the ones that need updating:
. protobuf-bom
. protobuf-java
. protobuf-java-util
@AfzalivE
AfzalivE / ands
Created July 6, 2021 18:35
Android Studio terminal launcher
#!/bin/bash
# check for where the latest version of IDEA is installed
STUDIOS=()
STUDIO_NAMES=()
while read line
do
studio=`echo $line`
STUDIOS+=("${studio}")