Messaging: Remove unused or not required classes and methods
Change-Id: I28ebaecc503ee58c74fc8081162777f861dd4516
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
* Copyright (C) 2024 The LineageOS Project
|
||||
* Copyright (C) 2024-2025 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.
|
||||
@@ -68,10 +68,6 @@ public class CompositeAdapter extends BaseAdapter {
|
||||
public View getHeaderView(final View convertView, final ViewGroup parentView) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void close() {
|
||||
// do nothing in base class.
|
||||
}
|
||||
}
|
||||
|
||||
private class Observer extends DataSetObserver {
|
||||
@@ -116,56 +112,6 @@ public class CompositeAdapter extends BaseAdapter {
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void removePartition(final int index) {
|
||||
final Partition partition = mPartitions[index];
|
||||
partition.close();
|
||||
System.arraycopy(mPartitions, index + 1, mPartitions, index,
|
||||
mSize - index - 1);
|
||||
mSize--;
|
||||
partition.getAdapter().unregisterDataSetObserver(mObserver);
|
||||
invalidate();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void clearPartitions() {
|
||||
for (int i = 0; i < mSize; i++) {
|
||||
final Partition partition = mPartitions[i];
|
||||
partition.close();
|
||||
partition.getAdapter().unregisterDataSetObserver(mObserver);
|
||||
}
|
||||
invalidate();
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public Partition getPartition(final int index) {
|
||||
return mPartitions[index];
|
||||
}
|
||||
|
||||
public int getPartitionAtPosition(final int position) {
|
||||
ensureCacheValid();
|
||||
int start = 0;
|
||||
for (int i = 0; i < mSize; i++) {
|
||||
final int end = start + mPartitions[i].getCount();
|
||||
if (position >= start && position < end) {
|
||||
int offset = position - start;
|
||||
if (mPartitions[i].hasHeader() &&
|
||||
(mPartitions[i].getCount() > 0 || mPartitions[i].showIfEmpty())) {
|
||||
offset--;
|
||||
}
|
||||
if (offset == -1) {
|
||||
return -1;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
start = end;
|
||||
}
|
||||
return mSize - 1;
|
||||
}
|
||||
|
||||
public int getPartitionCount() {
|
||||
return mSize;
|
||||
}
|
||||
|
||||
public void invalidate() {
|
||||
mCacheValid = false;
|
||||
}
|
||||
|
||||
@@ -278,14 +278,6 @@ public class ConversationActivity extends BugleActionBarActivity
|
||||
invalidateActionBar();
|
||||
}
|
||||
|
||||
@Override // From ConversationFragmentHost
|
||||
public void onConversationMessagesUpdated(final int numberOfMessages) {
|
||||
}
|
||||
|
||||
@Override // From ConversationFragmentHost
|
||||
public void onConversationParticipantDataLoaded(final int numberOfParticipants) {
|
||||
}
|
||||
|
||||
@Override // From ConversationFragmentHost
|
||||
public boolean isActiveAndFocused() {
|
||||
return !mIsPaused && hasWindowFocus();
|
||||
|
||||
@@ -131,14 +131,11 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
ActionMode startActionMode(ActionMode.Callback callback);
|
||||
void dismissActionMode();
|
||||
ActionMode getActionMode();
|
||||
void onConversationMessagesUpdated(int numberOfMessages);
|
||||
void onConversationParticipantDataLoaded(int numberOfParticipants);
|
||||
boolean isActiveAndFocused();
|
||||
}
|
||||
|
||||
public static final String FRAGMENT_TAG = "conversation";
|
||||
|
||||
static final int REQUEST_CHOOSE_ATTACHMENTS = 2;
|
||||
private static final int JUMP_SCROLL_THRESHOLD = 15;
|
||||
// We animate the message from draft to message list, if we the message doesn't show up in the
|
||||
// list within this time limit, then we just do a fade in animation instead
|
||||
@@ -896,8 +893,6 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
}
|
||||
|
||||
if (cursor != null) {
|
||||
mHost.onConversationMessagesUpdated(cursor.getCount());
|
||||
|
||||
// Are we coming from a widget click where we're told to scroll to a particular item?
|
||||
final int scrollToPos = getScrollToMessagePosition();
|
||||
if (scrollToPos >= 0) {
|
||||
@@ -1164,8 +1159,6 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
mHost.invalidateActionBar();
|
||||
|
||||
mRecyclerView.setVisibility(View.VISIBLE);
|
||||
mHost.onConversationParticipantDataLoaded
|
||||
(mBinding.getData().getNumberOfParticipantsExcludingSelf());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1542,11 +1535,6 @@ public class ConversationFragment extends Fragment implements ConversationDataLi
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void showHideSimSelector(final boolean show) {
|
||||
// no-op for now
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSimSelectorItemLayoutId() {
|
||||
return R.layout.sim_selector_item_view;
|
||||
|
||||
@@ -62,7 +62,6 @@ public class ConversationInputManager implements ConversationInput.ConversationI
|
||||
void onStartComposeMessage();
|
||||
SimSelectorView getSimSelectorView();
|
||||
MediaPicker createMediaPicker();
|
||||
void showHideSimSelector(boolean show);
|
||||
int getSimSelectorItemLayoutId();
|
||||
}
|
||||
|
||||
@@ -493,15 +492,12 @@ public class ConversationInputManager implements ConversationInput.ConversationI
|
||||
@Override
|
||||
public boolean show(boolean animate) {
|
||||
final boolean result = super.show(animate);
|
||||
mHost.showHideSimSelector(true /*show*/);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hide(boolean animate) {
|
||||
final boolean result = super.hide(animate);
|
||||
mHost.showHideSimSelector(false /*show*/);
|
||||
return result;
|
||||
return super.hide(animate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -104,11 +104,6 @@ class CameraMediaChooser extends MediaChooser {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public View destroyView() {
|
||||
return super.destroyView();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View createView(final ViewGroup container) {
|
||||
final LayoutInflater inflater = getLayoutInflater();
|
||||
|
||||
@@ -107,9 +107,6 @@ abstract class MediaChooser extends BasePagerViewHolder
|
||||
return LayoutInflater.from(getContext());
|
||||
}
|
||||
|
||||
/** Allows the chooser to handle full screen change */
|
||||
void onFullScreenChanged(final boolean fullScreen) {}
|
||||
|
||||
/** Allows the chooser to handle the chooser being opened or closed */
|
||||
void onOpenedChanged(final boolean open) {
|
||||
mOpen = open;
|
||||
@@ -176,9 +173,6 @@ abstract class MediaChooser extends BasePagerViewHolder
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onCreateOptionsMenu(final MenuInflater inflater, final Menu menu) {
|
||||
}
|
||||
|
||||
public boolean onOptionsItemSelected(final MenuItem item) {
|
||||
return false;
|
||||
}
|
||||
@@ -204,5 +198,4 @@ abstract class MediaChooser extends BasePagerViewHolder
|
||||
|
||||
/** Optional activity life-cycle methods to be overridden by subclasses */
|
||||
public void onPause() { }
|
||||
public void onResume() { }
|
||||
}
|
||||
|
||||
@@ -279,15 +279,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
|
||||
for (final MediaChooser chooser : mEnabledChoosers) {
|
||||
chooser.onResume();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
@@ -545,7 +536,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
mListenerHandler.post(() -> mListener.onOpened());
|
||||
}
|
||||
if (mSelectedChooser != null) {
|
||||
mSelectedChooser.onFullScreenChanged(false);
|
||||
mSelectedChooser.onOpenedChanged(true);
|
||||
}
|
||||
}
|
||||
@@ -566,9 +556,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
if (mListener != null) {
|
||||
mListenerHandler.post(() -> mListener.onFullScreenChanged(fullScreen));
|
||||
}
|
||||
if (mSelectedChooser != null) {
|
||||
mSelectedChooser.onFullScreenChanged(fullScreen);
|
||||
}
|
||||
}
|
||||
|
||||
void dispatchItemsSelected(final MessagePartData item, final boolean dismissMediaPicker) {
|
||||
@@ -641,9 +628,6 @@ public class MediaPicker extends Fragment implements DraftMessageSubscriptionDat
|
||||
@Override
|
||||
public void onCreateOptionsMenu(@NonNull final Menu menu,
|
||||
@NonNull final MenuInflater inflater) {
|
||||
if (mSelectedChooser != null) {
|
||||
mSelectedChooser.onCreateOptionsMenu(inflater, menu);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user