-
Notifications
You must be signed in to change notification settings - Fork 451
/
Copy pathGearboxActivity.java
47 lines (36 loc) · 1.52 KB
/
GearboxActivity.java
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
package com.nightonke.wowoviewpagerexample;
import android.os.Bundle;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.SeekBar;
import com.nightonke.wowoviewpager.Enum.Gearbox;
import com.nightonke.wowoviewpager.Enum.WoWoGearbox;
public class GearboxActivity extends GuidePageActivity1 {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
RelativeLayout base = (RelativeLayout) findViewById(R.id.base);
SeekBar seekBar = new SeekBar(this);
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT);
layoutParams.setMargins(0, 0, 0, 20);
layoutParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
seekBar.setLayoutParams(layoutParams);
seekBar.setMax(WoWoGearbox.Gearboxes.length - 1);
seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
if (fromUser) wowo.setGearbox(WoWoGearbox.Gearboxes[progress]);
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
seekBar.setProgress(3);
base.addView(seekBar);
}
}