Skip to content

Instantly share code, notes, and snippets.

View SeniorZhai's full-sized avatar
🏠
Working from home

SeniorZhai SeniorZhai

🏠
Working from home
View GitHub Profile
@nickbutcher
nickbutcher / MainActivity.java
Last active August 20, 2021 16:15
A quick sample of the new physics-based animation library added in Support Library 25.3.0 docs: https://developer.android.com/reference/android/support/animation/package-summary.html output: https://twitter.com/crafty/status/842055117323026432
/*
* Copyright 2017 Google 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
@lopspower
lopspower / README.md
Last active May 17, 2024 04:22
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@neworld
neworld / howto.md
Last active September 15, 2020 11:32
How to make faster Android build without sacrificing new api lint check

Original solution sacrifices new api lint check.

Here my solution:

int minSdk = hasProperty('minSdk') ? minSdk.toInteger() : 16

apply plugin: 'com.android.application'

android {
 compileSdkVersion 23
@kyze8439690
kyze8439690 / ActivityLifecycleLogger.java
Last active January 12, 2016 03:57
Activity Lifecycle Logger, not support onActivityResult()
//call if(BuildConfig.DEBUG) registerActivityLifecycleCallbacks(new ActivityLifecycleLogger()) in your own Application class.
public class ActivityLifecycleLogger implements Application.ActivityLifecycleCallbacks {
private static final String TAG = "LifeCycleLogger";
private static final Class[] LOG_CYCLE_ACTIVITIES = new Class[] {
//add activities you want to log here
MainActivity.class
};
@wong2
wong2 / cmds.txt
Last active May 2, 2021 12:13
在任意聊天中输入。 [ ]表示后面要跟一个空格(可能还需要别的参数才能生效)
//wearversion
//wearlog
//wearvoiceinputenable
//wearvoiceinputdisable
//weargoogleapi
//assert
//pushassert
//uplog
//upcrash
//switchnotificationstatus
@nickbutcher
nickbutcher / 1 search_bar.xml
Last active March 26, 2022 10:03
Demonstrating morphing a search icon into a search field. To do this we use an AnimatedVectorDrawable (https://developer.android.com/reference/android/graphics/drawable/AnimatedVectorDrawable.html) made up of two paths. The first is the search icon (as a single line) the second is the horizontal bar. We then animate the 'trimPathStart' property …
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 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
http://www.apache.org/licenses/LICENSE-2.0
@cyndibaby905
cyndibaby905 / build_ffmpeg_android
Created August 5, 2014 07:14
Build ffmpeg on OS X 10.9
此处主要参考 http://harryhsu.logdown.com/posts/198416-build-ffmpeg-on-mac-os-109
根据我的编译过程做了适当修改
1. Download NDK
https://developer.android.com/tools/sdk/ndk/index.html
我下载的版本是android-ndk-r10,不同的版本在下面的build脚中本需要修改的地方大致相同.
2. Download ffmpeg source code
下载 ffmpeg(http://www.ffmpeg.org/download.html)
推荐 git clone git://source.ffmpeg.org/ffmpeg.git ffmpeg
@litao0621
litao0621 / MainActivity.java
Last active August 29, 2015 14:03
footertab pointer anim
package com.gitonway.footertab;
import android.app.Activity;
import android.graphics.Point;
import android.os.Bundle;
import android.view.Display;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TextView;
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 17, 2024 12:37
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@edokeh
edokeh / index.js
Last active May 12, 2024 05:54
佛祖保佑,永无 BUG
//
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \