Messaging: Fix a few android related things
* NotificationBuilder.addPerson(String) -> .addPerson(Person) * Wearableextenter.addPage deprecated without replacement * Html.fromHtml(String) -> .fromHtml(String, int) * Handlers need Loopers * Resource-IDs are not final by default (if-else instead of switch-case) * call super.onFinishInflate() in override of onFinishInflate() * Configuration.locale -> configuration.getLocales().get(0) * SimpleDateFormat needs localization as well * AudioAttributes instead of setAudioStreamType() * isDataEnabled() is a public method, no need for reflection anymore Change-Id: Icd830768b86edca3e0b44f1edc6c57facc9f731a
This commit is contained in:
@@ -64,13 +64,11 @@ public class ArchivedConversationListActivity extends AbstractConversationListAc
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem menuItem) {
|
||||
switch(menuItem.getItemId()) {
|
||||
case android.R.id.home:
|
||||
onActionBarHome();
|
||||
return true;
|
||||
default:
|
||||
return super.onOptionsItemSelected(menuItem);
|
||||
if (menuItem.getItemId() == android.R.id.home) {
|
||||
onActionBarHome();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(menuItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -85,19 +85,19 @@ public class ConversationListActivity extends AbstractConversationListActivity i
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(@NonNull final MenuItem menuItem) {
|
||||
switch(menuItem.getItemId()) {
|
||||
case R.id.action_start_new_conversation:
|
||||
onActionBarStartNewConversation();
|
||||
return true;
|
||||
case R.id.action_settings:
|
||||
onActionBarSettings();
|
||||
return true;
|
||||
case R.id.action_show_archived:
|
||||
onActionBarArchived();
|
||||
return true;
|
||||
case R.id.action_show_blocked_contacts:
|
||||
onActionBarBlockedParticipants();
|
||||
return true;
|
||||
int itemId = menuItem.getItemId();
|
||||
if (itemId == R.id.action_start_new_conversation) {
|
||||
onActionBarStartNewConversation();
|
||||
return true;
|
||||
} else if (itemId == R.id.action_settings) {
|
||||
onActionBarSettings();
|
||||
return true;
|
||||
} else if (itemId == R.id.action_show_archived) {
|
||||
onActionBarArchived();
|
||||
return true;
|
||||
} else if (itemId == R.id.action_show_blocked_contacts) {
|
||||
onActionBarBlockedParticipants();
|
||||
return true;
|
||||
}
|
||||
return super.onOptionsItemSelected(menuItem);
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ public class ConversationListItemView extends FrameLayout implements OnClickList
|
||||
|
||||
@Override
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
mSwipeableContainer = (ViewGroup) findViewById(R.id.swipeableContainer);
|
||||
mCrossSwipeBackground = (ViewGroup) findViewById(R.id.crossSwipeBackground);
|
||||
mSwipeableContent = (ViewGroup) findViewById(R.id.swipeableContent);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -95,30 +96,29 @@ public class MultiSelectActionModeCallback implements Callback {
|
||||
|
||||
@Override
|
||||
public boolean onActionItemClicked(ActionMode actionMode, MenuItem menuItem) {
|
||||
switch(menuItem.getItemId()) {
|
||||
case R.id.action_delete:
|
||||
mListener.onActionBarDelete(mSelectedConversations.values());
|
||||
return true;
|
||||
case R.id.action_archive:
|
||||
mListener.onActionBarArchive(mSelectedConversations.values(), true);
|
||||
return true;
|
||||
case R.id.action_unarchive:
|
||||
mListener.onActionBarArchive(mSelectedConversations.values(), false);
|
||||
return true;
|
||||
case R.id.action_add_contact:
|
||||
Assert.isTrue(mSelectedConversations.size() == 1);
|
||||
mListener.onActionBarAddContact(mSelectedConversations.valueAt(0));
|
||||
return true;
|
||||
case R.id.action_block:
|
||||
Assert.isTrue(mSelectedConversations.size() == 1);
|
||||
mListener.onActionBarBlock(mSelectedConversations.valueAt(0));
|
||||
return true;
|
||||
case android.R.id.home:
|
||||
mListener.onActionBarHome();
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
int itemId = menuItem.getItemId();
|
||||
if (itemId == R.id.action_delete) {
|
||||
mListener.onActionBarDelete(mSelectedConversations.values());
|
||||
return true;
|
||||
} else if (itemId == R.id.action_archive) {
|
||||
mListener.onActionBarArchive(mSelectedConversations.values(), true);
|
||||
return true;
|
||||
} else if (itemId == R.id.action_unarchive) {
|
||||
mListener.onActionBarArchive(mSelectedConversations.values(), false);
|
||||
return true;
|
||||
} else if (itemId == R.id.action_add_contact) {
|
||||
Assert.isTrue(mSelectedConversations.size() == 1);
|
||||
mListener.onActionBarAddContact(mSelectedConversations.valueAt(0));
|
||||
return true;
|
||||
} else if (itemId == R.id.action_block) {
|
||||
Assert.isTrue(mSelectedConversations.size() == 1);
|
||||
mListener.onActionBarBlock(mSelectedConversations.valueAt(0));
|
||||
return true;
|
||||
} else if (itemId == android.R.id.home) {
|
||||
mListener.onActionBarHome();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user