use of android.widget.Toast in project AmazeFileManager by TeamAmaze.
the class MainActivityHelper method mkFile.
public void mkFile(final HybridFile path, final MainFragment ma) {
final Toast toast = Toast.makeText(ma.getActivity(), ma.getString(R.string.creatingfile), Toast.LENGTH_SHORT);
toast.show();
Operations.mkfile(path, ma.getActivity(), mainActivity.isRootExplorer(), new Operations.ErrorCallBack() {
@Override
public void exists(final HybridFile file) {
ma.getActivity().runOnUiThread(() -> {
if (toast != null)
toast.cancel();
Toast.makeText(mainActivity, mainActivity.getString(R.string.fileexist), Toast.LENGTH_SHORT).show();
if (ma != null && ma.getActivity() != null) {
// retry with dialog prompted again
mkfile(file.getMode(), file.getParent(), ma);
}
});
}
@Override
public void launchSAF(HybridFile file) {
ma.getActivity().runOnUiThread(() -> {
if (toast != null)
toast.cancel();
mainActivity.oppathe = path.getPath();
mainActivity.operation = DataUtils.NEW_FILE;
guideDialogForLEXA(mainActivity.oppathe);
});
}
@Override
public void launchSAF(HybridFile file, HybridFile file1) {
}
@Override
public void done(HybridFile hFile, final boolean b) {
ma.getActivity().runOnUiThread(() -> {
if (b) {
ma.updateList();
} else {
Toast.makeText(ma.getActivity(), ma.getString(R.string.operationunsuccesful), Toast.LENGTH_SHORT).show();
}
});
}
@Override
public void invalidName(final HybridFile file) {
ma.getActivity().runOnUiThread(() -> {
if (toast != null)
toast.cancel();
Toast.makeText(ma.getActivity(), ma.getString(R.string.invalid_name) + ": " + file.getName(), Toast.LENGTH_LONG).show();
});
}
});
}
use of android.widget.Toast in project android_packages_apps_Dialer by LineageOS.
the class CallComposerActivity method placeRCSCall.
private void placeRCSCall(MultimediaData.Builder builder) {
MultimediaData data = builder.build();
LogUtil.i("CallComposerActivity.placeRCSCall", "placing enriched call, data: " + data);
Logger.get(this).logImpression(DialerImpression.Type.CALL_COMPOSER_ACTIVITY_PLACE_RCS_CALL);
getEnrichedCallManager().sendCallComposerData(sessionId, data);
TelecomUtil.placeCall(this, new CallIntentBuilder(contact.getNumber(), CallInitiationType.Type.CALL_COMPOSER).build());
setResult(RESULT_OK);
SharedPreferences preferences = DialerUtils.getDefaultSharedPreferenceForDeviceProtectedStorageContext(this);
// Show a toast for privacy purposes if this is the first time a user uses call composer.
if (preferences.getBoolean(KEY_IS_FIRST_CALL_COMPOSE, true)) {
int privacyMessage = data.hasImageData() ? R.string.image_sent_messages : R.string.message_sent_messages;
Toast toast = Toast.makeText(this, privacyMessage, Toast.LENGTH_LONG);
int yOffset = getResources().getDimensionPixelOffset(R.dimen.privacy_toast_y_offset);
toast.setGravity(Gravity.CENTER_HORIZONTAL | Gravity.BOTTOM, 0, yOffset);
toast.show();
preferences.edit().putBoolean(KEY_IS_FIRST_CALL_COMPOSE, false).apply();
}
finish();
}
use of android.widget.Toast in project mongol-library by suragch.
the class MongolToast method show.
public void show() {
Toast mongolToast = new Toast(context);
mongolToast.setDuration(duration);
mongolToast.setView(getLayout());
mongolToast.show();
}
use of android.widget.Toast in project mongol-library by suragch.
the class MongolButtonActivity method normalButtonClick.
public void normalButtonClick(View view) {
Toast toast = Toast.makeText(getApplicationContext(), "system button", Toast.LENGTH_SHORT);
toast.show();
}
use of android.widget.Toast in project mongol-library by suragch.
the class MongolToastActivity method toastClick.
public void toastClick(View view) {
Toast toast = Toast.makeText(getApplicationContext(), "Hello", Toast.LENGTH_LONG);
toast.show();
}
Aggregations