From b14c13d90eafe423dec7a7f8bae2018a868e5eb7 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 7 Apr 2018 16:48:24 +0200 Subject: [PATCH] Removed useless class --- .idea/misc.xml | 2 +- .../client/ui/views/NestedListView.java | 98 ------------------- .../main/res/layout/fragment_postslist.xml | 2 +- 3 files changed, 2 insertions(+), 100 deletions(-) delete mode 100644 app/src/main/java/org/communiquons/android/comunic/client/ui/views/NestedListView.java diff --git a/.idea/misc.xml b/.idea/misc.xml index 33952c6..503aca7 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -55,7 +55,7 @@ - + diff --git a/app/src/main/java/org/communiquons/android/comunic/client/ui/views/NestedListView.java b/app/src/main/java/org/communiquons/android/comunic/client/ui/views/NestedListView.java deleted file mode 100644 index 85924f6..0000000 --- a/app/src/main/java/org/communiquons/android/comunic/client/ui/views/NestedListView.java +++ /dev/null @@ -1,98 +0,0 @@ -package org.communiquons.android.comunic.client.ui.views; - -import android.content.Context; -import android.util.AttributeSet; -import android.widget.ListView; - -/** - * Nested ListView class - * - * @from https://stackoverflow.com/a/17503823 - * @author Muhammad Aamir Ali - * @author Pierre HUBERT - */ - -public class NestedListView extends ListView /*implements View.OnTouchListener, AbsListView.OnScrollListener*/ { - - /*/** - * Debug tag - *//* - private static final String TAG = "NestedListView"; - - private int listViewTouchAction; - private static final int MAXIMUM_LIST_ITEMS_VIEWABLE = 99; - - - private int lastItemCounted = 0; - private int itemsHeight = 2;*/ - - - public NestedListView(Context context, AttributeSet attrs) { - super(context, attrs); - /*listViewTouchAction = -1; - setOnScrollListener(this); - setOnTouchListener(this);*/ - } - - /*@Override - public void onScroll(AbsListView view, int firstVisibleItem, - int visibleItemCount, int totalItemCount) { - - /*if (getAdapter() != null && getAdapter().getCount() > MAXIMUM_LIST_ITEMS_VIEWABLE) { - if (listViewTouchAction == MotionEvent.ACTION_MOVE) { - scrollBy(0, -1); - } - }*//* - } - - @Override - public void onScrollStateChanged(AbsListView view, int scrollState) { - } - - - @Override - protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { - super.onMeasure(widthMeasureSpec, heightMeasureSpec); - - if(getAdapter() == null) - return; - - /*View view = null; - - for(int i = lastItemCounted; i < getLastVisiblePosition() || i < 2; i++){ - if(getAdapter().getCount() < i+1) - break; - - view = getAdapter().getView(i, view, this); - - view.measure(widthMeasureSpec, heightMeasureSpec); - itemsHeight += view.getMeasuredHeight(); - - lastItemCounted++; - } - - //Add average height for the remaining items - itemsHeight += (lastItemCounted - getAdapter().getCount() + 1)*(itemsHeight/(lastItemCounted+1)); - - setMeasuredDimension(getMeasuredWidth(), itemsHeight);*//* - - - - //setMeasuredDimension(getMeasuredWidth(), 700); - - } - - @Override - public boolean onTouch(View v, MotionEvent event) { - - /*if (getAdapter() != null && getAdapter().getCount() > MAXIMUM_LIST_ITEMS_VIEWABLE) { - if (listViewTouchAction == MotionEvent.ACTION_MOVE) { - scrollBy(0, 1); - } - } - //return false;*/ - /* Log.v(TAG, "scroll:" ); - v.getParent().requestDisallowInterceptTouchEvent(false); - return false;*/ - /* }*/ -} \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_postslist.xml b/app/src/main/res/layout/fragment_postslist.xml index f9c9fe7..e29fecf 100644 --- a/app/src/main/res/layout/fragment_postslist.xml +++ b/app/src/main/res/layout/fragment_postslist.xml @@ -1,5 +1,5 @@ -