From bc724bfa89d8601ef25c327d023641ae38f96594 Mon Sep 17 00:00:00 2001 From: olzzon Date: Sun, 27 Aug 2017 20:41:29 +0200 Subject: [PATCH 1/2] Change/swap Join channel and join chat This is a proposal that change the behavior of the Channel Row. The Join arrow is removed and a chat bubble is added instead. So now you press the text of the channel to join it (cvh.itemView.setOnClickListener), and the Chat bubble to join the Chat channel. If someone want a more safe join channel, an option in seeting called something like "safe join channel" could be added, and a long press would be needed (cvh.itenView.senOnLongClickListener joins channel instead of opening the moreMenu) --- .../channel/ChannelListAdapter.java | 30 +++++++++++-------- app/src/main/res/layout/channel_row.xml | 14 ++++----- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/app/src/main/java/com/morlunk/mumbleclient/channel/ChannelListAdapter.java b/app/src/main/java/com/morlunk/mumbleclient/channel/ChannelListAdapter.java index bf649af4..7459266f 100644 --- a/app/src/main/java/com/morlunk/mumbleclient/channel/ChannelListAdapter.java +++ b/app/src/main/java/com/morlunk/mumbleclient/channel/ChannelListAdapter.java @@ -124,14 +124,6 @@ public void onBindViewHolder(RecyclerView.ViewHolder viewHolder, int position) { if (node.isChannel()) { final IChannel channel = node.getChannel(); final ChannelViewHolder cvh = (ChannelViewHolder) viewHolder; - cvh.itemView.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - if (mChannelClickListener != null) { - mChannelClickListener.onChannelClick(channel); - } - } - }); final boolean expandUsable = channel.getSubchannels().size() > 0 || channel.getSubchannelUserCount() > 0; @@ -185,11 +177,14 @@ public void onClick(View v) { cvh.mChannelHolder.getPaddingRight(), cvh.mChannelHolder.getPaddingBottom()); - cvh.mJoinButton.setOnClickListener(new View.OnClickListener() { + // Actions. + + cvh.mChatChannelButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - if (mService.isConnected()) - mService.getSession().joinChannel(channel.getId()); + if (mChannelClickListener != null) { + mChannelClickListener.onChannelClick(channel); + } } }); @@ -201,9 +196,18 @@ public void onClick(View v) { } }); + cvh.itemView.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (mService.isConnected()) + mService.getSession().joinChannel(channel.getId()); + } + + }); cvh.itemView.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean onLongClick(View v) { + //ToDo: olzzon Long Click join Channel - Setting Secure Channel Shift cvh.mMoreButton.performClick(); return true; } @@ -516,7 +520,7 @@ private static class ChannelViewHolder extends RecyclerView.ViewHolder { public ImageView mChannelExpandToggle; public TextView mChannelName; public TextView mChannelUserCount; - public ImageView mJoinButton; + public ImageView mChatChannelButton; public ImageView mMoreButton; public ChannelViewHolder(View itemView) { @@ -525,7 +529,7 @@ public ChannelViewHolder(View itemView) { mChannelExpandToggle = (ImageView) itemView.findViewById(R.id.channel_row_expand); mChannelName = (TextView) itemView.findViewById(R.id.channel_row_name); mChannelUserCount = (TextView) itemView.findViewById(R.id.channel_row_count); - mJoinButton = (ImageView) itemView.findViewById(R.id.channel_row_join); + mChatChannelButton = (ImageView) itemView.findViewById(R.id.channel_row_join); mMoreButton = (ImageView) itemView.findViewById(R.id.channel_row_more); } } diff --git a/app/src/main/res/layout/channel_row.xml b/app/src/main/res/layout/channel_row.xml index 8b6fad49..3bf80f6f 100644 --- a/app/src/main/res/layout/channel_row.xml +++ b/app/src/main/res/layout/channel_row.xml @@ -37,7 +37,7 @@ android:id="@+id/channel_row_name" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="1" + android:layout_weight="0.77" android:gravity="center_vertical|left" android:minHeight="48dp" android:padding="4dp" @@ -48,17 +48,17 @@ android:layout_width="wrap_content" android:layout_height="match_parent" android:gravity="center" + android:padding="10dp" android:text="10" - android:textStyle="bold" - android:padding="10dp"/> + android:textStyle="bold" /> + android:background="?attr/selectableItemBackgroundBorderless" + android:src="@android:drawable/sym_action_chat" + android:tint="?android:attr/textColorSecondary" /> Date: Mon, 28 Aug 2017 10:02:04 +0200 Subject: [PATCH 2/2] Incorporate larger-bold ChannelRow font and Larger-Red PushToTalk --- app/src/main/res/layout/channel_row.xml | 7 +++++-- app/src/main/res/layout/fragment_channel.xml | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/layout/channel_row.xml b/app/src/main/res/layout/channel_row.xml index 3bf80f6f..55c00392 100644 --- a/app/src/main/res/layout/channel_row.xml +++ b/app/src/main/res/layout/channel_row.xml @@ -37,11 +37,14 @@ android:id="@+id/channel_row_name" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_weight="0.77" + android:layout_weight="1" android:gravity="center_vertical|left" android:minHeight="48dp" android:padding="4dp" - android:text="Channel name\nLine 2\nLine 3\nLine 4"/> + android:text="Channel name\nLine 2\nLine 3\nLine 4" + android:textAppearance="@style/TextAppearance.AppCompat.Body2" + android:textSize="18sp" + />