fix tab height in StartConversation screen

This commit is contained in:
Daniel Gultsch 2021-01-19 12:58:05 +01:00
parent 6e5240fe2e
commit 49d0558da1
2 changed files with 28 additions and 25 deletions

View file

@ -93,17 +93,17 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
public int conference_context_id; public int conference_context_id;
public int contact_context_id; public int contact_context_id;
private ListPagerAdapter mListPagerAdapter; private ListPagerAdapter mListPagerAdapter;
private List<ListItem> contacts = new ArrayList<>(); private final List<ListItem> contacts = new ArrayList<>();
private ListItemAdapter mContactsAdapter; private ListItemAdapter mContactsAdapter;
private List<ListItem> conferences = new ArrayList<>(); private final List<ListItem> conferences = new ArrayList<>();
private ListItemAdapter mConferenceAdapter; private ListItemAdapter mConferenceAdapter;
private List<String> mActivatedAccounts = new ArrayList<>(); private final List<String> mActivatedAccounts = new ArrayList<>();
private EditText mSearchEditText; private EditText mSearchEditText;
private AtomicBoolean mRequestedContactsPermission = new AtomicBoolean(false); private final AtomicBoolean mRequestedContactsPermission = new AtomicBoolean(false);
private AtomicBoolean mOpenedFab = new AtomicBoolean(false); private final AtomicBoolean mOpenedFab = new AtomicBoolean(false);
private boolean mHideOfflineContacts = false; private boolean mHideOfflineContacts = false;
private boolean createdByViewIntent = false; private boolean createdByViewIntent = false;
private MenuItem.OnActionExpandListener mOnActionExpandListener = new MenuItem.OnActionExpandListener() { private final MenuItem.OnActionExpandListener mOnActionExpandListener = new MenuItem.OnActionExpandListener() {
@Override @Override
public boolean onMenuItemActionExpand(MenuItem item) { public boolean onMenuItemActionExpand(MenuItem item) {
@ -132,7 +132,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
return true; return true;
} }
}; };
private TextWatcher mSearchTextWatcher = new TextWatcher() { private final TextWatcher mSearchTextWatcher = new TextWatcher() {
@Override @Override
public void afterTextChanged(Editable editable) { public void afterTextChanged(Editable editable) {
@ -148,7 +148,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
} }
}; };
private MenuItem mMenuSearchView; private MenuItem mMenuSearchView;
private ListItemAdapter.OnTagClickedListener mOnTagClickedListener = new ListItemAdapter.OnTagClickedListener() { private final ListItemAdapter.OnTagClickedListener mOnTagClickedListener = new ListItemAdapter.OnTagClickedListener() {
@Override @Override
public void onTagClicked(String tag) { public void onTagClicked(String tag) {
if (mMenuSearchView != null) { if (mMenuSearchView != null) {
@ -161,7 +161,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
}; };
private Pair<Integer, Intent> mPostponedActivityResult; private Pair<Integer, Intent> mPostponedActivityResult;
private Toast mToast; private Toast mToast;
private UiCallback<Conversation> mAdhocConferenceCallback = new UiCallback<Conversation>() { private final UiCallback<Conversation> mAdhocConferenceCallback = new UiCallback<Conversation>() {
@Override @Override
public void success(final Conversation conversation) { public void success(final Conversation conversation) {
runOnUiThread(() -> { runOnUiThread(() -> {
@ -181,7 +181,7 @@ public class StartConversationActivity extends XmppActivity implements XmppConne
} }
}; };
private ActivityStartConversationBinding binding; private ActivityStartConversationBinding binding;
private TextView.OnEditorActionListener mSearchDone = new TextView.OnEditorActionListener() { private final TextView.OnEditorActionListener mSearchDone = new TextView.OnEditorActionListener() {
@Override @Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
int pos = binding.startConversationViewPager.getCurrentItem(); int pos = binding.startConversationViewPager.getCurrentItem();

View file

@ -1,25 +1,29 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android" <layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"> xmlns:app="http://schemas.android.com/apk/res-auto">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<include android:id="@+id/toolbar"
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" /> layout="@layout/toolbar" />
<com.google.android.material.tabs.TabLayout <com.google.android.material.tabs.TabLayout
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
android:layout_below="@id/toolbar"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
android:background="?attr/colorPrimary" android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:elevation="@dimen/toolbar_elevation" android:elevation="@dimen/toolbar_elevation"
app:tabMode="fixed" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:tabGravity="fill" app:tabGravity="fill"
app:tabTextColor="@color/white70"
app:tabSelectedTextColor="@color/white"
app:tabIndicatorColor="@color/white87" app:tabIndicatorColor="@color/white87"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" /> app:tabMode="fixed"
app:tabSelectedTextColor="@color/white"
app:tabTextColor="@color/white70" />
<androidx.viewpager.widget.ViewPager <androidx.viewpager.widget.ViewPager
android:id="@+id/start_conversation_view_pager" android:id="@+id/start_conversation_view_pager"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -43,14 +47,13 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
app:backgroundTint="?colorPrimary"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
app:sdMainFabClosedSrc="@drawable/ic_add_white_24dp"
app:sdMainFabClosedBackgroundColor="?colorPrimary"
app:sdMainFabOpenedBackgroundColor="?colorPrimaryDark"
app:sdUseReverseAnimationOnClose="true"
android:contentDescription="@string/add_contact_or_create_or_join_group_chat" android:contentDescription="@string/add_contact_or_create_or_join_group_chat"
app:sdOverlayLayout="@id/overlay"/> app:backgroundTint="?colorPrimary"
app:sdMainFabClosedBackgroundColor="?colorPrimary"
app:sdMainFabClosedSrc="@drawable/ic_add_white_24dp"
app:sdMainFabOpenedBackgroundColor="?colorPrimaryDark"
app:sdOverlayLayout="@id/overlay"
app:sdUseReverseAnimationOnClose="true" />
</RelativeLayout> </RelativeLayout>
</layout> </layout>