Lazarus

Programming => Operating Systems => Android => Topic started by: bmcsoft on February 06, 2021, 07:15:42 pm

Title: [LAMW] jButton - problems of using
Post by: bmcsoft on February 06, 2021, 07:15:42 pm
We use in our program Jbutton as part of the chessboard.
There are 2 problem:

1. On the different Android device Jbutton captions looks very different. I run the same apk file on 2 different devices. 
On  the first  the first device the captions of Jbuttons is good (see attached screenshot 1), but on the second device the captions almost invisible (see attached screenshot 2).

Can this problem be solved? Can Jbutton caption be seen properly on any type of Android device?

2.We need to have 2 different types of pressing JButton. On PC It was left and right mouse click. Can 2 types of pressing be made with the Jbutton? For example short tap and long tap?
Title: Re: [LAMW] jButton - problems of using
Post by: jmpessoa on February 06, 2021, 07:43:13 pm
Quote
Can Jbutton caption be seen properly on any type of Android device?

How you set properties "LayoutParamHeight'    and LayoutParamWidth" ?


Quote
Can 2 types of pressing be made with the Jbutton? For example short tap and long tap?

I will try some solution...
Title: Re: [LAMW] jButton - problems of using
Post by: mihhim on February 07, 2021, 07:00:08 am
Quote
Can Jbutton caption be seen properly on any type of Android device?

How you set properties "LayoutParamHeight'    and LayoutParamWidth" ?

LayoutParamHeight and LayoutParamWidth = IpExact

Quote
Quote
Can 2 types of pressing be made with the Jbutton? For example short tap and long tap?

I will try some solution...
Thanks
Title: Re: [LAMW] jButton - problems of using
Post by: bmcsoft on February 07, 2021, 08:48:26 am
Mihhim and me work together on the same problem. We want to create playable chessboard with figures and symbols on it.

jmpessoa, if we will use jGridView instead of jButton, can we use 2 types of pressing?

Also we need to swipe board left to show chatbox. Where we can read about using navigation gestures in LAMW?
Title: Re: [LAMW] jButton - problems of using
Post by: jmpessoa on February 07, 2021, 03:58:00 pm
Quote
LayoutParamHeight and LayoutParamWidth = IpExact

"IpExact"  not scale ....

So, on the different Android devices Jbutton looks very different!

You need jPanel and more jPanels.....

I will try to do some example and put here....

Title: Re: [LAMW] jButton - problems of using
Post by: mihhim on June 23, 2021, 11:45:25 am

I will try to do some example and put here....

Good day, J.M. Pessoa. Would you be so kind to add two types of pressing jbutton in LAMW and others manipulations
(specific android gestures)?
The development of our and may be many others android applications is stopped without them. Thanks.

May be this will help:

https://www.androidauthority.com/android-gesture-tutorial-1032515/
Title: Re: [LAMW] jButton - problems of using
Post by: jmpessoa on June 23, 2021, 07:16:40 pm
Quote
add two types of pressing jbutton...

What?

Quote
and others manipulations

What?

Quote
(specific android gestures)?

Where?
Title: Re: [LAMW] jButton - problems of using
Post by: mihhim on June 23, 2021, 10:08:24 pm
Quote
add two types of pressing jbutton...

What?

We need equivalents left and right type mouse button clicks  that is on PC. For example 2 different reactions for Jbutton on touch and double touch on Jbutton. Our game need two different event from Jbutton. It can be realized for example by  the simple touch and the double touch of jbutton.
Is it possible? Thanks.
Here is our old version of the Game on English for PC as example.
https://yadi.sk/d/XN9P9hv23YkPjS
New versions is much better, but they are not on English yet.
Title: Re: [LAMW] jButton - problems of using
Post by: jmpessoa on June 23, 2021, 10:34:28 pm
Quote
For example 2 different reactions for Jbutton on touch and double touch on Jbutton

double touch? No. But we can try implement LONG touch...

Hint: what about jImageView or jBtnButton ?   [not jButton....]
Title: Re: [LAMW] jButton - problems of using
Post by: mihhim on June 24, 2021, 10:51:18 am
Quote
For example 2 different reactions for Jbutton on touch and double touch on Jbutton

double touch? No. But we can try implement LONG touch...

Hint: what about jImageView or jBtnButton ?   [not jButton....]
Thanks. We've learned your advices. We try to use Jpanel now. We would like to know: how to print some text in it? Is any idea?
Title: Re: [LAMW] jButton - problems of using
Post by: Mongkey on June 24, 2021, 12:53:54 pm
Placing jtextview inside panel will do the trick  :), placing jimageview to represent your bishop character also good idea, i think.
Title: Re: [LAMW] jButton - problems of using
Post by: mihhim on June 24, 2021, 06:05:50 pm
Placing jtextview inside panel will do the trick  :), placing jimageview to represent your bishop character also good idea, i think.
Thanks!
Title: Re: [LAMW] jButton - problems of using
Post by: Mongkey on June 25, 2021, 04:27:28 pm
 :D :D , read and practice more you'll find answer provided by LAMW of all your questions.
TinyPortal © 2005-2018