I tested straygecko's approach instead of adding layout_width, and gtalk didn't crash. It runs fine on execution. Still the keyboard doesn't popup though. Believing that I can find a working alternative, I tried Xabber. Well, it suffered exactly the same problem: no keyboard popping up, and no auto scrolling down to the new message. I tried the same change I suggested for the keyboard issue with gtalk to Xabber, and it did take care of it.
Regarding the scroll issue, the root cause is that android:transcriptMode attribute in the chat_view.xml, which automatically sets the message list view anchored to the bottom, is not supported on NST. You can easily confirm this in the logcat output. Also android:stackFromBottom behaves somehow weirdly because on NST list view always scrolls by page. For example, when there are 25 items on a list that can show 10 items at a time, you can see the items from 1~10, 11~20, and 21~25, but not from 16~25. So, when the list size is smaller than the page size, android:stackFromBottom works fine. However, when bigger, it only shifts the items on the last page, like 21~25 in the previous example, to the bottom.
At least we can do something for the android:transcriptMode issue by force-scrolling the list all the way down whenever the list is updated (new messages on gtalk). Find ChatView$ChatAdapter.smali under smali/com/google/android/talk, and add the following code. What's being done in the code is that scroll events are being monitored, and when there is an update to the message list (except when user manually scrolls), the list is scrolled all the ways down to the last item.
1. add the following after line 24:
2. Find "onScroll" method. Modify its first line to ".locals 1" (from 0 to 1). Then at the end of the same method right before "return-void", insert the following code:
3. Find "onScrollStateChanged" method. Then at the end of the method right before "return-void", insert the following code:
Read my previous post to figure out how to download, decompile, build, sign, and replace the Talk.apk file. It sounds a bit daunting, but once you go through the process, you can hack any app you want. Also don't forget to apply the other changes (removing "|textShortMessage" from chat_screen.xml, and adding "<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="9" />" to AndroidManifest.xml as suggested by straygecko).
Regarding the scroll-only-by-page issue, I think we really cannot do anything at this point. Maybe injecting some dummy messages to the beginning of the list? Oh well...
Regarding the scroll issue, the root cause is that android:transcriptMode attribute in the chat_view.xml, which automatically sets the message list view anchored to the bottom, is not supported on NST. You can easily confirm this in the logcat output. Also android:stackFromBottom behaves somehow weirdly because on NST list view always scrolls by page. For example, when there are 25 items on a list that can show 10 items at a time, you can see the items from 1~10, 11~20, and 21~25, but not from 16~25. So, when the list size is smaller than the page size, android:stackFromBottom works fine. However, when bigger, it only shifts the items on the last page, like 21~25 in the previous example, to the bottom.
At least we can do something for the android:transcriptMode issue by force-scrolling the list all the way down whenever the list is updated (new messages on gtalk). Find ChatView$ChatAdapter.smali under smali/com/google/android/talk, and add the following code. What's being done in the code is that scroll events are being monitored, and when there is an update to the message list (except when user manually scrolls), the list is scrolled all the ways down to the last item.
1. add the following after line 24:
.field public mIgnore:I
2. Find "onScroll" method. Modify its first line to ".locals 1" (from 0 to 1). Then at the end of the same method right before "return-void", insert the following code:
iget v0, p0, Lcom/google/android/talk/ChatView$ChatAdapter;->mIgnore:I
if-nez v0, :ignore
add-int/2addr p2, p3
if-eq p2, p4, :ignore
const/4 v0, 0x1
sub-int/2addr p4, v0
invoke-virtual {p1, p4}, Landroid/widget/AbsListView;->setSelection(I)V
:ignore
const/4 v0, 0x0
iput v0, p0, Lcom/google/android/talk/ChatView$ChatAdapter;->mIgnore:I
if-nez v0, :ignore
add-int/2addr p2, p3
if-eq p2, p4, :ignore
const/4 v0, 0x1
sub-int/2addr p4, v0
invoke-virtual {p1, p4}, Landroid/widget/AbsListView;->setSelection(I)V
:ignore
const/4 v0, 0x0
iput v0, p0, Lcom/google/android/talk/ChatView$ChatAdapter;->mIgnore:I
3. Find "onScrollStateChanged" method. Then at the end of the method right before "return-void", insert the following code:
iget v0, p0, Lcom/google/android/talk/ChatView$ChatAdapter;->mIgnore:I
const/4 v1, 0x1
xor-int/2addr v0, v1
iput v0, p0, Lcom/google/android/talk/ChatView$ChatAdapter;->mIgnore:I
const/4 v1, 0x1
xor-int/2addr v0, v1
iput v0, p0, Lcom/google/android/talk/ChatView$ChatAdapter;->mIgnore:I
Read my previous post to figure out how to download, decompile, build, sign, and replace the Talk.apk file. It sounds a bit daunting, but once you go through the process, you can hack any app you want. Also don't forget to apply the other changes (removing "|textShortMessage" from chat_screen.xml, and adding "<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="9" />" to AndroidManifest.xml as suggested by straygecko).
Regarding the scroll-only-by-page issue, I think we really cannot do anything at this point. Maybe injecting some dummy messages to the beginning of the list? Oh well...
I found some info on the layout_width problem and it seems to apply to the keyboard problem as well. It seems to have something to do with SDK compatibility behaviors. Talk doesn't declare a minimum SDK level its compatible with or a target SDK so Android tries to use some compatibility behaviors for Android 1.0. I found a reference to this problem that said a fix was to declare minimum SDK level 7 and target SDK level 9. I tested that and Talk opens fine, doesn't crash and the keyboard seems to display properly. But I don't use Talk so I don't have any way of testing further. Would you try adding the following line to AndroidManifest.xml without any of the other changes to the layouts you have been trying and let me know how it goes.
Code:<uses-sdk android:minSdkVersion="7" android:targetSdkVersion="9" />