Skip to content

Instantly share code, notes, and snippets.

@oskuhsiu
oskuhsiu / RecyclerView.java
Created May 9, 2022 05:34 — forked from fcaldarelli/RecyclerView.java
Recycler view swipe actions
RecyclerViewSwipeHelper swipeHelper = new RecyclerViewSwipeHelper(this, listView) {
@Override
public void instantiateUnderlayButton(RecyclerView.ViewHolder viewHolder, List<UnderlayButton> underlayButtons) {
underlayButtons.add(new RecyclerViewSwipeHelper.UnderlayButton(
"Delete",
0,
Color.parseColor("#FF3C30"),
new RecyclerViewSwipeHelper.UnderlayButtonClickListener() {
@Override
public void onClick(int pos) {
repositories {
jcenter()
google()
maven { url "https://github.com/ChangYow/CYLogUtils/raw/master" }
maven { url "https://github.com/ChangYow/CYSerialCommLib/raw/master" }
maven { url "https://github.com/ChangYow/CYEchelonLib/raw/master" }
}
@oskuhsiu
oskuhsiu / AndroidScreenRecording
Created October 14, 2015 14:17 — forked from sahajamit/AndroidScreenRecording
To record the Android screen using the native adb commands and then downloading it from the device sd card to the local machine
#Check if an argument was supplied
if [ -z "$1" ]
then
echo "No argument supplied, please provide video name"
else
# start recording
adb shell screenrecord --bit-rate 6000000 /sdcard/$1.mp4 &
# Get its PID
PID=$!
@oskuhsiu
oskuhsiu / AndroidScreenRecording.sh
Created October 14, 2015 14:17 — forked from ZevEisenberg/AndroidScreenRecording.sh
Functions to take a screen video recording or screenshot on the currently-connected Android device and drop it on your Mac’s Desktop.
function androidScreenshot
{
# only do this if there is a device connected
adb shell exit 2>/dev/null
if [[ $? == 0 ]]; then
# Example filename: ~/Desktop/Android Screen 2013-09-11 12.32.16 PM.png
# perl line ending hacks from http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html
dateString=`date +"%Y-%m-%d at %I.%M.%S %p"`
fileName="Android Screen $dateString.png"
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Desktop/$fileName
@oskuhsiu
oskuhsiu / android-screen-gif.sh
Created October 14, 2015 14:17 — forked from sveinungkb/android-screen-gif.sh
Bash script to record screenshots on Android until interrupted, then assemble all screenshots to an animated GIF. Useful for demos etc.
#!/bin/sh
echo "Press Ctrl + C to stop recording"
PREFIX="Screenshot-$(date +%Y%m%d-%H%M%S)"
BASE="/sdcard/$PREFIX"
DELAY=300
trap ctrl_c INT
@oskuhsiu
oskuhsiu / adb-record.sh
Created October 14, 2015 14:13 — forked from logankoester/adb-record.sh
Record, merge, and accelerate Android screen capture
#!/usr/bin/env bash
# Repeatedly records Android screen capture to files 180 seconds in length
# until Ctrl+C, then pulls those files to the desktop, merges them into
# one video, generates an additional 8x speed version (*-8x.mp4) and cleans
# up the intermediary files.
# Depends on: ffmpeg, adb
# Usage: $ adb-record <name> # => ./name.mp4
@oskuhsiu
oskuhsiu / android-screen-to-gif.sh
Created October 14, 2015 14:13 — forked from lorenzos/android-screen-to-gif.sh
Captures screen from Android device via ADB and makes a 180x320 GIF
#!/bin/bash
# How to install:
# exo-open "http://developer.android.com/sdk/index.html#Other"
# sudo apt-get install libav-tools imagemagick
# wget https://gist.githubusercontent.com/lorenzos/e8a97c1992cddf9c1142/raw/android-screen-to-gif.sh
# chmod a+x android-screen-to-gif.sh
# Help message
function usage() {
@oskuhsiu
oskuhsiu / gist:3004e0c050258c24b6d0
Last active August 29, 2015 14:08
uncrustify config, obj-c, 2014/10/24 16
# Uncrustify 0.60
#
# General options
#
# The type of line endings
newlines = auto # auto/lf/crlf/cr
# The original size of tabs in the input