public void onPLAIN(View view){
noActLayout = (CoordinatorLayout)findViewById(R.id.USE_ME_TWICE);
sbNoAct = Snackbar.make(noActLayout,R.string.real_csb_noaction_text,1);
sbNoAct.setDuration(4000);
View sbView = sbNoAct.getView();
sbView.setBackgroundColor(ContextCompat.getColor(this, R.color.color_lightBlue));
TextView textViewNoAct = sbView.findViewById(android.support.design.R.id.snackbar_text);
textViewNoAct.setTextColor(ContextCompat.getColor(this,R.color.color_White));
textViewNoAct.setMaxLines(10);
textViewNoAct.setTextSize(18);
sbNoAct.show();
}
public void onWithAct(View view){
myLayout = (CoordinatorLayout) findViewById(R.id.USE_ME_TWICE);
sb = Snackbar.make(myLayout, R.string.real_csb_text, Snackbar.LENGTH_INDEFINITE)
.setAction(R.string.real_csb_action, myOnClickListener)
.setActionTextColor(ContextCompat.getColor(context, R.color.color_Red));
View sbView = sb.getView();
sbView.setBackgroundColor(ContextCompat.getColor(this, R.color.color_White));
TextView textView = sbView.findViewById(android.support.design.R.id.snackbar_text);
textView.setTextColor(ContextCompat.getColor(this,R.color.color_deepBlue));
textView.setTextSize(18);
textView.setMaxLines(10);
TextView textAction = sbView.findViewById(android.support.design.R.id.snackbar_action);
textAction.setTextColor(ContextCompat.getColor(this,R.color.color_Red));
textAction.setTextSize(18);
sb.show();
}
View.OnClickListener myOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
System.out.println("=== I WAS DISMISSED OR SENT TO MainActivity===");
Intent intent = new Intent(PageThreeActivity.this, MainActivity.class);
startActivity(intent);
}
};
}