Skip to content

Instantly share code, notes, and snippets.

View reduced_incompatible_vectors.xml
<vector>
<path
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
</vector>
<vector>
<path
android:pathData="M12,8c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2 -2,0.9 -2,2 0.9,2 2,2zM12,10c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2zM12,16c-1.1,0 -2,0.9 -2,2s0.9,2 2,2 2,-0.9 2,-2 -0.9,-2 -2,-2z"/>
</vector>
View reduced_compatible_vectors.xml
<vector>
<path
android:pathData="M 2 21 L 23 12 L 2 3 L 2 10 L 17 12 L 2 14 Z"/>
</vector>
<vector>
<path
android:pathData="M 1 10 L 1 12 L 1 21 L 10 21 L 17 21 L 1 10 Z"/>
</vector>
@akaita
akaita / HomeActivity.java
Created Mar 26, 2018
Using an AnimatedVectorDrawable (java)
View HomeActivity.java
public void onClickIcon() {
ImageView image = findViewById(R.id.someImageView);
((AnimatedVectorDrawable)image.getDrawable()).start()
}
@akaita
akaita / HomeActivity.kt
Last active Mar 26, 2018
Using an AnimatedVectorDrawable (kotlin)
View HomeActivity.kt
fun onClickIcon() {
(someImageView.drawable as AnimatedVectorDrawable).start()
}
View AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application>
<meta-data android:name="com.bumptech.glide.integration.okhttp3.OkHttpGlideModule" tools:node="remove" />
</application>
@akaita
akaita / windows-binding.json
Created Mar 1, 2019
Karabiner - PC-style for MacOs: Home, End and Undo
View windows-binding.json
# ~/.config/karabiner/assets/complex_modifications/windows-binding.json
{
"title": "Windows keys",
"rules": [
{
"description": "swap control/command fix home/end/redo except for iterm2/vim",
"manipulators": [
{
"type": "basic",
View FavoriteToSendMorphView.kt
package com.akaita.android.morphview.example.kotlin
/**
* Created by mikel on 26/03/2018.
*/
import android.content.Context
import android.support.graphics.drawable.AnimatedVectorDrawableCompat
import android.util.AttributeSet
View unmaintainable-code-5.java
for(j=0; j<array_len; j+ =8) {
total += array[j+0 ];
  total += array[j+1 ];
  total += array[j+2 ]; /* Main body of
  total += array[j+3 ]; * loop is unrolled
  total += array[j+4 ]; * for greater speed.
  total += array[j+5 ]; */
  total += array[j+6 ];
  total += array[j+7 ];
}
View unmaintainable-code-22.java
if ( function_A() == OK )
{
if ( function_B() == OK )
{
/* Normal completion stuff */
}
else
{
/* some error recovery for Function_B */
}