opt
This commit is contained in:
@@ -9,6 +9,7 @@ package com.mogo.utils;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
@@ -144,10 +145,6 @@ public final class TipToast {
|
||||
sToast.cancel();
|
||||
}
|
||||
|
||||
if ( sGenerator == null ) {
|
||||
sToast = Toast.makeText( context, msg, duration );
|
||||
}
|
||||
|
||||
if ( sGenerator == null ) {
|
||||
sToast = Toast.makeText( context, msg, duration );
|
||||
} else {
|
||||
@@ -155,6 +152,7 @@ public final class TipToast {
|
||||
final View view = sGenerator.make( context, msg );
|
||||
if ( view != null ) {
|
||||
sToast.setView( view );
|
||||
sToast.setGravity( sGenerator.gravity(), sGenerator.xOffset(), sGenerator.yOffset() );
|
||||
sToast.setDuration( duration );
|
||||
} else {
|
||||
sToast = Toast.makeText( context, msg, duration );
|
||||
@@ -171,6 +169,12 @@ public final class TipToast {
|
||||
|
||||
public interface ToastViewGenerator {
|
||||
View make( Context context, String message );
|
||||
|
||||
int gravity();
|
||||
|
||||
int yOffset();
|
||||
|
||||
int xOffset();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user