use of android.widget.Toast in project AdMoney by ErnestoGonAr.
the class Reporte_Prestamos method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_reporte__prestamos);
bd = new BDHandlerAM(this);
RecyclerView rv = (RecyclerView) findViewById(R.id.recycler_prestamos);
try {
String[][] dataSet = bd.obtenerPrestamos();
LinearLayoutManager ln = new LinearLayoutManager(this);
ln.setOrientation(LinearLayoutManager.VERTICAL);
CustomAdapter_Prestamos adapter = new CustomAdapter_Prestamos(dataSet);
rv.setLayoutManager(ln);
rv.setAdapter(adapter);
} catch (ArrayIndexOutOfBoundsException e) {
Toast toast = Toast.makeText(this, "No hay prestamos", Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
toast.show();
return;
}
}
use of android.widget.Toast in project android_frameworks_base by AOSPA.
the class ActionMenuItemView method onLongClick.
@Override
public boolean onLongClick(View v) {
if (hasText()) {
// Don't show the cheat sheet for items that already show text.
return false;
}
final int[] screenPos = new int[2];
final Rect displayFrame = new Rect();
getLocationOnScreen(screenPos);
getWindowVisibleDisplayFrame(displayFrame);
final Context context = getContext();
final int width = getWidth();
final int height = getHeight();
final int midy = screenPos[1] + height / 2;
int referenceX = screenPos[0] + width / 2;
if (v.getLayoutDirection() == View.LAYOUT_DIRECTION_LTR) {
final int screenWidth = context.getResources().getDisplayMetrics().widthPixels;
// mirror
referenceX = screenWidth - referenceX;
}
Toast cheatSheet = Toast.makeText(context, mItemData.getTitle(), Toast.LENGTH_SHORT);
if (midy < displayFrame.height()) {
// Show along the top; follow action buttons
cheatSheet.setGravity(Gravity.TOP | Gravity.END, referenceX, screenPos[1] + height - displayFrame.top);
} else {
// Show along the bottom center
cheatSheet.setGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL, 0, height);
}
cheatSheet.show();
return true;
}
use of android.widget.Toast in project android_frameworks_base by AOSPA.
the class NekoActivationActivity method toastUp.
private void toastUp(String s) {
Toast toast = Toast.makeText(this, s, Toast.LENGTH_SHORT);
toast.getView().setBackgroundDrawable(null);
toast.show();
}
use of android.widget.Toast in project android_frameworks_base by AOSPA.
the class SysUIToast method makeText.
public static Toast makeText(Context context, CharSequence text, int duration) {
Toast toast = Toast.makeText(context, text, duration);
toast.getWindowParams().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
return toast;
}
use of android.widget.Toast in project android_frameworks_base by AOSPA.
the class LockTaskNotify method makeAllUserToastAndShow.
private Toast makeAllUserToastAndShow(String text) {
Toast toast = Toast.makeText(mContext, text, Toast.LENGTH_LONG);
toast.getWindowParams().privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
toast.show();
return toast;
}
Aggregations