mirror of
https://github.com/moparisthebest/Yaaic
synced 2024-11-25 18:32:15 -05:00
ConversationActivity: notify the whole deck only as fallback
This commit is contained in:
parent
fbb74184d5
commit
11eabc723e
@ -28,6 +28,7 @@ import android.content.IntentFilter;
|
|||||||
import android.content.ServiceConnection;
|
import android.content.ServiceConnection;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
@ -49,6 +50,7 @@ import android.widget.TableLayout.LayoutParams;
|
|||||||
import org.yaaic.R;
|
import org.yaaic.R;
|
||||||
import org.yaaic.Yaaic;
|
import org.yaaic.Yaaic;
|
||||||
import org.yaaic.adapter.DeckAdapter;
|
import org.yaaic.adapter.DeckAdapter;
|
||||||
|
import org.yaaic.adapter.MessageListAdapter;
|
||||||
import org.yaaic.command.CommandParser;
|
import org.yaaic.command.CommandParser;
|
||||||
import org.yaaic.irc.IRCBinder;
|
import org.yaaic.irc.IRCBinder;
|
||||||
import org.yaaic.irc.IRCService;
|
import org.yaaic.irc.IRCService;
|
||||||
@ -236,10 +238,8 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
|||||||
// not all children like the adapter so getChildAt() will return
|
// not all children like the adapter so getChildAt() will return
|
||||||
// no child view or not the view that is logical connected to
|
// no child view or not the view that is logical connected to
|
||||||
// the item in the adapter at the same position. So we just
|
// the item in the adapter at the same position. So we just
|
||||||
// notify the whole deck adapter.
|
// notify the whole deck adapter (as fallback).
|
||||||
deckAdapter.notifyDataSetChanged();
|
|
||||||
|
|
||||||
/*
|
|
||||||
Message message = conversation.pollBufferedMessage();
|
Message message = conversation.pollBufferedMessage();
|
||||||
|
|
||||||
int position = deckAdapter.getPositionByName(target);
|
int position = deckAdapter.getPositionByName(target);
|
||||||
@ -251,12 +251,12 @@ public class ConversationActivity extends Activity implements ServiceConnection,
|
|||||||
adapter.addMessage(message);
|
adapter.addMessage(message);
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "MessageListView Adapter is null (position: " + position + ")");
|
Log.d(TAG, "MessageListView Adapter is null (position: " + position + ")");
|
||||||
|
// Fallback: We could not get the MessageListAdapter. Notify the whole deck
|
||||||
|
deckAdapter.notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
if (deckAdapter.isSwitched() && target.equals(deckAdapter.getSwitchedName())) {
|
if (deckAdapter.isSwitched() && target.equals(deckAdapter.getSwitchedName())) {
|
||||||
Message message = conversation.pollBufferedMessage();
|
|
||||||
MessageListView switchedView = deckAdapter.getSwitchedView();
|
MessageListView switchedView = deckAdapter.getSwitchedView();
|
||||||
switchedView.getAdapter().addMessage(message);
|
switchedView.getAdapter().addMessage(message);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user