Skip to content

Commit

Permalink
Fix the conflict with onItemClickListener.
Browse files Browse the repository at this point in the history
  • Loading branch information
SpecialCyCi committed May 30, 2014
1 parent a586191 commit 29f5847
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 0 additions & 2 deletions ResideMenu/src/com/special/ResideMenu/ResideMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,6 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
if(xOffset < -50 || xOffset > 50) {
pressedState = PRESSED_MOVE_HORIZANTAL;
ev.setAction(MotionEvent.ACTION_CANCEL);
lastRawX = ev.getRawX();
return true;
}
} else if(pressedState == PRESSED_MOVE_HORIZANTAL) {
if (currentActivityScaleX < 0.95)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.*;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -37,6 +35,12 @@ private void initView(){
android.R.layout.simple_list_item_1,
getCalendarData());
listView.setAdapter(arrayAdapter);
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Toast.makeText(getActivity(), "Clicked item!", Toast.LENGTH_LONG).show();
}
});
}

private ArrayList<String> getCalendarData(){
Expand Down

0 comments on commit 29f5847

Please sign in to comment.