Android Open Source - android.bigredsnapshot Customed Dialog






From Project

Back to project page android.bigredsnapshot.

License

The source code is released under:

MIT License

If you think the Android project android.bigredsnapshot listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package io.evercam.bigredsnapshot.helper;
/*ww w  .ja v a 2s  .  c  o  m*/
import io.evercam.bigredsnapshot.R;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.provider.Settings;

public class CustomedDialog
{
  // Alert dialog with single button
  public static AlertDialog getAlertDialog(Context context, String title, String message)
  {
    AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(context);
    dialogBuilder.setTitle(title);
    dialogBuilder.setMessage(message);
    dialogBuilder.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener(){

      @Override
      public void onClick(DialogInterface dialog, int which)
      {
        dialog.dismiss();
      }
    });
    AlertDialog alertDialog = dialogBuilder.create();
    alertDialog.setCanceledOnTouchOutside(false);
    return alertDialog;
  }

  // Dialog that shows when Internet is not connected.
  public static AlertDialog getNoInternetDialog(final Context context)
  {
    AlertDialog.Builder connectDialogBuilder = new AlertDialog.Builder(context);
    connectDialogBuilder.setMessage(R.string.noNetworkMsg);

    connectDialogBuilder.setPositiveButton(R.string.settings,
        new DialogInterface.OnClickListener(){
          @Override
          public void onClick(DialogInterface dialog, int which)
          {
            context.startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
          }
        });
    connectDialogBuilder.setNegativeButton(R.string.notNow,
        new DialogInterface.OnClickListener(){
          @Override
          public void onClick(DialogInterface dialog, int which)
          {
            return;
          }
        });
    connectDialogBuilder.setTitle(R.string.noNetwork);
    connectDialogBuilder.setCancelable(false);
    AlertDialog alertDialog = connectDialogBuilder.create();
    return alertDialog;
  }
}




Java Source Code List

io.evercam.bigredsnapshot.BigButtonActivity.java
io.evercam.bigredsnapshot.BigRedSnapshot.java
io.evercam.bigredsnapshot.ChooseCameraActivity.java
io.evercam.bigredsnapshot.LoginActivity.java
io.evercam.bigredsnapshot.SignUpActivity.java
io.evercam.bigredsnapshot.SlideActivity.java
io.evercam.bigredsnapshot.SnapshotRequest.java
io.evercam.bigredsnapshot.UrlStatus.java
io.evercam.bigredsnapshot.account.AccountUtils.java
io.evercam.bigredsnapshot.account.ProfileQuery.java
io.evercam.bigredsnapshot.account.UserProfile.java
io.evercam.bigredsnapshot.helper.CustomedDialog.java
io.evercam.bigredsnapshot.helper.PrefsManager.java
io.evercam.bigredsnapshot.helper.PropertyReader.java
io.evercam.bigredsnapshot.tasks.CaptureSnapshotTask.java
io.evercam.bigredsnapshot.tasks.CheckInternetTask.java