#Version 23.8 en testBeta
This commit is contained in:
parent
27b9a694c8
commit
0986f34e71
|
@ -7,8 +7,8 @@ android {
|
||||||
applicationId "verdnatura.es.repartoverdnatura"
|
applicationId "verdnatura.es.repartoverdnatura"
|
||||||
minSdkVersion 19
|
minSdkVersion 19
|
||||||
//targetSdkVersion 28
|
//targetSdkVersion 28
|
||||||
versionCode 36
|
versionCode 40
|
||||||
versionName "23.6"
|
versionName "23.8Beta"
|
||||||
//versionName "23.2Beta" Madrid 33
|
//versionName "23.2Beta" Madrid 33
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,9 +20,10 @@ android {
|
||||||
minifyEnabled false
|
minifyEnabled false
|
||||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
}
|
}
|
||||||
/* getByName("release") {
|
getByName("release") {
|
||||||
applicationIdSuffix = ".sfusion"
|
applicationIdSuffix = ".sfusion"
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
getByName("debug") {
|
getByName("debug") {
|
||||||
applicationIdSuffix = ".sfusion"
|
applicationIdSuffix = ".sfusion"
|
||||||
}*/
|
}*/
|
||||||
|
|
|
@ -36,19 +36,23 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".MainActivity"
|
android:name=".MainActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".Tickets"
|
android:name=".Tickets"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".SignActivity"
|
android:name=".SignActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".InfoActivity"
|
android:name=".InfoActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ConfigureActivity"
|
android:name=".ConfigureActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
|
@ -60,23 +64,28 @@
|
||||||
<activity
|
<activity
|
||||||
android:name=".LoadVanActivity"
|
android:name=".LoadVanActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".UnLoadVanActivity"
|
android:name=".UnLoadVanActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ExpeditionScanActivity"
|
android:name=".ExpeditionScanActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ExpeditionInfoActivity"
|
android:name=".ExpeditionInfoActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ExpeditionSummaryActivity"
|
android:name=".ExpeditionSummaryActivity"
|
||||||
android:configChanges="orientation"
|
android:configChanges="orientation"
|
||||||
android:screenOrientation="portrait" />
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"/>
|
||||||
|
|
||||||
<receiver android:name=".NetworkStateReveiver">
|
<receiver android:name=".NetworkStateReveiver">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
|
|
@ -6,7 +6,6 @@ import android.content.Intent
|
||||||
import android.media.MediaPlayer
|
import android.media.MediaPlayer
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.v7.app.AppCompatActivity
|
import android.support.v7.app.AppCompatActivity
|
||||||
import android.util.Log.d
|
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.inputmethod.InputMethodManager
|
import android.view.inputmethod.InputMethodManager
|
||||||
import android.widget.*
|
import android.widget.*
|
||||||
|
@ -75,9 +74,19 @@ class ExpeditionSummaryActivity : AppCompatActivity() {
|
||||||
val bundle = intent.extras
|
val bundle = intent.extras
|
||||||
try {
|
try {
|
||||||
if (bundle != null) {
|
if (bundle != null) {
|
||||||
route = bundle.getSerializable("route") as Ruta
|
|
||||||
|
if (bundle.get("app") == "picking") {
|
||||||
|
/* Utils.saveTokenUser(this,bundle.get("token").toString())
|
||||||
|
Utils.saveUserPass(this,bundle.get("user").toString(),bundle.get("password").toString())
|
||||||
|
Utils.saveIdUser(this,bundle.get("userId").toString())*/
|
||||||
|
|
||||||
|
routeOfLoad = bundle.get("routeId").toString()
|
||||||
|
} else {
|
||||||
|
route = bundle.getSerializable("route") as Ruta
|
||||||
|
routeOfLoad = route!!.id.toString()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
routeOfLoad = route!!.id.toString()
|
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
routeOfLoad = ""
|
routeOfLoad = ""
|
||||||
|
@ -374,7 +383,7 @@ class ExpeditionSummaryActivity : AppCompatActivity() {
|
||||||
}
|
}
|
||||||
|
|
||||||
txtScan!!.setText("")
|
txtScan!!.setText("")
|
||||||
txtScan!!.requestFocus()
|
txtScan!!.requestFocus()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,11 +475,13 @@ class ExpeditionSummaryActivity : AppCompatActivity() {
|
||||||
textAddressSelected!!.text =
|
textAddressSelected!!.text =
|
||||||
if (checked == totalChecks) {
|
if (checked == totalChecks) {
|
||||||
listExpeditionSummary.get(positionSelected!! + 1).address
|
listExpeditionSummary.get(positionSelected!! + 1).address
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
listExpeditionSummary.get(positionSelected!!).address
|
listExpeditionSummary.get(positionSelected!!).address
|
||||||
|
|
||||||
}
|
}
|
||||||
//positionSelected = positionSelected!! + 1
|
if (checked == totalChecks)
|
||||||
|
positionSelected = positionSelected!! + 1
|
||||||
|
|
||||||
}
|
}
|
||||||
onResume()
|
onResume()
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
package verdnatura.es.repartoverdnatura;
|
package verdnatura.es.repartoverdnatura;
|
||||||
|
|
||||||
|
import android.app.AlertDialog;
|
||||||
|
import android.content.DialogInterface;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
@ -18,6 +23,7 @@ import retrofit2.Response;
|
||||||
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
|
import verdnatura.es.repartoverdnatura.INTERFACES.RestClient;
|
||||||
import verdnatura.es.repartoverdnatura.INTERFACES.RestClientSalix;
|
import verdnatura.es.repartoverdnatura.INTERFACES.RestClientSalix;
|
||||||
import verdnatura.es.repartoverdnatura.MODELS.LoginSalix;
|
import verdnatura.es.repartoverdnatura.MODELS.LoginSalix;
|
||||||
|
import verdnatura.es.repartoverdnatura.MODELS.Version;
|
||||||
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
|
import verdnatura.es.repartoverdnatura.UTILS.ApiUtils;
|
||||||
import verdnatura.es.repartoverdnatura.UTILS.ApiUtilsSalix;
|
import verdnatura.es.repartoverdnatura.UTILS.ApiUtilsSalix;
|
||||||
import verdnatura.es.repartoverdnatura.UTILS.Utils;
|
import verdnatura.es.repartoverdnatura.UTILS.Utils;
|
||||||
|
@ -29,6 +35,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
private EditText txtUser, txtPassword;
|
private EditText txtUser, txtPassword;
|
||||||
private CheckBox checkVerPass;
|
private CheckBox checkVerPass;
|
||||||
|
|
||||||
|
final LoginActivity that = this;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onRestart() {
|
protected void onRestart() {
|
||||||
|
@ -85,7 +92,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
final String password = txtPassword.getText().toString();
|
final String password = txtPassword.getText().toString();
|
||||||
LoginSalix ls = new LoginSalix(user, password, "", false, "");
|
LoginSalix ls = new LoginSalix(user, password, "", false, "");
|
||||||
|
|
||||||
final LoginActivity that = this;
|
|
||||||
|
|
||||||
restClientSalix.loginSalix(Utils.getMapSalix(user, password), ls).enqueue(new Callback<LoginSalix>() {
|
restClientSalix.loginSalix(Utils.getMapSalix(user, password), ls).enqueue(new Callback<LoginSalix>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -123,7 +129,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
final String user = txtUser.getText().toString();
|
final String user = txtUser.getText().toString();
|
||||||
final String password = txtPassword.getText().toString();
|
final String password = txtPassword.getText().toString();
|
||||||
|
|
||||||
final LoginActivity that = this;
|
|
||||||
|
|
||||||
restClient.worker_getId(Utils.getMap(user, password)).enqueue(new Callback<String>() {
|
restClient.worker_getId(Utils.getMap(user, password)).enqueue(new Callback<String>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -154,7 +159,69 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void checkVersion(){
|
||||||
|
|
||||||
|
String[] userData = new String[1];
|
||||||
|
userData[0] = "delivery";
|
||||||
|
|
||||||
|
|
||||||
|
//sergio: se cambia llamada Callback porque requeria un objeto y se le pasaba un true o false
|
||||||
|
restClient.getVersion(Utils.getMapWhitUser(this),userData).enqueue(new Callback<Version>() {
|
||||||
|
//restClient.getVersion(Utils.getMapWhitUser(this),userData).enqueue(new Callback<String>() {
|
||||||
|
@Override
|
||||||
|
public void onResponse(Call<Version> call, Response<Version> response) {
|
||||||
|
if (response.isSuccessful()){
|
||||||
|
final Version v = response.body();
|
||||||
|
|
||||||
|
PackageManager manager = that.getPackageManager();
|
||||||
|
try{
|
||||||
|
PackageInfo info = manager.getPackageInfo(that.getPackageName(), 0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (!v.getVersion().equals(info.versionName)){
|
||||||
|
AlertDialog.Builder builderVersion = new AlertDialog.Builder(that);
|
||||||
|
builderVersion.setMessage("Existe una nueva versión. Se recomienda actualizar.");
|
||||||
|
builderVersion.setCancelable(false);
|
||||||
|
builderVersion.setPositiveButton(
|
||||||
|
"Actualizar",
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(v.getUrl())));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!v.getVersionIsCritical().equals("1")){
|
||||||
|
builderVersion.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialogInterface, int i) {
|
||||||
|
startActivity(new Intent(that, MainActivity.class));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
builderVersion.setMessage("Existe una nueva versión. Es necesario actualizar para un correcto funcionamiento");
|
||||||
|
}
|
||||||
|
AlertDialog alertVersion = builderVersion.create();
|
||||||
|
alertVersion.show();
|
||||||
|
}else{
|
||||||
|
startActivity(new Intent(that, MainActivity.class));
|
||||||
|
}
|
||||||
|
}catch (Exception e){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(Call<Version> call, Throwable t) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
public void deviceLog_add() {
|
public void deviceLog_add() {
|
||||||
|
|
||||||
Utils.progressBar.show(this, "Añadiendo log");
|
Utils.progressBar.show(this, "Añadiendo log");
|
||||||
|
@ -166,7 +233,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
data[1] = Utils.getAppVersion(this);
|
data[1] = Utils.getAppVersion(this);
|
||||||
data[2] = Utils.getAndroid_id(this);
|
data[2] = Utils.getAndroid_id(this);
|
||||||
|
|
||||||
final LoginActivity that = this;
|
|
||||||
|
|
||||||
restClient.deviceLog_add(Utils.getMap(user, password), data).enqueue(new Callback<Void>() {
|
restClient.deviceLog_add(Utils.getMap(user, password), data).enqueue(new Callback<Void>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -174,7 +240,8 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
Utils.progressBar.getDialog().dismiss();
|
Utils.progressBar.getDialog().dismiss();
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
|
|
||||||
startActivity(new Intent(that, MainActivity.class));
|
//startActivity(new Intent(that, MainActivity.class));
|
||||||
|
checkVersion();
|
||||||
txtUser.setText("");
|
txtUser.setText("");
|
||||||
txtPassword.setText("");
|
txtPassword.setText("");
|
||||||
|
|
||||||
|
@ -182,7 +249,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||||
} else {
|
} else {
|
||||||
Utils.showErrorDialog(that, that.getResources().getString(R.string.log_incorrect));
|
Utils.showErrorDialog(that, that.getResources().getString(R.string.log_incorrect));
|
||||||
//Utils.showErrorDialog(that,response.message().toString());
|
//Utils.showErrorDialog(that,response.message().toString());
|
||||||
startActivity(new Intent(that, MainActivity.class));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,12 +67,6 @@ public class MainActivity<RouteLoaded> extends AppCompatActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
//Tarea #4602
|
|
||||||
/* Bundle extras = getIntent().getExtras();
|
|
||||||
if (extras!=null)
|
|
||||||
{d("VERDNATURA::","el token es "+ extras.getString("token"));
|
|
||||||
Toast.makeText(this,"token es "+extras.getString("token"),Toast.LENGTH_LONG).show();}
|
|
||||||
else{d("VERDNATURA::","no token es");}*/
|
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_main);
|
setContentView(R.layout.activity_main);
|
||||||
|
@ -162,7 +156,8 @@ public class MainActivity<RouteLoaded> extends AppCompatActivity {
|
||||||
ViewGroup.LayoutParams params = listViewRutas.getLayoutParams();
|
ViewGroup.LayoutParams params = listViewRutas.getLayoutParams();
|
||||||
params.height = (heightCellRoute * (listaRutas.size()));
|
params.height = (heightCellRoute * (listaRutas.size()));
|
||||||
listViewRutas.setLayoutParams(params);
|
listViewRutas.setLayoutParams(params);
|
||||||
checkVersion();
|
//Se actualiza por ScaleFusion. Hay redmine para pasar a LoginActivity
|
||||||
|
// checkVersion();
|
||||||
LocalStorage.checkDateForClear(that);
|
LocalStorage.checkDateForClear(that);
|
||||||
|
|
||||||
// getExpeditions();
|
// getExpeditions();
|
||||||
|
@ -191,10 +186,10 @@ public class MainActivity<RouteLoaded> extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void goToExpeditionInfo(View v){
|
public void goToExpeditionInfo(View v){
|
||||||
|
/*
|
||||||
|
|
||||||
Intent i = new Intent(this,ExpeditionInfoActivity.class);
|
Intent i = new Intent(this,ExpeditionInfoActivity.class);
|
||||||
startActivity(i);
|
startActivity(i);*/
|
||||||
|
Utils.startPicking(this,"log");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -391,7 +386,8 @@ public class MainActivity<RouteLoaded> extends AppCompatActivity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void goToInfo(View v){
|
public void goToInfo(View v){
|
||||||
startActivity(new Intent(this,InfoActivity.class));
|
// startActivity(new Intent(this,InfoActivity.class));
|
||||||
|
Utils.startPicking(this,"info");
|
||||||
}
|
}
|
||||||
public void goToFound(View v){
|
public void goToFound(View v){
|
||||||
startActivity(new Intent(this,ExpeditionScanActivity.class));
|
startActivity(new Intent(this,ExpeditionScanActivity.class));
|
||||||
|
|
|
@ -38,10 +38,10 @@ public class Utils {
|
||||||
|
|
||||||
public static String getAppVersion(Context context) {
|
public static String getAppVersion(Context context) {
|
||||||
PackageManager packageManager = context.getPackageManager();
|
PackageManager packageManager = context.getPackageManager();
|
||||||
String version="";
|
String version = "";
|
||||||
try {
|
try {
|
||||||
|
|
||||||
version=packageManager.getPackageInfo(context.getPackageName(), 0).versionName;
|
version = packageManager.getPackageInfo(context.getPackageName(), 0).versionName;
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
} catch (PackageManager.NameNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,7 @@ public class Utils {
|
||||||
AlertDialog alert11 = builder1.create();
|
AlertDialog alert11 = builder1.create();
|
||||||
alert11.show();
|
alert11.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showInputDialogExpedition(final Context context, String title) {
|
public static void showInputDialogExpedition(final Context context, String title) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||||
builder.setTitle(title);
|
builder.setTitle(title);
|
||||||
|
@ -128,25 +129,26 @@ public class Utils {
|
||||||
// Set up the input
|
// Set up the input
|
||||||
final EditText input = new EditText(context);
|
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
|
// 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 );
|
input.setInputType(InputType.TYPE_CLASS_NUMBER);
|
||||||
builder.setView(input);
|
builder.setView(input);
|
||||||
|
|
||||||
// Set up the buttons
|
// Set up the buttons
|
||||||
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
Log.d("VERDNATURA::",input.getText().toString());
|
Log.d("VERDNATURA::", input.getText().toString());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
dialog.cancel();
|
dialog.cancel();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void saveIdUser(Context context, String idUser) {
|
public static void saveIdUser(Context context, String idUser) {
|
||||||
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
||||||
SharedPreferences.Editor editor = sp.edit();
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
@ -169,7 +171,6 @@ public class Utils {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String getIdUserLogin(Context context) {
|
public static String getIdUserLogin(Context context) {
|
||||||
sp = context.getSharedPreferences("deliveryLogin", Activity.MODE_PRIVATE);
|
sp = context.getSharedPreferences("deliveryLogin", Activity.MODE_PRIVATE);
|
||||||
return sp.getString("idUserLogin", "nouser");
|
return sp.getString("idUserLogin", "nouser");
|
||||||
|
@ -189,10 +190,12 @@ public class Utils {
|
||||||
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
||||||
return sp.getString("user", "nouser");
|
return sp.getString("user", "nouser");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getPass(Context context) {
|
public static String getPass(Context context) {
|
||||||
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
||||||
return sp.getString("pass", "");
|
return sp.getString("pass", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getIdUser(Context context) {
|
public static String getIdUser(Context context) {
|
||||||
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
sp = context.getSharedPreferences("delivery", Activity.MODE_PRIVATE);
|
||||||
return sp.getString("idUser", "nouser");
|
return sp.getString("idUser", "nouser");
|
||||||
|
@ -205,13 +208,15 @@ public class Utils {
|
||||||
editor.commit();
|
editor.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void startPicking(Context context) {
|
public static void startPicking(Context context, String option) {
|
||||||
|
|
||||||
Intent i = new Intent();
|
Intent i = new Intent();
|
||||||
i.setClassName("es.verdnatura", "es.verdnatura.presentation.view.feature.login.activity.LoginActivity");
|
//i.setClassName("es.verdnatura", "es.verdnatura.presentation.view.feature.login.activity.LoginActivity")
|
||||||
i.putExtra("token", "sergiodt");
|
|
||||||
i.putExtra("user", getIdUserLogin(context));
|
i.setClassName("es.verdnatura", "es.verdnatura.presentation.view.feature.main.activity.MainActivity");
|
||||||
i.putExtra("pass", getPass(context));
|
i.putExtra("user", getUser(context));
|
||||||
|
i.putExtra("password", getPass(context));
|
||||||
|
i.putExtra("menu", option);
|
||||||
context.startActivity(i);
|
context.startActivity(i);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue