use of android.graphics.Bitmap in project kickmaterial by byoutline.
the class RewardsListActivity method loadProjectData.
private void loadProjectData() {
selectCategoryTv.setText(R.string.select_pledge);
selectCategoryTv.setBackgroundColor(Color.TRANSPARENT);
categoryCircleIv.setVisibility(View.GONE);
Picasso.with(getApplicationContext()).load(project.getPhotoUrl()).into(new Target() {
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
selectedCategoryIv.setImageBitmap(bitmap);
LUtils.toGrayscale(selectedCategoryIv);
selectedCategoryIv.getDrawable().setColorFilter(ContextCompat.getColor(RewardsListActivity.this, R.color.green_dark), PorterDuff.Mode.MULTIPLY);
}
@Override
public void onBitmapFailed(Drawable errorDrawable) {
selectedCategoryIv.setImageResource(0);
}
@Override
public void onPrepareLoad(Drawable placeHolderDrawable) {
selectedCategoryIv.setImageResource(0);
}
});
}
use of android.graphics.Bitmap in project kickmaterial by byoutline.
the class CircleTransition method captureStartValues.
@Override
public void captureStartValues(TransitionValues transitionValues) {
final View view = transitionValues.view;
if (view.getWidth() <= 0 || view.getHeight() <= 0) {
return;
}
captureValues(transitionValues);
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
transitionValues.values.put(PROPERTY_IMAGE, bitmap);
}
use of android.graphics.Bitmap in project kickmaterial by byoutline.
the class CircleTransition method getStartView.
private View getStartView(ViewGroup sceneRoot, TransitionValues startValues, int[] sceneRootLoc, int[] startLoc) {
Bitmap startImage = (Bitmap) startValues.values.get(PROPERTY_IMAGE);
Drawable startBackground = new BitmapDrawable(startImage);
final View startView = addViewToOverlay(sceneRoot, startImage.getWidth(), startImage.getHeight(), startBackground);
int startTranslationX = startLoc[0] - sceneRootLoc[0];
int startTranslationY = startLoc[1] - sceneRootLoc[1];
startView.setTranslationX(startTranslationX);
startView.setTranslationY(startTranslationY);
return startView;
}
use of android.graphics.Bitmap in project buck by facebook.
the class ExoMetaLogActivity method onCreate.
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
try {
ApplicationInfo appInfo = getPackageManager().getApplicationInfo("buck.exotest", PackageManager.GET_META_DATA);
Bitmap icon = getIcon(appInfo);
Bitmap defaultIcon = ((BitmapDrawable) getPackageManager().getApplicationIcon(getApplicationInfo())).getBitmap();
if (icon == null) {
Log.i("EXOPACKAGE_TEST_META", "Found no icon");
} else if (icon.sameAs(defaultIcon)) {
Log.i("EXOPACKAGE_TEST_META", "Found default icon");
} else {
Log.i("EXOPACKAGE_TEST_META", "META_ICON=" + icon.getWidth() + "_" + icon.getHeight());
}
String name = getName(appInfo);
if (name == null) {
Log.i("EXOPACKAGE_TEST_META", "Found no name");
} else {
Log.i("EXOPACKAGE_TEST_META", "META_NAME=" + name);
}
String[] meta = getMeta(appInfo);
if (meta == null) {
Log.i("EXOPACKAGE_TEST_META", "Found no metadata");
} else {
String metaStr = "<";
for (int i = 0; i < meta.length; i++) {
metaStr += (i == 0 ? "" : ",") + meta[i];
}
metaStr += ">";
Log.i("EXOPACKAGE_TEST_META", "META_DATA=" + metaStr);
}
} catch (Exception e) {
Log.i("EXOPACKAGE_TEST_META_DEBUG", "Got an exception", e);
}
Log.i("EXOPACKAGE_TEST_META", "FINISHED");
finish();
}
use of android.graphics.Bitmap in project UltimateAndroid by cymcsg.
the class Tile method decode.
public void decode(Context context, TileCache cache, BitmapDecoder decoder) {
if (hasBitmap) {
return;
}
if (cache != null) {
Bitmap cached = cache.getBitmap(file);
if (cached != null) {
bitmap = cached;
return;
}
}
bitmap = decoder.decode(file, context);
hasBitmap = (bitmap != null);
if (cache != null) {
cache.addBitmap(file, bitmap);
}
}
Aggregations