mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Merge branch '799-explain-content-visibility' into 'master'
Show explanation about visibility in member lists Closes #799 See merge request !516
This commit is contained in:
@@ -4,6 +4,7 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.briarproject.bramble.api.db.DbException;
|
||||
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
|
||||
@@ -40,7 +41,7 @@ public class GroupMemberListActivity extends BriarActivity {
|
||||
public void onCreate(@Nullable final Bundle state) {
|
||||
super.onCreate(state);
|
||||
|
||||
setContentView(R.layout.list);
|
||||
setContentView(R.layout.activity_sharing_status);
|
||||
|
||||
Intent i = getIntent();
|
||||
byte[] b = i.getByteArrayExtra(GROUP_ID);
|
||||
@@ -52,6 +53,9 @@ public class GroupMemberListActivity extends BriarActivity {
|
||||
list.setLayoutManager(linearLayoutManager);
|
||||
adapter = new MemberListAdapter(this);
|
||||
list.setAdapter(adapter);
|
||||
|
||||
TextView info = (TextView) findViewById(R.id.info);
|
||||
info.setText(R.string.sharing_status_groups);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.briarproject.bramble.api.db.DatabaseExecutor;
|
||||
import org.briarproject.bramble.api.db.DbException;
|
||||
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
|
||||
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.activity.ActivityComponent;
|
||||
import org.briarproject.briar.api.blog.BlogSharingManager;
|
||||
|
||||
@@ -25,6 +26,11 @@ public class BlogSharingStatusActivity extends SharingStatusActivity {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
int getInfoText() {
|
||||
return R.string.sharing_status_blog;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DatabaseExecutor
|
||||
protected Collection<Contact> getSharedWith() throws DbException {
|
||||
|
||||
@@ -5,6 +5,7 @@ import org.briarproject.bramble.api.db.DatabaseExecutor;
|
||||
import org.briarproject.bramble.api.db.DbException;
|
||||
import org.briarproject.bramble.api.nullsafety.MethodsNotNullByDefault;
|
||||
import org.briarproject.bramble.api.nullsafety.ParametersNotNullByDefault;
|
||||
import org.briarproject.briar.R;
|
||||
import org.briarproject.briar.android.activity.ActivityComponent;
|
||||
import org.briarproject.briar.api.forum.ForumSharingManager;
|
||||
|
||||
@@ -25,6 +26,11 @@ public class ForumSharingStatusActivity extends SharingStatusActivity {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
int getInfoText() {
|
||||
return R.string.sharing_status_forum;
|
||||
}
|
||||
|
||||
@Override
|
||||
@DatabaseExecutor
|
||||
protected Collection<Contact> getSharedWith() throws DbException {
|
||||
|
||||
@@ -3,8 +3,10 @@ package org.briarproject.briar.android.sharing;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.annotation.StringRes;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.view.MenuItem;
|
||||
import android.widget.TextView;
|
||||
|
||||
import org.briarproject.bramble.api.contact.Contact;
|
||||
import org.briarproject.bramble.api.db.DatabaseExecutor;
|
||||
@@ -45,7 +47,7 @@ abstract class SharingStatusActivity extends BriarActivity {
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
setContentView(R.layout.list);
|
||||
setContentView(R.layout.activity_sharing_status);
|
||||
|
||||
Intent i = getIntent();
|
||||
byte[] b = i.getByteArrayExtra(GROUP_ID);
|
||||
@@ -57,6 +59,9 @@ abstract class SharingStatusActivity extends BriarActivity {
|
||||
list.setLayoutManager(new LinearLayoutManager(this));
|
||||
list.setAdapter(adapter);
|
||||
list.setEmptyText(getString(R.string.nobody));
|
||||
|
||||
TextView info = (TextView) findViewById(R.id.info);
|
||||
info.setText(getInfoText());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -84,6 +89,9 @@ abstract class SharingStatusActivity extends BriarActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@StringRes
|
||||
abstract int getInfoText();
|
||||
|
||||
@DatabaseExecutor
|
||||
abstract protected Collection<Contact> getSharedWith() throws DbException;
|
||||
|
||||
|
||||
10
briar-android/src/main/res/drawable/ic_info.xml
Normal file
10
briar-android/src/main/res/drawable/ic_info.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.56"
|
||||
android:viewportHeight="24.0"
|
||||
android:viewportWidth="24.0">
|
||||
<path
|
||||
android:fillColor="#000000"
|
||||
android:pathData="M11,17h2v-6h-2v6zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8zM11,9h2L13,7h-2v2z"/>
|
||||
</vector>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/info"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawableLeft="@drawable/ic_info"
|
||||
android:drawablePadding="@dimen/margin_medium"
|
||||
android:padding="@dimen/margin_medium"
|
||||
android:textColor="?android:textColorSecondary"
|
||||
android:textSize="@dimen/text_size_tiny"
|
||||
tools:text="@string/sharing_status_forum"/>
|
||||
|
||||
<View style="@style/Divider.Horizontal"/>
|
||||
|
||||
<org.briarproject.briar.android.view.BriarRecyclerView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:scrollToEnd="false"
|
||||
tools:listitem="@layout/list_item_contact"/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -194,6 +194,7 @@
|
||||
<string name="groups_invitations_response_declined_sent">You declined the group invitation from %s.</string>
|
||||
<string name="groups_invitations_response_accepted_received">%s accepted the group invitation.</string>
|
||||
<string name="groups_invitations_response_declined_received">%s declined the group invitation.</string>
|
||||
<string name="sharing_status_groups">Only the creator can invite new members to the group. Below are all current members of the group.</string>
|
||||
|
||||
<!-- Private Groups Revealing Contacts -->
|
||||
<string name="groups_reveal_contacts">Reveal Contacts</string>
|
||||
@@ -252,6 +253,7 @@
|
||||
<string name="forum_invitation_response_declined_received">%s declined the forum invitation.</string>
|
||||
|
||||
<string name="sharing_status">Sharing Status</string>
|
||||
<string name="sharing_status_forum">Any member of a forum can share it with their contacts. You are sharing this forum with the following contacts. There may also be other members who you can\'t see.</string>
|
||||
<string name="shared_with">Shared with %1$d (%2$d online)</string>
|
||||
<plurals name="forums_shared">
|
||||
<item quantity="one">%d forum shared by contacts</item>
|
||||
@@ -291,6 +293,7 @@
|
||||
<string name="blogs_sharing_invitations_title">Blog Invitations</string>
|
||||
<string name="blogs_sharing_joined_toast">Subscribed to Blog</string>
|
||||
<string name="blogs_sharing_declined_toast">Blog Invitation Declined</string>
|
||||
<string name="sharing_status_blog">Anyone who subscribes to a blog can share it with their contacts. You are sharing this blog with the following contacts. There may also be other subscribers who you can\'t see.</string>
|
||||
|
||||
<!-- RSS Feeds -->
|
||||
<string name="blogs_rss_feeds_import">Import RSS Feed</string>
|
||||
|
||||
Reference in New Issue
Block a user