|
|
|
@ -4,12 +4,11 @@ import android.app.Activity;
|
|
|
|
|
import android.app.AlertDialog;
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.content.DialogInterface;
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.content.SharedPreferences;
|
|
|
|
|
import android.content.pm.ApplicationInfo;
|
|
|
|
|
import android.content.pm.PackageManager;
|
|
|
|
|
import android.preference.PreferenceManager;
|
|
|
|
|
import android.provider.Settings;
|
|
|
|
|
import android.support.v4.BuildConfig;
|
|
|
|
|
import android.text.InputType;
|
|
|
|
|
import android.util.Log;
|
|
|
|
|
import android.widget.EditText;
|
|
|
|
@ -17,8 +16,6 @@ import android.widget.EditText;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
import verdnatura.es.repartoverdnatura.R;
|
|
|
|
|
|
|
|
|
|
public class Utils {
|
|
|
|
|
|
|
|
|
|
static SharedPreferences sp;
|
|
|
|
@ -37,7 +34,7 @@ public class Utils {
|
|
|
|
|
/* ApplicationInfo applicationInfo = context.getApplicationInfo();
|
|
|
|
|
int stringId = applicationInfo.labelRes;
|
|
|
|
|
return stringId == 0 ? applicationInfo.nonLocalizedLabel.toString() : context.getString(stringId);*/
|
|
|
|
|
return "delivery";
|
|
|
|
|
return "delivery";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String getAppVersion(Context context) {
|
|
|
|
@ -133,12 +130,12 @@ public class Utils {
|
|
|
|
|
AlertDialog alert11 = builder1.create();
|
|
|
|
|
alert11.show();
|
|
|
|
|
}
|
|
|
|
|
public static void showInputDialogExpedition(final Context context, String title) {
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
|
|
|
builder.setTitle(title);
|
|
|
|
|
public static void showInputDialogExpedition(final Context context, String title) {
|
|
|
|
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
|
|
|
|
builder.setTitle(title);
|
|
|
|
|
|
|
|
|
|
// Set up the input
|
|
|
|
|
final EditText input = new EditText(context);
|
|
|
|
|
// Set up the input
|
|
|
|
|
final EditText input = new EditText(context);
|
|
|
|
|
// Specify the type of input expected; this, for example, sets the input as a password, and will mask the text
|
|
|
|
|
input.setInputType(InputType.TYPE_CLASS_NUMBER );
|
|
|
|
|
builder.setView(input);
|
|
|
|
@ -157,8 +154,8 @@ public static void showInputDialogExpedition(final Context context, String title
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
builder.show();
|
|
|
|
|
}
|
|
|
|
|
builder.show();
|
|
|
|
|
}
|
|
|
|
|
public static void saveIdUser(Context context, String idUser) {
|
|
|
|
|
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
|
|
|
|
SharedPreferences.Editor editor = sp.edit();
|
|
|
|
@ -220,4 +217,14 @@ public static void showInputDialogExpedition(final Context context, String title
|
|
|
|
|
editor.commit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void startPicking(Context context) {
|
|
|
|
|
|
|
|
|
|
Intent i = new Intent();
|
|
|
|
|
i.setClassName("es.verdnatura", "es.verdnatura.presentation.view.feature.login.activity.LoginActivity");
|
|
|
|
|
i.putExtra("token", "sergiodt");
|
|
|
|
|
i.putExtra("user", getIdUserLogin(context));
|
|
|
|
|
i.putExtra("pass", getPass(context));
|
|
|
|
|
context.startActivity(i);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|