mirror of https://github.com/tasks/tasks
Remove "No Activity" from task edit screen
parent
658e12d6f5
commit
58d44d1aea
@ -1,42 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.ScrollView;
|
||||
|
||||
public class NestableScrollView extends ScrollView {
|
||||
private int[] scrollableViews = new int[0];
|
||||
|
||||
public NestableScrollView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent event) {
|
||||
if (scrollableViews != null) {
|
||||
for (int i = 0; i < scrollableViews.length; i++) {
|
||||
View view = findViewById(scrollableViews[i]);
|
||||
if (view != null) {
|
||||
Rect rect = new Rect();
|
||||
view.getHitRect(rect);
|
||||
if (rect.contains((int) event.getX(), (int) event.getY())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return super.onInterceptTouchEvent(event);
|
||||
}
|
||||
|
||||
public void setScrollabelViews(int[] views) {
|
||||
this.scrollableViews = views;
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
public class NestableViewPager extends ViewPager {
|
||||
|
||||
public NestableViewPager(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent horizontal scrolling
|
||||
*/
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2012 Todoroo Inc
|
||||
*
|
||||
* See the file "LICENSE" for the full license governing this code.
|
||||
*/
|
||||
package com.todoroo.astrid.ui;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.ListAdapter;
|
||||
import android.widget.ListView;
|
||||
|
||||
public class NestedListView extends ListView {
|
||||
private static final int MAXIMUM_LIST_ITEMS_VIEWABLE = 2;
|
||||
|
||||
|
||||
public NestedListView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
int newHeight = 0;
|
||||
final int heightMode = MeasureSpec.getMode(heightMeasureSpec);
|
||||
int heightSize = MeasureSpec.getSize(heightMeasureSpec);
|
||||
if (heightMode != MeasureSpec.EXACTLY) {
|
||||
ListAdapter listAdapter = getAdapter();
|
||||
if (listAdapter != null && !listAdapter.isEmpty()) {
|
||||
int listPosition = 0;
|
||||
for (listPosition = 0; listPosition < listAdapter.getCount()
|
||||
&& listPosition < MAXIMUM_LIST_ITEMS_VIEWABLE; listPosition++) {
|
||||
View listItem = listAdapter.getView(listPosition, null,
|
||||
this);
|
||||
listItem.measure(widthMeasureSpec, heightMeasureSpec);
|
||||
newHeight += listItem.getMeasuredHeight();
|
||||
}
|
||||
newHeight += getDividerHeight() * listPosition;
|
||||
}
|
||||
if ((heightMode == MeasureSpec.AT_MOST) && (newHeight > heightSize)) {
|
||||
if (newHeight > heightSize) {
|
||||
newHeight = heightSize;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
newHeight = getMeasuredHeight();
|
||||
}
|
||||
setMeasuredDimension(getMeasuredWidth(), newHeight);
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
#Wed Sep 25 08:24:47 CDT 2013
|
||||
#Sat Sep 28 02:39:06 CDT 2013
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-bin.zip
|
||||
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip
|
||||
|
Loading…
Reference in New Issue