This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class OnClickListenerActivity extends Activity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
commutateViewSwitcherButton.setOnClickListener(new OnClickListener() { | |
public void onClick(View view) { | |
final ViewSwitcher viewSwitcher = (ViewSwitcher) findViewById(R.id.viewSwitcher); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
android { | |
... | |
signingConfigs { | |
debug { | |
storeFile file("debug.keystore") | |
} | |
myConfig { | |
storeFile file("release.keystore") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Bitmap blurBitmap(Bitmap bitmap){ | |
//Let's create an empty bitmap with the same size of the bitmap we want to blur | |
Bitmap outBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Config.ARGB_8888); | |
//Instantiate a new Renderscript | |
RenderScript rs = RenderScript.create(getApplicationContext()); | |
//Create an Intrinsic Blur Script using the Renderscript | |
ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ColorFilter getColorFilterFromColor(int color){ | |
//Extract the RGB components from color | |
int red = Color.red(color); | |
int green = Color.green(color); | |
int blue = Color.blue(color); | |
//create a ColorMatrix with the RGB Components | |
float[] matrix = { | |
0, 0, 0, 0, red |