Skip to content

Instantly share code, notes, and snippets.

@cjoseanguiano
cjoseanguiano / MainActivity.java
Created June 20, 2019 20:52 — forked from granoeste/MainActivity.java
[Android] Button background change for state. (selector)
package com.example.sellectorsample;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity implements OnClickListener {
@cjoseanguiano
cjoseanguiano / BitmapImageSize.java
Created August 14, 2017 23:40
BitmapImageSize.java
Bitmap bitmapImage = BitmapFactory.decodeFile(uri.getPath());
int nh = (int) (bitmapImage.getHeight() * (512.0 / bitmapImage.getWidth()));
Bitmap scaled = Bitmap.createScaledBitmap(bitmapImage, 512, nh, true);
mediaListRowHolder.thumbnail.setImageBitmap(scaled);