diff --git a/src/org/thoughtcrime/securesms/ProfileSettingsAdapter.java b/src/org/thoughtcrime/securesms/ProfileSettingsAdapter.java index d8794cddf..1e7d6a82b 100644 --- a/src/org/thoughtcrime/securesms/ProfileSettingsAdapter.java +++ b/src/org/thoughtcrime/securesms/ProfileSettingsAdapter.java @@ -163,12 +163,14 @@ public class ProfileSettingsAdapter extends RecyclerView.Adapter ConversationListItem conversationListItem = (ConversationListItem) holder.itemView; int chatlistIndex = itemData.get(i).chatlistIndex; - DcChat chat = dcContext.getChat(itemDataSharedChats.getChatId(chatlistIndex)); + int chatId = itemDataSharedChats.getChatId(chatlistIndex); + DcChat chat = dcContext.getChat(chatId); DcLot summary = itemDataSharedChats.getSummary(chatlistIndex, chat); conversationListItem.bind(dcContext.getThreadRecord(summary, chat), itemDataSharedChats.getMsgId(chatlistIndex), summary, glideRequests, locale, Collections.emptySet(), false); + conversationListItem.setOnClickListener(view -> clickListener.onSharedChatClicked(chatId)); } else if(holder.itemView instanceof ProfileSettingsItem) { int settingsId = itemData.get(i).settingsId; @@ -185,6 +187,7 @@ public class ProfileSettingsAdapter extends RecyclerView.Adapter public interface ItemClickListener { void onSettingsClicked(int settingsId); + void onSharedChatClicked(int chatId); } @Override diff --git a/src/org/thoughtcrime/securesms/ProfileSettingsFragment.java b/src/org/thoughtcrime/securesms/ProfileSettingsFragment.java index 891613ab2..1a45780a6 100644 --- a/src/org/thoughtcrime/securesms/ProfileSettingsFragment.java +++ b/src/org/thoughtcrime/securesms/ProfileSettingsFragment.java @@ -111,6 +111,10 @@ public class ProfileSettingsFragment extends Fragment adapter.changeData(memberList, dcContact, sharedChats, dcChat); } + + // handle the various events + // ========================================================================= + @Override public void onSettingsClicked(int settingsId) { switch(settingsId) { @@ -140,6 +144,12 @@ public class ProfileSettingsFragment extends Fragment break; } } + @Override + public void onSharedChatClicked(int chatId) { + Intent intent = new Intent(getContext(), ConversationActivity.class); + intent.putExtra(ConversationActivity.CHAT_ID_EXTRA, chatId); + getContext().startActivity(intent); + } private void onContactAddrClicked() { String address = dcContext.getContact(contactId).getAddr(); @@ -268,6 +278,11 @@ public class ProfileSettingsFragment extends Fragment } private void onVibrateSettings() { - + new AlertDialog.Builder(getContext()) + .setTitle(R.string.pref_vibrate) + .setItems(R.array.recipient_vibrate_entries, (dialog, which) -> { + Prefs.setChatVibrate(getContext(), chatId, Prefs.VibrateState.fromId(which)); + }) + .show(); } }