Commit 0bb17bb0 authored by fallenstardust's avatar fallenstardust

showToast显示位置都改为屏幕顶部

parent 2355394b
......@@ -12,6 +12,7 @@ import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
......@@ -331,6 +332,7 @@ public class BaseActivity extends AppCompatActivity {
}
Toast toast = makeToast();
toast.setText(text);
toast.setGravity(Gravity.TOP, 0, 0);
toast.setDuration(duration);
toast.show();
}
......
......@@ -605,9 +605,9 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
if (checkLimit(cardInfo)) {
boolean rs = mDeckAdapater.AddCard(cardInfo, DeckItemType.SideCard);
if (rs) {
Toast.makeText(getContext(), R.string.add_card_tip_ok, Toast.LENGTH_SHORT).show();
activity.showToast(R.string.add_card_tip_ok);
} else {
Toast.makeText(getContext(), R.string.add_card_tip_fail, Toast.LENGTH_SHORT).show();
activity.showToast(R.string.add_card_tip_fail);
}
return rs;
}
......@@ -623,9 +623,9 @@ public class DeckManagerFragment extends BaseFragemnt implements RecyclerViewIte
rs = mDeckAdapater.AddCard(cardInfo, DeckItemType.MainCard);
}
if (rs) {
Toast.makeText(getContext(), R.string.add_card_tip_ok, Toast.LENGTH_SHORT).show();
activity.showToast(R.string.add_card_tip_ok);
} else {
Toast.makeText(getContext(), R.string.add_card_tip_fail, Toast.LENGTH_SHORT).show();
activity.showToast(R.string.add_card_tip_fail);
}
return rs;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment