Jul 24 | 3:55 PM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
Jul 24 | 4:10 PM |
Aditya | has entered the room |
Aditya |
Hello MArk..
|
Mark M. |
howdy, Aditya!
|
Mark M. |
how can I help you today?
|
Aditya |
I have been following you since long.. I like the work you do..
|
Aditya |
I am a Android Developer
|
Mark M. |
thanks!
|
Jul 24 | 4:15 PM |
Aditya |
ok...in my Apps..I use custom keyboard as a custom view and slide it in and out on touch of edittext
|
Aditya |
I don't include it as a service...so.I have to always hide the soft keyboard..
|
Mark M. |
if you do not want to use the device's hard keyboard or soft keyboard, why are you using an EditText?
|
Lujop | has entered the room |
Lujop |
Hi
|
Mark M. |
howdy, Lujop!
|
Mark M. |
Lujop: I will be with you momentarily, once Aditya's first question is handled
|
Aditya |
this has worked marvelously well before JElly
Bean..from Jelly bean..I think because of Project butter..when I am
pressing a key on my custom keyboard..the sift keyboard tries to push in
but hides and this is causing the screen to flash and push my keyboard
up....then what would you suggest to use?
|
Aditya |
*soft
|
Lujop |
Ok. I wait then. Thank you
|
Mark M. |
why do you have "custom keyboard as a custom view" in the first place? Why not let the user use their own keyboard?
|
Jul 24 | 4:20 PM |
Mark M. |
in other words, what are you and the user gaining from this custom keyboard?
|
Aditya |
The soft keyboard showing up and hiding process is
manifesting as a screen flash..because the custom keyboard provides
symbols and other keys which are not being used on soft keyboard..greek
letters..chemical elements..tan sin functions..and lots of other keys
|
Aditya |
each of my apps uses a different keyboard..and
they have different keys..and I don't want my keyboards to be used by
other apps, so I am not using it as a service
|
Aditya |
keyboards on android are a pain..which I have found out since last 9 months or so
|
Mark M. |
first, I really recommend that your own "custom
keyboard" be a supplement to the existing keyboard, not a replacement
(i.e., allow the user to use their own keyboard for letters, numbers,
etc.)
|
Mark M. |
beyond that, though, I have no idea how to help you
|
Aditya |
how would I supplement my custom keyboard to the existing keyboard?
|
Mark M. |
start by not trying to fight the existing keyboard, allowing it to appear
|
Mark M. |
also, remove any likely duplicates (letters, numbers)
|
Jul 24 | 4:25 PM |
Aditya |
so you suggest me to have the custom keyboard on
top of the soft keyboard? have you seen any instances of people coming
up with their own keyboards in their apps?
|
Mark M. |
I cannot answer either of those questions, sorry
|
Mark M. |
let me take a question from Lujop, and I will come back to you shortly
|
Mark M. |
Lujop: do you have a question?
|
Aditya |
sure..
|
Lujop |
Yes
|
Lujop |
I've a problem with FragmentPageAdapter and dynamically inserting pages
|
Lujop |
I tried with FragmentPagerAdapter and
FragmentStatePagerAdapter but I can't get it working without a
workarround to discard and create always pages
|
Lujop |
I've a question on SO with the sample code http://stackoverflow.com/questions/1084023…
|
Mark M. |
I suspect that you will need to create your own custom PagerAdapter, but that is just a guess
|
Lujop |
Do you have any idea on what can be happening or id I'm doing something wrong?
|
Jul 24 | 4:30 PM |
Lujop |
Mmmm, I look a moment at the code of FragmentPagerAdapter/PagerAdapter
|
Mark M. |
you could also try swapping in a fresh PagerAdapter when you insert stuff, but that too is just a guess
|
Mark M. |
it's a good question, but I just haven't tried this
|
Lujop |
Yes it seems that the interface support insertion
|
Mark M. |
have you played with returning POSITION_UNCHANGED from getItemPosition()?
|
Lujop |
But the implementation seems a little trivial
|
Mark M. |
you mentioned POSITION_NONE, but that is for removed pages
|
Lujop |
mmm, but the position really changes normally
|
Mark M. |
only for the ones after the insertion point
|
Mark M. |
ones before the insertion point are unchanged
|
Lujop |
Yes, but I need to insert at the second position
|
Mark M. |
the first page would still return POSITION_UNCHANGED
|
Jul 24 | 4:35 PM |
Lujop |
I will try
|
Mark M. |
again, it's just some educated guesses
|
Mark M. |
Aditya: do you have another question, or a follow-up from your first one?
|
Lujop |
But I think that I will need to go on custom pageradapter as you said.
|
Aditya |
The major issue was with Keyboards..and I was looking to see if you had any ideas..
|
Mark M. |
trying to block the soft keyboard is just going to
be difficult, particularly since this is an area where device
manufacturers like to tinker with Android
|
Aditya |
you are perfectly right..behavior is weird with different devices..
|
Mark M. |
that is why your typical calculator app does not use an EditText
|
Aditya |
then what you suggest me to use
|
Mark M. |
since I have absolutely no idea what your app is or what you are trying to accomplish, that is impossible for me to answer
|
Jul 24 | 4:40 PM |
Aditya |
ok..I need to type in some stuff and there is computation going on..and the results how up
|
Aditya |
*show
|
Aditya |
it is sort of a general calculator..
|
Mark M. |
then I would model your app after existing popular calculator apps
|
Mark M. |
see what they do, and follow suit
|
Mark M. |
for example, I use Droid48
|
Aditya |
ok...can you name me some..
|
Aditya |
ok
|
Mark M. |
it has an on-screen keyboard, but it does not use an EditText
|
Mark M. |
I do not know whether they are using a TextView and custom fonts, or are drawing on a Canvas, for rendering the RPN stack
|
Aditya |
ok
|
Mark M. |
you can find other calculator apps on the Play Store
|
Mark M. |
Lujop: do you have another question?
|
Aditya |
I will try looking at them..thanks
|
Lujop |
Can I ask another question?
|
Jul 24 | 4:45 PM |
Mark M. |
Lujop: yes
|
Lujop |
I'm using your MergeAdapter
|
Lujop |
And until now it works very easy an well
|
Lujop |
I use addView to add some sort of header rows
|
Lujop |
and addAdapter for data
|
Lujop |
The problem is that now I need to have a button in some rows that do a row change
|
Lujop |
the typeOfView of the row is changed
|
Lujop |
There isn'tsome support for data invalidation, is there?
|
Mark M. |
the type of a row cannot change, regardless of MergeAdapter
|
Mark M. |
AFAIK, that has to be immutable for the life of the adapter
|
Lujop |
Woww....
|
Lujop |
I supposed I can change with notifyDataSetChanged()
|
Mark M. |
you can give that a try
|
Mark M. |
if changing row types works with ArrayAdapter, and
does not work with MergeAdapter wrapping around the ArrayAdapter, file
an issue on the project, and I'll take a look at it
|
Mark M. |
but I have never seen that done
|
Jul 24 | 4:50 PM |
Lujop |
Mmm, I've seen some applications
|
Lujop |
I've seen some applications that have like a page advance button for the row
|
Lujop |
that when pressed changes the content of the row
|
Mark M. |
just because a row changes visually does not mean that getItemViewType() returns a different value
|
Lujop |
yes, if it doesn't works I will have to play with visibility
|
Lujop |
or discarding reusedview
|
Mark M. |
or just change the contents of your row view
|
Lujop |
And if I have some sort of expand rows button in the header views and then call notifyDataSetChanged
|
Lujop |
MergeAdapter will get the new rows from the managed child adapters, won't it?
|
Mark M. |
it should, yes
|
Mark M. |
if not, that is a bug
|
Lujop |
Okey. I will have to play on it then. I connected mainly for the first question.
|
Mark M. |
Aditya: do you have another question?
|
Jul 24 | 4:55 PM |
Mark M. |
do either of you have another question?
|
Lujop |
Yes
|
Lujop |
I've a last one
|
Lujop |
In current version app I use a DB that is stored in internal memory
|
Lujop |
For a future version I'm evaluating to move to SD because the DB is quite big
|
Aditya |
I don't have any questions..Thanks
|
Lujop |
But the problem is that application needs the DB mainly in all places
|
Mark M. |
starting with API Level 11, internal and external storage should share a partition, and so size is less of an issue
|
Lujop |
And I don't know if there is a good centralized way
|
Lujop |
that I can advice the user that application doesn't work like the phone is connected with usb and sd disconnected
|
Lujop |
Well, in API11 devices I think that the problem in DB size is minor
|
Mark M. |
can you quantify "quite big"?
|
Lujop |
about 2MB
|
Mark M. |
oh, I really would not worry about that
|
Lujop |
But there are a quite descent number of users complaining about that
|
Mark M. |
and if you move it to external storage, you will
have a decent number of users complaining about that (i.e., unavailable
when tethered)
|
Jul 24 | 5:00 PM |
Lujop |
But in general is there a good centralized way to catch up if we haven't external storage
|
Mark M. |
you can listen for the broadcast Intents
|
Lujop |
ok
|
Lujop |
Because also I'm plannig to move some other sort of data to the SD
|
Lujop |
And application won't work without that.
|
Lujop |
The idea is then to listen itents and leave a global I_CANT_WORK_BECAUSE_NO_SD state...
|
Mark M. |
you will also need to check the state manually, via Environment, for when your app is started up with a fresh process
|
Mark M. |
and that is it for today's chat
|
Lujop |
Ok I will evaluate that
|
Mark M. |
next chat is Thursday, 10am Eastern Time
|
Mark M. |
have a pleasant day, all!
|
Lujop |
But I think that will be difficult one
|
Lujop |
Because when receiving state change there can be working threads...
|
Lujop |
Ok. Thank you Mark
|
Aditya | has left the room |
Lujop | has left the room |
Mark M. | turned off guest access |