-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainActivity.java
More file actions
26 lines (21 loc) · 791 Bytes
/
Copy pathMainActivity.java
File metadata and controls
26 lines (21 loc) · 791 Bytes
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
package study.amadey.customview;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.CompoundButton;
import android.widget.Switch;
public class MainActivity extends AppCompatActivity implements Switch.OnCheckedChangeListener {
private ClockView clockView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Switch switch1 = findViewById(R.id.switch1);
switch1.setOnCheckedChangeListener(this);
clockView = findViewById(R.id.clockView);
}
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
clockView.setLineOrArc(b);
}
}