working on PCB issues

parent 9371a190
...@@ -165,7 +165,8 @@ public class PictoItemViewGenerator { ...@@ -165,7 +165,8 @@ public class PictoItemViewGenerator {
if (convertView == null) { if (convertView == null) {
convertView = LayoutInflater.from(parent.getContext()).inflate(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big() ? LAYOUT_BIG : LAYOUT, parent, false); convertView = LayoutInflater.from(parent.getContext()).inflate(PCBcontext.getPcbdb().getCurrentUser().is_picto_size_big() ? LAYOUT_BIG : LAYOUT, parent, false);
} }
if (parent.getId()==R.id.tape_grid_view)
convertView.setPadding(0,0,0,0);
RelativeLayout layoutWrapper ; RelativeLayout layoutWrapper ;
FrameLayout layout ; FrameLayout layout ;
final ImageView pictoImage ; final ImageView pictoImage ;
......
...@@ -11,6 +11,7 @@ import android.content.DialogInterface; ...@@ -11,6 +11,7 @@ import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.database.Cursor; import android.database.Cursor;
import android.graphics.Color; import android.graphics.Color;
import android.graphics.ColorFilter;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.media.Ringtone; import android.media.Ringtone;
import android.media.RingtoneManager; import android.media.RingtoneManager;
...@@ -213,8 +214,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -213,8 +214,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Log.i(PictogramActivity.class.getCanonicalName(), " Deleting item " + position + "-"+id+"(" + PictogramActivity.this.tapeAdapter.getItem(position).get_translation() + ")"); Log.i(PictogramActivity.class.getCanonicalName(), " Deleting item " + position + "-"+id+"(" + PictogramActivity.this.tapeAdapter.getItem(position).get_translation() + ")");
ImageView pictov=((ImageView)((FrameLayout)((RelativeLayout)view).getChildAt(0)).getChildAt(0)); animateImageView(view,position);
animateImageView(pictov,position);
PictogramActivity.this.tapeAdapter.notifyDataSetChanged(); PictogramActivity.this.tapeAdapter.notifyDataSetChanged();
PCBcontext.getActionLog().log(new TalkAction(TalkAction.DELETE, PictogramActivity.this.tapeAdapter.getItem(position))); PCBcontext.getActionLog().log(new TalkAction(TalkAction.DELETE, PictogramActivity.this.tapeAdapter.getItem(position)));
}}); }});
...@@ -1116,13 +1116,16 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -1116,13 +1116,16 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public void animateImageView(final ImageView v, final int position) { public void animateImageView(View view, final int position) {
if (PictogramActivity.this.deleting) return; if (PictogramActivity.this.deleting) return;
View borderlayout=((RelativeLayout)view).getChildAt(0);
final ImageView v=((ImageView)((FrameLayout)borderlayout).getChildAt(0));
final int orange = ContextCompat.getColor(PCBcontext.getContext(),R.color.picto_default_background); // final int orange = ContextCompat.getColor(PCBcontext.getContext(),R.color.picto_default_background);
final int orange = ContextCompat.getColor(PCBcontext.getContext(),R.color.red);
final ValueAnimator colorAnim = ObjectAnimator.ofFloat(0f, 1f); final ValueAnimator colorAnim = ObjectAnimator.ofFloat(0f, 1f);
colorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { colorAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
...@@ -1130,8 +1133,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -1130,8 +1133,9 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
public void onAnimationUpdate(ValueAnimator animation) { public void onAnimationUpdate(ValueAnimator animation) {
float mul = (Float) animation.getAnimatedValue(); float mul = (Float) animation.getAnimatedValue();
int alphaOrange = adjustAlpha(orange, mul); int alphaOrange = adjustAlpha(orange, mul);
v.setBackgroundColor(alphaOrange);
v.setColorFilter(alphaOrange, PorterDuff.Mode.SRC_ATOP); v.setColorFilter(alphaOrange, PorterDuff.Mode.SRC_ATOP);
v.setBackgroundColor(alphaOrange);
v.setPadding(0,0,0,0);
if (mul == 0.0) { if (mul == 0.0) {
v.setColorFilter(0); v.setColorFilter(0);
} }
...@@ -1152,6 +1156,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab ...@@ -1152,6 +1156,7 @@ public class PictogramActivity extends Activity implements VocabularyTalk.iVocab
tapeAdapter.deleteItem(position); tapeAdapter.deleteItem(position);
tapeAdapter.notifyDataSetChanged(); tapeAdapter.notifyDataSetChanged();
v.setColorFilter(0); v.setColorFilter(0);
v.setBackgroundColor(ContextCompat.getColor(PCBcontext.getContext(),R.color.picto_default_background));
PictogramActivity.this.deleting=false; PictogramActivity.this.deleting=false;
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
android:layout_height="@dimen/picto_big_height" android:layout_height="@dimen/picto_big_height"
android:id="@+id/picto_grid_item_layout_big" android:id="@+id/picto_grid_item_layout_big"
android:background="@color/picto_default_background" android:background="@color/picto_default_background"
android:padding="@dimen/picto_padding"> >
<ImageView <ImageView
android:id="@+id/picto_grid_item_image_big" android:id="@+id/picto_grid_item_image_big"
......
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