use of net.steamcrafted.loadtoast.LoadToast in project UltimateAndroid by cymcsg.
the class LoadToastLibActivity method onCreate.
// Example activity
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.load_toast_lib_activity_main);
final String text = "Sending reply...";
final LoadToast lt = new LoadToast(this).setText(text).setTranslationY(100).show();
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(LoadToastLibActivity.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));
}
});
}
use of net.steamcrafted.loadtoast.LoadToast 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