Skip to content

Commit

Permalink
Update and speed up ConferenceList screen.
Browse files Browse the repository at this point in the history
  • Loading branch information
abelsson committed May 26, 2011
1 parent 28426bd commit 238d048
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 206 deletions.
2 changes: 1 addition & 1 deletion res/layout/main.xml
Expand Up @@ -15,5 +15,5 @@
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center"
android:text="@string/no_unreads"/>
android:text="@string/fetching_conferences"/>
</LinearLayout>
1 change: 1 addition & 0 deletions res/values/strings.xml
Expand Up @@ -25,6 +25,7 @@
<string name="no_recipient_error">No such recipient</string>
<string name="no_conference_error">No such conference</string>
<string name="no_unreads">Nothing to read</string>
<string name="fetching_conferences">Loading unreads..</string>
<string name="local_time">(local)</string>

<string name="login_name">Username:</string>
Expand Down
7 changes: 6 additions & 1 deletion src/org/lindev/androkom/AsyncMessages.java
Expand Up @@ -4,11 +4,14 @@
import java.util.HashSet;
import java.util.Set;

import org.lindev.androkom.KomServer.TextInfo;

import nu.dll.lyskom.AsynchMessage;
import nu.dll.lyskom.AsynchMessageReceiver;
import nu.dll.lyskom.Hollerith;
import nu.dll.lyskom.KomToken;
import nu.dll.lyskom.RpcFailure;
import nu.dll.lyskom.TextStat;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Message;
Expand All @@ -17,7 +20,7 @@

public class AsyncMessages implements AsynchMessageReceiver
{
private static final String TAG = "Androkom AsyncMessages";
private static final String TAG = "Androkom";

private final App app;
private final Set<AsyncMessageSubscriber> subscribers;
Expand Down Expand Up @@ -141,6 +144,7 @@ private Message processMessage(final AsynchMessage asynchMessage)
case nu.dll.lyskom.Asynch.new_text:
Log.d(TAG, "New text created.");
Log.d(TAG, "Trying to cache text " + params[0].intValue());
TextStat foo = new TextStat();
try {
kom.getSession().getText(params[0].intValue());
} catch (RpcFailure e) {
Expand Down Expand Up @@ -195,6 +199,7 @@ protected Message doInBackground(final AsynchMessage... message)
@Override
protected void onPostExecute(final Message msg)
{
Log.d(TAG, "Number of async subscribers: " + subscribers.size());
for (AsyncMessageSubscriber subscriber : subscribers)
{
subscriber.asyncMessage(msg);
Expand Down

0 comments on commit 238d048

Please sign in to comment.