mirror of
https://github.com/pierre42100/ComunicAndroid
synced 2024-12-28 14:39:00 +00:00
Removed useless class
This commit is contained in:
parent
523b30cc90
commit
b14c13d90e
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
@ -55,7 +55,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
@ -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;*/
|
||||
/* }*/
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.communiquons.android.comunic.client.ui.views.NestedListView android:id="@+id/posts_list"
|
||||
<ListView android:id="@+id/posts_list"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
Loading…
Reference in New Issue
Block a user