2

I am working on collage app. Currently, i have done adding images in individual blocks. I have done it by keeping 1 relative layout in xml and then in code by inflating collage layout in that relative layout. In that inflated view, i am dynamically adding views.

But now my problem is that i have to add stickers on that. I searched a lot for way to add it. If i add stickers using addView() then all those views behind, wont be accessible.

Any hint/help will be appreciated.

Thanks.

enter image description here

View localView = ((LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE))
                        .inflate(R.layout.frame_six, null);
layoutBox1 = (LinearLayout) localView
                        .findViewById(R.id.six_one);
layout_addPictures.addView(
                    localView,
                    new RelativeLayout.LayoutParams(layout_addPictures
                            .getLayoutParams().width, layout_addPictures
                            .getLayoutParams().height));

BlockView localBlockView = new BlockView(getApplicationContext(),
                    BitmapFactory.decodeFile(imagePath));
layoutBox1.addView(localBlockView);

BlockView is my custom view used for collage blocks.

Dig
  • 254
  • 1
  • 9
  • what do you mean by the views behind the stickers not becoming accessible? – arnorhs Apr 16 '14 at 06:01
  • You can translate, zoom and rotate the images in collage blocks. so if i add stickers as another view,then those block images cannot react to those gestures. – Dig Apr 16 '14 at 06:06
  • What kind of views are the stickers? If they're normal views the clicks don't stop on them by default. You can always do view.setClickable(false), but maybe there's more at play. Post your code and maybe I can give you a better answer – arnorhs Apr 16 '14 at 06:36
  • Can you portray an image for your description(showing your Haves and requires)? – sai Apr 16 '14 at 06:38
  • Stickers will be normal images only. I will be having custom view which can hold those stickers added by user. See i have attached 1 image. Orange and red are collage blocks which are dynamically added custom views. and for eg. that santa is a sticker which i have to add it. need to provide all gestures to that sticker too. – Dig Apr 16 '14 at 07:10
  • @arnorhs i have posted some code. i hope u get some more idea. – Dig Apr 16 '14 at 07:16
  • can u please suggest me how to proceed ? – Dig Apr 16 '14 at 10:53
  • That's better but maybe still missing some pieces. Where is your gesture interaction code? Also the layout xml from where the stickers are inflated would be helpful. Did you try setting `localBlockView.setClickable(false)` ? – arnorhs Apr 17 '14 at 03:12
  • yes i tried setting localBlockView.setClickable(false), but of no use. – Dig Apr 17 '14 at 04:49

0 Answers0