use of android.widget.Toast in project Applozic-Android-SDK by AppLozic.
the class AppContactFragment method processLoadRegisteredUsers.
public void processLoadRegisteredUsers() {
final ProgressDialog progressDialog = ProgressDialog.show(getActivity(), "", getActivity().getString(R.string.applozic_contacts_loading_info), true);
RegisteredUsersAsyncTask.TaskListener usersAsyncTaskTaskListener = new RegisteredUsersAsyncTask.TaskListener() {
@Override
public void onSuccess(RegisteredUsersApiResponse registeredUsersApiResponse, String[] userIdArray) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
try {
if (registeredUsersApiResponse != null) {
getLoaderManager().restartLoader(AppContactFragment.ContactsQuery.QUERY_ID, null, AppContactFragment.this);
}
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onFailure(RegisteredUsersApiResponse registeredUsersApiResponse, String[] userIdArray, Exception exception) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
String error = getString(Utils.isInternetAvailable(getActivity()) ? R.string.applozic_server_error : R.string.you_need_network_access_for_block_or_unblock);
Toast toast = Toast.makeText(getActivity(), error, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
@Override
public void onCompletion() {
}
};
RegisteredUsersAsyncTask usersAsyncTask = new RegisteredUsersAsyncTask(getActivity(), usersAsyncTaskTaskListener, alCustomizationSettings.getTotalRegisteredUserToFetch(), userPreference.getRegisteredUsersLastFetchTime(), null, null, true);
usersAsyncTask.execute((Void) null);
}
use of android.widget.Toast in project Applozic-Android-SDK by AppLozic.
the class ContactSelectionFragment method processDownloadRegisteredUsers.
public void processDownloadRegisteredUsers() {
final ProgressDialog progressDialog = ProgressDialog.show(getActivity(), "", getActivity().getString(R.string.applozic_contacts_loading_info), true);
RegisteredUsersAsyncTask.TaskListener usersAsyncTaskTaskListener = new RegisteredUsersAsyncTask.TaskListener() {
@Override
public void onSuccess(RegisteredUsersApiResponse registeredUsersApiResponse, String[] userIdArray) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
if (registeredUsersApiResponse != null) {
try {
if (!Utils.isInternetAvailable(getActivity())) {
Toast toast = Toast.makeText(getActivity(), getActivity().getString(R.string.applozic_contacts_loading_error), Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
if (registeredUsersApiResponse != null && contactsGroupId == null) {
getLoaderManager().restartLoader(ContactSelectionFragment.ContactsQuery.QUERY_ID, null, ContactSelectionFragment.this);
}
} catch (Exception e) {
}
}
}
@Override
public void onFailure(RegisteredUsersApiResponse registeredUsersApiResponse, String[] userIdArray, Exception exception) {
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
String error = getString(Utils.isInternetAvailable(getActivity()) ? R.string.applozic_server_error : R.string.you_need_network_access_for_block_or_unblock);
Toast toast = Toast.makeText(getActivity(), error, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
@Override
public void onCompletion() {
}
};
RegisteredUsersAsyncTask usersAsyncTask = new RegisteredUsersAsyncTask(getActivity(), usersAsyncTaskTaskListener, alCustomizationSettings.getTotalRegisteredUserToFetch(), userPreference.getRegisteredUsersLastFetchTime(), null, null, true);
usersAsyncTask.execute((Void) null);
}
use of android.widget.Toast in project android_packages_apps_OmniClock by omnirom.
the class AlarmUtils method popFirstAlarmCreatedToast.
public static void popFirstAlarmCreatedToast(Context context) {
Toast toast = Toast.makeText(context, R.string.first_alarm_created_hint, Toast.LENGTH_LONG);
ToastMaster.setToast(toast);
toast.show();
}
use of android.widget.Toast in project Applozic-Android-SDK by AppLozic.
the class ConversationUIService method showToastMessage.
void showToastMessage(final String messageToShow) {
Toast toast = Toast.makeText(fragmentActivity, messageToShow, Toast.LENGTH_SHORT);
toast.setGravity(Gravity.CENTER, 0, 0);
toast.show();
}
use of android.widget.Toast in project AmazeFileManager by TeamAmaze.
the class MainActivityHelper method mkDir.
public void mkDir(final HybridFile path, final MainFragment ma) {
final Toast toast = Toast.makeText(ma.getActivity(), ma.getString(R.string.creatingfolder), Toast.LENGTH_SHORT);
toast.show();
Operations.mkdir(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
mkdir(file.getMode(), file.getParent(), ma);
}
});
}
@Override
public void launchSAF(HybridFile file) {
if (toast != null)
toast.cancel();
ma.getActivity().runOnUiThread(() -> {
mainActivity.oppathe = path.getPath();
mainActivity.operation = DataUtils.NEW_FOLDER;
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();
});
}
});
}
Aggregations