Skip to content

Instantly share code, notes, and snippets.

@siyamed
siyamed / ImageRadioButton.java
Created November 22, 2014 01:03
Android RadioButton With Text Drawable Aligned Centered With Text
/**
*
* Android radio button that draws (state list) drawable to immediate left of its text.
* RadioButton has an attribute drawableLeft or drawableStart, however those
* draw the drawable to the left of the component and does not center align
* with the text itself.
*
* This ui component also supports statelistdrawables and state changes on
* the drawable.
*
@ishida-m
ishida-m / mecab.sh
Last active December 18, 2016 08:23
mecab installer
#!/bin/sh
# wget http://mecab.googlecode.com/files/mecab-0.996.tar.gz
curl -OL http://mecab.googlecode.com/files/mecab-0.996.tar.gz
if [ -f mecab-0.996.tar.gz ]; then
tar zxf mecab-0.996.tar.gz
cd mecab-0.996
./configure --with-charset="utf8"
@tc
tc / EncodeAndMuxTest.java
Created September 5, 2013 21:26
OpenGL to video on Android, 4.3 API 18
/*
* Copyright 2013 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
*
* Unless required by applicable law or agreed to in writing, software
@mediavrog
mediavrog / gist:5625602
Last active March 20, 2024 16:59
Filter out Intents you don"t want to show from a IntentChooser dialog. For example your own app, competing apps or just apps you have a share integration by SDK already :) Based on http://stackoverflow.com/questions/5734678/custom-filtering-of-intent-chooser-based-on-installed-android-package-name/8550043#8550043
// Usage:
// blacklist
String[] blacklist = new String[]{"com.any.package", "net.other.package"};
// your share intent
Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "some text");
intent.putExtra(android.content.Intent.EXTRA_SUBJECT, "a subject");
// ... anything else you want to add
// invoke custom chooser
@cblunt
cblunt / MaskedImageView.java
Created July 25, 2012 11:22
Android MaskedImageView - Uses the Background resource as a mask for the src bitmap. If set, foregroundBitmap is overlaid on top of the masked image.
package com.example;
import android.content.Context;
import android.graphics.*;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.NinePatchDrawable;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.ImageView;