mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
fixed final akwizgran comments
This commit is contained in:
@@ -67,15 +67,13 @@ public class ThreadItemAdapter<I extends ThreadItem>
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setItemWithIdVisible(MessageId messageId) {
|
void setItemWithIdVisible(MessageId messageId) {
|
||||||
if (messageId != null) {
|
int pos = 0;
|
||||||
int pos = 0;
|
for (I item : items) {
|
||||||
for (I item : items) {
|
if (item.getId().equals(messageId)) {
|
||||||
if (item.getId().equals(messageId)) {
|
layoutManager.scrollToPosition(pos);
|
||||||
layoutManager.scrollToPosition(pos);
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
pos++;
|
|
||||||
}
|
}
|
||||||
|
pos++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ public abstract class ThreadListActivity<G extends NamedGroup, A extends ThreadI
|
|||||||
int position =
|
int position =
|
||||||
layoutManager.findFirstVisibleItemPosition();
|
layoutManager.findFirstVisibleItemPosition();
|
||||||
I i = adapter.getItemAt(position);
|
I i = adapter.getItemAt(position);
|
||||||
return i == null ? null : adapter.getItemAt(position).getId();
|
return i == null ? null : i.getId();
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,20 +6,17 @@ import org.briarproject.bramble.api.data.BdfEntry;
|
|||||||
import org.briarproject.bramble.api.db.DatabaseComponent;
|
import org.briarproject.bramble.api.db.DatabaseComponent;
|
||||||
import org.briarproject.bramble.api.sync.GroupId;
|
import org.briarproject.bramble.api.sync.GroupId;
|
||||||
import org.briarproject.bramble.api.sync.MessageId;
|
import org.briarproject.bramble.api.sync.MessageId;
|
||||||
|
import org.briarproject.bramble.test.BrambleMockTestCase;
|
||||||
import org.briarproject.bramble.test.TestUtils;
|
import org.briarproject.bramble.test.TestUtils;
|
||||||
import org.briarproject.briar.api.client.MessageTracker;
|
import org.briarproject.briar.api.client.MessageTracker;
|
||||||
import org.briarproject.briar.test.BriarTestCase;
|
|
||||||
import org.jmock.Expectations;
|
import org.jmock.Expectations;
|
||||||
import org.jmock.Mockery;
|
|
||||||
import org.junit.After;
|
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.briarproject.briar.client.MessageTrackerConstants.GROUP_KEY_STORED_MESSAGE_ID;
|
import static org.briarproject.briar.client.MessageTrackerConstants.GROUP_KEY_STORED_MESSAGE_ID;
|
||||||
|
|
||||||
public class MessageTrackerTest extends BriarTestCase {
|
public class MessageTrackerTest extends BrambleMockTestCase {
|
||||||
|
|
||||||
protected final Mockery context = new Mockery();
|
|
||||||
protected final GroupId groupId = new GroupId(TestUtils.getRandomId());
|
protected final GroupId groupId = new GroupId(TestUtils.getRandomId());
|
||||||
protected final ClientHelper clientHelper =
|
protected final ClientHelper clientHelper =
|
||||||
context.mock(ClientHelper.class);
|
context.mock(ClientHelper.class);
|
||||||
@@ -50,8 +47,4 @@ public class MessageTrackerTest extends BriarTestCase {
|
|||||||
Assert.assertTrue(messageId.equals(loadedId));
|
Assert.assertTrue(messageId.equals(loadedId));
|
||||||
}
|
}
|
||||||
|
|
||||||
@After
|
|
||||||
public void checkExpectations() {
|
|
||||||
context.assertIsSatisfied();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user