diff --git a/briar-android/src/org/briarproject/android/forum/ForumActivity.java b/briar-android/src/org/briarproject/android/forum/ForumActivity.java index 31816fa8fea8fc2fb4f9678591b507416c827c84..36d552473a2684fbd3974a159c11d43d0a5c5ede 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 71a4865b516bf1e14e8b5d1ef9c6317179092c2a..d17ed8d66374e1080c2761bce0a9f382a98c91ca 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 58eec29385fc37b8a7e63a38fd626c7970e15c03..c042a182965f3dbe067a3a5a343898c1f13cb0f1 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 8a2942a4c46f44a442df7f1e7214d118752dca3e..972a6149eaa0d3093156c1df28bbe2c43fa77954 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 21425ced3815804046343b2c9fb8bd404a9a3994..7c3ee9079128f1d1424ab570e78f1da3c3b126e4 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 268fdcca9dee90439b736d5c38622b9f1ac6b8cb..eff17e175e13264ea28ab2381ae422d87e2e0aef 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 c59eac8a48305ecc48a417a1b536ee5fd0c55738..bffd1d6eaeb5a73f6b30ebedc617a37ded04b06c 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);