Use CoordinatorLayout in task_list_activity

Fix clipping on android 2.x devices
pull/281/head
Alex Baker 11 years ago
parent 8d4ca3f185
commit 62e3f4ac21

@ -27,7 +27,7 @@ android {
buildToolsVersion "22.0.1"
defaultConfig {
versionCode 360
versionCode 361
versionName "4.7.11"
minSdkVersion 7
targetSdkVersion 22

@ -283,11 +283,11 @@ public class TaskListFragment extends InjectingListFragment implements OnSortSel
});
View body = getListBody(parent);
listView = (SwipeRefreshLayout) body.findViewById(R.id.swipe_layout);
emptyView = (SwipeRefreshLayout) body.findViewById(R.id.swipe_layout_empty);
emptyView = (SwipeRefreshLayout) parent.findViewById(R.id.swipe_layout_empty);
setupRefresh(listView);
setupRefresh(emptyView);
((ListView) listView.findViewById(android.R.id.list)).setEmptyView(emptyView);
parent.addView(body, 0);
((ViewGroup) parent.findViewById(R.id.task_list_body)).addView(body, 0);
return parent;
}

@ -3,9 +3,8 @@
**
** See the file "LICENSE" for the full license governing this code.
-->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/taskListParent"
android:background="?attr/asContentBackground"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
@ -14,19 +13,22 @@
android:focusableInTouchMode="true"
android:orientation="vertical">
<!-- Body goes here -->
<RelativeLayout
android:id="@+id/task_list_body"
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/task_list_swipe_layout_empty" />
</RelativeLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:src="?attr/fab_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="16dp"
android:layout_marginRight="16dp"
android:layout_marginEnd="16dp"
android:layout_gravity="end|bottom"
android:layout_margin="16dp"
app:borderWidth="0dp"/>
</RelativeLayout>
</android.support.design.widget.CoordinatorLayout>

@ -1,23 +1,12 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="100">
<android.support.v4.widget.SwipeRefreshLayout
<android.support.v4.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ListView
android:id="@android:id/list"
style="@style/ListView"
style="@style/TaskListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:paddingBottom="104dp"
android:clipToPadding="false"/>
android:layout_height="fill_parent"/>
</android.support.v4.widget.SwipeRefreshLayout>
<include layout="@layout/task_list_swipe_layout_empty" />
</RelativeLayout>

@ -1,24 +1,13 @@
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="100">
<org.tasks.ui.DraggableSwipeRefreshLayout
<org.tasks.ui.DraggableSwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/swipe_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<com.todoroo.astrid.ui.DraggableListView
android:id="@android:id/list"
style="@style/ListView"
style="@style/TaskListView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:drawSelectorOnTop="false"
android:paddingBottom="104dp"
android:clipToPadding="false" />
android:drawSelectorOnTop="false"/>
</org.tasks.ui.DraggableSwipeRefreshLayout>
<include layout="@layout/task_list_swipe_layout_empty" />
</RelativeLayout>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="TaskListView" parent="ListView">
<item name="android:paddingBottom">90dp</item>
<item name="android:clipToPadding">false</item>
</style>
</resources>

@ -142,6 +142,9 @@
<item name="android:smoothScrollbar">true</item>
</style>
<style name="TaskListView" parent="ListView">
</style>
<!-- =============================================== TaskEditActivity == -->
<style name="TEA_Dialog" parent="Theme.AppCompat.Light.Dialog">

Loading…
Cancel
Save