|
@@ -2,7 +2,9 @@
|
|
* Nextcloud Talk application
|
|
* Nextcloud Talk application
|
|
*
|
|
*
|
|
* @author Mario Danic
|
|
* @author Mario Danic
|
|
- * Copyright (C) 2017 Mario Danic (mario@lovelyhq.com)
|
|
|
|
|
|
+ * @author Andy Scherzinger
|
|
|
|
+ * Copyright (C) 2021 Andy Scherzinger (info@andy-scherzinger.de)
|
|
|
|
+ * Copyright (C) 2017-2020 Mario Danic (mario@lovelyhq.com)
|
|
*
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* it under the terms of the GNU General Public License as published by
|
|
@@ -20,6 +22,7 @@
|
|
|
|
|
|
package com.nextcloud.talk.controllers;
|
|
package com.nextcloud.talk.controllers;
|
|
|
|
|
|
|
|
+import android.animation.AnimatorInflater;
|
|
import android.app.SearchManager;
|
|
import android.app.SearchManager;
|
|
import android.content.Context;
|
|
import android.content.Context;
|
|
import android.content.Intent;
|
|
import android.content.Intent;
|
|
@@ -27,8 +30,10 @@ import android.graphics.Bitmap;
|
|
import android.os.Build;
|
|
import android.os.Build;
|
|
import android.os.Bundle;
|
|
import android.os.Bundle;
|
|
import android.os.Handler;
|
|
import android.os.Handler;
|
|
|
|
+import android.text.Editable;
|
|
import android.text.InputType;
|
|
import android.text.InputType;
|
|
import android.text.TextUtils;
|
|
import android.text.TextUtils;
|
|
|
|
+import android.text.TextWatcher;
|
|
import android.view.LayoutInflater;
|
|
import android.view.LayoutInflater;
|
|
import android.view.Menu;
|
|
import android.view.Menu;
|
|
import android.view.MenuInflater;
|
|
import android.view.MenuInflater;
|
|
@@ -39,6 +44,19 @@ import android.view.inputmethod.EditorInfo;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.ProgressBar;
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.RelativeLayout;
|
|
|
|
|
|
|
|
+import androidx.annotation.NonNull;
|
|
|
|
+import androidx.annotation.Nullable;
|
|
|
|
+import androidx.appcompat.widget.SearchView;
|
|
|
|
+import androidx.core.content.res.ResourcesCompat;
|
|
|
|
+import androidx.core.graphics.drawable.RoundedBitmapDrawable;
|
|
|
|
+import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory;
|
|
|
|
+import androidx.core.view.MenuItemCompat;
|
|
|
|
+import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
+import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
|
|
+import androidx.work.Data;
|
|
|
|
+import androidx.work.OneTimeWorkRequest;
|
|
|
|
+import androidx.work.WorkManager;
|
|
|
|
+
|
|
import com.bluelinelabs.conductor.RouterTransaction;
|
|
import com.bluelinelabs.conductor.RouterTransaction;
|
|
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
|
import com.bluelinelabs.conductor.changehandler.HorizontalChangeHandler;
|
|
import com.bluelinelabs.conductor.changehandler.TransitionChangeHandlerCompat;
|
|
import com.bluelinelabs.conductor.changehandler.TransitionChangeHandlerCompat;
|
|
@@ -52,10 +70,12 @@ import com.facebook.imagepipeline.core.ImagePipeline;
|
|
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
|
import com.facebook.imagepipeline.datasource.BaseBitmapDataSubscriber;
|
|
import com.facebook.imagepipeline.image.CloseableImage;
|
|
import com.facebook.imagepipeline.image.CloseableImage;
|
|
import com.facebook.imagepipeline.request.ImageRequest;
|
|
import com.facebook.imagepipeline.request.ImageRequest;
|
|
|
|
+import com.google.android.material.button.MaterialButton;
|
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
|
import com.kennyc.bottomsheet.BottomSheet;
|
|
import com.kennyc.bottomsheet.BottomSheet;
|
|
import com.nextcloud.talk.R;
|
|
import com.nextcloud.talk.R;
|
|
import com.nextcloud.talk.activities.MagicCallActivity;
|
|
import com.nextcloud.talk.activities.MagicCallActivity;
|
|
|
|
+import com.nextcloud.talk.activities.MainActivity;
|
|
import com.nextcloud.talk.adapters.items.CallItem;
|
|
import com.nextcloud.talk.adapters.items.CallItem;
|
|
import com.nextcloud.talk.adapters.items.ConversationItem;
|
|
import com.nextcloud.talk.adapters.items.ConversationItem;
|
|
import com.nextcloud.talk.api.NcApi;
|
|
import com.nextcloud.talk.api.NcApi;
|
|
@@ -95,17 +115,6 @@ import java.util.List;
|
|
|
|
|
|
import javax.inject.Inject;
|
|
import javax.inject.Inject;
|
|
|
|
|
|
-import androidx.annotation.NonNull;
|
|
|
|
-import androidx.annotation.Nullable;
|
|
|
|
-import androidx.appcompat.widget.SearchView;
|
|
|
|
-import androidx.core.graphics.drawable.RoundedBitmapDrawable;
|
|
|
|
-import androidx.core.graphics.drawable.RoundedBitmapDrawableFactory;
|
|
|
|
-import androidx.core.view.MenuItemCompat;
|
|
|
|
-import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
-import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
|
|
|
-import androidx.work.Data;
|
|
|
|
-import androidx.work.OneTimeWorkRequest;
|
|
|
|
-import androidx.work.WorkManager;
|
|
|
|
import autodagger.AutoInjector;
|
|
import autodagger.AutoInjector;
|
|
import butterknife.BindView;
|
|
import butterknife.BindView;
|
|
import eu.davidea.fastscroller.FastScroller;
|
|
import eu.davidea.fastscroller.FastScroller;
|
|
@@ -214,9 +223,16 @@ public class ConversationsListController extends BaseController implements Searc
|
|
prepareViews();
|
|
prepareViews();
|
|
}
|
|
}
|
|
|
|
|
|
- private void loadUserAvatar(MenuItem menuItem) {
|
|
|
|
|
|
+ private void loadUserAvatar(MaterialButton button) {
|
|
if (getActivity() != null) {
|
|
if (getActivity() != null) {
|
|
- int avatarSize = (int) DisplayUtils.convertDpToPixel(menuItem.getIcon().getIntrinsicHeight(), getActivity());
|
|
|
|
|
|
+ int avatarSize;
|
|
|
|
+
|
|
|
|
+ if (getResources() != null) {
|
|
|
|
+ avatarSize = getResources().getDimensionPixelSize(R.dimen.avatar_size_app_bar);
|
|
|
|
+ } else {
|
|
|
|
+ avatarSize = (int) DisplayUtils.convertDpToPixel(30.0f, context);
|
|
|
|
+ }
|
|
|
|
+
|
|
ImageRequest imageRequest = DisplayUtils.getImageRequestForUrl(ApiUtils.getUrlForAvatarWithNameAndPixels(currentUser.getBaseUrl(),
|
|
ImageRequest imageRequest = DisplayUtils.getImageRequestForUrl(ApiUtils.getUrlForAvatarWithNameAndPixels(currentUser.getBaseUrl(),
|
|
currentUser.getUserId(), avatarSize), currentUser);
|
|
currentUser.getUserId(), avatarSize), currentUser);
|
|
|
|
|
|
@@ -229,13 +245,15 @@ public class ConversationsListController extends BaseController implements Searc
|
|
RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), bitmap);
|
|
RoundedBitmapDrawable roundedBitmapDrawable = RoundedBitmapDrawableFactory.create(getResources(), bitmap);
|
|
roundedBitmapDrawable.setCircular(true);
|
|
roundedBitmapDrawable.setCircular(true);
|
|
roundedBitmapDrawable.setAntiAlias(true);
|
|
roundedBitmapDrawable.setAntiAlias(true);
|
|
- menuItem.setIcon(roundedBitmapDrawable);
|
|
|
|
|
|
+ button.setIcon(roundedBitmapDrawable);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
protected void onFailureImpl(DataSource<CloseableReference<CloseableImage>> dataSource) {
|
|
protected void onFailureImpl(DataSource<CloseableReference<CloseableImage>> dataSource) {
|
|
- menuItem.setIcon(R.drawable.ic_settings_white_24dp);
|
|
|
|
|
|
+ if (getResources() != null) {
|
|
|
|
+ button.setIcon(ResourcesCompat.getDrawable(getResources(), R.drawable.ic_settings_white_24dp, null));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}, UiThreadImmediateExecutorService.getInstance());
|
|
}, UiThreadImmediateExecutorService.getInstance());
|
|
}
|
|
}
|
|
@@ -251,6 +269,9 @@ public class ConversationsListController extends BaseController implements Searc
|
|
if (currentUser != null) {
|
|
if (currentUser != null) {
|
|
credentials = ApiUtils.getCredentials(currentUser.getUsername(), currentUser.getToken());
|
|
credentials = ApiUtils.getCredentials(currentUser.getUsername(), currentUser.getToken());
|
|
shouldUseLastMessageLayout = currentUser.hasSpreedFeatureCapability("last-room-activity");
|
|
shouldUseLastMessageLayout = currentUser.hasSpreedFeatureCapability("last-room-activity");
|
|
|
|
+ if (getActivity() != null && getActivity() instanceof MainActivity) {
|
|
|
|
+ loadUserAvatar(((MainActivity) getActivity()).settingsButton);
|
|
|
|
+ }
|
|
fetchData(false);
|
|
fetchData(false);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -266,6 +287,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|
SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
|
|
SearchManager searchManager = (SearchManager) getActivity().getSystemService(Context.SEARCH_SERVICE);
|
|
if (searchItem != null) {
|
|
if (searchItem != null) {
|
|
searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
|
|
searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
|
|
|
|
+ DisplayUtils.themeSearchView(searchView, context);
|
|
searchView.setMaxWidth(Integer.MAX_VALUE);
|
|
searchView.setMaxWidth(Integer.MAX_VALUE);
|
|
searchView.setInputType(InputType.TYPE_TEXT_VARIATION_FILTER);
|
|
searchView.setInputType(InputType.TYPE_TEXT_VARIATION_FILTER);
|
|
int imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_FULLSCREEN;
|
|
int imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_FULLSCREEN;
|
|
@@ -273,7 +295,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|
imeOptions |= EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING;
|
|
imeOptions |= EditorInfo.IME_FLAG_NO_PERSONALIZED_LEARNING;
|
|
}
|
|
}
|
|
searchView.setImeOptions(imeOptions);
|
|
searchView.setImeOptions(imeOptions);
|
|
- searchView.setQueryHint(getResources().getString(R.string.nc_search));
|
|
|
|
|
|
+ searchView.setQueryHint(getSearchHint());
|
|
if (searchManager != null) {
|
|
if (searchManager != null) {
|
|
searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
|
|
searchView.setSearchableInfo(searchManager.getSearchableInfo(getActivity().getComponentName()));
|
|
}
|
|
}
|
|
@@ -283,22 +305,7 @@ public class ConversationsListController extends BaseController implements Searc
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
|
|
|
- switch (item.getItemId()) {
|
|
|
|
- case R.id.action_settings:
|
|
|
|
- ArrayList<String> names = new ArrayList<>();
|
|
|
|
- names.add("userAvatar.transitionTag");
|
|
|
|
- getRouter().pushController((RouterTransaction.with(new SettingsController())
|
|
|
|
- .pushChangeHandler(new TransitionChangeHandlerCompat(new SharedElementTransition(names), new VerticalChangeHandler()))
|
|
|
|
- .popChangeHandler(new TransitionChangeHandlerCompat(new SharedElementTransition(names), new VerticalChangeHandler()))));
|
|
|
|
- return true;
|
|
|
|
- default:
|
|
|
|
- return super.onOptionsItemSelected(item);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- @Override
|
|
|
|
- public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
|
|
|
|
|
|
+ public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
|
super.onCreateOptionsMenu(menu, inflater);
|
|
super.onCreateOptionsMenu(menu, inflater);
|
|
inflater.inflate(R.menu.menu_conversation_plus_filter, menu);
|
|
inflater.inflate(R.menu.menu_conversation_plus_filter, menu);
|
|
searchItem = menu.findItem(R.id.action_search);
|
|
searchItem = menu.findItem(R.id.action_search);
|
|
@@ -306,16 +313,87 @@ public class ConversationsListController extends BaseController implements Searc
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void onPrepareOptionsMenu(Menu menu) {
|
|
|
|
|
|
+ public void onPrepareOptionsMenu(@NonNull Menu menu) {
|
|
super.onPrepareOptionsMenu(menu);
|
|
super.onPrepareOptionsMenu(menu);
|
|
|
|
+
|
|
|
|
+ searchView = (SearchView) MenuItemCompat.getActionView(searchItem);
|
|
|
|
+
|
|
|
|
+ MainActivity activity = (MainActivity) getActivity();
|
|
|
|
+
|
|
searchItem.setVisible(callItems.size() > 0);
|
|
searchItem.setVisible(callItems.size() > 0);
|
|
if (adapter.hasFilter()) {
|
|
if (adapter.hasFilter()) {
|
|
- searchItem.expandActionView();
|
|
|
|
|
|
+ showSearchView(activity, searchView, searchItem);
|
|
searchView.setQuery(adapter.getFilter(String.class), false);
|
|
searchView.setQuery(adapter.getFilter(String.class), false);
|
|
}
|
|
}
|
|
|
|
|
|
- MenuItem menuItem = menu.findItem(R.id.action_settings);
|
|
|
|
- loadUserAvatar(menuItem);
|
|
|
|
|
|
+ if (activity != null) {
|
|
|
|
+ activity.getSearchInputText().setOnClickListener(v -> {
|
|
|
|
+ showSearchView(activity, searchView, searchItem);
|
|
|
|
+ if (getResources() != null) {
|
|
|
|
+ DisplayUtils.applyColorToStatusBar(
|
|
|
|
+ activity,
|
|
|
|
+ ResourcesCompat.getColor(getResources(), R.color.bg_default, null)
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ searchView.setOnCloseListener(() -> {
|
|
|
|
+ if (TextUtils.isEmpty(searchView.getQuery().toString())) {
|
|
|
|
+ searchView.onActionViewCollapsed();
|
|
|
|
+ if (activity != null && getResources() != null) {
|
|
|
|
+ DisplayUtils.applyColorToStatusBar(
|
|
|
|
+ activity,
|
|
|
|
+ ResourcesCompat.getColor(getResources(), R.color.appbar, null)
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ searchView.post(() -> searchView.setQuery("", true));
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ searchItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() {
|
|
|
|
+ @Override
|
|
|
|
+ public boolean onMenuItemActionExpand(MenuItem item) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean onMenuItemActionCollapse(MenuItem item) {
|
|
|
|
+ searchView.onActionViewCollapsed();
|
|
|
|
+ MainActivity activity = (MainActivity) getActivity();
|
|
|
|
+ if (activity != null) {
|
|
|
|
+ activity.appBar.setStateListAnimator(AnimatorInflater.loadStateListAnimator(
|
|
|
|
+ activity.appBar.getContext(),
|
|
|
|
+ R.animator.appbar_elevation_off)
|
|
|
|
+ );
|
|
|
|
+ activity.toolbar.setVisibility(View.GONE);
|
|
|
|
+ activity.searchCardView.setVisibility(View.VISIBLE);
|
|
|
|
+ }
|
|
|
|
+ SmoothScrollLinearLayoutManager layoutManager =
|
|
|
|
+ (SmoothScrollLinearLayoutManager) recyclerView.getLayoutManager();
|
|
|
|
+ if (layoutManager!=null) {
|
|
|
|
+ layoutManager.scrollToPositionWithOffset(0, 0);
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected void showSearchOrToolbar() {
|
|
|
|
+ if (TextUtils.isEmpty(searchQuery)) {
|
|
|
|
+ super.showSearchOrToolbar();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void showSearchView(MainActivity activity, SearchView searchView, MenuItem searchItem) {
|
|
|
|
+ activity.appBar.setStateListAnimator(AnimatorInflater.loadStateListAnimator(
|
|
|
|
+ activity.appBar.getContext(),
|
|
|
|
+ R.animator.appbar_elevation_on));
|
|
|
|
+ activity.toolbar.setVisibility(View.VISIBLE);
|
|
|
|
+ activity.searchCardView.setVisibility(View.GONE);
|
|
|
|
+ searchItem.expandActionView();
|
|
}
|
|
}
|
|
|
|
|
|
private void fetchData(boolean fromBottomSheet) {
|
|
private void fetchData(boolean fromBottomSheet) {
|
|
@@ -385,19 +463,11 @@ public class ConversationsListController extends BaseController implements Searc
|
|
|
|
|
|
adapter.updateDataSet(callItems, false);
|
|
adapter.updateDataSet(callItems, false);
|
|
|
|
|
|
- if (searchItem != null) {
|
|
|
|
- searchItem.setVisible(callItems.size() > 0);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (swipeRefreshLayout != null) {
|
|
if (swipeRefreshLayout != null) {
|
|
swipeRefreshLayout.setRefreshing(false);
|
|
swipeRefreshLayout.setRefreshing(false);
|
|
}
|
|
}
|
|
|
|
|
|
}, throwable -> {
|
|
}, throwable -> {
|
|
- if (searchItem != null) {
|
|
|
|
- searchItem.setVisible(false);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
if (throwable instanceof HttpException) {
|
|
if (throwable instanceof HttpException) {
|
|
HttpException exception = (HttpException) throwable;
|
|
HttpException exception = (HttpException) throwable;
|
|
switch (exception.code()) {
|
|
switch (exception.code()) {
|
|
@@ -436,7 +506,6 @@ public class ConversationsListController extends BaseController implements Searc
|
|
|
|
|
|
isRefreshing = false;
|
|
isRefreshing = false;
|
|
});
|
|
});
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private void prepareViews() {
|
|
private void prepareViews() {
|
|
@@ -472,6 +541,20 @@ public class ConversationsListController extends BaseController implements Searc
|
|
}
|
|
}
|
|
return displayName;
|
|
return displayName;
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ if (getActivity() != null && getActivity() instanceof MainActivity) {
|
|
|
|
+ MainActivity activity = (MainActivity) getActivity();
|
|
|
|
+
|
|
|
|
+ if (activity.settingsButton != null) {
|
|
|
|
+ activity.settingsButton.setOnClickListener(v -> {
|
|
|
|
+ ArrayList<String> names = new ArrayList<>();
|
|
|
|
+ names.add("userAvatar.transitionTag");
|
|
|
|
+ getRouter().pushController((RouterTransaction.with(new SettingsController())
|
|
|
|
+ .pushChangeHandler(new TransitionChangeHandlerCompat(new SharedElementTransition(names), new VerticalChangeHandler()))
|
|
|
|
+ .popChangeHandler(new TransitionChangeHandlerCompat(new SharedElementTransition(names), new VerticalChangeHandler()))));
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private void showNewConversationsScreen() {
|
|
private void showNewConversationsScreen() {
|
|
@@ -490,7 +573,6 @@ public class ConversationsListController extends BaseController implements Searc
|
|
roomsQueryDisposable != null && !roomsQueryDisposable.isDisposed()) {
|
|
roomsQueryDisposable != null && !roomsQueryDisposable.isDisposed()) {
|
|
roomsQueryDisposable.dispose();
|
|
roomsQueryDisposable.dispose();
|
|
roomsQueryDisposable = null;
|
|
roomsQueryDisposable = null;
|
|
-
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -508,7 +590,9 @@ public class ConversationsListController extends BaseController implements Searc
|
|
@Override
|
|
@Override
|
|
public void onRestoreViewState(@NonNull View view, @NonNull Bundle savedViewState) {
|
|
public void onRestoreViewState(@NonNull View view, @NonNull Bundle savedViewState) {
|
|
super.onRestoreViewState(view, savedViewState);
|
|
super.onRestoreViewState(view, savedViewState);
|
|
- searchQuery = savedViewState.getString(KEY_SEARCH_QUERY, "");
|
|
|
|
|
|
+ if (savedViewState.containsKey(KEY_SEARCH_QUERY)) {
|
|
|
|
+ searchQuery = savedViewState.getString(KEY_SEARCH_QUERY, "");
|
|
|
|
+ }
|
|
if (LovelySaveStateHandler.wasDialogOnScreen(savedViewState)) {
|
|
if (LovelySaveStateHandler.wasDialogOnScreen(savedViewState)) {
|
|
//Dialog won't be restarted automatically, so we need to call this method.
|
|
//Dialog won't be restarted automatically, so we need to call this method.
|
|
//Each dialog knows how to restore its state
|
|
//Each dialog knows how to restore its state
|
|
@@ -525,7 +609,6 @@ public class ConversationsListController extends BaseController implements Searc
|
|
@Override
|
|
@Override
|
|
public boolean onQueryTextChange(String newText) {
|
|
public boolean onQueryTextChange(String newText) {
|
|
if (adapter.hasNewFilter(newText) || !TextUtils.isEmpty(searchQuery)) {
|
|
if (adapter.hasNewFilter(newText) || !TextUtils.isEmpty(searchQuery)) {
|
|
-
|
|
|
|
if (!TextUtils.isEmpty(searchQuery)) {
|
|
if (!TextUtils.isEmpty(searchQuery)) {
|
|
adapter.setFilter(searchQuery);
|
|
adapter.setFilter(searchQuery);
|
|
searchQuery = "";
|
|
searchQuery = "";
|
|
@@ -602,7 +685,6 @@ public class ConversationsListController extends BaseController implements Searc
|
|
bottomSheet.show();
|
|
bottomSheet.show();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
@Override
|
|
@Override
|
|
protected String getTitle() {
|
|
protected String getTitle() {
|
|
return getResources().getString(R.string.nc_app_name);
|
|
return getResources().getString(R.string.nc_app_name);
|
|
@@ -624,7 +706,6 @@ public class ConversationsListController extends BaseController implements Searc
|
|
conversation = ((CallItem) clickedItem).getModel();
|
|
conversation = ((CallItem) clickedItem).getModel();
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
Bundle bundle = new Bundle();
|
|
Bundle bundle = new Bundle();
|
|
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_USER_ENTITY(), currentUser);
|
|
bundle.putParcelable(BundleKeys.INSTANCE.getKEY_USER_ENTITY(), currentUser);
|
|
bundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), conversation.getToken());
|
|
bundle.putString(BundleKeys.INSTANCE.getKEY_ROOM_TOKEN(), conversation.getToken());
|
|
@@ -753,4 +834,9 @@ public class ConversationsListController extends BaseController implements Searc
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public AppBarLayoutType getAppBarLayoutType() {
|
|
|
|
+ return AppBarLayoutType.SEARCH_BAR;
|
|
|
|
+ }
|
|
}
|
|
}
|