use of com.gc.materialdesign.widgets.Dialog in project MaterialDesignLibrary by navasmdc.
the class WidgetActivity method onCreate.
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_widgets);
// SHOW SNACKBAR
findViewById(R.id.buttonSnackBar).setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View flatButton) {
new SnackBar(WidgetActivity.this, "Do you want change color of this button to red?", "yes", new OnClickListener() {
@Override
public void onClick(View v) {
ButtonFlat btn = (ButtonFlat) findViewById(R.id.buttonSnackBar);
btn.setTextColor(Color.RED);
}
}).show();
}
});
// SHOW DiALOG
findViewById(R.id.buttonDialog).setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View flatButton) {
Dialog dialog = new Dialog(WidgetActivity.this, "Title", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam");
dialog.setOnAcceptButtonClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(WidgetActivity.this, "Click accept button", 1).show();
}
});
dialog.setOnCancelButtonClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(WidgetActivity.this, "Click cancel button", 1).show();
}
});
dialog.show();
}
});
// SHOW COLOR SEECTOR
findViewById(R.id.buttonColorSelector).setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View flatButton) {
new ColorSelector(WidgetActivity.this, Color.RED, null).show();
}
});
}
use of com.gc.materialdesign.widgets.Dialog in project UltimateAndroid by cymcsg.
the class WidgetActivity method onCreate.
@SuppressLint("NewApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.material_design_activity_widgets);
// SHOW SNACKBAR
findViewById(R.id.buttonSnackBar).setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View flatButton) {
new SnackBar(WidgetActivity.this, "Do you want change color of this button to red?", "yes", new OnClickListener() {
@Override
public void onClick(View v) {
ButtonFlat btn = (ButtonFlat) findViewById(R.id.buttonSnackBar);
btn.setTextColor(Color.RED);
}
}).show();
}
});
// SHOW DiALOG
findViewById(R.id.buttonDialog).setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View flatButton) {
Dialog dialog = new Dialog(WidgetActivity.this, "Title", "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam");
dialog.setOnAcceptButtonClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(WidgetActivity.this, "Click accept button", Toast.LENGTH_LONG).show();
}
});
dialog.setOnCancelButtonClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(WidgetActivity.this, "Click cancel button", Toast.LENGTH_LONG).show();
}
});
dialog.show();
}
});
// SHOW COLOR SEECTOR
findViewById(R.id.buttonColorSelector).setOnClickListener(new OnClickListener() {
@Override
public void onClick(final View flatButton) {
new ColorSelector(WidgetActivity.this, Color.RED, null).show();
}
});
}
Aggregations