private void showAppMsg(int resId) {
final AppMsg.Style style;
AppMsg provided = null;
// style = AppMsg.STYLE_ALERT;
style = new AppMsg.Style(LENGTH_SHORT, R.color.sticky);
AppMsg appMsg = provided != null ? provided : AppMsg.makeText(this,
R.string.hint_loginError, style);
appMsg.setPriority(BIND_AUTO_CREATE);
appMsg.setLayoutGravity(BOTTOM);
appMsg.setAnimation(android.R.anim.slide_in_left,
android.R.anim.slide_out_right);
appMsg.show();
}
添加appmsg以后,将该封装块加入,需要进行show的地方直接调用showAppMsg();
参数传递string,例如:R.string.app_name