Better alignment for bottom toolbar in chapters fragment

This commit is contained in:
inorichi 2015-12-11 13:50:47 +01:00
parent 5fda4ad786
commit ed5486975d
2 changed files with 59 additions and 69 deletions

View File

@ -8,7 +8,6 @@ import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.view.ActionMode;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
@ -46,7 +45,7 @@ public class ChaptersFragment extends BaseRxFragment<ChaptersPresenter> implemen
@Bind(R.id.chapter_list) RecyclerView recyclerView;
@Bind(R.id.swipe_refresh) SwipeRefreshLayout swipeRefresh;
@Bind(R.id.toolbar_bottom) Toolbar toolbarBottom;
@Bind(R.id.toolbar_bottom) ViewGroup toolbarBottom;
@Bind(R.id.action_sort) ImageView sortBtn;
@Bind(R.id.action_next_unread) ImageView nextUnreadBtn;

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
@ -15,8 +14,8 @@
<android.support.v7.widget.RecyclerView
android:id="@+id/chapter_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:descendantFocusability="blocksDescendants"
@ -27,84 +26,76 @@
</android.support.v4.widget.SwipeRefreshLayout>
<android.support.v7.widget.Toolbar
<RelativeLayout
android:id="@+id/toolbar_bottom"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:layout_alignParentBottom="true"
android:background="@color/colorPrimary"
android:elevation="4dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:gravity="top|start"
android:theme="@style/ThemeOverlay.AppTheme.Dark"
app:popupTheme="@style/AppTheme.Popup">
android:theme="@style/ThemeOverlay.AppTheme.Dark">
<RelativeLayout
<ImageView
android:id="@+id/action_sort"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:background="?android:selectableItemBackground"
android:title="@string/action_sort_up"
tools:src="@drawable/ic_expand_less_white_36dp"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginRight="4dp">
android:layout_toEndOf="@+id/action_sort"
android:layout_toLeftOf="@+id/action_next_unread"
android:layout_toRightOf="@+id/action_sort"
android:gravity="center_vertical">
<ImageView
android:id="@+id/action_sort"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_gravity="center"
android:background="?android:selectableItemBackground"
android:title="@string/action_sort_up"
tools:src="@drawable/ic_expand_less_white_36dp"
/>
<LinearLayout
android:layout_width="match_parent"
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_toEndOf="@+id/action_sort"
android:layout_toLeftOf="@+id/action_next_unread"
android:layout_toRightOf="@+id/action_sort"
android:gravity="center_vertical">
android:layout_margin="10dp"
android:background="@color/white"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="@color/white"/>
<CheckBox
android:id="@+id/action_show_unread"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
android:checkable="true"
android:text="@string/action_show_unread"
android:title="@string/action_show_unread"/>
<CheckBox
android:id="@+id/action_show_downloaded"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_weight="1"
android:checkable="true"
android:text="@string/action_show_downloaded"
android:title="@string/action_show_downloaded"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="@color/white"/>
</LinearLayout>
<ImageView
android:id="@+id/action_next_unread"
<CheckBox
android:id="@+id/action_show_unread"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:background="?android:selectableItemBackground"
android:src="@drawable/ic_play_arrow_white_36dp"
android:title="@string/action_next_unread"
/>
</RelativeLayout>
</android.support.v7.widget.Toolbar>
android:layout_height="match_parent"
android:layout_weight="1"
android:checkable="true"
android:text="@string/action_show_unread"
android:title="@string/action_show_unread"/>
<CheckBox
android:id="@+id/action_show_downloaded"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:checkable="true"
android:text="@string/action_show_downloaded"
android:title="@string/action_show_downloaded"/>
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_margin="10dp"
android:background="@color/white"/>
</LinearLayout>
<ImageView
android:id="@+id/action_next_unread"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="?android:selectableItemBackground"
android:src="@drawable/ic_play_arrow_white_36dp"
android:title="@string/action_next_unread"/>
</RelativeLayout>
</RelativeLayout>