diff --git a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java index 072cef066..01d63d564 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/CallsListController.java @@ -29,6 +29,8 @@ import android.support.annotation.Nullable; import android.support.design.widget.BottomNavigationView; import android.support.v4.view.MenuItemCompat; import android.support.v4.widget.SwipeRefreshLayout; +import android.support.v7.widget.DividerItemDecoration; +import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; import android.text.InputType; @@ -279,16 +281,20 @@ public class CallsListController extends BaseController implements SearchView.On } private void prepareViews() { - recyclerView.setLayoutManager(new SmoothScrollLinearLayoutManager(getActivity())); + LinearLayoutManager layoutManager = new SmoothScrollLinearLayoutManager(getActivity()); + recyclerView.setLayoutManager(layoutManager); recyclerView.setHasFixedSize(true); recyclerView.setAdapter(adapter); - recyclerView.addItemDecoration(new FlexibleItemDecoration(getActivity()) - .withDivider(R.drawable.divider)); + RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecoration( + recyclerView.getContext(), + layoutManager.getOrientation() + ); + recyclerView.addItemDecoration(dividerItemDecoration); swipeRefreshLayout.setOnRefreshListener(() -> fetchData(true)); - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.colorPrimary)); + swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); } private void dispose(@Nullable Disposable disposable) { diff --git a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java index 8ce1a5c38..a96e04046 100644 --- a/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java +++ b/app/src/main/java/com/nextcloud/talk/controllers/ContactsController.java @@ -29,6 +29,8 @@ import android.support.annotation.Nullable; import android.support.design.widget.BottomNavigationView; import android.support.v4.view.MenuItemCompat; import android.support.v4.widget.SwipeRefreshLayout; +import android.support.v7.widget.DividerItemDecoration; +import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SearchView; import android.text.InputType; @@ -69,7 +71,6 @@ import javax.inject.Inject; import autodagger.AutoInjector; import butterknife.BindView; import eu.davidea.flexibleadapter.FlexibleAdapter; -import eu.davidea.flexibleadapter.common.FlexibleItemDecoration; import eu.davidea.flexibleadapter.common.SmoothScrollLinearLayoutManager; import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.disposables.Disposable; @@ -327,15 +328,19 @@ public class ContactsController extends BaseController implements SearchView.OnQ } private void prepareViews() { - recyclerView.setLayoutManager(new SmoothScrollLinearLayoutManager(getActivity())); + LinearLayoutManager layoutManager = new SmoothScrollLinearLayoutManager(getActivity()); + recyclerView.setLayoutManager(layoutManager); recyclerView.setHasFixedSize(true); recyclerView.setAdapter(adapter); - recyclerView.addItemDecoration(new FlexibleItemDecoration(getActivity()) - .withDivider(R.drawable.divider)); + RecyclerView.ItemDecoration dividerItemDecoration = new DividerItemDecoration( + recyclerView.getContext(), + layoutManager.getOrientation() + ); + recyclerView.addItemDecoration(dividerItemDecoration); swipeRefreshLayout.setOnRefreshListener(() -> fetchData(true)); - swipeRefreshLayout.setProgressBackgroundColorSchemeColor(getResources().getColor(R.color.colorPrimary)); + swipeRefreshLayout.setColorSchemeResources(R.color.colorPrimary); } private void dispose(@Nullable Disposable disposable) { diff --git a/app/src/main/res/drawable/divider.xml b/app/src/main/res/drawable/divider.xml deleted file mode 100644 index 0d9702995..000000000 --- a/app/src/main/res/drawable/divider.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - \ No newline at end of file