Search in sources :

Example 76 with Toast

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);
}
Also used : Toast(android.widget.Toast) RegisteredUsersAsyncTask(com.applozic.mobicomkit.api.account.user.RegisteredUsersAsyncTask) RegisteredUsersApiResponse(com.applozic.mobicomkit.feed.RegisteredUsersApiResponse) SpannableString(android.text.SpannableString) ProgressDialog(android.app.ProgressDialog)

Example 77 with Toast

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);
}
Also used : Toast(android.widget.Toast) RegisteredUsersAsyncTask(com.applozic.mobicomkit.api.account.user.RegisteredUsersAsyncTask) RegisteredUsersApiResponse(com.applozic.mobicomkit.feed.RegisteredUsersApiResponse) SpannableString(android.text.SpannableString) ProgressDialog(android.app.ProgressDialog)

Example 78 with Toast

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();
}
Also used : Toast(android.widget.Toast)

Example 79 with Toast

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();
}
Also used : Toast(android.widget.Toast)

Example 80 with Toast

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();
            });
        }
    });
}
Also used : HybridFile(com.amaze.filemanager.filesystem.HybridFile) Toast(android.widget.Toast) Operations(com.amaze.filemanager.filesystem.Operations)

Aggregations

Toast (android.widget.Toast)485 Context (android.content.Context)89 View (android.view.View)86 TextView (android.widget.TextView)74 Intent (android.content.Intent)55 Rect (android.graphics.Rect)34 LayoutInflater (android.view.LayoutInflater)31 SuppressLint (android.annotation.SuppressLint)30 JSONObject (org.json.JSONObject)23 ImageView (android.widget.ImageView)21 RequestQueue (com.android.volley.RequestQueue)20 Response (com.android.volley.Response)20 EditText (android.widget.EditText)19 JSONException (org.json.JSONException)18 VolleyError (com.android.volley.VolleyError)17 JsonObjectRequest (com.android.volley.toolbox.JsonObjectRequest)17 User (model.User)16 PendingIntent (android.app.PendingIntent)15 File (java.io.File)15 HashMap (java.util.HashMap)15