-
Notifications
You must be signed in to change notification settings - Fork 0
/
Test app
103 lines (70 loc) · 1.95 KB
/
Test app
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package com.example.sa;
import android.os.Bundle;
import android.app.Activity;
import android.text.Editable;
import android.text.method.KeyListener;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ScrollView;
public class MainActivity extends Activity implements KeyListener,OnClickListener{
ScrollView s,sx;
Button b1,b2;
int c=0;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
b1=(Button)findViewById(R.id.button1);
b2=(Button)findViewById(R.id.button2);
s=(ScrollView)findViewById(R.id.s1);
sx=(ScrollView)findViewById(R.id.s2);
b1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)
{
// TODO Auto-generated method stub
int y = s.getHeight();
s.smoothScrollBy(0, y);
c=c+y;
}
});
b2.setOnClickListener(new View.OnClickListener() {
public void onClick(View v)
{
// TODO Auto-generated method stub
int y = sx.getHeight();
sx.smoothScrollBy(c, y);
}
});
}
@Override
public void clearMetaKeyState(View arg0, Editable arg1, int arg2) {
// TODO Auto-generated method stub
}
@Override
public int getInputType() {
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean onKeyDown(View arg0, Editable arg1, int arg2, KeyEvent arg3) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean onKeyOther(View arg0, Editable arg1, KeyEvent arg2) {
// TODO Auto-generated method stub
return false;
}
@Override
public boolean onKeyUp(View arg0, Editable arg1, int arg2, KeyEvent arg3) {
// TODO Auto-generated method stub
return false;
}
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
}
}