-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
185 additions
and
28 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
PensieveSkeleton/mobile/src/main/java/com/example/gseyf/pensieveskeleton/DeleteTask.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.gseyf.pensieveskeleton; | ||
|
||
import android.app.Activity; | ||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Toast; | ||
|
||
/** | ||
* Created by david on 4/20/16. | ||
*/ | ||
public class DeleteTask extends Activity { | ||
private String TAG = "@>@>@>"; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.family_member_delete_action_activity); | ||
} | ||
|
||
public void goBack(View view){ | ||
Intent i = new Intent(DeleteTask.this, FamilyMemberMainActivity.class); | ||
startActivity(i); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
...keleton/mobile/src/main/java/com/example/gseyf/pensieveskeleton/OnSwipeTouchListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package com.example.gseyf.pensieveskeleton; | ||
|
||
/** | ||
* Created by david on 4/19/16. | ||
*/ | ||
|
||
import android.content.Context; | ||
import android.view.GestureDetector; | ||
import android.view.GestureDetector.SimpleOnGestureListener; | ||
import android.view.MotionEvent; | ||
import android.view.View; | ||
import android.view.View.OnTouchListener; | ||
|
||
public class OnSwipeTouchListener implements OnTouchListener { | ||
|
||
private final GestureDetector gestureDetector; | ||
|
||
public OnSwipeTouchListener(Context ctx){ | ||
gestureDetector = new GestureDetector(ctx, new GestureListener()); | ||
} | ||
|
||
@Override | ||
public boolean onTouch(View v, MotionEvent event) { | ||
return gestureDetector.onTouchEvent(event); | ||
} | ||
|
||
private final class GestureListener extends SimpleOnGestureListener { | ||
|
||
private static final int SWIPE_THRESHOLD = 100; | ||
private static final int SWIPE_VELOCITY_THRESHOLD = 100; | ||
|
||
@Override | ||
public boolean onDown(MotionEvent e) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { | ||
boolean result = false; | ||
try { | ||
float diffY = e2.getY() - e1.getY(); | ||
float diffX = e2.getX() - e1.getX(); | ||
if (Math.abs(diffX) > Math.abs(diffY)) { | ||
if (Math.abs(diffX) > SWIPE_THRESHOLD && Math.abs(velocityX) > SWIPE_VELOCITY_THRESHOLD) { | ||
if (diffX > 0) { | ||
onSwipeRight(); | ||
} else { | ||
onSwipeLeft(); | ||
} | ||
} | ||
result = true; | ||
} | ||
else if (Math.abs(diffY) > SWIPE_THRESHOLD && Math.abs(velocityY) > SWIPE_VELOCITY_THRESHOLD) { | ||
if (diffY > 0) { | ||
onSwipeBottom(); | ||
} else { | ||
onSwipeTop(); | ||
} | ||
} | ||
result = true; | ||
|
||
} catch (Exception exception) { | ||
exception.printStackTrace(); | ||
} | ||
return result; | ||
} | ||
} | ||
|
||
public void onSwipeRight() { | ||
} | ||
|
||
public void onSwipeLeft() { | ||
} | ||
|
||
public void onSwipeTop() { | ||
} | ||
|
||
public void onSwipeBottom() { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters