I wanted to change color of image icon image format and image size pro-grammatically according to my requirement with the help of android code.how can i change color with the help of any specific code please suggest something.
Asked
Active
Viewed 101 times
0
-
void openImageChooser() { try { showAlertDialogWithYesNoCallBack( "Choose Type", "From Where to Pick Image", false, "Camera", "Gallery", new DialogCallBackAlert() { @Override public void dialogCallBackPositive() { Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null) { startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE); } } – Jaishree Apr 12 '17 at 05:45
-
@Override public void dialogCallBackNagative() { Intent intent = new Intent(); intent.setType("image/*"); intent.setAction(Intent.ACTION_GET_CONTENT); startActivityForResult(Intent.createChooser(intent, "Select Picture"), SELECT_PICTURE); } }); }catch (Exception e){ Log.e("Error in Camera Alert",e.getMessage()); } } – Jaishree Apr 12 '17 at 05:45
-
public void onActivityResult(int requestCode, int resultCode, Intent data) { try { if (resultCode == RESULT_OK) { if (requestCode == SELECT_PICTURE) { Uri selectedImageUri = data.getData(); try { Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), selectedImageUri); // Log.d(TAG, String.valueOf(bitmap)); setImageView(bitmap); } catch (IOException e) { e.printStackTrace(); }} – Jaishree Apr 12 '17 at 05:45
-
if (requestCode == REQUEST_IMAGE_CAPTURE ) { Bundle extras = data.getExtras(); Bitmap imageBitmap = (Bitmap) extras.get("data"); setImageView(imageBitmap); } } }catch (Exception e){ Log.e("Error", e.getMessage()); } } – Jaishree Apr 12 '17 at 05:46
-
public void setImageView(Bitmap bitmap){ if(imageViewtype.equalsIgnoreCase("bannerimg")){ bannerimage.setImageBitmap(bitmap); }else{ idproof.setImageBitmap(bitmap); } } – Jaishree Apr 12 '17 at 05:46
-
public String getPathFromURI(Uri contentUri) { String res = null; String[] proj = {MediaStore.Images.Media.DATA}; Cursor cursor = getContentResolver().query(contentUri, proj, null, null, null); cursor.moveToFirst(); int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA); res = cursor.getString(column_index); cursor.close(); return res; } – Jaishree Apr 12 '17 at 05:46
-
public void showAlertDialogWithYesNoCallBack(String title, String message, Boolean isCancelable, String positiveButtonTxt,String negativeButtonTxt, final DialogCallBackAlert callback) {AlertDialog alertDialog = new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.myDialog)).create(); ///AlertDialog alertDialog = new AlertDialog.Builder(getApplicationContext(),newContextThemeWrapper(SellerActivity.this, R.style.myDialog)).create(); alertDialog.setCancelable(isCancelable);alertDialog.setCanceledOnTouchOutside(isCancelable); // Setting Dialog TitlealertDialog.setTitle(title); – Jaishree Apr 12 '17 at 05:48
-
alertDialog.setMessage(message); alertDialog.setButton(DialogInterface.BUTTON_POSITIVE, positiveButtonTxt, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) callback.dialogCallBackPositive() }}); alertDialog.setButton(DialogInterface.BUTTON_NEGATIVE, negativeButtonTxt, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { callback.dialogCallBackNagative()}}); alertDialog.show(); }} – Jaishree Apr 12 '17 at 05:49
-
write proper i cant understand – Jaishree Apr 12 '17 at 05:49
-
http://www.viralandroid.com/2016/03/android-material-design-profile-screen-xml-ui-design.html – Jaishree Apr 12 '17 at 05:52
-
http://www.androidhive.info/2015/09/android-material-design-working-with-tabs/ – Jaishree Apr 12 '17 at 06:13
-
unable to find notification – Jaishree Apr 12 '17 at 06:14
-
http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/ – Jaishree Apr 12 '17 at 06:15
-
https://developer.android.com/training/implementing-navigation/lateral.html – Jaishree Apr 12 '17 at 06:15
-
pass data from one tab to aNOTHER....http://stackoverflow.com/questions/37943474/pass-data-from-one-design-tab-to-another-tab – Jaishree Apr 12 '17 at 06:17
-
http://www.vogella.com/tutorials/AndroidNotifications/article.html – Jaishree Apr 12 '17 at 06:39
-
http://www.androidauthority.com/how-to-create-android-notifications-707254/............. – Jaishree Apr 12 '17 at 06:40
-
Intent intent = new Intent(ctx, HomeActivity.class); PendingIntent contentIntent = PendingIntent.getActivity(ctx, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT); – Jaishree Apr 12 '17 at 06:41
-
NotificationCompat.Builder b = new NotificationCompat.Builder(ctx); b.setAutoCancel(true) .setDefaults(Notification.DEFAULT_ALL) .setWhen(System.currentTimeMillis()) .setSmallIcon(R.drawable.ic_launcher) .setTicker("Hearty365") .setContentTitle("Default notification") .setContentText("Lorem ipsum dolor sit amet, consectetur adipiscing elit.") – Jaishree Apr 12 '17 at 06:43
-
.setDefaults(Notification.DEFAULT_LIGHTS| Notification.DEFAULT_SOUND) .setContentIntent(contentIntent) .setContentInfo("Info"); – Jaishree Apr 12 '17 at 06:43
-
NotificationManager notificationManager = (NotificationManager) ctx.getSystemService(Context.NOTIFICATION_SERVICE); notificationManager.notify(1, b.build()); – Jaishree Apr 12 '17 at 06:43
-
private static final int SELECT_PICTURE = 100; private static final String TAG = "MainActivity"; static final int REQUEST_IMAGE_CAPTURE = 1 – Jaishree Apr 12 '17 at 08:05
1 Answers
0
you can use the website http://www196.lunapic.com/editor/ to change the color of icon and resizing image.If you want to do from the code then try it.
Drawable mDrawable = context.getResources().getDrawable(R.drawable.balloons);
mDrawable.setColorFilter(newPorterDuffColorFilter(0xffff00,
PorterDuff.Mode.MULTIPLY));

Farhana Naaz Ansari
- 7,524
- 26
- 65
- 105
-
public static int REQUEST_IMAGE_GALLERY = 101; public static final int RESULT_LOAD_IMAGE = 101; private static final int SELECT_PICTURE = 100; private static final String TAG = "MainActivity"; – Jaishree Apr 12 '17 at 08:05