Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PhotoMargingActivity extends Activity implements OnClickListener{
- /** Called when the activity is first created. */
- private Button share,flshControl,buttonClick,capture,mSave;
- TextView addText, addTexture, effect_name;
- private final String TAG = "CameraDemo";
- Bitmap imageBitmap;
- String[] effectNames={"Darken","Color Burn","Overlay","Soft Light","Hard Light","Vivid Light","Hue","Pin Light"};
- ImageView btnLeft,btnRight;
- private EditText mText;
- int selectedItem, effectNumber=0;
- AlertDialog alert,alert1;
- Bitmap bmOut;
- boolean Flash = false;
- Gallery g;
- int i =0;
- boolean addtextClicked = true;
- String textureEffects[]= {"bright red","broken glass","clouds","cloudy art","cloudy art 2",
- "colorful 7","colorful blotches","colorful blotches frame","colorful circles","cyclos","danger","dirty screen 2",
- "dirty screen 3","dont look","endless route","fancy m
- "swag","verde","x ray blue","yellow wood","warning","golden circle","green","old paper","passion","rays of light","semicircles","","","","","","","","","","","",};
- private Integer[] mImageIds = {
- R.drawable.dreaming, R.drawable.bluefilm, R.drawable.chromatic_lights, R.drawable.dirty_screen,
- R.drawable.colorful_blotches,R.drawable.colorful_blotches_frame,
- R.drawable.colorful_circles,R.drawable.cyclos, R.drawable.danger,
- R.drawable.oldfilm, R.drawable.oldmusic,
- };
- Dialog mDialog;
- LinearLayout previewImage;
- /// public Camera camera;
- public static ImageView img;
- private Bitmap mBit;
- int ItemsInGallery=0;
- int CurrentIndex=0;
- Preview preview;
- FrameLayout mfram;
- public static Bitmap icon;
- Typeface tf,tf1,tf2,tf3,tf4,tf5;
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- tf = Typeface.createFromAsset(getAssets(),"fonts/FtraBk_0.ttf");
- tf1 = Typeface.createFromAsset(getAssets(),"fonts/DESYREL.ttf");
- tf2 = Typeface.createFromAsset(getAssets(),"fonts/Helvetica.ttf");
- // tf3 = Typeface.createFromAsset(getAssets(),"TR_Arial.ttf");
- tf4 = Typeface.createFromAsset(getAssets(),"fonts/ufonts.com_bradley-hand-itc-2.ttf");
- tf5 = Typeface.createFromAsset(getAssets(),"fonts/ufonts.com_cochin1.ttf");
- mText=(EditText)findViewById(R.id.text);
- // image veiw text.............................
- img=(ImageView)findViewById(R.id.img);
- //...............image id...............................
- previewImage = (LinearLayout) findViewById(R.id.preview_image);
- mfram=(FrameLayout) findViewById(R.id.preview1234);
- capture=(Button)findViewById(R.id.capture);
- mSave=(Button)findViewById(R.id.save);
- addTexture = (TextView) findViewById(R.id.add_texture);
- //.................. to get the intent from ... main1 class........................
- Bundle bundle = getIntent().getExtras();
- if(bundle.getBoolean("image"))
- {
- //............. here to get the decode file of image.................. main1 class
- Bitmap b = Bitmap.createBitmap(Main1.mBitMap);
- img.setImageBitmap(b);
- previewImage.setVisibility(View.GONE);
- }else{
- //capture.setVisibility(View.VISIBLE);
- i++;
- preview = new Preview(PhotoMargingActivity.this);
- mfram.addView(preview);
- }
- icon = Main1.mBitMap;
- effect_name= (TextView) findViewById(R.id.change_effects);
- btnLeft =(ImageView) findViewById(R.id.btn_left);
- btnRight = (ImageView) findViewById(R.id.btn_right);
- btnLeft.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- // TODO Auto-generated method stub
- if(effectNumber==0) effectNumber=7;
- else effectNumber--;
- applyEffect();
- }
- });
- btnRight.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- // TODO Auto-generated method stub
- if(effectNumber==7) effectNumber=0;
- else effectNumber++;
- applyEffect();
- }
- });
- buttonClick = (Button) findViewById(R.id.btnClick);
- buttonClick.setOnClickListener( new OnClickListener() {
- public void onClick(View v) {
- //img.setVisibility(View.GONE);
- i++;
- if(i == 1){
- //capture.setVisibility(View.VISIBLE);
- preview = new Preview(PhotoMargingActivity.this);
- mfram.addView(preview);
- }else if(i==2){
- preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);
- }
- }
- });
- flshControl=(Button)findViewById(R.id.flsh_control);
- flshControl.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- //createSepiaToningEffect(BitmapFactory.decodeResource(getResources(),R.drawable.antartica1),1,10,10,255);
- if(PhotoMargingActivity.this.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH)){
- //Flash = (Flash == true) ? false : true;
- if(!Flash){
- Parameters p = preview.camera.getParameters();
- p.setFlashMode(Parameters.FLASH_MODE_TORCH);
- preview.camera.setParameters(p);
- Flash = true;
- }else{
- Parameters p = preview.camera.getParameters();
- p.setFlashMode(Parameters.FLASH_MODE_OFF);
- preview.camera.setParameters(p);
- Flash = false;
- }
- }
- }
- });
- capture.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- // TODO Auto-generated method stub
- preview.camera.takePicture(shutterCallback, rawCallback, jpegCallback);
- //mfram.setVisibility(View.GONE);
- }
- });
- mSave.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- File cacheDir;
- Bitmap bitmap = icon;
- // String path = Environment.getExternalStorageDirectory().toString();
- OutputStream fOut = null;
- Date d=new Date();
- if (android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))
- cacheDir=new File(android.os.Environment.getExternalStorageDirectory(),"Photo Art Camera");
- else
- cacheDir=PhotoMargingActivity.this.getCacheDir();
- if(!cacheDir.exists())
- cacheDir.mkdirs();
- File file = new File(cacheDir, "PhotoMarge"+d.getTime()+".jpg");
- try {
- fOut = new FileOutputStream(file);
- bitmap.compress(CompressFormat.PNG, 100, fOut);
- //getImageBitmap(myurl).compress(Bitmap.CompressFormat.JPEG, 85, fOut);
- fOut.flush();
- fOut.close();
- Toast.makeText(PhotoMargingActivity.this, "Photo Saved Sucessfully", 500).show();
- // mDialog.dismiss();
- //MediaStore.Images.Media.insertImage(getContentResolver(),file.getAbsolutePath(),file.getName(),file.getName());
- } catch (FileNotFoundException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- Toast.makeText(PhotoMargingActivity.this, "Photo Not Saved Sucessfully", 500).show();
- }
- }
- });
- Log.d(TAG, "onCreate'd");
- g = (Gallery) findViewById(R.id.Gallery01);
- g.setAdapter(new ImageAdapter(this));
- g.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
- img.setBackgroundResource(mImageIds[position]);
- img.setAlpha(170);
- addTexture.setText(textureEffects[position]);
- }
- });
- share=(Button)findViewById(R.id.share);
- share.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- mfram.setDrawingCacheEnabled(true);
- icon = Bitmap.createBitmap(mfram.getDrawingCache());
- mfram.setDrawingCacheEnabled(false);
- mDialog=new Dialog(PhotoMargingActivity.this);
- mDialog=new Dialog(PhotoMargingActivity.this);
- mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
- mDialog.setContentView(R.layout.dialog2);
- mDialog.show();
- }
- });
- // mBtn4=(Button)findViewById(R.id.btn4);
- // mBtn4.setOnClickListener(new OnClickListener() {
- //
- // @Override
- // public void onClick(View arg0) {
- // doInvert(BitmapFactory.decodeResource(getResources(),R.drawable.antartica1));
- // }
- // });
- //
- addText=(TextView)findViewById(R.id.add_text);
- addText.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View arg0) {
- // TODO Auto-generated method stub
- if(addtextClicked == true){
- addtextClicked = false;
- showAddTextDialoge();
- addText.setBackgroundResource(R.drawable.done);
- }
- else{
- addtextClicked = true;
- addText.setBackgroundResource(R.drawable.addtext);
- }
- }
- });
- }
- void applyEffect(){
- //img.buildDrawingCache();
- //Bitmap bmap = img.getDrawingCache();
- //mfram.setDrawingCacheEnabled(true);
- // Bitmap b = ll.getDrawingCache();
- mfram.removeView(preview);
- previewImage.setVisibility(View.VISIBLE);
- Bitmap icon1 = icon;
- //effect_name.setText(effectNames[effectNumber]);
- switch (effectNumber) {
- case 0:
- int highlightColor = getResources().getColor(R.color.highlight_color_filter);
- PorterDuffColorFilter colorFilter = new PorterDuffColorFilter(highlightColor, PorterDuff.Mode.SRC_ATOP);
- img.setColorFilter(colorFilter);
- break;
- case 1:
- createSepiaToningEffect(icon1,1,255,0,0);
- break;
- case 2:
- createSepiaToningEffect(icon1,1,0,255,0);
- break;
- case 3:
- createSepiaToningEffect(icon1,1,0,0,255);
- break;
- case 4:
- doInvert(icon1);
- break;
- case 5:
- doInvert(icon1);
- break;
- case 6:
- doInvert(icon1);
- break;
- case 7:
- doInvert(icon1);
- break;
- }
- }
- public class ImageAdapter extends BaseAdapter {
- int mGalleryItemBackground;
- private Context mContext;
- public ImageAdapter(Context c) {
- mContext = c;
- TypedArray a = c.obtainStyledAttributes(R.styleable.GalleryA);
- mGalleryItemBackground = a.getResourceId(R.styleable.GalleryA_android_galleryItemBackground, 0);
- a.recycle();
- }
- public int getCount() {
- ItemsInGallery=mImageIds.length;
- return mImageIds.length;
- }
- public Object getItem(int position) {
- return position;
- }
- public long getItemId(int position) {
- return position;
- }
- public View getView(int position, View convertView, ViewGroup parent) {
- ImageView i = new ImageView(mContext);
- i.setImageResource(mImageIds[position]);
- i.setLayoutParams(new Gallery.LayoutParams(100, 100));
- i.setScaleType(ImageView.ScaleType.FIT_XY);
- i.setBackgroundResource(mGalleryItemBackground);
- return i;
- }
- }
- @Override
- public void onClick(View v) {
- // TODO Auto-generated method stub
- switch(v.getId())
- {
- case R.id.btnNext:
- //Increase the index
- CurrentIndex++;
- //if reached the end of the gallery, then start from the first item
- if(CurrentIndex>ItemsInGallery-1)
- CurrentIndex=ItemsInGallery-1;
- //CurrentIndex=0;
- g.setSelection(CurrentIndex,true);
- //txt.setText(String.valueOf(CurrentIndex));
- break;
- case R.id.btnPrev:
- //Decrease the index
- CurrentIndex=CurrentIndex-1;
- //If reached the first item, then return to the last item in the gallery
- if(CurrentIndex<0)
- CurrentIndex=0;
- //CurrentIndex=ItemsInGallery-1;
- g.setSelection(CurrentIndex,true);
- //txt.setText(String.valueOf(CurrentIndex));
- break;
- }
- }
- //............................................ errorrrrrrrrrrrrrrrrrrrrrrrr...............
- public void createSepiaToningEffect(Bitmap src, int depth, double red, double green, double blue) {
- // image size
- int width = src.getWidth();
- int height = src.getHeight();
- // create output bitmap
- bmOut = Bitmap.createBitmap(width, height, src.getConfig());
- // constant grayscale
- final double GS_RED = 0.3;
- final double GS_GREEN = 0.59;
- final double GS_BLUE = 0.11;
- // color information
- int A, R, G, B;
- int pixel;
- // scan through all pixels
- for(int x = 0; x < width; ++x) {
- for(int y = 0; y < height; ++y) {
- // get pixel color
- pixel = src.getPixel(x, y);
- // get color on each channel
- A = Color.alpha(pixel);
- R = Color.red(pixel);
- G = Color.green(pixel);
- B = Color.blue(pixel);
- // apply grayscale sample
- B = G = R = (int)(GS_RED * R + GS_GREEN * G + GS_BLUE * B);
- // apply intensity level for sepid-toning on each channel
- R += (depth * red);
- if(R > 255) { R = 255; }
- G += (depth * green);
- if(G > 255) { G = 255; }
- B += (depth * blue);
- if(B > 255) { B = 255; }
- // set new pixel color to output image
- bmOut.setPixel(x, y, Color.argb(A, R, G, B));
- }
- }
- icon=bmOut;
- // return final image
- img.setImageBitmap(bmOut);
- }
- public static Bitmap doInvert(Bitmap src) {
- // create new bitmap with the same settings as source bitmap
- Bitmap bmOut = Bitmap.createBitmap(src.getWidth(), src.getHeight(), src.getConfig());
- // color info
- int A, R, G, B;
- int pixelColor;
- // image size
- int height = src.getHeight();
- int width = src.getWidth();
- // scan through every pixel
- for (int y = 0; y < height; y++)
- {
- for (int x = 0; x < width; x++)
- {
- // get one pixel
- pixelColor = src.getPixel(x, y);
- // saving alpha channel
- A = Color.alpha(pixelColor);
- // inverting byte for each R/G/B channel
- R = 255 - Color.red(pixelColor);
- G = 255 - Color.green(pixelColor);
- B = 255 - Color.blue(pixelColor);
- // set newly-inverted pixel to output image
- bmOut.setPixel(x, y, Color.argb(A, R, G, B));
- }
- }
- img.setImageBitmap(bmOut);
- // return final bitmap
- return bmOut;
- }
- public static Bitmap engrave(Bitmap src) {
- ConvolutionMatrix convMatrix = new ConvolutionMatrix(3);
- convMatrix.setAll(0);
- convMatrix.Matrix[0][0] = -2;
- convMatrix.Matrix[1][1] = 2;
- convMatrix.Factor = 1;
- convMatrix.Offset = 95;
- return ConvolutionMatrix.computeConvolution3x3(src, convMatrix);
- }
- public static Bitmap sharpen(Bitmap src, double weight) {
- double[][] SharpConfig = new double[][] {
- { 0 , -2 , 0 },
- { -2, weight, -2 },
- { 0 , -2 , 0 }
- };
- ConvolutionMatrix convMatrix = new ConvolutionMatrix(3);
- convMatrix.applyConfig(SharpConfig);
- convMatrix.Factor = weight - 8;
- return ConvolutionMatrix.computeConvolution3x3(src, convMatrix);
- }
- public static Bitmap applyMeanRemoval(Bitmap src) {
- double[][] MeanRemovalConfig = new double[][] {
- { -1 , -1, -1 },
- { -1 , 9, -1 },
- { -1 , -1, -1 }
- };
- ConvolutionMatrix convMatrix = new ConvolutionMatrix(3);
- convMatrix.applyConfig(MeanRemovalConfig);
- convMatrix.Factor = 1;
- convMatrix.Offset = 0;
- return ConvolutionMatrix.computeConvolution3x3(src, convMatrix);
- }
- public static Bitmap doColorFilter(Bitmap src, double red, double green, double blue) {
- // image size
- int width = src.getWidth();
- int height = src.getHeight();
- // create output bitmap
- Bitmap bmOut = Bitmap.createBitmap(width, height, src.getConfig());
- // color information
- int A, R, G, B;
- int pixel;
- // scan through all pixels
- for(int x = 0; x < width; ++x) {
- for(int y = 0; y < height; ++y) {
- // get pixel color
- pixel = src.getPixel(x, y);
- // apply filtering on each channel R, G, B
- A = Color.alpha(pixel);
- R = (int)(Color.red(pixel) * red);
- G = (int)(Color.green(pixel) * green);
- B = (int)(Color.blue(pixel) * blue);
- // set new color pixel to output bitmap
- bmOut.setPixel(x, y, Color.argb(A, R, G, B));
- }
- }
- img.setImageBitmap(bmOut);
- // return final image
- return bmOut;
- }
- public static Bitmap applyShadingFilter(Bitmap source, int shadingColor) {
- // get image size
- int width = source.getWidth();
- int height = source.getHeight();
- int[] pixels = new int[width * height];
- // get pixel array from source
- source.getPixels(pixels, 0, width, 0, 0, width, height);
- int index = 0;
- // iteration through pixels
- for(int y = 0; y < height; ++y) {
- for(int x = 0; x < width; ++x) {
- // get current index in 2D-matrix
- index = y * width + x;
- // AND
- pixels[index] &= shadingColor;
- }
- }
- // output bitmap
- Bitmap bmOut = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- bmOut.setPixels(pixels, 0, width, 0, 0, width, height);
- img.setImageBitmap(bmOut);
- return bmOut;
- }
- public static Bitmap applySnowEffect(Bitmap source) {
- // get image size
- int width = source.getWidth();
- int height = source.getHeight();
- int[] pixels = new int[width * height];
- // get pixel array from source
- source.getPixels(pixels, 0, width, 0, 0, width, height);
- // random object
- Random random = new Random();
- int R, G, B, index = 0, thresHold = 50;
- // iteration through pixels
- for(int y = 0; y < height; ++y) {
- for(int x = 0; x < width; ++x) {
- // get current index in 2D-matrix
- index = y * width + x;
- // get color
- R = Color.red(pixels[index]);
- G = Color.green(pixels[index]);
- B = Color.blue(pixels[index]);
- // generate threshold
- thresHold = random.nextInt(0xFF);
- if(R > thresHold && G > thresHold && B > thresHold) {
- pixels[index] = Color.rgb(0xFF, 0xFF, 0xFF);
- }
- }
- }
- // output bitmap
- Bitmap bmOut = Bitmap.createBitmap(width, height, Bitmap.Config.RGB_565);
- bmOut.setPixels(pixels, 0, width, 0, 0, width, height);
- img.setImageBitmap(bmOut);
- return bmOut;
- }
- public static Bitmap applyHueFilter(Bitmap source, int level) {
- // get image size
- int width = source.getWidth();
- int height = source.getHeight();
- int[] pixels = new int[width * height];
- float[] HSV = new float[3];
- // get pixel array from source
- source.getPixels(pixels, 0, width, 0, 0, width, height);
- int index = 0;
- // iteration through pixels
- for(int y = 0; y < height; ++y) {
- for(int x = 0; x < width; ++x) {
- // get current index in 2D-matrix
- index = y * width + x;
- // convert to HSV
- Color.colorToHSV(pixels[index], HSV);
- // increase Saturation level
- HSV[0] *= level;
- HSV[0] = (float) Math.max(0.0, Math.min(HSV[0], 360.0));
- // take color back
- pixels[index] |= Color.HSVToColor(HSV);
- }
- }
- // output bitmap
- Bitmap bmOut = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- bmOut.setPixels(pixels, 0, width, 0, 0, width, height);
- img.setImageBitmap(bmOut);
- return bmOut;
- }
- public static Bitmap boost(Bitmap src, int type, float percent) {
- int width = src.getWidth();
- int height = src.getHeight();
- Bitmap bmOut = Bitmap.createBitmap(width, height, src.getConfig());
- int A, R, G, B;
- int pixel;
- for(int x = 0; x < width; ++x) {
- for(int y = 0; y < height; ++y) {
- pixel = src.getPixel(x, y);
- A = Color.alpha(pixel);
- R = Color.red(pixel);
- G = Color.green(pixel);
- B = Color.blue(pixel);
- if(type == 1) {
- R = (int)(R * (1 + percent));
- if(R > 255) R = 255;
- }
- else if(type == 2) {
- G = (int)(G * (1 + percent));
- if(G > 255) G = 255;
- }
- else if(type == 3) {
- B = (int)(B * (1 + percent));
- if(B > 255) B = 255;
- }
- bmOut.setPixel(x, y, Color.argb(A, R, G, B));
- }
- }
- img.setImageBitmap(bmOut);
- return bmOut;
- }
- ShutterCallback shutterCallback = new ShutterCallback() {
- public void onShutter() {
- Log.d(TAG, "onShutter'd");
- }
- };
- /** Handles data for raw picture */
- PictureCallback rawCallback = new PictureCallback() {
- public void onPictureTaken(byte[] data, Camera camera) {
- Log.d(TAG, "onPictureTaken - raw");
- }
- };
- /** Handles data for jpeg picture */
- PictureCallback jpegCallback = new PictureCallback() {
- public void onPictureTaken(byte[] data, Camera camera) {
- //FileOutputStream outStream = null;
- try {
- // write to local sandbox file system
- // outStream = CameraDemo.this.openFileOutput(String.format("%d.jpg", System.currentTimeMillis()), 0);
- // Or write to sdcard
- ByteArrayInputStream imagestream=new ByteArrayInputStream(data);
- icon=BitmapFactory.decodeStream(imagestream);
- File pic = null;
- try {
- File root = Environment.getExternalStorageDirectory();
- if (root.canWrite()){
- pic = new File(root,"signature.png");
- FileOutputStream out = new FileOutputStream(pic);
- icon.compress(CompressFormat.PNG, 100, out);
- out.flush();
- out.close();
- }
- } catch (IOException e) {
- Log.e("BROKEN", "Could not write file " + e.getMessage());
- }
- img.setImageBitmap(icon);
- //outStream = new FileOutputStream(String.format("/sdcard/%d.jpg", System.currentTimeMillis()));
- //outStream.write(data);
- //outStream.close();
- Log.d(TAG, "onPictureTaken - wrote bytes: " + data.length);
- } finally {
- }
- Log.d(TAG, "onPictureTaken - jpeg");
- }
- };
- void showAddTextDialoge(){
- final CharSequence[] digitList = { "Arial", "Baskerville", "Bodoni 72","Bradley Hand","Cochin" };
- AlertDialog.Builder alt_bld = new AlertDialog.Builder(PhotoMargingActivity.this);
- alt_bld.setIcon(R.drawable.icon);
- alt_bld.setTitle("Select one Digit");
- selectedItem = -1;
- alt_bld.setSingleChoiceItems(digitList , -1,new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int item) {
- selectedItem = item;
- if(digitList[item].equals("Arial")){
- mText.setTypeface(tf);
- }
- else if(digitList[item].equals("Baskerville")){
- mText.setTypeface(tf1);
- }
- else if(digitList[item].equals("Bodoni 72")){
- mText.setTypeface(tf2);
- }
- else if(digitList[item].equals("Bradley Hand")){
- mText.setTypeface(tf4);
- }
- else if(digitList[item].equals("Cochin")){
- mText.setTypeface(tf5);
- }
- alert.dismiss();
- final CharSequence[] ColorList = { "Red", "Green", "Blue","Orange","White","Gray","Black","Yellow" };
- AlertDialog.Builder alt_bld1 = new AlertDialog.Builder(PhotoMargingActivity.this);
- alt_bld1.setIcon(R.drawable.icon);
- alt_bld1.setTitle("Select one Digit");
- selectedItem = -1;
- alt_bld1.setSingleChoiceItems(ColorList , -1,new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int item) {
- selectedItem = item;
- mText.setVisibility(View.VISIBLE);
- if(ColorList[item].equals("Red")){
- mText.setTextColor(Color.RED);
- }
- else if(ColorList[item].equals("Green")){
- mText.setTextColor(Color.GREEN);
- }
- else if(ColorList[item].equals("Blue")){
- mText.setTextColor(Color.BLUE);
- }
- else if(ColorList[item].equals("Orange")){
- mText.setTextColor(Color.MAGENTA);
- }
- else if(ColorList[item].equals("White")){
- mText.setTextColor(Color.WHITE);
- }
- else if(ColorList[item].equals("Gray")){
- mText.setTextColor(Color.GRAY);
- }
- else if(ColorList[item].equals("Black")){
- mText.setTextColor(Color.BLACK);
- }
- else if(ColorList[item].equals("Yellow")){
- mText.setTextColor(Color.YELLOW);
- }
- alert1.dismiss();
- }
- });
- alt_bld1.setNegativeButton("Cancel",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- }
- });
- alert1 = alt_bld1.create();
- alert1.show();
- }
- });
- alt_bld.setNegativeButton("Cancel",
- new DialogInterface.OnClickListener() {
- @Override
- public void onClick(DialogInterface dialog, int which) {
- }
- });
- alert = alt_bld.create();
- alert.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement