From 656a947f5a44f616eb1964ffa59682d68a97e45f Mon Sep 17 00:00:00 2001 From: Torsten Grote <t@grobox.de> Date: Mon, 31 Oct 2016 13:13:59 -0200 Subject: [PATCH] Last minor review comments addressed --- .../src/org/briarproject/android/forum/ForumActivity.java | 2 +- .../android/privategroup/conversation/GroupActivity.java | 2 +- .../privategroup/conversation/GroupMessageAdapter.java | 6 +++--- ...ssageItemHolder.java => JoinMessageItemViewHolder.java} | 4 ++-- .../briarproject/android/threaded/ThreadItemAdapter.java | 2 +- .../briarproject/android/threaded/ThreadListActivity.java | 7 ++++--- ...ThreadItemViewHolder.java => ThreadPostViewHolder.java} | 4 ++-- 7 files changed, 14 insertions(+), 13 deletions(-) rename briar-android/src/org/briarproject/android/privategroup/conversation/{JoinMessageItemHolder.java => JoinMessageItemViewHolder.java} (90%) rename briar-android/src/org/briarproject/android/threaded/{ThreadItemViewHolder.java => ThreadPostViewHolder.java} (96%) diff --git a/briar-android/src/org/briarproject/android/forum/ForumActivity.java b/briar-android/src/org/briarproject/android/forum/ForumActivity.java index 31816fa8fe..36d552473a 100644 --- a/briar-android/src/org/briarproject/android/forum/ForumActivity.java +++ b/briar-android/src/org/briarproject/android/forum/ForumActivity.java @@ -36,7 +36,7 @@ import static android.widget.Toast.LENGTH_SHORT; import static org.briarproject.api.forum.ForumConstants.MAX_FORUM_POST_BODY_LENGTH; public class ForumActivity extends - ThreadListActivity<Forum, ForumItem, ForumPostHeader, ThreadItemAdapter<ForumItem>> { + ThreadListActivity<Forum, ForumItem, ForumPostHeader> { private static final int REQUEST_FORUM_SHARED = 3; diff --git a/briar-android/src/org/briarproject/android/privategroup/conversation/GroupActivity.java b/briar-android/src/org/briarproject/android/privategroup/conversation/GroupActivity.java index 71a4865b51..d17ed8d663 100644 --- a/briar-android/src/org/briarproject/android/privategroup/conversation/GroupActivity.java +++ b/briar-android/src/org/briarproject/android/privategroup/conversation/GroupActivity.java @@ -22,7 +22,7 @@ import javax.inject.Inject; import static org.briarproject.api.privategroup.PrivateGroupConstants.MAX_GROUP_POST_BODY_LENGTH; public class GroupActivity extends - ThreadListActivity<PrivateGroup, GroupMessageItem, GroupMessageHeader, GroupMessageAdapter> { + ThreadListActivity<PrivateGroup, GroupMessageItem, GroupMessageHeader> { @Inject GroupController controller; diff --git a/briar-android/src/org/briarproject/android/privategroup/conversation/GroupMessageAdapter.java b/briar-android/src/org/briarproject/android/privategroup/conversation/GroupMessageAdapter.java index 58eec29385..c042a18296 100644 --- a/briar-android/src/org/briarproject/android/privategroup/conversation/GroupMessageAdapter.java +++ b/briar-android/src/org/briarproject/android/privategroup/conversation/GroupMessageAdapter.java @@ -10,7 +10,7 @@ import android.view.ViewGroup; import org.briarproject.R; import org.briarproject.android.threaded.BaseThreadItemViewHolder; import org.briarproject.android.threaded.ThreadItemAdapter; -import org.briarproject.android.threaded.ThreadItemViewHolder; +import org.briarproject.android.threaded.ThreadPostViewHolder; @UiThread public class GroupMessageAdapter extends ThreadItemAdapter<GroupMessageItem> { @@ -34,9 +34,9 @@ public class GroupMessageAdapter extends ThreadItemAdapter<GroupMessageItem> { View v = LayoutInflater.from(parent.getContext()) .inflate(type, parent, false); if (type == R.layout.list_item_thread_notice) { - return new JoinMessageItemHolder(v); + return new JoinMessageItemViewHolder(v); } - return new ThreadItemViewHolder<>(v); + return new ThreadPostViewHolder<>(v); } } diff --git a/briar-android/src/org/briarproject/android/privategroup/conversation/JoinMessageItemHolder.java b/briar-android/src/org/briarproject/android/privategroup/conversation/JoinMessageItemViewHolder.java similarity index 90% rename from briar-android/src/org/briarproject/android/privategroup/conversation/JoinMessageItemHolder.java rename to briar-android/src/org/briarproject/android/privategroup/conversation/JoinMessageItemViewHolder.java index 8a2942a4c4..972a6149ea 100644 --- a/briar-android/src/org/briarproject/android/privategroup/conversation/JoinMessageItemHolder.java +++ b/briar-android/src/org/briarproject/android/privategroup/conversation/JoinMessageItemViewHolder.java @@ -11,10 +11,10 @@ import org.briarproject.api.nullsafety.NotNullByDefault; @UiThread @NotNullByDefault -public class JoinMessageItemHolder +public class JoinMessageItemViewHolder extends BaseThreadItemViewHolder<GroupMessageItem> { - public JoinMessageItemHolder(View v) { + public JoinMessageItemViewHolder(View v) { super(v); } diff --git a/briar-android/src/org/briarproject/android/threaded/ThreadItemAdapter.java b/briar-android/src/org/briarproject/android/threaded/ThreadItemAdapter.java index 21425ced38..7c3ee90791 100644 --- a/briar-android/src/org/briarproject/android/threaded/ThreadItemAdapter.java +++ b/briar-android/src/org/briarproject/android/threaded/ThreadItemAdapter.java @@ -50,7 +50,7 @@ public class ThreadItemAdapter<I extends ThreadItem> ViewGroup parent, int viewType) { View v = LayoutInflater.from(parent.getContext()) .inflate(R.layout.list_item_thread, parent, false); - return new ThreadItemViewHolder<>(v); + return new ThreadPostViewHolder<>(v); } @Override diff --git a/briar-android/src/org/briarproject/android/threaded/ThreadListActivity.java b/briar-android/src/org/briarproject/android/threaded/ThreadListActivity.java index 268fdcca9d..eff17e175e 100644 --- a/briar-android/src/org/briarproject/android/threaded/ThreadListActivity.java +++ b/briar-android/src/org/briarproject/android/threaded/ThreadListActivity.java @@ -35,7 +35,7 @@ import static android.support.design.widget.Snackbar.make; import static android.view.View.GONE; import static android.view.View.VISIBLE; -public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadItem, H extends PostHeader, A extends ThreadItemAdapter<I>> +public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadItem, H extends PostHeader> extends BriarActivity implements ThreadListListener<H>, TextInputListener, ThreadItemListener<I> { @@ -46,7 +46,7 @@ public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadI private static final Logger LOG = Logger.getLogger(ThreadListActivity.class.getName()); - protected A adapter; + protected ThreadItemAdapter<I> adapter; protected BriarRecyclerView list; protected TextInputView textInput; protected GroupId groupId; @@ -88,7 +88,8 @@ public abstract class ThreadListActivity<G extends NamedGroup, I extends ThreadI @LayoutRes protected abstract int getLayout(); - protected abstract A createAdapter(LinearLayoutManager layoutManager); + protected abstract ThreadItemAdapter<I> createAdapter( + LinearLayoutManager layoutManager); protected void loadNamedGroup() { getController().loadNamedGroup( diff --git a/briar-android/src/org/briarproject/android/threaded/ThreadItemViewHolder.java b/briar-android/src/org/briarproject/android/threaded/ThreadPostViewHolder.java similarity index 96% rename from briar-android/src/org/briarproject/android/threaded/ThreadItemViewHolder.java rename to briar-android/src/org/briarproject/android/threaded/ThreadPostViewHolder.java index c59eac8a48..bffd1d6eae 100644 --- a/briar-android/src/org/briarproject/android/threaded/ThreadItemViewHolder.java +++ b/briar-android/src/org/briarproject/android/threaded/ThreadPostViewHolder.java @@ -14,14 +14,14 @@ import static android.view.View.VISIBLE; @UiThread @NotNullByDefault -public class ThreadItemViewHolder<I extends ThreadItem> +public class ThreadPostViewHolder<I extends ThreadItem> extends BaseThreadItemViewHolder<I> { private final TextView lvlText, repliesText; private final View[] lvls; private final View chevron, replyButton; - public ThreadItemViewHolder(View v) { + public ThreadPostViewHolder(View v) { super(v); lvlText = (TextView) v.findViewById(R.id.nested_line_text); -- GitLab