-3

I am trying to attempt the below :

What i am trying to do is whenever a user click on a button, it will add a image to the layout(which the user can scale and move to any position within the layout). The user can repeat this process hence if the user click 6 times on the button, there should be 6 image in the layout.

i have google around, looking for some sample but ain't sure if its the correct one to use. maybe i did not use the correct keyword to search. So far i have seen is endless adapter and RecyclerView but both seen to be mainly for "ListView" type.

Anyone can suggest or share a link/example that i can read up and learn from? It will be a great help.

Lockon
  • 11
  • 3

1 Answers1

0

If you want to add image on button click set on-click listener on it. You need to get how many time the user have clicked the button.

    btn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
             //get adapter and view
             //get image to add
             addImage(i); //to desire view

        }
    });
  • You can also use counter and loop for repeated process – SUDARSHAN BHALERAO Jan 29 '16 at 11:38
  • Hi sir thanks for the reply. so for the get adapter will can i use the endless adapter (which i see from the demo of it, it was demo in listview) – Lockon Jan 30 '16 at 06:01
  • It's the thing totally depends on your requirement. you can refer this (http://stackoverflow.com/questions/14785547/implementing-the-endless-adapter) for more detail about implementing endless adaptor – SUDARSHAN BHALERAO Jan 30 '16 at 09:34