public ListViewSwipeGesture(ListView listView, TouchCallbacks Callbacks, Activity context) { ViewConfiguration vc = ViewConfiguration.get(listView.getContext()); mSlop = vc.getScaledTouchSlop(); mMinFlingVelocity = vc.getScaledMinimumFlingVelocity() * 16; mMaxFlingVelocity = vc.getScaledMaximumFlingVelocity(); mListView = listView; activity = context; tcallbacks = Callbacks; SwipeType = Double; GetResourcesValues(); mListView.setOnItemClickListener( new AdapterView.OnItemClickListener() { @Override public void onItemClick( AdapterView<?> arg0, View arg1, int arg2, long arg3) { // Invokes OnClick Functionality if (!moptionsDisplay && DeltaX == 0.0) { tcallbacks.OnClickListView(temp_position); } else { if (old_mDownView != null && mDownView != old_mDownView) { ResetListItem(old_mDownView); old_mDownView = null; mDownView = null; } } } }); }
private void GetResourcesValues() { mAnimationTime = mListView.getContext().getResources().getInteger(android.R.integer.config_shortAnimTime); HalfColor = RangeOneColor; // Green FullColor = activity.getResources().getString(R.string.str_red); // Orange HalfText = activity.getResources().getString(R.string.basic_action_1); HalfTextFinal = activity.getResources().getString(R.string.basic_action_1); FullText = activity.getResources().getString(R.string.basic_action_2); FullTextFinal = activity.getResources().getString(R.string.basic_action_2); // HalfDrawable = activity.getResources().getDrawable( R.drawable.rating_good ); // FullDrawable = // activity.getResources().getDrawable(R.drawable.content_discard); }