use of net.steamcrafted.loadtoast.MaterialProgressDrawable in project loadtoast by code-mc.
the class MainActivity method onCreate.
// Example activity
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
final String text = "";
final LoadToast lt = new LoadToast(this).setProgressColor(Color.RED).setText(text).setTranslationY(100).show();
//lt.success();
final ViewGroup root = (ViewGroup) findViewById(android.R.id.content);
View v = new View(this);
v.setBackgroundColor(Color.RED);
//root.addView(v, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 400));
findViewById(R.id.show).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
lt.show();
}
});
findViewById(R.id.error).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
lt.error();
}
});
findViewById(R.id.success).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
lt.success();
}
});
findViewById(R.id.refresh).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
View v = new View(MainActivity.this);
v.setBackgroundColor(Color.rgb((int) (Math.random() * 255), (int) (Math.random() * 255), (int) (Math.random() * 255)));
//root.addView(v, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 400));
}
});
ImageView progressView = ((ImageView) findViewById(R.id.progressdrawable));
MaterialProgressDrawable drawable = new MaterialProgressDrawable(this, progressView);
}
Aggregations