This commit is contained in:
wangcongtao
2020-05-29 09:50:27 +08:00
parent ff769c325e
commit 80ac1ed05e
14 changed files with 262 additions and 240 deletions

View File

@@ -70,33 +70,15 @@ public class AbsMogoApplication extends Application {
ARouter.openLog();
}
ARouter.init( sApp );
TipToast.init( this, new TipToast.ToastViewGenerator() {
@Override
public View make( Context context, String message ) {
if ( TextUtils.isEmpty( message ) ) {
return null;
}
View contentView = LayoutInflater.from( context ).inflate( R.layout.module_commons_layout_toast, null );
TextView txt = contentView.findViewById( R.id.module_commons_toast_msg );
txt.setText( message );
return contentView;
TipToast.init( this, ( ( context, message ) -> {
if ( TextUtils.isEmpty( message ) ) {
return null;
}
@Override
public int gravity() {
return Gravity.TOP | Gravity.CENTER_HORIZONTAL;
}
@Override
public int yOffset() {
return sApp.getResources().getDimensionPixelSize( R.dimen.module_commons_toast_y_offset );
}
@Override
public int xOffset() {
return 0;
}
} );
View contentView = LayoutInflater.from( context ).inflate( R.layout.module_commons_layout_toast, null );
TextView txt = contentView.findViewById( R.id.module_commons_toast_msg );
txt.setText( message );
return contentView;
} ) );
}
/**