本文整理了Java中com.zulip.android.ZulipApp.getMaxMessageId()
方法的一些代码示例,展示了ZulipApp.getMaxMessageId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZulipApp.getMaxMessageId()
方法的具体详情如下:
包路径:com.zulip.android.ZulipApp
类名称:ZulipApp
方法名:getMaxMessageId
暂无
代码示例来源:origin: zulip/zulip-android
private Boolean listHasMostRecent() {
return lastMessageId == app.getMaxMessageId();
}
代码示例来源:origin: zulip/zulip-android
public static void updateNewMessagesRange(ZulipApp app, int maxId) {
synchronized (app.updateRangeLock) {
RuntimeExceptionDao<MessageRange, Integer> rangeDao = app
.getDao(MessageRange.class);
MessageRange currentRange = MessageRange.getRangeContaining(
app.getMaxMessageId(), rangeDao);
if (currentRange == null) {
currentRange = new MessageRange(app.getMaxMessageId(),
app.getMaxMessageId());
}
if (currentRange.high <= maxId) {
currentRange.high = maxId;
rangeDao.createOrUpdate(currentRange);
}
}
app.setMaxMessageId(maxId);
}
代码示例来源:origin: zulip/zulip-android
@Override
protected void onPostExecute(String result) {
if (receivedMessages != null) {
Log.v("poll", "Processing messages received.");
if ((position == LoadPosition.BELOW || position == LoadPosition.INITIAL)
&& app.getMaxMessageId() == rangeHigh) {
noFurtherMessages = true;
}
listener.onMessages(receivedMessages.toArray(new Message[receivedMessages.size()]),
position, recursedAbove, recursedBelow, noFurtherMessages);
callback.onTaskComplete(receivedMessages.size() + "", null);
} else {
listener.onMessageError(position);
Log.v("poll", "No messages returned.");
callback.onTaskFailure("");
}
}
代码示例来源:origin: zulip/zulip-android
public void showLatestMessages() {
if (listHasMostRecent()) {
recyclerView.scrollToPosition(adapter.getItemCount() - 1);
} else {
loadMessageId(app.getMaxMessageId());
}
}
代码示例来源:origin: zulip/zulip-android
public boolean isScrolledToLastMessage() {
int index = stickyLayoutManager.findLastVisibleItemPosition();
if (index == -1) return false;
Object object = adapter.getItem(index);
if (object instanceof Integer) {
/**
* A Loading Indicator (see here {@link RecyclerMessageAdapter#getItemViewType})
* Therefore before this should be a message
*/
object = adapter.getItem(index - 1);
}
return object instanceof Message && (((Message) object).getId() >= app.getMaxMessageId() - 2);
}
代码示例来源:origin: zulip/zulip-android
if (after > 0 && rng.high != app.getMaxMessageId()) {
this.recurse(LoadPosition.BELOW, after, rng,
afterAnchor);
代码示例来源:origin: zulip/zulip-android
+ app.getMaxMessageId());
return;
代码示例来源:origin: zulip/zulip-android
@Before
public void setUp() {
app = ZulipApp.get();
if (ZulipApp.get().getApiKey() == null) {
BaseTest baseTest = new BaseTest();
baseTest.login();
sleep(4000);
}
//This is to make sure the latest recieved messages will be added to the list!
app.setPointer(app.getMaxMessageId());
setTestMessageStream((testMessageStream == null) ? RandomStringUtils.randomAlphanumeric(10) : testMessageStream);
setTestMessagePrivate((testMessagePrivate == null) ? RandomStringUtils.randomAlphanumeric(15) : testMessagePrivate);
}
内容来源于网络,如有侵权,请联系作者删除!