Comments (7)
- For the rightmost you can ask to
getActualScrollX()
(I increase its visibility in 78d689f) For the leftmost istable.getActualScrollX() - table.getWidth() - adapter.getWidth(-1);
- That feature isn't implemented.
from tablefixheaders.
When scrolling a little feeling of vertigo,i think it should scroll should be only in one direction, i am doing some changes.
private int downX, downY;
private boolean direction;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN: {
if (!flinger.isFinished()) { // If scrolling, then stop now
flinger.forceFinished();
}
currentX = (int) event.getRawX();
currentY = (int) event.getRawY();
downX = currentX;
downY = currentY;
break;
}
case MotionEvent.ACTION_MOVE: {
final int x2 = (int) event.getRawX();
final int y2 = (int) event.getRawY();
final int diffX = currentX - x2;
final int diffY = currentY - y2;
currentX = x2;
currentY = y2;
direction = Math.abs(downX - x2) > Math.abs(downY - y2);
if (direction) {
scrollBy(diffX, 0);
} else {
scrollBy(0, diffY);
}
break;
}
case MotionEvent.ACTION_UP: {
final VelocityTracker velocityTracker = this.velocityTracker;
velocityTracker.computeCurrentVelocity(1000, maximumVelocity);
int velocityX = (int) velocityTracker.getXVelocity();
int velocityY = (int) velocityTracker.getYVelocity();
if (Math.abs(velocityX) > minimumVelocity || Math.abs(velocityY) > minimumVelocity) {
if (direction) {
flinger.start(getActualScrollX(), getActualScrollY(), velocityX, 0, getMaxScrollX(), getMaxScrollY());
} else {
flinger.start(getActualScrollX(), getActualScrollY(), 0, velocityY, getMaxScrollX(), getMaxScrollY());
}
} else {
if (this.velocityTracker != null) { // If the velocity less than threshold
this.velocityTracker.recycle(); // recycle the tracker
this.velocityTracker = null;
}
}
break;
}
from tablefixheaders.
I think that a better option is see the angle of the movement. If it is around 0 or 90 degrees you would activeate only vertical or horizontal scroll for all this tap. Else you would keep the two directions scroll.
I think that with this solution the vertigo is gone and the double scroll feature remains.
from tablefixheaders.
@liujmok , do you solve the problems with the EditText
s? Is there a bug or only a problem with your implementation?
from tablefixheaders.
Not a bug, my mistake. because i attempt to modify TableFixedHeaders scroll and use EditText.
The controls is good.
If problems are found, I will feedback to you.
from tablefixheaders.
Hi BraisGabin,
Whether the control can provide some rolling method, or tell me how to achieve?
1.scrollToBottom
2.scrollToRight
Thanks.
from tablefixheaders.
scrollToRight: getMaxScrollX() - getActualScrollX()
scrollToBottom: getMaxScrollY() - getActualScrollY()
And, please, if you write about a new topic open a new Issue.
from tablefixheaders.
Related Issues (20)
- How can i use it in a CoordinatorLayout HOT 1
- How can scroll in viewpage when columns stop scrolling HOT 4
- how to remove first column on fix hader HOT 2
- can i set header on image
- java.lang.NullPointerException: at com.inqbarna.tablefixheaders.TableFixHeaders.scrollBounds (TableFixHeaders.java:630) HOT 2
- Want to inflate more than one values in one column
- Issue with UI Thread block HOT 1
- search value in TableFixHeaders
- How to pass model array list to MatrixTableAdapter HOT 6
- How to insert data from api HOT 1
- Scroll issue when i put TableFixHeaders view inside a ScrollView/NestedScrollView HOT 2
- Text Color
- Not running in Tablet HOT 4
- Invalid content set in cell(view) during scrolling up,down or right, left...
- How to adapt the row height by context?
- How to set section header is aligned center on table? HOT 2
- Why does the table get inside the screen? HOT 5
- Android 9.0 landscape will crash
- after horizontal scrolling content get reset HOT 1
- Unable to use the lib
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tablefixheaders.