Compare commits
132 Commits
beta-2016-
...
384-conver
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b3722ad840 | ||
|
|
a6de1f7144 | ||
|
|
2698e4c181 | ||
|
|
db52b2c29f | ||
|
|
f750280845 | ||
|
|
1e8784efe9 | ||
|
|
7a3bd86522 | ||
|
|
c333052396 | ||
|
|
67aa7c3269 | ||
|
|
85f96d8865 | ||
|
|
89469f9d35 | ||
|
|
55601bc2c3 | ||
|
|
9a4bf598ae | ||
|
|
ee68e35b36 | ||
|
|
8f02cf8307 | ||
|
|
193cdc42d9 | ||
|
|
91492c3068 | ||
|
|
3a3d717884 | ||
|
|
6301b2a9a2 | ||
|
|
c577efacbe | ||
|
|
fa5304c145 | ||
|
|
f0a784b4af | ||
|
|
b2b97f31f3 | ||
|
|
e9789435cc | ||
|
|
ba86690ce0 | ||
|
|
db2d965006 | ||
|
|
b99650b070 | ||
|
|
bc0b226fff | ||
|
|
3ae3fdab63 | ||
|
|
37a5d884b8 | ||
|
|
759b1c7448 | ||
|
|
57ce7e3f63 | ||
|
|
f84bba5d79 | ||
|
|
bb6e249980 | ||
|
|
d8df9c9955 | ||
|
|
ebe80c773d | ||
|
|
123f59cd96 | ||
|
|
f7965edc71 | ||
|
|
66a1f85859 | ||
|
|
7a9290e3a6 | ||
|
|
f270624f39 | ||
|
|
94927c2f60 | ||
|
|
ecbf5621f2 | ||
|
|
4d3a333915 | ||
|
|
9ac1a13711 | ||
|
|
946d7cb3e7 | ||
|
|
b71a303bf8 | ||
|
|
a9996b4fb1 | ||
|
|
9c2250277b | ||
|
|
4176f592df | ||
|
|
91aa81041e | ||
|
|
a8f51fcb8a | ||
|
|
30fe9f6e2a | ||
|
|
5a9615265e | ||
|
|
59320f02b7 | ||
|
|
3e4be038f2 | ||
|
|
a2a5b746c5 | ||
|
|
08cc5500ef | ||
|
|
ee0c4c07a7 | ||
|
|
ac8c1c0eee | ||
|
|
8a29207bd0 | ||
|
|
192ee41600 | ||
|
|
13e3eec6b3 | ||
|
|
9ae64124d3 | ||
|
|
5df2776dc2 | ||
|
|
19fdf3ffd0 | ||
|
|
e7dce02709 | ||
|
|
f823b8ba4c | ||
|
|
dc048187f5 | ||
|
|
da68ef78f1 | ||
|
|
bbed673150 | ||
|
|
69b0bec033 | ||
|
|
a11e30c2b3 | ||
|
|
c5708ee3ce | ||
|
|
e96838e731 | ||
|
|
6697b06530 | ||
|
|
1bb17a3979 | ||
|
|
9d826631e9 | ||
|
|
b26acdf228 | ||
|
|
69fba1aa17 | ||
|
|
1a1dd80810 | ||
|
|
02f432c04e | ||
|
|
3f838b0472 | ||
|
|
5d06f42000 | ||
|
|
4acb59b22a | ||
|
|
bba7083660 | ||
|
|
e3fc015ec3 | ||
|
|
441fce8500 | ||
|
|
a58fb72ab1 | ||
|
|
86039b81c0 | ||
|
|
661140f623 | ||
|
|
19b6afa69f | ||
|
|
7ac7fae30e | ||
|
|
d3b83a50a6 | ||
|
|
5561532c5d | ||
|
|
b03d0a206b | ||
|
|
512940e82b | ||
|
|
d2ba7c9b7f | ||
|
|
a652f1a5d7 | ||
|
|
21b237a629 | ||
|
|
2a7990f5c4 | ||
|
|
92d3e02c82 | ||
|
|
0d16dd0358 | ||
|
|
3f2b85ac0d | ||
|
|
d0852d2265 | ||
|
|
9149b82cc4 | ||
|
|
b13bf66165 | ||
|
|
8c2fd905a1 | ||
|
|
38a4f73cdc | ||
|
|
1a175beac9 | ||
|
|
7e9ff40837 | ||
|
|
bd01c3732e | ||
|
|
9532a60f43 | ||
|
|
d2722eed92 | ||
|
|
886c8feb34 | ||
|
|
c7f73f9247 | ||
|
|
35156d698f | ||
|
|
1366972449 | ||
|
|
3d25c41e7a | ||
|
|
ba928875df | ||
|
|
cac0f30816 | ||
|
|
aad9f5142b | ||
|
|
9d686e16e0 | ||
|
|
2880043c07 | ||
|
|
fb85345392 | ||
|
|
0b67ec9201 | ||
|
|
fcf21b7ed7 | ||
|
|
6e545d0100 | ||
|
|
69026054cd | ||
|
|
db4b79fcae | ||
|
|
7412ca59ac | ||
|
|
ec083d617e |
@@ -2,10 +2,6 @@ apply plugin: 'com.android.library'
|
|||||||
apply plugin: 'witness'
|
apply plugin: 'witness'
|
||||||
apply plugin: 'com.neenbedankt.android-apt'
|
apply plugin: 'com.neenbedankt.android-apt'
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven { url 'http://repo1.maven.org/maven2' }
|
|
||||||
}
|
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
buildToolsVersion "23.0.3"
|
buildToolsVersion "23.0.3"
|
||||||
|
|||||||
@@ -0,0 +1,387 @@
|
|||||||
|
package org.briarproject;
|
||||||
|
|
||||||
|
import net.jodah.concurrentunit.Waiter;
|
||||||
|
|
||||||
|
import org.briarproject.api.blogs.Blog;
|
||||||
|
import org.briarproject.api.blogs.BlogFactory;
|
||||||
|
import org.briarproject.api.blogs.BlogManager;
|
||||||
|
import org.briarproject.api.blogs.BlogPost;
|
||||||
|
import org.briarproject.api.blogs.BlogPostFactory;
|
||||||
|
import org.briarproject.api.blogs.BlogPostHeader;
|
||||||
|
import org.briarproject.api.contact.ContactId;
|
||||||
|
import org.briarproject.api.contact.ContactManager;
|
||||||
|
import org.briarproject.api.crypto.CryptoComponent;
|
||||||
|
import org.briarproject.api.crypto.KeyPair;
|
||||||
|
import org.briarproject.api.crypto.SecretKey;
|
||||||
|
import org.briarproject.api.db.DbException;
|
||||||
|
import org.briarproject.api.event.Event;
|
||||||
|
import org.briarproject.api.event.EventListener;
|
||||||
|
import org.briarproject.api.event.MessageStateChangedEvent;
|
||||||
|
import org.briarproject.api.identity.AuthorFactory;
|
||||||
|
import org.briarproject.api.identity.IdentityManager;
|
||||||
|
import org.briarproject.api.identity.LocalAuthor;
|
||||||
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
|
import org.briarproject.api.sync.SyncSession;
|
||||||
|
import org.briarproject.api.sync.SyncSessionFactory;
|
||||||
|
import org.briarproject.api.system.Clock;
|
||||||
|
import org.briarproject.blogs.BlogsModule;
|
||||||
|
import org.briarproject.contact.ContactModule;
|
||||||
|
import org.briarproject.crypto.CryptoModule;
|
||||||
|
import org.briarproject.lifecycle.LifecycleModule;
|
||||||
|
import org.briarproject.properties.PropertiesModule;
|
||||||
|
import org.briarproject.sync.SyncModule;
|
||||||
|
import org.briarproject.transport.TransportModule;
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertFalse;
|
||||||
|
import static org.briarproject.TestPluginsModule.MAX_LATENCY;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.DELIVERED;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.INVALID;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.PENDING;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.VALID;
|
||||||
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
public class BlogManagerTest {
|
||||||
|
|
||||||
|
private LifecycleManager lifecycleManager0, lifecycleManager1;
|
||||||
|
private SyncSessionFactory sync0, sync1;
|
||||||
|
private BlogManager blogManager0, blogManager1;
|
||||||
|
private ContactManager contactManager0, contactManager1;
|
||||||
|
private ContactId contactId0,contactId1;
|
||||||
|
private IdentityManager identityManager0, identityManager1;
|
||||||
|
private LocalAuthor author0, author1;
|
||||||
|
private Blog blog0, blog1;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
Clock clock;
|
||||||
|
@Inject
|
||||||
|
AuthorFactory authorFactory;
|
||||||
|
@Inject
|
||||||
|
CryptoComponent crypto;
|
||||||
|
@Inject
|
||||||
|
BlogFactory blogFactory;
|
||||||
|
@Inject
|
||||||
|
BlogPostFactory blogPostFactory;
|
||||||
|
|
||||||
|
// objects accessed from background threads need to be volatile
|
||||||
|
private volatile Waiter validationWaiter;
|
||||||
|
private volatile Waiter deliveryWaiter;
|
||||||
|
|
||||||
|
private final File testDir = TestUtils.getTestDirectory();
|
||||||
|
private final SecretKey master = TestUtils.getSecretKey();
|
||||||
|
private final int TIMEOUT = 15000;
|
||||||
|
private final String AUTHOR1 = "Author 1";
|
||||||
|
private final String AUTHOR2 = "Author 2";
|
||||||
|
private final String CONTENT_TYPE = "text/plain";
|
||||||
|
|
||||||
|
private static final Logger LOG =
|
||||||
|
Logger.getLogger(ForumSharingIntegrationTest.class.getName());
|
||||||
|
|
||||||
|
private BlogManagerTestComponent t0, t1;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
BlogManagerTestComponent component =
|
||||||
|
DaggerBlogManagerTestComponent.builder().build();
|
||||||
|
component.inject(this);
|
||||||
|
injectEagerSingletons(component);
|
||||||
|
|
||||||
|
assertTrue(testDir.mkdirs());
|
||||||
|
File t0Dir = new File(testDir, AUTHOR1);
|
||||||
|
t0 = DaggerBlogManagerTestComponent.builder()
|
||||||
|
.testDatabaseModule(new TestDatabaseModule(t0Dir)).build();
|
||||||
|
injectEagerSingletons(t0);
|
||||||
|
File t1Dir = new File(testDir, AUTHOR2);
|
||||||
|
t1 = DaggerBlogManagerTestComponent.builder()
|
||||||
|
.testDatabaseModule(new TestDatabaseModule(t1Dir)).build();
|
||||||
|
injectEagerSingletons(t1);
|
||||||
|
|
||||||
|
identityManager0 = t0.getIdentityManager();
|
||||||
|
identityManager1 = t1.getIdentityManager();
|
||||||
|
contactManager0 = t0.getContactManager();
|
||||||
|
contactManager1 = t1.getContactManager();
|
||||||
|
blogManager0 = t0.getBlogManager();
|
||||||
|
blogManager1 = t1.getBlogManager();
|
||||||
|
sync0 = t0.getSyncSessionFactory();
|
||||||
|
sync1 = t1.getSyncSessionFactory();
|
||||||
|
|
||||||
|
// initialize waiters fresh for each test
|
||||||
|
validationWaiter = new Waiter();
|
||||||
|
deliveryWaiter = new Waiter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testPersonalBlogInitialisation() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
|
||||||
|
defaultInit();
|
||||||
|
|
||||||
|
Collection<Blog> blogs0 = blogManager0.getBlogs();
|
||||||
|
assertEquals(2, blogs0.size());
|
||||||
|
Iterator<Blog> i0 = blogs0.iterator();
|
||||||
|
assertEquals(author0, i0.next().getAuthor());
|
||||||
|
assertEquals(author1, i0.next().getAuthor());
|
||||||
|
|
||||||
|
Collection<Blog> blogs1 = blogManager1.getBlogs();
|
||||||
|
assertEquals(2, blogs1.size());
|
||||||
|
Iterator<Blog> i1 = blogs1.iterator();
|
||||||
|
assertEquals(author1, i1.next().getAuthor());
|
||||||
|
assertEquals(author0, i1.next().getAuthor());
|
||||||
|
|
||||||
|
assertEquals(blog0, blogManager0.getPersonalBlog(author0));
|
||||||
|
assertEquals(blog0, blogManager1.getPersonalBlog(author0));
|
||||||
|
assertEquals(blog1, blogManager0.getPersonalBlog(author1));
|
||||||
|
assertEquals(blog1, blogManager1.getPersonalBlog(author1));
|
||||||
|
|
||||||
|
assertEquals(blog0, blogManager0.getBlog(blog0.getId()));
|
||||||
|
assertEquals(blog0, blogManager1.getBlog(blog0.getId()));
|
||||||
|
assertEquals(blog1, blogManager0.getBlog(blog1.getId()));
|
||||||
|
assertEquals(blog1, blogManager1.getBlog(blog1.getId()));
|
||||||
|
|
||||||
|
assertEquals(1, blogManager0.getBlogs(author0).size());
|
||||||
|
assertEquals(1, blogManager1.getBlogs(author0).size());
|
||||||
|
assertEquals(1, blogManager0.getBlogs(author1).size());
|
||||||
|
assertEquals(1, blogManager1.getBlogs(author1).size());
|
||||||
|
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBlogPost() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
defaultInit();
|
||||||
|
|
||||||
|
// check that blog0 has no posts
|
||||||
|
final byte[] body = TestUtils.getRandomBytes(42);
|
||||||
|
Collection<BlogPostHeader> headers0 =
|
||||||
|
blogManager0.getPostHeaders(blog0.getId());
|
||||||
|
assertEquals(0, headers0.size());
|
||||||
|
|
||||||
|
// add a post to blog0
|
||||||
|
BlogPost p = blogPostFactory
|
||||||
|
.createBlogPost(blog0.getId(), null, clock.currentTimeMillis(),
|
||||||
|
null, author0, CONTENT_TYPE, body);
|
||||||
|
blogManager0.addLocalPost(p);
|
||||||
|
|
||||||
|
// check that post is now in blog0
|
||||||
|
headers0 = blogManager0.getPostHeaders(blog0.getId());
|
||||||
|
assertEquals(1, headers0.size());
|
||||||
|
|
||||||
|
// check that body is there
|
||||||
|
assertArrayEquals(body,
|
||||||
|
blogManager0.getPostBody(p.getMessage().getId()));
|
||||||
|
|
||||||
|
// make sure that blog0 at author1 doesn't have the post yet
|
||||||
|
Collection<BlogPostHeader> headers1 =
|
||||||
|
blogManager1.getPostHeaders(blog0.getId());
|
||||||
|
assertEquals(0, headers1.size());
|
||||||
|
|
||||||
|
// sync the post over
|
||||||
|
sync0To1();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
|
||||||
|
// make sure post arrived
|
||||||
|
headers1 = blogManager1.getPostHeaders(blog0.getId());
|
||||||
|
assertEquals(1, headers1.size());
|
||||||
|
|
||||||
|
// check that body is there
|
||||||
|
assertArrayEquals(body,
|
||||||
|
blogManager1.getPostBody(p.getMessage().getId()));
|
||||||
|
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testBlogPostInWrongBlog() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
defaultInit();
|
||||||
|
|
||||||
|
// add a post to blog1
|
||||||
|
final byte[] body = TestUtils.getRandomBytes(42);
|
||||||
|
BlogPost p = blogPostFactory
|
||||||
|
.createBlogPost(blog1.getId(), null, clock.currentTimeMillis(),
|
||||||
|
null, author0, CONTENT_TYPE, body);
|
||||||
|
blogManager0.addLocalPost(p);
|
||||||
|
|
||||||
|
// check that post is now in blog1
|
||||||
|
Collection<BlogPostHeader> headers0 =
|
||||||
|
blogManager0.getPostHeaders(blog1.getId());
|
||||||
|
assertEquals(1, headers0.size());
|
||||||
|
|
||||||
|
// sync the post over
|
||||||
|
sync0To1();
|
||||||
|
validationWaiter.await(TIMEOUT, 1);
|
||||||
|
|
||||||
|
// make sure post did not arrive, because of wrong signature
|
||||||
|
Collection<BlogPostHeader> headers1 =
|
||||||
|
blogManager1.getPostHeaders(blog1.getId());
|
||||||
|
assertEquals(0, headers1.size());
|
||||||
|
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testAddAndRemoveBlog() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
defaultInit();
|
||||||
|
|
||||||
|
String name = "Test Blog";
|
||||||
|
String desc = "Description";
|
||||||
|
|
||||||
|
// add blog
|
||||||
|
Blog blog = blogManager0.addBlog(author0, name, desc);
|
||||||
|
Collection<Blog> blogs0 = blogManager0.getBlogs();
|
||||||
|
assertEquals(3, blogs0.size());
|
||||||
|
assertTrue(blogs0.contains(blog));
|
||||||
|
assertEquals(2, blogManager0.getBlogs(author0).size());
|
||||||
|
|
||||||
|
// remove blog
|
||||||
|
blogManager0.removeBlog(blog);
|
||||||
|
blogs0 = blogManager0.getBlogs();
|
||||||
|
assertEquals(2, blogs0.size());
|
||||||
|
assertFalse(blogs0.contains(blog));
|
||||||
|
assertEquals(1, blogManager0.getBlogs(author0).size());
|
||||||
|
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() throws Exception {
|
||||||
|
TestUtils.deleteTestDirectory(testDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Listener implements EventListener {
|
||||||
|
public void eventOccurred(Event e) {
|
||||||
|
if (e instanceof MessageStateChangedEvent) {
|
||||||
|
MessageStateChangedEvent event = (MessageStateChangedEvent) e;
|
||||||
|
if (!event.isLocal()) {
|
||||||
|
if (event.getState() == DELIVERED) {
|
||||||
|
deliveryWaiter.resume();
|
||||||
|
} else if (event.getState() == VALID ||
|
||||||
|
event.getState() == INVALID ||
|
||||||
|
event.getState() == PENDING) {
|
||||||
|
validationWaiter.resume();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void defaultInit() throws DbException {
|
||||||
|
addDefaultIdentities();
|
||||||
|
addDefaultContacts();
|
||||||
|
listenToEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addDefaultIdentities() throws DbException {
|
||||||
|
KeyPair keyPair0 = crypto.generateSignatureKeyPair();
|
||||||
|
byte[] publicKey0 = keyPair0.getPublic().getEncoded();
|
||||||
|
byte[] privateKey0 = keyPair0.getPrivate().getEncoded();
|
||||||
|
author0 = authorFactory
|
||||||
|
.createLocalAuthor(AUTHOR1, publicKey0, privateKey0);
|
||||||
|
identityManager0.addLocalAuthor(author0);
|
||||||
|
blog0 = blogFactory.createPersonalBlog(author0);
|
||||||
|
|
||||||
|
KeyPair keyPair1 = crypto.generateSignatureKeyPair();
|
||||||
|
byte[] publicKey1 = keyPair1.getPublic().getEncoded();
|
||||||
|
byte[] privateKey1 = keyPair1.getPrivate().getEncoded();
|
||||||
|
author1 = authorFactory
|
||||||
|
.createLocalAuthor(AUTHOR2, publicKey1, privateKey1);
|
||||||
|
identityManager1.addLocalAuthor(author1);
|
||||||
|
blog1 = blogFactory.createPersonalBlog(author1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addDefaultContacts() throws DbException {
|
||||||
|
// sharer adds invitee as contact
|
||||||
|
contactId1 = contactManager0.addContact(author1,
|
||||||
|
author0.getId(), master, clock.currentTimeMillis(), true,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
// invitee adds sharer back
|
||||||
|
contactId0 = contactManager1.addContact(author0,
|
||||||
|
author1.getId(), master, clock.currentTimeMillis(), true,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listenToEvents() {
|
||||||
|
Listener listener0 = new Listener();
|
||||||
|
t0.getEventBus().addListener(listener0);
|
||||||
|
Listener listener1 = new Listener();
|
||||||
|
t1.getEventBus().addListener(listener1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sync0To1() throws IOException, TimeoutException {
|
||||||
|
deliverMessage(sync0, contactId0, sync1, contactId1, "0 to 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sync1To0() throws IOException, TimeoutException {
|
||||||
|
deliverMessage(sync1, contactId1, sync0, contactId0, "1 to 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deliverMessage(SyncSessionFactory fromSync, ContactId fromId,
|
||||||
|
SyncSessionFactory toSync, ContactId toId, String debug)
|
||||||
|
throws IOException, TimeoutException {
|
||||||
|
|
||||||
|
if (debug != null) LOG.info("TEST: Sending message from " + debug);
|
||||||
|
|
||||||
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
|
// Create an outgoing sync session
|
||||||
|
SyncSession sessionFrom =
|
||||||
|
fromSync.createSimplexOutgoingSession(toId, MAX_LATENCY, out);
|
||||||
|
// Write whatever needs to be written
|
||||||
|
sessionFrom.run();
|
||||||
|
out.close();
|
||||||
|
|
||||||
|
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||||
|
// Create an incoming sync session
|
||||||
|
SyncSession sessionTo = toSync.createIncomingSession(fromId, in);
|
||||||
|
// Read whatever needs to be read
|
||||||
|
sessionTo.run();
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startLifecycles() throws InterruptedException {
|
||||||
|
// Start the lifecycle manager and wait for it to finish
|
||||||
|
lifecycleManager0 = t0.getLifecycleManager();
|
||||||
|
lifecycleManager1 = t1.getLifecycleManager();
|
||||||
|
lifecycleManager0.startServices();
|
||||||
|
lifecycleManager1.startServices();
|
||||||
|
lifecycleManager0.waitForStartup();
|
||||||
|
lifecycleManager1.waitForStartup();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopLifecycles() throws InterruptedException {
|
||||||
|
// Clean up
|
||||||
|
lifecycleManager0.stopServices();
|
||||||
|
lifecycleManager1.stopServices();
|
||||||
|
lifecycleManager0.waitForShutdown();
|
||||||
|
lifecycleManager1.waitForShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void injectEagerSingletons(BlogManagerTestComponent component) {
|
||||||
|
component.inject(new LifecycleModule.EagerSingletons());
|
||||||
|
component.inject(new BlogsModule.EagerSingletons());
|
||||||
|
component.inject(new CryptoModule.EagerSingletons());
|
||||||
|
component.inject(new ContactModule.EagerSingletons());
|
||||||
|
component.inject(new TransportModule.EagerSingletons());
|
||||||
|
component.inject(new SyncModule.EagerSingletons());
|
||||||
|
component.inject(new PropertiesModule.EagerSingletons());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
package org.briarproject;
|
||||||
|
|
||||||
|
import org.briarproject.api.blogs.BlogManager;
|
||||||
|
import org.briarproject.api.contact.ContactManager;
|
||||||
|
import org.briarproject.api.event.EventBus;
|
||||||
|
import org.briarproject.api.identity.IdentityManager;
|
||||||
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
|
import org.briarproject.api.sync.SyncSessionFactory;
|
||||||
|
import org.briarproject.blogs.BlogsModule;
|
||||||
|
import org.briarproject.clients.ClientsModule;
|
||||||
|
import org.briarproject.contact.ContactModule;
|
||||||
|
import org.briarproject.crypto.CryptoModule;
|
||||||
|
import org.briarproject.data.DataModule;
|
||||||
|
import org.briarproject.db.DatabaseModule;
|
||||||
|
import org.briarproject.event.EventModule;
|
||||||
|
import org.briarproject.identity.IdentityModule;
|
||||||
|
import org.briarproject.lifecycle.LifecycleModule;
|
||||||
|
import org.briarproject.properties.PropertiesModule;
|
||||||
|
import org.briarproject.sharing.SharingModule;
|
||||||
|
import org.briarproject.sync.SyncModule;
|
||||||
|
import org.briarproject.system.SystemModule;
|
||||||
|
import org.briarproject.transport.TransportModule;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Component;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Component(modules = {
|
||||||
|
TestDatabaseModule.class,
|
||||||
|
TestPluginsModule.class,
|
||||||
|
TestSeedProviderModule.class,
|
||||||
|
ClientsModule.class,
|
||||||
|
ContactModule.class,
|
||||||
|
CryptoModule.class,
|
||||||
|
DataModule.class,
|
||||||
|
DatabaseModule.class,
|
||||||
|
EventModule.class,
|
||||||
|
BlogsModule.class,
|
||||||
|
IdentityModule.class,
|
||||||
|
LifecycleModule.class,
|
||||||
|
PropertiesModule.class,
|
||||||
|
SharingModule.class,
|
||||||
|
SyncModule.class,
|
||||||
|
SystemModule.class,
|
||||||
|
TransportModule.class
|
||||||
|
})
|
||||||
|
interface BlogManagerTestComponent {
|
||||||
|
|
||||||
|
void inject(BlogManagerTest testCase);
|
||||||
|
|
||||||
|
void inject(ContactModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(CryptoModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(BlogsModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(LifecycleModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(PropertiesModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(SyncModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(TransportModule.EagerSingletons init);
|
||||||
|
|
||||||
|
LifecycleManager getLifecycleManager();
|
||||||
|
|
||||||
|
EventBus getEventBus();
|
||||||
|
|
||||||
|
IdentityManager getIdentityManager();
|
||||||
|
|
||||||
|
ContactManager getContactManager();
|
||||||
|
|
||||||
|
BlogManager getBlogManager();
|
||||||
|
|
||||||
|
SyncSessionFactory getSyncSessionFactory();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,447 @@
|
|||||||
|
package org.briarproject;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import net.jodah.concurrentunit.Waiter;
|
||||||
|
|
||||||
|
import org.briarproject.api.contact.Contact;
|
||||||
|
import org.briarproject.api.contact.ContactId;
|
||||||
|
import org.briarproject.api.contact.ContactManager;
|
||||||
|
import org.briarproject.api.crypto.SecretKey;
|
||||||
|
import org.briarproject.api.db.DbException;
|
||||||
|
import org.briarproject.api.event.Event;
|
||||||
|
import org.briarproject.api.event.EventListener;
|
||||||
|
import org.briarproject.api.event.MessageStateChangedEvent;
|
||||||
|
import org.briarproject.api.forum.Forum;
|
||||||
|
import org.briarproject.api.forum.ForumManager;
|
||||||
|
import org.briarproject.api.forum.ForumPost;
|
||||||
|
import org.briarproject.api.forum.ForumPostFactory;
|
||||||
|
import org.briarproject.api.forum.ForumPostHeader;
|
||||||
|
import org.briarproject.api.forum.ForumSharingManager;
|
||||||
|
import org.briarproject.api.identity.AuthorFactory;
|
||||||
|
import org.briarproject.api.identity.IdentityManager;
|
||||||
|
import org.briarproject.api.identity.LocalAuthor;
|
||||||
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
|
import org.briarproject.api.sync.GroupId;
|
||||||
|
import org.briarproject.api.sync.SyncSession;
|
||||||
|
import org.briarproject.api.sync.SyncSessionFactory;
|
||||||
|
import org.briarproject.api.system.Clock;
|
||||||
|
import org.briarproject.contact.ContactModule;
|
||||||
|
import org.briarproject.crypto.CryptoModule;
|
||||||
|
import org.briarproject.forum.ForumModule;
|
||||||
|
import org.briarproject.lifecycle.LifecycleModule;
|
||||||
|
import org.briarproject.properties.PropertiesModule;
|
||||||
|
import org.briarproject.sharing.SharingModule;
|
||||||
|
import org.briarproject.sync.SyncModule;
|
||||||
|
import org.briarproject.transport.TransportModule;
|
||||||
|
import org.briarproject.util.StringUtils;
|
||||||
|
import org.junit.After;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.concurrent.TimeoutException;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static junit.framework.Assert.assertEquals;
|
||||||
|
import static junit.framework.Assert.assertNull;
|
||||||
|
import static junit.framework.TestCase.assertFalse;
|
||||||
|
import static org.briarproject.TestPluginsModule.MAX_LATENCY;
|
||||||
|
import static org.briarproject.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.DELIVERED;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.INVALID;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.PENDING;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.VALID;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
public class ForumManagerTest {
|
||||||
|
|
||||||
|
private LifecycleManager lifecycleManager0, lifecycleManager1;
|
||||||
|
private SyncSessionFactory sync0, sync1;
|
||||||
|
private ForumManager forumManager0, forumManager1;
|
||||||
|
private ContactManager contactManager0, contactManager1;
|
||||||
|
private ContactId contactId0,contactId1;
|
||||||
|
private IdentityManager identityManager0, identityManager1;
|
||||||
|
private LocalAuthor author0, author1;
|
||||||
|
private Forum forum0;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
Clock clock;
|
||||||
|
@Inject
|
||||||
|
AuthorFactory authorFactory;
|
||||||
|
@Inject
|
||||||
|
ForumPostFactory forumPostFactory;
|
||||||
|
|
||||||
|
// objects accessed from background threads need to be volatile
|
||||||
|
private volatile ForumSharingManager forumSharingManager0;
|
||||||
|
private volatile ForumSharingManager forumSharingManager1;
|
||||||
|
private volatile Waiter validationWaiter;
|
||||||
|
private volatile Waiter deliveryWaiter;
|
||||||
|
|
||||||
|
private final File testDir = TestUtils.getTestDirectory();
|
||||||
|
private final SecretKey master = TestUtils.getSecretKey();
|
||||||
|
private final int TIMEOUT = 15000;
|
||||||
|
private final String SHARER = "Sharer";
|
||||||
|
private final String INVITEE = "Invitee";
|
||||||
|
|
||||||
|
private static final Logger LOG =
|
||||||
|
Logger.getLogger(ForumSharingIntegrationTest.class.getName());
|
||||||
|
|
||||||
|
private ForumManagerTestComponent t0, t1;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
ForumManagerTestComponent component =
|
||||||
|
DaggerForumManagerTestComponent.builder().build();
|
||||||
|
component.inject(this);
|
||||||
|
injectEagerSingletons(component);
|
||||||
|
|
||||||
|
assertTrue(testDir.mkdirs());
|
||||||
|
File t0Dir = new File(testDir, SHARER);
|
||||||
|
t0 = DaggerForumManagerTestComponent.builder()
|
||||||
|
.testDatabaseModule(new TestDatabaseModule(t0Dir)).build();
|
||||||
|
injectEagerSingletons(t0);
|
||||||
|
File t1Dir = new File(testDir, INVITEE);
|
||||||
|
t1 = DaggerForumManagerTestComponent.builder()
|
||||||
|
.testDatabaseModule(new TestDatabaseModule(t1Dir)).build();
|
||||||
|
injectEagerSingletons(t1);
|
||||||
|
|
||||||
|
identityManager0 = t0.getIdentityManager();
|
||||||
|
identityManager1 = t1.getIdentityManager();
|
||||||
|
contactManager0 = t0.getContactManager();
|
||||||
|
contactManager1 = t1.getContactManager();
|
||||||
|
forumManager0 = t0.getForumManager();
|
||||||
|
forumManager1 = t1.getForumManager();
|
||||||
|
forumSharingManager0 = t0.getForumSharingManager();
|
||||||
|
forumSharingManager1 = t1.getForumSharingManager();
|
||||||
|
sync0 = t0.getSyncSessionFactory();
|
||||||
|
sync1 = t1.getSyncSessionFactory();
|
||||||
|
|
||||||
|
// initialize waiters fresh for each test
|
||||||
|
validationWaiter = new Waiter();
|
||||||
|
deliveryWaiter = new Waiter();
|
||||||
|
}
|
||||||
|
|
||||||
|
private ForumPost createForumPost(GroupId groupId, ForumPost parent,
|
||||||
|
String body, long ms) throws Exception {
|
||||||
|
return forumPostFactory.createAnonymousPost(groupId, ms,
|
||||||
|
parent == null ? null : parent.getMessage().getId(),
|
||||||
|
"text/plain", StringUtils.toUtf8(body));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testForumPost() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
Forum forum = forumManager0.addForum("TestForum");
|
||||||
|
assertEquals(1, forumManager0.getForums().size());
|
||||||
|
final long ms1 = clock.currentTimeMillis() - 1000L;
|
||||||
|
final String body1 = "some forum text";
|
||||||
|
final long ms2 = clock.currentTimeMillis();
|
||||||
|
final String body2 = "some other forum text";
|
||||||
|
ForumPost post1 =
|
||||||
|
createForumPost(forum.getGroup().getId(), null, body1, ms1);
|
||||||
|
assertEquals(ms1, post1.getMessage().getTimestamp());
|
||||||
|
ForumPost post2 =
|
||||||
|
createForumPost(forum.getGroup().getId(), post1, body2, ms2);
|
||||||
|
assertEquals(ms2, post2.getMessage().getTimestamp());
|
||||||
|
forumManager0.addLocalPost(post1);
|
||||||
|
forumManager0.setReadFlag(post1.getMessage().getId(), true);
|
||||||
|
forumManager0.addLocalPost(post2);
|
||||||
|
forumManager0.setReadFlag(post2.getMessage().getId(), false);
|
||||||
|
Collection<ForumPostHeader> headers =
|
||||||
|
forumManager0.getPostHeaders(forum.getGroup().getId());
|
||||||
|
assertEquals(2, headers.size());
|
||||||
|
for (ForumPostHeader h : headers) {
|
||||||
|
final String hBody =
|
||||||
|
StringUtils.fromUtf8(forumManager0.getPostBody(h.getId()));
|
||||||
|
|
||||||
|
boolean isPost1 = h.getId().equals(post1.getMessage().getId());
|
||||||
|
boolean isPost2 = h.getId().equals(post2.getMessage().getId());
|
||||||
|
Assert.assertTrue(isPost1 || isPost2);
|
||||||
|
if (isPost1) {
|
||||||
|
assertEquals(h.getTimestamp(), ms1);
|
||||||
|
assertEquals(body1, hBody);
|
||||||
|
assertNull(h.getParentId());
|
||||||
|
assertTrue(h.isRead());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assertEquals(h.getTimestamp(), ms2);
|
||||||
|
assertEquals(body2, hBody);
|
||||||
|
assertEquals(h.getParentId(), post2.getParent());
|
||||||
|
assertFalse(h.isRead());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
forumManager0.removeForum(forum);
|
||||||
|
assertEquals(0, forumManager0.getForums().size());
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testForumPostDelivery() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
defaultInit();
|
||||||
|
|
||||||
|
// share forum
|
||||||
|
GroupId g = forum0.getId();
|
||||||
|
forumSharingManager0.sendInvitation(g, contactId1, null);
|
||||||
|
sync0To1();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
Contact c0 = contactManager1.getContact(contactId0);
|
||||||
|
forumSharingManager1.respondToInvitation(forum0, c0, true);
|
||||||
|
sync1To0();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
|
||||||
|
// add one forum post
|
||||||
|
long time = clock.currentTimeMillis();
|
||||||
|
ForumPost post1 = createForumPost(g, null, "a", time);
|
||||||
|
forumManager0.addLocalPost(post1);
|
||||||
|
assertEquals(1, forumManager0.getPostHeaders(g).size());
|
||||||
|
assertEquals(0, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
// send post to 1
|
||||||
|
sync0To1();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
assertEquals(1, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
// add another forum post
|
||||||
|
time = clock.currentTimeMillis();
|
||||||
|
ForumPost post2 = createForumPost(g, null, "b", time);
|
||||||
|
forumManager1.addLocalPost(post2);
|
||||||
|
assertEquals(1, forumManager0.getPostHeaders(g).size());
|
||||||
|
assertEquals(2, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
// send post to 0
|
||||||
|
sync1To0();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
assertEquals(2, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testForumPostDeliveredAfterParent() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
defaultInit();
|
||||||
|
|
||||||
|
// share forum
|
||||||
|
GroupId g = forum0.getId();
|
||||||
|
forumSharingManager0.sendInvitation(g, contactId1, null);
|
||||||
|
sync0To1();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
Contact c0 = contactManager1.getContact(contactId0);
|
||||||
|
forumSharingManager1.respondToInvitation(forum0, c0, true);
|
||||||
|
sync1To0();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
|
||||||
|
// add one forum post without the parent
|
||||||
|
long time = clock.currentTimeMillis();
|
||||||
|
ForumPost post1 = createForumPost(g, null, "a", time);
|
||||||
|
ForumPost post2 = createForumPost(g, post1, "a", time);
|
||||||
|
forumManager0.addLocalPost(post2);
|
||||||
|
assertEquals(1, forumManager0.getPostHeaders(g).size());
|
||||||
|
assertEquals(0, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
// send post to 1 without waiting for message delivery
|
||||||
|
sync0To1();
|
||||||
|
validationWaiter.await(TIMEOUT, 1);
|
||||||
|
assertEquals(0, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
// now add the parent post as well
|
||||||
|
forumManager0.addLocalPost(post1);
|
||||||
|
assertEquals(2, forumManager0.getPostHeaders(g).size());
|
||||||
|
assertEquals(0, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
// and send it over to 1 and wait for a second message to be delivered
|
||||||
|
sync0To1();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 2);
|
||||||
|
assertEquals(2, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testForumPostWithParentInOtherGroup() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
defaultInit();
|
||||||
|
|
||||||
|
// share forum
|
||||||
|
GroupId g = forum0.getId();
|
||||||
|
forumSharingManager0.sendInvitation(g, contactId1, null);
|
||||||
|
sync0To1();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
Contact c0 = contactManager1.getContact(contactId0);
|
||||||
|
forumSharingManager1.respondToInvitation(forum0, c0, true);
|
||||||
|
sync1To0();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
|
||||||
|
// share a second forum
|
||||||
|
Forum forum1 = forumManager0.addForum("Test Forum1");
|
||||||
|
GroupId g1 = forum1.getId();
|
||||||
|
forumSharingManager0.sendInvitation(g1, contactId1, null);
|
||||||
|
sync0To1();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
forumSharingManager1.respondToInvitation(forum1, c0, true);
|
||||||
|
sync1To0();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
|
||||||
|
// add one forum post with a parent in another forum
|
||||||
|
long time = clock.currentTimeMillis();
|
||||||
|
ForumPost post1 = createForumPost(g1, null, "a", time);
|
||||||
|
ForumPost post = createForumPost(g, post1, "b", time);
|
||||||
|
forumManager0.addLocalPost(post);
|
||||||
|
assertEquals(1, forumManager0.getPostHeaders(g).size());
|
||||||
|
assertEquals(0, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
// send posts to 1
|
||||||
|
sync0To1();
|
||||||
|
validationWaiter.await(TIMEOUT, 1);
|
||||||
|
assertEquals(1, forumManager0.getPostHeaders(g).size());
|
||||||
|
assertEquals(0, forumManager1.getPostHeaders(g).size());
|
||||||
|
|
||||||
|
// now also add the parent post which is in another group
|
||||||
|
forumManager0.addLocalPost(post1);
|
||||||
|
assertEquals(1, forumManager0.getPostHeaders(g1).size());
|
||||||
|
assertEquals(0, forumManager1.getPostHeaders(g1).size());
|
||||||
|
|
||||||
|
// send posts to 1
|
||||||
|
sync0To1();
|
||||||
|
deliveryWaiter.await(TIMEOUT, 1);
|
||||||
|
assertEquals(1, forumManager0.getPostHeaders(g).size());
|
||||||
|
assertEquals(1, forumManager0.getPostHeaders(g1).size());
|
||||||
|
// the next line is critical, makes sure post doesn't show up
|
||||||
|
assertEquals(0, forumManager1.getPostHeaders(g).size());
|
||||||
|
assertEquals(1, forumManager1.getPostHeaders(g1).size());
|
||||||
|
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void tearDown() throws Exception {
|
||||||
|
TestUtils.deleteTestDirectory(testDir);
|
||||||
|
}
|
||||||
|
|
||||||
|
private class Listener implements EventListener {
|
||||||
|
public void eventOccurred(Event e) {
|
||||||
|
if (e instanceof MessageStateChangedEvent) {
|
||||||
|
MessageStateChangedEvent event = (MessageStateChangedEvent) e;
|
||||||
|
if (!event.isLocal()) {
|
||||||
|
if (event.getState() == DELIVERED) {
|
||||||
|
deliveryWaiter.resume();
|
||||||
|
} else if (event.getState() == VALID ||
|
||||||
|
event.getState() == INVALID ||
|
||||||
|
event.getState() == PENDING) {
|
||||||
|
validationWaiter.resume();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void defaultInit() throws DbException {
|
||||||
|
addDefaultIdentities();
|
||||||
|
addDefaultContacts();
|
||||||
|
addForum();
|
||||||
|
listenToEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addDefaultIdentities() throws DbException {
|
||||||
|
author0 = authorFactory.createLocalAuthor(SHARER,
|
||||||
|
TestUtils.getRandomBytes(MAX_PUBLIC_KEY_LENGTH),
|
||||||
|
TestUtils.getRandomBytes(123));
|
||||||
|
identityManager0.addLocalAuthor(author0);
|
||||||
|
author1 = authorFactory.createLocalAuthor(INVITEE,
|
||||||
|
TestUtils.getRandomBytes(MAX_PUBLIC_KEY_LENGTH),
|
||||||
|
TestUtils.getRandomBytes(123));
|
||||||
|
identityManager1.addLocalAuthor(author1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addDefaultContacts() throws DbException {
|
||||||
|
// sharer adds invitee as contact
|
||||||
|
contactId1 = contactManager0.addContact(author1,
|
||||||
|
author0.getId(), master, clock.currentTimeMillis(), true,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
// invitee adds sharer back
|
||||||
|
contactId0 = contactManager1.addContact(author0,
|
||||||
|
author1.getId(), master, clock.currentTimeMillis(), true,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void addForum() throws DbException {
|
||||||
|
forum0 = forumManager0.addForum("Test Forum");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void listenToEvents() {
|
||||||
|
Listener listener0 = new Listener();
|
||||||
|
t0.getEventBus().addListener(listener0);
|
||||||
|
Listener listener1 = new Listener();
|
||||||
|
t1.getEventBus().addListener(listener1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sync0To1() throws IOException, TimeoutException {
|
||||||
|
deliverMessage(sync0, contactId0, sync1, contactId1, "0 to 1");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sync1To0() throws IOException, TimeoutException {
|
||||||
|
deliverMessage(sync1, contactId1, sync0, contactId0, "1 to 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void deliverMessage(SyncSessionFactory fromSync, ContactId fromId,
|
||||||
|
SyncSessionFactory toSync, ContactId toId, String debug)
|
||||||
|
throws IOException, TimeoutException {
|
||||||
|
|
||||||
|
if (debug != null) LOG.info("TEST: Sending message from " + debug);
|
||||||
|
|
||||||
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
|
// Create an outgoing sync session
|
||||||
|
SyncSession sessionFrom =
|
||||||
|
fromSync.createSimplexOutgoingSession(toId, MAX_LATENCY, out);
|
||||||
|
// Write whatever needs to be written
|
||||||
|
sessionFrom.run();
|
||||||
|
out.close();
|
||||||
|
|
||||||
|
ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
|
||||||
|
// Create an incoming sync session
|
||||||
|
SyncSession sessionTo = toSync.createIncomingSession(fromId, in);
|
||||||
|
// Read whatever needs to be read
|
||||||
|
sessionTo.run();
|
||||||
|
in.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startLifecycles() throws InterruptedException {
|
||||||
|
// Start the lifecycle manager and wait for it to finish
|
||||||
|
lifecycleManager0 = t0.getLifecycleManager();
|
||||||
|
lifecycleManager1 = t1.getLifecycleManager();
|
||||||
|
lifecycleManager0.startServices();
|
||||||
|
lifecycleManager1.startServices();
|
||||||
|
lifecycleManager0.waitForStartup();
|
||||||
|
lifecycleManager1.waitForStartup();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopLifecycles() throws InterruptedException {
|
||||||
|
// Clean up
|
||||||
|
lifecycleManager0.stopServices();
|
||||||
|
lifecycleManager1.stopServices();
|
||||||
|
lifecycleManager0.waitForShutdown();
|
||||||
|
lifecycleManager1.waitForShutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void injectEagerSingletons(ForumManagerTestComponent component) {
|
||||||
|
component.inject(new LifecycleModule.EagerSingletons());
|
||||||
|
component.inject(new ForumModule.EagerSingletons());
|
||||||
|
component.inject(new CryptoModule.EagerSingletons());
|
||||||
|
component.inject(new ContactModule.EagerSingletons());
|
||||||
|
component.inject(new TransportModule.EagerSingletons());
|
||||||
|
component.inject(new SharingModule.EagerSingletons());
|
||||||
|
component.inject(new SyncModule.EagerSingletons());
|
||||||
|
component.inject(new PropertiesModule.EagerSingletons());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package org.briarproject;
|
||||||
|
|
||||||
|
import org.briarproject.api.contact.ContactManager;
|
||||||
|
import org.briarproject.api.event.EventBus;
|
||||||
|
import org.briarproject.api.forum.ForumManager;
|
||||||
|
import org.briarproject.api.forum.ForumSharingManager;
|
||||||
|
import org.briarproject.api.identity.IdentityManager;
|
||||||
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
|
import org.briarproject.api.sync.SyncSessionFactory;
|
||||||
|
import org.briarproject.clients.ClientsModule;
|
||||||
|
import org.briarproject.contact.ContactModule;
|
||||||
|
import org.briarproject.crypto.CryptoModule;
|
||||||
|
import org.briarproject.data.DataModule;
|
||||||
|
import org.briarproject.db.DatabaseModule;
|
||||||
|
import org.briarproject.event.EventModule;
|
||||||
|
import org.briarproject.forum.ForumModule;
|
||||||
|
import org.briarproject.identity.IdentityModule;
|
||||||
|
import org.briarproject.lifecycle.LifecycleModule;
|
||||||
|
import org.briarproject.properties.PropertiesModule;
|
||||||
|
import org.briarproject.sharing.SharingModule;
|
||||||
|
import org.briarproject.sync.SyncModule;
|
||||||
|
import org.briarproject.system.SystemModule;
|
||||||
|
import org.briarproject.transport.TransportModule;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Component;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Component(modules = {
|
||||||
|
TestDatabaseModule.class,
|
||||||
|
TestPluginsModule.class,
|
||||||
|
TestSeedProviderModule.class,
|
||||||
|
ClientsModule.class,
|
||||||
|
ContactModule.class,
|
||||||
|
CryptoModule.class,
|
||||||
|
DataModule.class,
|
||||||
|
DatabaseModule.class,
|
||||||
|
EventModule.class,
|
||||||
|
ForumModule.class,
|
||||||
|
IdentityModule.class,
|
||||||
|
LifecycleModule.class,
|
||||||
|
PropertiesModule.class,
|
||||||
|
SharingModule.class,
|
||||||
|
SyncModule.class,
|
||||||
|
SystemModule.class,
|
||||||
|
TransportModule.class
|
||||||
|
})
|
||||||
|
public interface ForumManagerTestComponent {
|
||||||
|
|
||||||
|
void inject(ForumManagerTest testCase);
|
||||||
|
|
||||||
|
void inject(ContactModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(CryptoModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(ForumModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(LifecycleModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(PropertiesModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(SharingModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(SyncModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(TransportModule.EagerSingletons init);
|
||||||
|
|
||||||
|
LifecycleManager getLifecycleManager();
|
||||||
|
|
||||||
|
EventBus getEventBus();
|
||||||
|
|
||||||
|
IdentityManager getIdentityManager();
|
||||||
|
|
||||||
|
ContactManager getContactManager();
|
||||||
|
|
||||||
|
ForumSharingManager getForumSharingManager();
|
||||||
|
|
||||||
|
ForumManager getForumManager();
|
||||||
|
|
||||||
|
SyncSessionFactory getSyncSessionFactory();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package org.briarproject;
|
||||||
|
|
||||||
|
import org.briarproject.api.clients.ClientHelper;
|
||||||
|
import org.briarproject.api.clients.MessageQueueManager;
|
||||||
|
import org.briarproject.api.clients.PrivateGroupFactory;
|
||||||
|
import org.briarproject.api.contact.ContactManager;
|
||||||
|
import org.briarproject.api.db.DatabaseComponent;
|
||||||
|
import org.briarproject.api.event.EventBus;
|
||||||
|
import org.briarproject.api.forum.ForumManager;
|
||||||
|
import org.briarproject.api.forum.ForumSharingManager;
|
||||||
|
import org.briarproject.api.identity.IdentityManager;
|
||||||
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
|
import org.briarproject.api.sync.SyncSessionFactory;
|
||||||
|
import org.briarproject.clients.ClientsModule;
|
||||||
|
import org.briarproject.contact.ContactModule;
|
||||||
|
import org.briarproject.crypto.CryptoModule;
|
||||||
|
import org.briarproject.data.DataModule;
|
||||||
|
import org.briarproject.db.DatabaseModule;
|
||||||
|
import org.briarproject.event.EventModule;
|
||||||
|
import org.briarproject.forum.ForumModule;
|
||||||
|
import org.briarproject.identity.IdentityModule;
|
||||||
|
import org.briarproject.lifecycle.LifecycleModule;
|
||||||
|
import org.briarproject.properties.PropertiesModule;
|
||||||
|
import org.briarproject.sharing.SharingModule;
|
||||||
|
import org.briarproject.sync.SyncModule;
|
||||||
|
import org.briarproject.system.SystemModule;
|
||||||
|
import org.briarproject.transport.TransportModule;
|
||||||
|
|
||||||
|
import javax.inject.Singleton;
|
||||||
|
|
||||||
|
import dagger.Component;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
@Component(modules = {
|
||||||
|
TestDatabaseModule.class,
|
||||||
|
TestPluginsModule.class,
|
||||||
|
TestSeedProviderModule.class,
|
||||||
|
ClientsModule.class,
|
||||||
|
ContactModule.class,
|
||||||
|
CryptoModule.class,
|
||||||
|
DataModule.class,
|
||||||
|
DatabaseModule.class,
|
||||||
|
EventModule.class,
|
||||||
|
ForumModule.class,
|
||||||
|
IdentityModule.class,
|
||||||
|
LifecycleModule.class,
|
||||||
|
PropertiesModule.class,
|
||||||
|
SharingModule.class,
|
||||||
|
SyncModule.class,
|
||||||
|
SystemModule.class,
|
||||||
|
TransportModule.class
|
||||||
|
})
|
||||||
|
public interface ForumSharingIntegrationTestComponent {
|
||||||
|
|
||||||
|
void inject(ForumSharingIntegrationTest testCase);
|
||||||
|
|
||||||
|
void inject(ContactModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(CryptoModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(ForumModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(LifecycleModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(PropertiesModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(SharingModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(SyncModule.EagerSingletons init);
|
||||||
|
|
||||||
|
void inject(TransportModule.EagerSingletons init);
|
||||||
|
|
||||||
|
LifecycleManager getLifecycleManager();
|
||||||
|
|
||||||
|
EventBus getEventBus();
|
||||||
|
|
||||||
|
IdentityManager getIdentityManager();
|
||||||
|
|
||||||
|
ContactManager getContactManager();
|
||||||
|
|
||||||
|
ForumSharingManager getForumSharingManager();
|
||||||
|
|
||||||
|
ForumManager getForumManager();
|
||||||
|
|
||||||
|
SyncSessionFactory getSyncSessionFactory();
|
||||||
|
|
||||||
|
/* the following methods are only needed to manually construct messages */
|
||||||
|
|
||||||
|
DatabaseComponent getDatabaseComponent();
|
||||||
|
|
||||||
|
PrivateGroupFactory getPrivateGroupFactory();
|
||||||
|
|
||||||
|
ClientHelper getClientHelper();
|
||||||
|
|
||||||
|
MessageQueueManager getMessageQueueManager();
|
||||||
|
|
||||||
|
}
|
||||||
@@ -19,7 +19,7 @@ import org.briarproject.api.event.IntroductionAbortedEvent;
|
|||||||
import org.briarproject.api.event.IntroductionRequestReceivedEvent;
|
import org.briarproject.api.event.IntroductionRequestReceivedEvent;
|
||||||
import org.briarproject.api.event.IntroductionResponseReceivedEvent;
|
import org.briarproject.api.event.IntroductionResponseReceivedEvent;
|
||||||
import org.briarproject.api.event.IntroductionSucceededEvent;
|
import org.briarproject.api.event.IntroductionSucceededEvent;
|
||||||
import org.briarproject.api.event.MessageValidatedEvent;
|
import org.briarproject.api.event.MessageStateChangedEvent;
|
||||||
import org.briarproject.api.identity.AuthorFactory;
|
import org.briarproject.api.identity.AuthorFactory;
|
||||||
import org.briarproject.api.identity.IdentityManager;
|
import org.briarproject.api.identity.IdentityManager;
|
||||||
import org.briarproject.api.identity.LocalAuthor;
|
import org.briarproject.api.identity.LocalAuthor;
|
||||||
@@ -29,10 +29,13 @@ import org.briarproject.api.introduction.IntroductionRequest;
|
|||||||
import org.briarproject.api.lifecycle.LifecycleManager;
|
import org.briarproject.api.lifecycle.LifecycleManager;
|
||||||
import org.briarproject.api.properties.TransportProperties;
|
import org.briarproject.api.properties.TransportProperties;
|
||||||
import org.briarproject.api.properties.TransportPropertyManager;
|
import org.briarproject.api.properties.TransportPropertyManager;
|
||||||
|
import org.briarproject.api.sync.ClientId;
|
||||||
import org.briarproject.api.sync.Group;
|
import org.briarproject.api.sync.Group;
|
||||||
import org.briarproject.api.sync.MessageId;
|
import org.briarproject.api.sync.MessageId;
|
||||||
import org.briarproject.api.sync.SyncSession;
|
import org.briarproject.api.sync.SyncSession;
|
||||||
import org.briarproject.api.sync.SyncSessionFactory;
|
import org.briarproject.api.sync.SyncSessionFactory;
|
||||||
|
import org.briarproject.api.sync.ValidationManager;
|
||||||
|
import org.briarproject.api.sync.ValidationManager.State;
|
||||||
import org.briarproject.api.system.Clock;
|
import org.briarproject.api.system.Clock;
|
||||||
import org.briarproject.contact.ContactModule;
|
import org.briarproject.contact.ContactModule;
|
||||||
import org.briarproject.crypto.CryptoModule;
|
import org.briarproject.crypto.CryptoModule;
|
||||||
@@ -70,6 +73,8 @@ import static org.briarproject.api.introduction.IntroductionConstants.PUBLIC_KEY
|
|||||||
import static org.briarproject.api.introduction.IntroductionConstants.SESSION_ID;
|
import static org.briarproject.api.introduction.IntroductionConstants.SESSION_ID;
|
||||||
import static org.briarproject.api.introduction.IntroductionConstants.TYPE;
|
import static org.briarproject.api.introduction.IntroductionConstants.TYPE;
|
||||||
import static org.briarproject.api.introduction.IntroductionConstants.TYPE_REQUEST;
|
import static org.briarproject.api.introduction.IntroductionConstants.TYPE_REQUEST;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.DELIVERED;
|
||||||
|
import static org.briarproject.api.sync.ValidationManager.State.INVALID;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
@@ -832,6 +837,106 @@ public class IntroductionIntegrationTest extends BriarTestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testIntroduceesRemovedCleanup() throws Exception {
|
||||||
|
startLifecycles();
|
||||||
|
try {
|
||||||
|
// Add Identities
|
||||||
|
addDefaultIdentities();
|
||||||
|
|
||||||
|
// Add Transport Properties
|
||||||
|
addTransportProperties();
|
||||||
|
|
||||||
|
// Add introducees as contacts
|
||||||
|
contactId1 = contactManager0.addContact(author1,
|
||||||
|
author0.getId(), master, clock.currentTimeMillis(), true,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
contactId2 = contactManager0.addContact(author2,
|
||||||
|
author0.getId(), master, clock.currentTimeMillis(), true,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
// Add introducer back
|
||||||
|
contactId0 = contactManager1.addContact(author0,
|
||||||
|
author1.getId(), master, clock.currentTimeMillis(), true,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
ContactId contactId02 = contactManager2.addContact(author0,
|
||||||
|
author2.getId(), master, clock.currentTimeMillis(), true,
|
||||||
|
true
|
||||||
|
);
|
||||||
|
assertTrue(contactId0.equals(contactId02));
|
||||||
|
|
||||||
|
// listen to events
|
||||||
|
IntroducerListener listener0 = new IntroducerListener();
|
||||||
|
t0.getEventBus().addListener(listener0);
|
||||||
|
IntroduceeListener listener1 = new IntroduceeListener(1, true);
|
||||||
|
t1.getEventBus().addListener(listener1);
|
||||||
|
IntroduceeListener listener2 = new IntroduceeListener(2, true);
|
||||||
|
t2.getEventBus().addListener(listener2);
|
||||||
|
|
||||||
|
// make introduction
|
||||||
|
long time = clock.currentTimeMillis();
|
||||||
|
Contact introducee1 = contactManager0.getContact(contactId1);
|
||||||
|
Contact introducee2 = contactManager0.getContact(contactId2);
|
||||||
|
introductionManager0
|
||||||
|
.makeIntroduction(introducee1, introducee2, "Hi!", time);
|
||||||
|
|
||||||
|
// sync first request message
|
||||||
|
deliverMessage(sync0, contactId0, sync1, contactId1, "0 to 1");
|
||||||
|
eventWaiter.await(TIMEOUT, 1);
|
||||||
|
assertTrue(listener1.requestReceived);
|
||||||
|
|
||||||
|
// get database and local group for introducee
|
||||||
|
DatabaseComponent db0 = t0.getDatabaseComponent();
|
||||||
|
IntroductionGroupFactory groupFactory0 =
|
||||||
|
t0.getIntroductionGroupFactory();
|
||||||
|
Group group1 = groupFactory0.createLocalGroup();
|
||||||
|
|
||||||
|
// get local session state messages
|
||||||
|
Map<MessageId, Metadata> map;
|
||||||
|
Transaction txn = db0.startTransaction(false);
|
||||||
|
try {
|
||||||
|
map = db0.getMessageMetadata(txn, group1.getId());
|
||||||
|
txn.setComplete();
|
||||||
|
} finally {
|
||||||
|
db0.endTransaction(txn);
|
||||||
|
}
|
||||||
|
// check that we have one session state
|
||||||
|
assertEquals(1, map.size());
|
||||||
|
|
||||||
|
// introducer removes introducee1
|
||||||
|
contactManager0.removeContact(contactId1);
|
||||||
|
|
||||||
|
// get local session state messages again
|
||||||
|
txn = db0.startTransaction(false);
|
||||||
|
try {
|
||||||
|
map = db0.getMessageMetadata(txn, group1.getId());
|
||||||
|
txn.setComplete();
|
||||||
|
} finally {
|
||||||
|
db0.endTransaction(txn);
|
||||||
|
}
|
||||||
|
// make sure local state is still there
|
||||||
|
assertEquals(1, map.size());
|
||||||
|
|
||||||
|
// introducer removes other introducee
|
||||||
|
contactManager0.removeContact(contactId2);
|
||||||
|
|
||||||
|
// get local session state messages again
|
||||||
|
txn = db0.startTransaction(false);
|
||||||
|
try {
|
||||||
|
map = db0.getMessageMetadata(txn, group1.getId());
|
||||||
|
txn.setComplete();
|
||||||
|
} finally {
|
||||||
|
db0.endTransaction(txn);
|
||||||
|
}
|
||||||
|
// make sure local state is gone now
|
||||||
|
assertEquals(0, map.size());
|
||||||
|
} finally {
|
||||||
|
stopLifecycles();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO add a test for faking responses when #256 is implemented
|
// TODO add a test for faking responses when #256 is implemented
|
||||||
|
|
||||||
@After
|
@After
|
||||||
@@ -947,15 +1052,16 @@ public class IntroductionIntegrationTest extends BriarTestCase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void eventOccurred(Event e) {
|
public void eventOccurred(Event e) {
|
||||||
if (e instanceof MessageValidatedEvent) {
|
if (e instanceof MessageStateChangedEvent) {
|
||||||
MessageValidatedEvent event = (MessageValidatedEvent) e;
|
MessageStateChangedEvent event = (MessageStateChangedEvent) e;
|
||||||
if (event.getClientId()
|
State s = event.getState();
|
||||||
.equals(introductionManager0.getClientId()) &&
|
ClientId c = event.getClientId();
|
||||||
|
if ((s == DELIVERED || s == INVALID) &&
|
||||||
|
c.equals(introductionManager0.getClientId()) &&
|
||||||
!event.isLocal()) {
|
!event.isLocal()) {
|
||||||
LOG.info("TEST: Introducee" + introducee +
|
LOG.info("TEST: Introducee" + introducee +
|
||||||
" received message in group " +
|
" received message in group " +
|
||||||
((MessageValidatedEvent) e).getMessage()
|
event.getMessage().getGroupId().hashCode());
|
||||||
.getGroupId().hashCode());
|
|
||||||
msgWaiter.resume();
|
msgWaiter.resume();
|
||||||
}
|
}
|
||||||
} else if (e instanceof IntroductionRequestReceivedEvent) {
|
} else if (e instanceof IntroductionRequestReceivedEvent) {
|
||||||
@@ -1014,14 +1120,13 @@ public class IntroductionIntegrationTest extends BriarTestCase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void eventOccurred(Event e) {
|
public void eventOccurred(Event e) {
|
||||||
if (e instanceof MessageValidatedEvent) {
|
if (e instanceof MessageStateChangedEvent) {
|
||||||
MessageValidatedEvent event = (MessageValidatedEvent) e;
|
MessageStateChangedEvent event = (MessageStateChangedEvent) e;
|
||||||
if (event.getClientId()
|
if (event.getState() == DELIVERED && event.getClientId()
|
||||||
.equals(introductionManager0.getClientId()) &&
|
.equals(introductionManager0.getClientId()) &&
|
||||||
!event.isLocal()) {
|
!event.isLocal()) {
|
||||||
LOG.info("TEST: Introducer received message in group " +
|
LOG.info("TEST: Introducer received message in group " +
|
||||||
((MessageValidatedEvent) e).getMessage()
|
event.getMessage().getGroupId().hashCode());
|
||||||
.getGroupId().hashCode());
|
|
||||||
msgWaiter.resume();
|
msgWaiter.resume();
|
||||||
}
|
}
|
||||||
} else if (e instanceof IntroductionResponseReceivedEvent) {
|
} else if (e instanceof IntroductionResponseReceivedEvent) {
|
||||||
|
|||||||
@@ -2,6 +2,11 @@ package org.briarproject;
|
|||||||
|
|
||||||
import org.briarproject.api.UniqueId;
|
import org.briarproject.api.UniqueId;
|
||||||
import org.briarproject.api.crypto.CryptoComponent;
|
import org.briarproject.api.crypto.CryptoComponent;
|
||||||
|
import org.briarproject.api.crypto.PrivateKey;
|
||||||
|
import org.briarproject.api.forum.ForumConstants;
|
||||||
|
import org.briarproject.api.forum.ForumPost;
|
||||||
|
import org.briarproject.api.forum.ForumPostFactory;
|
||||||
|
import org.briarproject.api.identity.Author;
|
||||||
import org.briarproject.api.identity.AuthorFactory;
|
import org.briarproject.api.identity.AuthorFactory;
|
||||||
import org.briarproject.api.messaging.MessagingConstants;
|
import org.briarproject.api.messaging.MessagingConstants;
|
||||||
import org.briarproject.api.messaging.PrivateMessage;
|
import org.briarproject.api.messaging.PrivateMessage;
|
||||||
@@ -13,6 +18,9 @@ import org.junit.Test;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
|
import static org.briarproject.api.forum.ForumConstants.MAX_FORUM_POST_BODY_LENGTH;
|
||||||
|
import static org.briarproject.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
|
||||||
|
import static org.briarproject.api.identity.AuthorConstants.MAX_PUBLIC_KEY_LENGTH;
|
||||||
import static org.briarproject.api.messaging.MessagingConstants.MAX_PRIVATE_MESSAGE_BODY_LENGTH;
|
import static org.briarproject.api.messaging.MessagingConstants.MAX_PRIVATE_MESSAGE_BODY_LENGTH;
|
||||||
import static org.briarproject.api.sync.SyncConstants.MAX_PACKET_PAYLOAD_LENGTH;
|
import static org.briarproject.api.sync.SyncConstants.MAX_PACKET_PAYLOAD_LENGTH;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
@@ -25,6 +33,8 @@ public class MessageSizeIntegrationTest extends BriarTestCase {
|
|||||||
AuthorFactory authorFactory;
|
AuthorFactory authorFactory;
|
||||||
@Inject
|
@Inject
|
||||||
PrivateMessageFactory privateMessageFactory;
|
PrivateMessageFactory privateMessageFactory;
|
||||||
|
@Inject
|
||||||
|
ForumPostFactory forumPostFactory;
|
||||||
|
|
||||||
public MessageSizeIntegrationTest() throws Exception {
|
public MessageSizeIntegrationTest() throws Exception {
|
||||||
MessageSizeIntegrationTestComponent component =
|
MessageSizeIntegrationTestComponent component =
|
||||||
@@ -51,4 +61,30 @@ public class MessageSizeIntegrationTest extends BriarTestCase {
|
|||||||
+ MAX_PRIVATE_MESSAGE_BODY_LENGTH);
|
+ MAX_PRIVATE_MESSAGE_BODY_LENGTH);
|
||||||
assertTrue(length <= MAX_PACKET_PAYLOAD_LENGTH);
|
assertTrue(length <= MAX_PACKET_PAYLOAD_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testForumPostFitsIntoPacket() throws Exception {
|
||||||
|
// Create a maximum-length author
|
||||||
|
String authorName = TestUtils.getRandomString(
|
||||||
|
MAX_AUTHOR_NAME_LENGTH);
|
||||||
|
byte[] authorPublic = new byte[MAX_PUBLIC_KEY_LENGTH];
|
||||||
|
Author author = authorFactory.createAuthor(authorName, authorPublic);
|
||||||
|
// Create a maximum-length forum post
|
||||||
|
GroupId groupId = new GroupId(TestUtils.getRandomId());
|
||||||
|
long timestamp = Long.MAX_VALUE;
|
||||||
|
MessageId parent = new MessageId(TestUtils.getRandomId());
|
||||||
|
String contentType = TestUtils.getRandomString(
|
||||||
|
ForumConstants.MAX_CONTENT_TYPE_LENGTH);
|
||||||
|
byte[] body = new byte[MAX_FORUM_POST_BODY_LENGTH];
|
||||||
|
PrivateKey privateKey = crypto.generateSignatureKeyPair().getPrivate();
|
||||||
|
ForumPost post = forumPostFactory.createPseudonymousPost(groupId,
|
||||||
|
timestamp, parent, author, contentType, body, privateKey);
|
||||||
|
// Check the size of the serialised message
|
||||||
|
int length = post.getMessage().getRaw().length;
|
||||||
|
assertTrue(length > UniqueId.LENGTH + 8 + UniqueId.LENGTH
|
||||||
|
+ MAX_AUTHOR_NAME_LENGTH + MAX_PUBLIC_KEY_LENGTH
|
||||||
|
+ ForumConstants.MAX_CONTENT_TYPE_LENGTH
|
||||||
|
+ MAX_FORUM_POST_BODY_LENGTH);
|
||||||
|
assertTrue(length <= MAX_PACKET_PAYLOAD_LENGTH);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.briarproject.crypto.CryptoModule;
|
|||||||
import org.briarproject.data.DataModule;
|
import org.briarproject.data.DataModule;
|
||||||
import org.briarproject.db.DatabaseModule;
|
import org.briarproject.db.DatabaseModule;
|
||||||
import org.briarproject.event.EventModule;
|
import org.briarproject.event.EventModule;
|
||||||
|
import org.briarproject.forum.ForumModule;
|
||||||
import org.briarproject.identity.IdentityModule;
|
import org.briarproject.identity.IdentityModule;
|
||||||
import org.briarproject.messaging.MessagingModule;
|
import org.briarproject.messaging.MessagingModule;
|
||||||
import org.briarproject.sync.SyncModule;
|
import org.briarproject.sync.SyncModule;
|
||||||
@@ -24,6 +25,7 @@ import dagger.Component;
|
|||||||
DataModule.class,
|
DataModule.class,
|
||||||
DatabaseModule.class,
|
DatabaseModule.class,
|
||||||
EventModule.class,
|
EventModule.class,
|
||||||
|
ForumModule.class,
|
||||||
IdentityModule.class,
|
IdentityModule.class,
|
||||||
MessagingModule.class,
|
MessagingModule.class,
|
||||||
SyncModule.class,
|
SyncModule.class,
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import java.util.Collection;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
|
|
||||||
import static org.briarproject.api.sync.SyncConstants.MAX_GROUP_DESCRIPTOR_LENGTH;
|
|
||||||
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
|
import static org.briarproject.api.transport.TransportConstants.TAG_LENGTH;
|
||||||
import static org.junit.Assert.assertArrayEquals;
|
import static org.junit.Assert.assertArrayEquals;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
@@ -76,7 +75,7 @@ public class SyncIntegrationTest extends BriarTestCase {
|
|||||||
streamNumber = 123;
|
streamNumber = 123;
|
||||||
// Create a group
|
// Create a group
|
||||||
ClientId clientId = new ClientId(TestUtils.getRandomId());
|
ClientId clientId = new ClientId(TestUtils.getRandomId());
|
||||||
byte[] descriptor = new byte[MAX_GROUP_DESCRIPTOR_LENGTH];
|
byte[] descriptor = new byte[0];
|
||||||
Group group = groupFactory.createGroup(clientId, descriptor);
|
Group group = groupFactory.createGroup(clientId, descriptor);
|
||||||
// Add two messages to the group
|
// Add two messages to the group
|
||||||
long timestamp = System.currentTimeMillis();
|
long timestamp = System.currentTimeMillis();
|
||||||
|
|||||||
11
briar-android/.tx/config
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
[main]
|
||||||
|
host = https://www.transifex.com
|
||||||
|
lang_map = pt_BR: pt-rBR
|
||||||
|
|
||||||
|
[briar.stringsxml-5]
|
||||||
|
file_filter = res/values-<lang>/strings.xml
|
||||||
|
source_file = res/values/strings.xml
|
||||||
|
source_lang = en
|
||||||
|
type = ANDROID
|
||||||
|
minimum_perc = 25
|
||||||
|
|
||||||
@@ -67,7 +67,8 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".android.SetupActivity"
|
android:name=".android.SetupActivity"
|
||||||
android:label="@string/setup_title">
|
android:label="@string/setup_title"
|
||||||
|
android:windowSoftInputMode="adjustResize">
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
@@ -98,6 +99,57 @@
|
|||||||
/>
|
/>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".android.forum.ForumInvitationsActivity"
|
||||||
|
android:label="@string/forum_invitations_title"
|
||||||
|
android:parentActivityName=".android.NavDrawerActivity">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value=".android.NavDrawerActivity"
|
||||||
|
/>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".android.forum.CreateForumActivity"
|
||||||
|
android:label="@string/create_forum_title"
|
||||||
|
android:parentActivityName=".android.NavDrawerActivity"
|
||||||
|
android:windowSoftInputMode="stateVisible">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value=".android.NavDrawerActivity"
|
||||||
|
/>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".android.forum.ForumActivity"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:parentActivityName=".android.NavDrawerActivity">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value=".android.NavDrawerActivity"
|
||||||
|
/>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".android.forum.ShareForumActivity"
|
||||||
|
android:label="@string/forums_share_toolbar_header"
|
||||||
|
android:parentActivityName=".android.forum.ForumActivity">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value=".android.forum.ForumActivity"
|
||||||
|
/>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".android.forum.ForumSharingStatusActivity"
|
||||||
|
android:label="@string/forum_sharing_status"
|
||||||
|
android:parentActivityName=".android.forum.ForumActivity">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value=".android.forum.ForumActivity"
|
||||||
|
/>
|
||||||
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".android.identity.CreateIdentityActivity"
|
android:name=".android.identity.CreateIdentityActivity"
|
||||||
android:label="@string/new_identity_title"
|
android:label="@string/new_identity_title"
|
||||||
@@ -154,6 +206,16 @@
|
|||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".android.ChangePasswordActivity"
|
||||||
|
android:label="@string/change_password"
|
||||||
|
android:parentActivityName=".android.SettingsActivity">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value=".android.SettingsActivity"
|
||||||
|
/>
|
||||||
|
</activity>
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".android.panic.PanicPreferencesActivity"
|
android:name=".android.panic.PanicPreferencesActivity"
|
||||||
android:label="@string/panic_setting">
|
android:label="@string/panic_setting">
|
||||||
|
|||||||
92
briar-android/artwork/trust-indicator.svg
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="49"
|
||||||
|
height="20"
|
||||||
|
viewBox="0 0 49.000004 20"
|
||||||
|
id="svg2"
|
||||||
|
version="1.1"
|
||||||
|
inkscape:version="0.91 r13725"
|
||||||
|
sodipodi:docname="trust-indicator.svg">
|
||||||
|
<defs
|
||||||
|
id="defs4" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="15.839192"
|
||||||
|
inkscape:cx="19.828141"
|
||||||
|
inkscape:cy="4.1791031"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
units="px"
|
||||||
|
fit-margin-top="0"
|
||||||
|
fit-margin-left="0"
|
||||||
|
fit-margin-right="0"
|
||||||
|
fit-margin-bottom="0"
|
||||||
|
inkscape:window-width="1920"
|
||||||
|
inkscape:window-height="993"
|
||||||
|
inkscape:window-x="1440"
|
||||||
|
inkscape:window-y="0"
|
||||||
|
inkscape:window-maximized="1" />
|
||||||
|
<metadata
|
||||||
|
id="metadata7">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-216.17711,-507.04154)">
|
||||||
|
<g
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;line-height:125%;font-family:FreeSans;-inkscape-font-specification:FreeSans;letter-spacing:0px;word-spacing:0px;fill:#b7b7b7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
id="text4136"
|
||||||
|
transform="matrix(1,0,0,0.90497738,-18.96574,55.694085)">
|
||||||
|
<path
|
||||||
|
d="m 250.64285,514.07648 0,-2.275 -2.55,0 0,-3.8 2.55,0 0,-2.275 -2.55,0 0,-4.225 -2.375,0 0,4.225 -3.15,0 0,-4.225 -2.375,0 0,4.225 -2.55,0 0,2.275 2.55,0 0,3.8 -2.55,0 0,2.275 2.55,0 0,4 2.375,0 0,-4 3.15,0 0,4 2.375,0 0,-4 2.55,0 z m -4.925,-2.275 -3.15,0 0,-3.8 3.15,0 0,3.8 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;font-family:Titillium;-inkscape-font-specification:'Titillium Semi-Bold';fill:#b7b7b7;fill-opacity:1"
|
||||||
|
id="path4745"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
transform="matrix(1,0,0,0.90497738,-3.4657389,55.694085)"
|
||||||
|
id="g4755"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;line-height:125%;font-family:FreeSans;-inkscape-font-specification:FreeSans;letter-spacing:0px;word-spacing:0px;fill:#b7b7b7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1">
|
||||||
|
<path
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
id="path4757"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;font-family:Titillium;-inkscape-font-specification:'Titillium Semi-Bold';fill:#b7b7b7;fill-opacity:1"
|
||||||
|
d="m 250.64285,514.07648 0,-2.275 -2.55,0 0,-3.8 2.55,0 0,-2.275 -2.55,0 0,-4.225 -2.375,0 0,4.225 -3.15,0 0,-4.225 -2.375,0 0,4.225 -2.55,0 0,2.275 2.55,0 0,3.8 -2.55,0 0,2.275 2.55,0 0,4 2.375,0 0,-4 3.15,0 0,4 2.375,0 0,-4 2.55,0 z m -4.925,-2.275 -3.15,0 0,-3.8 3.15,0 0,3.8 z" />
|
||||||
|
</g>
|
||||||
|
<g
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:25px;line-height:125%;font-family:FreeSans;-inkscape-font-specification:FreeSans;letter-spacing:0px;word-spacing:0px;fill:#b7b7b7;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||||
|
id="g4139"
|
||||||
|
transform="matrix(1,0,0,0.90497738,12.034262,55.694085)">
|
||||||
|
<path
|
||||||
|
d="m 250.64285,514.07648 0,-2.275 -2.55,0 0,-3.8 2.55,0 0,-2.275 -2.55,0 0,-4.225 -2.375,0 0,4.225 -3.15,0 0,-4.225 -2.375,0 0,4.225 -2.55,0 0,2.275 2.55,0 0,3.8 -2.55,0 0,2.275 2.55,0 0,4 2.375,0 0,-4 3.15,0 0,4 2.375,0 0,-4 2.55,0 z m -4.925,-2.275 -3.15,0 0,-3.8 3.15,0 0,3.8 z"
|
||||||
|
style="font-style:normal;font-variant:normal;font-weight:600;font-stretch:normal;font-family:Titillium;-inkscape-font-specification:'Titillium Semi-Bold';fill:#b7b7b7;fill-opacity:1"
|
||||||
|
id="path4141"
|
||||||
|
inkscape:connector-curvature="0" />
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 4.6 KiB |
@@ -6,11 +6,6 @@ apply plugin: 'witness'
|
|||||||
apply plugin: 'com.neenbedankt.android-apt'
|
apply plugin: 'com.neenbedankt.android-apt'
|
||||||
apply plugin: 'de.undercouch.download'
|
apply plugin: 'de.undercouch.download'
|
||||||
|
|
||||||
repositories {
|
|
||||||
jcenter()
|
|
||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
def supportVersion = '23.2.1'
|
def supportVersion = '23.2.1'
|
||||||
compile project(':briar-api')
|
compile project(':briar-api')
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 975 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1009 B |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 362 B |
|
Before Width: | Height: | Size: 708 B |
|
Before Width: | Height: | Size: 713 B |
|
Before Width: | Height: | Size: 531 B |
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 853 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
10
briar-android/res/drawable/blogs.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:alpha="0.54"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M13,12h7v1.5h-7zM13,9.5h7L20,11h-7zM13,14.5h7L20,16h-7zM21,4L3,4c-1.1,0 -2,0.9 -2,2v13c0,1.1 0.9,2 2,2h18c1.1,0 2,-0.9 2,-2L23,6c0,-1.1 -0.9,-2 -2,-2zM21,19h-9L12,6h9v13z"/>
|
||||||
|
</vector>
|
||||||
22
briar-android/res/drawable/bubble.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:radius="@dimen/unread_bubble_size"/>
|
||||||
|
|
||||||
|
<padding
|
||||||
|
android:left="@dimen/unread_bubble_padding_horizontal"
|
||||||
|
android:right="@dimen/unread_bubble_padding_horizontal"
|
||||||
|
android:bottom="1px"/>
|
||||||
|
|
||||||
|
<solid
|
||||||
|
android:color="@color/briar_primary"/>
|
||||||
|
|
||||||
|
<stroke
|
||||||
|
android:color="@color/briar_text_primary_inverse"
|
||||||
|
android:width="@dimen/avatar_border_width"/>
|
||||||
|
|
||||||
|
</shape>
|
||||||
|
|
||||||
21
briar-android/res/drawable/bubble_problem.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:radius="@dimen/unread_bubble_size"/>
|
||||||
|
|
||||||
|
<padding
|
||||||
|
android:left="@dimen/unread_bubble_padding_horizontal"
|
||||||
|
android:right="@dimen/unread_bubble_padding_horizontal"/>
|
||||||
|
|
||||||
|
<solid
|
||||||
|
android:color="@color/briar_gold"/>
|
||||||
|
|
||||||
|
<stroke
|
||||||
|
android:color="@color/briar_primary"
|
||||||
|
android:width="@dimen/avatar_border_width"/>
|
||||||
|
|
||||||
|
</shape>
|
||||||
|
|
||||||
4
briar-android/res/drawable/chevron48dp_down.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<vector android:height="24dp" android:viewportHeight="48.0"
|
||||||
|
android:viewportWidth="48.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M9.1,19.3l14.9,11.8l14.9,-11.8l-1.9,-2.4l-13,10.4l-13,-10.4z"/>
|
||||||
|
</vector>
|
||||||
4
briar-android/res/drawable/chevron48dp_up.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<vector android:height="24dp" android:viewportHeight="48.0"
|
||||||
|
android:viewportWidth="48.0" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<path android:fillColor="#FF000000" android:pathData="M38.9,28.7l-14.9,-11.8l-14.9,11.8l1.9,2.4l13,-10.4l13,10.4z"/>
|
||||||
|
</vector>
|
||||||
9
briar-android/res/drawable/forum_item_create_white.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFFFF"
|
||||||
|
android:pathData="M3,17.25V21h3.75L17.81,9.94l-3.75,-3.75L3,17.25zM20.71,7.04c0.39,-0.39 0.39,-1.02 0,-1.41l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-1.83,1.83 3.75,3.75 1.83,-1.83z"/>
|
||||||
|
</vector>
|
||||||
10
briar-android/res/drawable/ic_contacts_black_24dp.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:alpha="0.54"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M16,11c1.66,0 2.99,-1.34 2.99,-3S17.66,5 16,5c-1.66,0 -3,1.34 -3,3s1.34,3 3,3zM8,11c1.66,0 2.99,-1.34 2.99,-3S9.66,5 8,5C6.34,5 5,6.34 5,8s1.34,3 3,3zM8,13c-2.33,0 -7,1.17 -7,3.5L1,19h14v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5zM16,13c-0.29,0 -0.62,0.02 -0.97,0.05 1.16,0.84 1.97,1.97 1.97,3.45L17,19h6v-2.5c0,-2.33 -4.67,-3.5 -7,-3.5z"/>
|
||||||
|
</vector>
|
||||||
10
briar-android/res/drawable/ic_forums_black_24dp.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:alpha="0.54"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M21,6h-2v9L6,15v2c0,0.55 0.45,1 1,1h11l4,4L22,7c0,-0.55 -0.45,-1 -1,-1zM17,12L17,3c0,-0.55 -0.45,-1 -1,-1L3,2c-0.55,0 -1,0.45 -1,1v14l4,-4h10c0.55,0 1,-0.45 1,-1z"/>
|
||||||
|
</vector>
|
||||||
10
briar-android/res/drawable/ic_settings_black_24dp.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:alpha="0.54"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M19.43,12.98c0.04,-0.32 0.07,-0.64 0.07,-0.98s-0.03,-0.66 -0.07,-0.98l2.11,-1.65c0.19,-0.15 0.24,-0.42 0.12,-0.64l-2,-3.46c-0.12,-0.22 -0.39,-0.3 -0.61,-0.22l-2.49,1c-0.52,-0.4 -1.08,-0.73 -1.69,-0.98l-0.38,-2.65C14.46,2.18 14.25,2 14,2h-4c-0.25,0 -0.46,0.18 -0.49,0.42l-0.38,2.65c-0.61,0.25 -1.17,0.59 -1.69,0.98l-2.49,-1c-0.23,-0.09 -0.49,0 -0.61,0.22l-2,3.46c-0.13,0.22 -0.07,0.49 0.12,0.64l2.11,1.65c-0.04,0.32 -0.07,0.65 -0.07,0.98s0.03,0.66 0.07,0.98l-2.11,1.65c-0.19,0.15 -0.24,0.42 -0.12,0.64l2,3.46c0.12,0.22 0.39,0.3 0.61,0.22l2.49,-1c0.52,0.4 1.08,0.73 1.69,0.98l0.38,2.65c0.03,0.24 0.24,0.42 0.49,0.42h4c0.25,0 0.46,-0.18 0.49,-0.42l0.38,-2.65c0.61,-0.25 1.17,-0.59 1.69,-0.98l2.49,1c0.23,0.09 0.49,0 0.61,-0.22l2,-3.46c0.12,-0.22 0.07,-0.49 -0.12,-0.64l-2.11,-1.65zM12,15.5c-1.93,0 -3.5,-1.57 -3.5,-3.5s1.57,-3.5 3.5,-3.5 3.5,1.57 3.5,3.5 -1.57,3.5 -3.5,3.5z"/>
|
||||||
|
</vector>
|
||||||
10
briar-android/res/drawable/ic_signout_black_24dp.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:alpha="0.54"
|
||||||
|
android:viewportHeight="24.0"
|
||||||
|
android:viewportWidth="24.0">
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M13,8.2l-1,-1 -4,4 -4,-4 -1,1 4,4 -4,4 1,1 4,-4 4,4 1,-1 -4,-4 4,-4zM19,1H9c-1.1,0 -2,0.9 -2,2v3h2V4h10v16H9v-2H7v3c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3c0,-1.1 -0.9,-2 -2,-2z"/>
|
||||||
|
</vector>
|
||||||
9
briar-android/res/drawable/level_indicator_circle.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval">
|
||||||
|
|
||||||
|
<solid android:color="@color/window_background"/>
|
||||||
|
|
||||||
|
<stroke
|
||||||
|
android:width="2dp"
|
||||||
|
android:color="@color/forum_discussion_nested_line"/>
|
||||||
|
</shape>
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
A FAB does not work, because even with fabSize="mini" it will be too big due to shadow drawing
|
|
||||||
on lower API levels
|
|
||||||
-->
|
|
||||||
<selector
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item>
|
|
||||||
<shape android:shape="oval">
|
|
||||||
<solid android:color="@color/briar_primary"/>
|
|
||||||
</shape>
|
|
||||||
</item>
|
|
||||||
</selector>
|
|
||||||
5
briar-android/res/drawable/selector_chevron.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_selected="true" android:drawable="@drawable/chevron48dp_down"/>
|
||||||
|
<item android:drawable="@drawable/chevron48dp_up"/>
|
||||||
|
</selector>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:width="24dp"
|
android:width="38dp"
|
||||||
android:height="24dp"
|
android:height="38dp"
|
||||||
android:viewportHeight="24.0"
|
android:viewportHeight="24.0"
|
||||||
android:viewportWidth="24.0">
|
android:viewportWidth="24.0">
|
||||||
<path
|
<path
|
||||||
|
|||||||
40
briar-android/res/drawable/trust_indicator_anonymous.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="40dp"
|
||||||
|
android:height="15dp"
|
||||||
|
android:viewportHeight="20"
|
||||||
|
android:viewportWidth="49">
|
||||||
|
<path
|
||||||
|
android:fillColor="#b7b7b7"
|
||||||
|
android:pathData="M15.5002,13.8797 L15.5002,11.8208 L12.9502,11.8208 L12.9502,8.38194
|
||||||
|
L15.5002,8.38194 L15.5002,6.32312 L12.9502,6.32312 L12.9502,2.49959
|
||||||
|
L10.5752,2.49959 L10.5752,6.32312 L7.42514,6.32312 L7.42514,2.49959
|
||||||
|
L5.05014,2.49959 L5.05014,6.32312 L2.50016,6.32312 L2.50016,8.38194
|
||||||
|
L5.05014,8.38194 L5.05014,11.8208 L2.50016,11.8208 L2.50016,13.8797
|
||||||
|
L5.05014,13.8797 L5.05014,17.4996 L7.42514,17.4996 L7.42514,13.8797
|
||||||
|
L10.5752,13.8797 L10.5752,17.4996 L12.9502,17.4996 L12.9502,13.8797
|
||||||
|
L15.5002,13.8797 Z M10.5752,11.8208 L7.42514,11.8208 L7.42514,8.38194
|
||||||
|
L10.5752,8.38194 L10.5752,11.8208 Z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#b7b7b7"
|
||||||
|
android:pathData="M31.0002,13.8797 L31.0002,11.8208 L28.4502,11.8208 L28.4502,8.38194
|
||||||
|
L31.0002,8.38194 L31.0002,6.32312 L28.4502,6.32312 L28.4502,2.49959
|
||||||
|
L26.0752,2.49959 L26.0752,6.32312 L22.9251,6.32312 L22.9251,2.49959
|
||||||
|
L20.5501,2.49959 L20.5501,6.32312 L18.0002,6.32312 L18.0002,8.38194
|
||||||
|
L20.5501,8.38194 L20.5501,11.8208 L18.0002,11.8208 L18.0002,13.8797
|
||||||
|
L20.5501,13.8797 L20.5501,17.4996 L22.9251,17.4996 L22.9251,13.8797
|
||||||
|
L26.0752,13.8797 L26.0752,17.4996 L28.4502,17.4996 L28.4502,13.8797
|
||||||
|
L31.0002,13.8797 Z M26.0752,11.8208 L22.9251,11.8208 L22.9251,8.38194
|
||||||
|
L26.0752,8.38194 L26.0752,11.8208 Z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#b7b7b7"
|
||||||
|
android:pathData="M46.5002,13.8797 L46.5002,11.8208 L43.9502,11.8208 L43.9502,8.38194
|
||||||
|
L46.5002,8.38194 L46.5002,6.32312 L43.9502,6.32312 L43.9502,2.49959
|
||||||
|
L41.5752,2.49959 L41.5752,6.32312 L38.4251,6.32312 L38.4251,2.49959
|
||||||
|
L36.0501,2.49959 L36.0501,6.32312 L33.5002,6.32312 L33.5002,8.38194
|
||||||
|
L36.0501,8.38194 L36.0501,11.8208 L33.5002,11.8208 L33.5002,13.8797
|
||||||
|
L36.0501,13.8797 L36.0501,17.4996 L38.4251,17.4996 L38.4251,13.8797
|
||||||
|
L41.5752,13.8797 L41.5752,17.4996 L43.9502,17.4996 L43.9502,13.8797
|
||||||
|
L46.5002,13.8797 Z M41.5752,11.8208 L38.4251,11.8208 L38.4251,8.38194
|
||||||
|
L41.5752,8.38194 L41.5752,11.8208 Z"/>
|
||||||
|
</vector>
|
||||||
40
briar-android/res/drawable/trust_indicator_unknown.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="40dp"
|
||||||
|
android:height="15dp"
|
||||||
|
android:viewportHeight="20"
|
||||||
|
android:viewportWidth="49">
|
||||||
|
<path
|
||||||
|
android:fillColor="#c34032"
|
||||||
|
android:pathData="M15.5002,13.8797 L15.5002,11.8208 L12.9502,11.8208 L12.9502,8.38194
|
||||||
|
L15.5002,8.38194 L15.5002,6.32312 L12.9502,6.32312 L12.9502,2.49959
|
||||||
|
L10.5752,2.49959 L10.5752,6.32312 L7.42514,6.32312 L7.42514,2.49959
|
||||||
|
L5.05014,2.49959 L5.05014,6.32312 L2.50016,6.32312 L2.50016,8.38194
|
||||||
|
L5.05014,8.38194 L5.05014,11.8208 L2.50016,11.8208 L2.50016,13.8797
|
||||||
|
L5.05014,13.8797 L5.05014,17.4996 L7.42514,17.4996 L7.42514,13.8797
|
||||||
|
L10.5752,13.8797 L10.5752,17.4996 L12.9502,17.4996 L12.9502,13.8797
|
||||||
|
L15.5002,13.8797 Z M10.5752,11.8208 L7.42514,11.8208 L7.42514,8.38194
|
||||||
|
L10.5752,8.38194 L10.5752,11.8208 Z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#b7b7b7"
|
||||||
|
android:pathData="M31.0002,13.8797 L31.0002,11.8208 L28.4502,11.8208 L28.4502,8.38194
|
||||||
|
L31.0002,8.38194 L31.0002,6.32312 L28.4502,6.32312 L28.4502,2.49959
|
||||||
|
L26.0752,2.49959 L26.0752,6.32312 L22.9251,6.32312 L22.9251,2.49959
|
||||||
|
L20.5501,2.49959 L20.5501,6.32312 L18.0002,6.32312 L18.0002,8.38194
|
||||||
|
L20.5501,8.38194 L20.5501,11.8208 L18.0002,11.8208 L18.0002,13.8797
|
||||||
|
L20.5501,13.8797 L20.5501,17.4996 L22.9251,17.4996 L22.9251,13.8797
|
||||||
|
L26.0752,13.8797 L26.0752,17.4996 L28.4502,17.4996 L28.4502,13.8797
|
||||||
|
L31.0002,13.8797 Z M26.0752,11.8208 L22.9251,11.8208 L22.9251,8.38194
|
||||||
|
L26.0752,8.38194 L26.0752,11.8208 Z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#b7b7b7"
|
||||||
|
android:pathData="M46.5002,13.8797 L46.5002,11.8208 L43.9502,11.8208 L43.9502,8.38194
|
||||||
|
L46.5002,8.38194 L46.5002,6.32312 L43.9502,6.32312 L43.9502,2.49959
|
||||||
|
L41.5752,2.49959 L41.5752,6.32312 L38.4251,6.32312 L38.4251,2.49959
|
||||||
|
L36.0501,2.49959 L36.0501,6.32312 L33.5002,6.32312 L33.5002,8.38194
|
||||||
|
L36.0501,8.38194 L36.0501,11.8208 L33.5002,11.8208 L33.5002,13.8797
|
||||||
|
L36.0501,13.8797 L36.0501,17.4996 L38.4251,17.4996 L38.4251,13.8797
|
||||||
|
L41.5752,13.8797 L41.5752,17.4996 L43.9502,17.4996 L43.9502,13.8797
|
||||||
|
L46.5002,13.8797 Z M41.5752,11.8208 L38.4251,11.8208 L38.4251,8.38194
|
||||||
|
L41.5752,8.38194 L41.5752,11.8208 Z"/>
|
||||||
|
</vector>
|
||||||
40
briar-android/res/drawable/trust_indicator_unverified.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="40dp"
|
||||||
|
android:height="15dp"
|
||||||
|
android:viewportHeight="20"
|
||||||
|
android:viewportWidth="49">
|
||||||
|
<path
|
||||||
|
android:fillColor="#fcd53a"
|
||||||
|
android:pathData="M15.5002,13.8797 L15.5002,11.8208 L12.9502,11.8208 L12.9502,8.38194
|
||||||
|
L15.5002,8.38194 L15.5002,6.32312 L12.9502,6.32312 L12.9502,2.49959
|
||||||
|
L10.5752,2.49959 L10.5752,6.32312 L7.42514,6.32312 L7.42514,2.49959
|
||||||
|
L5.05014,2.49959 L5.05014,6.32312 L2.50016,6.32312 L2.50016,8.38194
|
||||||
|
L5.05014,8.38194 L5.05014,11.8208 L2.50016,11.8208 L2.50016,13.8797
|
||||||
|
L5.05014,13.8797 L5.05014,17.4996 L7.42514,17.4996 L7.42514,13.8797
|
||||||
|
L10.5752,13.8797 L10.5752,17.4996 L12.9502,17.4996 L12.9502,13.8797
|
||||||
|
L15.5002,13.8797 Z M10.5752,11.8208 L7.42514,11.8208 L7.42514,8.38194
|
||||||
|
L10.5752,8.38194 L10.5752,11.8208 Z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#fcd53a"
|
||||||
|
android:pathData="M31.0002,13.8797 L31.0002,11.8208 L28.4502,11.8208 L28.4502,8.38194
|
||||||
|
L31.0002,8.38194 L31.0002,6.32312 L28.4502,6.32312 L28.4502,2.49959
|
||||||
|
L26.0752,2.49959 L26.0752,6.32312 L22.9251,6.32312 L22.9251,2.49959
|
||||||
|
L20.5501,2.49959 L20.5501,6.32312 L18.0002,6.32312 L18.0002,8.38194
|
||||||
|
L20.5501,8.38194 L20.5501,11.8208 L18.0002,11.8208 L18.0002,13.8797
|
||||||
|
L20.5501,13.8797 L20.5501,17.4996 L22.9251,17.4996 L22.9251,13.8797
|
||||||
|
L26.0752,13.8797 L26.0752,17.4996 L28.4502,17.4996 L28.4502,13.8797
|
||||||
|
L31.0002,13.8797 Z M26.0752,11.8208 L22.9251,11.8208 L22.9251,8.38194
|
||||||
|
L26.0752,8.38194 L26.0752,11.8208 Z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#b7b7b7"
|
||||||
|
android:pathData="M46.5002,13.8797 L46.5002,11.8208 L43.9502,11.8208 L43.9502,8.38194
|
||||||
|
L46.5002,8.38194 L46.5002,6.32312 L43.9502,6.32312 L43.9502,2.49959
|
||||||
|
L41.5752,2.49959 L41.5752,6.32312 L38.4251,6.32312 L38.4251,2.49959
|
||||||
|
L36.0501,2.49959 L36.0501,6.32312 L33.5002,6.32312 L33.5002,8.38194
|
||||||
|
L36.0501,8.38194 L36.0501,11.8208 L33.5002,11.8208 L33.5002,13.8797
|
||||||
|
L36.0501,13.8797 L36.0501,17.4996 L38.4251,17.4996 L38.4251,13.8797
|
||||||
|
L41.5752,13.8797 L41.5752,17.4996 L43.9502,17.4996 L43.9502,13.8797
|
||||||
|
L46.5002,13.8797 Z M41.5752,11.8208 L38.4251,11.8208 L38.4251,8.38194
|
||||||
|
L41.5752,8.38194 L41.5752,11.8208 Z"/>
|
||||||
|
</vector>
|
||||||
40
briar-android/res/drawable/trust_indicator_verified.xml
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="40dp"
|
||||||
|
android:height="15dp"
|
||||||
|
android:viewportHeight="20"
|
||||||
|
android:viewportWidth="49">
|
||||||
|
<path
|
||||||
|
android:fillColor="#7fac49"
|
||||||
|
android:pathData="M15.5002,13.8797 L15.5002,11.8208 L12.9502,11.8208 L12.9502,8.38194
|
||||||
|
L15.5002,8.38194 L15.5002,6.32312 L12.9502,6.32312 L12.9502,2.49959
|
||||||
|
L10.5752,2.49959 L10.5752,6.32312 L7.42514,6.32312 L7.42514,2.49959
|
||||||
|
L5.05014,2.49959 L5.05014,6.32312 L2.50016,6.32312 L2.50016,8.38194
|
||||||
|
L5.05014,8.38194 L5.05014,11.8208 L2.50016,11.8208 L2.50016,13.8797
|
||||||
|
L5.05014,13.8797 L5.05014,17.4996 L7.42514,17.4996 L7.42514,13.8797
|
||||||
|
L10.5752,13.8797 L10.5752,17.4996 L12.9502,17.4996 L12.9502,13.8797
|
||||||
|
L15.5002,13.8797 Z M10.5752,11.8208 L7.42514,11.8208 L7.42514,8.38194
|
||||||
|
L10.5752,8.38194 L10.5752,11.8208 Z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#7fac49"
|
||||||
|
android:pathData="M31.0002,13.8797 L31.0002,11.8208 L28.4502,11.8208 L28.4502,8.38194
|
||||||
|
L31.0002,8.38194 L31.0002,6.32312 L28.4502,6.32312 L28.4502,2.49959
|
||||||
|
L26.0752,2.49959 L26.0752,6.32312 L22.9251,6.32312 L22.9251,2.49959
|
||||||
|
L20.5501,2.49959 L20.5501,6.32312 L18.0002,6.32312 L18.0002,8.38194
|
||||||
|
L20.5501,8.38194 L20.5501,11.8208 L18.0002,11.8208 L18.0002,13.8797
|
||||||
|
L20.5501,13.8797 L20.5501,17.4996 L22.9251,17.4996 L22.9251,13.8797
|
||||||
|
L26.0752,13.8797 L26.0752,17.4996 L28.4502,17.4996 L28.4502,13.8797
|
||||||
|
L31.0002,13.8797 Z M26.0752,11.8208 L22.9251,11.8208 L22.9251,8.38194
|
||||||
|
L26.0752,8.38194 L26.0752,11.8208 Z"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#7fac49"
|
||||||
|
android:pathData="M46.5002,13.8797 L46.5002,11.8208 L43.9502,11.8208 L43.9502,8.38194
|
||||||
|
L46.5002,8.38194 L46.5002,6.32312 L43.9502,6.32312 L43.9502,2.49959
|
||||||
|
L41.5752,2.49959 L41.5752,6.32312 L38.4251,6.32312 L38.4251,2.49959
|
||||||
|
L36.0501,2.49959 L36.0501,6.32312 L33.5002,6.32312 L33.5002,8.38194
|
||||||
|
L36.0501,8.38194 L36.0501,11.8208 L33.5002,11.8208 L33.5002,13.8797
|
||||||
|
L36.0501,13.8797 L36.0501,17.4996 L38.4251,17.4996 L38.4251,13.8797
|
||||||
|
L41.5752,13.8797 L41.5752,17.4996 L43.9502,17.4996 L43.9502,13.8797
|
||||||
|
L46.5002,13.8797 Z M41.5752,11.8208 L38.4251,11.8208 L38.4251,8.38194
|
||||||
|
L41.5752,8.38194 L41.5752,11.8208 Z"/>
|
||||||
|
</vector>
|
||||||
@@ -38,7 +38,8 @@
|
|||||||
style="@style/BriarTextBody"
|
style="@style/BriarTextBody"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/your_nickname"/>
|
android:text="@string/your_nickname"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner"
|
android:id="@+id/spinner"
|
||||||
@@ -46,7 +47,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/margin_medium"
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
android:background="@drawable/spinner_border"
|
android:background="@drawable/spinner_border"
|
||||||
android:spinnerMode="dropdown"/>
|
android:spinnerMode="dropdown"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/faceToFaceView"
|
android:id="@+id/faceToFaceView"
|
||||||
|
|||||||
@@ -38,7 +38,8 @@
|
|||||||
style="@style/BriarTextBody"
|
style="@style/BriarTextBody"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/your_nickname"/>
|
android:text="@string/your_nickname"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner"
|
android:id="@+id/spinner"
|
||||||
@@ -46,7 +47,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/margin_medium"
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
android:background="@drawable/spinner_border"
|
android:background="@drawable/spinner_border"
|
||||||
android:spinnerMode="dropdown"/>
|
android:spinnerMode="dropdown"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/faceToFaceView"
|
android:id="@+id/faceToFaceView"
|
||||||
|
|||||||
6
briar-android/res/layout/activity_available_forums.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<org.briarproject.android.util.BriarRecyclerView
|
||||||
|
android:id="@+id/availableForumsView"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
128
briar-android/res/layout/activity_change_password.xml
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".android.ChangePasswordActivity">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="@dimen/margin_activity_vertical"
|
||||||
|
android:paddingEnd="@dimen/margin_activity_horizontal"
|
||||||
|
android:paddingLeft="@dimen/margin_activity_horizontal"
|
||||||
|
android:paddingRight="@dimen/margin_activity_horizontal"
|
||||||
|
android:paddingStart="@dimen/margin_activity_horizontal"
|
||||||
|
android:paddingTop="@dimen/margin_activity_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/current_password_title"
|
||||||
|
style="@style/BriarTextTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text="@string/current_password"
|
||||||
|
android:textSize="@dimen/text_size_medium"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/current_password_entry_wrapper"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/current_password_title"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
app:errorEnabled="true">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/current_password_entry"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLines="1"/>
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/new_password_title"
|
||||||
|
style="@style/BriarTextTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/current_password_entry_wrapper"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text="@string/choose_new_password"
|
||||||
|
android:textSize="@dimen/text_size_medium"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/new_password_entry_wrapper"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/new_password_title"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
app:errorEnabled="true">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/new_password_entry"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLines="1"/>
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/new_password_confirm_title"
|
||||||
|
style="@style/BriarTextTitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/new_password_entry_wrapper"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text="@string/confirm_new_password"
|
||||||
|
android:textSize="@dimen/text_size_medium"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/new_password_confirm_wrapper"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/new_password_confirm_title"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
app:errorEnabled="true">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/new_password_confirm"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLines="1"/>
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<org.briarproject.android.util.StrengthMeter
|
||||||
|
android:id="@+id/strength_meter"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/new_password_confirm_wrapper"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:visibility="invisible"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/change_password"
|
||||||
|
style="@style/BriarButton.Default"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/strength_meter"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
|
android:enabled="false"
|
||||||
|
android:text="@string/change_password"/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progress_wheel"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@id/change_password"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:visibility="invisible"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
@@ -46,33 +46,9 @@
|
|||||||
|
|
||||||
<View style="@style/Divider.Horizontal"/>
|
<View style="@style/Divider.Horizontal"/>
|
||||||
|
|
||||||
<LinearLayout
|
<include
|
||||||
|
layout="@layout/text_input_field"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"/>
|
||||||
android:background="@color/button_bar_background"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:paddingLeft="@dimen/margin_medium"
|
|
||||||
android:paddingStart="@dimen/margin_medium">
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/contentView"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:hint="@string/private_message_hint"
|
|
||||||
android:inputType="text|textMultiLine|textCapSentences"/>
|
|
||||||
|
|
||||||
<ImageButton
|
|
||||||
android:id="@+id/sendButton"
|
|
||||||
android:layout_width="38dp"
|
|
||||||
android:layout_height="38dp"
|
|
||||||
android:layout_margin="@dimen/margin_small"
|
|
||||||
android:background="@drawable/round_button"
|
|
||||||
android:src="@drawable/social_send_now_white"
|
|
||||||
android:contentDescription="@string/send"
|
|
||||||
android:elevation="@dimen/margin_tiny"
|
|
||||||
/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
49
briar-android/res/layout/activity_create_forum.xml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:padding="20dp" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
android:text="@string/choose_forum_name" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/createForumNameEntry"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:inputType="text|textCapSentences" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/createForumFeedback"
|
||||||
|
android:gravity="center"
|
||||||
|
android:paddingLeft="50dp"
|
||||||
|
android:paddingRight="50dp" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
style="@style/BriarButton"
|
||||||
|
android:id="@+id/createForumButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text="@string/create_forum_button" />
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/createForumProgressBar"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
52
briar-android/res/layout/activity_create_identity.xml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/margin_activity_horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:text="@string/choose_nickname"
|
||||||
|
android:textSize="@dimen/text_size_large"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/nicknameInputLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:errorEnabled="true">
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/nicknameEntry"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:ems="10"
|
||||||
|
android:inputType="textPersonName"
|
||||||
|
android:maxLines="1"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/createIdentityButton"
|
||||||
|
style="@style/BriarButton"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:enabled="false"
|
||||||
|
android:text="@string/create_identity_button"/>
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:id="@+id/progressBar"
|
||||||
|
style="?android:attr/progressBarStyleLarge"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:indeterminate="true"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
9
briar-android/res/layout/activity_expired.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<TextView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/expiry_warning"
|
||||||
|
android:textSize="@dimen/text_size_large"/>
|
||||||
21
briar-android/res/layout/activity_forum.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<org.briarproject.android.util.BriarRecyclerView
|
||||||
|
android:id="@+id/forum_discussion_list"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
app:scrollToEnd="false"/>
|
||||||
|
|
||||||
|
<include
|
||||||
|
layout="@layout/text_input_field"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
48
briar-android/res/layout/activity_forum_sharing_status.xml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/default_separator_inverted"
|
||||||
|
android:padding="@dimen/margin_medium"
|
||||||
|
android:text="@string/forum_shared_by"
|
||||||
|
android:textSize="@dimen/text_size_large"/>
|
||||||
|
|
||||||
|
<View style="@style/Divider.ForumList"/>
|
||||||
|
|
||||||
|
<org.briarproject.android.util.BriarRecyclerView
|
||||||
|
android:id="@+id/sharedByView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="@dimen/margin_medium"
|
||||||
|
android:paddingTop="@dimen/margin_medium"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/default_separator_inverted"
|
||||||
|
android:padding="@dimen/margin_medium"
|
||||||
|
android:text="@string/forum_shared_with"
|
||||||
|
android:textSize="@dimen/text_size_large"/>
|
||||||
|
|
||||||
|
<View style="@style/Divider.ForumList"/>
|
||||||
|
|
||||||
|
<org.briarproject.android.util.BriarRecyclerView
|
||||||
|
android:id="@+id/sharedWithView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingBottom="@dimen/margin_medium"
|
||||||
|
android:paddingTop="@dimen/margin_medium"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
<include
|
<include
|
||||||
android:id="@+id/navigation_menu_drawer"
|
android:id="@+id/navigation_menu_drawer"
|
||||||
layout="@layout/navigation_menu"
|
layout="@layout/navigation_menu"
|
||||||
android:layout_width="@dimen/nav_drawer_width"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="start"/>
|
android:layout_gravity="start"/>
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
<ScrollView
|
<ScrollView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent"
|
||||||
|
tools:context=".android.SetupActivity">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -17,109 +19,93 @@
|
|||||||
android:paddingTop="@dimen/margin_activity_vertical">
|
android:paddingTop="@dimen/margin_activity_vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/nickname_title"
|
android:id="@+id/setup_explanation"
|
||||||
style="@style/BriarTextTitle"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerHorizontal="true"
|
android:text="@string/setup_explanation"/>
|
||||||
android:text="@string/choose_nickname"
|
|
||||||
android:textSize="@dimen/text_size_medium"/>
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
<android.support.design.widget.TextInputLayout
|
||||||
android:id="@+id/nickname_entry_wrapper"
|
android:id="@+id/nickname_entry_wrapper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/setup_explanation"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_below="@id/nickname_title"
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
app:errorEnabled="true">
|
app:errorEnabled="true">
|
||||||
|
|
||||||
<EditText
|
<android.support.design.widget.TextInputEditText
|
||||||
android:id="@+id/nickname_entry"
|
android:id="@+id/nickname_entry"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/choose_nickname"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
android:inputType="text|textCapWords"
|
android:inputType="text|textCapWords"
|
||||||
android:maxLines="1"/>
|
android:maxLines="1"/>
|
||||||
</android.support.design.widget.TextInputLayout>
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/password_title"
|
|
||||||
style="@style/BriarTextTitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_below="@id/nickname_entry_wrapper"
|
|
||||||
android:text="@string/choose_password"
|
|
||||||
android:textSize="@dimen/text_size_medium"/>
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
<android.support.design.widget.TextInputLayout
|
||||||
android:id="@+id/password_entry_wrapper"
|
android:id="@+id/password_entry_wrapper"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/nickname_entry_wrapper"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_below="@id/password_title"
|
|
||||||
app:errorEnabled="true">
|
app:errorEnabled="true">
|
||||||
|
|
||||||
<EditText
|
<android.support.design.widget.TextInputEditText
|
||||||
android:id="@+id/password_entry"
|
android:id="@+id/password_entry"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/choose_password"
|
||||||
|
android:imeOptions="actionNext"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:maxLines="1"/>
|
android:maxLines="1"/>
|
||||||
</android.support.design.widget.TextInputLayout>
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/password_confirm_title"
|
|
||||||
style="@style/BriarTextTitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_below="@id/password_entry_wrapper"
|
|
||||||
android:text="@string/confirm_password"
|
|
||||||
android:textSize="@dimen/text_size_medium"/>
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
|
||||||
android:id="@+id/password_confirm_wrapper"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:layout_below="@id/password_confirm_title"
|
|
||||||
app:errorEnabled="true">
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/password_confirm"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:inputType="textPassword"
|
|
||||||
android:imeOptions="actionDone"
|
|
||||||
android:maxLines="1"/>
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
|
||||||
|
|
||||||
<org.briarproject.android.util.StrengthMeter
|
<org.briarproject.android.util.StrengthMeter
|
||||||
android:id="@+id/strength_meter"
|
android:id="@+id/strength_meter"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/password_entry_wrapper"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_below="@id/password_confirm_wrapper"
|
android:layout_marginBottom="@dimen/margin_medium"
|
||||||
android:visibility="invisible"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:id="@+id/password_confirm_wrapper"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/strength_meter"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
app:errorEnabled="true">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputEditText
|
||||||
|
android:id="@+id/password_confirm"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="@string/confirm_password"
|
||||||
|
android:imeOptions="actionDone"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:maxLines="1"/>
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/create_account"
|
android:id="@+id/create_account"
|
||||||
style="@style/BriarButton.Default"
|
style="@style/BriarButton.Default"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/password_confirm_wrapper"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_below="@id/strength_meter"
|
|
||||||
android:layout_marginTop="@dimen/margin_medium"
|
|
||||||
android:enabled="false"
|
android:enabled="false"
|
||||||
android:text="@string/create_account_button"/>
|
android:text="@string/create_account_button"/>
|
||||||
|
|
||||||
<ProgressBar
|
<ProgressBar
|
||||||
android:id="@+id/progress_wheel"
|
android:id="@+id/progress_wheel"
|
||||||
|
style="?android:attr/progressBarStyle"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignTop="@id/create_account"
|
android:layout_alignTop="@id/create_account"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:visibility="invisible" />
|
android:visibility="invisible"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|||||||
6
briar-android/res/layout/activity_share_forum.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<FrameLayout
|
||||||
|
android:id="@+id/shareForumContainer"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<RelativeLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
|
||||||
android:id="@+id/avatarView"
|
|
||||||
android:layout_width="@dimen/listitem_picture_size"
|
|
||||||
android:layout_height="@dimen/listitem_picture_size"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
|
||||||
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
|
||||||
app:civ_border_width="@dimen/avatar_border_width"
|
|
||||||
app:civ_border_color="@color/briar_primary"/>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/statusView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:src="@drawable/identity_anonymous"/>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/nameView"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentLeft="true"
|
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:layout_marginEnd="@dimen/margin_small"
|
|
||||||
android:layout_marginLeft="@dimen/listitem_text_left_margin"
|
|
||||||
android:layout_marginRight="@dimen/margin_small"
|
|
||||||
android:layout_marginStart="@dimen/listitem_text_left_margin"
|
|
||||||
android:layout_toLeftOf="@id/statusView"
|
|
||||||
android:layout_toStartOf="@id/statusView"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:text="@string/anonymous"
|
|
||||||
android:textSize="@dimen/text_size_medium"/>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
@@ -24,8 +24,10 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
|
android:gravity="center"
|
||||||
android:padding="@dimen/margin_activity_horizontal"
|
android:padding="@dimen/margin_activity_horizontal"
|
||||||
|
android:text="@string/no_data"
|
||||||
android:textSize="@dimen/text_size_large"
|
android:textSize="@dimen/text_size_large"
|
||||||
android:text="@string/no_data"/>
|
tools:text="@string/no_contacts"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -9,11 +9,10 @@
|
|||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
android:id="@+id/contactAvatar"
|
android:id="@+id/contactAvatar"
|
||||||
|
style="@style/BriarAvatar"
|
||||||
android:layout_width="30dp"
|
android:layout_width="30dp"
|
||||||
android:layout_height="30dp"
|
android:layout_height="30dp"
|
||||||
android:transitionName="avatar"
|
|
||||||
app:civ_border_color="@color/action_bar_text"
|
app:civ_border_color="@color/action_bar_text"
|
||||||
app:civ_border_width="@dimen/avatar_border_width"
|
|
||||||
tools:src="@drawable/ic_launcher"/>
|
tools:src="@drawable/ic_launcher"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -22,7 +21,7 @@
|
|||||||
android:layout_height="15dp"
|
android:layout_height="15dp"
|
||||||
android:layout_gravity="bottom|right"
|
android:layout_gravity="bottom|right"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
tools:src="@drawable/contact_online"
|
tools:ignore="ContentDescription"
|
||||||
tools:ignore="ContentDescription"/>
|
tools:src="@drawable/contact_online"/>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
@@ -9,11 +8,11 @@
|
|||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
android:id="@+id/avatarView"
|
android:id="@+id/avatarView"
|
||||||
|
style="@style/BriarAvatar"
|
||||||
android:layout_width="@dimen/dropdown_picture_size"
|
android:layout_width="@dimen/dropdown_picture_size"
|
||||||
android:layout_height="@dimen/dropdown_picture_size"
|
android:layout_height="@dimen/dropdown_picture_size"
|
||||||
android:layout_margin="@dimen/margin_small"
|
android:layout_margin="@dimen/margin_small"
|
||||||
app:civ_border_color="@color/briar_primary"
|
tools:src="@drawable/ic_launcher"/>
|
||||||
app:civ_border_width="@dimen/avatar_border_width"/>
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/nameView"
|
android:id="@+id/nameView"
|
||||||
|
|||||||
193
briar-android/res/layout/forum_discussion_cell.xml
Normal file
@@ -0,0 +1,193 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/forum_cell"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/nested_line_1"
|
||||||
|
style="@style/DiscussionLevelIndicator"
|
||||||
|
android:layout_width="@dimen/forum_nested_line_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:visibility="gone"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/nested_line_2"
|
||||||
|
style="@style/DiscussionLevelIndicator"
|
||||||
|
android:layout_width="@dimen/forum_nested_line_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_toRightOf="@id/nested_line_1"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/nested_line_3"
|
||||||
|
style="@style/DiscussionLevelIndicator"
|
||||||
|
android:layout_width="@dimen/forum_nested_line_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_toRightOf="@id/nested_line_2"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/nested_line_4"
|
||||||
|
style="@style/DiscussionLevelIndicator"
|
||||||
|
android:layout_width="@dimen/forum_nested_line_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_toRightOf="@id/nested_line_3"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/nested_line_5"
|
||||||
|
style="@style/DiscussionLevelIndicator"
|
||||||
|
android:layout_width="@dimen/forum_nested_line_width"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_toRightOf="@id/nested_line_4"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/nested_line_text"
|
||||||
|
android:layout_width="@dimen/forum_nested_indicator"
|
||||||
|
android:layout_height="@dimen/forum_nested_indicator"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:background="@drawable/level_indicator_circle"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="@dimen/text_size_small"
|
||||||
|
android:visibility="gone"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/margin_medium"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/text"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="@dimen/margin_small"
|
||||||
|
android:layout_marginLeft="@dimen/margin_medium"
|
||||||
|
android:layout_marginRight="@dimen/margin_medium"
|
||||||
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
|
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."/>
|
||||||
|
|
||||||
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
|
android:id="@+id/avatar"
|
||||||
|
android:layout_width="@dimen/forum_avatar_size"
|
||||||
|
android:layout_height="@dimen/forum_avatar_size"
|
||||||
|
android:layout_alignLeft="@id/text"
|
||||||
|
android:layout_below="@id/text"
|
||||||
|
android:layout_marginRight="@dimen/margin_small"
|
||||||
|
android:layout_marginTop="@dimen/margin_small"
|
||||||
|
android:src="@drawable/ic_launcher"
|
||||||
|
app:civ_border_color="@color/briar_primary"
|
||||||
|
app:civ_border_width="@dimen/avatar_border_width"
|
||||||
|
tools:src="@drawable/ic_launcher"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/author"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toRightOf="@id/avatar"
|
||||||
|
android:layout_alignBottom="@+id/avatar"
|
||||||
|
android:layout_alignTop="@+id/avatar"
|
||||||
|
android:gravity="center"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/text_size_tiny"
|
||||||
|
tools:text="John Smith"/>
|
||||||
|
|
||||||
|
<org.briarproject.android.util.TrustIndicatorView
|
||||||
|
android:id="@+id/trustIndicator"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/avatar"
|
||||||
|
android:layout_alignTop="@+id/avatar"
|
||||||
|
android:scaleType="center"
|
||||||
|
android:layout_marginLeft="@dimen/margin_small"
|
||||||
|
android:layout_marginStart="@dimen/margin_small"
|
||||||
|
android:layout_toRightOf="@+id/author"
|
||||||
|
tools:src="@drawable/trust_indicator_verified"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/date"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBottom="@+id/avatar"
|
||||||
|
android:layout_alignTop="@+id/avatar"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_toRightOf="@+id/trustIndicator"
|
||||||
|
android:layout_marginLeft="@dimen/margin_small"
|
||||||
|
android:layout_marginStart="@dimen/margin_small"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/text_size_tiny"
|
||||||
|
tools:text="09:09"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/chevron"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_below="@id/text"
|
||||||
|
android:layout_marginRight="@dimen/margin_medium"
|
||||||
|
android:layout_marginTop="@dimen/margin_small"
|
||||||
|
android:clickable="true"
|
||||||
|
android:src="@drawable/selector_chevron"
|
||||||
|
android:tint="@color/briar_button_positive"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btn_reply"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/text"
|
||||||
|
android:layout_marginRight="@dimen/margin_medium"
|
||||||
|
android:layout_toLeftOf="@id/chevron"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:clickable="true"
|
||||||
|
android:padding="@dimen/margin_medium"
|
||||||
|
android:text="@string/btn_reply"
|
||||||
|
android:textColor="@color/briar_button_positive"
|
||||||
|
android:textSize="@dimen/text_size_tiny"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/replies"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignBaseline="@id/btn_reply"
|
||||||
|
android:layout_toLeftOf="@id/btn_reply"
|
||||||
|
android:layout_toRightOf="@+id/date"
|
||||||
|
android:gravity="right|end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:padding="@dimen/margin_medium"
|
||||||
|
android:textSize="@dimen/text_size_tiny"
|
||||||
|
tools:text="2 replies"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/top_divider"
|
||||||
|
style="@style/Divider.ForumList"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/margin_separator"
|
||||||
|
android:layout_alignLeft="@id/text"
|
||||||
|
android:layout_alignParentTop="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
46
briar-android/res/layout/fragment_blogs.xml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.design.widget.TabLayout
|
||||||
|
android:id="@+id/tabLayout"
|
||||||
|
style="@style/BriarTabLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<android.support.design.widget.TabItem
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/blogs_feed"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TabItem
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/blogs_my_blogs"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TabItem
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/blogs_blog_list"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TabItem
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/blogs_available_blogs"/>
|
||||||
|
|
||||||
|
<android.support.design.widget.TabItem
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/blogs_drafts"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.TabLayout>
|
||||||
|
|
||||||
|
<android.support.v4.view.ViewPager
|
||||||
|
android:id="@+id/pager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
26
briar-android/res/layout/fragment_blogs_my.xml
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- This is just a placeholder to be replaced by the real My Blogs list -->
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/num"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:padding="@dimen/margin_activity_horizontal"
|
||||||
|
android:textSize="128sp"
|
||||||
|
tools:text="1"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="@dimen/margin_activity_horizontal"
|
||||||
|
android:text="There is nothing for you to see here.\n\nMove along and come back later."
|
||||||
|
android:textSize="@dimen/text_size_large"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -1,27 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.design.widget.CoordinatorLayout
|
<org.briarproject.android.util.BriarRecyclerView
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:id="@+id/coordinatorLayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent">
|
|
||||||
|
|
||||||
<org.briarproject.android.util.BriarRecyclerView
|
|
||||||
android:id="@+id/contactList"
|
android:id="@+id/contactList"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"/>
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
<android.support.design.widget.FloatingActionButton
|
|
||||||
android:id="@+id/addContactFAB"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="bottom|end"
|
|
||||||
android:layout_margin="@dimen/margin_activity_horizontal"
|
|
||||||
android:src="@drawable/ic_add_white"
|
|
||||||
app:fabSize="normal"
|
|
||||||
app:elevation="4dp"
|
|
||||||
app:layout_anchor="@id/contactList"
|
|
||||||
app:layout_anchorGravity="bottom|right|end"
|
|
||||||
app:layout_behavior="org.briarproject.android.util.HideFabOnScrollBehavior"/>
|
|
||||||
|
|
||||||
</android.support.design.widget.CoordinatorLayout>
|
|
||||||
|
|||||||
16
briar-android/res/layout/fragment_forum_list.xml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<android.support.design.widget.CoordinatorLayout
|
||||||
|
android:id="@+id/coordinatorLayout"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<org.briarproject.android.util.BriarRecyclerView
|
||||||
|
android:id="@+id/forumList"
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:layout_behavior="org.briarproject.android.util.BriarRecyclerViewBehavior"/>
|
||||||
|
|
||||||
|
</android.support.design.widget.CoordinatorLayout>
|
||||||
@@ -20,7 +20,8 @@
|
|||||||
style="@style/BriarTextBody"
|
style="@style/BriarTextBody"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/your_nickname"/>
|
android:text="@string/your_nickname"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner"
|
android:id="@+id/spinner"
|
||||||
@@ -28,7 +29,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/margin_medium"
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
android:background="@drawable/spinner_border"
|
android:background="@drawable/spinner_border"
|
||||||
android:spinnerMode="dropdown"/>
|
android:spinnerMode="dropdown"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
android:id="@+id/avatarContact1"
|
android:id="@+id/avatarContact1"
|
||||||
|
style="@style/BriarAvatar"
|
||||||
android:layout_width="@dimen/listitem_picture_size"
|
android:layout_width="@dimen/listitem_picture_size"
|
||||||
android:layout_height="@dimen/listitem_picture_size"
|
android:layout_height="@dimen/listitem_picture_size"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@@ -31,8 +32,6 @@
|
|||||||
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
||||||
android:layout_toLeftOf="@+id/introductionIcon"
|
android:layout_toLeftOf="@+id/introductionIcon"
|
||||||
android:layout_toStartOf="@+id/introductionIcon"
|
android:layout_toStartOf="@+id/introductionIcon"
|
||||||
app:civ_border_color="@color/briar_primary"
|
|
||||||
app:civ_border_width="@dimen/avatar_border_width"
|
|
||||||
tools:src="@drawable/ic_launcher"/>
|
tools:src="@drawable/ic_launcher"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -45,6 +44,7 @@
|
|||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
android:id="@+id/avatarContact2"
|
android:id="@+id/avatarContact2"
|
||||||
|
style="@style/BriarAvatar"
|
||||||
android:layout_width="@dimen/listitem_picture_size"
|
android:layout_width="@dimen/listitem_picture_size"
|
||||||
android:layout_height="@dimen/listitem_picture_size"
|
android:layout_height="@dimen/listitem_picture_size"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@@ -53,8 +53,6 @@
|
|||||||
android:layout_toEndOf="@+id/introductionIcon"
|
android:layout_toEndOf="@+id/introductionIcon"
|
||||||
android:layout_toRightOf="@+id/introductionIcon"
|
android:layout_toRightOf="@+id/introductionIcon"
|
||||||
android:transitionName="avatar"
|
android:transitionName="avatar"
|
||||||
app:civ_border_color="@color/briar_primary"
|
|
||||||
app:civ_border_width="@dimen/avatar_border_width"
|
|
||||||
tools:src="@drawable/ic_launcher"/>
|
tools:src="@drawable/ic_launcher"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@@ -75,6 +73,7 @@
|
|||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="top"
|
android:gravity="top"
|
||||||
android:textSize="@dimen/text_size_medium"
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
tools:text="@string/introduction_message_text"/>
|
tools:text="@string/introduction_message_text"/>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
|||||||
@@ -47,6 +47,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="@dimen/margin_medium"
|
android:padding="@dimen/margin_medium"
|
||||||
android:textSize="50sp"
|
android:textSize="50sp"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
android:layout_below="@+id/yourConfirmationCodeView"
|
android:layout_below="@+id/yourConfirmationCodeView"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
tools:text="1337"/>
|
tools:text="1337"/>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/margin_medium"
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
android:textSize="50sp"
|
android:textSize="50sp"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
android:layout_below="@+id/yourCodeView"
|
android:layout_below="@+id/yourCodeView"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
tools:text="1337"/>
|
tools:text="1337"/>
|
||||||
|
|||||||
@@ -20,7 +20,8 @@
|
|||||||
style="@style/BriarTextBody"
|
style="@style/BriarTextBody"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/your_nickname"/>
|
android:text="@string/your_nickname"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<Spinner
|
<Spinner
|
||||||
android:id="@+id/spinner"
|
android:id="@+id/spinner"
|
||||||
@@ -28,7 +29,8 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/spinner_border"
|
android:background="@drawable/spinner_border"
|
||||||
android:layout_marginTop="@dimen/margin_medium"
|
android:layout_marginTop="@dimen/margin_medium"
|
||||||
android:spinnerMode="dropdown"/>
|
android:spinnerMode="dropdown"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/imageView"
|
android:id="@+id/imageView"
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
android:text="@string/connection_failed"
|
android:text="@string/connection_failed"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:textSize="@dimen/text_size_large"
|
android:textSize="@dimen/text_size_large"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
android:drawableStart="@drawable/alerts_and_states_error"
|
android:drawableStart="@drawable/alerts_and_states_error"
|
||||||
android:drawableLeft="@drawable/alerts_and_states_error"
|
android:drawableLeft="@drawable/alerts_and_states_error"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/interfering"
|
android:text="@string/interfering"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:padding="@dimen/margin_medium"/>
|
android:padding="@dimen/margin_medium"/>
|
||||||
|
|
||||||
|
|||||||
90
briar-android/res/layout/list_item_available_forum.xml
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
||||||
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingTop="@dimen/listitem_horizontal_margin">
|
||||||
|
|
||||||
|
<org.briarproject.android.util.TextAvatarView
|
||||||
|
android:id="@+id/avatarView"
|
||||||
|
android:layout_width="@dimen/listitem_picture_frame_size"
|
||||||
|
android:layout_height="@dimen/listitem_picture_frame_size"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/forumNameView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_toEndOf="@+id/avatarView"
|
||||||
|
android:layout_toRightOf="@+id/avatarView"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textColor="@color/briar_primary"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
tools:text="This is a name of a forum that is available"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sharedByView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/forumNameView"
|
||||||
|
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_toEndOf="@+id/avatarView"
|
||||||
|
android:layout_toRightOf="@+id/avatarView"
|
||||||
|
android:paddingTop="@dimen/margin_medium"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
|
android:textSize="@dimen/text_size_small"
|
||||||
|
tools:text="Shared by Megalox"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/forumSubscribedView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/sharedByView"
|
||||||
|
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/margin_medium"
|
||||||
|
android:text="@string/forum_invitation_exists"
|
||||||
|
android:textColor="@color/briar_text_tertiary"
|
||||||
|
android:textSize="@dimen/text_size_small"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/acceptButton"
|
||||||
|
style="@style/BriarButtonFlat.Positive"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_below="@+id/forumSubscribedView"
|
||||||
|
android:layout_marginTop="-8dp"
|
||||||
|
android:text="@string/dialog_button_accept"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/declineButton"
|
||||||
|
style="@style/BriarButtonFlat.Negative"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/forumSubscribedView"
|
||||||
|
android:layout_marginTop="-8dp"
|
||||||
|
android:layout_toLeftOf="@+id/acceptButton"
|
||||||
|
android:layout_toStartOf="@+id/acceptButton"
|
||||||
|
android:text="@string/dialog_button_decline"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/Divider.ForumList"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_below="@+id/acceptButton"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
@@ -10,43 +10,62 @@
|
|||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="@dimen/listitem_horizontal_margin"
|
|
||||||
android:paddingBottom="@dimen/listitem_horizontal_margin"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
android:background="?attr/selectableItemBackground"
|
||||||
|
android:paddingBottom="@dimen/listitem_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/listitem_horizontal_margin"
|
||||||
>
|
>
|
||||||
|
|
||||||
<de.hdodenhof.circleimageview.CircleImageView
|
<FrameLayout
|
||||||
android:id="@+id/avatarView"
|
android:id="@+id/avatarFrameView"
|
||||||
android:layout_width="@dimen/listitem_picture_size"
|
android:layout_width="@dimen/listitem_picture_frame_size"
|
||||||
android:layout_height="@dimen/listitem_picture_size"
|
android:layout_height="@dimen/listitem_picture_frame_size"
|
||||||
android:layout_alignParentLeft="true"
|
android:layout_alignParentLeft="true"
|
||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
||||||
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
android:layout_marginStart="@dimen/listitem_horizontal_margin">
|
||||||
android:transitionName="avatar"
|
|
||||||
app:civ_border_color="@color/briar_primary"
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
app:civ_border_width="@dimen/avatar_border_width"
|
android:id="@+id/avatarView"
|
||||||
tools:src="@drawable/ic_launcher"/>
|
style="@style/BriarAvatar"
|
||||||
|
android:layout_width="@dimen/listitem_picture_size"
|
||||||
|
android:layout_height="@dimen/listitem_picture_size"
|
||||||
|
android:layout_gravity="bottom|left"
|
||||||
|
tools:src="@drawable/ic_launcher"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/unreadCountView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="@dimen/unread_bubble_size"
|
||||||
|
android:layout_gravity="right|top"
|
||||||
|
android:background="@drawable/bubble"
|
||||||
|
android:gravity="center"
|
||||||
|
android:minWidth="@dimen/unread_bubble_size"
|
||||||
|
android:textColor="@color/briar_text_primary_inverse"
|
||||||
|
android:textSize="@dimen/unread_bubble_text_size"
|
||||||
|
android:textStyle="bold"
|
||||||
|
tools:text="123"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/textViews"
|
android:id="@+id/textViews"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
||||||
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_toEndOf="@+id/avatarFrameView"
|
||||||
android:layout_toLeftOf="@+id/bulbView"
|
android:layout_toLeftOf="@+id/bulbView"
|
||||||
android:layout_toRightOf="@+id/avatarView"
|
android:layout_toRightOf="@+id/avatarFrameView"
|
||||||
android:layout_toEndOf="@+id/avatarView">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/nameView"
|
android:id="@+id/nameView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:maxLines="2"
|
android:maxLines="2"
|
||||||
android:textColor="@android:color/primary_text_light"
|
android:textColor="@color/briar_text_primary"
|
||||||
android:textSize="@dimen/text_size_medium"
|
android:textSize="@dimen/text_size_medium"
|
||||||
tools:text="This is a name of a contact"/>
|
tools:text="This is a name of a contact"/>
|
||||||
|
|
||||||
@@ -54,7 +73,7 @@
|
|||||||
android:id="@+id/dateView"
|
android:id="@+id/dateView"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textColor="@android:color/secondary_text_light"
|
android:textColor="@color/briar_text_secondary"
|
||||||
android:textSize="@dimen/text_size_small"
|
android:textSize="@dimen/text_size_small"
|
||||||
tools:text="Dec 24"/>
|
tools:text="Dec 24"/>
|
||||||
|
|
||||||
|
|||||||
32
briar-android/res/layout/list_item_contact_small.xml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingBottom="@dimen/margin_small"
|
||||||
|
android:paddingTop="@dimen/margin_small">
|
||||||
|
|
||||||
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
|
android:id="@+id/avatarView"
|
||||||
|
style="@style/BriarAvatar"
|
||||||
|
android:layout_width="@dimen/listitem_picture_size_small"
|
||||||
|
android:layout_height="@dimen/listitem_picture_size_small"
|
||||||
|
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
||||||
|
tools:src="@drawable/ic_launcher"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/nameView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
tools:text="This is a name of a contact"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -19,9 +19,11 @@
|
|||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/title"
|
android:id="@+id/title"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginBottom="@dimen/margin_small"
|
android:layout_marginBottom="@dimen/margin_small"
|
||||||
|
android:gravity="bottom"
|
||||||
android:textSize="@dimen/text_size_large"
|
android:textSize="@dimen/text_size_large"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
tools:text="Crash log entry title"/>
|
tools:text="Crash log entry title"/>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
@@ -30,6 +32,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/margin_medium"
|
android:layout_marginBottom="@dimen/margin_medium"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
tools:text="Crash log entry value"/>
|
tools:text="Crash log entry value"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
68
briar-android/res/layout/list_item_forum.xml
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_marginStart="@dimen/listitem_horizontal_margin"
|
||||||
|
android:background="?attr/selectableItemBackground">
|
||||||
|
|
||||||
|
<org.briarproject.android.util.TextAvatarView
|
||||||
|
android:id="@+id/avatarView"
|
||||||
|
android:layout_width="@dimen/listitem_picture_frame_size"
|
||||||
|
android:layout_height="@dimen/listitem_picture_frame_size"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginRight="@dimen/listitem_horizontal_margin"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/forumNameView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_marginTop="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_toEndOf="@+id/avatarView"
|
||||||
|
android:layout_toRightOf="@+id/avatarView"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:textColor="@color/briar_text_primary"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
tools:text="This is a name of a forum"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/unreadView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/forumNameView"
|
||||||
|
android:layout_toEndOf="@+id/avatarView"
|
||||||
|
android:layout_toRightOf="@+id/avatarView"
|
||||||
|
android:paddingBottom="@dimen/listitem_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/margin_medium"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
|
android:textSize="@dimen/text_size_small"
|
||||||
|
tools:text="1337 posts"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/dateView"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_below="@+id/forumNameView"
|
||||||
|
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
|
||||||
|
android:layout_marginRight="@dimen/listitem_horizontal_margin"
|
||||||
|
android:paddingBottom="@dimen/listitem_horizontal_margin"
|
||||||
|
android:paddingTop="@dimen/margin_medium"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
|
android:textSize="@dimen/text_size_small"
|
||||||
|
tools:text="Dec 24"/>
|
||||||
|
|
||||||
|
<View
|
||||||
|
style="@style/Divider.ForumList"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_below="@+id/unreadView"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
58
briar-android/res/layout/list_item_forum_invitation_in.xml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/messageLayout"
|
||||||
|
layout="@layout/list_item_msg_in"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/introductionLayout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="left|start"
|
||||||
|
android:background="@drawable/notice_in"
|
||||||
|
android:layout_marginLeft="@dimen/message_bubble_margin_tail"
|
||||||
|
android:layout_marginRight="@dimen/message_bubble_margin_non_tail">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/introductionText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:minWidth="80dp"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
android:textStyle="italic"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
|
tools:text="@string/forum_invitation_received"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/introductionTime"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/message_bubble_timestamp_margin"
|
||||||
|
android:layout_alignEnd="@+id/introductionText"
|
||||||
|
android:layout_alignRight="@+id/introductionText"
|
||||||
|
android:layout_below="@+id/showForumsButton"
|
||||||
|
android:textColor="@color/private_message_date"
|
||||||
|
android:textSize="@dimen/text_size_tiny"
|
||||||
|
tools:text="Dec 24, 13:37"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/showForumsButton"
|
||||||
|
style="@style/BriarButtonFlat.Positive"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="-15dp"
|
||||||
|
android:layout_alignEnd="@+id/introductionText"
|
||||||
|
android:layout_alignRight="@+id/introductionText"
|
||||||
|
android:layout_below="@+id/introductionText"
|
||||||
|
android:text="@string/forum_show_invitations"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
57
briar-android/res/layout/list_item_forum_invitation_out.xml
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/messageLayout"
|
||||||
|
layout="@layout/list_item_msg_out"/>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/introductionLayout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right|end"
|
||||||
|
android:background="@drawable/notice_out"
|
||||||
|
android:layout_marginLeft="@dimen/message_bubble_margin_non_tail"
|
||||||
|
android:layout_marginRight="@dimen/message_bubble_margin_tail">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/introductionText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
android:textSize="@dimen/text_size_medium"
|
||||||
|
android:textStyle="italic"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
|
tools:text="@string/introduction_request_received"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/introductionTime"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/message_bubble_timestamp_margin"
|
||||||
|
android:layout_alignParentLeft="true"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:layout_below="@+id/introductionText"
|
||||||
|
android:textColor="@color/private_message_date"
|
||||||
|
android:textSize="@dimen/text_size_tiny"
|
||||||
|
tools:text="Dec 24, 13:37"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/introductionStatus"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toEndOf="@+id/introductionTime"
|
||||||
|
android:layout_toRightOf="@+id/introductionTime"
|
||||||
|
android:layout_alignBottom="@+id/introductionTime"
|
||||||
|
android:layout_marginLeft="@dimen/margin_medium"
|
||||||
|
tools:ignore="ContentDescription"
|
||||||
|
tools:src="@drawable/message_delivered"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
android:textSize="@dimen/text_size_medium"
|
android:textSize="@dimen/text_size_medium"
|
||||||
android:textStyle="italic"
|
android:textStyle="italic"
|
||||||
|
android:textColor="@color/briar_text_secondary"
|
||||||
tools:text="@string/introduction_request_received"/>
|
tools:text="@string/introduction_request_received"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||