Recent

Author Topic: [LAMW] jButton - problems of using  (Read 5744 times)

bmcsoft

  • New Member
  • *
  • Posts: 21
[LAMW] jButton - problems of using
« 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?

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: [LAMW] jButton - problems of using
« Reply #1 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...
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

mihhim

  • Newbie
  • Posts: 5
Re: [LAMW] jButton - problems of using
« Reply #2 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
« Last Edit: February 07, 2021, 09:33:36 am by mihhim »

bmcsoft

  • New Member
  • *
  • Posts: 21
Re: [LAMW] jButton - problems of using
« Reply #3 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?
« Last Edit: February 07, 2021, 09:37:25 am by bmcsoft »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: [LAMW] jButton - problems of using
« Reply #4 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....

Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

mihhim

  • Newbie
  • Posts: 5
Re: [LAMW] jButton - problems of using
« Reply #5 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/
« Last Edit: June 23, 2021, 12:21:37 pm by mihhim »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: [LAMW] jButton - problems of using
« Reply #6 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?
« Last Edit: June 23, 2021, 07:19:13 pm by jmpessoa »
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

mihhim

  • Newbie
  • Posts: 5
Re: [LAMW] jButton - problems of using
« Reply #7 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.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2296
Re: [LAMW] jButton - problems of using
« Reply #8 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....]
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

mihhim

  • Newbie
  • Posts: 5
Re: [LAMW] jButton - problems of using
« Reply #9 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?
« Last Edit: June 24, 2021, 12:24:17 pm by mihhim »

Mongkey

  • Sr. Member
  • ****
  • Posts: 430
Re: [LAMW] jButton - problems of using
« Reply #10 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.
« Last Edit: June 24, 2021, 12:57:10 pm by Mongkey »

mihhim

  • Newbie
  • Posts: 5
Re: [LAMW] jButton - problems of using
« Reply #11 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!

Mongkey

  • Sr. Member
  • ****
  • Posts: 430
Re: [LAMW] jButton - problems of using
« Reply #12 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