Varios issues cerrados.

parent f675c734
...@@ -7,6 +7,8 @@ import android.graphics.BitmapFactory; ...@@ -7,6 +7,8 @@ import android.graphics.BitmapFactory;
import android.graphics.Canvas; import android.graphics.Canvas;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.Matrix; import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.drawable.Drawable;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.speech.tts.TextToSpeech; import android.speech.tts.TextToSpeech;
...@@ -15,6 +17,7 @@ import android.view.View; ...@@ -15,6 +17,7 @@ import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.BaseAdapter; import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.GridLayout; import android.widget.GridLayout;
import android.widget.GridView; import android.widget.GridView;
import android.widget.ImageView; import android.widget.ImageView;
...@@ -183,7 +186,31 @@ public class PanelAdapter extends ArrayAdapter { ...@@ -183,7 +186,31 @@ public class PanelAdapter extends ArrayAdapter {
*/ */
} }
else{ else{
imageView.setImageAlpha(255); /* AÑADO UN BORDE */
/*
final int BORDER_WIDTH = 1;
final int BORDER_COLOR = Color.WHITE;
Bitmap res = Bitmap.createBitmap(bmp1.getWidth() + 2 * BORDER_WIDTH,
bmp1.getHeight() + 2 * BORDER_WIDTH,
bmp1.getConfig());
Canvas c = new Canvas(res);
Paint p = new Paint();
p.setColor(BORDER_COLOR);
c.drawRect(0, 0, res.getWidth(), res.getHeight(), p);
p = new Paint(Paint.FILTER_BITMAP_FLAG);
c.drawBitmap(res, BORDER_WIDTH, BORDER_WIDTH, p);
*/
/* FIN BORDE */
Drawable d = null;
imageView.setImageDrawable(d);
imageView.setAdjustViewBounds(true);
imageView.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
imageView.setBackgroundColor(Color.WHITE); //providing color to the background.
imageView.setPadding(3, 3, 3, 3);//providing padding to the image.
imageView.setLayoutParams(new Gallery.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
//imageView.setImageAlpha(255);
imageView.setImageBitmap(bmp1); imageView.setImageBitmap(bmp1);
} }
} }
......
...@@ -389,12 +389,11 @@ public class PictogramActivity extends Activity implements iVocabularyListener, ...@@ -389,12 +389,11 @@ public class PictogramActivity extends Activity implements iVocabularyListener,
count_deletelong++; count_deletelong++;
if (count_deletelong >= 3){ if (count_deletelong >= 3){
Log.d(LOG_TAG, "SALTO A LOGIN"); //Log.d(LOG_TAG, "SALTO A LOGIN");
// Paso un parámetro a la SerialActivity, para controlar de dónde viene // Paso un parámetro a la SerialActivity, para controlar de dónde viene
Intent serialActivity = new Intent(getBaseContext(), SerialActivity.class); Intent serialActivity = new Intent(getBaseContext(), SerialActivity.class);
serialActivity.putExtra("activity_name","PictogramActivity"); serialActivity.putExtra("activity_name","PictogramActivity");
startActivity(serialActivity); startActivity(serialActivity);
// ....
} }
return false; return false;
......
...@@ -28,22 +28,25 @@ ...@@ -28,22 +28,25 @@
<ImageButton <ImageButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="20dp" android:paddingLeft="800dp"
android:src="@drawable/play64" android:paddingTop="20dp"
android:src="@drawable/back64"
android:background="@null" android:background="@null"
android:id="@+id/button_tts" android:id="@+id/button_delete"
android:layout_toRightOf="@+id/tape_grid_view"
android:layout_alignParentTop="true"/> android:layout_alignParentTop="true"/>
<ImageButton <ImageButton
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:src="@drawable/back64" android:paddingTop="20dp"
android:src="@drawable/play64"
android:background="@null" android:background="@null"
android:id="@+id/button_delete" android:id="@+id/button_tts"
android:layout_toRightOf="@+id/tape_grid_view" android:layout_toRightOf="@+id/tape_grid_view"
android:layout_below="@+id/button_tts"/> android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:maxHeight = "85dp"/>
<GridView <GridView
android:id="@+id/panel_grid_view" android:id="@+id/panel_grid_view"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android" <ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent"> android:layout_width="match_parent"
android:layout_height="match_parent"/>
</ImageView> \ No newline at end of file
\ No newline at end of file
...@@ -5,4 +5,11 @@ ...@@ -5,4 +5,11 @@
<!-- Customize your theme here. --> <!-- Customize your theme here. -->
</style> </style>
<style name="myImageView">
<!-- 3dp so the background border to be visible -->
<item name="android:padding">3dp</item>
<item name="android:background">@drawable/image_border</item>
<item name="android:scaleType">fitCenter</item>
</style>
</resources> </resources>
...@@ -25,4 +25,8 @@ ...@@ -25,4 +25,8 @@
<item>@color/darkred</item> <item>@color/darkred</item>
</integer-array> </integer-array>
<color name="image_border_start">#40990000</color>
<color name="image_border_end">#FF660000</color>
<color name="image_border_center">#FFFF3333</color>
</resources> </resources>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment