|
@@ -4,17 +4,20 @@ import android.os.Bundle;
|
|
import android.support.design.widget.FloatingActionButton;
|
|
import android.support.design.widget.FloatingActionButton;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
import android.support.v7.app.AppCompatActivity;
|
|
import android.support.v7.widget.Toolbar;
|
|
import android.support.v7.widget.Toolbar;
|
|
|
|
+import android.util.Log;
|
|
import android.view.View;
|
|
import android.view.View;
|
|
-import android.widget.Toast;
|
|
|
|
|
|
+import android.widget.CheckBox;
|
|
|
|
+import android.widget.CompoundButton;
|
|
|
|
|
|
import com.bumptech.glide.Glide;
|
|
import com.bumptech.glide.Glide;
|
|
|
|
+import com.uddream.library.Test;
|
|
|
|
+
|
|
|
|
+public class MainActivity extends AppCompatActivity implements View.OnClickListener, CompoundButton.OnCheckedChangeListener {
|
|
|
|
|
|
-public class MainActivity extends AppCompatActivity {
|
|
|
|
-
|
|
|
|
private View.OnClickListener listener = new View.OnClickListener() {
|
|
private View.OnClickListener listener = new View.OnClickListener() {
|
|
@Override
|
|
@Override
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
- Toast.makeText(MainActivity.this, "field listener", Toast.LENGTH_LONG).show();
|
|
|
|
|
|
+ System.out.print("field listener");
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -27,5 +30,18 @@ public class MainActivity extends AppCompatActivity {
|
|
Glide.with(this);
|
|
Glide.with(this);
|
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
|
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
|
fab.setOnClickListener(listener);
|
|
fab.setOnClickListener(listener);
|
|
|
|
+ fab.setOnClickListener(new Test());
|
|
|
|
+ fab.setOnClickListener(this);
|
|
|
|
+ new CheckBox(this).setOnCheckedChangeListener(this);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
+ System.out.print("onClick listener");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void onCheckedChanged(CompoundButton v, boolean isChecked) {
|
|
|
|
+ System.out.print("onCheckedChanged listener");
|
|
}
|
|
}
|
|
}
|
|
}
|