Android :: Scrolling Direction And Velocity
Jul 8, 2010Is there an easy to know the direction of scroll (up or down for a vertical list) and the scroll velocity for ListView's?

Is there an easy to know the direction of scroll (up or down for a vertical list) and the scroll velocity for ListView's?
Scrolling on an Android phone makes sense because it's like you're physically sliding the page upwards. However, now that I'm used to doing that, when I get on my laptop and start to scroll with my touchpad, sometimes I find myself scrolling the wrong direction. On a touchpad you drag downwards to go down on the page, or to slide the page upwards. So it's backwards from the motion you would make on your phone.
View 17 Replies View RelatedI want to ask that is that possible do in android catch the in the touch mode catch the scrolling direction ? When user touch on the screen left to right, can I catch the change ?
If it is possible which listener can ı use ?
I found some of the methods and listeners but I 'm not sure that therse are represent my requirement .
http://developer.android.com/reference/android/text/method/Touch.html
Public Methods
static int getInitialScrollX(TextView widget, Spannable buffer)
static int getInitialScrollY(TextView widget, Spannable buffer)
I want to ask that is that possible do in android catch the in the touch mode catch the scrolling direction ? When user touch on the screen left to right, can I catch the change ? If it is possible which listener can ı use ?
I found some of the methods and listeners but I 'm not sure that therse are represent my requirement . http://developer.android.com/reference/android/text/method/Touch.html
Public Methods static int getInitialScrollX(TextView widget, Spannable buffer) static int getInitialScrollY(TextView widget, Spannable buffer)
Ok, the family has Allys I am trying to convince them to let me flash Velocity to their phones, But they think I will kill their phones. Would there be a good noticeable speed difference, Battery life? Any other odd perks I can use to convince them?
Cause they are always complaining about how it is slow.
Does anybody know if there is an application for Doppler radar or base velocity? I know stuff like weatherbug have radar but it doesn't have base velocity...anybody know of anything?
View 8 Replies View RelatedWhat is the easiest way to find out how fast the Android device is traveling?
Also, is there a way to register an intent for speed? Example: intent if the device goes more than 20 miles an hour.
Every one can any body explain to me how I can get direction in Htc desire ,cause when I ask about any direction or end point always the answer is no route.
View 6 Replies View RelatedWhere can I find that exact flashlight app that is in Velocity 0.3? When I look in the market, there are TONS of them and most of them only make the touch screen turn bright.P.S. I did have Velocity 0.3, but went back to just a stock rom with Universal Androot. Google maps, which I actually use a lot, was being very slow and buggy for me.
View 5 Replies View RelatedI just compiled a very small theme to test the waters. Its basically only an edit of the status bar, battery icon, browser background, and for no reason what so ever made the gtalk icon grey scale.Like I said, testing the waters here and only did a tiny bit of modifying. When Velocity 0.2 comes out I will be making a more detailed theme. This is just something to throw on your rom while you wait.Note: This will not completely replace your current theme if you have one. This theme will work best when installed on the stock theme.Beautiful Widgets and launcherpro not included.
View 8 Replies View RelatedSo with 2 ROM's out now everybody want's to know the "under-the-hood" benefits of both ROM's. Both Velocity and Raptor report 6.8 MFLOPS with Linpack, no OC, just the Turbo. Testing battery on both, will let you guys know tomorrow.
-ILL RUN SOME SERIOUS STRESS TESTS ON BOTH ROM'S TO SEE WHICH ONE CAN HANDLE MORE RESOURCE USE BEFORE A BUNCH OF FORCE CLOSES POP-UP OR PHONE STARTS FREEZING.
My opinion: In my opinion Velocity is snappier but I'll post more on this by tomorrow so check back!
I have the haptic feedback enabled and it works for everything that I have used except the virtual keyboard.
I'm wondering if anyone else has this issue. I have the OC kernel as well set at 729/245.
I've been playing with the data given by the accelerometer,trying to work out how I can gauge a shake from front to back or side to side. This all seems straightforward enough.But I'd love to know the direction of the shake. So, if the user is shaking backwards and forwards, I want to know if the device is moving away from the user, or back towards him/her. I can't find any way of telling this.
View 6 Replies View RelatedI want to show the direction information in my app.Direction from one address to the another using Google maps and also wanted to set overlays at the starting address and the destination address.Is there any classes in android too do that.
View 5 Replies View RelatedI am creating a class extending mylocationoverlay. then, i override the draw method. is this the correct method? because after i rewrote the draw method, the map tile cannot render.
View 4 Replies View RelatedI'm trying to create a compass for my application BUT the difference is that, instead of having a line always pointing to north, I want this line to point for a specific point. I've been trying dozens of algorithms and nothing works. I've finally found one that points me exactlly to the point I want. But it doesn't move if I change the position of the device which is my objective. Basically, what I want is that no matter the direction I'm using my device. The line always point me to the point (picLatitude,picLongitude). I understood that for the line to move, I can't use static variables. I need to use the values offered by the onSensorChanged(SensorEvent event). This are the data I have available:
event.values[0]: azimuth, rotation around the Z axis (device in relation to north, 0º) event.values[1]: pitch, rotation around the X axis event.values[2]: roll, rotation around the Y axis mLatitude: device current latitude got from GPS (variable) mLongitude: device current longitude got from GPS (variable) picLatitude: static picture latitude established previously picLongitude: static picture longitude established previously distance: distance in Km from device to the picture calculated previously
And this the formula that works correct, and gives me the correct angle. (But it doesn't use any of the Sensor Data so the line Compass doesn't move):
double dLong = picLongitude - mLongitude; double y = (Math.sin(dLong) *
Math.cos(picLatitude)); double x = (Math.cos(mLatitude) * Math.sin(picLatitude) - Math.sin(mLatitude)*Math.cos(picLatitude)*Math.cos(dLong)); double angleDegreesWrongRange = Math.abs(Math.toDegrees(Math.atan2(y, x))); float angleDegrees = (float) ((angleDegreesWrongRange+360) % 360);
myCompass.updateDirection(angleDegrees);
I got this "bearing" formula from this website: http://www.movable-type.co.uk/scripts/latlong.html. I've try adding, subtracting, the azimuth.. I've tried with the others, seriously at this point I'm just demoralized.
Is there any way to find the direction between two locations in Android?
View 3 Replies View RelatedI have my lg Ally with the new Jit kernel (Thanks Drellisdee), with Velocity 0.2 (Thanks Trident) and am overclocking at 768 mhz. I want to apply the new update, VZB, and then put velocity and the jit kernel back. So my thoughts are that I would have to...
1.) Backup rom/Apps/Data (Titanium Backup/ROM Manager)
2.) Go into Recovery (Clockworkmod) and make a nendroid backup.
3.) Wipe Dalvik, data, and cache.
4.) Install vzb via Drellisdee's rooted update (After i check md5)
5.) Then Apply Velocity 0.2
6.) Apply the kernel
7.) Restore data from titanium backup...
Is this what I would do? What about the ally's unofficial "V9" update that has to be installed manually... Is that worth it or should I just do VZB?
Also, do I need to go to a stock rom proior to the update?
I'm trying to figure out how to get Velocity on my LG Ally, and I was wondering if anyone could help me out. Could someone post a link for instructions?
View 4 Replies View RelatedI want to switch from raptor back to velocity .3. except that after putting raptor on i downloaded a new kernel. Can I put velocity on with the kernel I have now or do I have to change it to one from the velocity post? and if I do have to change it, do I change it before or after changing the rom to velocity?
View 7 Replies View RelatedThe Kindle app doesn't work in Velocity 0.3. It worked fine in stock ROM. I can download a book but when I try to read it, I get an error that it can't open the book. This happens with books I have on my archive list as well as new downloads.
View 5 Replies View RelatedSo I did a test for Velocity ROM and I currently have the fastest LG Ally, check it out: Linpack by Device GreeneComputing
Trident thanks for the ROM this just shows that it does magic to your phone!
I am trying to change my wallpaper, although every time I check a new wallpaper nothing happens it stays the same, any help?
View 5 Replies View RelatedI am wondering whether it is possible to detect voice direction in android or not? For example on nexus one using the actual mic and the noise cancellation mic or using any other method?
View 4 Replies View RelatedI need to know if there is an interface to access the direction in which the phone is pointing.
View 2 Replies View RelatedI'm trying to implement something that I don't even know if it's possible. So I have this class which implements a SensorEventListener like this:
private SensorEventListener mySensorEventListener = new SensorEventListener(){
@Override public void onAccuracyChanged(Sensor sensor, int accuracy) {
} @Override public void onSensorChanged(SensorEvent event) {
myCompass.updateDirection((float)event.values[0]); } };
And a class that handles the way the compass looks like this:
public static class compassLook extends View {
private Paint paintPointer = new Paint(Paint.ANTI_ALIAS_FLAG);
private Paint paintCircle = new Paint(Paint.ANTI_ALIAS_FLAG);
private Paint paintLeters = new Paint(Paint.ANTI_ALIAS_FLAG);
private boolean firstDraw; private float direction = 0 ;
public compassLook(Context context) { super(context); init();
} public compassLook(Context context, AttributeSet attrs) { super(context, attrs); init();
} public compassLook(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle); init(); } private void init(){
paintPointer.setStyle(Paint.Style.STROKE); paintPointer.setStrokeWidth(3);
paintPointer.setColor(Color.argb(255, 209, 114, 2)); paintCircle.setStyle(Paint.Style.STROKE);
paintCircle.setStrokeWidth(2); paintCircle.setColor(Color.argb(150, 255, 255, 255));
paintLeters.setStyle(Paint.Style.STROKE); paintLeters.setStrokeWidth(1);
paintLeters.setColor(Color.argb(230, 255, 255, 255)); paintLeters.setTextSize(12);
firstDraw = true; } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec),
MeasureSpec.getSize(heightMeasureSpec)); } @Override protected void onDraw(Canvas canvas) {
int cxCompass = (getMeasuredWidth()/2); int cyCompass = (getMeasuredHeight()/2);
float radiusCompass; if(cxCompass > cyCompass){ radiusCompass = (float) (cyCompass * 0.9);
} else{ radiusCompass = (float) (cxCompass * 0.9);}
canvas.drawCircle(cxCompass-50, cyCompass, radiusCompass, paintCircle);
if(!firstDraw){ // Desenho da linha que aponta canvas.drawLine(cxCompass-50, cyCompass,
(float)(cxCompass-50 + radiusCompass * Math.sin((double)(- direction) * 3.14/180)),
(float)(cyCompass - radiusCompass * Math.cos((double)(-direction) * 3.14/180)),
paintPointer); double mLatitude = (mLocation.getLatitude() / 1E6);
// I get this value from a LM request double mLongitude = (mLocation.getLongitude() / 1E6);
// I get this value from a LM request double picLatitude= Double.parseDouble(picLatitudeString);
// I get this value from a bundle double picLongitude = Double.parseDouble(picLongitudeString);
// I get this value from a bundle float direction = (float)
Math.toDegrees(Math.atan2(picLongitude- mLongitude, picLatitude-mLatitude));
float distancia = (float) (Math.sqrt(Math.pow(mLatitude- picLatitude,
2) + Math.pow(mLongitude-picLongitude,2)))/2;
//Desenho do texto que indica a distancia
canvas.drawText(String.valueOf(distancia) + "Km", cxCompass-30,
cyCompass+20, paintLeters); } } public void updateDirection(float dir)
{ firstDraw = false; direction = dir; invalidate(); } }
My current app flies in a sub activity when you flick-up. Problem is, it flies in horizontally from the right. I want it to fly in vertically from the bottom to match the flick direction. I'm sure this must be an xml property somewhere, but I can't find it. Does someone have a pointer as to how to set this?
View 10 Replies View RelatedI am using Tablet skin for running emulator output. All the menu and list items are displayed properly e.g. Horizontally whereas Videos are being played vertically. How can I change the direction of video? Kindly reply as soon as possible.
View 2 Replies View RelatedHow to play video in a time reversed direction? The requirement is to loop playing forward and backward repeatedly.
View 7 Replies View RelatedI want to show the direction on the screen that phone is facing.
For example:
0
|- []
|_
South --- North
In the above diagram the phone would display "North". Since the user (the stick with 0 for his head) is holding out the phone (the [] in the diagram) pointing north.
I found this example. I understand what it's doing except it seems to calculate yaw, pitch, roll, and inclination. What are those and how would I use them to simply find which way the phone is pointing?
Also this android documentation mentions X, Y, and Z axises but I don't see anywhere that says how those axises correspond to the phone? Is Z going from the bottom of the phone to the top?