Commit cdcbbbb0 authored by Adrien Béraud's avatar Adrien Béraud Committed by Sébastien Blin
Browse files

tablet: add conversation selection

Change-Id: I1c0a7078031133e7442699720a4fb9874e47cced
parent 2ed1e7b3
...@@ -24,6 +24,7 @@ import cx.ring.databinding.ItemSmartlistBinding; ...@@ -24,6 +24,7 @@ import cx.ring.databinding.ItemSmartlistBinding;
import cx.ring.databinding.ItemSmartlistHeaderBinding; import cx.ring.databinding.ItemSmartlistHeaderBinding;
import net.jami.smartlist.SmartListViewModel; import net.jami.smartlist.SmartListViewModel;
import cx.ring.viewholders.SmartListViewHolder; import cx.ring.viewholders.SmartListViewHolder;
import io.reactivex.disposables.CompositeDisposable;
import android.os.Parcelable; import android.os.Parcelable;
import android.view.LayoutInflater; import android.view.LayoutInflater;
...@@ -40,10 +41,12 @@ public class SmartListAdapter extends RecyclerView.Adapter<SmartListViewHolder> ...@@ -40,10 +41,12 @@ public class SmartListAdapter extends RecyclerView.Adapter<SmartListViewHolder>
private List<SmartListViewModel> mSmartListViewModels = new ArrayList<>(); private List<SmartListViewModel> mSmartListViewModels = new ArrayList<>();
private final SmartListViewHolder.SmartListListeners listener; private final SmartListViewHolder.SmartListListeners listener;
private final CompositeDisposable mDisposable;
private RecyclerView recyclerView; private RecyclerView recyclerView;
public SmartListAdapter(List<SmartListViewModel> smartListViewModels, SmartListViewHolder.SmartListListeners listener) { public SmartListAdapter(List<SmartListViewModel> smartListViewModels, SmartListViewHolder.SmartListListeners listener, CompositeDisposable disposable) {
this.listener = listener; this.listener = listener;
mDisposable = disposable;
if (smartListViewModels != null) if (smartListViewModels != null)
mSmartListViewModels.addAll(smartListViewModels); mSmartListViewModels.addAll(smartListViewModels);
} }
...@@ -54,10 +57,10 @@ public class SmartListAdapter extends RecyclerView.Adapter<SmartListViewHolder> ...@@ -54,10 +57,10 @@ public class SmartListAdapter extends RecyclerView.Adapter<SmartListViewHolder>
LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext()); LayoutInflater layoutInflater = LayoutInflater.from(parent.getContext());
if (viewType == 0) { if (viewType == 0) {
ItemSmartlistBinding itemBinding = ItemSmartlistBinding.inflate(layoutInflater, parent, false); ItemSmartlistBinding itemBinding = ItemSmartlistBinding.inflate(layoutInflater, parent, false);
return new SmartListViewHolder(itemBinding); return new SmartListViewHolder(itemBinding, mDisposable);
} else { } else {
ItemSmartlistHeaderBinding itemBinding = ItemSmartlistHeaderBinding.inflate(layoutInflater, parent, false); ItemSmartlistHeaderBinding itemBinding = ItemSmartlistHeaderBinding.inflate(layoutInflater, parent, false);
return new SmartListViewHolder(itemBinding); return new SmartListViewHolder(itemBinding, mDisposable);
} }
} }
......
...@@ -343,6 +343,10 @@ public abstract class JamiApplication extends Application { ...@@ -343,6 +343,10 @@ public abstract class JamiApplication extends Application {
return mHardwareService; return mHardwareService;
} }
public ConversationFacade getFacade() {
return mConversationFacade;
}
private void setupActivityListener() { private void setupActivityListener() {
registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() { registerActivityLifecycleCallbacks(new ActivityLifecycleCallbacks() {
......
...@@ -53,7 +53,7 @@ import io.reactivex.disposables.CompositeDisposable; ...@@ -53,7 +53,7 @@ import io.reactivex.disposables.CompositeDisposable;
public class ConversationSelectionActivity extends AppCompatActivity { public class ConversationSelectionActivity extends AppCompatActivity {
private final static String TAG = ConversationSelectionActivity.class.getSimpleName(); private final static String TAG = ConversationSelectionActivity.class.getSimpleName();
private CompositeDisposable mDisposable = new CompositeDisposable(); private final CompositeDisposable mDisposable = new CompositeDisposable();
@Inject @Inject
@Singleton @Singleton
...@@ -90,7 +90,7 @@ public class ConversationSelectionActivity extends AppCompatActivity { ...@@ -90,7 +90,7 @@ public class ConversationSelectionActivity extends AppCompatActivity {
@Override @Override
public void onItemLongClick(SmartListViewModel smartListViewModel) { public void onItemLongClick(SmartListViewModel smartListViewModel) {
} }
}); }, mDisposable);
list.setLayoutManager(new LinearLayoutManager(this)); list.setLayoutManager(new LinearLayoutManager(this));
list.setAdapter(adapter); list.setAdapter(adapter);
} }
......
...@@ -49,11 +49,13 @@ import androidx.fragment.app.FragmentTransaction; ...@@ -49,11 +49,13 @@ import androidx.fragment.app.FragmentTransaction;
import com.google.android.material.bottomnavigation.BottomNavigationView; import com.google.android.material.bottomnavigation.BottomNavigationView;
import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import net.jami.facades.ConversationFacade;
import net.jami.model.Account; import net.jami.model.Account;
import net.jami.model.AccountConfig; import net.jami.model.AccountConfig;
import net.jami.model.Conversation; import net.jami.model.Conversation;
import net.jami.services.AccountService; import net.jami.services.AccountService;
import net.jami.services.NotificationService; import net.jami.services.NotificationService;
import net.jami.smartlist.SmartListViewModel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
...@@ -87,6 +89,7 @@ import cx.ring.utils.ContentUriHandler; ...@@ -87,6 +89,7 @@ import cx.ring.utils.ContentUriHandler;
import cx.ring.utils.ConversationPath; import cx.ring.utils.ConversationPath;
import cx.ring.utils.DeviceUtils; import cx.ring.utils.DeviceUtils;
import cx.ring.views.SwitchButton; import cx.ring.views.SwitchButton;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable; import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
...@@ -195,7 +198,7 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -195,7 +198,7 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
} }
// if app opened from notification display trust request fragment when mService will connected // if app opened from notification display trust request fragment when mService will connected
Intent intent = getIntent(); /*Intent intent = getIntent();
Bundle extra = intent.getExtras(); Bundle extra = intent.getExtras();
String action = intent.getAction(); String action = intent.getAction();
if (ACTION_PRESENT_TRUST_REQUEST_FRAGMENT.equals(action)) { if (ACTION_PRESENT_TRUST_REQUEST_FRAGMENT.equals(action)) {
...@@ -213,13 +216,12 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -213,13 +216,12 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
fragmentManager.beginTransaction() fragmentManager.beginTransaction()
.replace(R.id.main_frame, fContent, HOME_TAG) .replace(R.id.main_frame, fContent, HOME_TAG)
.commitNow(); .commitNow();
} else if (fContent instanceof Refreshable) {
((Refreshable) fContent).refresh();
} }
if (mAccountWithPendingrequests != null) { if (mAccountWithPendingrequests != null) {
presentTrustRequestFragment(mAccountWithPendingrequests); presentTrustRequestFragment(mAccountWithPendingrequests);
mAccountWithPendingrequests = null; mAccountWithPendingrequests = null;
} }*/
handleIntent(getIntent());
} }
@Override @Override
...@@ -251,7 +253,7 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -251,7 +253,7 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
@Override @Override
protected void onNewIntent(Intent intent) { protected void onNewIntent(Intent intent) {
super.onNewIntent(intent); super.onNewIntent(intent);
Log.d(TAG, "onNewIntent: " + intent); /*Log.d(TAG, "onNewIntent: " + intent);
String action = intent.getAction(); String action = intent.getAction();
if (ACTION_PRESENT_TRUST_REQUEST_FRAGMENT.equals(action)) { if (ACTION_PRESENT_TRUST_REQUEST_FRAGMENT.equals(action)) {
Bundle extra = intent.getExtras(); Bundle extra = intent.getExtras();
...@@ -265,11 +267,51 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -265,11 +267,51 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
if (fContent instanceof SmartListFragment) { if (fContent instanceof SmartListFragment) {
((SmartListFragment)fContent).handleIntent(intent); ((SmartListFragment)fContent).handleIntent(intent);
} }
} else if (DRingService.ACTION_CONV_ACCEPT.equals(action)) { } else if (DRingService.ACTION_CONV_ACCEPT.equals(action) || Intent.ACTION_VIEW.equals(action)) {
if (DeviceUtils.isTablet(this)) { startConversation(ConversationPath.fromIntent(intent));
}*/
}
private void handleIntent(Intent intent) {
Log.d(TAG, "handleIntent: " + intent);
Bundle extra = intent.getExtras();
String action = intent.getAction();
if (ACTION_PRESENT_TRUST_REQUEST_FRAGMENT.equals(action)) {
if (extra == null || extra.getString(ContactRequestsFragment.ACCOUNT_ID) == null) {
return;
}
//mAccountWithPendingrequests = extra.getString(ContactRequestsFragment.ACCOUNT_ID);
presentTrustRequestFragment(extra.getString(ContactRequestsFragment.ACCOUNT_ID));
} else if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action)) {
ConversationPath path = ConversationPath.fromBundle(extra);
if (path != null) {
intent.setClass(this, ConversationActivity.class);
startActivity(intent);
}
} else if (DRingService.ACTION_CONV_ACCEPT.equals(action) || Intent.ACTION_VIEW.equals(action)) {
startConversation(ConversationPath.fromIntent(intent));
/*if (DeviceUtils.isTablet(this)) {
startConversationTablet(ConversationPath.fromIntent(intent).toBundle()); startConversationTablet(ConversationPath.fromIntent(intent).toBundle());
}*/
} //else {
FragmentManager fragmentManager = getSupportFragmentManager();
fContent = fragmentManager.findFragmentById(R.id.main_frame);
if (fContent == null || Intent.ACTION_SEARCH.equals(action)) {
if (fContent instanceof SmartListFragment) {
((SmartListFragment)fContent).handleIntent(intent);
} else {
fContent = new SmartListFragment();
fragmentManager.beginTransaction()
.replace(R.id.main_frame, fContent, HOME_TAG)
.commitNow();
}
} }
} /*if (mAccountWithPendingrequests != null) {
presentTrustRequestFragment(mAccountWithPendingrequests);
mAccountWithPendingrequests = null;
}*/
//}
} }
private void showMigrationDialog() { private void showMigrationDialog() {
...@@ -370,6 +412,39 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -370,6 +412,39 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
if (DeviceUtils.isTablet(this)) { if (DeviceUtils.isTablet(this)) {
selectNavigationItem(R.id.navigation_home); selectNavigationItem(R.id.navigation_home);
showTabletToolbar(); showTabletToolbar();
} else {
// Remove ConversationFragment that might have been restored after an orientation change
if (fConversation == null)
fConversation = (ConversationFragment) getSupportFragmentManager().findFragmentByTag(ConversationFragment.class.getSimpleName());
if (fConversation != null) {
// fConversation = null;
// getSupportFragmentManager().findFragmentByTag(ConversationFragment.class.getSimpleName());
getSupportFragmentManager().beginTransaction().remove(fConversation).commitNow();
fConversation = null;
}
}
}
// Select first conversation in tablet mode
if (DeviceUtils.isTablet(this)) {
Intent intent = getIntent();
Uri uri = intent == null ? null : intent.getData();
if ((intent == null || uri == null) && fConversation == null) {
ConversationFacade facade = ((JamiApplication) getApplication()).getFacade();
Observable<List<Observable<SmartListViewModel>>> smartlist = null;
if (fContent instanceof SmartListFragment)
smartlist = facade.getSmartList(false);
else if (fContent instanceof ContactRequestsFragment)
smartlist = facade.getPendingList();
if (smartlist != null) {
mDisposable.add(smartlist
.filter(list -> !list.isEmpty())
.map(list -> list.get(0).firstOrError())
.firstElement()
.flatMapSingle(e -> e)
.subscribe(element -> startConversation(element.getAccountId(), element.getUri())));
}
} }
} }
} }
...@@ -387,11 +462,14 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -387,11 +462,14 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
.subscribe(account -> startConversation(account.getAccountID(), net.jami.model.Uri.fromString(conversationId)))); .subscribe(account -> startConversation(account.getAccountID(), net.jami.model.Uri.fromString(conversationId))));
} }
public void startConversation(String accountId, net.jami.model.Uri conversationId) { public void startConversation(String accountId, net.jami.model.Uri conversationId) {
Log.w(TAG, "startConversation " + accountId + " " + conversationId); startConversation(new ConversationPath(accountId, conversationId));
}
public void startConversation(ConversationPath path) {
Log.w(TAG, "startConversation " + path);
if (!DeviceUtils.isTablet(this)) { if (!DeviceUtils.isTablet(this)) {
startActivity(new Intent(Intent.ACTION_VIEW, ConversationPath.toUri(accountId, conversationId), this, ConversationActivity.class)); startActivity(new Intent(Intent.ACTION_VIEW, path.toUri(), this, ConversationActivity.class));
} else { } else {
startConversationTablet(ConversationPath.toBundle(accountId, conversationId)); startConversationTablet(path.toBundle());
} }
} }
...@@ -399,7 +477,6 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -399,7 +477,6 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
fConversation = new ConversationFragment(); fConversation = new ConversationFragment();
fConversation.setArguments(bundle); fConversation.setArguments(bundle);
//getSupportFragmentManager().get
if (!(fContent instanceof ContactRequestsFragment)) { if (!(fContent instanceof ContactRequestsFragment)) {
selectNavigationItem(R.id.navigation_home); selectNavigationItem(R.id.navigation_home);
} }
...@@ -584,10 +661,6 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV ...@@ -584,10 +661,6 @@ public class HomeActivity extends AppCompatActivity implements BottomNavigationV
} }
public interface Refreshable {
void refresh();
}
public void setBadge(int menuId, int number) { public void setBadge(int menuId, int number) {
if (number == 0) if (number == 0)
mBinding.navigationView.removeBadge(menuId); mBinding.navigationView.removeBadge(menuId);
......
...@@ -45,6 +45,7 @@ import cx.ring.mvp.BaseSupportFragment; ...@@ -45,6 +45,7 @@ import cx.ring.mvp.BaseSupportFragment;
import net.jami.smartlist.SmartListViewModel; import net.jami.smartlist.SmartListViewModel;
import cx.ring.viewholders.SmartListViewHolder; import cx.ring.viewholders.SmartListViewHolder;
import io.reactivex.disposables.CompositeDisposable;
public class ContactRequestsFragment extends BaseSupportFragment<ContactRequestsPresenter> implements ContactRequestsView, public class ContactRequestsFragment extends BaseSupportFragment<ContactRequestsPresenter> implements ContactRequestsView,
SmartListViewHolder.SmartListListeners { SmartListViewHolder.SmartListListeners {
...@@ -100,7 +101,7 @@ public class ContactRequestsFragment extends BaseSupportFragment<ContactRequests ...@@ -100,7 +101,7 @@ public class ContactRequestsFragment extends BaseSupportFragment<ContactRequests
} }
@Override @Override
public void updateView(final List<SmartListViewModel> list) { public void updateView(final List<SmartListViewModel> list, CompositeDisposable disposable) {
if (binding == null) { if (binding == null) {
return; return;
} }
...@@ -114,7 +115,7 @@ public class ContactRequestsFragment extends BaseSupportFragment<ContactRequests ...@@ -114,7 +115,7 @@ public class ContactRequestsFragment extends BaseSupportFragment<ContactRequests
if (binding.requestsList.getAdapter() != null) { if (binding.requestsList.getAdapter() != null) {
mAdapter.update(list); mAdapter.update(list);
} else { } else {
mAdapter = new SmartListAdapter(list, ContactRequestsFragment.this); mAdapter = new SmartListAdapter(list, ContactRequestsFragment.this, disposable);
binding.requestsList.setAdapter(mAdapter); binding.requestsList.setAdapter(mAdapter);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity()); LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity());
binding.requestsList.setLayoutManager(mLayoutManager); binding.requestsList.setLayoutManager(mLayoutManager);
......
...@@ -141,7 +141,7 @@ public class ContactPickerFragment extends BottomSheetDialogFragment { ...@@ -141,7 +141,7 @@ public class ContactPickerFragment extends BottomSheetDialogFragment {
public void onItemLongClick(SmartListViewModel item) { public void onItemLongClick(SmartListViewModel item) {
} }
}); }, mDisposableBag);
binding.createGroupBtn.setOnClickListener(v -> mDisposableBag.add(mConversationFacade.createConversation(mAccountId, mCurrentSelection) binding.createGroupBtn.setOnClickListener(v -> mDisposableBag.add(mConversationFacade.createConversation(mAccountId, mCurrentSelection)
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(conversation -> { .subscribe(conversation -> {
......
...@@ -833,16 +833,28 @@ public class ConversationFragment extends BaseSupportFragment<ConversationPresen ...@@ -833,16 +833,28 @@ public class ConversationFragment extends BaseSupportFragment<ConversationPresen
presenter.clickOnGoingPane(); presenter.clickOnGoingPane();
} }
@Override
public void onStart() {
super.onStart();
presenter.resume(mIsBubble);
}
@Override
public void onStop() {
super.onStop();
presenter.pause();
}
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
presenter.pause(); //presenter.pause();
} }
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
presenter.resume(mIsBubble); //presenter.resume(mIsBubble);
} }
@Override @Override
......
...@@ -156,7 +156,7 @@ public class ShareWithFragment extends Fragment { ...@@ -156,7 +156,7 @@ public class ShareWithFragment extends Fragment {
public void onItemLongClick(SmartListViewModel smartListViewModel) { public void onItemLongClick(SmartListViewModel smartListViewModel) {
} }
}); }, mDisposable);
list.setLayoutManager(new LinearLayoutManager(context)); list.setLayoutManager(new LinearLayoutManager(context));
list.setAdapter(adapter); list.setAdapter(adapter);
return view; return view;
......
...@@ -74,6 +74,7 @@ import cx.ring.utils.ClipboardHelper; ...@@ -74,6 +74,7 @@ import cx.ring.utils.ClipboardHelper;
import cx.ring.utils.ConversationPath; import cx.ring.utils.ConversationPath;
import cx.ring.utils.DeviceUtils; import cx.ring.utils.DeviceUtils;
import cx.ring.viewholders.SmartListViewHolder; import cx.ring.viewholders.SmartListViewHolder;
import io.reactivex.disposables.CompositeDisposable;
public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> implements SearchView.OnQueryTextListener, public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> implements SearchView.OnQueryTextListener,
SmartListViewHolder.SmartListListeners, SmartListViewHolder.SmartListListeners,
...@@ -391,11 +392,11 @@ public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> i ...@@ -391,11 +392,11 @@ public class SmartListFragment extends BaseSupportFragment<SmartListPresenter> i
} }
@Override @Override
public void updateList(@Nullable final List<SmartListViewModel> smartListViewModels) { public void updateList(@Nullable final List<SmartListViewModel> smartListViewModels, CompositeDisposable parentDisposable) {
if (binding == null) if (binding == null)
return; return;
if (binding.confsList.getAdapter() == null) { if (binding.confsList.getAdapter() == null) {
mSmartListAdapter = new SmartListAdapter(smartListViewModels, SmartListFragment.this); mSmartListAdapter = new SmartListAdapter(smartListViewModels, SmartListFragment.this, parentDisposable);
binding.confsList.setAdapter(mSmartListAdapter); binding.confsList.setAdapter(mSmartListAdapter);
binding.confsList.setHasFixedSize(true); binding.confsList.setHasFixedSize(true);
LinearLayoutManager llm = new LinearLayoutManager(getActivity()); LinearLayoutManager llm = new LinearLayoutManager(getActivity());
......
...@@ -47,16 +47,18 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder { ...@@ -47,16 +47,18 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder {
public final ItemSmartlistHeaderBinding headerBinding; public final ItemSmartlistHeaderBinding headerBinding;
private final CompositeDisposable compositeDisposable = new CompositeDisposable(); private final CompositeDisposable compositeDisposable = new CompositeDisposable();
public SmartListViewHolder(@NonNull ItemSmartlistBinding b) { public SmartListViewHolder(@NonNull ItemSmartlistBinding b, @NonNull CompositeDisposable parentDisposable) {
super(b.getRoot()); super(b.getRoot());
binding = b; binding = b;
headerBinding = null; headerBinding = null;
parentDisposable.add(compositeDisposable);
} }
public SmartListViewHolder(@NonNull ItemSmartlistHeaderBinding b) { public SmartListViewHolder(@NonNull ItemSmartlistHeaderBinding b, @NonNull CompositeDisposable parentDisposable) {
super(b.getRoot()); super(b.getRoot());
binding = null; binding = null;
headerBinding = b; headerBinding = b;
parentDisposable.add(compositeDisposable);
} }
public void bind(final SmartListListeners clickListener, final SmartListViewModel smartListViewModel) { public void bind(final SmartListListeners clickListener, final SmartListViewModel smartListViewModel) {
...@@ -67,6 +69,10 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder { ...@@ -67,6 +69,10 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder {
compositeDisposable.add(Observable.create(e -> itemView.setOnClickListener(e::onNext)) compositeDisposable.add(Observable.create(e -> itemView.setOnClickListener(e::onNext))
.throttleFirst(1000, TimeUnit.MILLISECONDS) .throttleFirst(1000, TimeUnit.MILLISECONDS)
.subscribe(v -> clickListener.onItemClick(smartListViewModel))); .subscribe(v -> clickListener.onItemClick(smartListViewModel)));
Observable<Boolean> isSelected = smartListViewModel.getSelected();
if (isSelected != null) {
compositeDisposable.add(isSelected.subscribe(binding.itemLayout::setActivated));
}
itemView.setOnLongClickListener(v -> { itemView.setOnLongClickListener(v -> {
clickListener.onItemLongClick(smartListViewModel); clickListener.onItemLongClick(smartListViewModel);
return true; return true;
...@@ -101,6 +107,7 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder { ...@@ -101,6 +107,7 @@ public class SmartListViewHolder extends RecyclerView.ViewHolder {
.withViewModel(smartListViewModel) .withViewModel(smartListViewModel)
.withCircleCrop(true) .withCircleCrop(true)
.build(binding.photo.getContext())); .build(binding.photo.getContext()));
} else if (headerBinding != null) { } else if (headerBinding != null) {
headerBinding.headerTitle.setText(smartListViewModel.getHeaderTitle() == SmartListViewModel.Title.Conversations headerBinding.headerTitle.setText(smartListViewModel.getHeaderTitle() == SmartListViewModel.Title.Conversations
? R.string.navigation_item_conversation : R.string.search_results_public_directory); ? R.string.navigation_item_conversation : R.string.search_results_public_directory);
......
<?xml version="1.0" encoding="utf-8"?>
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?attr/colorControlHighlight">
<item>
<selector
android:exitFadeDuration="@android:integer/config_mediumAnimTime">
<item
android:drawable="@color/transparent_grey"
android:state_activated="true" />
<item android:drawable="@color/background" />
</selector>
</item>
</ripple>
\ No newline at end of file
...@@ -19,10 +19,10 @@ along with this program; if not, write to the Free Software ...@@ -19,10 +19,10 @@ along with this program; if not, write to the Free Software
--> -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/call_entry"