Hi,

I'm going to create a custom keyboard app. One feature is, that an
user can resize the keys.
Currently I'm doing this by firstly creating a button, which can be
resized and letters can be entered. In the second step, the button
should be transformed into a key. Resizing is done by two buttons,
making by onClick the "Key-Button" bigger and smaller. But i think
it's very annoying to do 20 clicks if you want a 20 times bigger
button.
So i tried to use onLongClick, that if a resize button is pushed and
held, the "Key-Button" should be resized.

But my problem at the moment is, that the onLongClickListener-method
doesn't work properly. I tried it like this:

 zoomin_button.setOnLongClickListener(new OnLongClickListener(){

                        public boolean onLongClick(View v){
                                int height = current_button.getHeight();
                        int width = current_button.getWidth();
                        boolean longclick = true;

                        while(longclick == true){
                                current_button.setHeight(height+2);
                                current_button.setWidth(width+2);
                        }
                        Toast.makeText(BApp.this, "Long Click", 
Toast.LENGTH_SHORT).show();
                        return true;
                        }
          });


If I do it like this, after a short time I get a message which says:
"Activity xy doesn't react".
While I tried it like:

 zoomin_button.setOnLongClickListener(new OnLongClickListener(){

                        public boolean onLongClick(View v){
                                int height = current_button.getHeight();
                        int width = current_button.getWidth();

                                current_button.setHeight(height+2);
                                current_button.setWidth(width+2);

                        Toast.makeText(BApp.this, "Long Click", 
Toast.LENGTH_SHORT).show();
                        return true;
                        }
          });

The Toast shows up but the button isn't resized.

Okai. If you have any suggestion how this can be solved I would be
deeply grateful !

Thanks in advance !

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to