@@ -91,7 +91,7 @@ protected void onCreate(Bundle savedInstanceState) {
91
91
Button bottomButton = findViewById (R .id .bottomButton );
92
92
Button leftButton = findViewById (R .id .leftButton );
93
93
Button rightButton = findViewById (R .id .rightButton );
94
- HorizontalScrollView scroll = findViewById (R .id .scroll );
94
+ LinearLayout linearLayout2 = findViewById (R .id .scrollvv );
95
95
scroll .fullScroll (View .FOCUS_DOWN );
96
96
WebView webView = findViewById (R .id .webview );
97
97
webView .getSettings ().setJavaScriptEnabled (true );
@@ -108,30 +108,35 @@ public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request
108
108
topButton .setOnClickListener (new View .OnClickListener () {
109
109
@ Override
110
110
public void onClick (View v ) {
111
- scroll .scrollTo (0 , 0 ); // Scroll to left
111
+ // Scroll to the top
112
+ scroll .fullScroll (View .FOCUS_UP );
112
113
}
113
114
});
114
115
115
116
bottomButton .setOnClickListener (new View .OnClickListener () {
116
117
@ Override
117
118
public void onClick (View v ) {
118
- scroll .scrollTo (0 , scroll .getChildAt (0 ).getHeight ()); // Scroll to right
119
+ // Scroll to the bottom
120
+ scroll .fullScroll (View .FOCUS_DOWN );
119
121
}
120
122
});
121
123
122
124
leftButton .setOnClickListener (new View .OnClickListener () {
123
125
@ Override
124
126
public void onClick (View v ) {
125
- scroll .scrollTo (0 , 0 ); // Scroll to top
127
+ // Scroll to the left
128
+ scroll .fullScroll (View .FOCUS_LEFT );
126
129
}
127
130
});
128
131
129
132
rightButton .setOnClickListener (new View .OnClickListener () {
130
133
@ Override
131
134
public void onClick (View v ) {
132
- scroll .scrollTo (scroll .getChildAt (0 ).getWidth (), 0 ); // Scroll to bottom
135
+ // Scroll to the right
136
+ scroll .fullScroll (View .FOCUS_RIGHT );
133
137
}
134
138
});
139
+
135
140
Button soundButton = findViewById (R .id .soundButton );
136
141
soundButton .setOnClickListener (v -> {
137
142
// Créer une boîte de dialogue avec trois options
0 commit comments