mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-19 19:49:33 +01:00
Fix scrolling and selection issue in RTL
The following views had scrolling and selection issues if RTL is activated: - Conversation list - File browser - Contact selection To fix this issues the fast scroller functionality were removed for those views. Signed-off-by: Tim Krüger <t@timkrueger.me>
This commit is contained in:
parent
139df41ac5
commit
fe989371de
@ -62,11 +62,9 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
import autodagger.AutoInjector;
|
import autodagger.AutoInjector;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
import eu.davidea.fastscroller.FastScroller;
|
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||||
import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager;
|
import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager;
|
||||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
||||||
import eu.davidea.flexibleadapter.items.IFlexible;
|
|
||||||
import okhttp3.OkHttpClient;
|
import okhttp3.OkHttpClient;
|
||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
@ -77,8 +75,6 @@ public abstract class BrowserController extends BaseController implements Listin
|
|||||||
UserUtils userUtils;
|
UserUtils userUtils;
|
||||||
@BindView(R.id.recycler_view)
|
@BindView(R.id.recycler_view)
|
||||||
RecyclerView recyclerView;
|
RecyclerView recyclerView;
|
||||||
@BindView(R.id.fast_scroller)
|
|
||||||
FastScroller fastScroller;
|
|
||||||
@BindView(R.id.action_back)
|
@BindView(R.id.action_back)
|
||||||
BottomNavigationItemView backMenuItem;
|
BottomNavigationItemView backMenuItem;
|
||||||
@BindView(R.id.action_refresh)
|
@BindView(R.id.action_refresh)
|
||||||
@ -276,18 +272,7 @@ public abstract class BrowserController extends BaseController implements Listin
|
|||||||
recyclerView.setLayoutManager(layoutManager);
|
recyclerView.setLayoutManager(layoutManager);
|
||||||
recyclerView.setHasFixedSize(true);
|
recyclerView.setHasFixedSize(true);
|
||||||
recyclerView.setAdapter(adapter);
|
recyclerView.setAdapter(adapter);
|
||||||
|
|
||||||
adapter.setFastScroller(fastScroller);
|
|
||||||
adapter.addListener(this);
|
adapter.addListener(this);
|
||||||
|
|
||||||
fastScroller.setBubbleTextCreator(position -> {
|
|
||||||
IFlexible abstractFlexibleItem = adapter.getItem(position);
|
|
||||||
if (abstractFlexibleItem instanceof BrowserFileItem) {
|
|
||||||
return String.valueOf(((BrowserFileItem) adapter.getItem(position)).getModel().getDisplayName().charAt(0));
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,6 @@ import autodagger.AutoInjector;
|
|||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.OnClick;
|
import butterknife.OnClick;
|
||||||
import butterknife.Optional;
|
import butterknife.Optional;
|
||||||
import eu.davidea.fastscroller.FastScroller;
|
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||||
import eu.davidea.flexibleadapter.SelectableAdapter;
|
import eu.davidea.flexibleadapter.SelectableAdapter;
|
||||||
import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager;
|
import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager;
|
||||||
@ -116,7 +115,7 @@ import okhttp3.ResponseBody;
|
|||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
public class ContactsController extends BaseController implements SearchView.OnQueryTextListener,
|
public class ContactsController extends BaseController implements SearchView.OnQueryTextListener,
|
||||||
FlexibleAdapter.OnItemClickListener, FastScroller.OnScrollStateChangeListener {
|
FlexibleAdapter.OnItemClickListener {
|
||||||
|
|
||||||
public static final String TAG = "ContactsController";
|
public static final String TAG = "ContactsController";
|
||||||
|
|
||||||
@ -137,9 +136,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
@BindView(R.id.swipe_refresh_layout)
|
@BindView(R.id.swipe_refresh_layout)
|
||||||
SwipeRefreshLayout swipeRefreshLayout;
|
SwipeRefreshLayout swipeRefreshLayout;
|
||||||
|
|
||||||
@BindView(R.id.fast_scroller)
|
|
||||||
FastScroller fastScroller;
|
|
||||||
|
|
||||||
@BindView(R.id.call_header_layout)
|
@BindView(R.id.call_header_layout)
|
||||||
RelativeLayout conversationPrivacyToogleLayout;
|
RelativeLayout conversationPrivacyToogleLayout;
|
||||||
|
|
||||||
@ -698,19 +694,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
|
swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary);
|
||||||
swipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.refresh_spinner_background);
|
swipeRefreshLayout.setProgressBackgroundColorSchemeResource(R.color.refresh_spinner_background);
|
||||||
|
|
||||||
fastScroller.addOnScrollStateChangeListener(this);
|
|
||||||
adapter.setFastScroller(fastScroller);
|
|
||||||
fastScroller.setBubbleTextCreator(position -> {
|
|
||||||
IFlexible abstractFlexibleItem = adapter.getItem(position);
|
|
||||||
if (abstractFlexibleItem instanceof UserItem) {
|
|
||||||
return ((UserItem) adapter.getItem(position)).getHeader().getModel();
|
|
||||||
} else if (abstractFlexibleItem instanceof GenericTextHeaderItem) {
|
|
||||||
return ((GenericTextHeaderItem) adapter.getItem(position)).getModel();
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
joinConversationViaLinkImageView
|
joinConversationViaLinkImageView
|
||||||
.getBackground()
|
.getBackground()
|
||||||
.setColorFilter(ResourcesCompat.getColor(getResources(), R.color.colorBackgroundDarker, null),
|
.setColorFilter(ResourcesCompat.getColor(getResources(), R.color.colorBackgroundDarker, null),
|
||||||
@ -819,10 +802,6 @@ public class ContactsController extends BaseController implements SearchView.OnQ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFastScrollerStateChange(boolean scrolling) {
|
|
||||||
swipeRefreshLayout.setEnabled(!scrolling);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void prepareAndShowBottomSheetWithBundle(Bundle bundle, boolean showEntrySheet) {
|
private void prepareAndShowBottomSheetWithBundle(Bundle bundle, boolean showEntrySheet) {
|
||||||
|
@ -122,7 +122,6 @@ import androidx.work.OneTimeWorkRequest;
|
|||||||
import androidx.work.WorkManager;
|
import androidx.work.WorkManager;
|
||||||
import autodagger.AutoInjector;
|
import autodagger.AutoInjector;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import eu.davidea.fastscroller.FastScroller;
|
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||||
import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager;
|
import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager;
|
||||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
||||||
@ -133,8 +132,7 @@ import retrofit2.HttpException;
|
|||||||
|
|
||||||
@AutoInjector(NextcloudTalkApplication.class)
|
@AutoInjector(NextcloudTalkApplication.class)
|
||||||
public class ConversationsListController extends BaseController implements SearchView.OnQueryTextListener,
|
public class ConversationsListController extends BaseController implements SearchView.OnQueryTextListener,
|
||||||
FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, FastScroller
|
FlexibleAdapter.OnItemClickListener, FlexibleAdapter.OnItemLongClickListener, ConversationMenuInterface {
|
||||||
.OnScrollStateChangeListener, ConversationMenuInterface {
|
|
||||||
|
|
||||||
public static final String TAG = "ConvListController";
|
public static final String TAG = "ConvListController";
|
||||||
public static final int ID_DELETE_CONVERSATION_DIALOG = 0;
|
public static final int ID_DELETE_CONVERSATION_DIALOG = 0;
|
||||||
@ -167,9 +165,6 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
@BindView(R.id.emptyLayout)
|
@BindView(R.id.emptyLayout)
|
||||||
RelativeLayout emptyLayoutView;
|
RelativeLayout emptyLayoutView;
|
||||||
|
|
||||||
@BindView(R.id.fast_scroller)
|
|
||||||
FastScroller fastScroller;
|
|
||||||
|
|
||||||
@BindView(R.id.floatingActionButton)
|
@BindView(R.id.floatingActionButton)
|
||||||
FloatingActionButton floatingActionButton;
|
FloatingActionButton floatingActionButton;
|
||||||
|
|
||||||
@ -588,23 +583,6 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
showNewConversationsScreen();
|
showNewConversationsScreen();
|
||||||
});
|
});
|
||||||
|
|
||||||
fastScroller.addOnScrollStateChangeListener(this);
|
|
||||||
adapter.setFastScroller(fastScroller);
|
|
||||||
|
|
||||||
fastScroller.setBubbleTextCreator(position -> {
|
|
||||||
String displayName;
|
|
||||||
if (shouldUseLastMessageLayout) {
|
|
||||||
displayName = ((ConversationItem) adapter.getItem(position)).getModel().getDisplayName();
|
|
||||||
} else {
|
|
||||||
displayName = ((CallItem) adapter.getItem(position)).getModel().getDisplayName();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (displayName.length() > 8) {
|
|
||||||
displayName = displayName.substring(0, 4) + "...";
|
|
||||||
}
|
|
||||||
return displayName;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (getActivity() != null && getActivity() instanceof MainActivity) {
|
if (getActivity() != null && getActivity() instanceof MainActivity) {
|
||||||
MainActivity activity = (MainActivity) getActivity();
|
MainActivity activity = (MainActivity) getActivity();
|
||||||
|
|
||||||
@ -755,11 +733,6 @@ public class ConversationsListController extends BaseController implements Searc
|
|||||||
return getResources().getString(R.string.nc_app_product_name);
|
return getResources().getString(R.string.nc_app_product_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFastScrollerStateChange(boolean scrolling) {
|
|
||||||
swipeRefreshLayout.setEnabled(!scrolling);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onItemClick(View view, int position) {
|
public boolean onItemClick(View view, int position) {
|
||||||
selectedConversation = getConversation(position);
|
selectedConversation = getConversation(position);
|
||||||
|
@ -53,11 +53,4 @@
|
|||||||
app:itemIconTint="@color/fg_default"
|
app:itemIconTint="@color/fg_default"
|
||||||
app:menu="@menu/file_browser_bottom" />
|
app:menu="@menu/file_browser_bottom" />
|
||||||
|
|
||||||
<include
|
|
||||||
layout="@layout/fast_scroller"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignTop="@id/recycler_view"
|
|
||||||
android:layout_alignBottom="@id/recycler_view" />
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -122,6 +122,4 @@
|
|||||||
app:srcCompat="@drawable/ic_add_white_24px"
|
app:srcCompat="@drawable/ic_add_white_24px"
|
||||||
app:tint="@color/white" />
|
app:tint="@color/white" />
|
||||||
|
|
||||||
<include layout="@layout/fast_scroller" />
|
|
||||||
|
|
||||||
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
</androidx.coordinatorlayout.widget.CoordinatorLayout>
|
||||||
|
@ -38,8 +38,6 @@
|
|||||||
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
|
|
||||||
<include layout="@layout/fast_scroller" />
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/recycler_view"
|
android:id="@+id/recycler_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
|
||||||
~ Nextcloud Talk application
|
|
||||||
~
|
|
||||||
~ @author Mario Danic
|
|
||||||
~ Copyright (C) 2017-2018 Mario Danic <mario@lovelyhq.com>
|
|
||||||
~
|
|
||||||
~ 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
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ at your option) any later version.
|
|
||||||
~
|
|
||||||
~ This program is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<eu.davidea.fastscroller.FastScroller xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
android:id="@+id/fast_scroller"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_alignTop="@+id/swipe_refresh_layout"
|
|
||||||
android:layout_alignBottom="@+id/swipe_refresh_layout"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
app:fastScrollerAutoHideDelayInMillis="1000"
|
|
||||||
app:fastScrollerAutoHideEnabled="true"
|
|
||||||
app:fastScrollerBubbleEnabled="true"
|
|
||||||
app:fastScrollerBubblePosition="adjacent"
|
|
||||||
app:fastScrollerIgnoreTouchesOutsideHandle="false"
|
|
||||||
tools:visibility="visible"></eu.davidea.fastscroller.FastScroller>
|
|
@ -1 +1 @@
|
|||||||
600
|
599
|
@ -1,2 +1,2 @@
|
|||||||
DO NOT TOUCH; GENERATED BY DRONE
|
DO NOT TOUCH; GENERATED BY DRONE
|
||||||
<span class="mdl-layout-title">Lint Report: 3 errors and 269 warnings</span>
|
<span class="mdl-layout-title">Lint Report: 3 errors and 266 warnings</span>
|
||||||
|
Loading…
Reference in New Issue
Block a user