diff --git a/APPVENTAS.iml b/APPVENTAS.iml new file mode 100644 index 00000000..b9128185 --- /dev/null +++ b/APPVENTAS.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/HEAD b/HEAD new file mode 100644 index 00000000..cb089cd8 --- /dev/null +++ b/HEAD @@ -0,0 +1 @@ +ref: refs/heads/master diff --git a/KeyVerdnatura b/KeyVerdnatura new file mode 100644 index 00000000..df50ab3c Binary files /dev/null and b/KeyVerdnatura differ diff --git a/android.iml b/android.iml new file mode 100644 index 00000000..9dbfcd38 --- /dev/null +++ b/android.iml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/baselibrary/.gitignore b/baselibrary/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/baselibrary/.gitignore @@ -0,0 +1 @@ +/build diff --git a/baselibrary/baselibrary.iml b/baselibrary/baselibrary.iml new file mode 100644 index 00000000..11d18add --- /dev/null +++ b/baselibrary/baselibrary.iml @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/baselibrary/build.gradle b/baselibrary/build.gradle new file mode 100644 index 00000000..63ae0d64 --- /dev/null +++ b/baselibrary/build.gradle @@ -0,0 +1,33 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 28 + defaultConfig { + minSdkVersion 14 + targetSdkVersion 26 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + lintOptions { + abortOnError false + } + compileOptions { + } + buildToolsVersion '28.0.3' +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'com.android.support:appcompat-v7:26.1.0' + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'com.google.code.gson:gson:2.2.4' + implementation 'com.squareup.picasso:picasso:2.5.0' + implementation 'androidx.cardview:cardview:1.0.0' + implementation 'androidx.multidex:multidex:2.0.0' +} diff --git a/baselibrary/proguard-rules.pro b/baselibrary/proguard-rules.pro new file mode 100644 index 00000000..6d73781c --- /dev/null +++ b/baselibrary/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /home/nelo/adt-bundle-linux-x86_64-20140702/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/baselibrary/src/androidTest/java/com/nelosan/baselibrary/ApplicationTest.java b/baselibrary/src/androidTest/java/com/nelosan/baselibrary/ApplicationTest.java new file mode 100644 index 00000000..bbd04072 --- /dev/null +++ b/baselibrary/src/androidTest/java/com/nelosan/baselibrary/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.nelosan.baselibrary; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/baselibrary/src/main/AndroidManifest.xml b/baselibrary/src/main/AndroidManifest.xml new file mode 100644 index 00000000..ecbf83f1 --- /dev/null +++ b/baselibrary/src/main/AndroidManifest.xml @@ -0,0 +1,8 @@ + + + + + + + diff --git a/baselibrary/src/main/assets/fonts/Roboto-Black.ttf b/baselibrary/src/main/assets/fonts/Roboto-Black.ttf new file mode 100644 index 00000000..9002aab5 Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-Black.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-BlackItalic.ttf b/baselibrary/src/main/assets/fonts/Roboto-BlackItalic.ttf new file mode 100644 index 00000000..b87e025d Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-BlackItalic.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-Bold.ttf b/baselibrary/src/main/assets/fonts/Roboto-Bold.ttf new file mode 100644 index 00000000..072b8429 Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-Bold.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-BoldItalic.ttf b/baselibrary/src/main/assets/fonts/Roboto-BoldItalic.ttf new file mode 100644 index 00000000..74919ff6 Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-BoldItalic.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-Italic.ttf b/baselibrary/src/main/assets/fonts/Roboto-Italic.ttf new file mode 100644 index 00000000..bd57775e Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-Italic.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-Light.ttf b/baselibrary/src/main/assets/fonts/Roboto-Light.ttf new file mode 100644 index 00000000..13bf13af Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-Light.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-LightItalic.ttf b/baselibrary/src/main/assets/fonts/Roboto-LightItalic.ttf new file mode 100644 index 00000000..130672a9 Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-LightItalic.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-Medium.ttf b/baselibrary/src/main/assets/fonts/Roboto-Medium.ttf new file mode 100644 index 00000000..d0f6e2b6 Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-Medium.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-MediumItalic.ttf b/baselibrary/src/main/assets/fonts/Roboto-MediumItalic.ttf new file mode 100644 index 00000000..6153d48b Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-MediumItalic.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-Regular.ttf b/baselibrary/src/main/assets/fonts/Roboto-Regular.ttf new file mode 100644 index 00000000..0ba95c98 Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-Regular.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-Thin.ttf b/baselibrary/src/main/assets/fonts/Roboto-Thin.ttf new file mode 100644 index 00000000..309c22d3 Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-Thin.ttf differ diff --git a/baselibrary/src/main/assets/fonts/Roboto-ThinItalic.ttf b/baselibrary/src/main/assets/fonts/Roboto-ThinItalic.ttf new file mode 100644 index 00000000..0b53ba4d Binary files /dev/null and b/baselibrary/src/main/assets/fonts/Roboto-ThinItalic.ttf differ diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/ActivityBase.java b/baselibrary/src/main/java/com/nelosan/baselibrary/ActivityBase.java new file mode 100644 index 00000000..e42f3908 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/ActivityBase.java @@ -0,0 +1,462 @@ +package com.nelosan.baselibrary; + +import android.app.FragmentTransaction; +import android.content.Context; + +import android.graphics.drawable.ColorDrawable; +import android.net.ConnectivityManager; +import android.os.Build; +import android.os.Bundle; + + +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import androidx.drawerlayout.widget.DrawerLayout; + +import android.view.Gravity; +import android.view.View; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Toast; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.dialog.DialogBuscar; +import com.nelosan.baselibrary.fragment.FragmentBase; +import com.nelosan.baselibrary.model.ResultadoBusqueda; +import com.nelosan.baselibrary.toolbar.ToolbarBuscar; +import com.nelosan.baselibrary.toolbar.ToolbarColores; + +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class ActivityBase extends AppCompatActivity { + + /*************************************************** PROPIEDADES *************************************************** + -FRAGMENT_CARGA: Fragment que mostrar por defecto para indicar que se esta realizando una acción de coste elevado. + -Pref: Preferencias de nuestra aplicación. + -Progress: Barra de progreso que se puede mostrar en algunos fragmentos. Desaparecera cuando termine una actividad larga. + -Session: Clase singleton para almacenar valores y clases complejas y pasarlas entre actividades. + -DrawerLayout: Controla el navigation drawer. + -LnrDerecha/Izquierda: Contenido de los correspondientes navigationdrawer. + -Ejecutando: Indica si una tarea asincrona se esta ejecutando en este momento. + -FragmentActivo: El fragment que se esta mostrando actualmente ne pantalla. + -Contenedor: El contenedor de los fragments. + -Toolbar: La barra de navegación de la aplicación. + ****************************************************************************************************************************/ + + protected ProgressBar progress; + + protected DrawerLayout drawerLayout; + protected LinearLayout lnrDerecha, lnrIzquierda; + + protected boolean ejecutando = false; + protected FragmentBase fragmentActivo, fragmentSecundario; + protected int contenedor, contenedor_izquierdo; + protected Toolbar toolbar; + + + /******************OVERRIDE**********************/ + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + /** Inicializamos las preferencias y la session **/ + setContentView(R.layout.activity_base); + //session = Session.getInstance(); + contenedor = R.id.contenedor; + if (findViewById(R.id.contenedor_izquierdo) != null) { + contenedor_izquierdo = R.id.contenedor_izquierdo; + } + + toolbar = (Toolbar)findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + toolbar.setContentInsetsAbsolute(0, 0); + getSupportActionBar().setDisplayShowTitleEnabled(false); + ToolbarColores tool = new ToolbarColores(this, getTitle().toString(), false); + crearToolbar(tool); + createNavigationDrawer(null, null); + overridePendingTransition(0,0); + + } + + @Override + protected void onStop() { + super.onStop(); + } + + @Override + protected void onStart() { + super.onStart(); + } + + @Override + protected void onResume() { + super.onResume(); + } + + @Override + protected void onPause() { + ejecutando = false; + super.onPause(); + } + + @Override + public void onBackPressed() { + + /** Controla el comportamiento de la aplicación al pulsar el boton de volver atras. + * Si hay una tarea asincrona en ejecución, marcamos su ejecución como falso. + * Si hay un navigationdrawer mostrandose en pantalla, se cierra. + * Si no, ejecutamos la acción definida en la funcion backPress. + */ + + ejecutando = false; + if(drawerLayout.isDrawerOpen(Gravity.LEFT)) + drawerLayout.closeDrawer(Gravity.LEFT); + else if(drawerLayout.isDrawerOpen(Gravity.RIGHT)) + drawerLayout.closeDrawer(Gravity.RIGHT); + else if(compararToolbar(ToolbarBuscar.class)) + {} + else + { + backPress(); + } + } + + + /************************************************/ + + + /******************NAVIGATION DRAWER**********************/ + + protected void createNavigationDrawer(View vIzquierda, View vDerecha) + { + /** Inicialización de los navigationdrawer **/ + + drawerLayout = (DrawerLayout) findViewById(R.id.main_navigation_drawer); + + lnrDerecha = (LinearLayout) findViewById(R.id.contenido_navigation_drawer_derecha); + lnrIzquierda = (LinearLayout)findViewById(R.id.contenido_navigation_drawer_izquierda); + + drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, findViewById(R.id.contenido_navigation_drawer_izquierda)); + + drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, findViewById(R.id.contenido_navigation_drawer_derecha)); + + if(vIzquierda != null) { + lnrIzquierda.addView(vIzquierda); + drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, findViewById(R.id.contenido_navigation_drawer_izquierda)); + } + else + drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, findViewById(R.id.contenido_navigation_drawer_izquierda)); + + if(vDerecha != null) { + lnrDerecha.addView(vDerecha); + drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED, findViewById(R.id.contenido_navigation_drawer_derecha)); + } + else + drawerLayout.setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED, findViewById(R.id.contenido_navigation_drawer_derecha)); + } + + public DrawerLayout getDrawerLayout() { + return drawerLayout; + } + + public void abrirDrawerIzquierdo() + { + drawerLayout.openDrawer(Gravity.LEFT); + } + + public void abrirDrawerDerecho() + { + drawerLayout.openDrawer(Gravity.RIGHT); + } + + public void cerrarDrawerIzquierdo() + { + drawerLayout.closeDrawer(Gravity.LEFT); + } + + public void cerrarDrawerDerecho() + { + drawerLayout.closeDrawer(Gravity.RIGHT); + } + + /********************************************************/ + + /******************TOOLBAR**********************/ + + public void crearToolbar(View view, int color, int darkColor) + { + if(mostrarToolbar(view)) { + toolbar.removeAllViews(); + toolbar.addView(view); + toolbar.setBackgroundColor(color); + pintarBarraSuperior(darkColor); + toolbar.setVisibility(View.VISIBLE); + } + else + { + toolbar.setVisibility(View.GONE); + } + } + + public void pintarBarraSuperior(int darkColor) + { + int currentapiVersion = android.os.Build.VERSION.SDK_INT; + if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) { + getWindow().setStatusBarColor(darkColor); + } + } + + public void crearToolbar(View view) + { + if(mostrarToolbar(view)) { + toolbar.removeAllViews(); + toolbar.addView(view); + int colorNegro = getResources().getColor(R.color.negro); + toolbar.setBackgroundColor(colorNegro); + int currentapiVersion = android.os.Build.VERSION.SDK_INT; + if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) { + getWindow().setStatusBarColor(colorNegro); + } + toolbar.setVisibility(View.VISIBLE); + } + else + { + toolbar.setVisibility(View.GONE); + } + } + + public boolean mostrarToolbar(View view) + { + if(view == null) + return false; + else + return true; + } + + protected void setToolbarColores(int color, int darkColor) + { + toolbar.setBackgroundColor(color); + + /** En caso de ser Lollipop, cambiamos el color de statusbar **/ + + int currentapiVersion = Build.VERSION.SDK_INT; + if(currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) { + getWindow().setStatusBarColor(darkColor); + } + } + + public Toolbar getToolbar() { + return toolbar; + } + + public boolean compararToolbar(Class tool) + { + String currentToolbar = toolbar.getChildAt(0).getClass().toString(); + String toolCompare = tool.toString(); + return currentToolbar.equals(toolCompare); + } + + public int getToolbarColor() + { + return ((ColorDrawable)getToolbar().getBackground()).getColor(); + } + + public int getToolbarDarkColor() + { + int currentapiVersion = android.os.Build.VERSION.SDK_INT; + if(currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) { + return getWindow().getStatusBarColor(); + } + + return getResources().getColor(R.color.negro); + } + + public void buscar(String cadena) {} + + public void autocompletarDialog(String cadena, DialogBuscar dialog) {} + + public void clickItemDialogBuscar(ResultadoBusqueda resultado) {} + + public void clickImagenDialog(DialogBuscar dialog) {} + + /************************************************/ + + /******************FRAGMENTS**********************/ + + public boolean compararFragments(Class frag) { + + if(fragmentActivo != null && frag != null) + { + String currentFragment = fragmentActivo.getClass().toString(); + String fragment = frag.toString(); + return currentFragment.equals(fragment); + } + + return false; + } + + public void cambiarFragment(FragmentBase fragment) + { + /** Cambia el fragment activo **/ + fragmentActivo = fragment; + cambiarFragment(fragment, null); + } + + public void cambiarFragment(FragmentBase fragment, Bundle bundle) + { + cambiarFragment(fragment, null, bundle); + } + + public void cambiarFragment(FragmentBase fragmentContenedor, FragmentBase fragmentIzquierdo, Bundle bundle) + { + ejecutando = false; + FragmentTransaction transaccion = getFragmentManager().beginTransaction(); + fragmentActivo = fragmentContenedor; + fragmentSecundario = fragmentIzquierdo; + if(fragmentSecundario != null) + { + fragmentSecundario.getView().setVisibility(View.VISIBLE); + fragmentSecundario.setArguments(bundle); + transaccion.replace(contenedor_izquierdo, fragmentSecundario, fragmentIzquierdo.getClass().getName()); + } + fragmentActivo.setArguments(bundle); + + transaccion.replace(contenedor, fragmentActivo, fragmentContenedor.getClass().getName()); + transaccion.addToBackStack(null); + transaccion.commit(); + } + + protected void backPress(){ + fragmentActivo = (FragmentBase) getFragmentManager().findFragmentById(R.id.contenedor); + } + + /***********************************************/ + + /******************COMMANDS**********************/ + + public void execute(CommandBase cmd) + { + /** Ejecuta una tarea asincrona **/ + boolean ejecutar = true; + + if (cmd.isNeedInternet() && !isOnline()) { + Toast.makeText(this, getResources().getString(R.string.no_internet), Toast.LENGTH_SHORT).show(); + ejecutar = false; + } + + if(ejecutar) + { + ejecutando = true; + cmd.execute(this); + } + } + + + private boolean isOnline() + { + /** Comprueba que hay conexión a internet **/ + + ConnectivityManager cm = (ConnectivityManager)this.getSystemService(Context.CONNECTIVITY_SERVICE); + return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnectedOrConnecting(); + } + + public boolean isEjecutando() { + return ejecutando; + } + + public void setEjecutando(boolean ejecutando) { + this.ejecutando = ejecutando; + } + + + public void setProgress(ProgressBar p) + { + this.progress = p; + } + + /************************************************/ + + /******************COMUNES**********************/ + + public void abrirTeclado(EditText myEditText) + { + myEditText.requestFocus(); + InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); + imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); + } + + public void cerrarTeclado(EditText myEditText) + { + /** Oculta el teclado **/ + InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); + } + + protected void closeApp() + { + finish(); + } + + public void startAnimation(int anim, View resource, Animation.AnimationListener listner) + { + /** Ejecuta una animación **/ + + Animation animacion = AnimationUtils.loadAnimation(this, anim); + if(listner != null) + animacion.setAnimationListener(listner); + animacion.reset(); // reset initialization state + animacion.setRepeatMode(Animation.RESTART); + animacion.setRepeatCount(Animation.INFINITE); + resource.startAnimation(animacion); + } + + public Animation.AnimationListener crearAnimationListener(final Object obj, final String met, final Class[] typeParameters, final Object[] parameters) + { + + /** Ejecuta un método por reflexión una vez ha finalizado una animación. + * obj: Es el objeto que contiene el método. + * met: Es el nombre del método a ejecutar. + * typeParameters: Es un array que indica el tipo de parámetros del método. + * parameters: Array de parámetros del método. + **/ + + Animation.AnimationListener end = new Animation.AnimationListener() { + @Override + public void onAnimationStart(Animation animation) { + + } + + @Override + public void onAnimationEnd(Animation animation) { + try { + Method method = obj.getClass().getMethod(met, typeParameters); + method.invoke(obj, parameters); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } catch (InvocationTargetException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + } + + @Override + public void onAnimationRepeat(Animation animation) { + + } + }; + + return end; + } + + /**********************************************/ + + public void setFragmentActivo(FragmentBase fragmentActivo) { + this.fragmentActivo = fragmentActivo; + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/MyApplication.java b/baselibrary/src/main/java/com/nelosan/baselibrary/MyApplication.java new file mode 100644 index 00000000..d5617076 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/MyApplication.java @@ -0,0 +1,89 @@ +package com.nelosan.baselibrary; + +import android.app.Application; +import android.content.Context; +import androidx.multidex.MultiDex; +import android.widget.ImageView; + +import com.nelosan.baselibrary.core.CircleTransform; +import com.nelosan.baselibrary.core.RoundedTransformation; +import com.squareup.picasso.Picasso; + + +import java.util.concurrent.Executors; + +/** + * Created by nelo on 2/02/15. + */ + +public class MyApplication extends Application { + + private static Context mContext; + private static Picasso mPicasso; + + /*****************IMAGEVIEW TRANSFORMATIONS*********************/ + public static int TRANSFORM_NONE = 100; + public static int TRANSFORM_CIRCLE = 101; + public static int TRANSFORM_ROUNDED = 102; + public static int TRANSFORM_INSIDE = 103; + public static int TRANSFORM_FULL = 104; + + @Override + public void onCreate() { + super.onCreate(); + mContext = getApplicationContext(); + mPicasso = new Picasso.Builder(mContext).executor(Executors.newSingleThreadExecutor()).build(); + + } + + @Override + protected void attachBaseContext(Context base) { + super.attachBaseContext(base); + MultiDex.install(base); + } + + + public static Context getContext() { + return mContext; + } + + public static void downloadImg(String url, ImageView imgFoto, int transform) + { + + if(transform == TRANSFORM_NONE) + { + mPicasso.load(url) + .fit() + .centerCrop() + .into(imgFoto); + } + else if(transform == TRANSFORM_CIRCLE) + { + mPicasso.load(url) + .transform(new CircleTransform()) + //.fit() + .into(imgFoto); + } + else if(transform == TRANSFORM_ROUNDED) + { + mPicasso.load(url) + .transform(new RoundedTransformation(12, 0)) + .fit() + .into(imgFoto); + + } + else if(transform == TRANSFORM_INSIDE) + { + mPicasso.load(url) + .fit() + .into(imgFoto); + } + else if(transform == TRANSFORM_FULL){ + mPicasso.load(url) + .into(imgFoto); + } + + } + + +} \ No newline at end of file diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/adapter/AdapterCalendar.java b/baselibrary/src/main/java/com/nelosan/baselibrary/adapter/AdapterCalendar.java new file mode 100644 index 00000000..e428e381 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/adapter/AdapterCalendar.java @@ -0,0 +1,102 @@ +package com.nelosan.baselibrary.adapter; + +import android.content.Context; +import android.content.res.Resources; +import android.graphics.drawable.GradientDrawable; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.LinearLayout; +import android.widget.TextView; + + +import com.nelosan.baselibrary.R; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.model.CalendarItem; + +import java.util.List; + +import static com.nelosan.baselibrary.core.Util.isInt; + +/** + * Created by nelo on 15/06/15. + */ +public class AdapterCalendar extends ArrayAdapter { + + LayoutInflater li; + Resources res; + Context context; + + public AdapterCalendar(Context context, int resource, List objects) { + super(context, resource, objects); + + li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + res = context.getResources(); + this.context = context; + } + + public class CalendarHolder { + public TextView txtDia; + public LinearLayout lnrDia; + + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) + { + CalendarItem dia = getItem(position); + //Inflate the view + CalendarHolder calendarHolder; + + if (convertView == null) { + calendarHolder = new CalendarHolder(); + convertView = li.inflate(R.layout.item_calendar, null); + calendarHolder.txtDia = (TextView)convertView.findViewById(R.id.textview_item_calendar_dia); + calendarHolder.lnrDia = (LinearLayout)convertView.findViewById(R.id.linear_item_calendar_dia); + convertView.setTag(calendarHolder); + } else { + calendarHolder = (CalendarHolder)convertView.getTag(); + } + + calendarHolder.txtDia.setText(dia.getValue()); + + + if(!isInt(dia.getValue())) { + setParameters(calendarHolder, 12, R.color.negro, R.color.blanco, R.color.blanco); + } + else + { + int textColor; + if(dia.isClick()) + { + textColor = R.color.negro; + } + else + { + textColor = R.color.gris_separacion; + } + + setParameters(calendarHolder, 14, textColor, R.color.blanco, R.color.blanco); + } + + + + if(dia.isSelected()) + { + setParameters(calendarHolder, 14, R.color.blanco, R.color.azul_claro, R.color.azul_claro); + } + + + return convertView; + } + + public void setParameters(CalendarHolder holder, int textSize, int textColot, int diaBack, int lnrBack) + { + //holder.txtDia.setTextSize(context.getResources().getDimension(textSize)); + holder.txtDia.setTextSize(textSize); + holder.txtDia.setTextColor(context.getResources().getColor(textColot)); + holder.txtDia.setBackgroundColor(context.getResources().getColor(diaBack)); + holder.lnrDia.setBackgroundColor(context.getResources().getColor(lnrBack)); + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/adapter/AdapterResultadosBusqueda.java b/baselibrary/src/main/java/com/nelosan/baselibrary/adapter/AdapterResultadosBusqueda.java new file mode 100644 index 00000000..ba82d4f3 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/adapter/AdapterResultadosBusqueda.java @@ -0,0 +1,64 @@ +package com.nelosan.baselibrary.adapter; + +import android.content.Context; +import android.content.res.Resources; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +import com.nelosan.baselibrary.MyApplication; +import com.nelosan.baselibrary.R; +import com.nelosan.baselibrary.model.ResultadoBusqueda; + +import java.util.List; + + +/** + * Created by nelo on 30/03/15. + */ +public class AdapterResultadosBusqueda extends ArrayAdapter { + + LayoutInflater li; + Resources res; + + public AdapterResultadosBusqueda(Context context, int resource, List objects) { + super(context, resource, objects); + + this.li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + this.res = context.getResources(); + } + + private class ResultadoBusquedaHolder { + ImageView imgFoto; + TextView txtArticle; + + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) + { + ResultadoBusqueda resultado = getItem(position); + //Inflate the view + ResultadoBusquedaHolder resultadoHolder; + + if (convertView == null) { + resultadoHolder = new ResultadoBusquedaHolder(); + convertView = li.inflate(R.layout.item_resultados_buscar, null); + resultadoHolder.txtArticle = (TextView)convertView.findViewById(R.id.textview_item_resultado_buscar_texto); + resultadoHolder.imgFoto = (ImageView)convertView.findViewById(R.id.imageview_item_resultado_buscar_foto); + + convertView.setTag(resultadoHolder); + } else { + resultadoHolder = (ResultadoBusquedaHolder)convertView.getTag(); + } + + resultadoHolder.txtArticle.setText(resultado.getNombre()); + if(!resultado.getUrl().equals("")) + MyApplication.downloadImg(resultado.getUrl(), resultadoHolder.imgFoto, MyApplication.TRANSFORM_CIRCLE); + + return convertView; + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/command/CommandBase.java b/baselibrary/src/main/java/com/nelosan/baselibrary/command/CommandBase.java new file mode 100644 index 00000000..4cacf467 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/command/CommandBase.java @@ -0,0 +1,140 @@ +package com.nelosan.baselibrary.command; + +import android.app.AlertDialog; +import android.content.DialogInterface; +import android.os.AsyncTask; +import android.widget.Toast; + +import com.nelosan.baselibrary.ActivityBase; +import com.nelosan.baselibrary.R; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.nelosan.baselibrary.core.FacadeException; + +public class CommandBase extends AsyncTask{ + + /*************************************************** PROPIEDADES *************************************************** + -Activity: Actividad que ejecuta la tarea asíncrona. + -errorMessage: Mensaje de error que se muestra si falla algo en la ejecución de la tarea. + -Start/End: Interface que se utiliza para ejecutar una operación antes o despues de ejecutar una tarea asíncrona. + -succesMessage: Mensaje que se muestra si la tarea se ha ejecutado correctamente. + ****************************************************************************************************************************/ + + protected ActivityBase activity; + private String errorMessage = ""; + private CommandOperation start, finished; + private CommandError errorManager; + private String succesMessage = ""; + protected boolean needInternet = true; + protected boolean showError = true; + protected String message = ""; + + @Override + protected final Void doInBackground(ActivityBase... params) { + + activity = params[0]; + + try { + Execute(); + } catch (FacadeException ex) { + String msg = ex.getMessage(); + if (msg != null && msg.length() > 0) { + errorMessage = msg; + } else { + errorMessage = ex.toString(); + } + } catch (Exception ex) { + errorMessage = ex.getMessage(); + } + + return null; + } + + protected void Execute() {} + + @Override + protected final void onPreExecute() { + super.onPreExecute(); + Start(); + } + + @Override + protected final void onPostExecute(Void result) { + super.onPostExecute(result); + if(activity.isEjecutando()) { + if (!errorMessage.equals("") && showError) { + mostrarAviso(); + } else { + Finished(); + if (succesMessage.length() > 0) + Toast.makeText(activity, succesMessage, Toast.LENGTH_LONG).show(); + } + } + + } + + public void setOnFinished(CommandOperation finished){ + this.finished = finished; + } + + public void setErrorManager(CommandError errorManager){ + this.errorManager = errorManager; + } + + private void Finished(){ + if(finished!= null) + finished.Realice(this); + } + + private void Start(){ + if(start!= null) + start.Realice(this); + } + + public void setSuccesMessage(String message) + { + this.succesMessage = message; + } + + public boolean isNeedInternet() { + return needInternet; + } + + private void mostrarAviso() + { + /** Muestra un mensaje de error **/ + AlertDialog.Builder b = new AlertDialog.Builder(activity); + b.setMessage(message); + + b.setPositiveButton(activity.getResources().getString(R.string.aceptar), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.cancel(); + accept(); + } + }); + + b.setNegativeButton(activity.getResources().getString(R.string.retry), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + retry(); + } + }); + + b.setTitle("Error"); + b.show(); + } + + public void retry() + { + if(errorManager != null) + errorManager.Retry(this); + } + + public void accept() + { + if(errorManager != null) + errorManager.Accept(this); + } + +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/components/Calendar.java b/baselibrary/src/main/java/com/nelosan/baselibrary/components/Calendar.java new file mode 100644 index 00000000..d57d5832 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/components/Calendar.java @@ -0,0 +1,150 @@ +package com.nelosan.baselibrary.components; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.AdapterView; +import android.widget.GridView; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.nelosan.baselibrary.R; +import com.nelosan.baselibrary.adapter.AdapterCalendar; +import com.nelosan.baselibrary.controller.ControllerCalendar; +import com.nelosan.baselibrary.core.OnChangeDate; +import com.nelosan.baselibrary.model.CalendarItem; + +import java.util.List; + +/** + * Created by nelo on 15/06/15. + */ +public class Calendar extends LinearLayout { + + private GridView gCalendar; + + private TextViewRoboto txtCabecera; + private ImageView imgPreview, imgNext; + + private ControllerCalendar cCalendar; + private List items; + + private OnChangeDate change; + + + public Calendar(final Context context) { + super(context); + initialize(context); + } + + public Calendar(Context context, AttributeSet attrs) + { + super(context, attrs); + initialize(context); + } + + public Calendar(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + initialize(context); + } + + public void initialize(final Context context) + { + LayoutInflater.from(context).inflate(R.layout.calendar, this); + + cCalendar = new ControllerCalendar(getContext()); + + gCalendar = (GridView)findViewById(R.id.calendar); + txtCabecera = (TextViewRoboto)findViewById(R.id.calendar_textview_cabecera); + imgPreview = (ImageView)findViewById(R.id.calendar_imageview_previous_month); + imgNext = (ImageView)findViewById(R.id.calendar_imageview_next_month); + + imgPreview.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + cCalendar.addMonthCalendar(-1); + generarCalendario(context); + dibujarCabecera(); + } + }); + + imgNext.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + cCalendar.addMonthCalendar(+1); + generarCalendario(context); + dibujarCabecera(); + } + }); + + gCalendar.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapter, View view, int position, long id) { + + CalendarItem item = (CalendarItem) adapter.getItemAtPosition(position); + + if(item.isClick()) + { + for (CalendarItem it : items) + { + it.setSelected(false); + } + + item.setSelected(true); + + cCalendar.selectDate(item); + + generarCalendario(context); + changeDate(); + } + } + }); + + items = cCalendar.generateArrayDays(); + + generarCalendario(context); + dibujarCabecera(); + } + + + + public void dibujarCabecera() + { + txtCabecera.setText(cCalendar.getTextMonth()); + if(cCalendar.getActualMonth() == cCalendar.getMonth() + && cCalendar.getActualYear() == cCalendar.getYear()) + imgPreview.setVisibility(View.INVISIBLE); + else + imgPreview.setVisibility(View.VISIBLE); + txtCabecera.setTypeface(TextViewRoboto.ROBOTO_THIN); + } + + public void generarCalendario(Context context) + { + items = cCalendar.generateArrayDays(); + AdapterCalendar adapter = new AdapterCalendar(context, R.id.calendar, items); + gCalendar.setAdapter(adapter); + } + + public void setOnChangeDate(OnChangeDate change) + { + this.change = change; + } + + public void changeDate() + { + if(this.change != null) + change.OnChangeDate(cCalendar.getSelectedYear(), cCalendar.getSelectedMonth(), cCalendar.getSelectedDay()); + } + + public void setDate(int year, int month, int day) + { + cCalendar.setDate(year, month, day); + generarCalendario(getContext()); + dibujarCabecera(); + } + +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/components/TextViewRoboto.java b/baselibrary/src/main/java/com/nelosan/baselibrary/components/TextViewRoboto.java new file mode 100644 index 00000000..5aa58d9c --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/components/TextViewRoboto.java @@ -0,0 +1,54 @@ +package com.nelosan.baselibrary.components; + +import android.content.Context; +import android.graphics.Typeface; +import android.util.AttributeSet; +import android.widget.TextView; + +/** + * Created by nelo on 16/04/15. + */ +public class TextViewRoboto extends TextView { + + public static final String ROBOTO_BLACK = "Roboto-Black.ttf"; + public static final String ROBOTO_BLACK_ITALIC = "Roboto-BlackItalic.ttf"; + public static final String ROBOTO_BOLD = "Roboto-Bold.ttf"; + public static final String ROBOTO_BOLD_ITALIC = "Roboto-BoldItalic.ttf"; + public static final String ROBOTO_ITALIC = "Roboto-Italic.ttf"; + public static final String ROBOTO_LIGHT = "Roboto-Light.ttf"; + public static final String ROBOTO_LIGT_ITALIC = "Roboto-LightItalic.ttf"; + public static final String ROBOTO_MEDIUM = "Roboto-Medium.ttf"; + public static final String ROBOTO_MEDIUM_ITALIC = "Roboto-MediumItalic.ttf"; + public static final String ROBOTO_REGULAR = "Roboto-Regular.ttf"; + public static final String ROBOTO_THIN = "Roboto-Thin.ttf"; + public static final String ROBOTO_THIN_ITALIC = "Roboto-ThinItalic.ttf"; + + private Context context; + + public TextViewRoboto(Context context) { + super(context); + this.context = context; + setTypeface(ROBOTO_REGULAR); + } + + public TextViewRoboto(Context context, AttributeSet attrs) + { + super(context, attrs); + this.context = context; + setTypeface(ROBOTO_REGULAR); + } + + public TextViewRoboto(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + this.context = context; + setTypeface(ROBOTO_REGULAR); + } + + public void setTypeface(String typeface) + { + Typeface face=Typeface.createFromAsset(context.getAssets(), "fonts/"+typeface); + this.setTypeface(face); + } + +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/controller/ControllerCalendar.java b/baselibrary/src/main/java/com/nelosan/baselibrary/controller/ControllerCalendar.java new file mode 100644 index 00000000..8c6f3bd3 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/controller/ControllerCalendar.java @@ -0,0 +1,330 @@ +package com.nelosan.baselibrary.controller; + +import android.content.Context; + +import com.nelosan.baselibrary.R; +import com.nelosan.baselibrary.model.CalendarItem; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.List; + +/** + * Created by nelo on 17/06/15. + */ +public class ControllerCalendar { + + private java.util.Calendar calendar; + + /**** FECHA ACTUAL ****/ + private int actualYear, actualMonth, actualDay; + /**** FECHA DATOS ****/ + private int year, month, day; + /**** FECHA SELECCIONADA ****/ + private int selectedYear, selectedMonth, selectedDay; + + private Context context; + + public ControllerCalendar(Context context) + { + /**** CONSTRUCTOR POR DEFECTO ****/ + this.context = context; + initializeCalendar(); + setDate(actualYear, actualMonth, actualDay); + } + + public ControllerCalendar(Context context, int year, int month, int day) + { + /**** CONSTRUCTOR INDICANDO FECHA ****/ + this.context = context; + initializeCalendar(); + setDate(year, month, day); + } + + public void initializeCalendar() + { + /**** INICIALIZAMOS EL CALENDARIO ****/ + calendar = new GregorianCalendar(); + actualMonth = calendar.get(java.util.Calendar.MONTH); + actualYear = calendar.get(java.util.Calendar.YEAR); + actualDay = calendar.get(Calendar.DAY_OF_MONTH); + } + + public void setDate(int year, int month, int day) + { + /**** INICIALIZAMOS LOS VALORES ****/ + + this.year = year; + this.month = month; + this.day = day; + + this.selectedYear = year; + this.selectedMonth = month; + this.selectedDay = day; + + calendar.set(year, month, day); + } + + public List generateArrayDays() + { + return getMonthItems(year, month, day); + } + + public List getMonthItems(int year, int month, int day) + { + List days = new ArrayList<>(); + + /*** Generamos los días de la cabecera del calendario ***/ + getCalendarHeaderDays(days); + + /*** Generamos los días del mes anterior ***/ + generatePreviousDays(year, month, days); + + /*** Obtenemos el número de dias que tiene el mes ***/ + generateCurrentDays(days); + + /*** Generamos los días del mes posterior ***/ + generatePostDays(year, month, days); + + return days; + } + + private void getCalendarHeaderDays(List days) + { + String[] dias = {context.getResources().getString(R.string.calendar_monday), + context.getResources().getString(R.string.calendar_tuesday), + context.getResources().getString(R.string.calendar_wednesday), + context.getResources().getString(R.string.calendar_thursday), + context.getResources().getString(R.string.calendar_friday), + context.getResources().getString(R.string.calendar_saturday), + context.getResources().getString(R.string.calendar_sunday)}; + + for(String d : dias) + { + CalendarItem item = new CalendarItem(); + item.setValue(d); + item.setClick(false); + days.add(item); + } + } + + private void generatePreviousDays(int year, int month, List days) + { + + int leftDays = getFirstDayMonth(year, month); + + java.util.Calendar cal = generateCalendar(year, month); + cal.add(java.util.Calendar.MONTH, -1); + int pMonth = cal.get(java.util.Calendar.MONTH); + int pYear = cal.get(java.util.Calendar.YEAR); + + int numDaysAnterior = getDaysInMonthInPresentYear(pYear, pMonth); + + while (leftDays != 0) { + + int pDay = numDaysAnterior - leftDays + 1; + CalendarItem item = generateItem(pYear, pMonth, pDay, false); + days.add(item); + leftDays--; + } + + } + + private void generateCurrentDays(List days) + { + int numDays = getDaysInMonthInPresentYear(year, month); + + for (int day = 1; day<= numDays; day++) + { + boolean click; + if(day < this.actualDay && calendar.get(java.util.Calendar.MONTH) == actualMonth && calendar.get(java.util.Calendar.YEAR) == actualYear) + click = false; + else + click = true; + CalendarItem item = generateItem(year, month, day, click); + days.add(item); + } + } + + private void generatePostDays(int year, int month, List days) + { + java.util.Calendar cal = generateCalendar(year, month); + cal.add(java.util.Calendar.MONTH, 1); + int nMonth = cal.get(java.util.Calendar.MONTH); + int nYear = cal.get(java.util.Calendar.YEAR); + int weekday = getFirstDayMonth(nYear, nMonth); + int contador = weekday; + + while (contador != 7) { + int nDay = 1 + contador - weekday; + CalendarItem item = generateItem(nYear, nMonth, nDay, false); + days.add(item); + contador++; + } + } + + private CalendarItem generateItem(int year, int month, int day, boolean click) + { + CalendarItem item = new CalendarItem(); + item.setDay(day); + item.setMonth(month); + item.setYear(year); + item.setValue("" + day); + item.setClick(click); + + if(this.selectedYear == year && this.selectedMonth == month && this.selectedDay == day) + { + item.setSelected(true); + } + + return item; + } + + private int getFirstDayMonth(int year, int month) + { + java.util.Calendar cal = generateCalendar(year, month); + cal.set(java.util.Calendar.DAY_OF_MONTH, 1); + switch (cal.get(java.util.Calendar.DAY_OF_WEEK)) { + case java.util.Calendar.MONDAY: + return 0; + case java.util.Calendar.TUESDAY: + return 1; + case java.util.Calendar.WEDNESDAY: + return 2; + case java.util.Calendar.THURSDAY: + return 3; + case java.util.Calendar.FRIDAY: + return 4; + case java.util.Calendar.SATURDAY: + return 5; + case java.util.Calendar.SUNDAY: + return 6; + } + return 0; + } + + private int getDaysInMonthInPresentYear(int year, int month) + { + int days=0; + if(month>=0 && month<12){ + try + { + java.util.Calendar calendar = java.util.Calendar.getInstance(); + int date = 1; + calendar.set(year, month, date); + days = calendar.getActualMaximum(java.util.Calendar.DAY_OF_MONTH); + } catch (Exception e) + { + if(e!=null) + e.printStackTrace(); + } + } + return days; + } + + public String getTextMonth() + { + String text = ""; + java.util.Calendar cal = generateCalendar(year, month); + switch (cal.get(java.util.Calendar.MONTH)) { + case java.util.Calendar.JANUARY: + text += context.getResources().getString(R.string.january); + break; + case java.util.Calendar.FEBRUARY: + text += context.getResources().getString(R.string.february); + break; + case java.util.Calendar.MARCH: + text += context.getResources().getString(R.string.march); + break; + case java.util.Calendar.APRIL: + text += context.getResources().getString(R.string.april); + break; + case java.util.Calendar.MAY: + text += context.getResources().getString(R.string.may); + break; + case java.util.Calendar.JUNE: + text += context.getResources().getString(R.string.june); + break; + case java.util.Calendar.JULY: + text += context.getResources().getString(R.string.july); + break; + case java.util.Calendar.AUGUST: + text += context.getResources().getString(R.string.august); + break; + case java.util.Calendar.SEPTEMBER: + text += context.getResources().getString(R.string.september); + break; + case java.util.Calendar.OCTOBER: + text += context.getResources().getString(R.string.october); + break; + case java.util.Calendar.NOVEMBER: + text += context.getResources().getString(R.string.november); + break; + case java.util.Calendar.DECEMBER: + text += context.getResources().getString(R.string.december); + break; + } + + text += " de "+year; + + return text; + } + + + public java.util.Calendar generateCalendar(int year, int month) + { + java.util.Calendar cal = new GregorianCalendar(); + cal.set(java.util.Calendar.MONTH, month); + cal.set(java.util.Calendar.YEAR, year); + + return cal; + } + + public void addMonthCalendar(int mon) + { + calendar.add(java.util.Calendar.MONTH, mon); + year = calendar.get(Calendar.YEAR); + month = calendar.get(Calendar.MONTH); + day = calendar.get(Calendar.DAY_OF_MONTH); + } + + public void selectDate(CalendarItem item) + { + this.selectedYear = item.getYear(); + this.selectedMonth = item.getMonth(); + this.selectedDay = item.getDay(); + } + + public int getActualYear() { + return actualYear; + } + + public int getActualMonth() { + return actualMonth; + } + + public Calendar getCalendar() { + return calendar; + } + + public int getSelectedYear() { + return selectedYear; + } + + public int getSelectedMonth() { + return selectedMonth; + } + + public int getSelectedDay() { + return selectedDay; + } + + public int getYear() { + return year; + } + + public int getMonth() { + return month; + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/CircleTransform.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/CircleTransform.java new file mode 100644 index 00000000..dfa3b6bf --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/CircleTransform.java @@ -0,0 +1,47 @@ +package com.nelosan.baselibrary.core; + + +import android.graphics.Bitmap; +import android.graphics.BitmapShader; +import android.graphics.Canvas; +import android.graphics.Paint; + +import com.squareup.picasso.Transformation; + +/** + * Created by nelo on 21/01/15. + */ +public class CircleTransform implements Transformation { + @Override + public Bitmap transform(Bitmap source) { + int size = Math.min(source.getWidth(), source.getHeight()); + + int x = (source.getWidth() - size) / 2; + int y = (source.getHeight() - size) / 2; + + Bitmap squaredBitmap = Bitmap.createBitmap(source, x, y, size, size); + if (squaredBitmap != source) { + source.recycle(); + } + + Bitmap bitmap = Bitmap.createBitmap(size, size, source.getConfig()); + + Canvas canvas = new Canvas(bitmap); + Paint paint = new Paint(); + BitmapShader shader = new BitmapShader(squaredBitmap, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP); + paint.setShader(shader); + paint.setAntiAlias(true); + + float r = size/2f; + canvas.drawCircle(r, r, r, paint); + + + squaredBitmap.recycle(); + return bitmap; + } + + @Override + public String key() { + return "circle"; + } +} \ No newline at end of file diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/CircleTransformBorder.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/CircleTransformBorder.java new file mode 100644 index 00000000..c1b6abf2 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/CircleTransformBorder.java @@ -0,0 +1,59 @@ +package com.nelosan.baselibrary.core; + +import android.graphics.Bitmap; +import android.graphics.BitmapShader; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; + +import com.squareup.picasso.Transformation; + +/** + * Created by nelo on 27/05/15. + */ +public class CircleTransformBorder implements Transformation { + private final int BORDER_COLOR = Color.WHITE; + private final int BORDER_RADIUS = 5; + + @Override + public Bitmap transform(Bitmap source) { + int size = Math.min(source.getWidth(), source.getHeight()); + + int x = (source.getWidth() - size) / 2; + int y = (source.getHeight() - size) / 2; + + Bitmap squaredBitmap = Bitmap.createBitmap(source, x, y, size, size); + if (squaredBitmap != source) { + source.recycle(); + } + + Bitmap bitmap = Bitmap.createBitmap(size, size, source.getConfig()); + + Canvas canvas = new Canvas(bitmap); + Paint paint = new Paint(); + BitmapShader shader = new BitmapShader(squaredBitmap, BitmapShader.TileMode.CLAMP, BitmapShader.TileMode.CLAMP); + paint.setShader(shader); + paint.setAntiAlias(true); + + float r = size / 2f; + + // Prepare the background + Paint paintBg = new Paint(); + paintBg.setColor(BORDER_COLOR); + paintBg.setAntiAlias(true); + + // Draw the background circle + canvas.drawCircle(r, r, r, paintBg); + + // Draw the image smaller than the background so a little border will be seen + canvas.drawCircle(r, r, r - BORDER_RADIUS, paint); + + squaredBitmap.recycle(); + return bitmap; + } + + @Override + public String key() { + return "circle"; + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/CommandError.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/CommandError.java new file mode 100644 index 00000000..dc59822e --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/CommandError.java @@ -0,0 +1,11 @@ +package com.nelosan.baselibrary.core; + +import com.nelosan.baselibrary.command.CommandBase; + +/** + * Created by nelo on 27/10/15. + */ +public interface CommandError { + public void Retry(CommandBase cmd); + public void Accept(CommandBase cmd); +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/CommandOperation.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/CommandOperation.java new file mode 100644 index 00000000..0051c51e --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/CommandOperation.java @@ -0,0 +1,11 @@ +package com.nelosan.baselibrary.core; + +import com.nelosan.baselibrary.command.CommandBase; + +/** + * Created by nelo on 13/01/15. + */ +public interface CommandOperation { + public void Realice(CommandBase cmd); + +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/DireccionesGestureDetector.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/DireccionesGestureDetector.java new file mode 100644 index 00000000..4c6b660b --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/DireccionesGestureDetector.java @@ -0,0 +1,80 @@ +package com.nelosan.baselibrary.core; + +import android.content.Context; +import android.util.Log; +import android.view.GestureDetector; +import android.view.MotionEvent; + +/** + * Created by Jes�s Tom�s on 04/05/2015. + */ +public class DireccionesGestureDetector extends GestureDetector { + + public interface OnDireccionesGestureListener extends OnGestureListener { + boolean onDerecha(MotionEvent e1, MotionEvent e2, float distX, float distY); + boolean onIzquierda(MotionEvent e1, MotionEvent e2, float distX, float distY); + boolean onArriba(MotionEvent e1, MotionEvent e2, float distX, float distY); + boolean onAbajo(MotionEvent e1, MotionEvent e2, float distX, float distY); + } + + OnDireccionesGestureListener listener; + MotionEvent antiguaPulsacion; + boolean pulsando = false; + float distMin = 20; + + public DireccionesGestureDetector(Context c, OnDireccionesGestureListener listener) { + super(c, listener); + this.listener = listener; + } + + public boolean onTouchEvent(MotionEvent evento) { + boolean procesado = false; + if (evento.getAction() == MotionEvent.ACTION_DOWN) { + antiguaPulsacion = MotionEvent.obtain(evento); + pulsando = true; + } else if (evento.getAction() == MotionEvent.ACTION_UP && pulsando) { + pulsando = false; + float distX = antiguaPulsacion.getX() - evento.getX(); + float distY = antiguaPulsacion.getY() - evento.getY(); + if ((Math.abs(distX / distY) > 2) && (distX > distMin)) { + procesado = listener.onIzquierda(antiguaPulsacion, evento, distX, distY); + } + if ((Math.abs(distX / distY) > 2) && (-distX > distMin)) { + procesado = listener.onDerecha(antiguaPulsacion, evento, distX, distY); + } + if ((Math.abs(distY / distX) > 2) && (distY > distMin)) { + procesado = listener.onArriba(antiguaPulsacion, evento, distX, distY); + } + if ((Math.abs(distY / distX) > 2) && (-distY > distMin)) { + procesado = listener.onAbajo(antiguaPulsacion, evento, distX, distY); + } + } + return procesado || super.onTouchEvent(evento); + } + + + public static class SimpleOnDireccionesGestureListener + extends SimpleOnGestureListener + implements OnDireccionesGestureListener{ + + @Override + public boolean onDerecha(MotionEvent e1, MotionEvent e2, float distX, float distY) { + return false; + } + + @Override + public boolean onIzquierda(MotionEvent e1, MotionEvent e2, float distX, float distY) { + return false; + } + + @Override + public boolean onArriba(MotionEvent e1, MotionEvent e2, float distX, float distY) { + return false; + } + + @Override + public boolean onAbajo(MotionEvent e1, MotionEvent e2, float distX, float distY) { + return false; + } + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/ErrorInfo.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/ErrorInfo.java new file mode 100644 index 00000000..38cd9c54 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/ErrorInfo.java @@ -0,0 +1,20 @@ +package com.nelosan.baselibrary.core; + +public class ErrorInfo +{ + private String Type; + private String Message; + + public String getType() { + return Type; + } + public void setType(String type) { + Type = type; + } + public String getMessage() { + return Message; + } + public void setMessage(String message) { + Message = message; + } +} \ No newline at end of file diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/FacadeException.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/FacadeException.java new file mode 100644 index 00000000..3a50544e --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/FacadeException.java @@ -0,0 +1,16 @@ +package com.nelosan.baselibrary.core; + +public class FacadeException extends RuntimeException{ + + public FacadeException(String s) { super(s); } + private String Type; + + public String getType() { + return Type; + } + public void setType(String type) { + Type = type; + } + + +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/FacadeUserException.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/FacadeUserException.java new file mode 100644 index 00000000..d51cd437 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/FacadeUserException.java @@ -0,0 +1,18 @@ +package com.nelosan.baselibrary.core; + +public class FacadeUserException extends RuntimeException +{ + public FacadeUserException(String message) + { + super(message); + } + + public FacadeUserException(String message, String Type) + { + super(message); + this.Type = Type; + } + + public String Type; + +} \ No newline at end of file diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/FileManager.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/FileManager.java new file mode 100644 index 00000000..e4caacab --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/FileManager.java @@ -0,0 +1,117 @@ +package com.nelosan.baselibrary.core; + +import android.content.Context; +import android.graphics.Movie; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import com.google.gson.reflect.TypeToken; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Dictionary; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by nelo on 30/01/15. + */ +public class FileManager { + + + public static void guardarFichero(String filename, Object objeto, Context context) + { + FileOutputStream outputStream; + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + String json = gson.toJson(objeto); + + try { + outputStream = context.openFileOutput(filename, Context.MODE_PRIVATE); + outputStream.write(json.getBytes()); + outputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static Object recuperarFichero(String filename, Type tipo, Context context) + { + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + String result = readFile(filename, context); + + return gson.fromJson(result, tipo); + } + + public static List recuperarFicheroLista(String filename, final Class tipo, Context context) + { + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + String result = readFile(filename, context); + + JsonParser parser = new JsonParser(); + JsonArray array = parser.parse(result).getAsJsonArray(); + + List lst = new ArrayList(); + for(final JsonElement json: array){ + T entity = gson.fromJson(json, tipo); + lst.add(entity); + } + + return lst; + } + + public static Map recuperarSession(String filename, Context context) + { + String result = readFile(filename, context); + + if(result.equals("")) + return null; + + Map map = new Gson().fromJson(result, new TypeToken>() {}.getType()); + + return map; + } + + + public static void borrarFichero(String filename, Context context) + { + File dir = context.getFilesDir(); + File file = new File(dir, filename); + file.delete(); + } + + private static String readFile(String filename, Context context) + { + String result = ""; + try { + FileInputStream inputStream = context.openFileInput(filename); + BufferedReader entrada; + entrada = new BufferedReader(new InputStreamReader(inputStream)); + String linea; + do { + linea = entrada.readLine(); + if(linea != null) { + result += linea; + } + } while (linea != null); + inputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + return result; + } + + +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/OnChangeDate.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/OnChangeDate.java new file mode 100644 index 00000000..c3f40c41 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/OnChangeDate.java @@ -0,0 +1,9 @@ +package com.nelosan.baselibrary.core; + +/** + * Created by nelo on 13/01/15. + */ +public interface OnChangeDate { + public void OnChangeDate(int year, int month, int day); + +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/RoundedTransformation.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/RoundedTransformation.java new file mode 100644 index 00000000..90b550e1 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/RoundedTransformation.java @@ -0,0 +1,45 @@ +package com.nelosan.baselibrary.core; + +import android.graphics.Bitmap; +import android.graphics.BitmapShader; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.RectF; +import android.graphics.Shader; + +/** + * Created by nelo on 4/06/15. + */ +public class RoundedTransformation implements com.squareup.picasso.Transformation { + private final int radius; + private final int margin; // dp + + // radius is corner radii in dp + // margin is the board in dp + public RoundedTransformation(final int radius, final int margin) { + this.radius = radius; + this.margin = margin; + } + + @Override + public Bitmap transform(final Bitmap source) { + final Paint paint = new Paint(); + paint.setAntiAlias(true); + paint.setShader(new BitmapShader(source, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP)); + + Bitmap output = Bitmap.createBitmap(source.getWidth(), source.getHeight(), Bitmap.Config.ARGB_8888); + Canvas canvas = new Canvas(output); + canvas.drawRoundRect(new RectF(margin, margin, source.getWidth() - margin, source.getHeight() - margin), radius, radius, paint); + + if (source != output) { + source.recycle(); + } + + return output; + } + + @Override + public String key() { + return "rounded"; + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/core/Util.java b/baselibrary/src/main/java/com/nelosan/baselibrary/core/Util.java new file mode 100644 index 00000000..1ed35956 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/core/Util.java @@ -0,0 +1,17 @@ +package com.nelosan.baselibrary.core; + +/** + * Created by nelo on 24/06/15. + */ +public class Util { + + public static boolean isInt(String s) { + + try { + Integer.parseInt(s); + return true; + } catch (NumberFormatException e) { + return false; + } + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/dialog/DialogBuscar.java b/baselibrary/src/main/java/com/nelosan/baselibrary/dialog/DialogBuscar.java new file mode 100644 index 00000000..f2dbb225 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/dialog/DialogBuscar.java @@ -0,0 +1,183 @@ +package com.nelosan.baselibrary.dialog; + +import android.app.Dialog; +import android.graphics.drawable.Drawable; +import android.os.Bundle; +import android.text.Editable; +import android.text.InputType; +import android.text.TextWatcher; +import android.view.Gravity; +import android.view.KeyEvent; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; +import android.view.inputmethod.EditorInfo; +import android.widget.AbsListView; +import android.widget.AdapterView; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.ListView; +import android.widget.TextView; + +import com.nelosan.baselibrary.ActivityBase; +import com.nelosan.baselibrary.R; +import com.nelosan.baselibrary.adapter.AdapterResultadosBusqueda; +import com.nelosan.baselibrary.model.ResultadoBusqueda; + +import java.util.ArrayList; +import java.util.List; + + +/** + * Created by nelo on 30/03/15. + */ +public class DialogBuscar extends Dialog{ + + protected ActivityBase activity; + protected ListView lstResultados; + protected EditText edtBuscar; + protected ImageView imgIcono, imgBack; + protected int imagenId = -1; + //private List busquedasAnteriores; + + public static final String FILE_DIALOG_BUSCAR = "file_dialog_buscar.txt"; + + public DialogBuscar(ActivityBase a) { + super(a); + this.activity = a; + } + + public DialogBuscar(ActivityBase a, int image) + { + super(a); + this.activity = a; + this.imagenId = image; + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + requestWindowFeature(Window.FEATURE_NO_TITLE); + setContentView(R.layout.dialog_buscar); + + WindowManager.LayoutParams wmlp = this.getWindow().getAttributes(); + wmlp.gravity = Gravity.TOP | Gravity.CENTER; + wmlp.width = activity.getWindow().getAttributes().width; + imgIcono = (ImageView) findViewById(R.id.imageview_dialog_buscar_icono); + + if(imagenId != -1) + { + Drawable d = activity.getResources().getDrawable(imagenId); + imgIcono.setImageDrawable(d); + } + + imgIcono.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + activity.clickImagenDialog(DialogBuscar.this); + } + }); + + edtBuscar = (EditText)findViewById(R.id.edittext_dialog_buscar_busqueda); + + edtBuscar.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + if (actionId == EditorInfo.IME_ACTION_SEARCH) { + dismiss(); + activity.cerrarTeclado(edtBuscar); + activity.buscar(edtBuscar.getText().toString()); + + return true; + } + + return false; + } + }); + + + edtBuscar.addTextChangedListener(new TextWatcher() { + + public void afterTextChanged(Editable s) { + + } + + public void beforeTextChanged(CharSequence s, int start, int count, int after) {} + + public void onTextChanged(CharSequence s, int start, int before, int count) { + activity.autocompletarDialog(s.toString(), DialogBuscar.this); + } + }); + + lstResultados = (ListView)findViewById(R.id.listview_dialog_buscar_resultados); + + lstResultados.setOnScrollListener(new AbsListView.OnScrollListener() { + @Override + public void onScrollStateChanged(AbsListView view, int scrollState) { + activity.cerrarTeclado(edtBuscar); + } + + @Override + public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { + + } + }); + + lstResultados.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView parent, View view, int position, long id) { + ResultadoBusqueda resultado = (ResultadoBusqueda) parent.getItemAtPosition(position); + onClickItem(resultado); + } + }); + + imgBack = (ImageView)findViewById(R.id.imageview_dialog_buscar_atras); + imgBack.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + activity.cerrarTeclado(edtBuscar); + DialogBuscar.this.dismiss(); + } + }); + + activity.abrirTeclado(edtBuscar); + + } + + public void setResultados(List resultados) + { + List res = new ArrayList(); + //res.addAll(busquedasAnteriores); + res.addAll(resultados); + + AdapterResultadosBusqueda adapter = new AdapterResultadosBusqueda(activity, R.layout.item_resultados_buscar, res); + lstResultados.setAdapter(adapter); + } + + protected void onClickItem(ResultadoBusqueda resultado) { + dismiss(); + activity.clickItemDialogBuscar(resultado); + } + + @Override + public void dismiss() { + activity.cerrarTeclado(edtBuscar); + super.dismiss(); + } + + + public int getImagenId() { + return imagenId; + } + + public EditText getEdtBuscar() { + return edtBuscar; + } + + public void setKeyboard(boolean isNumeric){ + if(isNumeric) + edtBuscar.setInputType(InputType.TYPE_CLASS_NUMBER); + else + edtBuscar.setInputType(InputType.TYPE_CLASS_TEXT); + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/fragment/FragmentBase.java b/baselibrary/src/main/java/com/nelosan/baselibrary/fragment/FragmentBase.java new file mode 100644 index 00000000..a4185c82 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/fragment/FragmentBase.java @@ -0,0 +1,71 @@ +package com.nelosan.baselibrary.fragment; + +import android.app.Activity; +import android.app.Fragment; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary.ActivityBase; +import com.nelosan.baselibrary.command.CommandBase; + + +/** + * Created by nelo on 12/01/15. + */ +public class FragmentBase extends Fragment { + + private ActivityBase activity; + protected ProgressBar progress; + protected View contenedor; + + @Override + public void onAttach(Activity activity) { + super.onAttach(activity); + this.activity = (ActivityBase) activity; + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + return super.onCreateView(inflater, container, savedInstanceState); + } + + public void setProgress(ProgressBar progress) { + /** Establece el progressbar de un fragment **/ + ((ActivityBase) getActivity()).setProgress(progress); + } + + public class OnClick implements View.OnClickListener { + @Override + public void onClick(View view) { + setClickActions(view.getId()); + } + } + + protected void setClickActions(int id) {} + + public void execute(CommandBase cmd) { + activity.execute(cmd); + } + + public void showProgress(boolean show) { + if (show) { + progress.setVisibility(View.VISIBLE); + contenedor.setVisibility(View.GONE); + } else { + progress.setVisibility(View.GONE); + contenedor.setVisibility(View.VISIBLE); + } + } + + protected void loadArgs(Bundle args) { + } + + @Override + public void onResume() { + super.onResume(); + activity.setFragmentActivo(this); + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/fragment/FragmentCarga.java b/baselibrary/src/main/java/com/nelosan/baselibrary/fragment/FragmentCarga.java new file mode 100644 index 00000000..866e706d --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/fragment/FragmentCarga.java @@ -0,0 +1,34 @@ +package com.nelosan.baselibrary.fragment; + +import android.app.Activity; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary.R; + + +public class FragmentCarga extends FragmentBase{ + + ProgressBar progressBar; + + @Override + public void onAttach(Activity activity) { + // TODO Auto-generated method stub + super.onAttach(activity); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // TODO Auto-generated method stub + View view = inflater.inflate(R.layout.fragment_carga, container, false); + + progressBar = (ProgressBar)view.findViewById(R.id.progress_fragment_carga); + setProgress(progressBar); + + return view; + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/model/CalendarItem.java b/baselibrary/src/main/java/com/nelosan/baselibrary/model/CalendarItem.java new file mode 100644 index 00000000..41001e47 --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/model/CalendarItem.java @@ -0,0 +1,60 @@ +package com.nelosan.baselibrary.model; + +/** + * Created by nelo on 15/06/15. + */ +public class CalendarItem { + + private int day, month, year; + private String value = ""; + private boolean click; + private boolean selected = false; + + public int getDay() { + return day; + } + + public void setDay(int day) { + this.day = day; + } + + public int getMonth() { + return month; + } + + public void setMonth(int month) { + this.month = month; + } + + public int getYear() { + return year; + } + + public void setYear(int year) { + this.year = year; + } + + public boolean isClick() { + return click; + } + + public void setClick(boolean click) { + this.click = click; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public boolean isSelected() { + return selected; + } + + public void setSelected(boolean selected) { + this.selected = selected; + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/model/ResultadoBusqueda.java b/baselibrary/src/main/java/com/nelosan/baselibrary/model/ResultadoBusqueda.java new file mode 100644 index 00000000..aba8fb5f --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/model/ResultadoBusqueda.java @@ -0,0 +1,41 @@ +package com.nelosan.baselibrary.model; + +/** + * Created by nelo on 31/03/15. + */ +public class ResultadoBusqueda { + + private String Nombre; + private String Url; + private Object value; + + public ResultadoBusqueda() + { + this.Nombre = ""; + this.Url = ""; + } + + public String getNombre() { + return Nombre; + } + + public void setNombre(String nombre) { + Nombre = nombre; + } + + public String getUrl() { + return Url; + } + + public void setUrl(String url) { + Url = url; + } + + public Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/toolbar/ToolbarBuscar.java b/baselibrary/src/main/java/com/nelosan/baselibrary/toolbar/ToolbarBuscar.java new file mode 100644 index 00000000..6ce27a4e --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/toolbar/ToolbarBuscar.java @@ -0,0 +1,74 @@ +package com.nelosan.baselibrary.toolbar; + +import android.content.Context; +import android.text.Editable; +import android.text.TextWatcher; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.View; +import android.view.inputmethod.EditorInfo; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.nelosan.baselibrary.ActivityBase; +import com.nelosan.baselibrary.R; + + +/** + * Created by nelo on 26/03/15. + */ +public class ToolbarBuscar extends RelativeLayout { + + private ActivityBase activity; + private EditText edtTexto; + private ImageView imgAtras; + private View viewAnterior; + private int color, darkColor; + + public ToolbarBuscar(Context context) { + super(context); + LayoutInflater.from(context).inflate(R.layout.toolbar_buscar, this); + activity = (ActivityBase)context; + viewAnterior = activity.getToolbar().getChildAt(0); + color = activity.getToolbarColor(); + darkColor = activity.getToolbarDarkColor(); + edtTexto = (EditText)findViewById(R.id.edittext_toolbar_buscar_texto); + activity.abrirTeclado(edtTexto); + edtTexto.setOnEditorActionListener(new TextView.OnEditorActionListener() { + @Override + public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { + if (actionId == EditorInfo.IME_ACTION_SEARCH) { + activity.cerrarTeclado(edtTexto); + activity.buscar(edtTexto.getText().toString()); + activity.crearToolbar(viewAnterior, color, darkColor); + return true; + } + + return false; + } + }); + edtTexto.addTextChangedListener(new TextWatcher() { + + public void afterTextChanged(Editable s) {} + + public void beforeTextChanged(CharSequence s, int start, int count, int after) {} + + public void onTextChanged(CharSequence s, int start, int before, int count) { + activity.buscar(s.toString()); + } + }); + imgAtras = (ImageView)findViewById(R.id.imageview_toolbar_buscar_atras); + imgAtras.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + activity.cerrarTeclado(edtTexto); + activity.crearToolbar(viewAnterior, color, darkColor); + activity.buscar(""); + } + }); + + } + +} diff --git a/baselibrary/src/main/java/com/nelosan/baselibrary/toolbar/ToolbarColores.java b/baselibrary/src/main/java/com/nelosan/baselibrary/toolbar/ToolbarColores.java new file mode 100644 index 00000000..37a4746f --- /dev/null +++ b/baselibrary/src/main/java/com/nelosan/baselibrary/toolbar/ToolbarColores.java @@ -0,0 +1,81 @@ +package com.nelosan.baselibrary.toolbar; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.nelosan.baselibrary.ActivityBase; +import com.nelosan.baselibrary.R; +import com.nelosan.baselibrary.dialog.DialogBuscar; + + +/** + * Created by nelo on 26/03/15. + */ +public class ToolbarColores extends LinearLayout { + + protected ActivityBase activity; + protected TextView txtTitulo; + protected ImageView imgBuscar; + private String tipoBusqueda; + private View separacion; + public static final String BUSCAR_NORMAL = "buscar_normal"; + public static final String BUSCAR_DIALOG = "buscar_dialog"; + + public ToolbarColores(Context context, String titulo, boolean buscar) { + super(context); + LayoutInflater.from(context).inflate(R.layout.toolbar_colores, this); + tipoBusqueda = BUSCAR_NORMAL; + inicializar(context, titulo, buscar); + } + + public ToolbarColores(Context context, String titulo, boolean buscar, String tipo) { + super(context); + LayoutInflater.from(context).inflate(R.layout.toolbar_colores, this); + tipoBusqueda = tipo; + inicializar(context, titulo, buscar); + } + + private void inicializar(Context context, String titulo, boolean buscar) + { + activity = (ActivityBase)context; + separacion = (View)findViewById(R.id.view_toolbar_colores_separacion); + txtTitulo = (TextView)findViewById(R.id.textview_toolbar_colores_titulo); + txtTitulo.setText(titulo); + imgBuscar = (ImageView)findViewById(R.id.imageview_toolbar_colores_buscar); + if(!buscar) + imgBuscar.setVisibility(View.GONE); + + imgBuscar.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + clickBuscar(); + } + }); + } + + public void clickBuscar() + { + if(tipoBusqueda.equals(BUSCAR_NORMAL)) + activity.crearToolbar(new ToolbarBuscar(activity), activity.getResources().getColor(R.color.blanco), activity.getResources().getColor(R.color.negro)); + else if(tipoBusqueda.equals(BUSCAR_DIALOG)) + { + DialogBuscar dialog = new DialogBuscar(activity); + dialog.show(); + } + } + + public void modificarToolbarcoloresClaros() + { + this.txtTitulo.setTextColor(activity.getResources().getColor(R.color.gris_buscar)); + this.imgBuscar.setImageDrawable(activity.getResources().getDrawable(R.drawable.ic_action_search_dark)); + } + + public void setSeparacion(int visibilidad) + { + separacion.setVisibility(visibilidad); + } +} diff --git a/baselibrary/src/main/res/anim/mostrar_detalle.xml b/baselibrary/src/main/res/anim/mostrar_detalle.xml new file mode 100644 index 00000000..ac646e94 --- /dev/null +++ b/baselibrary/src/main/res/anim/mostrar_detalle.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/anim/quitar_detalle.xml b/baselibrary/src/main/res/anim/quitar_detalle.xml new file mode 100644 index 00000000..36a23851 --- /dev/null +++ b/baselibrary/src/main/res/anim/quitar_detalle.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/drawable-hdpi/ic_action_back.png b/baselibrary/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 00000000..bff21fbd Binary files /dev/null and b/baselibrary/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/baselibrary/src/main/res/drawable-hdpi/ic_action_mic.png b/baselibrary/src/main/res/drawable-hdpi/ic_action_mic.png new file mode 100644 index 00000000..0706f9d7 Binary files /dev/null and b/baselibrary/src/main/res/drawable-hdpi/ic_action_mic.png differ diff --git a/baselibrary/src/main/res/drawable-hdpi/ic_action_next_item.png b/baselibrary/src/main/res/drawable-hdpi/ic_action_next_item.png new file mode 100644 index 00000000..67f14821 Binary files /dev/null and b/baselibrary/src/main/res/drawable-hdpi/ic_action_next_item.png differ diff --git a/baselibrary/src/main/res/drawable-hdpi/ic_action_previous_item.png b/baselibrary/src/main/res/drawable-hdpi/ic_action_previous_item.png new file mode 100644 index 00000000..e861ecce Binary files /dev/null and b/baselibrary/src/main/res/drawable-hdpi/ic_action_previous_item.png differ diff --git a/baselibrary/src/main/res/drawable-hdpi/ic_action_replay.png b/baselibrary/src/main/res/drawable-hdpi/ic_action_replay.png new file mode 100644 index 00000000..93a0f670 Binary files /dev/null and b/baselibrary/src/main/res/drawable-hdpi/ic_action_replay.png differ diff --git a/baselibrary/src/main/res/drawable-hdpi/ic_action_search.png b/baselibrary/src/main/res/drawable-hdpi/ic_action_search.png new file mode 100644 index 00000000..772e3598 Binary files /dev/null and b/baselibrary/src/main/res/drawable-hdpi/ic_action_search.png differ diff --git a/baselibrary/src/main/res/drawable-hdpi/ic_action_search_dark.png b/baselibrary/src/main/res/drawable-hdpi/ic_action_search_dark.png new file mode 100644 index 00000000..f594b4e4 Binary files /dev/null and b/baselibrary/src/main/res/drawable-hdpi/ic_action_search_dark.png differ diff --git a/baselibrary/src/main/res/drawable-mdpi/ic_action_back.png b/baselibrary/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 00000000..de49971d Binary files /dev/null and b/baselibrary/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/baselibrary/src/main/res/drawable-mdpi/ic_action_mic.png b/baselibrary/src/main/res/drawable-mdpi/ic_action_mic.png new file mode 100644 index 00000000..360a575e Binary files /dev/null and b/baselibrary/src/main/res/drawable-mdpi/ic_action_mic.png differ diff --git a/baselibrary/src/main/res/drawable-mdpi/ic_action_next_item.png b/baselibrary/src/main/res/drawable-mdpi/ic_action_next_item.png new file mode 100644 index 00000000..47365a30 Binary files /dev/null and b/baselibrary/src/main/res/drawable-mdpi/ic_action_next_item.png differ diff --git a/baselibrary/src/main/res/drawable-mdpi/ic_action_previous_item.png b/baselibrary/src/main/res/drawable-mdpi/ic_action_previous_item.png new file mode 100644 index 00000000..4ad2df42 Binary files /dev/null and b/baselibrary/src/main/res/drawable-mdpi/ic_action_previous_item.png differ diff --git a/baselibrary/src/main/res/drawable-mdpi/ic_action_replay.png b/baselibrary/src/main/res/drawable-mdpi/ic_action_replay.png new file mode 100644 index 00000000..71dfae2d Binary files /dev/null and b/baselibrary/src/main/res/drawable-mdpi/ic_action_replay.png differ diff --git a/baselibrary/src/main/res/drawable-mdpi/ic_action_search.png b/baselibrary/src/main/res/drawable-mdpi/ic_action_search.png new file mode 100644 index 00000000..4edb1ff9 Binary files /dev/null and b/baselibrary/src/main/res/drawable-mdpi/ic_action_search.png differ diff --git a/baselibrary/src/main/res/drawable-mdpi/ic_action_search_dark.png b/baselibrary/src/main/res/drawable-mdpi/ic_action_search_dark.png new file mode 100644 index 00000000..2e446ec0 Binary files /dev/null and b/baselibrary/src/main/res/drawable-mdpi/ic_action_search_dark.png differ diff --git a/baselibrary/src/main/res/drawable-xhdpi/ic_action_back.png b/baselibrary/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 00000000..28432f10 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/baselibrary/src/main/res/drawable-xhdpi/ic_action_mic.png b/baselibrary/src/main/res/drawable-xhdpi/ic_action_mic.png new file mode 100644 index 00000000..0c2814f0 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xhdpi/ic_action_mic.png differ diff --git a/baselibrary/src/main/res/drawable-xhdpi/ic_action_next_item.png b/baselibrary/src/main/res/drawable-xhdpi/ic_action_next_item.png new file mode 100644 index 00000000..5f304742 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xhdpi/ic_action_next_item.png differ diff --git a/baselibrary/src/main/res/drawable-xhdpi/ic_action_previous_item.png b/baselibrary/src/main/res/drawable-xhdpi/ic_action_previous_item.png new file mode 100644 index 00000000..ed8ac91d Binary files /dev/null and b/baselibrary/src/main/res/drawable-xhdpi/ic_action_previous_item.png differ diff --git a/baselibrary/src/main/res/drawable-xhdpi/ic_action_replay.png b/baselibrary/src/main/res/drawable-xhdpi/ic_action_replay.png new file mode 100644 index 00000000..d6671f3b Binary files /dev/null and b/baselibrary/src/main/res/drawable-xhdpi/ic_action_replay.png differ diff --git a/baselibrary/src/main/res/drawable-xhdpi/ic_action_search.png b/baselibrary/src/main/res/drawable-xhdpi/ic_action_search.png new file mode 100644 index 00000000..19658e4a Binary files /dev/null and b/baselibrary/src/main/res/drawable-xhdpi/ic_action_search.png differ diff --git a/baselibrary/src/main/res/drawable-xhdpi/ic_action_search_dark.png b/baselibrary/src/main/res/drawable-xhdpi/ic_action_search_dark.png new file mode 100644 index 00000000..aad535e9 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xhdpi/ic_action_search_dark.png differ diff --git a/baselibrary/src/main/res/drawable-xxhdpi/ic_action_back.png b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 00000000..46184bd0 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/baselibrary/src/main/res/drawable-xxhdpi/ic_action_mic.png b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_mic.png new file mode 100644 index 00000000..c80c4b95 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_mic.png differ diff --git a/baselibrary/src/main/res/drawable-xxhdpi/ic_action_next_item.png b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_next_item.png new file mode 100644 index 00000000..51479d8d Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_next_item.png differ diff --git a/baselibrary/src/main/res/drawable-xxhdpi/ic_action_previous_item.png b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_previous_item.png new file mode 100644 index 00000000..bc8ff124 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_previous_item.png differ diff --git a/baselibrary/src/main/res/drawable-xxhdpi/ic_action_replay.png b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_replay.png new file mode 100644 index 00000000..d9561b3b Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_replay.png differ diff --git a/baselibrary/src/main/res/drawable-xxhdpi/ic_action_search.png b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_search.png new file mode 100644 index 00000000..a1086388 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_search.png differ diff --git a/baselibrary/src/main/res/drawable-xxhdpi/ic_action_search_dark.png b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_search_dark.png new file mode 100644 index 00000000..9c0ea3ca Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxhdpi/ic_action_search_dark.png differ diff --git a/baselibrary/src/main/res/drawable-xxxhdpi/mcv_action_next.png b/baselibrary/src/main/res/drawable-xxxhdpi/mcv_action_next.png new file mode 100644 index 00000000..9a8e5a80 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxxhdpi/mcv_action_next.png differ diff --git a/baselibrary/src/main/res/drawable-xxxhdpi/mcv_action_previous.png b/baselibrary/src/main/res/drawable-xxxhdpi/mcv_action_previous.png new file mode 100644 index 00000000..bce26481 Binary files /dev/null and b/baselibrary/src/main/res/drawable-xxxhdpi/mcv_action_previous.png differ diff --git a/baselibrary/src/main/res/drawable/bottom_shadow.9.png b/baselibrary/src/main/res/drawable/bottom_shadow.9.png new file mode 100644 index 00000000..b9bcc2d1 Binary files /dev/null and b/baselibrary/src/main/res/drawable/bottom_shadow.9.png differ diff --git a/baselibrary/src/main/res/drawable/circulo.xml b/baselibrary/src/main/res/drawable/circulo.xml new file mode 100644 index 00000000..8fe5b190 --- /dev/null +++ b/baselibrary/src/main/res/drawable/circulo.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/baselibrary/src/main/res/layout-sw820dp-land/activity_base.xml b/baselibrary/src/main/res/layout-sw820dp-land/activity_base.xml new file mode 100644 index 00000000..9a644b68 --- /dev/null +++ b/baselibrary/src/main/res/layout-sw820dp-land/activity_base.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/baselibrary/src/main/res/layout/activity_base.xml b/baselibrary/src/main/res/layout/activity_base.xml new file mode 100644 index 00000000..bbedbfa8 --- /dev/null +++ b/baselibrary/src/main/res/layout/activity_base.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + diff --git a/baselibrary/src/main/res/layout/calendar.xml b/baselibrary/src/main/res/layout/calendar.xml new file mode 100644 index 00000000..b8dfb521 --- /dev/null +++ b/baselibrary/src/main/res/layout/calendar.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/baselibrary/src/main/res/layout/dialog_buscar.xml b/baselibrary/src/main/res/layout/dialog_buscar.xml new file mode 100644 index 00000000..31482abc --- /dev/null +++ b/baselibrary/src/main/res/layout/dialog_buscar.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/layout/fragment_carga.xml b/baselibrary/src/main/res/layout/fragment_carga.xml new file mode 100644 index 00000000..507c551e --- /dev/null +++ b/baselibrary/src/main/res/layout/fragment_carga.xml @@ -0,0 +1,15 @@ + + + + + + diff --git a/baselibrary/src/main/res/layout/framelayout_sombra.xml b/baselibrary/src/main/res/layout/framelayout_sombra.xml new file mode 100644 index 00000000..a3b0ade1 --- /dev/null +++ b/baselibrary/src/main/res/layout/framelayout_sombra.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/baselibrary/src/main/res/layout/item_calendar.xml b/baselibrary/src/main/res/layout/item_calendar.xml new file mode 100644 index 00000000..25312b43 --- /dev/null +++ b/baselibrary/src/main/res/layout/item_calendar.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/layout/item_resultados_buscar.xml b/baselibrary/src/main/res/layout/item_resultados_buscar.xml new file mode 100644 index 00000000..a4437c84 --- /dev/null +++ b/baselibrary/src/main/res/layout/item_resultados_buscar.xml @@ -0,0 +1,24 @@ + + + + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/layout/navigation_drawer_derecha.xml b/baselibrary/src/main/res/layout/navigation_drawer_derecha.xml new file mode 100644 index 00000000..5f0bd9e3 --- /dev/null +++ b/baselibrary/src/main/res/layout/navigation_drawer_derecha.xml @@ -0,0 +1,11 @@ + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/layout/navigation_drawer_izquierda.xml b/baselibrary/src/main/res/layout/navigation_drawer_izquierda.xml new file mode 100644 index 00000000..2ccf6a73 --- /dev/null +++ b/baselibrary/src/main/res/layout/navigation_drawer_izquierda.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/layout/toolbar.xml b/baselibrary/src/main/res/layout/toolbar.xml new file mode 100644 index 00000000..83c4b802 --- /dev/null +++ b/baselibrary/src/main/res/layout/toolbar.xml @@ -0,0 +1,16 @@ + + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/layout/toolbar_buscar.xml b/baselibrary/src/main/res/layout/toolbar_buscar.xml new file mode 100644 index 00000000..c9ac973f --- /dev/null +++ b/baselibrary/src/main/res/layout/toolbar_buscar.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/layout/toolbar_colores.xml b/baselibrary/src/main/res/layout/toolbar_colores.xml new file mode 100644 index 00000000..5d783047 --- /dev/null +++ b/baselibrary/src/main/res/layout/toolbar_colores.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/values-ca/strings.xml b/baselibrary/src/main/res/values-ca/strings.xml new file mode 100644 index 00000000..9a186974 --- /dev/null +++ b/baselibrary/src/main/res/values-ca/strings.xml @@ -0,0 +1,53 @@ + + + + No hi ha conexió a internet + Aceptar + Reintentar + Avís + Buscar + + + dilluns + dimarts + dimecres + dijous + divendres + dissabte + diumenge + + dil. + dim. + dix. + dij. + div. + dis. + diu. + + gen. + feb. + mar. + abr. + mai. + jun. + jul. + ago. + set. + oct. + nov. + dec. + + Gener + Febrer + Març + Abril + Maig + Juny + Juliol + Agost + Setembre + Octubre + Novembre + Decembre + + \ No newline at end of file diff --git a/baselibrary/src/main/res/values-es/strings.xml b/baselibrary/src/main/res/values-es/strings.xml new file mode 100644 index 00000000..8ab90a27 --- /dev/null +++ b/baselibrary/src/main/res/values-es/strings.xml @@ -0,0 +1,53 @@ + + + + No hay conexión a internet + Aceptar + Reintentar + Aviso + Buscar + + + lunes + martes + miercoles + jueves + viernes + sabado + domingo + + lun. + mar. + mie. + jue. + vie. + sab. + dom. + + ene. + feb. + mar. + abr. + may. + jun. + jul. + ago. + sep. + oct. + nov. + dec. + + Enero + Febrero + Marzo + Abril + Mayo + Junio + Julio + Agosto + Septiembre + Octubre + Noviembre + Diciembre + + \ No newline at end of file diff --git a/baselibrary/src/main/res/values-pt/strings.xml b/baselibrary/src/main/res/values-pt/strings.xml new file mode 100644 index 00000000..b3e04759 --- /dev/null +++ b/baselibrary/src/main/res/values-pt/strings.xml @@ -0,0 +1,53 @@ + + + + Não há conexão com internet + Aceitar + Repetir + Aviso + Buscar + + + Segunda-Feira + Terça-Feira + Quarta-Feira + Quinta-Feira + Sexta-Feira + Sabado + Domingo + + seg. + ter. + qua. + qui. + sex. + sab. + dom. + + jan. + fev. + mar. + abr. + mai. + jun. + jul. + ago. + set. + out. + nov. + dez. + + Janeiro + Fevereiro + Março + Abril + Maio + Junho + Julho + Agosto + Setembro + Outubro + Novembro + Dezembro + + \ No newline at end of file diff --git a/baselibrary/src/main/res/values-v21/refs.xml b/baselibrary/src/main/res/values-v21/refs.xml new file mode 100644 index 00000000..2ef381b7 --- /dev/null +++ b/baselibrary/src/main/res/values-v21/refs.xml @@ -0,0 +1,4 @@ + + + @null + \ No newline at end of file diff --git a/baselibrary/src/main/res/values-v21/styles.xml b/baselibrary/src/main/res/values-v21/styles.xml new file mode 100644 index 00000000..824a3087 --- /dev/null +++ b/baselibrary/src/main/res/values-v21/styles.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/values-w800dp/dimens.xml b/baselibrary/src/main/res/values-w800dp/dimens.xml new file mode 100644 index 00000000..6e887da7 --- /dev/null +++ b/baselibrary/src/main/res/values-w800dp/dimens.xml @@ -0,0 +1,8 @@ + + + 64dp + 10sp + 30sp + diff --git a/baselibrary/src/main/res/values/colors.xml b/baselibrary/src/main/res/values/colors.xml new file mode 100644 index 00000000..121eb871 --- /dev/null +++ b/baselibrary/src/main/res/values/colors.xml @@ -0,0 +1,12 @@ + + + + #000 + #000 + #FFF + #d7d7d7 + #8c8c8c + #ff00b5d0 + #d7d7d7 + + diff --git a/baselibrary/src/main/res/values/dimens.xml b/baselibrary/src/main/res/values/dimens.xml new file mode 100644 index 00000000..54dcff1f --- /dev/null +++ b/baselibrary/src/main/res/values/dimens.xml @@ -0,0 +1,25 @@ + + + 16dp + 16dp + + 1dp + 10dp + 10dp + 10dp + 10dp + 10dp + 4dp + + + 60dp + 15dp + 15dp + 20sp + 5dp + 3dp + 12sp + + 30sp + + diff --git a/baselibrary/src/main/res/values/refs.xml b/baselibrary/src/main/res/values/refs.xml new file mode 100644 index 00000000..22382412 --- /dev/null +++ b/baselibrary/src/main/res/values/refs.xml @@ -0,0 +1,4 @@ + + + @drawable/bottom_shadow + \ No newline at end of file diff --git a/baselibrary/src/main/res/values/strings.xml b/baselibrary/src/main/res/values/strings.xml new file mode 100644 index 00000000..665cb5da --- /dev/null +++ b/baselibrary/src/main/res/values/strings.xml @@ -0,0 +1,54 @@ + + + + No internet + Accept + Retry + Notice + Search + + + monday + tuesday + wednesday + thursday + friday + saturday + sunday + + mon. + tue. + wed. + thu. + fri. + sat. + sun. + + jan. + feb. + mar. + apr. + may. + jun. + jul. + aug. + sep. + oct. + nov. + dec. + + January + February + March + April + May + June + July + August + September + October + November + December + + + \ No newline at end of file diff --git a/baselibrary/src/main/res/values/styles.xml b/baselibrary/src/main/res/values/styles.xml new file mode 100644 index 00000000..bc5157f7 --- /dev/null +++ b/baselibrary/src/main/res/values/styles.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/baselibrary2/.gitignore b/baselibrary2/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/baselibrary2/.gitignore @@ -0,0 +1 @@ +/build diff --git a/baselibrary2/baselibrary2.iml b/baselibrary2/baselibrary2.iml new file mode 100644 index 00000000..517b9a0a --- /dev/null +++ b/baselibrary2/baselibrary2.iml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/baselibrary2/build.gradle b/baselibrary2/build.gradle new file mode 100644 index 00000000..2df698c4 --- /dev/null +++ b/baselibrary2/build.gradle @@ -0,0 +1,48 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 28 + + lintOptions { + abortOnError false + } + + defaultConfig { + minSdkVersion 14 + targetSdkVersion 26 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } + sourceSets { + main { + res.srcDirs = + [ + 'src/main/res', + 'src/main/res/layouts/fragment', + 'src/main/res/layouts/calendar', + 'src/main/res/layouts/progress-view', + 'src/main/res/layouts/app-bar', + 'src/main/res/layouts' + ] + } + } + buildToolsVersion '28.0.3' +} + +dependencies { + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation 'androidx.appcompat:appcompat:1.0.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.material:material:1.0.0' + implementation 'com.google.code.gson:gson:+' + implementation 'com.squareup.picasso:picasso:+' + implementation 'androidx.cardview:cardview:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.0.0' + testImplementation 'junit:junit:4.12' +} diff --git a/baselibrary2/proguard-rules.pro b/baselibrary2/proguard-rules.pro new file mode 100644 index 00000000..6d73781c --- /dev/null +++ b/baselibrary2/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /home/nelo/adt-bundle-linux-x86_64-20140702/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/baselibrary2/src/androidTest/java/nelosan/com/baselibrary2/ApplicationTest.java b/baselibrary2/src/androidTest/java/nelosan/com/baselibrary2/ApplicationTest.java new file mode 100644 index 00000000..73a73897 --- /dev/null +++ b/baselibrary2/src/androidTest/java/nelosan/com/baselibrary2/ApplicationTest.java @@ -0,0 +1,13 @@ +package nelosan.com.baselibrary2; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/baselibrary2/src/main/AndroidManifest.xml b/baselibrary2/src/main/AndroidManifest.xml new file mode 100644 index 00000000..906e4a27 --- /dev/null +++ b/baselibrary2/src/main/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + + + diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/MyApplication.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/MyApplication.java new file mode 100644 index 00000000..f6f9e7e1 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/MyApplication.java @@ -0,0 +1,30 @@ +package com.nelosan.baselibrary2; + +import android.app.Application; +import android.content.Context; + + +/** + * Created by nelo on 2/02/15. + */ + +public class MyApplication extends Application { + + private static Context mContext; + + @Override + public void onCreate() { + super.onCreate(); + mContext = getApplicationContext(); + } + + public static Context getContext() { + return mContext; + } + + public static void setContext(Context context) + { + mContext = context; + } + +} \ No newline at end of file diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/activity/ActivityBase.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/activity/ActivityBase.java new file mode 100644 index 00000000..9d6bd607 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/activity/ActivityBase.java @@ -0,0 +1,155 @@ +package com.nelosan.baselibrary2.activity; + +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import androidx.annotation.NonNull; +import com.google.android.material.appbar.AppBarLayout; +import androidx.core.app.ActivityCompat; +import androidx.core.app.ActivityOptionsCompat; +import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.widget.Toolbar; +import android.view.View; + +import com.nelosan.baselibrary2.R; +import com.nelosan.baselibrary2.comunicacion.Executer; +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; +import com.nelosan.baselibrary2.fragment.base.FragmentBase; + +/** + * Created by nelo on 5/4/16. + */ +public class ActivityBase extends AppCompatActivity { + + protected FragmentBase fragmentActivo; + protected int contenedor; + protected Toolbar toolbar; + + protected boolean inicializado = false; + + public static final String EXTRA_IMAGE = "EXTRA_IMAGE"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_appbar); + contenedor = R.id.contenedor; + setToolbar(); + setBackButton(toolbar); + if(savedInstanceState != null) + inicializado = savedInstanceState.getBoolean("inicializado", false); + } + + public void setToolbar(){ + toolbar = (Toolbar) findViewById(R.id.appbar); + setSupportActionBar(toolbar); + } + + @Override + protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putBoolean("inicializado", inicializado); + } + + + @Override + protected void onResume() { + super.onResume(); + inicializado = true; + } + + + @Override + public void onBackPressed() { + fragmentActivo = (FragmentBase) getFragmentManager().findFragmentById(contenedor); + if(fragmentActivo != null && fragmentActivo.back()) { + if (getFragmentManager().getBackStackEntryCount() == 1) + finish(); + else + getFragmentManager().popBackStack(); + } + + } + + public void launchTransition(ActivityBase activity, View transitionView, Intent intent) { + ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation( + activity, transitionView, EXTRA_IMAGE); + + ActivityCompat.startActivity(activity, intent, options.toBundle()); + } + + public void cambiarFragment(FragmentBase fragment, Bundle args) + { + if(args != null) + fragment.setArguments(args); + fragmentActivo = fragment; + android.app.FragmentTransaction transaccion = getFragmentManager().beginTransaction(); + //transaccion.setCustomAnimations(R.animator.enter_anim, R.animator.exit_anim, R.animator.enter_anim, R.animator.exit_anim); + transaccion.replace(contenedor, fragmentActivo, fragment.getClass().toString()); + transaccion.addToBackStack(null); + transaccion.commit(); + } + + public void cambiarFragment(FragmentBase fragment) + { + cambiarFragment(fragment, null); + } + + public boolean compararFragments(Class frag) { + + if(fragmentActivo != null && frag != null) + { + String currentFragment = fragmentActivo.getClass().toString(); + String fragment = frag.toString(); + return currentFragment.equals(fragment); + } + + return false; + } + + public void setBackButton(Toolbar toolbar) + { + toolbar.setNavigationIcon(R.drawable.ic_back); + + toolbar.setNavigationOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + onBackPressed(); + //overridePendingTransition(R.anim.scale_enter, R.anim.salida_derecha); + } + }); + } + + public void pintarBarraSuperior(int darkColor) + { + int currentapiVersion = android.os.Build.VERSION.SDK_INT; + if (currentapiVersion >= Build.VERSION_CODES.LOLLIPOP) { + getWindow().setStatusBarColor(darkColor); + } + } + + public void cancelToolbarScroll() + { + AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams(); + params.setScrollFlags(0); + } + + public FragmentBase getFragmentActivo() { + return fragmentActivo; + } + + public void solicitarPermisos() {} + + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) + fragmentActivo.onRequestPermissionsResult(requestCode, permissions, grantResults); + } + + public void execute(CommandBase cmd) + { + Executer executer = Executer.getInstance(); + executer.execute(this, cmd); + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/adapter/AdapterBase.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/adapter/AdapterBase.java new file mode 100644 index 00000000..fd9f4cdb --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/adapter/AdapterBase.java @@ -0,0 +1,71 @@ +package com.nelosan.baselibrary2.adapter; + +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import java.util.List; + +/** + * Created by nelo on 18/11/15. + */ +public abstract class AdapterBase extends RecyclerView.Adapter implements View.OnClickListener{ + + protected List elements; + private View.OnClickListener listener; + protected int item; + + public AdapterBase(List elements, int item) { + this.elements = elements; + this.item = item; + } + + public abstract static class AdapterViewHolder extends RecyclerView.ViewHolder { + + public AdapterViewHolder(View itemView) { + super(itemView); + loadElements(itemView); + } + + public abstract void loadElements(View itemView); + + public abstract void bindElement(Object t); + } + + @Override + public AdapterViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(item, viewGroup, false); + itemView.setOnClickListener(this); + return create(itemView); + } + + public abstract AdapterViewHolder create(View itemView); + + @Override + public void onBindViewHolder(AdapterViewHolder viewHolder, int position) { + Object item = elements.get(position); + viewHolder.bindElement(item); + } + + @Override + public int getItemCount() { + return elements.size(); + } + + public Object getItem(int position) + { + return elements.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if(listener != null) + listener.onClick(view); + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/TextViewRoboto.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/TextViewRoboto.java new file mode 100644 index 00000000..71162d22 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/TextViewRoboto.java @@ -0,0 +1,54 @@ +package com.nelosan.baselibrary2.components; + +import android.content.Context; +import android.graphics.Typeface; +import android.util.AttributeSet; +import android.widget.TextView; + +/** + * Created by nelo on 16/04/15. + */ +public class TextViewRoboto extends TextView { + + public static final String ROBOTO_BLACK = "Roboto-Black.ttf"; + public static final String ROBOTO_BLACK_ITALIC = "Roboto-BlackItalic.ttf"; + public static final String ROBOTO_BOLD = "Roboto-Bold.ttf"; + public static final String ROBOTO_BOLD_ITALIC = "Roboto-BoldItalic.ttf"; + public static final String ROBOTO_ITALIC = "Roboto-Italic.ttf"; + public static final String ROBOTO_LIGHT = "Roboto-Light.ttf"; + public static final String ROBOTO_LIGT_ITALIC = "Roboto-LightItalic.ttf"; + public static final String ROBOTO_MEDIUM = "Roboto-Medium.ttf"; + public static final String ROBOTO_MEDIUM_ITALIC = "Roboto-MediumItalic.ttf"; + public static final String ROBOTO_REGULAR = "Roboto-Regular.ttf"; + public static final String ROBOTO_THIN = "Roboto-Thin.ttf"; + public static final String ROBOTO_THIN_ITALIC = "Roboto-ThinItalic.ttf"; + + private Context context; + + public TextViewRoboto(Context context) { + super(context); + this.context = context; + setTypeface(ROBOTO_REGULAR); + } + + public TextViewRoboto(Context context, AttributeSet attrs) + { + super(context, attrs); + this.context = context; + setTypeface(ROBOTO_REGULAR); + } + + public TextViewRoboto(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + this.context = context; + setTypeface(ROBOTO_REGULAR); + } + + public void setTypeface(String typeface) + { + Typeface face=Typeface.createFromAsset(context.getAssets(), "fonts/"+typeface); + this.setTypeface(face); + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/AdapterCalendar.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/AdapterCalendar.java new file mode 100644 index 00000000..54887b99 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/AdapterCalendar.java @@ -0,0 +1,98 @@ +package com.nelosan.baselibrary2.components.calendar; + +import android.content.Context; +import android.content.res.Resources; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.nelosan.baselibrary2.R; + +import java.util.List; + +import static com.nelosan.baselibrary2.core.Util.isInt; + +/** + * Created by nelo on 15/06/15. + */ +public class AdapterCalendar extends ArrayAdapter { + + LayoutInflater li; + Resources res; + Context context; + + public AdapterCalendar(Context context, int resource, List objects) { + super(context, resource, objects); + + li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + res = context.getResources(); + this.context = context; + } + + public class CalendarHolder { + public TextView txtDia; + public LinearLayout lnrDia; + + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) + { + CalendarItem dia = getItem(position); + //Inflate the view + CalendarHolder calendarHolder; + + if (convertView == null) { + calendarHolder = new CalendarHolder(); + convertView = li.inflate(R.layout.item_calendar, null); + calendarHolder.txtDia = (TextView)convertView.findViewById(R.id.textview_item_calendar_dia); + calendarHolder.lnrDia = (LinearLayout)convertView.findViewById(R.id.linear_item_calendar_dia); + convertView.setTag(calendarHolder); + } else { + calendarHolder = (CalendarHolder)convertView.getTag(); + } + + calendarHolder.txtDia.setText(dia.getValue()); + + + if(!isInt(dia.getValue())) { + setParameters(calendarHolder, 12, R.color.negro, R.color.blanco, R.color.blanco); + } + else + { + int textColor; + if(dia.isClick()) + { + textColor = R.color.negro; + } + else + { + textColor = R.color.gris_separacion; + } + + setParameters(calendarHolder, 14, textColor, R.color.blanco, R.color.blanco); + } + + + + if(dia.isSelected()) + { + setParameters(calendarHolder, 14, R.color.blanco, R.color.azul_claro, R.color.azul_claro); + } + + + return convertView; + } + + public void setParameters(CalendarHolder holder, int textSize, int textColot, int diaBack, int lnrBack) + { + //holder.txtDia.setTextSize(context.getResources().getDimension(textSize)); + holder.txtDia.setTextSize(textSize); + holder.txtDia.setTextColor(context.getResources().getColor(textColot)); + holder.txtDia.setBackgroundColor(context.getResources().getColor(diaBack)); + holder.lnrDia.setBackgroundColor(context.getResources().getColor(lnrBack)); + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/Calendar.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/Calendar.java new file mode 100644 index 00000000..0e81b639 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/Calendar.java @@ -0,0 +1,147 @@ +package com.nelosan.baselibrary2.components.calendar; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.AdapterView; +import android.widget.GridView; +import android.widget.ImageView; +import android.widget.LinearLayout; + +import com.nelosan.baselibrary2.R; +import com.nelosan.baselibrary2.components.TextViewRoboto; + +import java.util.List; + + +/** + * Created by nelo on 15/06/15. + */ +public class Calendar extends LinearLayout { + + private GridView gCalendar; + + private TextViewRoboto txtCabecera; + private ImageView imgPreview, imgNext; + + private ControllerCalendar cCalendar; + private List items; + + private OnChangeDate change; + + + public Calendar(final Context context) { + super(context); + initialize(context); + } + + public Calendar(Context context, AttributeSet attrs) + { + super(context, attrs); + initialize(context); + } + + public Calendar(Context context, AttributeSet attrs, int defStyle) + { + super(context, attrs, defStyle); + initialize(context); + } + + public void initialize(final Context context) + { + LayoutInflater.from(context).inflate(R.layout.calendar, this); + + cCalendar = new ControllerCalendar(getContext()); + + gCalendar = (GridView)findViewById(R.id.calendar); + txtCabecera = (TextViewRoboto)findViewById(R.id.calendar_textview_cabecera); + imgPreview = (ImageView)findViewById(R.id.calendar_imageview_previous_month); + imgNext = (ImageView)findViewById(R.id.calendar_imageview_next_month); + + imgPreview.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + cCalendar.addMonthCalendar(-1); + generarCalendario(context); + dibujarCabecera(); + } + }); + + imgNext.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + cCalendar.addMonthCalendar(+1); + generarCalendario(context); + dibujarCabecera(); + } + }); + + gCalendar.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapter, View view, int position, long id) { + + CalendarItem item = (CalendarItem) adapter.getItemAtPosition(position); + + if(item.isClick()) + { + for (CalendarItem it : items) + { + it.setSelected(false); + } + + item.setSelected(true); + + cCalendar.selectDate(item); + + generarCalendario(context); + changeDate(); + } + } + }); + + items = cCalendar.generateArrayDays(); + + generarCalendario(context); + dibujarCabecera(); + } + + + + public void dibujarCabecera() + { + txtCabecera.setText(cCalendar.getTextMonth()); + if(cCalendar.getActualMonth() == cCalendar.getMonth() + && cCalendar.getActualYear() == cCalendar.getYear()) + imgPreview.setVisibility(View.INVISIBLE); + else + imgPreview.setVisibility(View.VISIBLE); + txtCabecera.setTypeface(TextViewRoboto.ROBOTO_THIN); + } + + public void generarCalendario(Context context) + { + items = cCalendar.generateArrayDays(); + AdapterCalendar adapter = new AdapterCalendar(context, R.id.calendar, items); + gCalendar.setAdapter(adapter); + } + + public void setOnChangeDate(OnChangeDate change) + { + this.change = change; + } + + public void changeDate() + { + if(this.change != null) + change.OnChangeDate(cCalendar.getSelectedYear(), cCalendar.getSelectedMonth(), cCalendar.getSelectedDay()); + } + + public void setDate(int year, int month, int day) + { + cCalendar.setDate(year, month, day); + generarCalendario(getContext()); + dibujarCabecera(); + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/CalendarItem.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/CalendarItem.java new file mode 100644 index 00000000..6bbe8f7c --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/CalendarItem.java @@ -0,0 +1,60 @@ +package com.nelosan.baselibrary2.components.calendar; + +/** + * Created by nelo on 15/06/15. + */ +public class CalendarItem { + + private int day, month, year; + private String value = ""; + private boolean click; + private boolean selected = false; + + public int getDay() { + return day; + } + + public void setDay(int day) { + this.day = day; + } + + public int getMonth() { + return month; + } + + public void setMonth(int month) { + this.month = month; + } + + public int getYear() { + return year; + } + + public void setYear(int year) { + this.year = year; + } + + public boolean isClick() { + return click; + } + + public void setClick(boolean click) { + this.click = click; + } + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + public boolean isSelected() { + return selected; + } + + public void setSelected(boolean selected) { + this.selected = selected; + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/ControllerCalendar.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/ControllerCalendar.java new file mode 100644 index 00000000..5d90ca8f --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/ControllerCalendar.java @@ -0,0 +1,330 @@ +package com.nelosan.baselibrary2.components.calendar; + +import android.content.Context; + +import com.nelosan.baselibrary2.R; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.List; + + +/** + * Created by nelo on 17/06/15. + */ +public class ControllerCalendar { + + private java.util.Calendar calendar; + + /**** FECHA ACTUAL ****/ + private int actualYear, actualMonth, actualDay; + /**** FECHA DATOS ****/ + private int year, month, day; + /**** FECHA SELECCIONADA ****/ + private int selectedYear, selectedMonth, selectedDay; + + private Context context; + + public ControllerCalendar(Context context) + { + /**** CONSTRUCTOR POR DEFECTO ****/ + this.context = context; + initializeCalendar(); + setDate(actualYear, actualMonth, actualDay); + } + + public ControllerCalendar(Context context, int year, int month, int day) + { + /**** CONSTRUCTOR INDICANDO FECHA ****/ + this.context = context; + initializeCalendar(); + setDate(year, month, day); + } + + public void initializeCalendar() + { + /**** INICIALIZAMOS EL CALENDARIO ****/ + calendar = new GregorianCalendar(); + actualMonth = calendar.get(java.util.Calendar.MONTH); + actualYear = calendar.get(java.util.Calendar.YEAR); + actualDay = calendar.get(Calendar.DAY_OF_MONTH); + } + + public void setDate(int year, int month, int day) + { + /**** INICIALIZAMOS LOS VALORES ****/ + + this.year = year; + this.month = month; + this.day = day; + + this.selectedYear = year; + this.selectedMonth = month; + this.selectedDay = day; + + calendar.set(year, month, day); + } + + public List generateArrayDays() + { + return getMonthItems(year, month, day); + } + + public List getMonthItems(int year, int month, int day) + { + List days = new ArrayList<>(); + + /*** Generamos los días de la cabecera del calendario ***/ + getCalendarHeaderDays(days); + + /*** Generamos los días del mes anterior ***/ + generatePreviousDays(year, month, days); + + /*** Obtenemos el número de dias que tiene el mes ***/ + generateCurrentDays(days); + + /*** Generamos los días del mes posterior ***/ + generatePostDays(year, month, days); + + return days; + } + + private void getCalendarHeaderDays(List days) + { + String[] dias = {context.getResources().getString(R.string.calendar_monday), + context.getResources().getString(R.string.calendar_tuesday), + context.getResources().getString(R.string.calendar_wednesday), + context.getResources().getString(R.string.calendar_thursday), + context.getResources().getString(R.string.calendar_friday), + context.getResources().getString(R.string.calendar_saturday), + context.getResources().getString(R.string.calendar_sunday)}; + + for(String d : dias) + { + CalendarItem item = new CalendarItem(); + item.setValue(d); + item.setClick(false); + days.add(item); + } + } + + private void generatePreviousDays(int year, int month, List days) + { + + int leftDays = getFirstDayMonth(year, month); + + java.util.Calendar cal = generateCalendar(year, month); + cal.add(java.util.Calendar.MONTH, -1); + int pMonth = cal.get(java.util.Calendar.MONTH); + int pYear = cal.get(java.util.Calendar.YEAR); + + int numDaysAnterior = getDaysInMonthInPresentYear(pYear, pMonth); + + while (leftDays != 0) { + + int pDay = numDaysAnterior - leftDays + 1; + CalendarItem item = generateItem(pYear, pMonth, pDay, false); + days.add(item); + leftDays--; + } + + } + + private void generateCurrentDays(List days) + { + int numDays = getDaysInMonthInPresentYear(year, month); + + for (int day = 1; day<= numDays; day++) + { + boolean click; + if(day < this.actualDay && calendar.get(java.util.Calendar.MONTH) == actualMonth && calendar.get(java.util.Calendar.YEAR) == actualYear) + click = false; + else + click = true; + CalendarItem item = generateItem(year, month, day, click); + days.add(item); + } + } + + private void generatePostDays(int year, int month, List days) + { + java.util.Calendar cal = generateCalendar(year, month); + cal.add(java.util.Calendar.MONTH, 1); + int nMonth = cal.get(java.util.Calendar.MONTH); + int nYear = cal.get(java.util.Calendar.YEAR); + int weekday = getFirstDayMonth(nYear, nMonth); + int contador = weekday; + + while (contador != 7) { + int nDay = 1 + contador - weekday; + CalendarItem item = generateItem(nYear, nMonth, nDay, false); + days.add(item); + contador++; + } + } + + private CalendarItem generateItem(int year, int month, int day, boolean click) + { + CalendarItem item = new CalendarItem(); + item.setDay(day); + item.setMonth(month); + item.setYear(year); + item.setValue("" + day); + item.setClick(click); + + if(this.selectedYear == year && this.selectedMonth == month && this.selectedDay == day) + { + item.setSelected(true); + } + + return item; + } + + private int getFirstDayMonth(int year, int month) + { + java.util.Calendar cal = generateCalendar(year, month); + cal.set(java.util.Calendar.DAY_OF_MONTH, 1); + switch (cal.get(java.util.Calendar.DAY_OF_WEEK)) { + case java.util.Calendar.MONDAY: + return 0; + case java.util.Calendar.TUESDAY: + return 1; + case java.util.Calendar.WEDNESDAY: + return 2; + case java.util.Calendar.THURSDAY: + return 3; + case java.util.Calendar.FRIDAY: + return 4; + case java.util.Calendar.SATURDAY: + return 5; + case java.util.Calendar.SUNDAY: + return 6; + } + return 0; + } + + private int getDaysInMonthInPresentYear(int year, int month) + { + int days=0; + if(month>=0 && month<12){ + try + { + java.util.Calendar calendar = java.util.Calendar.getInstance(); + int date = 1; + calendar.set(year, month, date); + days = calendar.getActualMaximum(java.util.Calendar.DAY_OF_MONTH); + } catch (Exception e) + { + if(e!=null) + e.printStackTrace(); + } + } + return days; + } + + public String getTextMonth() + { + String text = ""; + java.util.Calendar cal = generateCalendar(year, month); + switch (cal.get(java.util.Calendar.MONTH)) { + case java.util.Calendar.JANUARY: + text += context.getResources().getString(R.string.january); + break; + case java.util.Calendar.FEBRUARY: + text += context.getResources().getString(R.string.february); + break; + case java.util.Calendar.MARCH: + text += context.getResources().getString(R.string.march); + break; + case java.util.Calendar.APRIL: + text += context.getResources().getString(R.string.april); + break; + case java.util.Calendar.MAY: + text += context.getResources().getString(R.string.may); + break; + case java.util.Calendar.JUNE: + text += context.getResources().getString(R.string.june); + break; + case java.util.Calendar.JULY: + text += context.getResources().getString(R.string.july); + break; + case java.util.Calendar.AUGUST: + text += context.getResources().getString(R.string.august); + break; + case java.util.Calendar.SEPTEMBER: + text += context.getResources().getString(R.string.september); + break; + case java.util.Calendar.OCTOBER: + text += context.getResources().getString(R.string.october); + break; + case java.util.Calendar.NOVEMBER: + text += context.getResources().getString(R.string.november); + break; + case java.util.Calendar.DECEMBER: + text += context.getResources().getString(R.string.december); + break; + } + + text += " de "+year; + + return text; + } + + + public java.util.Calendar generateCalendar(int year, int month) + { + java.util.Calendar cal = new GregorianCalendar(); + cal.set(java.util.Calendar.MONTH, month); + cal.set(java.util.Calendar.YEAR, year); + + return cal; + } + + public void addMonthCalendar(int mon) + { + calendar.add(java.util.Calendar.MONTH, mon); + year = calendar.get(Calendar.YEAR); + month = calendar.get(Calendar.MONTH); + day = calendar.get(Calendar.DAY_OF_MONTH); + } + + public void selectDate(CalendarItem item) + { + this.selectedYear = item.getYear(); + this.selectedMonth = item.getMonth(); + this.selectedDay = item.getDay(); + } + + public int getActualYear() { + return actualYear; + } + + public int getActualMonth() { + return actualMonth; + } + + public Calendar getCalendar() { + return calendar; + } + + public int getSelectedYear() { + return selectedYear; + } + + public int getSelectedMonth() { + return selectedMonth; + } + + public int getSelectedDay() { + return selectedDay; + } + + public int getYear() { + return year; + } + + public int getMonth() { + return month; + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/OnChangeDate.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/OnChangeDate.java new file mode 100644 index 00000000..2cfaf6f2 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/components/calendar/OnChangeDate.java @@ -0,0 +1,9 @@ +package com.nelosan.baselibrary2.components.calendar; + +/** + * Created by nelo on 13/01/15. + */ +public interface OnChangeDate { + public void OnChangeDate(int year, int month, int day); + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/Ejecutador.java.orig b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/Ejecutador.java.orig new file mode 100644 index 00000000..9130aec0 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/Ejecutador.java.orig @@ -0,0 +1,55 @@ +package com.nelosan.baselibrary2.comunicacion; + +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; +import java.util.ArrayList; + +/** + * Created by nelo on 21/02/16. + */ +public class Ejecutador { + + private ArrayList commands = new ArrayList(); + + private static Ejecutador INSTANCE = null; + + private Ejecutador(){} + + private synchronized static void createInstance() { + if (INSTANCE == null) { + INSTANCE = new Ejecutador(); + } + } + + public static Ejecutador getInstance() { + if (INSTANCE == null) + createInstance(); + return INSTANCE; + } + + public void execute(CommandBase cmd) + { + commands.add(cmd); + cmd.execute(); + } + + public void cancelCommad(CommandBase cmd) + { + if(cmd.isCancelable()) { + cmd.cancel(true); + commands.remove(cmd); + } + } + + public void removeCommand(CommandBase cmd) + { + commands.remove(cmd); + } + + public void removeCommands() + { + for(CommandBase cmd : commands) + cancelCommad(cmd); + } + + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/Executer.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/Executer.java new file mode 100644 index 00000000..8cfc546b --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/Executer.java @@ -0,0 +1,133 @@ +package com.nelosan.baselibrary2.comunicacion; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.net.ConnectivityManager; + +import com.nelosan.baselibrary2.R; +import com.nelosan.baselibrary2.activity.ActivityBase; +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; +import com.nelosan.baselibrary2.comunicacion.command.CommandCallbacks; +import com.nelosan.baselibrary2.comunicacion.command.ExecuterCallbacks; + +import java.util.ArrayList; + +/** + * Created by nelo on 21/02/16. + */ +public class Executer implements ExecuterCallbacks { + + private ArrayList commands = new ArrayList(); + + private static Executer INSTANCE = null; + + private Executer(){} + + private synchronized static void createInstance() { + if (INSTANCE == null) { + INSTANCE = new Executer(); + } + } + + public static Executer getInstance() { + if (INSTANCE == null) + createInstance(); + return INSTANCE; + } + + public void execute(Context context, CommandBase cmd) + { + cmd.setContext(context); + executeCommand(cmd); + } + + public void executeCommand(CommandBase cmd) + { + cmd.setExecuterCallbacks(this); + commands.add(cmd); + cmd.execute(); + } + + public void cancelCommad(CommandBase cmd) + { + if(cmd.isCancelable()) { + cmd.cancel(true); + commands.remove(cmd); + } + } + + public void removeCommand(CommandBase cmd) + { + cancelCommad(cmd); + } + + public void removeCommands() + { + for(CommandBase cmd : commands) + if(cmd.isBackground()) + cmd.cancel(true); + commands = new ArrayList<>(); + } + + public void mostrarAvisoNoInternet(Context context){ + mostrarAviso(context, context.getResources().getString(R.string.no_internet), null); + } + + public void mostrarAviso(Context context, String msg, final CommandCallbacks callbacks) + { + if(!((ActivityBase) context).isFinishing()) + { + showDialog(context, msg, callbacks); + } + + } + + private void showDialog(Context context, String msg, final CommandCallbacks callbacks) + { + /** Muestra un mensaje de error **/ + AlertDialog.Builder b = new AlertDialog.Builder(context); + b.setMessage(msg); + + b.setPositiveButton(context.getResources().getString(R.string.aceptar), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.cancel(); + if(callbacks != null) + callbacks.onAccept(); + } + }); + + if(callbacks != null) { + b.setNegativeButton(context.getResources().getString(R.string.retry), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + callbacks.onRetry(); + } + }); + } + + b.setTitle("Error"); + b.show(); + } + + + public boolean isOnline(Context context) + { + /** Comprueba que hay conexión a internet **/ + ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); + return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnectedOrConnecting(); + } + + @Override + public void showError(Context context, String msg, CommandCallbacks callbacks) { + if(msg.length() > 0) + mostrarAviso(context, msg, callbacks); + } + + @Override + public void onFinish(CommandBase cmd) { + removeCommand(cmd); + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandBase.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandBase.java new file mode 100644 index 00000000..8b79d67a --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandBase.java @@ -0,0 +1,126 @@ +package com.nelosan.baselibrary2.comunicacion.command; + +import android.content.Context; +import android.os.AsyncTask; + + +public class CommandBase extends AsyncTask { + + /*************************************************** PROPIEDADES *************************************************** + -Activity: Actividad que ejecuta la tarea asíncrona. + -errorMessage: Mensaje de error que se muestra si falla algo en la ejecución de la tarea. + -Start/End: Interface que se utiliza para ejecutar una operación antes o despues de ejecutar una tarea asíncrona. + -succesMessage: Mensaje que se muestra si la tarea se ha ejecutado correctamente. + ****************************************************************************************************************************/ + + private CommandCallbacks callbacks; + + private Context context; + private ExecuterCallbacks executerCallbacks; + protected boolean needInternet = true; + private boolean cancel = false; + private boolean cancelable = true; + protected boolean background = false; + private String errorMessage = ""; + private String error = ""; + + @Override + protected final Void doInBackground(Void... params) { + + try { + Execute(); + } catch (RuntimeException ex) { + error = ex.getMessage(); + } + return null; + } + + protected void Execute() {} + + @Override + protected final void onPreExecute() { + super.onPreExecute(); + cancel = false; + Start(); + } + + @Override + protected final void onPostExecute(Void result) { + super.onPostExecute(result); + if(!cancel) { + if(error.length() == 0 || background) { + errorMessage = ""; + Finished(); + } + else { + if (errorMessage.equals("")) { + errorMessage = error; + } + executerCallbacks.showError(context, errorMessage, callbacks); + } + } + executerCallbacks.onFinish(this); + } + + public boolean isNeedInternet() { + return needInternet; + } + + @Override + protected void onCancelled() { + super.onCancelled(); + if(cancelable) + cancel = true; + } + + private void Finished(){ + if(callbacks != null) + callbacks.onFinish(); + } + + private void Start(){ + if(callbacks != null) + callbacks.onStart(); + } + + public void retry() + { + if(callbacks != null) + callbacks.onRetry(); + } + + public void accept() + { + if(callbacks != null) + callbacks.onAccept(); + } + + public void setCancelable(Boolean cancelable) { + this.cancelable = cancelable; + } + + + public void setCallbacks(CommandCallbacks callbacks) { + this.callbacks = callbacks; + } + + public Boolean isCancelable() { + return cancelable; + } + + public void setExecuterCallbacks(ExecuterCallbacks executerCallbacks) { + this.executerCallbacks = executerCallbacks; + } + + public void setErrorMessage(String errorMessage) { + this.errorMessage = errorMessage; + } + + public void setContext(Context context) { + this.context = context; + } + + public boolean isBackground() { + return background; + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandBase.java.orig b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandBase.java.orig new file mode 100644 index 00000000..b263ca88 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandBase.java.orig @@ -0,0 +1,147 @@ +package com.nelosan.baselibrary2.comunicacion.command; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.net.ConnectivityManager; +import android.os.AsyncTask; + +import com.nelosan.baselibrary2.R; +import com.nelosan.baselibrary2.comunicacion.Ejecutador; + +public class CommandBase extends AsyncTask { + + /*************************************************** PROPIEDADES *************************************************** + -Activity: Actividad que ejecuta la tarea asíncrona. + -errorMessage: Mensaje de error que se muestra si falla algo en la ejecución de la tarea. + -Start/End: Interface que se utiliza para ejecutar una operación antes o despues de ejecutar una tarea asíncrona. + -succesMessage: Mensaje que se muestra si la tarea se ha ejecutado correctamente. + ****************************************************************************************************************************/ + + private Context context; + private CommandCallbacks callbacks; + protected boolean needInternet = true; + private Boolean cancel = false; + private Boolean cancelable = true; + private String error = ""; + protected String errorMessage = ""; + private Ejecutador ejecutador = Ejecutador.getInstance(); + + public CommandBase(){} + + public CommandBase(CommandCallbacks callbacks) + { + this.callbacks = callbacks; + } + + @Override + protected final Void doInBackground(Context... params) { + + context = params[0]; + + try { + if (needInternet && !isOnline()) { + mostrarAviso(context.getResources().getString(R.string.no_internet), false); + } + else { + Execute(); + } + } catch (Exception ex) { + error = ex.getMessage(); + } + + return null; + } + + protected void Execute() {} + + @Override + protected final void onPreExecute() { + super.onPreExecute(); + cancel = false; + Start(); + } + + @Override + protected final void onPostExecute(Void result) { + super.onPostExecute(result); + if(!cancel) { + if (!error.equals("") && !errorMessage.equals("")) + mostrarAviso(errorMessage, true); + else + Finished(); + } + ejecutador.removeCommand(this); + } + + public boolean isNeedInternet() { + return needInternet; + } + + private void mostrarAviso(String msg, boolean showRetry) + { + /** Muestra un mensaje de error **/ + AlertDialog.Builder b = new AlertDialog.Builder(context); + b.setMessage(msg); + + b.setPositiveButton(context.getResources().getString(R.string.aceptar), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.cancel(); + accept(); + } + }); + + if(showRetry) { + b.setNegativeButton(context.getResources().getString(R.string.retry), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + retry(); + } + }); + } + + b.setTitle("Error"); + b.show(); + } + + @Override + protected void onCancelled() { + super.onCancelled(); + if(cancelable) + cancel = true; + } + + private void Finished(){ + if(callbacks != null) + callbacks.onFinish(); + } + + private void Start(){ + if(callbacks != null) + callbacks.onStart(); + } + + public void retry() + { + if(callbacks != null) + callbacks.onRetry(); + } + + public void accept() + { + if(callbacks != null) + callbacks.onAccept(); + } + + public void setCancelable(Boolean cancelable) { + this.cancelable = cancelable; + } + + private boolean isOnline() + { + /** Comprueba que hay conexión a internet **/ + ConnectivityManager cm = (ConnectivityManager)context.getSystemService(Context.CONNECTIVITY_SERVICE); + return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnectedOrConnecting(); + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandCallbacks.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandCallbacks.java new file mode 100644 index 00000000..1ad528e0 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/CommandCallbacks.java @@ -0,0 +1,13 @@ +package com.nelosan.baselibrary2.comunicacion.command; + +/** + * Created by nelo on 17/02/16. + */ +public interface CommandCallbacks { + + void onStart(); + void onFinish(); + void onRetry(); + void onAccept(); + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/ExecuterCallbacks.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/ExecuterCallbacks.java new file mode 100644 index 00000000..58203aba --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/command/ExecuterCallbacks.java @@ -0,0 +1,12 @@ +package com.nelosan.baselibrary2.comunicacion.command; + +import android.content.Context; + +/** + * Created by nelo on 25/5/16. + */ +public interface ExecuterCallbacks { + + void showError(Context context, String msg, CommandCallbacks callbacks); + void onFinish(CommandBase cmd); +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/ErrorInfo.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/ErrorInfo.java new file mode 100644 index 00000000..2ac823f7 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/ErrorInfo.java @@ -0,0 +1,20 @@ +package com.nelosan.baselibrary2.comunicacion.facade; + +public class ErrorInfo +{ + private String Type; + private String Message; + + public String getType() { + return Type; + } + public void setType(String type) { + Type = type; + } + public String getMessage() { + return Message; + } + public void setMessage(String message) { + Message = message; + } +} \ No newline at end of file diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/FacadeBase.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/FacadeBase.java new file mode 100644 index 00000000..734d5f15 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/FacadeBase.java @@ -0,0 +1,53 @@ +package com.nelosan.baselibrary2.comunicacion.facade; + +import java.io.File; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Map; + + +/** + * Created by nelo on 14/01/15. + */ +public class FacadeBase { + + private String facadeName = ""; + protected FacadeClient client; + + public FacadeBase(String name) + { + this.facadeName = name; + } + + protected Object Exec(Type tipo, String command, Object... args) + { + return client.Execute(tipo, facadeName, command, args); + } + + protected Object Exec(Type tipo, Map politypes, String command, Object... args) + { + return client.Execute(tipo, politypes, facadeName, command, args); + } + + protected List ExecList(Class tipo, String command, Object... args) + { + return client.ExecuteList(tipo, facadeName, command, args); + } + + protected void ExecVoid(Type tipo, String command, Object... args) + { + client.Execute(tipo, facadeName, command, args); + } + + public void Download(File file, String facade, String command, Object... args) + { + client.Download(file, facade, command, args); + } + + public String DownloadString(String facade, String command, Object[] args) + { + return client.DownloadString(facade, command, args); + } + + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/FacadeClient.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/FacadeClient.java new file mode 100644 index 00000000..35bf423e --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/FacadeClient.java @@ -0,0 +1,152 @@ +package com.nelosan.baselibrary2.comunicacion.facade; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import com.google.gson.reflect.TypeToken; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.lang.reflect.Type; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +public class FacadeClient { + + public static final String GET = "GET"; + public static final String POST = "POST"; + protected static final int CONNECTION_TIMEOUT = 10; + protected static final int DATA_TIMEOUT = 10; + + protected Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + protected String host; + + protected FacadeClient() { + } + + public Object Execute(Type tipo, String facade, String command, Object... args) + { + String msg = InnerExecute(facade, command, args, null); + + Object obj = null; + + obj = gson.fromJson(msg, tipo); + + return obj; + } + + public Object Execute(Type tipo, Map politypes, String facade, String command, Object... args) + { + + String msg = InnerExecute(facade, command, args, null); + + Object obj = null; + + obj = gson.fromJson(msg, tipo); + return obj; + + } + + public List ExecuteList(final Class tipo, String facade, String command, Object... args) + { + String msg = InnerExecute(facade, command, args, null); + + JsonParser parser = new JsonParser(); + JsonArray array = parser.parse(msg).getAsJsonArray(); + + List lst = new ArrayList(); + for(final JsonElement json: array){ + T entity = gson.fromJson(json, tipo); + lst.add(entity); + } + + return lst; + } + + public void Download(File file, String facade, String command, Object[] args) + { + InnerExecute(facade, command, args, file); + } + + public String DownloadString(String facade, String command, Object[] args) + { + return InnerExecute(facade, command, args, null); + } + + private String InnerExecute(String facade, String command, Object[] args, File file) + { + + String argsMessage = ""; + argsMessage = gson.toJson(args); + String msg = ""; + OutputStream output; + try + { + + if (file == null) + { + output = new ByteArrayOutputStream(); + WriteResponseToStream(facade, command, argsMessage, output); + msg = output.toString(); + output.close(); + } + else + { + output = new FileOutputStream(file); + WriteResponseToStream(facade, command, argsMessage, output); + output.close(); + } + + } + catch (FileNotFoundException e) { + // TODO Auto-generated catch block + throw new RuntimeException(e.getMessage()); + } catch (IOException e) { + // TODO Auto-generated catch block + throw new RuntimeException(e.getMessage()); + } + + + return msg; + } + + protected void WriteResponseToStream(String facade, String command, String argsMessage, OutputStream resultstream){ + } + + protected HttpURLConnection generateHttpUrlConection(URL url){ + HttpURLConnection connection = null; + try { + connection = (HttpURLConnection) url.openConnection(); + connection.setReadTimeout(DATA_TIMEOUT * 1000); + connection.setConnectTimeout(CONNECTION_TIMEOUT * 1000); + connection.setDoInput(true); + connection.setDoOutput(true); + } catch (IOException e) { + throw new RuntimeException(e.toString()); + } + + return connection; + } + + protected URL generateUrl(String facade, String command) + { + try { + return new URL(host+facade+"/"+command); + } catch (MalformedURLException e) { + throw new RuntimeException(e.toString()); + } + + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/UpdateException.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/UpdateException.java new file mode 100644 index 00000000..105efa3f --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/comunicacion/facade/UpdateException.java @@ -0,0 +1,19 @@ +package com.nelosan.baselibrary2.comunicacion.facade; + +/** + * Created by nelo on 2/5/16. + */ +public class UpdateException extends RuntimeException { + + private int type; + + public UpdateException(String message, int type) + { + super(message); + this.type = type; + } + + public int getType() { + return type; + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/Accion.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/Accion.java new file mode 100644 index 00000000..0b4ca138 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/Accion.java @@ -0,0 +1,10 @@ +package com.nelosan.baselibrary2.core; + +/** + * Created by nelo on 5/5/16. + */ +public interface Accion { + + public void realizarAccion(); + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/DireccionesGestureDetector.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/DireccionesGestureDetector.java new file mode 100644 index 00000000..b5ee4a24 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/DireccionesGestureDetector.java @@ -0,0 +1,80 @@ +package com.nelosan.baselibrary2.core; + +import android.content.Context; +import android.util.Log; +import android.view.GestureDetector; +import android.view.MotionEvent; + +/** + * Created by Jes�s Tom�s on 04/05/2015. + */ +public class DireccionesGestureDetector extends GestureDetector { + + public interface OnDireccionesGestureListener extends OnGestureListener { + boolean onDerecha(MotionEvent e1, MotionEvent e2, float distX, float distY); + boolean onIzquierda(MotionEvent e1, MotionEvent e2, float distX, float distY); + boolean onArriba(MotionEvent e1, MotionEvent e2, float distX, float distY); + boolean onAbajo(MotionEvent e1, MotionEvent e2, float distX, float distY); + } + + OnDireccionesGestureListener listener; + MotionEvent antiguaPulsacion; + boolean pulsando = false; + float distMin = 20; + + public DireccionesGestureDetector(Context c, OnDireccionesGestureListener listener) { + super(c, listener); + this.listener = listener; + } + + public boolean onTouchEvent(MotionEvent evento) { + boolean procesado = false; + if (evento.getAction() == MotionEvent.ACTION_DOWN) { + antiguaPulsacion = MotionEvent.obtain(evento); + pulsando = true; + } else if (evento.getAction() == MotionEvent.ACTION_UP && pulsando) { + pulsando = false; + float distX = antiguaPulsacion.getX() - evento.getX(); + float distY = antiguaPulsacion.getY() - evento.getY(); + if ((Math.abs(distX / distY) > 2) && (distX > distMin)) { + procesado = listener.onIzquierda(antiguaPulsacion, evento, distX, distY); + } + if ((Math.abs(distX / distY) > 2) && (-distX > distMin)) { + procesado = listener.onDerecha(antiguaPulsacion, evento, distX, distY); + } + if ((Math.abs(distY / distX) > 2) && (distY > distMin)) { + procesado = listener.onArriba(antiguaPulsacion, evento, distX, distY); + } + if ((Math.abs(distY / distX) > 2) && (-distY > distMin)) { + procesado = listener.onAbajo(antiguaPulsacion, evento, distX, distY); + } + } + return procesado || super.onTouchEvent(evento); + } + + + public static class SimpleOnDireccionesGestureListener + extends SimpleOnGestureListener + implements OnDireccionesGestureListener{ + + @Override + public boolean onDerecha(MotionEvent e1, MotionEvent e2, float distX, float distY) { + return false; + } + + @Override + public boolean onIzquierda(MotionEvent e1, MotionEvent e2, float distX, float distY) { + return false; + } + + @Override + public boolean onArriba(MotionEvent e1, MotionEvent e2, float distX, float distY) { + return false; + } + + @Override + public boolean onAbajo(MotionEvent e1, MotionEvent e2, float distX, float distY) { + return false; + } + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/DividerItemDecoration.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/DividerItemDecoration.java new file mode 100644 index 00000000..4000c89e --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/DividerItemDecoration.java @@ -0,0 +1,88 @@ +package com.nelosan.baselibrary2.core; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Rect; +import android.graphics.drawable.Drawable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import android.view.View; + +/** + * Created by nelo on 13/4/16. + */ +public class DividerItemDecoration extends RecyclerView.ItemDecoration { + + private static final int[] ATTRS = new int[]{ + android.R.attr.listDivider + }; + + public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL; + public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL; + + private Drawable mDivider; + private int mOrientation; + + public DividerItemDecoration(Context context, int orientation) { + final TypedArray a = context.obtainStyledAttributes(ATTRS); + mDivider = a.getDrawable(0); + a.recycle(); + setOrientation(orientation); + } + + public void setOrientation(int orientation) { + if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST) { + throw new IllegalArgumentException("invalid orientation"); + } + mOrientation = orientation; + } + + @Override + public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) { + if (mOrientation == VERTICAL_LIST) { + drawVertical(c, parent); + } else { + drawHorizontal(c, parent); + } + } + + public void drawVertical(Canvas c, RecyclerView parent) { + final int left = parent.getPaddingLeft(); + final int right = parent.getWidth() - parent.getPaddingRight(); + final int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++) { + final View child = parent.getChildAt(i); + final RecyclerView.LayoutParams params = + (RecyclerView.LayoutParams) child.getLayoutParams(); + final int top = child.getBottom() + params.bottomMargin; + final int bottom = top + mDivider.getIntrinsicHeight(); + mDivider.setBounds(left, top, right, bottom); + mDivider.draw(c); + } + } + + public void drawHorizontal(Canvas c, RecyclerView parent) { + final int top = parent.getPaddingTop(); + final int bottom = parent.getHeight() - parent.getPaddingBottom(); + final int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++) { + final View child = parent.getChildAt(i); + final RecyclerView.LayoutParams params = + (RecyclerView.LayoutParams) child.getLayoutParams(); + final int left = child.getRight() + params.rightMargin; + final int right = left + mDivider.getIntrinsicHeight(); + mDivider.setBounds(left, top, right, bottom); + mDivider.draw(c); + } + } + + @Override + public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { + if (mOrientation == VERTICAL_LIST) { + outRect.set(0, 0, 0, mDivider.getIntrinsicHeight()); + } else { + outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0); + } + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/FileManager.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/FileManager.java new file mode 100644 index 00000000..7d82fe96 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/FileManager.java @@ -0,0 +1,108 @@ +package com.nelosan.baselibrary2.core; + +import android.content.Context; +import androidx.annotation.NonNull; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStreamReader; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 30/01/15. + */ +public class FileManager { + + + public static void guardarFichero(String filename, Object objeto, Context context) + { + FileOutputStream outputStream; + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + String json = gson.toJson(objeto); + + try { + outputStream = context.openFileOutput(filename, Context.MODE_PRIVATE); + outputStream.write(json.getBytes()); + outputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + + public static List recuperarFicheroLista(String filename, final Class tipo, Context context) + { + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + String result = readFile(filename, context); + + JsonParser parser = new JsonParser(); + JsonArray array = parser.parse(result).getAsJsonArray(); + + List lst = new ArrayList(); + for(final JsonElement json: array){ + T entity = gson.fromJson(json, tipo); + lst.add(entity); + } + + return lst; + } + + public static Object recuperarFichero(String filename, Type tipo, Context context) + { + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + String result = readFile(filename, context); + + return gson.fromJson(result, tipo); + } + + public static void borrarFichero(String filename, Context context) + { + File file = getFile(filename, context); + file.delete(); + } + + private static String readFile(String filename, Context context) + { + String result = ""; + try { + FileInputStream inputStream = context.openFileInput(filename); + BufferedReader entrada; + entrada = new BufferedReader(new InputStreamReader(inputStream)); + String linea; + do { + linea = entrada.readLine(); + if(linea != null) { + result += linea; + } + } while (linea != null); + inputStream.close(); + } catch (Exception e) { + e.printStackTrace(); + } + + return result; + } + + public static boolean fileExist(String filename, @NonNull Context context){ + File file = getFile(filename, context); + return file.exists(); + } + + private static File getFile(String filename, @NonNull Context context){ + File dir = context.getFilesDir(); + File file = new File(dir, filename); + return file; + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/PreferencesManager.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/PreferencesManager.java new file mode 100644 index 00000000..3d1a9572 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/PreferencesManager.java @@ -0,0 +1,59 @@ +package com.nelosan.baselibrary2.core; + +import android.content.SharedPreferences; +import android.util.Base64; + +import com.nelosan.baselibrary2.MyApplication; + + +/** + * Created by nelo on 5/4/16. + */ +public class PreferencesManager { + + public static SharedPreferences getSharedPreferences () { + return MyApplication.getContext().getSharedPreferences("Preferences", 0); + } + + protected static String codificarBase64(String cadena) + { + byte[] encodedBytes = Base64.encode(cadena.getBytes(), Base64.DEFAULT); + return new String(encodedBytes); + } + + + protected static String decodificarBase64(String cadena) + { + byte[] password = Base64.decode(cadena.getBytes(), Base64.DEFAULT); + return new String(password); + } + + + protected static void putStringValue(String key, String value) + { + SharedPreferences.Editor editor = getSharedPreferences().edit(); + editor.putString(key, value); + editor.commit(); + } + + protected static void putBooleanValue(String key, boolean value){ + SharedPreferences.Editor editor = getSharedPreferences().edit(); + editor.putBoolean(key, value); + editor.commit(); + } + + + protected static void putIntValue(String key, int value){ + SharedPreferences.Editor editor = getSharedPreferences().edit(); + editor.putInt(key, value); + editor.commit(); + } + + protected static void removeValue(String key) + { + SharedPreferences.Editor editor = getSharedPreferences().edit(); + editor.remove(key); + editor.commit(); + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/Util.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/Util.java new file mode 100644 index 00000000..195cc074 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/Util.java @@ -0,0 +1,97 @@ +package com.nelosan.baselibrary2.core; + +import android.content.Context; +import android.net.ConnectivityManager; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; + +import com.nelosan.baselibrary2.MyApplication; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +/** + * Created by nelo on 24/06/15. + */ +public class Util { + + public static boolean isInt(String s) { + + try { + Integer.parseInt(s); + return true; + } catch (NumberFormatException e) { + return false; + } + } + + public static void abrirTeclado(EditText myEditText, Context context) + { + myEditText.requestFocus(); + InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); + imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); + } + + public void cerrarTeclado(EditText myEditText, Context context) + { + /** Oculta el teclado **/ + InputMethodManager imm = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE); + imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0); + } + + public static boolean isOnline() + { + /** Comprueba que hay conexión a internet **/ + ConnectivityManager cm = (ConnectivityManager) MyApplication.getContext().getSystemService(Context.CONNECTIVITY_SERVICE); + return cm.getActiveNetworkInfo() != null && cm.getActiveNetworkInfo().isConnectedOrConnecting(); + } + + public static String getStringResource(int id){ + return MyApplication.getContext().getString(id); + } + + public static Date stringToDate(String stringDate, String dateformat){ + DateFormat format = new SimpleDateFormat(dateformat, Locale.ENGLISH); + Date date = null; + try { + date = format.parse(stringDate); + } catch (ParseException e) { + e.printStackTrace(); + } + return date; + } + + public static String dateToString(Date date, String dateformat){ + SimpleDateFormat df = new SimpleDateFormat(dateformat); + String formattedDate = df.format(date); + return formattedDate; + } + + public static int booleanToInt(boolean value){ + if(value) + return 1; + return 0; + } + + public static boolean intToBoolean(int value){ + if(value == 0) + return false; + return true; + } + + public static String getNow(){ + Calendar c = Calendar.getInstance(); + String date = Util.dateToString(c.getTime(), "yyyy-MM-dd"); + return date; + } + + public static String getOdbcDate(){ + Calendar c = Calendar.getInstance(); + String date = Util.dateToString(c.getTime(), "yyyy-MM-dd HH:mm:ss"); + return date; + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/location/LocationProvider.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/location/LocationProvider.java new file mode 100644 index 00000000..35c4cb13 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/location/LocationProvider.java @@ -0,0 +1,18 @@ +package com.nelosan.baselibrary2.core.location; + +import android.content.Context; +import android.location.Location; + +/** + * Created by nelo on 6/7/16. + */ +public interface LocationProvider { + + void createLocationManager(Context context); + String getProvider(); + boolean isEnabledProvider(); + void showAlertProvider(Context context); + Location getLastKnowLocation(Context context); + void updateLocation(); + void stopProvider(); +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/ComprobarPermisos.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/ComprobarPermisos.java new file mode 100644 index 00000000..01d6d302 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/ComprobarPermisos.java @@ -0,0 +1,93 @@ +package com.nelosan.baselibrary2.core.permisos; + +import android.Manifest; +import android.content.pm.PackageManager; +import android.os.Build; +import com.google.android.material.snackbar.Snackbar; +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; +import android.view.View; + +import com.nelosan.baselibrary2.activity.ActivityBase; + + +/** + * Created by nelo on 6/01/16. + */ +public class ComprobarPermisos { + + public static final String READ_PHONE_STATE = Manifest.permission.READ_PHONE_STATE; + public static final String GET_ACCOUNTS = Manifest.permission.GET_ACCOUNTS; + public static final String WRITE_EXTERNAL_STORAGE = Manifest.permission.WRITE_EXTERNAL_STORAGE; + public static final String READ_EXTERNAL_STORAGE = Manifest.permission.READ_EXTERNAL_STORAGE; + public static final String CALL_PHONE = Manifest.permission.CALL_PHONE; + public static final String FINE_LOCATION = Manifest.permission.ACCESS_FINE_LOCATION; + public static final String CAMERA = Manifest.permission.CAMERA; + + public static final int PERMISO_READ_PHONE_STATE = 1; + public static final int PERMISO_GET_ACCOUNTS = 2; + public static final int PERMISO_WRITE_EXTERNAL_STORAGE = 3; + public static final int PERMISO_READ_EXTERNAL_STORAGE = 4; + public static final int PERMISO_CALL_PHONE = 5; + public static final int PERMISO_FINE_LOCATION = 6; + public static final int PERMISO_CAMERA = 7; + + public static void necesitaPermiso(SolicitudPermisos solicitud) + { + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) + comprobarPermiso(solicitud); + else if(solicitud.getAccion() != null) + solicitud.getAccion().realizarAccion(); + } + + private static boolean checkPermision(ActivityBase activity, String permiso) + { + return ContextCompat.checkSelfPermission(activity, permiso) == PackageManager.PERMISSION_GRANTED; + } + + private static void comprobarPermiso(SolicitudPermisos solicitud) + { + if(!ComprobarPermisos.checkPermision(solicitud.getActivity(), solicitud.getPermisos()[0])) + solicitarPermisos(solicitud); + else if(solicitud.getAccion() != null) + solicitud.getAccion().realizarAccion(); + } + + private static void solicitarPermisos(final SolicitudPermisos solicitud) { + if(ComprobarPermisos.permisoYaPedido(solicitud)) + { + ComprobarPermisos.snackPermisos(solicitud); + } + else + { + ComprobarPermisos.pedirPermiso(solicitud); + } + } + + + private static boolean permisoYaPedido(SolicitudPermisos solicitud) + { + return ActivityCompat.shouldShowRequestPermissionRationale(solicitud.getActivity(), solicitud.getPermisos()[0]); + } + + private static void pedirPermiso(SolicitudPermisos solicitud) + { + ActivityCompat.requestPermissions(solicitud.getActivity(), solicitud.getPermisos(), solicitud.getCode()); + } + + private static void snackPermisos(final SolicitudPermisos solicitud) + { + Snackbar.make(solicitud.getView(), + solicitud.getMessage(), + Snackbar.LENGTH_INDEFINITE) + .setAction("OK", new View.OnClickListener() { + @Override + public void onClick(View v) { + ComprobarPermisos.pedirPermiso(solicitud); + } + }) + .show(); + } + + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/RequestPermision.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/RequestPermision.java new file mode 100644 index 00000000..0e865a0a --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/RequestPermision.java @@ -0,0 +1,85 @@ +package com.nelosan.baselibrary2.core.permisos; + + +import android.content.Context; +import android.view.View; + +import com.nelosan.baselibrary2.activity.ActivityBase; +import com.nelosan.baselibrary2.core.Accion; +import com.nelosan.baselibrary2.core.permisos.ComprobarPermisos; +import com.nelosan.baselibrary2.core.permisos.SolicitudPermisos; + +/** + * Created by nelo on 4/5/16. + */ +public class RequestPermision extends ComprobarPermisos{ + + public static void pedirPermisoStorage(Context context, View view, String message, Accion accion) + { + String permisos[] = new String[]{ComprobarPermisos.WRITE_EXTERNAL_STORAGE}; + + SolicitudPermisos solicitud = new SolicitudPermisos((ActivityBase) context, + view, + permisos, + message, + ComprobarPermisos.PERMISO_WRITE_EXTERNAL_STORAGE, + accion); + + necesitaPermiso(solicitud); + } + + + public static void pedirPermisoCallPhone(Context context, View view, String message, Accion accion) + { + String permisos[] = new String[]{ComprobarPermisos.CALL_PHONE}; + + SolicitudPermisos solicitud = new SolicitudPermisos((ActivityBase) context, + view, + permisos, + message, + ComprobarPermisos.PERMISO_CALL_PHONE, + accion); + + necesitaPermiso(solicitud); + } + + public static void pedirPermisoFineLocation(Context context, View view, String message, Accion accion){ + String permisos[] = new String[]{ComprobarPermisos.FINE_LOCATION}; + + SolicitudPermisos solicitud = new SolicitudPermisos((ActivityBase) context, + view, + permisos, + message, + ComprobarPermisos.PERMISO_FINE_LOCATION, + accion); + + necesitaPermiso(solicitud); + } + + public static void pedirPermisoCamara(Context context, View view, String message, Accion accion){ + String permisos[] = new String[]{ComprobarPermisos.CAMERA}; + + SolicitudPermisos solicitud = new SolicitudPermisos((ActivityBase) context, + view, + permisos, + message, + ComprobarPermisos.PERMISO_CAMERA, + accion); + + necesitaPermiso(solicitud); + } + + public static void pedirPermisoAccounts(Context context, View view, String message, Accion accion) + { + String permisos[] = new String[]{ComprobarPermisos.GET_ACCOUNTS}; + + SolicitudPermisos solicitud = new SolicitudPermisos((ActivityBase) context, + view, + permisos, + message, + ComprobarPermisos.PERMISO_GET_ACCOUNTS, + accion); + + necesitaPermiso(solicitud); + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/SolicitudPermisos.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/SolicitudPermisos.java new file mode 100644 index 00000000..6a63d6ea --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/core/permisos/SolicitudPermisos.java @@ -0,0 +1,74 @@ +package com.nelosan.baselibrary2.core.permisos; + +import android.view.View; + +import com.nelosan.baselibrary2.activity.ActivityBase; +import com.nelosan.baselibrary2.core.Accion; + +/** + * Created by nelo on 5/5/16. + */ +public class SolicitudPermisos { + + private ActivityBase activity; + private Accion accion; + private String message; + private String[] permisos; + private View view; + private int code; + + public SolicitudPermisos(ActivityBase activity, View view, String[] permisos, String message, int code, Accion accion) + { + this.activity = activity; + this.view = view; + this.message = message; + this.permisos = permisos; + this.code = code; + this.accion = accion; + } + + public ActivityBase getActivity() { + return activity; + } + + public void setActivity(ActivityBase activity) { + this.activity = activity; + } + + public Accion getAccion() { + return accion; + } + + public void setAccion(Accion accion) { + this.accion = accion; + } + + public String[] getPermisos() { + return permisos; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public View getView() { + return view; + } + + public void setView(View view) { + this.view = view; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogBase.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogBase.java new file mode 100644 index 00000000..e067b37e --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogBase.java @@ -0,0 +1,86 @@ +package com.nelosan.baselibrary2.dialog; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary2.comunicacion.Executer; +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; + +/** + * Created by nelo on 18/4/16. + */ +public abstract class DialogBase extends DialogFragment { + + protected ProgressBar progress; + protected View contenedor; + protected LayoutInflater inflater; + protected int layout = -1; + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + inflater = getActivity().getLayoutInflater(); + Bundle args = getArguments(); + if(savedInstanceState != null) + loadArgs(savedInstanceState); + else if(args != null) + loadArgs(args); + + Dialog dialog = createDialog(); + return dialog; + } + + public Dialog createDialog() + { + AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); + View view = CreateView(); + onViewCreated(); + builder.setView(view); + Dialog dialog = builder.create(); + dialog.setCanceledOnTouchOutside(false); + onCreatedDialog(dialog); + return dialog; + } + + protected abstract void loadArgs(Bundle args); + + protected void onCreatedDialog(Dialog dialog){} + + public View CreateView(){ + setLayout(); + View view = inflater.inflate(layout, null); + loadItems(view); + return view; + } + + public abstract void setLayout(); + + public abstract void loadItems(View view); + + public abstract void onViewCreated(); + + public void showProgress(boolean show) + { + if(show) + { + progress.setVisibility(View.VISIBLE); + contenedor.setVisibility(View.INVISIBLE); + } + else + { + progress.setVisibility(View.INVISIBLE); + contenedor.setVisibility(View.VISIBLE); + } + } + + public void execute(CommandBase cmd) + { + Executer ejecutador = Executer.getInstance(); + ejecutador.execute(getActivity(), cmd); + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogListados.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogListados.java new file mode 100644 index 00000000..1c9ad879 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogListados.java @@ -0,0 +1,102 @@ +package com.nelosan.baselibrary2.dialog; + +import android.os.Bundle; +import android.os.Parcelable; + +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + +import android.view.View; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary2.R; +import com.nelosan.baselibrary2.adapter.AdapterBase; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 18/4/16. + */ +public abstract class DialogListados extends DialogRecycler{ + + public static final String ELEMENTOS = "ELEMENTOS"; + + protected RecyclerView rcyListado; + protected AdapterBase adapter; + protected SwipeRefreshLayout swipe; + + protected List elements; + + @Override + public void setErrorMessage() { + + } + + @Override + public void setAdapter() { + rcyListado.setAdapter(adapter); + rcyListado.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false)); + swipe.setRefreshing(false); + adapter.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + clicItemAdapter(v); + } + }); + } + + @Override + public void setAdapterGrid(int columns) { + rcyListado.setAdapter(adapter); + rcyListado.setLayoutManager(new GridLayoutManager(getActivity(), columns)); + swipe.setRefreshing(false); + adapter.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + clicItemAdapter(v); + } + }); + } + + @Override + protected void loadArgs(Bundle args) { + elements = args.getParcelableArrayList(ELEMENTOS); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + if(elements != null) + outState.putParcelableArrayList(ELEMENTOS, (ArrayList) elements); + } + + @Override + public View CreateView() { + View view = inflater.inflate(R.layout.fragment_listado, null); + progress = (ProgressBar)view.findViewById(R.id.fragment_progress); + rcyListado = (RecyclerView)view.findViewById(R.id.recyclerview_listado); + rcyListado.setItemAnimator(new DefaultItemAnimator()); + swipe = (SwipeRefreshLayout)view.findViewById(R.id.fragment_listado_swipe_refresh); + contenedor = rcyListado; + return view; + } + + @Override + public void onViewCreated() { + if(elements == null) + downloadItems(); + else + createAdapter(); + } + + public abstract void downloadItems(); + + public abstract void clicItemAdapter(View v); + + public abstract void createAdapter(); + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogRecycler.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogRecycler.java new file mode 100644 index 00000000..81169aca --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/DialogRecycler.java @@ -0,0 +1,13 @@ +package com.nelosan.baselibrary2.dialog; + + +/** + * Created by nelo on 18/11/15. + */ +public abstract class DialogRecycler extends DialogBase { + + public abstract void setErrorMessage(); + public abstract void setAdapter(); + public abstract void setAdapterGrid(int columns); + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/StaticAlerts.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/StaticAlerts.java new file mode 100644 index 00000000..fc6a483d --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/dialog/StaticAlerts.java @@ -0,0 +1,48 @@ +package com.nelosan.baselibrary2.dialog; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; + +import com.nelosan.baselibrary2.R; +import com.nelosan.baselibrary2.core.Accion; + + +/** + * Created by nelo on 28/4/16. + */ +public class StaticAlerts { + + protected static void alert(Context context, String title, String message, DialogInterface.OnClickListener positive, DialogInterface.OnClickListener negative) + { + alert(context, title, message, context.getResources().getString(R.string.aceptar), context.getResources().getString(R.string.cancelar), positive, negative); + } + + protected static void alert(Context context, String title, String message, String positiveText, String negativeText, + DialogInterface.OnClickListener positive, DialogInterface.OnClickListener negative) + { + AlertDialog.Builder dialog = new AlertDialog.Builder(context); + dialog.setTitle(title); + dialog.setMessage(message); + dialog.setPositiveButton(positiveText, positive); + dialog.setNegativeButton(negativeText, negative); + dialog.show(); + } + + + protected static void alertListado(Context context, String title, String[] opciones, final Accion[] acciones) + { + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setTitle("¿Que desea hacer?") + .setItems(opciones, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int position) { + Accion a = acciones[position]; + a.realizarAccion(); + } + }); + builder.show(); + + } + + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseIterator.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseIterator.java new file mode 100644 index 00000000..3e69be93 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseIterator.java @@ -0,0 +1,16 @@ +package com.nelosan.baselibrary2.fragment.base; + +import androidx.annotation.NonNull; + +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; + +/** + * Created by nelo on 25/5/16. + */ +public interface BaseIterator

{ + + void bindPresenter(@NonNull P presenter); + + void execute(CommandBase cmd); + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseIteratorImpl.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseIteratorImpl.java new file mode 100644 index 00000000..c38f45a0 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseIteratorImpl.java @@ -0,0 +1,24 @@ +package com.nelosan.baselibrary2.fragment.base; + +import androidx.annotation.NonNull; + +import com.nelosan.baselibrary2.comunicacion.Executer; +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; + +/** + * Created by nelo on 25/5/16. + */ +public class BaseIteratorImpl

implements BaseIterator

{ + + protected P presenter; + + public void bindPresenter(@NonNull P presenter) { + this.presenter = presenter; + } + + public void execute(CommandBase cmd) { + if(presenter != null && presenter.getContextFragment() != null) + Executer.getInstance().execute(presenter.getContextFragment(), cmd); + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BasePresenter.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BasePresenter.java new file mode 100644 index 00000000..4e531c6e --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BasePresenter.java @@ -0,0 +1,16 @@ +package com.nelosan.baselibrary2.fragment.base; + +import android.content.Context; +import android.os.Bundle; +import androidx.annotation.NonNull; + +/** + * Created by nelo on 25/5/16. + */ +public interface BasePresenter { + + void bindView(@NonNull V view); + void loadArgs(Bundle args); + void saveArgs(Bundle outs); + Context getContextFragment(); +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BasePresenterImpl.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BasePresenterImpl.java new file mode 100644 index 00000000..4469bc24 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BasePresenterImpl.java @@ -0,0 +1,35 @@ +package com.nelosan.baselibrary2.fragment.base; + +import android.content.Context; +import android.os.Bundle; +import androidx.annotation.NonNull; + +/** + * Created by nelo on 21/05/16. + */ +public class BasePresenterImpl implements BasePresenter { + + protected V view; + + public void bindView(@NonNull V view) { + this.view = view; + } + + @Override + public void loadArgs(Bundle args) { + + } + + @Override + public void saveArgs(Bundle outs) { + + } + + @Override + public Context getContextFragment() { + if(view != null) + return view.getContextFragment(); + return null; + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseView.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseView.java new file mode 100644 index 00000000..b567ce6d --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/BaseView.java @@ -0,0 +1,23 @@ +package com.nelosan.baselibrary2.fragment.base; + +import android.content.Context; +import android.os.Bundle; +import android.view.View; + +import com.nelosan.baselibrary2.comunicacion.command.CommandCallbacks; + +/** + * Created by nelo on 21/05/16. + */ +public interface BaseView { + + void loadArgs(Bundle args); + void loadItems(View view); + void updateView(); + Context getContextFragment(); + void onBackPressed(); + void cambiarFragment(FragmentBase fragment); + void cambiarFragment(FragmentBase fragment, Bundle args); + void createPresenter(); + boolean back(); +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/FragmentBase.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/FragmentBase.java new file mode 100644 index 00000000..dad16e6f --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/base/FragmentBase.java @@ -0,0 +1,109 @@ +package com.nelosan.baselibrary2.fragment.base; + +import android.app.Fragment; +import android.content.Context; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.nelosan.baselibrary2.activity.ActivityBase; +import com.nelosan.baselibrary2.comunicacion.Executer; + +/** + * Created by nelo on 12/01/15. + */ +public class FragmentBase extends Fragment implements BaseView { + + private int layout = -1; + + protected boolean inicializado = false; + private static final String INICIALIZADO = "INICIALIZADO"; + + @Override + public void onCreate(Bundle savedInstanceState) { + createPresenter(); + super.onCreate(savedInstanceState); + Bundle args = getArguments(); + + if(savedInstanceState != null) { + inicializado = savedInstanceState.getBoolean(INICIALIZADO, true); + loadArgs(savedInstanceState); + } + + else if(args != null){ + loadArgs(args); + } + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + super.onCreateView(inflater, container, savedInstanceState); + View view = inflater.inflate(layout, container, false); + setHasOptionsMenu(true); + loadItems(view); + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + updateView(); + } + + @Override + public void loadArgs(Bundle args) { + + } + + @Override + public void loadItems(View view) { + + } + + @Override + public void updateView() { + + } + + @Override + public void onPause() { + super.onPause(); + Executer executer = Executer.getInstance(); + executer.removeCommands(); + } + + @Override + public Context getContextFragment() { + return getActivity(); + } + + @Override + public void onBackPressed(){ + ((ActivityBase)getActivity()).onBackPressed(); + } + + + @Override + public void cambiarFragment(FragmentBase fragment) { + ((ActivityBase)getActivity()).cambiarFragment(fragment); + } + + @Override + public void cambiarFragment(FragmentBase fragment, Bundle args) { + ((ActivityBase)getActivity()).cambiarFragment(fragment, args); + } + + @Override + public void createPresenter() {} + + @Override + public boolean back() { + return true; + } + + public void setLayout(int layout) { + this.layout = layout; + } + +} \ No newline at end of file diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/FragmentListados.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/FragmentListados.java new file mode 100644 index 00000000..bbf91918 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/FragmentListados.java @@ -0,0 +1,91 @@ +package com.nelosan.baselibrary2.fragment.listados; + +import android.os.Bundle; + +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import android.view.View; + +import com.nelosan.baselibrary2.R; +import com.nelosan.baselibrary2.adapter.AdapterBase; +import com.nelosan.baselibrary2.fragment.progress.FragmentProgress; + +/** + * Created by nelo on 18/11/15. + */ +public class FragmentListados extends FragmentProgress implements ListadosView { + + + protected RecyclerView rcyListado; + protected AdapterBase adapter; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setLayout(R.layout.fragment_listado); + } + + @Override + public void loadItems(View view) { + super.loadItems(view); + rcyListado = (RecyclerView)view.findViewById(R.id.recyclerview_listado); + rcyListado.setItemAnimator(new DefaultItemAnimator()); + setContenedor(rcyListado); + hideProgress(); + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + downloadItems(); + } + + @Override + public void setAdapter() { + rcyListado.setAdapter(adapter); + rcyListado.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.VERTICAL, false)); + adapter.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + clicItemAdapter(v); + } + }); + } + + @Override + public void setAdapterGrid(int columns) { + rcyListado.setAdapter(adapter); + rcyListado.setLayoutManager(new GridLayoutManager(getActivity(), columns)); + adapter.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + clicItemAdapter(v); + } + }); + } + + @Override + public void updateAdapter() { + adapter.notifyDataSetChanged(); + } + + @Override + public void downloadItems(){} + + @Override + public void clicItemAdapter(View v){} + + @Override + public void createAdapter(AdapterBase adapter) { + this.adapter = adapter; + setAdapter(); + } + + @Override + public void createAdapterGrid(AdapterBase adapter, int columns) { + this.adapter = adapter; + setAdapterGrid(columns); + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/FragmentSwipe.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/FragmentSwipe.java new file mode 100644 index 00000000..13152c32 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/FragmentSwipe.java @@ -0,0 +1,51 @@ +package com.nelosan.baselibrary2.fragment.listados; + +import android.os.Bundle; + +import android.view.View; + +import com.nelosan.baselibrary2.R; + +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + +/** + * Created by nelo on 22/05/16. + */ +public class FragmentSwipe extends FragmentListados implements SwipeRefreshLayout.OnRefreshListener, RefreshView{ + + private SwipeRefreshLayout swipe; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setLayout(R.layout.fragment_swipe); + } + + @Override + public void loadItems(View view) { + super.loadItems(view); + swipe = (SwipeRefreshLayout)view.findViewById(R.id.fragment_listado_swipe_refresh); + } + + @Override + public void downloadItems() { + + } + + @Override + public void clicItemAdapter(View v) { + + } + + @Override + public void refresList() { + + } + + + @Override + public void onRefresh() { + refresList(); + } + +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/ListadosView.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/ListadosView.java new file mode 100644 index 00000000..88af65b1 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/ListadosView.java @@ -0,0 +1,22 @@ +package com.nelosan.baselibrary2.fragment.listados; + +import android.view.View; + +import com.nelosan.baselibrary2.adapter.AdapterBase; +import com.nelosan.baselibrary2.fragment.progress.ProgressView; + + + +/** + * Created by nelo on 21/05/16. + */ +public interface ListadosView extends ProgressView { + + void downloadItems(); + void clicItemAdapter(View v); + void createAdapter(AdapterBase adapter); + void createAdapterGrid(AdapterBase adapter, int columns); + void setAdapter(); + void setAdapterGrid(int columns); + void updateAdapter(); +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/RefreshView.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/RefreshView.java new file mode 100644 index 00000000..4a50d535 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/listados/RefreshView.java @@ -0,0 +1,8 @@ +package com.nelosan.baselibrary2.fragment.listados; + +/** + * Created by nelo on 22/05/16. + */ +public interface RefreshView extends ListadosView { + void refresList(); +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/progress/FragmentProgress.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/progress/FragmentProgress.java new file mode 100644 index 00000000..2b4d9b54 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/progress/FragmentProgress.java @@ -0,0 +1,72 @@ +package com.nelosan.baselibrary2.fragment.progress; + +import android.os.Bundle; +import android.view.View; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.nelosan.baselibrary2.R; +import com.nelosan.baselibrary2.fragment.base.FragmentBase; + +/** + * Created by nelo on 21/05/16. + */ +public class FragmentProgress extends FragmentBase implements ProgressView { + + private ProgressBar progress; + private TextView textError; + protected View contenedor; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setLayout(R.layout.progress_view); + } + + @Override + public void loadItems(View view) { + super.loadItems(view); + progress = (ProgressBar)view.findViewById(R.id.fragment_progress); + textError = (TextView)view.findViewById(R.id.textview_no_elementos); + hideProgress(); + } + + + @Override + public void showProgress() { + progress.setVisibility(View.VISIBLE); + textError.setVisibility(View.GONE); + if(contenedor!= null) + contenedor.setVisibility(View.GONE); + } + + @Override + public void hideProgress() { + progress.setVisibility(View.GONE); + if(contenedor!= null) + contenedor.setVisibility(View.VISIBLE); + } + + @Override + public void showError() { + progress.setVisibility(View.GONE); + textError.setVisibility(View.VISIBLE); + if(contenedor!= null) + contenedor.setVisibility(View.GONE); + } + + @Override + public void hideError() { + textError.setVisibility(View.GONE); + if(contenedor!= null) + contenedor.setVisibility(View.VISIBLE); + } + + public void setContenedor(View view){ + this.contenedor = view; + } + + public void setTextError(String error){ + this.textError.setText(error); + } +} diff --git a/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/progress/ProgressView.java b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/progress/ProgressView.java new file mode 100644 index 00000000..f73c47d2 --- /dev/null +++ b/baselibrary2/src/main/java/com/nelosan/baselibrary2/fragment/progress/ProgressView.java @@ -0,0 +1,14 @@ +package com.nelosan.baselibrary2.fragment.progress; + +import com.nelosan.baselibrary2.fragment.base.BaseView; + +/** + * Created by nelo on 21/05/16. + */ +public interface ProgressView extends BaseView{ + + void showProgress(); + void hideProgress(); + void showError(); + void hideError(); +} diff --git a/baselibrary2/src/main/res/anim/entrada_derecha.xml b/baselibrary2/src/main/res/anim/entrada_derecha.xml new file mode 100644 index 00000000..b0d312f7 --- /dev/null +++ b/baselibrary2/src/main/res/anim/entrada_derecha.xml @@ -0,0 +1,5 @@ + + diff --git a/baselibrary2/src/main/res/anim/entrada_izquierda.xml b/baselibrary2/src/main/res/anim/entrada_izquierda.xml new file mode 100644 index 00000000..9fa2f7f2 --- /dev/null +++ b/baselibrary2/src/main/res/anim/entrada_izquierda.xml @@ -0,0 +1,5 @@ + + diff --git a/baselibrary2/src/main/res/anim/salida_derecha.xml b/baselibrary2/src/main/res/anim/salida_derecha.xml new file mode 100644 index 00000000..19ce6ce5 --- /dev/null +++ b/baselibrary2/src/main/res/anim/salida_derecha.xml @@ -0,0 +1,5 @@ + + diff --git a/baselibrary2/src/main/res/anim/salida_izquierda.xml b/baselibrary2/src/main/res/anim/salida_izquierda.xml new file mode 100644 index 00000000..0cf357d8 --- /dev/null +++ b/baselibrary2/src/main/res/anim/salida_izquierda.xml @@ -0,0 +1,5 @@ + + diff --git a/baselibrary2/src/main/res/anim/scale_enter.xml b/baselibrary2/src/main/res/anim/scale_enter.xml new file mode 100644 index 00000000..a6beb723 --- /dev/null +++ b/baselibrary2/src/main/res/anim/scale_enter.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/anim/scale_exit.xml b/baselibrary2/src/main/res/anim/scale_exit.xml new file mode 100644 index 00000000..efcbfe02 --- /dev/null +++ b/baselibrary2/src/main/res/anim/scale_exit.xml @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/animator/enter_anim.xml b/baselibrary2/src/main/res/animator/enter_anim.xml new file mode 100644 index 00000000..dae3109d --- /dev/null +++ b/baselibrary2/src/main/res/animator/enter_anim.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/animator/entrada_derecha.xml b/baselibrary2/src/main/res/animator/entrada_derecha.xml new file mode 100644 index 00000000..a16c0c68 --- /dev/null +++ b/baselibrary2/src/main/res/animator/entrada_derecha.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/animator/exit_anim.xml b/baselibrary2/src/main/res/animator/exit_anim.xml new file mode 100644 index 00000000..14edd1d6 --- /dev/null +++ b/baselibrary2/src/main/res/animator/exit_anim.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/animator/salida_izquierda.xml b/baselibrary2/src/main/res/animator/salida_izquierda.xml new file mode 100644 index 00000000..559ceb51 --- /dev/null +++ b/baselibrary2/src/main/res/animator/salida_izquierda.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/baselibrary2/src/main/res/drawable-hdpi/ic_action_back.png b/baselibrary2/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 00000000..bff21fbd Binary files /dev/null and b/baselibrary2/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/baselibrary2/src/main/res/drawable-hdpi/ic_action_mic.png b/baselibrary2/src/main/res/drawable-hdpi/ic_action_mic.png new file mode 100644 index 00000000..0706f9d7 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-hdpi/ic_action_mic.png differ diff --git a/baselibrary2/src/main/res/drawable-hdpi/ic_action_next_item.png b/baselibrary2/src/main/res/drawable-hdpi/ic_action_next_item.png new file mode 100644 index 00000000..67f14821 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-hdpi/ic_action_next_item.png differ diff --git a/baselibrary2/src/main/res/drawable-hdpi/ic_action_previous_item.png b/baselibrary2/src/main/res/drawable-hdpi/ic_action_previous_item.png new file mode 100644 index 00000000..e861ecce Binary files /dev/null and b/baselibrary2/src/main/res/drawable-hdpi/ic_action_previous_item.png differ diff --git a/baselibrary2/src/main/res/drawable-hdpi/ic_action_replay.png b/baselibrary2/src/main/res/drawable-hdpi/ic_action_replay.png new file mode 100644 index 00000000..93a0f670 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-hdpi/ic_action_replay.png differ diff --git a/baselibrary2/src/main/res/drawable-hdpi/ic_action_search.png b/baselibrary2/src/main/res/drawable-hdpi/ic_action_search.png new file mode 100644 index 00000000..772e3598 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-hdpi/ic_action_search.png differ diff --git a/baselibrary2/src/main/res/drawable-hdpi/ic_action_search_dark.png b/baselibrary2/src/main/res/drawable-hdpi/ic_action_search_dark.png new file mode 100644 index 00000000..f594b4e4 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-hdpi/ic_action_search_dark.png differ diff --git a/baselibrary2/src/main/res/drawable-hdpi/ic_back.png b/baselibrary2/src/main/res/drawable-hdpi/ic_back.png new file mode 100644 index 00000000..0763318b Binary files /dev/null and b/baselibrary2/src/main/res/drawable-hdpi/ic_back.png differ diff --git a/baselibrary2/src/main/res/drawable-mdpi/ic_action_back.png b/baselibrary2/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 00000000..de49971d Binary files /dev/null and b/baselibrary2/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/baselibrary2/src/main/res/drawable-mdpi/ic_action_mic.png b/baselibrary2/src/main/res/drawable-mdpi/ic_action_mic.png new file mode 100644 index 00000000..360a575e Binary files /dev/null and b/baselibrary2/src/main/res/drawable-mdpi/ic_action_mic.png differ diff --git a/baselibrary2/src/main/res/drawable-mdpi/ic_action_next_item.png b/baselibrary2/src/main/res/drawable-mdpi/ic_action_next_item.png new file mode 100644 index 00000000..47365a30 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-mdpi/ic_action_next_item.png differ diff --git a/baselibrary2/src/main/res/drawable-mdpi/ic_action_previous_item.png b/baselibrary2/src/main/res/drawable-mdpi/ic_action_previous_item.png new file mode 100644 index 00000000..4ad2df42 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-mdpi/ic_action_previous_item.png differ diff --git a/baselibrary2/src/main/res/drawable-mdpi/ic_action_replay.png b/baselibrary2/src/main/res/drawable-mdpi/ic_action_replay.png new file mode 100644 index 00000000..71dfae2d Binary files /dev/null and b/baselibrary2/src/main/res/drawable-mdpi/ic_action_replay.png differ diff --git a/baselibrary2/src/main/res/drawable-mdpi/ic_action_search.png b/baselibrary2/src/main/res/drawable-mdpi/ic_action_search.png new file mode 100644 index 00000000..4edb1ff9 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-mdpi/ic_action_search.png differ diff --git a/baselibrary2/src/main/res/drawable-mdpi/ic_action_search_dark.png b/baselibrary2/src/main/res/drawable-mdpi/ic_action_search_dark.png new file mode 100644 index 00000000..2e446ec0 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-mdpi/ic_action_search_dark.png differ diff --git a/baselibrary2/src/main/res/drawable-mdpi/ic_back.png b/baselibrary2/src/main/res/drawable-mdpi/ic_back.png new file mode 100644 index 00000000..2724aa51 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-mdpi/ic_back.png differ diff --git a/baselibrary2/src/main/res/drawable-xhdpi/ic_action_back.png b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 00000000..28432f10 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/baselibrary2/src/main/res/drawable-xhdpi/ic_action_mic.png b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_mic.png new file mode 100644 index 00000000..0c2814f0 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_mic.png differ diff --git a/baselibrary2/src/main/res/drawable-xhdpi/ic_action_next_item.png b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_next_item.png new file mode 100644 index 00000000..5f304742 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_next_item.png differ diff --git a/baselibrary2/src/main/res/drawable-xhdpi/ic_action_previous_item.png b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_previous_item.png new file mode 100644 index 00000000..ed8ac91d Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_previous_item.png differ diff --git a/baselibrary2/src/main/res/drawable-xhdpi/ic_action_replay.png b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_replay.png new file mode 100644 index 00000000..d6671f3b Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_replay.png differ diff --git a/baselibrary2/src/main/res/drawable-xhdpi/ic_action_search.png b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_search.png new file mode 100644 index 00000000..19658e4a Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_search.png differ diff --git a/baselibrary2/src/main/res/drawable-xhdpi/ic_action_search_dark.png b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_search_dark.png new file mode 100644 index 00000000..aad535e9 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xhdpi/ic_action_search_dark.png differ diff --git a/baselibrary2/src/main/res/drawable-xhdpi/ic_back.png b/baselibrary2/src/main/res/drawable-xhdpi/ic_back.png new file mode 100644 index 00000000..f48e521c Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xhdpi/ic_back.png differ diff --git a/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_back.png b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 00000000..46184bd0 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_mic.png b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_mic.png new file mode 100644 index 00000000..c80c4b95 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_mic.png differ diff --git a/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_next_item.png b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_next_item.png new file mode 100644 index 00000000..51479d8d Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_next_item.png differ diff --git a/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_previous_item.png b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_previous_item.png new file mode 100644 index 00000000..bc8ff124 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_previous_item.png differ diff --git a/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_replay.png b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_replay.png new file mode 100644 index 00000000..d9561b3b Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_replay.png differ diff --git a/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_search.png b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_search.png new file mode 100644 index 00000000..a1086388 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_search.png differ diff --git a/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_search_dark.png b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_search_dark.png new file mode 100644 index 00000000..9c0ea3ca Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxhdpi/ic_action_search_dark.png differ diff --git a/baselibrary2/src/main/res/drawable-xxhdpi/ic_back.png b/baselibrary2/src/main/res/drawable-xxhdpi/ic_back.png new file mode 100644 index 00000000..f8610b76 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxhdpi/ic_back.png differ diff --git a/baselibrary2/src/main/res/drawable-xxxhdpi/mcv_action_next.png b/baselibrary2/src/main/res/drawable-xxxhdpi/mcv_action_next.png new file mode 100644 index 00000000..9a8e5a80 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxxhdpi/mcv_action_next.png differ diff --git a/baselibrary2/src/main/res/drawable-xxxhdpi/mcv_action_previous.png b/baselibrary2/src/main/res/drawable-xxxhdpi/mcv_action_previous.png new file mode 100644 index 00000000..bce26481 Binary files /dev/null and b/baselibrary2/src/main/res/drawable-xxxhdpi/mcv_action_previous.png differ diff --git a/baselibrary2/src/main/res/drawable/bottom_shadow.9.png b/baselibrary2/src/main/res/drawable/bottom_shadow.9.png new file mode 100644 index 00000000..b9bcc2d1 Binary files /dev/null and b/baselibrary2/src/main/res/drawable/bottom_shadow.9.png differ diff --git a/baselibrary2/src/main/res/drawable/circulo.xml b/baselibrary2/src/main/res/drawable/circulo.xml new file mode 100644 index 00000000..8fe5b190 --- /dev/null +++ b/baselibrary2/src/main/res/drawable/circulo.xml @@ -0,0 +1,14 @@ + + + + + + + diff --git a/baselibrary2/src/main/res/layouts/app-bar/layout/activity_appbar.xml b/baselibrary2/src/main/res/layouts/app-bar/layout/activity_appbar.xml new file mode 100644 index 00000000..dcaec01e --- /dev/null +++ b/baselibrary2/src/main/res/layouts/app-bar/layout/activity_appbar.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + diff --git a/baselibrary2/src/main/res/layouts/app-bar/layout/appbar_layout.xml b/baselibrary2/src/main/res/layouts/app-bar/layout/appbar_layout.xml new file mode 100644 index 00000000..f41710b1 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/app-bar/layout/appbar_layout.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/layouts/app-bar/layout/toolbar.xml b/baselibrary2/src/main/res/layouts/app-bar/layout/toolbar.xml new file mode 100644 index 00000000..cacbd1d3 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/app-bar/layout/toolbar.xml @@ -0,0 +1,10 @@ + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/layouts/calendar/layout/calendar.xml b/baselibrary2/src/main/res/layouts/calendar/layout/calendar.xml new file mode 100644 index 00000000..b8dfb521 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/calendar/layout/calendar.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/baselibrary2/src/main/res/layouts/calendar/layout/item_calendar.xml b/baselibrary2/src/main/res/layouts/calendar/layout/item_calendar.xml new file mode 100644 index 00000000..25312b43 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/calendar/layout/item_calendar.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/layouts/fragment/layout/fragment_listado.xml b/baselibrary2/src/main/res/layouts/fragment/layout/fragment_listado.xml new file mode 100644 index 00000000..6b4b2f08 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/fragment/layout/fragment_listado.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/layouts/fragment/layout/fragment_swipe.xml b/baselibrary2/src/main/res/layouts/fragment/layout/fragment_swipe.xml new file mode 100644 index 00000000..35c2fa3c --- /dev/null +++ b/baselibrary2/src/main/res/layouts/fragment/layout/fragment_swipe.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/layouts/fragment/layout/item_string.xml b/baselibrary2/src/main/res/layouts/fragment/layout/item_string.xml new file mode 100644 index 00000000..b9ce641d --- /dev/null +++ b/baselibrary2/src/main/res/layouts/fragment/layout/item_string.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/layouts/fragment/layout/recyclerview.xml b/baselibrary2/src/main/res/layouts/fragment/layout/recyclerview.xml new file mode 100644 index 00000000..b0664ab3 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/fragment/layout/recyclerview.xml @@ -0,0 +1,11 @@ + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/layouts/framelayout_sombra.xml b/baselibrary2/src/main/res/layouts/framelayout_sombra.xml new file mode 100644 index 00000000..a3b0ade1 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/framelayout_sombra.xml @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/layouts/progress-view/layout/progress.xml b/baselibrary2/src/main/res/layouts/progress-view/layout/progress.xml new file mode 100644 index 00000000..7d387059 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/progress-view/layout/progress.xml @@ -0,0 +1,9 @@ + + + diff --git a/baselibrary2/src/main/res/layouts/progress-view/layout/progress_view.xml b/baselibrary2/src/main/res/layouts/progress-view/layout/progress_view.xml new file mode 100644 index 00000000..fb55bf1d --- /dev/null +++ b/baselibrary2/src/main/res/layouts/progress-view/layout/progress_view.xml @@ -0,0 +1,8 @@ + + + + + + diff --git a/baselibrary2/src/main/res/layouts/progress-view/layout/text_no_hay.xml b/baselibrary2/src/main/res/layouts/progress-view/layout/text_no_hay.xml new file mode 100644 index 00000000..44e7e220 --- /dev/null +++ b/baselibrary2/src/main/res/layouts/progress-view/layout/text_no_hay.xml @@ -0,0 +1,9 @@ + + diff --git a/baselibrary2/src/main/res/values-es/strings.xml b/baselibrary2/src/main/res/values-es/strings.xml new file mode 100644 index 00000000..467984f8 --- /dev/null +++ b/baselibrary2/src/main/res/values-es/strings.xml @@ -0,0 +1,59 @@ + + + + No hay conexión a internet + Aceptar + Cancelar + Reintentar + Aviso + Buscar + Actualizar + + + lunes + martes + miercoles + jueves + viernes + sabado + domingo + + lun. + mar. + mie. + jue. + vie. + sab. + dom. + + ene. + feb. + mar. + abr. + may. + jun. + jul. + ago. + sep. + oct. + nov. + dec. + + Enero + Febrero + Marzo + Abril + Mayo + Junio + Julio + Agosto + Septiembre + Octubre + Noviembre + Diciembre + + Actualización + Hay disponible una actualización + Actualizar + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/values-v21/refs.xml b/baselibrary2/src/main/res/values-v21/refs.xml new file mode 100644 index 00000000..2ef381b7 --- /dev/null +++ b/baselibrary2/src/main/res/values-v21/refs.xml @@ -0,0 +1,4 @@ + + + @null + \ No newline at end of file diff --git a/baselibrary2/src/main/res/values-w800dp/dimens.xml b/baselibrary2/src/main/res/values-w800dp/dimens.xml new file mode 100644 index 00000000..6e887da7 --- /dev/null +++ b/baselibrary2/src/main/res/values-w800dp/dimens.xml @@ -0,0 +1,8 @@ + + + 64dp + 10sp + 30sp + diff --git a/baselibrary2/src/main/res/values/attrs.xml b/baselibrary2/src/main/res/values/attrs.xml new file mode 100644 index 00000000..a638e472 --- /dev/null +++ b/baselibrary2/src/main/res/values/attrs.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/baselibrary2/src/main/res/values/colors.xml b/baselibrary2/src/main/res/values/colors.xml new file mode 100644 index 00000000..121eb871 --- /dev/null +++ b/baselibrary2/src/main/res/values/colors.xml @@ -0,0 +1,12 @@ + + + + #000 + #000 + #FFF + #d7d7d7 + #8c8c8c + #ff00b5d0 + #d7d7d7 + + diff --git a/baselibrary2/src/main/res/values/dimens.xml b/baselibrary2/src/main/res/values/dimens.xml new file mode 100644 index 00000000..54dcff1f --- /dev/null +++ b/baselibrary2/src/main/res/values/dimens.xml @@ -0,0 +1,25 @@ + + + 16dp + 16dp + + 1dp + 10dp + 10dp + 10dp + 10dp + 10dp + 4dp + + + 60dp + 15dp + 15dp + 20sp + 5dp + 3dp + 12sp + + 30sp + + diff --git a/baselibrary2/src/main/res/values/refs.xml b/baselibrary2/src/main/res/values/refs.xml new file mode 100644 index 00000000..22382412 --- /dev/null +++ b/baselibrary2/src/main/res/values/refs.xml @@ -0,0 +1,4 @@ + + + @drawable/bottom_shadow + \ No newline at end of file diff --git a/baselibrary2/src/main/res/values/strings.xml b/baselibrary2/src/main/res/values/strings.xml new file mode 100644 index 00000000..d86ea184 --- /dev/null +++ b/baselibrary2/src/main/res/values/strings.xml @@ -0,0 +1,59 @@ + + + + No internet + Accept + Cancel + Retry + Notice + Search + Update + + + monday + tuesday + wednesday + thursday + friday + saturday + sunday + + mon. + tue. + wed. + thu. + fri. + sat. + sun. + + jan. + feb. + mar. + apr. + may. + jun. + jul. + aug. + sep. + oct. + nov. + dec. + + January + February + March + April + May + June + July + August + September + October + November + December + + Update + An update is available + Update + + \ No newline at end of file diff --git a/baselibrary2/src/main/res/values/styles.xml b/baselibrary2/src/main/res/values/styles.xml new file mode 100644 index 00000000..3a20bb7f --- /dev/null +++ b/baselibrary2/src/main/res/values/styles.xml @@ -0,0 +1,8 @@ + + + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 00000000..4bd8e5c6 --- /dev/null +++ b/build.gradle @@ -0,0 +1,26 @@ +// Top-level build file where you can add configuration options common to all sub-projects/modules. +buildscript { + ext.kotlin_version = '1.2.51' + repositories { + jcenter() + google() + } + dependencies { + classpath 'com.android.tools.build:gradle:3.2.1' + //classpath 'com.android.tools.build:gradle:3.1.3' + //classpath 'com.android.tools.build:gradle:3.0.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.0.1' + } +} + +allprojects { + repositories { + google() + jcenter() + maven { url "https://jitpack.io" } + + } + + +} diff --git a/build/android-profile/profile-2018-10-04-12-36-49-602.json b/build/android-profile/profile-2018-10-04-12-36-49-602.json new file mode 100644 index 00000000..2b0428bd --- /dev/null +++ b/build/android-profile/profile-2018-10-04-12-36-49-602.json @@ -0,0 +1 @@ +[{"pid":0,"ph":"i","name":"Memory sample","ts":1538649383363000,"args":{"JVM stats":"heap_memory_usage: 284932104\nnon_heap_memory_usage: 195835648\nloaded_class_count: 20730\nthread_count: 23\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 45\n gc_time: 2352\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 4\n gc_time: 1217\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649409610000,"args":{"JVM stats":"heap_memory_usage: 320736384\nnon_heap_memory_usage: 211490864\nloaded_class_count: 22411\nthread_count: 23\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 3\n gc_time: 226\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":1,"tid":1,"id":2,"name":"base plugin project configure","args":{"span_id":"2","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649383481000,"dur":122000},{"pid":1,"tid":1,"id":3,"name":"base plugin project base extension creation","args":{"span_id":"3","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649383604000,"dur":750000},{"pid":1,"tid":1,"id":5,"name":"task manager create tasks","args":{"span_id":"5","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649384355000,"dur":106000},{"pid":1,"tid":1,"id":4,"name":"base plugin project tasks creation","args":{"span_id":"4","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649384354000,"dur":107000},{"pid":1,"tid":1,"id":8,"name":"variant manager create variants","args":{"span_id":"8","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649386505000,"dur":180000},{"pid":1,"tid":1,"id":9,"name":"variant manager create tests tasks","args":{"span_id":"9","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649386704000,"dur":25000},{"pid":1,"tid":1,"id":11,"name":"lib task manager create generate res values task","args":{"span_id":"11","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649386789000,"dur":7000},{"pid":1,"tid":1,"id":12,"name":"lib task manager create merge manifest task","args":{"span_id":"12","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649386800000,"dur":17000},{"pid":1,"tid":1,"id":13,"name":"lib task manager create create renderscript task","args":{"span_id":"13","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649386818000,"dur":29000},{"pid":1,"tid":1,"id":14,"name":"lib task manager create merge resources task","args":{"span_id":"14","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649386848000,"dur":67000},{"pid":1,"tid":1,"id":15,"name":"lib task manager create merge assets task","args":{"span_id":"15","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649386915000,"dur":26000},{"pid":1,"tid":1,"id":16,"name":"lib task manager create build config task","args":{"span_id":"16","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649386942000,"dur":10000},{"pid":1,"tid":1,"id":17,"name":"lib task manager create process res task","args":{"span_id":"17","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649386972000,"dur":76000},{"pid":1,"tid":1,"id":18,"name":"lib task manager create aidl task","args":{"span_id":"18","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387048000,"dur":25000},{"pid":1,"tid":1,"id":19,"name":"lib task manager create shader task","args":{"span_id":"19","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387074000,"dur":18000},{"pid":1,"tid":1,"id":20,"name":"lib task manager create compile task","args":{"span_id":"20","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387093000,"dur":48000},{"pid":1,"tid":1,"id":21,"name":"lib task manager create ndk task","args":{"span_id":"21","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387142000,"dur":8000},{"pid":1,"tid":1,"id":22,"name":"lib task manager create external native build task","args":{"span_id":"22","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387151000,"dur":1000},{"pid":1,"tid":1,"id":23,"name":"lib task manager create packaging task","args":{"span_id":"23","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387237000,"dur":5000},{"pid":1,"tid":1,"id":24,"name":"lib task manager create merge proguard file task","args":{"span_id":"24","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387246000,"dur":9000},{"pid":1,"tid":1,"id":25,"name":"lib task manager create post compilation task","args":{"span_id":"25","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387306000,"dur":99000},{"pid":1,"tid":1,"id":26,"name":"lib task manager create lint task","args":{"span_id":"26","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387406000,"dur":16000},{"pid":1,"tid":1,"id":10,"name":"variant manager create tasks for variant","args":{"span_id":"10","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649386730000,"dur":692000},{"pid":1,"tid":1,"id":27,"name":"variant manager create tasks for variant","args":{"span_id":"27","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649387422000,"dur":26000},{"pid":1,"tid":1,"id":29,"name":"lib task manager create generate res values task","args":{"span_id":"29","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387450000,"dur":100},{"pid":1,"tid":1,"id":30,"name":"lib task manager create merge manifest task","args":{"span_id":"30","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387450000,"dur":100},{"pid":1,"tid":1,"id":31,"name":"lib task manager create create renderscript task","args":{"span_id":"31","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387450000,"dur":100},{"pid":1,"tid":1,"id":32,"name":"lib task manager create merge resources task","args":{"span_id":"32","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387450000,"dur":2000},{"pid":1,"tid":1,"id":33,"name":"lib task manager create merge assets task","args":{"span_id":"33","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387452000,"dur":100},{"pid":1,"tid":1,"id":34,"name":"lib task manager create build config task","args":{"span_id":"34","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387452000,"dur":1000},{"pid":1,"tid":1,"id":35,"name":"lib task manager create process res task","args":{"span_id":"35","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387453000,"dur":13000},{"pid":1,"tid":1,"id":36,"name":"lib task manager create aidl task","args":{"span_id":"36","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387466000,"dur":100},{"pid":1,"tid":1,"id":37,"name":"lib task manager create shader task","args":{"span_id":"37","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387466000,"dur":1000},{"pid":1,"tid":1,"id":38,"name":"lib task manager create compile task","args":{"span_id":"38","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387467000,"dur":2000},{"pid":1,"tid":1,"id":39,"name":"lib task manager create ndk task","args":{"span_id":"39","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387469000,"dur":1000},{"pid":1,"tid":1,"id":40,"name":"lib task manager create external native build task","args":{"span_id":"40","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387470000,"dur":100},{"pid":1,"tid":1,"id":41,"name":"lib task manager create packaging task","args":{"span_id":"41","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387470000,"dur":1000},{"pid":1,"tid":1,"id":42,"name":"lib task manager create merge proguard file task","args":{"span_id":"42","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387471000,"dur":100},{"pid":1,"tid":1,"id":43,"name":"lib task manager create post compilation task","args":{"span_id":"43","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387471000,"dur":11000},{"pid":1,"tid":1,"id":44,"name":"lib task manager create lint task","args":{"span_id":"44","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387489000,"dur":100},{"pid":1,"tid":1,"id":28,"name":"variant manager create tasks for variant","args":{"span_id":"28","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649387449000,"dur":41000},{"pid":1,"tid":1,"id":45,"name":"variant manager create tasks for variant","args":{"span_id":"45","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649387490000,"dur":12000},{"pid":1,"tid":1,"id":46,"name":"variant manager create tasks for variant","args":{"span_id":"46","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649387502000,"dur":199000},{"pid":1,"tid":1,"id":7,"name":"variant manager create android tasks","args":{"span_id":"7","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649386502000,"dur":1318000},{"pid":1,"tid":1,"id":47,"name":"variant manager external native config values","args":{"span_id":"47","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649387830000,"dur":100},{"pid":1,"tid":1,"id":6,"name":"base plugin create android tasks","args":{"span_id":"6","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649384660000,"dur":3170000},{"pid":1,"tid":1,"id":48,"name":"base plugin project configure","args":{"span_id":"48","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388012000,"dur":24000},{"pid":1,"tid":1,"id":49,"name":"base plugin project base extension creation","args":{"span_id":"49","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388036000,"dur":15000},{"pid":1,"tid":1,"id":51,"name":"task manager create tasks","args":{"span_id":"51","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388051000,"dur":2000},{"pid":1,"tid":1,"id":50,"name":"base plugin project tasks creation","args":{"span_id":"50","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388051000,"dur":6000},{"pid":1,"tid":1,"id":54,"name":"variant manager create variants","args":{"span_id":"54","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388096000,"dur":10000},{"pid":1,"tid":1,"id":55,"name":"variant manager create tests tasks","args":{"span_id":"55","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388106000,"dur":100},{"pid":1,"tid":1,"id":57,"name":"lib task manager create generate res values task","args":{"span_id":"57","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388107000,"dur":100},{"pid":1,"tid":1,"id":58,"name":"lib task manager create merge manifest task","args":{"span_id":"58","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388107000,"dur":100},{"pid":1,"tid":1,"id":59,"name":"lib task manager create create renderscript task","args":{"span_id":"59","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388109000,"dur":1000},{"pid":1,"tid":1,"id":60,"name":"lib task manager create merge resources task","args":{"span_id":"60","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388110000,"dur":3000},{"pid":1,"tid":1,"id":61,"name":"lib task manager create merge assets task","args":{"span_id":"61","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388113000,"dur":100},{"pid":1,"tid":1,"id":62,"name":"lib task manager create build config task","args":{"span_id":"62","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388113000,"dur":100},{"pid":1,"tid":1,"id":63,"name":"lib task manager create process res task","args":{"span_id":"63","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388113000,"dur":11000},{"pid":1,"tid":1,"id":64,"name":"lib task manager create aidl task","args":{"span_id":"64","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388124000,"dur":16000},{"pid":1,"tid":1,"id":65,"name":"lib task manager create shader task","args":{"span_id":"65","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388140000,"dur":1000},{"pid":1,"tid":1,"id":66,"name":"lib task manager create compile task","args":{"span_id":"66","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388141000,"dur":2000},{"pid":1,"tid":1,"id":67,"name":"lib task manager create ndk task","args":{"span_id":"67","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388143000,"dur":100},{"pid":1,"tid":1,"id":68,"name":"lib task manager create external native build task","args":{"span_id":"68","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388143000,"dur":100},{"pid":1,"tid":1,"id":69,"name":"lib task manager create packaging task","args":{"span_id":"69","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388144000,"dur":100},{"pid":1,"tid":1,"id":70,"name":"lib task manager create merge proguard file task","args":{"span_id":"70","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388144000,"dur":100},{"pid":1,"tid":1,"id":71,"name":"lib task manager create post compilation task","args":{"span_id":"71","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388145000,"dur":1000},{"pid":1,"tid":1,"id":72,"name":"lib task manager create lint task","args":{"span_id":"72","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388146000,"dur":100},{"pid":1,"tid":1,"id":56,"name":"variant manager create tasks for variant","args":{"span_id":"56","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388106000,"dur":40000},{"pid":1,"tid":1,"id":73,"name":"variant manager create tasks for variant","args":{"span_id":"73","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388146000,"dur":7000},{"pid":1,"tid":1,"id":75,"name":"lib task manager create generate res values task","args":{"span_id":"75","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388168000,"dur":1000},{"pid":1,"tid":1,"id":76,"name":"lib task manager create merge manifest task","args":{"span_id":"76","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388169000,"dur":100},{"pid":1,"tid":1,"id":77,"name":"lib task manager create create renderscript task","args":{"span_id":"77","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388169000,"dur":1000},{"pid":1,"tid":1,"id":78,"name":"lib task manager create merge resources task","args":{"span_id":"78","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388170000,"dur":3000},{"pid":1,"tid":1,"id":79,"name":"lib task manager create merge assets task","args":{"span_id":"79","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388173000,"dur":5000},{"pid":1,"tid":1,"id":80,"name":"lib task manager create build config task","args":{"span_id":"80","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388178000,"dur":3000},{"pid":1,"tid":1,"id":81,"name":"lib task manager create process res task","args":{"span_id":"81","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388182000,"dur":5000},{"pid":1,"tid":1,"id":82,"name":"lib task manager create aidl task","args":{"span_id":"82","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388188000,"dur":3000},{"pid":1,"tid":1,"id":83,"name":"lib task manager create shader task","args":{"span_id":"83","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388191000,"dur":1000},{"pid":1,"tid":1,"id":84,"name":"lib task manager create compile task","args":{"span_id":"84","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388192000,"dur":8000},{"pid":1,"tid":1,"id":85,"name":"lib task manager create ndk task","args":{"span_id":"85","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388200000,"dur":2000},{"pid":1,"tid":1,"id":86,"name":"lib task manager create external native build task","args":{"span_id":"86","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388203000,"dur":100},{"pid":1,"tid":1,"id":87,"name":"lib task manager create packaging task","args":{"span_id":"87","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388206000,"dur":4000},{"pid":1,"tid":1,"id":88,"name":"lib task manager create merge proguard file task","args":{"span_id":"88","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388210000,"dur":100},{"pid":1,"tid":1,"id":89,"name":"lib task manager create post compilation task","args":{"span_id":"89","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388211000,"dur":3000},{"pid":1,"tid":1,"id":90,"name":"lib task manager create lint task","args":{"span_id":"90","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388216000,"dur":100},{"pid":1,"tid":1,"id":74,"name":"variant manager create tasks for variant","args":{"span_id":"74","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388153000,"dur":63000},{"pid":1,"tid":1,"id":91,"name":"variant manager create tasks for variant","args":{"span_id":"91","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388216000,"dur":54000},{"pid":1,"tid":1,"id":92,"name":"variant manager create tasks for variant","args":{"span_id":"92","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388270000,"dur":63000},{"pid":1,"tid":1,"id":53,"name":"variant manager create android tasks","args":{"span_id":"53","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388096000,"dur":240000},{"pid":1,"tid":1,"id":93,"name":"variant manager external native config values","args":{"span_id":"93","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388337000,"dur":100},{"pid":1,"tid":1,"id":52,"name":"base plugin create android tasks","args":{"span_id":"52","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649388079000,"dur":258000},{"pid":1,"tid":1,"id":94,"name":"base plugin project configure","args":{"span_id":"94","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388500000,"dur":45000},{"pid":1,"tid":1,"id":95,"name":"base plugin project base extension creation","args":{"span_id":"95","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388545000,"dur":26000},{"pid":1,"tid":1,"id":97,"name":"task manager create tasks","args":{"span_id":"97","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388571000,"dur":100},{"pid":1,"tid":1,"id":96,"name":"base plugin project tasks creation","args":{"span_id":"96","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388571000,"dur":100},{"pid":1,"tid":1,"id":100,"name":"variant manager create variants","args":{"span_id":"100","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388624000,"dur":43000},{"pid":1,"tid":1,"id":101,"name":"variant manager create tests tasks","args":{"span_id":"101","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388667000,"dur":100},{"pid":1,"tid":1,"id":103,"name":"app task manager create merge manifest task","args":{"span_id":"103","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388691000,"dur":24000},{"pid":1,"tid":1,"id":104,"name":"app task manager create generate res values task","args":{"span_id":"104","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388715000,"dur":1000},{"pid":1,"tid":1,"id":105,"name":"app task manager create create renderscript task","args":{"span_id":"105","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388719000,"dur":3000},{"pid":1,"tid":1,"id":106,"name":"app task manager create merge resources task","args":{"span_id":"106","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388722000,"dur":1000},{"pid":1,"tid":1,"id":107,"name":"app task manager create merge assets task","args":{"span_id":"107","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388731000,"dur":6000},{"pid":1,"tid":1,"id":108,"name":"app task manager create build config task","args":{"span_id":"108","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388738000,"dur":100},{"pid":1,"tid":1,"id":109,"name":"app task manager create process res task","args":{"span_id":"109","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388740000,"dur":14000},{"pid":1,"tid":1,"id":110,"name":"app task manager create aidl task","args":{"span_id":"110","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388755000,"dur":100},{"pid":1,"tid":1,"id":111,"name":"app task manager create shader task","args":{"span_id":"111","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388756000,"dur":100},{"pid":1,"tid":1,"id":112,"name":"app task manager create ndk task","args":{"span_id":"112","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388756000,"dur":1000},{"pid":1,"tid":1,"id":113,"name":"app task manager create external native build task","args":{"span_id":"113","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388757000,"dur":100},{"pid":1,"tid":1,"id":114,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"114","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388758000,"dur":100},{"pid":1,"tid":1,"id":115,"name":"app task manager create compile task","args":{"span_id":"115","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388760000,"dur":4000},{"pid":1,"tid":1,"id":116,"name":"app task manager create packaging task","args":{"span_id":"116","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388767000,"dur":2000},{"pid":1,"tid":1,"id":117,"name":"app task manager create lint task","args":{"span_id":"117","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388769000,"dur":1000},{"pid":1,"tid":1,"id":102,"name":"variant manager create tasks for variant","args":{"span_id":"102","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388667000,"dur":103000},{"pid":1,"tid":1,"id":118,"name":"variant manager create tasks for variant","args":{"span_id":"118","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388770000,"dur":36000},{"pid":1,"tid":1,"id":120,"name":"app task manager create merge manifest task","args":{"span_id":"120","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388810000,"dur":100},{"pid":1,"tid":1,"id":121,"name":"app task manager create generate res values task","args":{"span_id":"121","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388810000,"dur":100},{"pid":1,"tid":1,"id":122,"name":"app task manager create create renderscript task","args":{"span_id":"122","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388810000,"dur":1000},{"pid":1,"tid":1,"id":123,"name":"app task manager create merge resources task","args":{"span_id":"123","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388811000,"dur":4000},{"pid":1,"tid":1,"id":124,"name":"app task manager create merge assets task","args":{"span_id":"124","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388815000,"dur":1000},{"pid":1,"tid":1,"id":125,"name":"app task manager create build config task","args":{"span_id":"125","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388816000,"dur":100},{"pid":1,"tid":1,"id":126,"name":"app task manager create process res task","args":{"span_id":"126","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388816000,"dur":2000},{"pid":1,"tid":1,"id":127,"name":"app task manager create aidl task","args":{"span_id":"127","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388819000,"dur":100},{"pid":1,"tid":1,"id":128,"name":"app task manager create shader task","args":{"span_id":"128","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388819000,"dur":1000},{"pid":1,"tid":1,"id":129,"name":"app task manager create ndk task","args":{"span_id":"129","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388821000,"dur":100},{"pid":1,"tid":1,"id":130,"name":"app task manager create external native build task","args":{"span_id":"130","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388821000,"dur":100},{"pid":1,"tid":1,"id":131,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"131","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388821000,"dur":3000},{"pid":1,"tid":1,"id":132,"name":"app task manager create compile task","args":{"span_id":"132","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388824000,"dur":13000},{"pid":1,"tid":1,"id":133,"name":"app task manager create packaging task","args":{"span_id":"133","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388837000,"dur":8000},{"pid":1,"tid":1,"id":134,"name":"app task manager create lint task","args":{"span_id":"134","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388845000,"dur":100},{"pid":1,"tid":1,"id":119,"name":"variant manager create tasks for variant","args":{"span_id":"119","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649388806000,"dur":39000},{"pid":1,"tid":1,"id":135,"name":"variant manager create tasks for variant","args":{"span_id":"135","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388845000,"dur":11000},{"pid":1,"tid":1,"id":136,"name":"variant manager create tasks for variant","args":{"span_id":"136","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388857000,"dur":32000},{"pid":1,"tid":1,"id":99,"name":"variant manager create android tasks","args":{"span_id":"99","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388624000,"dur":277000},{"pid":1,"tid":1,"id":137,"name":"variant manager external native config values","args":{"span_id":"137","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388902000,"dur":100},{"pid":1,"tid":1,"id":98,"name":"base plugin create android tasks","args":{"span_id":"98","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649388623000,"dur":279000},{"pid":1,"tid":1,"id":138,"name":"base plugin project configure","args":{"span_id":"138","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389148000,"dur":7000},{"pid":1,"tid":1,"id":139,"name":"base plugin project base extension creation","args":{"span_id":"139","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389155000,"dur":9000},{"pid":1,"tid":1,"id":141,"name":"task manager create tasks","args":{"span_id":"141","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389164000,"dur":1000},{"pid":1,"tid":1,"id":140,"name":"base plugin project tasks creation","args":{"span_id":"140","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389164000,"dur":1000},{"pid":1,"tid":1,"id":144,"name":"variant manager create variants","args":{"span_id":"144","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389205000,"dur":42000},{"pid":1,"tid":1,"id":145,"name":"variant manager create tests tasks","args":{"span_id":"145","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389247000,"dur":100},{"pid":1,"tid":1,"id":147,"name":"app task manager create merge manifest task","args":{"span_id":"147","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389248000,"dur":1000},{"pid":1,"tid":1,"id":148,"name":"app task manager create generate res values task","args":{"span_id":"148","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389249000,"dur":100},{"pid":1,"tid":1,"id":149,"name":"app task manager create create renderscript task","args":{"span_id":"149","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389249000,"dur":100},{"pid":1,"tid":1,"id":150,"name":"app task manager create merge resources task","args":{"span_id":"150","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389249000,"dur":2000},{"pid":1,"tid":1,"id":151,"name":"app task manager create merge assets task","args":{"span_id":"151","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389251000,"dur":100},{"pid":1,"tid":1,"id":152,"name":"app task manager create build config task","args":{"span_id":"152","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389251000,"dur":1000},{"pid":1,"tid":1,"id":153,"name":"app task manager create process res task","args":{"span_id":"153","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389252000,"dur":4000},{"pid":1,"tid":1,"id":154,"name":"app task manager create aidl task","args":{"span_id":"154","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389256000,"dur":1000},{"pid":1,"tid":1,"id":155,"name":"app task manager create shader task","args":{"span_id":"155","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389257000,"dur":100},{"pid":1,"tid":1,"id":156,"name":"app task manager create ndk task","args":{"span_id":"156","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389257000,"dur":100},{"pid":1,"tid":1,"id":157,"name":"app task manager create external native build task","args":{"span_id":"157","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389257000,"dur":100},{"pid":1,"tid":1,"id":158,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"158","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389257000,"dur":1000},{"pid":1,"tid":1,"id":159,"name":"app task manager create compile task","args":{"span_id":"159","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389258000,"dur":7000},{"pid":1,"tid":1,"id":160,"name":"app task manager create packaging task","args":{"span_id":"160","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389265000,"dur":1000},{"pid":1,"tid":1,"id":161,"name":"app task manager create lint task","args":{"span_id":"161","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389266000,"dur":1000},{"pid":1,"tid":1,"id":146,"name":"variant manager create tasks for variant","args":{"span_id":"146","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389247000,"dur":20000},{"pid":1,"tid":1,"id":162,"name":"variant manager create tasks for variant","args":{"span_id":"162","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389267000,"dur":5000},{"pid":1,"tid":1,"id":164,"name":"app task manager create merge manifest task","args":{"span_id":"164","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389273000,"dur":100},{"pid":1,"tid":1,"id":165,"name":"app task manager create generate res values task","args":{"span_id":"165","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389273000,"dur":100},{"pid":1,"tid":1,"id":166,"name":"app task manager create create renderscript task","args":{"span_id":"166","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389273000,"dur":100},{"pid":1,"tid":1,"id":167,"name":"app task manager create merge resources task","args":{"span_id":"167","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389273000,"dur":1000},{"pid":1,"tid":1,"id":168,"name":"app task manager create merge assets task","args":{"span_id":"168","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389274000,"dur":100},{"pid":1,"tid":1,"id":169,"name":"app task manager create build config task","args":{"span_id":"169","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389274000,"dur":100},{"pid":1,"tid":1,"id":170,"name":"app task manager create process res task","args":{"span_id":"170","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389274000,"dur":1000},{"pid":1,"tid":1,"id":171,"name":"app task manager create aidl task","args":{"span_id":"171","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389275000,"dur":100},{"pid":1,"tid":1,"id":172,"name":"app task manager create shader task","args":{"span_id":"172","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389275000,"dur":100},{"pid":1,"tid":1,"id":173,"name":"app task manager create ndk task","args":{"span_id":"173","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389275000,"dur":100},{"pid":1,"tid":1,"id":174,"name":"app task manager create external native build task","args":{"span_id":"174","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389275000,"dur":100},{"pid":1,"tid":1,"id":175,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"175","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389275000,"dur":1000},{"pid":1,"tid":1,"id":176,"name":"app task manager create compile task","args":{"span_id":"176","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389276000,"dur":10000},{"pid":1,"tid":1,"id":177,"name":"app task manager create packaging task","args":{"span_id":"177","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389287000,"dur":2000},{"pid":1,"tid":1,"id":178,"name":"app task manager create lint task","args":{"span_id":"178","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389289000,"dur":100},{"pid":1,"tid":1,"id":163,"name":"variant manager create tasks for variant","args":{"span_id":"163","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389272000,"dur":17000},{"pid":1,"tid":1,"id":179,"name":"variant manager create tasks for variant","args":{"span_id":"179","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389289000,"dur":9000},{"pid":1,"tid":1,"id":180,"name":"variant manager create tasks for variant","args":{"span_id":"180","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389298000,"dur":19000},{"pid":1,"tid":1,"id":143,"name":"variant manager create android tasks","args":{"span_id":"143","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389205000,"dur":117000},{"pid":1,"tid":1,"id":181,"name":"variant manager external native config values","args":{"span_id":"181","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389322000,"dur":100},{"pid":1,"tid":1,"id":142,"name":"base plugin create android tasks","args":{"span_id":"142","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389202000,"dur":120000},{"pid":1,"tid":1,"id":182,"name":"base plugin project configure","args":{"span_id":"182","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389617000,"dur":22000},{"pid":1,"tid":1,"id":183,"name":"base plugin project base extension creation","args":{"span_id":"183","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389640000,"dur":21000},{"pid":1,"tid":1,"id":185,"name":"task manager create tasks","args":{"span_id":"185","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389661000,"dur":1000},{"pid":1,"tid":1,"id":184,"name":"base plugin project tasks creation","args":{"span_id":"184","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389661000,"dur":1000},{"pid":1,"tid":1,"id":188,"name":"variant manager create variants","args":{"span_id":"188","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389691000,"dur":18000},{"pid":1,"tid":1,"id":189,"name":"variant manager create tests tasks","args":{"span_id":"189","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389709000,"dur":100},{"pid":1,"tid":1,"id":191,"name":"app task manager create merge manifest task","args":{"span_id":"191","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389711000,"dur":100},{"pid":1,"tid":1,"id":192,"name":"app task manager create generate res values task","args":{"span_id":"192","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389712000,"dur":100},{"pid":1,"tid":1,"id":193,"name":"app task manager create create renderscript task","args":{"span_id":"193","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389712000,"dur":100},{"pid":1,"tid":1,"id":194,"name":"app task manager create merge resources task","args":{"span_id":"194","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389712000,"dur":100},{"pid":1,"tid":1,"id":195,"name":"app task manager create merge assets task","args":{"span_id":"195","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389712000,"dur":100},{"pid":1,"tid":1,"id":196,"name":"app task manager create build config task","args":{"span_id":"196","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389712000,"dur":100},{"pid":1,"tid":1,"id":197,"name":"app task manager create process res task","args":{"span_id":"197","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389712000,"dur":6000},{"pid":1,"tid":1,"id":198,"name":"app task manager create aidl task","args":{"span_id":"198","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389718000,"dur":100},{"pid":1,"tid":1,"id":199,"name":"app task manager create shader task","args":{"span_id":"199","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389718000,"dur":1000},{"pid":1,"tid":1,"id":200,"name":"app task manager create ndk task","args":{"span_id":"200","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389719000,"dur":1000},{"pid":1,"tid":1,"id":201,"name":"app task manager create external native build task","args":{"span_id":"201","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389720000,"dur":100},{"pid":1,"tid":1,"id":202,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"202","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389720000,"dur":1000},{"pid":1,"tid":1,"id":203,"name":"app task manager create compile task","args":{"span_id":"203","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389721000,"dur":29000},{"pid":1,"tid":1,"id":204,"name":"app task manager create packaging task","args":{"span_id":"204","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389750000,"dur":1000},{"pid":1,"tid":1,"id":205,"name":"app task manager create lint task","args":{"span_id":"205","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389751000,"dur":1000},{"pid":1,"tid":1,"id":190,"name":"variant manager create tasks for variant","args":{"span_id":"190","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389709000,"dur":43000},{"pid":1,"tid":1,"id":206,"name":"variant manager create tasks for variant","args":{"span_id":"206","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389752000,"dur":11000},{"pid":1,"tid":1,"id":208,"name":"app task manager create merge manifest task","args":{"span_id":"208","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389767000,"dur":100},{"pid":1,"tid":1,"id":209,"name":"app task manager create generate res values task","args":{"span_id":"209","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389767000,"dur":100},{"pid":1,"tid":1,"id":210,"name":"app task manager create create renderscript task","args":{"span_id":"210","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389767000,"dur":2000},{"pid":1,"tid":1,"id":211,"name":"app task manager create merge resources task","args":{"span_id":"211","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389769000,"dur":1000},{"pid":1,"tid":1,"id":212,"name":"app task manager create merge assets task","args":{"span_id":"212","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389770000,"dur":1000},{"pid":1,"tid":1,"id":213,"name":"app task manager create build config task","args":{"span_id":"213","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389771000,"dur":100},{"pid":1,"tid":1,"id":214,"name":"app task manager create process res task","args":{"span_id":"214","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389771000,"dur":11000},{"pid":1,"tid":1,"id":215,"name":"app task manager create aidl task","args":{"span_id":"215","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389782000,"dur":100},{"pid":1,"tid":1,"id":216,"name":"app task manager create shader task","args":{"span_id":"216","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389787000,"dur":2000},{"pid":1,"tid":1,"id":217,"name":"app task manager create ndk task","args":{"span_id":"217","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389789000,"dur":100},{"pid":1,"tid":1,"id":218,"name":"app task manager create external native build task","args":{"span_id":"218","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389790000,"dur":100},{"pid":1,"tid":1,"id":219,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"219","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389790000,"dur":2000},{"pid":1,"tid":1,"id":220,"name":"app task manager create compile task","args":{"span_id":"220","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389792000,"dur":7000},{"pid":1,"tid":1,"id":221,"name":"app task manager create packaging task","args":{"span_id":"221","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389799000,"dur":2000},{"pid":1,"tid":1,"id":222,"name":"app task manager create lint task","args":{"span_id":"222","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389801000,"dur":100},{"pid":1,"tid":1,"id":207,"name":"variant manager create tasks for variant","args":{"span_id":"207","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649389763000,"dur":38000},{"pid":1,"tid":1,"id":223,"name":"variant manager create tasks for variant","args":{"span_id":"223","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389801000,"dur":4000},{"pid":1,"tid":1,"id":224,"name":"variant manager create tasks for variant","args":{"span_id":"224","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389805000,"dur":8000},{"pid":1,"tid":1,"id":187,"name":"variant manager create android tasks","args":{"span_id":"187","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389691000,"dur":122000},{"pid":1,"tid":1,"id":225,"name":"variant manager external native config values","args":{"span_id":"225","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389815000,"dur":100},{"pid":1,"tid":1,"id":186,"name":"base plugin create android tasks","args":{"span_id":"186","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649389686000,"dur":129000},{"pid":1,"tid":1,"id":226,"name":"base plugin build finished","args":{"span_id":"226","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649409501000,"dur":45000},{"pid":1,"tid":1,"id":227,"name":"base plugin build finished","args":{"span_id":"227","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649409546000,"dur":100},{"pid":1,"tid":1,"id":228,"name":"base plugin build finished","args":{"span_id":"228","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649409546000,"dur":100},{"pid":1,"tid":1,"id":229,"name":"base plugin build finished","args":{"span_id":"229","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649409546000,"dur":100},{"pid":1,"tid":1,"id":230,"name":"base plugin build finished","args":{"span_id":"230","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649409546000,"dur":100}] \ No newline at end of file diff --git a/build/android-profile/profile-2018-10-04-12-36-49-602.rawproto b/build/android-profile/profile-2018-10-04-12-36-49-602.rawproto new file mode 100644 index 00000000..d7d4574b Binary files /dev/null and b/build/android-profile/profile-2018-10-04-12-36-49-602.rawproto differ diff --git a/build/android-profile/profile-2018-10-04-12-37-43-159.json b/build/android-profile/profile-2018-10-04-12-37-43-159.json new file mode 100644 index 00000000..5e28da87 --- /dev/null +++ b/build/android-profile/profile-2018-10-04-12-37-43-159.json @@ -0,0 +1 @@ +[{"pid":0,"ph":"i","name":"Memory sample","ts":1538649446475000,"args":{"JVM stats":"heap_memory_usage: 349822576\nnon_heap_memory_usage: 214956792\nloaded_class_count: 22702\nthread_count: 23\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649448189000,"args":{"JVM stats":"heap_memory_usage: 162155392\nnon_heap_memory_usage: 215824208\nloaded_class_count: 22732\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 1\n gc_time: 101\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649448191000,"args":{"JVM stats":"heap_memory_usage: 165630912\nnon_heap_memory_usage: 215824208\nloaded_class_count: 22732\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649450212000,"args":{"JVM stats":"heap_memory_usage: 170040304\nnon_heap_memory_usage: 215933584\nloaded_class_count: 22732\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649450214000,"args":{"JVM stats":"heap_memory_usage: 170040304\nnon_heap_memory_usage: 215933584\nloaded_class_count: 22732\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451278000,"args":{"JVM stats":"heap_memory_usage: 173161832\nnon_heap_memory_usage: 215933584\nloaded_class_count: 22732\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451281000,"args":{"JVM stats":"heap_memory_usage: 173161832\nnon_heap_memory_usage: 215933584\nloaded_class_count: 22732\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451282000,"args":{"JVM stats":"heap_memory_usage: 173161832\nnon_heap_memory_usage: 215933584\nloaded_class_count: 22732\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451385000,"args":{"JVM stats":"heap_memory_usage: 181907296\nnon_heap_memory_usage: 215934096\nloaded_class_count: 22745\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451387000,"args":{"JVM stats":"heap_memory_usage: 181907296\nnon_heap_memory_usage: 215936912\nloaded_class_count: 22745\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451649000,"args":{"JVM stats":"heap_memory_usage: 187358248\nnon_heap_memory_usage: 216658880\nloaded_class_count: 22895\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451657000,"args":{"JVM stats":"heap_memory_usage: 187358248\nnon_heap_memory_usage: 216658880\nloaded_class_count: 22895\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451856000,"args":{"JVM stats":"heap_memory_usage: 204908320\nnon_heap_memory_usage: 216787344\nloaded_class_count: 22897\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451933000,"args":{"JVM stats":"heap_memory_usage: 208538232\nnon_heap_memory_usage: 216820104\nloaded_class_count: 22899\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649451935000,"args":{"JVM stats":"heap_memory_usage: 208538232\nnon_heap_memory_usage: 216820104\nloaded_class_count: 22899\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452023000,"args":{"JVM stats":"heap_memory_usage: 212418136\nnon_heap_memory_usage: 216863832\nloaded_class_count: 22903\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452025000,"args":{"JVM stats":"heap_memory_usage: 212657728\nnon_heap_memory_usage: 216866224\nloaded_class_count: 22904\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452054000,"args":{"JVM stats":"heap_memory_usage: 212957704\nnon_heap_memory_usage: 216936136\nloaded_class_count: 22908\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452062000,"args":{"JVM stats":"heap_memory_usage: 212957704\nnon_heap_memory_usage: 216941608\nloaded_class_count: 22908\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452120000,"args":{"JVM stats":"heap_memory_usage: 213678760\nnon_heap_memory_usage: 216960456\nloaded_class_count: 22912\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452123000,"args":{"JVM stats":"heap_memory_usage: 213922464\nnon_heap_memory_usage: 216960776\nloaded_class_count: 22912\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452124000,"args":{"JVM stats":"heap_memory_usage: 213922464\nnon_heap_memory_usage: 216960776\nloaded_class_count: 22912\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452699000,"args":{"JVM stats":"heap_memory_usage: 223863424\nnon_heap_memory_usage: 217944856\nloaded_class_count: 23027\nthread_count: 28\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452708000,"args":{"JVM stats":"heap_memory_usage: 224662672\nnon_heap_memory_usage: 217956280\nloaded_class_count: 23030\nthread_count: 29\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649452708001,"args":{"JVM stats":"heap_memory_usage: 224662672\nnon_heap_memory_usage: 217957432\nloaded_class_count: 23030\nthread_count: 29\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649459492000,"args":{"JVM stats":"heap_memory_usage: 263431088\nnon_heap_memory_usage: 220531496\nloaded_class_count: 23160\nthread_count: 35\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 1\n gc_time: 176\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649459505000,"args":{"JVM stats":"heap_memory_usage: 266804648\nnon_heap_memory_usage: 220502664\nloaded_class_count: 23167\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649459868000,"args":{"JVM stats":"heap_memory_usage: 284905944\nnon_heap_memory_usage: 220602640\nloaded_class_count: 23178\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649459908000,"args":{"JVM stats":"heap_memory_usage: 285086272\nnon_heap_memory_usage: 220719096\nloaded_class_count: 23189\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649459910000,"args":{"JVM stats":"heap_memory_usage: 285239856\nnon_heap_memory_usage: 220719800\nloaded_class_count: 23189\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649460089000,"args":{"JVM stats":"heap_memory_usage: 293149048\nnon_heap_memory_usage: 220811616\nloaded_class_count: 23190\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649460136000,"args":{"JVM stats":"heap_memory_usage: 294172560\nnon_heap_memory_usage: 220811616\nloaded_class_count: 23190\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649460152000,"args":{"JVM stats":"heap_memory_usage: 294172560\nnon_heap_memory_usage: 220811616\nloaded_class_count: 23190\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649460761000,"args":{"JVM stats":"heap_memory_usage: 309427952\nnon_heap_memory_usage: 221648512\nloaded_class_count: 23263\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649463134000,"args":{"JVM stats":"heap_memory_usage: 321357656\nnon_heap_memory_usage: 221720000\nloaded_class_count: 23306\nthread_count: 36\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":0,"ph":"i","name":"Memory sample","ts":1538649463160000,"args":{"JVM stats":"heap_memory_usage: 324246648\nnon_heap_memory_usage: 221709632\nloaded_class_count: 23307\nthread_count: 31\ngarbage_collection_stats {\n name: \"PS Scavenge\"\n gc_collections: 0\n gc_time: 0\n}\ngarbage_collection_stats {\n name: \"PS MarkSweep\"\n gc_collections: 0\n gc_time: 0\n}\n"}},{"pid":1,"tid":1,"id":2,"name":"base plugin project configure","args":{"span_id":"2","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446475000,"dur":6000},{"pid":1,"tid":1,"id":3,"name":"base plugin project base extension creation","args":{"span_id":"3","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446481000,"dur":15000},{"pid":1,"tid":1,"id":5,"name":"task manager create tasks","args":{"span_id":"5","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446496000,"dur":1000},{"pid":1,"tid":1,"id":4,"name":"base plugin project tasks creation","args":{"span_id":"4","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446496000,"dur":1000},{"pid":1,"tid":1,"id":8,"name":"variant manager create variants","args":{"span_id":"8","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446556000,"dur":21000},{"pid":1,"tid":1,"id":9,"name":"variant manager create tests tasks","args":{"span_id":"9","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446577000,"dur":1000},{"pid":1,"tid":1,"id":11,"name":"lib task manager create generate res values task","args":{"span_id":"11","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446578000,"dur":1000},{"pid":1,"tid":1,"id":12,"name":"lib task manager create merge manifest task","args":{"span_id":"12","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446579000,"dur":100},{"pid":1,"tid":1,"id":13,"name":"lib task manager create create renderscript task","args":{"span_id":"13","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446579000,"dur":1000},{"pid":1,"tid":1,"id":14,"name":"lib task manager create merge resources task","args":{"span_id":"14","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446580000,"dur":1000},{"pid":1,"tid":1,"id":15,"name":"lib task manager create merge assets task","args":{"span_id":"15","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446581000,"dur":1000},{"pid":1,"tid":1,"id":16,"name":"lib task manager create build config task","args":{"span_id":"16","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446582000,"dur":11000},{"pid":1,"tid":1,"id":17,"name":"lib task manager create process res task","args":{"span_id":"17","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446593000,"dur":54000},{"pid":1,"tid":1,"id":18,"name":"lib task manager create aidl task","args":{"span_id":"18","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446647000,"dur":2000},{"pid":1,"tid":1,"id":19,"name":"lib task manager create shader task","args":{"span_id":"19","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446649000,"dur":100},{"pid":1,"tid":1,"id":20,"name":"lib task manager create compile task","args":{"span_id":"20","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446652000,"dur":12000},{"pid":1,"tid":1,"id":21,"name":"lib task manager create ndk task","args":{"span_id":"21","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446664000,"dur":1000},{"pid":1,"tid":1,"id":22,"name":"lib task manager create external native build task","args":{"span_id":"22","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446665000,"dur":100},{"pid":1,"tid":1,"id":23,"name":"lib task manager create packaging task","args":{"span_id":"23","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446666000,"dur":2000},{"pid":1,"tid":1,"id":24,"name":"lib task manager create merge proguard file task","args":{"span_id":"24","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446668000,"dur":100},{"pid":1,"tid":1,"id":25,"name":"lib task manager create post compilation task","args":{"span_id":"25","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446669000,"dur":2000},{"pid":1,"tid":1,"id":26,"name":"lib task manager create lint task","args":{"span_id":"26","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446672000,"dur":4000},{"pid":1,"tid":1,"id":10,"name":"variant manager create tasks for variant","args":{"span_id":"10","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446578000,"dur":98000},{"pid":1,"tid":1,"id":27,"name":"variant manager create tasks for variant","args":{"span_id":"27","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446676000,"dur":7000},{"pid":1,"tid":1,"id":29,"name":"lib task manager create generate res values task","args":{"span_id":"29","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446683000,"dur":100},{"pid":1,"tid":1,"id":30,"name":"lib task manager create merge manifest task","args":{"span_id":"30","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446683000,"dur":100},{"pid":1,"tid":1,"id":31,"name":"lib task manager create create renderscript task","args":{"span_id":"31","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446683000,"dur":1000},{"pid":1,"tid":1,"id":32,"name":"lib task manager create merge resources task","args":{"span_id":"32","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446684000,"dur":100},{"pid":1,"tid":1,"id":33,"name":"lib task manager create merge assets task","args":{"span_id":"33","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446684000,"dur":100},{"pid":1,"tid":1,"id":34,"name":"lib task manager create build config task","args":{"span_id":"34","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446684000,"dur":100},{"pid":1,"tid":1,"id":35,"name":"lib task manager create process res task","args":{"span_id":"35","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446684000,"dur":2000},{"pid":1,"tid":1,"id":36,"name":"lib task manager create aidl task","args":{"span_id":"36","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446686000,"dur":100},{"pid":1,"tid":1,"id":37,"name":"lib task manager create shader task","args":{"span_id":"37","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446686000,"dur":100},{"pid":1,"tid":1,"id":38,"name":"lib task manager create compile task","args":{"span_id":"38","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446686000,"dur":2000},{"pid":1,"tid":1,"id":39,"name":"lib task manager create ndk task","args":{"span_id":"39","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446688000,"dur":100},{"pid":1,"tid":1,"id":40,"name":"lib task manager create external native build task","args":{"span_id":"40","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446688000,"dur":100},{"pid":1,"tid":1,"id":41,"name":"lib task manager create packaging task","args":{"span_id":"41","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446688000,"dur":1000},{"pid":1,"tid":1,"id":42,"name":"lib task manager create merge proguard file task","args":{"span_id":"42","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446689000,"dur":3000},{"pid":1,"tid":1,"id":43,"name":"lib task manager create post compilation task","args":{"span_id":"43","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446693000,"dur":100},{"pid":1,"tid":1,"id":44,"name":"lib task manager create lint task","args":{"span_id":"44","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446694000,"dur":100},{"pid":1,"tid":1,"id":28,"name":"variant manager create tasks for variant","args":{"span_id":"28","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446683000,"dur":11000},{"pid":1,"tid":1,"id":45,"name":"variant manager create tasks for variant","args":{"span_id":"45","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446694000,"dur":2000},{"pid":1,"tid":1,"id":46,"name":"variant manager create tasks for variant","args":{"span_id":"46","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446696000,"dur":45000},{"pid":1,"tid":1,"id":7,"name":"variant manager create android tasks","args":{"span_id":"7","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446556000,"dur":195000},{"pid":1,"tid":1,"id":47,"name":"variant manager external native config values","args":{"span_id":"47","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446752000,"dur":100},{"pid":1,"tid":1,"id":6,"name":"base plugin create android tasks","args":{"span_id":"6","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649446500000,"dur":252000},{"pid":1,"tid":1,"id":48,"name":"base plugin project configure","args":{"span_id":"48","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446756000,"dur":2000},{"pid":1,"tid":1,"id":49,"name":"base plugin project base extension creation","args":{"span_id":"49","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446758000,"dur":10000},{"pid":1,"tid":1,"id":51,"name":"task manager create tasks","args":{"span_id":"51","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446768000,"dur":1000},{"pid":1,"tid":1,"id":50,"name":"base plugin project tasks creation","args":{"span_id":"50","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446768000,"dur":1000},{"pid":1,"tid":1,"id":54,"name":"variant manager create variants","args":{"span_id":"54","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446771000,"dur":10000},{"pid":1,"tid":1,"id":55,"name":"variant manager create tests tasks","args":{"span_id":"55","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446781000,"dur":1000},{"pid":1,"tid":1,"id":57,"name":"lib task manager create generate res values task","args":{"span_id":"57","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446782000,"dur":100},{"pid":1,"tid":1,"id":58,"name":"lib task manager create merge manifest task","args":{"span_id":"58","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446782000,"dur":3000},{"pid":1,"tid":1,"id":59,"name":"lib task manager create create renderscript task","args":{"span_id":"59","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446785000,"dur":100},{"pid":1,"tid":1,"id":60,"name":"lib task manager create merge resources task","args":{"span_id":"60","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446785000,"dur":2000},{"pid":1,"tid":1,"id":61,"name":"lib task manager create merge assets task","args":{"span_id":"61","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446787000,"dur":1000},{"pid":1,"tid":1,"id":62,"name":"lib task manager create build config task","args":{"span_id":"62","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446788000,"dur":100},{"pid":1,"tid":1,"id":63,"name":"lib task manager create process res task","args":{"span_id":"63","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446788000,"dur":4000},{"pid":1,"tid":1,"id":64,"name":"lib task manager create aidl task","args":{"span_id":"64","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446792000,"dur":100},{"pid":1,"tid":1,"id":65,"name":"lib task manager create shader task","args":{"span_id":"65","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446792000,"dur":100},{"pid":1,"tid":1,"id":66,"name":"lib task manager create compile task","args":{"span_id":"66","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446792000,"dur":1000},{"pid":1,"tid":1,"id":67,"name":"lib task manager create ndk task","args":{"span_id":"67","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446793000,"dur":100},{"pid":1,"tid":1,"id":68,"name":"lib task manager create external native build task","args":{"span_id":"68","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446793000,"dur":100},{"pid":1,"tid":1,"id":69,"name":"lib task manager create packaging task","args":{"span_id":"69","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446793000,"dur":1000},{"pid":1,"tid":1,"id":70,"name":"lib task manager create merge proguard file task","args":{"span_id":"70","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446794000,"dur":100},{"pid":1,"tid":1,"id":71,"name":"lib task manager create post compilation task","args":{"span_id":"71","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446795000,"dur":14000},{"pid":1,"tid":1,"id":72,"name":"lib task manager create lint task","args":{"span_id":"72","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446809000,"dur":6000},{"pid":1,"tid":1,"id":56,"name":"variant manager create tasks for variant","args":{"span_id":"56","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446782000,"dur":33000},{"pid":1,"tid":1,"id":73,"name":"variant manager create tasks for variant","args":{"span_id":"73","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446819000,"dur":16000},{"pid":1,"tid":1,"id":75,"name":"lib task manager create generate res values task","args":{"span_id":"75","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446837000,"dur":100},{"pid":1,"tid":1,"id":76,"name":"lib task manager create merge manifest task","args":{"span_id":"76","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446837000,"dur":1000},{"pid":1,"tid":1,"id":77,"name":"lib task manager create create renderscript task","args":{"span_id":"77","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446838000,"dur":100},{"pid":1,"tid":1,"id":78,"name":"lib task manager create merge resources task","args":{"span_id":"78","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446838000,"dur":1000},{"pid":1,"tid":1,"id":79,"name":"lib task manager create merge assets task","args":{"span_id":"79","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446839000,"dur":100},{"pid":1,"tid":1,"id":80,"name":"lib task manager create build config task","args":{"span_id":"80","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446839000,"dur":100},{"pid":1,"tid":1,"id":81,"name":"lib task manager create process res task","args":{"span_id":"81","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446839000,"dur":2000},{"pid":1,"tid":1,"id":82,"name":"lib task manager create aidl task","args":{"span_id":"82","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446841000,"dur":1000},{"pid":1,"tid":1,"id":83,"name":"lib task manager create shader task","args":{"span_id":"83","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446842000,"dur":100},{"pid":1,"tid":1,"id":84,"name":"lib task manager create compile task","args":{"span_id":"84","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446842000,"dur":2000},{"pid":1,"tid":1,"id":85,"name":"lib task manager create ndk task","args":{"span_id":"85","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446844000,"dur":100},{"pid":1,"tid":1,"id":86,"name":"lib task manager create external native build task","args":{"span_id":"86","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446845000,"dur":100},{"pid":1,"tid":1,"id":87,"name":"lib task manager create packaging task","args":{"span_id":"87","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446845000,"dur":100},{"pid":1,"tid":1,"id":88,"name":"lib task manager create merge proguard file task","args":{"span_id":"88","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446846000,"dur":100},{"pid":1,"tid":1,"id":89,"name":"lib task manager create post compilation task","args":{"span_id":"89","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446846000,"dur":3000},{"pid":1,"tid":1,"id":90,"name":"lib task manager create lint task","args":{"span_id":"90","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446849000,"dur":1000},{"pid":1,"tid":1,"id":74,"name":"variant manager create tasks for variant","args":{"span_id":"74","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 22\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649446835000,"dur":15000},{"pid":1,"tid":1,"id":91,"name":"variant manager create tasks for variant","args":{"span_id":"91","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446850000,"dur":4000},{"pid":1,"tid":1,"id":92,"name":"variant manager create tasks for variant","args":{"span_id":"92","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446855000,"dur":103000},{"pid":1,"tid":1,"id":53,"name":"variant manager create android tasks","args":{"span_id":"53","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446771000,"dur":188000},{"pid":1,"tid":1,"id":93,"name":"variant manager external native config values","args":{"span_id":"93","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446961000,"dur":100},{"pid":1,"tid":1,"id":52,"name":"base plugin create android tasks","args":{"span_id":"52","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649446770000,"dur":191000},{"pid":1,"tid":1,"id":94,"name":"base plugin project configure","args":{"span_id":"94","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649446991000,"dur":20000},{"pid":1,"tid":1,"id":95,"name":"base plugin project base extension creation","args":{"span_id":"95","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447011000,"dur":17000},{"pid":1,"tid":1,"id":97,"name":"task manager create tasks","args":{"span_id":"97","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447028000,"dur":1000},{"pid":1,"tid":1,"id":96,"name":"base plugin project tasks creation","args":{"span_id":"96","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447028000,"dur":1000},{"pid":1,"tid":1,"id":100,"name":"variant manager create variants","args":{"span_id":"100","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447033000,"dur":82000},{"pid":1,"tid":1,"id":101,"name":"variant manager create tests tasks","args":{"span_id":"101","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447115000,"dur":100},{"pid":1,"tid":1,"id":103,"name":"app task manager create merge manifest task","args":{"span_id":"103","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447118000,"dur":3000},{"pid":1,"tid":1,"id":104,"name":"app task manager create generate res values task","args":{"span_id":"104","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447121000,"dur":100},{"pid":1,"tid":1,"id":105,"name":"app task manager create create renderscript task","args":{"span_id":"105","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447121000,"dur":1000},{"pid":1,"tid":1,"id":106,"name":"app task manager create merge resources task","args":{"span_id":"106","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447122000,"dur":100},{"pid":1,"tid":1,"id":107,"name":"app task manager create merge assets task","args":{"span_id":"107","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447122000,"dur":100},{"pid":1,"tid":1,"id":108,"name":"app task manager create build config task","args":{"span_id":"108","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447122000,"dur":100},{"pid":1,"tid":1,"id":109,"name":"app task manager create process res task","args":{"span_id":"109","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447122000,"dur":32000},{"pid":1,"tid":1,"id":110,"name":"app task manager create aidl task","args":{"span_id":"110","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447154000,"dur":100},{"pid":1,"tid":1,"id":111,"name":"app task manager create shader task","args":{"span_id":"111","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447154000,"dur":2000},{"pid":1,"tid":1,"id":112,"name":"app task manager create ndk task","args":{"span_id":"112","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447156000,"dur":100},{"pid":1,"tid":1,"id":113,"name":"app task manager create external native build task","args":{"span_id":"113","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447156000,"dur":100},{"pid":1,"tid":1,"id":114,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"114","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447156000,"dur":100},{"pid":1,"tid":1,"id":115,"name":"app task manager create compile task","args":{"span_id":"115","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447157000,"dur":2000},{"pid":1,"tid":1,"id":116,"name":"app task manager create packaging task","args":{"span_id":"116","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447159000,"dur":100},{"pid":1,"tid":1,"id":117,"name":"app task manager create lint task","args":{"span_id":"117","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447160000,"dur":100},{"pid":1,"tid":1,"id":102,"name":"variant manager create tasks for variant","args":{"span_id":"102","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447115000,"dur":45000},{"pid":1,"tid":1,"id":118,"name":"variant manager create tasks for variant","args":{"span_id":"118","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447160000,"dur":2000},{"pid":1,"tid":1,"id":120,"name":"app task manager create merge manifest task","args":{"span_id":"120","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447164000,"dur":100},{"pid":1,"tid":1,"id":121,"name":"app task manager create generate res values task","args":{"span_id":"121","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447164000,"dur":100},{"pid":1,"tid":1,"id":122,"name":"app task manager create create renderscript task","args":{"span_id":"122","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447164000,"dur":100},{"pid":1,"tid":1,"id":123,"name":"app task manager create merge resources task","args":{"span_id":"123","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447164000,"dur":100},{"pid":1,"tid":1,"id":124,"name":"app task manager create merge assets task","args":{"span_id":"124","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447164000,"dur":100},{"pid":1,"tid":1,"id":125,"name":"app task manager create build config task","args":{"span_id":"125","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447164000,"dur":100},{"pid":1,"tid":1,"id":126,"name":"app task manager create process res task","args":{"span_id":"126","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447164000,"dur":11000},{"pid":1,"tid":1,"id":127,"name":"app task manager create aidl task","args":{"span_id":"127","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447175000,"dur":1000},{"pid":1,"tid":1,"id":128,"name":"app task manager create shader task","args":{"span_id":"128","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447176000,"dur":100},{"pid":1,"tid":1,"id":129,"name":"app task manager create ndk task","args":{"span_id":"129","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447176000,"dur":100},{"pid":1,"tid":1,"id":130,"name":"app task manager create external native build task","args":{"span_id":"130","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447176000,"dur":100},{"pid":1,"tid":1,"id":131,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"131","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447176000,"dur":100},{"pid":1,"tid":1,"id":132,"name":"app task manager create compile task","args":{"span_id":"132","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447176000,"dur":2000},{"pid":1,"tid":1,"id":133,"name":"app task manager create packaging task","args":{"span_id":"133","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447178000,"dur":100},{"pid":1,"tid":1,"id":134,"name":"app task manager create lint task","args":{"span_id":"134","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447178000,"dur":100},{"pid":1,"tid":1,"id":119,"name":"variant manager create tasks for variant","args":{"span_id":"119","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447163000,"dur":15000},{"pid":1,"tid":1,"id":135,"name":"variant manager create tasks for variant","args":{"span_id":"135","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447178000,"dur":4000},{"pid":1,"tid":1,"id":136,"name":"variant manager create tasks for variant","args":{"span_id":"136","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447182000,"dur":8000},{"pid":1,"tid":1,"id":99,"name":"variant manager create android tasks","args":{"span_id":"99","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447033000,"dur":159000},{"pid":1,"tid":1,"id":137,"name":"variant manager external native config values","args":{"span_id":"137","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447192000,"dur":100},{"pid":1,"tid":1,"id":98,"name":"base plugin create android tasks","args":{"span_id":"98","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649447032000,"dur":160000},{"pid":1,"tid":1,"id":138,"name":"base plugin project configure","args":{"span_id":"138","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447197000,"dur":4000},{"pid":1,"tid":1,"id":139,"name":"base plugin project base extension creation","args":{"span_id":"139","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447201000,"dur":3000},{"pid":1,"tid":1,"id":141,"name":"task manager create tasks","args":{"span_id":"141","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447204000,"dur":1000},{"pid":1,"tid":1,"id":140,"name":"base plugin project tasks creation","args":{"span_id":"140","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447204000,"dur":1000},{"pid":1,"tid":1,"id":144,"name":"variant manager create variants","args":{"span_id":"144","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447207000,"dur":7000},{"pid":1,"tid":1,"id":145,"name":"variant manager create tests tasks","args":{"span_id":"145","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447214000,"dur":100},{"pid":1,"tid":1,"id":147,"name":"app task manager create merge manifest task","args":{"span_id":"147","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447215000,"dur":100},{"pid":1,"tid":1,"id":148,"name":"app task manager create generate res values task","args":{"span_id":"148","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447215000,"dur":100},{"pid":1,"tid":1,"id":149,"name":"app task manager create create renderscript task","args":{"span_id":"149","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447215000,"dur":100},{"pid":1,"tid":1,"id":150,"name":"app task manager create merge resources task","args":{"span_id":"150","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447216000,"dur":100},{"pid":1,"tid":1,"id":151,"name":"app task manager create merge assets task","args":{"span_id":"151","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447216000,"dur":100},{"pid":1,"tid":1,"id":152,"name":"app task manager create build config task","args":{"span_id":"152","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447216000,"dur":100},{"pid":1,"tid":1,"id":153,"name":"app task manager create process res task","args":{"span_id":"153","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447216000,"dur":4000},{"pid":1,"tid":1,"id":154,"name":"app task manager create aidl task","args":{"span_id":"154","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447220000,"dur":100},{"pid":1,"tid":1,"id":155,"name":"app task manager create shader task","args":{"span_id":"155","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447220000,"dur":100},{"pid":1,"tid":1,"id":156,"name":"app task manager create ndk task","args":{"span_id":"156","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447220000,"dur":100},{"pid":1,"tid":1,"id":157,"name":"app task manager create external native build task","args":{"span_id":"157","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447220000,"dur":100},{"pid":1,"tid":1,"id":158,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"158","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447220000,"dur":1000},{"pid":1,"tid":1,"id":159,"name":"app task manager create compile task","args":{"span_id":"159","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447221000,"dur":3000},{"pid":1,"tid":1,"id":160,"name":"app task manager create packaging task","args":{"span_id":"160","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447224000,"dur":100},{"pid":1,"tid":1,"id":161,"name":"app task manager create lint task","args":{"span_id":"161","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447225000,"dur":100},{"pid":1,"tid":1,"id":146,"name":"variant manager create tasks for variant","args":{"span_id":"146","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447214000,"dur":11000},{"pid":1,"tid":1,"id":162,"name":"variant manager create tasks for variant","args":{"span_id":"162","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447225000,"dur":6000},{"pid":1,"tid":1,"id":164,"name":"app task manager create merge manifest task","args":{"span_id":"164","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447236000,"dur":100},{"pid":1,"tid":1,"id":165,"name":"app task manager create generate res values task","args":{"span_id":"165","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447236000,"dur":100},{"pid":1,"tid":1,"id":166,"name":"app task manager create create renderscript task","args":{"span_id":"166","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447236000,"dur":100},{"pid":1,"tid":1,"id":167,"name":"app task manager create merge resources task","args":{"span_id":"167","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447237000,"dur":100},{"pid":1,"tid":1,"id":168,"name":"app task manager create merge assets task","args":{"span_id":"168","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447237000,"dur":100},{"pid":1,"tid":1,"id":169,"name":"app task manager create build config task","args":{"span_id":"169","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447237000,"dur":100},{"pid":1,"tid":1,"id":170,"name":"app task manager create process res task","args":{"span_id":"170","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447237000,"dur":41000},{"pid":1,"tid":1,"id":171,"name":"app task manager create aidl task","args":{"span_id":"171","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447278000,"dur":100},{"pid":1,"tid":1,"id":172,"name":"app task manager create shader task","args":{"span_id":"172","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447278000,"dur":100},{"pid":1,"tid":1,"id":173,"name":"app task manager create ndk task","args":{"span_id":"173","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447278000,"dur":100},{"pid":1,"tid":1,"id":174,"name":"app task manager create external native build task","args":{"span_id":"174","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447278000,"dur":100},{"pid":1,"tid":1,"id":175,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"175","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447278000,"dur":1000},{"pid":1,"tid":1,"id":176,"name":"app task manager create compile task","args":{"span_id":"176","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447279000,"dur":4000},{"pid":1,"tid":1,"id":177,"name":"app task manager create packaging task","args":{"span_id":"177","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447283000,"dur":100},{"pid":1,"tid":1,"id":178,"name":"app task manager create lint task","args":{"span_id":"178","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447283000,"dur":100},{"pid":1,"tid":1,"id":163,"name":"variant manager create tasks for variant","args":{"span_id":"163","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 23\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447231000,"dur":52000},{"pid":1,"tid":1,"id":179,"name":"variant manager create tasks for variant","args":{"span_id":"179","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447283000,"dur":5000},{"pid":1,"tid":1,"id":180,"name":"variant manager create tasks for variant","args":{"span_id":"180","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447288000,"dur":43000},{"pid":1,"tid":1,"id":143,"name":"variant manager create android tasks","args":{"span_id":"143","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447207000,"dur":128000},{"pid":1,"tid":1,"id":181,"name":"variant manager external native config values","args":{"span_id":"181","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447336000,"dur":100},{"pid":1,"tid":1,"id":142,"name":"base plugin create android tasks","args":{"span_id":"142","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447206000,"dur":130000},{"pid":1,"tid":1,"id":182,"name":"base plugin project configure","args":{"span_id":"182","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447341000,"dur":2000},{"pid":1,"tid":1,"id":183,"name":"base plugin project base extension creation","args":{"span_id":"183","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447343000,"dur":3000},{"pid":1,"tid":1,"id":185,"name":"task manager create tasks","args":{"span_id":"185","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447346000,"dur":3000},{"pid":1,"tid":1,"id":184,"name":"base plugin project tasks creation","args":{"span_id":"184","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447346000,"dur":3000},{"pid":1,"tid":1,"id":188,"name":"variant manager create variants","args":{"span_id":"188","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447521000,"dur":6000},{"pid":1,"tid":1,"id":189,"name":"variant manager create tests tasks","args":{"span_id":"189","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447528000,"dur":100},{"pid":1,"tid":1,"id":191,"name":"app task manager create merge manifest task","args":{"span_id":"191","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447543000,"dur":100},{"pid":1,"tid":1,"id":192,"name":"app task manager create generate res values task","args":{"span_id":"192","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447543000,"dur":100},{"pid":1,"tid":1,"id":193,"name":"app task manager create create renderscript task","args":{"span_id":"193","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447543000,"dur":100},{"pid":1,"tid":1,"id":194,"name":"app task manager create merge resources task","args":{"span_id":"194","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447543000,"dur":1000},{"pid":1,"tid":1,"id":195,"name":"app task manager create merge assets task","args":{"span_id":"195","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447544000,"dur":100},{"pid":1,"tid":1,"id":196,"name":"app task manager create build config task","args":{"span_id":"196","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447544000,"dur":100},{"pid":1,"tid":1,"id":197,"name":"app task manager create process res task","args":{"span_id":"197","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447544000,"dur":4000},{"pid":1,"tid":1,"id":198,"name":"app task manager create aidl task","args":{"span_id":"198","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447548000,"dur":100},{"pid":1,"tid":1,"id":199,"name":"app task manager create shader task","args":{"span_id":"199","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447548000,"dur":1000},{"pid":1,"tid":1,"id":200,"name":"app task manager create ndk task","args":{"span_id":"200","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447549000,"dur":100},{"pid":1,"tid":1,"id":201,"name":"app task manager create external native build task","args":{"span_id":"201","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447549000,"dur":100},{"pid":1,"tid":1,"id":202,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"202","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447549000,"dur":1000},{"pid":1,"tid":1,"id":203,"name":"app task manager create compile task","args":{"span_id":"203","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447550000,"dur":2000},{"pid":1,"tid":1,"id":204,"name":"app task manager create packaging task","args":{"span_id":"204","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447552000,"dur":1000},{"pid":1,"tid":1,"id":205,"name":"app task manager create lint task","args":{"span_id":"205","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447553000,"dur":100},{"pid":1,"tid":1,"id":190,"name":"variant manager create tasks for variant","args":{"span_id":"190","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447528000,"dur":25000},{"pid":1,"tid":1,"id":206,"name":"variant manager create tasks for variant","args":{"span_id":"206","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447553000,"dur":6000},{"pid":1,"tid":1,"id":208,"name":"app task manager create merge manifest task","args":{"span_id":"208","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447560000,"dur":100},{"pid":1,"tid":1,"id":209,"name":"app task manager create generate res values task","args":{"span_id":"209","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447560000,"dur":100},{"pid":1,"tid":1,"id":210,"name":"app task manager create create renderscript task","args":{"span_id":"210","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447560000,"dur":100},{"pid":1,"tid":1,"id":211,"name":"app task manager create merge resources task","args":{"span_id":"211","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447560000,"dur":1000},{"pid":1,"tid":1,"id":212,"name":"app task manager create merge assets task","args":{"span_id":"212","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447561000,"dur":100},{"pid":1,"tid":1,"id":213,"name":"app task manager create build config task","args":{"span_id":"213","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447561000,"dur":100},{"pid":1,"tid":1,"id":214,"name":"app task manager create process res task","args":{"span_id":"214","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447561000,"dur":1000},{"pid":1,"tid":1,"id":215,"name":"app task manager create aidl task","args":{"span_id":"215","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447562000,"dur":100},{"pid":1,"tid":1,"id":216,"name":"app task manager create shader task","args":{"span_id":"216","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447562000,"dur":100},{"pid":1,"tid":1,"id":217,"name":"app task manager create ndk task","args":{"span_id":"217","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447562000,"dur":100},{"pid":1,"tid":1,"id":218,"name":"app task manager create external native build task","args":{"span_id":"218","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447562000,"dur":100},{"pid":1,"tid":1,"id":219,"name":"app task manager create merge jnilibs folders task","args":{"span_id":"219","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447562000,"dur":1000},{"pid":1,"tid":1,"id":220,"name":"app task manager create compile task","args":{"span_id":"220","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447563000,"dur":12000},{"pid":1,"tid":1,"id":221,"name":"app task manager create packaging task","args":{"span_id":"221","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447575000,"dur":1000},{"pid":1,"tid":1,"id":222,"name":"app task manager create lint task","args":{"span_id":"222","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447576000,"dur":100},{"pid":1,"tid":1,"id":207,"name":"variant manager create tasks for variant","args":{"span_id":"207","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 2\nis_debug: false\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n"},"ph":"X","ts":1538649447559000,"dur":17000},{"pid":1,"tid":1,"id":223,"name":"variant manager create tasks for variant","args":{"span_id":"223","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447576000,"dur":4000},{"pid":1,"tid":1,"id":224,"name":"variant manager create tasks for variant","args":{"span_id":"224","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447581000,"dur":33000},{"pid":1,"tid":1,"id":187,"name":"variant manager create android tasks","args":{"span_id":"187","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447521000,"dur":94000},{"pid":1,"tid":1,"id":225,"name":"variant manager external native config values","args":{"span_id":"225","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447616000,"dur":100},{"pid":1,"tid":1,"id":186,"name":"base plugin create android tasks","args":{"span_id":"186","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649447520000,"dur":96000},{"pid":1,"tid":0,"id":226,"name":"task: delete","args":{"span_id":"226","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 104\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649447800000,"dur":382000},{"pid":1,"tid":0,"id":227,"name":"task: delete","args":{"span_id":"227","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n","task":"type: 104\ndid_work: false\nskipped: true\nup_to_date: true\nfailed: false\n"},"ph":"X","ts":1538649448190000,"dur":100},{"pid":1,"tid":0,"id":228,"name":"task: delete","args":{"span_id":"228","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","task":"type: 104\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649448191000,"dur":2021000},{"pid":1,"tid":0,"id":229,"name":"task: delete","args":{"span_id":"229","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 104\ndid_work: false\nskipped: true\nup_to_date: true\nfailed: false\n"},"ph":"X","ts":1538649450213000,"dur":1000},{"pid":1,"tid":0,"id":230,"name":"task: delete","args":{"span_id":"230","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 104\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649450215000,"dur":1063000},{"pid":1,"tid":0,"id":231,"name":"task: unknown task type","args":{"span_id":"231","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 0\ndid_work: false\nskipped: true\nup_to_date: true\nfailed: false\n"},"ph":"X","ts":1538649451280000,"dur":1000},{"pid":1,"tid":0,"id":232,"name":"task: unknown task type","args":{"span_id":"232","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 0\ndid_work: false\nskipped: true\nup_to_date: true\nfailed: false\n"},"ph":"X","ts":1538649451281000,"dur":100},{"pid":1,"tid":0,"id":233,"name":"task: aidl compile","args":{"span_id":"233","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 1\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649451283000,"dur":101000},{"pid":1,"tid":0,"id":234,"name":"task: check manifest","args":{"span_id":"234","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 8\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649451385000,"dur":2000},{"pid":1,"tid":0,"id":235,"name":"task: process manifest","args":{"span_id":"235","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 52\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649451389000,"dur":260000},{"pid":1,"tid":0,"id":236,"name":"task: unknown task type","args":{"span_id":"236","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 0\ndid_work: false\nskipped: true\nup_to_date: true\nfailed: false\n"},"ph":"X","ts":1538649451651000,"dur":4000},{"pid":1,"tid":0,"id":237,"name":"task: app pre build","args":{"span_id":"237","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 92\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649451660000,"dur":196000},{"pid":1,"tid":0,"id":238,"name":"task: aidl compile","args":{"span_id":"238","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 1\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649451857000,"dur":76000},{"pid":1,"tid":0,"id":239,"name":"task: unknown task type","args":{"span_id":"239","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 0\ndid_work: false\nskipped: true\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649451934000,"dur":1000},{"pid":1,"tid":0,"id":240,"name":"task: renderscript compile","args":{"span_id":"240","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 54\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649451937000,"dur":84000},{"pid":1,"tid":0,"id":241,"name":"task: check manifest","args":{"span_id":"241","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 8\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452024000,"dur":1000},{"pid":1,"tid":0,"id":242,"name":"task: generate build config","args":{"span_id":"242","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 24\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452026000,"dur":28000},{"pid":1,"tid":0,"id":243,"name":"task: prepare lint jar","args":{"span_id":"243","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 119\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452055000,"dur":7000},{"pid":1,"tid":0,"id":244,"name":"task: renderscript compile","args":{"span_id":"244","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 54\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452064000,"dur":56000},{"pid":1,"tid":0,"id":245,"name":"task: generate res values","args":{"span_id":"245","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 26\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452121000,"dur":2000},{"pid":1,"tid":0,"id":246,"name":"task: unknown task type","args":{"span_id":"246","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 0\ndid_work: false\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452123000,"dur":1000},{"pid":1,"tid":0,"id":247,"name":"task: merge resources","args":{"span_id":"247","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 40\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452126000,"dur":573000},{"pid":1,"tid":0,"id":249,"name":"task: generate res values","args":{"span_id":"249","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 26\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452706000,"dur":2000},{"pid":1,"tid":0,"id":250,"name":"task: unknown task type","args":{"span_id":"250","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 0\ndid_work: false\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452708000,"dur":100},{"pid":1,"tid":0,"id":251,"name":"task: merge resources","args":{"span_id":"251","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 40\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452710000,"dur":6781000},{"pid":1,"tid":0,"id":252,"name":"task: compatible screens manifest","args":{"span_id":"252","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 9\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649459493000,"dur":12000},{"pid":1,"tid":0,"id":253,"name":"task: merge manifests","args":{"span_id":"253","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 39\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649459508000,"dur":360000},{"pid":1,"tid":0,"id":254,"name":"task: splits discovery","args":{"span_id":"254","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 87\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649459872000,"dur":36000},{"pid":1,"tid":0,"id":255,"name":"task: unknown task type","args":{"span_id":"255","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","task":"type: 0\ndid_work: false\nskipped: true\nup_to_date: true\nfailed: false\n"},"ph":"X","ts":1538649459909000,"dur":1000},{"pid":1,"tid":0,"id":256,"name":"task: app pre build","args":{"span_id":"256","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 92\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649459911000,"dur":178000},{"pid":1,"tid":0,"id":257,"name":"task: aidl compile","args":{"span_id":"257","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 16\n}\ntarget_sdk_version {\n api_level: 18\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 1\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649460091000,"dur":45000},{"pid":1,"tid":0,"id":248,"name":"task: platform attr extractor","args":{"span_id":"248","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","task":"type: 109\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649452700000,"dur":7452000},{"pid":1,"tid":0,"id":258,"name":"task: process android resources","args":{"span_id":"258","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: false\nuse_legacy_multidex: false\nvariant_type: LIBRARY\nmin_sdk_version {\n api_level: 14\n}\ntarget_sdk_version {\n api_level: 25\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 51\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: false\n"},"ph":"X","ts":1538649460154000,"dur":607000},{"pid":1,"tid":0,"id":259,"name":"task: process android resources","args":{"span_id":"259","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n","variant":"id: 1\nis_debug: true\nminify_enabled: false\nuse_multidex: true\nuse_legacy_multidex: true\nvariant_type: APPLICATION\nmin_sdk_version {\n api_level: 15\n}\ntarget_sdk_version {\n api_level: 26\n}\ndex_builder: DX_DEXER\ndex_merger: DX_MERGER\n","task":"type: 51\ndid_work: true\nskipped: false\nup_to_date: false\nfailed: true\n"},"ph":"X","ts":1538649460764000,"dur":2370000},{"pid":1,"tid":1,"id":260,"name":"base plugin build finished","args":{"span_id":"260","project":"id: 1\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649463144000,"dur":1000},{"pid":1,"tid":1,"id":261,"name":"base plugin build finished","args":{"span_id":"261","project":"id: 2\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: LIBRARY\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-23\"\nsplits {\n}\n"},"ph":"X","ts":1538649463145000,"dur":2000},{"pid":1,"tid":1,"id":262,"name":"base plugin build finished","args":{"span_id":"262","project":"id: 3\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-22\"\nsplits {\n}\n"},"ph":"X","ts":1538649463147000,"dur":100},{"pid":1,"tid":1,"id":263,"name":"base plugin build finished","args":{"span_id":"263","project":"id: 4\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"27.0.3\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649463148000,"dur":100},{"pid":1,"tid":1,"id":264,"name":"base plugin build finished","args":{"span_id":"264","project":"id: 5\nandroid_plugin_version: \"3.0.0\"\nandroid_plugin: APPLICATION\nplugin_generation: FIRST\nbuild_tools_version: \"26.0.2\"\ncompile_sdk: \"android-26\"\nsplits {\n}\n"},"ph":"X","ts":1538649463148000,"dur":100}] \ No newline at end of file diff --git a/build/android-profile/profile-2018-10-04-12-37-43-159.rawproto b/build/android-profile/profile-2018-10-04-12-37-43-159.rawproto new file mode 100644 index 00000000..dddf9931 Binary files /dev/null and b/build/android-profile/profile-2018-10-04-12-37-43-159.rawproto differ diff --git a/build/intermediates/lint-cache/maven.google/androidx/appcompat/group-index.xml b/build/intermediates/lint-cache/maven.google/androidx/appcompat/group-index.xml new file mode 100644 index 00000000..565b82f0 --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/androidx/appcompat/group-index.xml @@ -0,0 +1,4 @@ + + + + diff --git a/build/intermediates/lint-cache/maven.google/androidx/cardview/group-index.xml b/build/intermediates/lint-cache/maven.google/androidx/cardview/group-index.xml new file mode 100644 index 00000000..84518cc7 --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/androidx/cardview/group-index.xml @@ -0,0 +1,4 @@ + + + + diff --git a/build/intermediates/lint-cache/maven.google/androidx/legacy/group-index.xml b/build/intermediates/lint-cache/maven.google/androidx/legacy/group-index.xml new file mode 100644 index 00000000..8962731f --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/androidx/legacy/group-index.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/build/intermediates/lint-cache/maven.google/androidx/recyclerview/group-index.xml b/build/intermediates/lint-cache/maven.google/androidx/recyclerview/group-index.xml new file mode 100644 index 00000000..fa6948f4 --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/androidx/recyclerview/group-index.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/build/intermediates/lint-cache/maven.google/com/android/support/constraint/group-index.xml b/build/intermediates/lint-cache/maven.google/com/android/support/constraint/group-index.xml new file mode 100644 index 00000000..b23dc055 --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/com/android/support/constraint/group-index.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/build/intermediates/lint-cache/maven.google/com/android/support/group-index.xml b/build/intermediates/lint-cache/maven.google/com/android/support/group-index.xml new file mode 100644 index 00000000..c2e0c79c --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/com/android/support/group-index.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/intermediates/lint-cache/maven.google/com/google/android/gms/group-index.xml b/build/intermediates/lint-cache/maven.google/com/google/android/gms/group-index.xml new file mode 100644 index 00000000..b6fdb73d --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/com/google/android/gms/group-index.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/intermediates/lint-cache/maven.google/com/google/firebase/group-index.xml b/build/intermediates/lint-cache/maven.google/com/google/firebase/group-index.xml new file mode 100644 index 00000000..6091bc73 --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/com/google/firebase/group-index.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/intermediates/lint-cache/maven.google/master-index.xml b/build/intermediates/lint-cache/maven.google/master-index.xml new file mode 100644 index 00000000..67cca333 --- /dev/null +++ b/build/intermediates/lint-cache/maven.google/master-index.xml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/intermediates/lint-cache/sdk-registry.xml/sdk-registry.xml b/build/intermediates/lint-cache/sdk-registry.xml/sdk-registry.xml new file mode 100644 index 00000000..2cedebf6 --- /dev/null +++ b/build/intermediates/lint-cache/sdk-registry.xml/sdk-registry.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/build/kotlin-build/caches/version.txt b/build/kotlin-build/caches/version.txt new file mode 100644 index 00000000..01aabacb --- /dev/null +++ b/build/kotlin-build/caches/version.txt @@ -0,0 +1 @@ +11001 \ No newline at end of file diff --git a/config b/config new file mode 100644 index 00000000..e6da2315 --- /dev/null +++ b/config @@ -0,0 +1,6 @@ +[core] + repositoryformatversion = 0 + filemode = true + bare = true + ignorecase = true + precomposeunicode = true diff --git a/description b/description new file mode 100644 index 00000000..498b267a --- /dev/null +++ b/description @@ -0,0 +1 @@ +Unnamed repository; edit this file 'description' to name the repository. diff --git a/google-services.json b/google-services.json new file mode 100644 index 00000000..6963b2b7 --- /dev/null +++ b/google-services.json @@ -0,0 +1,55 @@ +{ + "project_info": { + "project_number": "76654359877", + "firebase_url": "https://verdventas.firebaseio.com", + "project_id": "verdventas", + "storage_bucket": "verdventas.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:76654359877:android:909f1e548dcba4ec", + "android_client_info": { + "package_name": "com.verdnatura.verdnaturaventas" + } + }, + "oauth_client": [ + { + "client_id": "76654359877-7k4idgvacougi5lhaih21poifh42ql9i.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.verdnatura.verdnaturaventas", + "certificate_hash": "ae9ec2d3adff998c0cc06830bc86d095b412f20f" + } + }, + { + "client_id": "76654359877-p1l2cbpkton7hcgbirtngobo9bqnrad7.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAvqJyp9FZPiBRHv9pmnPZAPKF_13Hq05k" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 2, + "other_platform_oauth_client": [ + { + "client_id": "76654359877-p1l2cbpkton7hcgbirtngobo9bqnrad7.apps.googleusercontent.com", + "client_type": 3 + } + ] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..dbb7bf70 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +android.enableJetifier=true +android.useAndroidX=true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..8c0fb64a Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..d653585b --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Wed Jun 06 13:05:42 CEST 2018 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip diff --git a/gradlew b/gradlew new file mode 100755 index 00000000..91a7e269 --- /dev/null +++ b/gradlew @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..f97283a3 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/hooks/applypatch-msg.sample b/hooks/applypatch-msg.sample new file mode 100755 index 00000000..a5d7b84a --- /dev/null +++ b/hooks/applypatch-msg.sample @@ -0,0 +1,15 @@ +#!/bin/sh +# +# An example hook script to check the commit log message taken by +# applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. The hook is +# allowed to edit the commit message file. +# +# To enable this hook, rename this file to "applypatch-msg". + +. git-sh-setup +commitmsg="$(git rev-parse --git-path hooks/commit-msg)" +test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} +: diff --git a/hooks/commit-msg.sample b/hooks/commit-msg.sample new file mode 100755 index 00000000..b58d1184 --- /dev/null +++ b/hooks/commit-msg.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to check the commit log message. +# Called by "git commit" with one argument, the name of the file +# that has the commit message. The hook should exit with non-zero +# status after issuing an appropriate message if it wants to stop the +# commit. The hook is allowed to edit the commit message file. +# +# To enable this hook, rename this file to "commit-msg". + +# Uncomment the below to add a Signed-off-by line to the message. +# Doing this in a hook is a bad idea in general, but the prepare-commit-msg +# hook is more suited to it. +# +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" + +# This example catches duplicate Signed-off-by lines. + +test "" = "$(grep '^Signed-off-by: ' "$1" | + sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { + echo >&2 Duplicate Signed-off-by lines. + exit 1 +} diff --git a/hooks/post-update.sample b/hooks/post-update.sample new file mode 100755 index 00000000..ec17ec19 --- /dev/null +++ b/hooks/post-update.sample @@ -0,0 +1,8 @@ +#!/bin/sh +# +# An example hook script to prepare a packed repository for use over +# dumb transports. +# +# To enable this hook, rename this file to "post-update". + +exec git update-server-info diff --git a/hooks/pre-applypatch.sample b/hooks/pre-applypatch.sample new file mode 100755 index 00000000..4142082b --- /dev/null +++ b/hooks/pre-applypatch.sample @@ -0,0 +1,14 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed +# by applypatch from an e-mail message. +# +# The hook should exit with non-zero status after issuing an +# appropriate message if it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-applypatch". + +. git-sh-setup +precommit="$(git rev-parse --git-path hooks/pre-commit)" +test -x "$precommit" && exec "$precommit" ${1+"$@"} +: diff --git a/hooks/pre-commit.sample b/hooks/pre-commit.sample new file mode 100755 index 00000000..68d62d54 --- /dev/null +++ b/hooks/pre-commit.sample @@ -0,0 +1,49 @@ +#!/bin/sh +# +# An example hook script to verify what is about to be committed. +# Called by "git commit" with no arguments. The hook should +# exit with non-zero status after issuing an appropriate message if +# it wants to stop the commit. +# +# To enable this hook, rename this file to "pre-commit". + +if git rev-parse --verify HEAD >/dev/null 2>&1 +then + against=HEAD +else + # Initial commit: diff against an empty tree object + against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 +fi + +# If you want to allow non-ASCII filenames set this variable to true. +allownonascii=$(git config --bool hooks.allownonascii) + +# Redirect output to stderr. +exec 1>&2 + +# Cross platform projects tend to avoid non-ASCII filenames; prevent +# them from being added to the repository. We exploit the fact that the +# printable range starts at the space character and ends with tilde. +if [ "$allownonascii" != "true" ] && + # Note that the use of brackets around a tr range is ok here, (it's + # even required, for portability to Solaris 10's /usr/bin/tr), since + # the square bracket bytes happen to fall in the designated range. + test $(git diff --cached --name-only --diff-filter=A -z $against | + LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0 +then + cat <<\EOF +Error: Attempt to add a non-ASCII file name. + +This can cause problems if you want to work with people on other platforms. + +To be portable it is advisable to rename the file. + +If you know what you are doing you can disable this check using: + + git config hooks.allownonascii true +EOF + exit 1 +fi + +# If there are whitespace errors, print the offending file names and fail. +exec git diff-index --check --cached $against -- diff --git a/hooks/pre-push.sample b/hooks/pre-push.sample new file mode 100755 index 00000000..6187dbf4 --- /dev/null +++ b/hooks/pre-push.sample @@ -0,0 +1,53 @@ +#!/bin/sh + +# An example hook script to verify what is about to be pushed. Called by "git +# push" after it has checked the remote status, but before anything has been +# pushed. If this script exits with a non-zero status nothing will be pushed. +# +# This hook is called with the following parameters: +# +# $1 -- Name of the remote to which the push is being done +# $2 -- URL to which the push is being done +# +# If pushing without using a named remote those arguments will be equal. +# +# Information about the commits which are being pushed is supplied as lines to +# the standard input in the form: +# +# +# +# This sample shows how to prevent push of commits where the log message starts +# with "WIP" (work in progress). + +remote="$1" +url="$2" + +z40=0000000000000000000000000000000000000000 + +while read local_ref local_sha remote_ref remote_sha +do + if [ "$local_sha" = $z40 ] + then + # Handle delete + : + else + if [ "$remote_sha" = $z40 ] + then + # New branch, examine all commits + range="$local_sha" + else + # Update to existing branch, examine new commits + range="$remote_sha..$local_sha" + fi + + # Check for WIP commit + commit=`git rev-list -n 1 --grep '^WIP' "$range"` + if [ -n "$commit" ] + then + echo >&2 "Found WIP commit in $local_ref, not pushing" + exit 1 + fi + fi +done + +exit 0 diff --git a/hooks/pre-rebase.sample b/hooks/pre-rebase.sample new file mode 100755 index 00000000..33730ca6 --- /dev/null +++ b/hooks/pre-rebase.sample @@ -0,0 +1,169 @@ +#!/bin/sh +# +# Copyright (c) 2006, 2008 Junio C Hamano +# +# The "pre-rebase" hook is run just before "git rebase" starts doing +# its job, and can prevent the command from running by exiting with +# non-zero status. +# +# The hook is called with the following parameters: +# +# $1 -- the upstream the series was forked from. +# $2 -- the branch being rebased (or empty when rebasing the current branch). +# +# This sample shows how to prevent topic branches that are already +# merged to 'next' branch from getting rebased, because allowing it +# would result in rebasing already published history. + +publish=next +basebranch="$1" +if test "$#" = 2 +then + topic="refs/heads/$2" +else + topic=`git symbolic-ref HEAD` || + exit 0 ;# we do not interrupt rebasing detached HEAD +fi + +case "$topic" in +refs/heads/??/*) + ;; +*) + exit 0 ;# we do not interrupt others. + ;; +esac + +# Now we are dealing with a topic branch being rebased +# on top of master. Is it OK to rebase it? + +# Does the topic really exist? +git show-ref -q "$topic" || { + echo >&2 "No such branch $topic" + exit 1 +} + +# Is topic fully merged to master? +not_in_master=`git rev-list --pretty=oneline ^master "$topic"` +if test -z "$not_in_master" +then + echo >&2 "$topic is fully merged to master; better remove it." + exit 1 ;# we could allow it, but there is no point. +fi + +# Is topic ever merged to next? If so you should not be rebasing it. +only_next_1=`git rev-list ^master "^$topic" ${publish} | sort` +only_next_2=`git rev-list ^master ${publish} | sort` +if test "$only_next_1" = "$only_next_2" +then + not_in_topic=`git rev-list "^$topic" master` + if test -z "$not_in_topic" + then + echo >&2 "$topic is already up-to-date with master" + exit 1 ;# we could allow it, but there is no point. + else + exit 0 + fi +else + not_in_next=`git rev-list --pretty=oneline ^${publish} "$topic"` + /usr/bin/perl -e ' + my $topic = $ARGV[0]; + my $msg = "* $topic has commits already merged to public branch:\n"; + my (%not_in_next) = map { + /^([0-9a-f]+) /; + ($1 => 1); + } split(/\n/, $ARGV[1]); + for my $elem (map { + /^([0-9a-f]+) (.*)$/; + [$1 => $2]; + } split(/\n/, $ARGV[2])) { + if (!exists $not_in_next{$elem->[0]}) { + if ($msg) { + print STDERR $msg; + undef $msg; + } + print STDERR " $elem->[1]\n"; + } + } + ' "$topic" "$not_in_next" "$not_in_master" + exit 1 +fi + +<<\DOC_END + +This sample hook safeguards topic branches that have been +published from being rewound. + +The workflow assumed here is: + + * Once a topic branch forks from "master", "master" is never + merged into it again (either directly or indirectly). + + * Once a topic branch is fully cooked and merged into "master", + it is deleted. If you need to build on top of it to correct + earlier mistakes, a new topic branch is created by forking at + the tip of the "master". This is not strictly necessary, but + it makes it easier to keep your history simple. + + * Whenever you need to test or publish your changes to topic + branches, merge them into "next" branch. + +The script, being an example, hardcodes the publish branch name +to be "next", but it is trivial to make it configurable via +$GIT_DIR/config mechanism. + +With this workflow, you would want to know: + +(1) ... if a topic branch has ever been merged to "next". Young + topic branches can have stupid mistakes you would rather + clean up before publishing, and things that have not been + merged into other branches can be easily rebased without + affecting other people. But once it is published, you would + not want to rewind it. + +(2) ... if a topic branch has been fully merged to "master". + Then you can delete it. More importantly, you should not + build on top of it -- other people may already want to + change things related to the topic as patches against your + "master", so if you need further changes, it is better to + fork the topic (perhaps with the same name) afresh from the + tip of "master". + +Let's look at this example: + + o---o---o---o---o---o---o---o---o---o "next" + / / / / + / a---a---b A / / + / / / / + / / c---c---c---c B / + / / / \ / + / / / b---b C \ / + / / / / \ / + ---o---o---o---o---o---o---o---o---o---o---o "master" + + +A, B and C are topic branches. + + * A has one fix since it was merged up to "next". + + * B has finished. It has been fully merged up to "master" and "next", + and is ready to be deleted. + + * C has not merged to "next" at all. + +We would want to allow C to be rebased, refuse A, and encourage +B to be deleted. + +To compute (1): + + git rev-list ^master ^topic next + git rev-list ^master next + + if these match, topic has not merged in next at all. + +To compute (2): + + git rev-list master..topic + + if this is empty, it is fully merged to "master". + +DOC_END diff --git a/hooks/pre-receive.sample b/hooks/pre-receive.sample new file mode 100755 index 00000000..a1fd29ec --- /dev/null +++ b/hooks/pre-receive.sample @@ -0,0 +1,24 @@ +#!/bin/sh +# +# An example hook script to make use of push options. +# The example simply echoes all push options that start with 'echoback=' +# and rejects all pushes when the "reject" push option is used. +# +# To enable this hook, rename this file to "pre-receive". + +if test -n "$GIT_PUSH_OPTION_COUNT" +then + i=0 + while test "$i" -lt "$GIT_PUSH_OPTION_COUNT" + do + eval "value=\$GIT_PUSH_OPTION_$i" + case "$value" in + echoback=*) + echo "echo from the pre-receive-hook: ${value#*=}" >&2 + ;; + reject) + exit 1 + esac + i=$((i + 1)) + done +fi diff --git a/hooks/prepare-commit-msg.sample b/hooks/prepare-commit-msg.sample new file mode 100755 index 00000000..f093a02e --- /dev/null +++ b/hooks/prepare-commit-msg.sample @@ -0,0 +1,36 @@ +#!/bin/sh +# +# An example hook script to prepare the commit log message. +# Called by "git commit" with the name of the file that has the +# commit message, followed by the description of the commit +# message's source. The hook's purpose is to edit the commit +# message file. If the hook fails with a non-zero status, +# the commit is aborted. +# +# To enable this hook, rename this file to "prepare-commit-msg". + +# This hook includes three examples. The first comments out the +# "Conflicts:" part of a merge commit. +# +# The second includes the output of "git diff --name-status -r" +# into the message, just before the "git status" output. It is +# commented because it doesn't cope with --amend or with squashed +# commits. +# +# The third example adds a Signed-off-by line to the message, that can +# still be edited. This is rarely a good idea. + +case "$2,$3" in + merge,) + /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; + +# ,|template,) +# /usr/bin/perl -i.bak -pe ' +# print "\n" . `git diff --cached --name-status -r` +# if /^#/ && $first++ == 0' "$1" ;; + + *) ;; +esac + +# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') +# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" diff --git a/hooks/update.sample b/hooks/update.sample new file mode 100755 index 00000000..80ba9413 --- /dev/null +++ b/hooks/update.sample @@ -0,0 +1,128 @@ +#!/bin/sh +# +# An example hook script to block unannotated tags from entering. +# Called by "git receive-pack" with arguments: refname sha1-old sha1-new +# +# To enable this hook, rename this file to "update". +# +# Config +# ------ +# hooks.allowunannotated +# This boolean sets whether unannotated tags will be allowed into the +# repository. By default they won't be. +# hooks.allowdeletetag +# This boolean sets whether deleting tags will be allowed in the +# repository. By default they won't be. +# hooks.allowmodifytag +# This boolean sets whether a tag may be modified after creation. By default +# it won't be. +# hooks.allowdeletebranch +# This boolean sets whether deleting branches will be allowed in the +# repository. By default they won't be. +# hooks.denycreatebranch +# This boolean sets whether remotely creating branches will be denied +# in the repository. By default this is allowed. +# + +# --- Command line +refname="$1" +oldrev="$2" +newrev="$3" + +# --- Safety check +if [ -z "$GIT_DIR" ]; then + echo "Don't run this script from the command line." >&2 + echo " (if you want, you could supply GIT_DIR then run" >&2 + echo " $0 )" >&2 + exit 1 +fi + +if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then + echo "usage: $0 " >&2 + exit 1 +fi + +# --- Config +allowunannotated=$(git config --bool hooks.allowunannotated) +allowdeletebranch=$(git config --bool hooks.allowdeletebranch) +denycreatebranch=$(git config --bool hooks.denycreatebranch) +allowdeletetag=$(git config --bool hooks.allowdeletetag) +allowmodifytag=$(git config --bool hooks.allowmodifytag) + +# check for no description +projectdesc=$(sed -e '1q' "$GIT_DIR/description") +case "$projectdesc" in +"Unnamed repository"* | "") + echo "*** Project description file hasn't been set" >&2 + exit 1 + ;; +esac + +# --- Check types +# if $newrev is 0000...0000, it's a commit to delete a ref. +zero="0000000000000000000000000000000000000000" +if [ "$newrev" = "$zero" ]; then + newrev_type=delete +else + newrev_type=$(git cat-file -t $newrev) +fi + +case "$refname","$newrev_type" in + refs/tags/*,commit) + # un-annotated tag + short_refname=${refname##refs/tags/} + if [ "$allowunannotated" != "true" ]; then + echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2 + echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2 + exit 1 + fi + ;; + refs/tags/*,delete) + # delete tag + if [ "$allowdeletetag" != "true" ]; then + echo "*** Deleting a tag is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/tags/*,tag) + # annotated tag + if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1 + then + echo "*** Tag '$refname' already exists." >&2 + echo "*** Modifying a tag is not allowed in this repository." >&2 + exit 1 + fi + ;; + refs/heads/*,commit) + # branch + if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then + echo "*** Creating a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/heads/*,delete) + # delete branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + refs/remotes/*,commit) + # tracking branch + ;; + refs/remotes/*,delete) + # delete tracking branch + if [ "$allowdeletebranch" != "true" ]; then + echo "*** Deleting a tracking branch is not allowed in this repository" >&2 + exit 1 + fi + ;; + *) + # Anything else (is there anything else?) + echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2 + exit 1 + ;; +esac + +# --- Finished +exit 0 diff --git a/import-summary.txt b/import-summary.txt new file mode 100644 index 00000000..518b4831 --- /dev/null +++ b/import-summary.txt @@ -0,0 +1,201 @@ +ECLIPSE ANDROID PROJECT IMPORT SUMMARY +====================================== + +Ignored Files: +-------------- +The following files were *not* copied into the new Gradle project; you +should evaluate whether these are still needed in your project and if +so manually move them: + +* javadoc/ +* javadoc/allclasses-frame.html +* javadoc/allclasses-noframe.html +* javadoc/constant-values.html +* javadoc/help-doc.html +* javadoc/index-all.html +* javadoc/index.html +* javadoc/org/ +* javadoc/org/opencv/ +* javadoc/org/opencv/android/ +* javadoc/org/opencv/android/BaseLoaderCallback.html +* javadoc/org/opencv/android/CameraBridgeViewBase.CvCameraViewFrame.html +* javadoc/org/opencv/android/CameraBridgeViewBase.CvCameraViewListener.html +* javadoc/org/opencv/android/CameraBridgeViewBase.CvCameraViewListener2.html +* javadoc/org/opencv/android/CameraBridgeViewBase.ListItemAccessor.html +* javadoc/org/opencv/android/CameraBridgeViewBase.html +* javadoc/org/opencv/android/FpsMeter.html +* javadoc/org/opencv/android/InstallCallbackInterface.html +* javadoc/org/opencv/android/JavaCameraView.JavaCameraSizeAccessor.html +* javadoc/org/opencv/android/JavaCameraView.html +* javadoc/org/opencv/android/LoaderCallbackInterface.html +* javadoc/org/opencv/android/OpenCVLoader.html +* javadoc/org/opencv/android/Utils.html +* javadoc/org/opencv/android/package-frame.html +* javadoc/org/opencv/android/package-summary.html +* javadoc/org/opencv/android/package-tree.html +* javadoc/org/opencv/calib3d/ +* javadoc/org/opencv/calib3d/Calib3d.html +* javadoc/org/opencv/calib3d/StereoBM.html +* javadoc/org/opencv/calib3d/StereoMatcher.html +* javadoc/org/opencv/calib3d/StereoSGBM.html +* javadoc/org/opencv/calib3d/package-frame.html +* javadoc/org/opencv/calib3d/package-summary.html +* javadoc/org/opencv/calib3d/package-tree.html +* javadoc/org/opencv/core/ +* javadoc/org/opencv/core/Algorithm.html +* javadoc/org/opencv/core/Core.MinMaxLocResult.html +* javadoc/org/opencv/core/Core.html +* javadoc/org/opencv/core/CvException.html +* javadoc/org/opencv/core/CvType.html +* javadoc/org/opencv/core/DMatch.html +* javadoc/org/opencv/core/KeyPoint.html +* javadoc/org/opencv/core/Mat.html +* javadoc/org/opencv/core/MatOfByte.html +* javadoc/org/opencv/core/MatOfDMatch.html +* javadoc/org/opencv/core/MatOfDouble.html +* javadoc/org/opencv/core/MatOfFloat.html +* javadoc/org/opencv/core/MatOfFloat4.html +* javadoc/org/opencv/core/MatOfFloat6.html +* javadoc/org/opencv/core/MatOfInt.html +* javadoc/org/opencv/core/MatOfInt4.html +* javadoc/org/opencv/core/MatOfKeyPoint.html +* javadoc/org/opencv/core/MatOfPoint.html +* javadoc/org/opencv/core/MatOfPoint2f.html +* javadoc/org/opencv/core/MatOfPoint3.html +* javadoc/org/opencv/core/MatOfPoint3f.html +* javadoc/org/opencv/core/MatOfRect.html +* javadoc/org/opencv/core/Point.html +* javadoc/org/opencv/core/Point3.html +* javadoc/org/opencv/core/Range.html +* javadoc/org/opencv/core/Rect.html +* javadoc/org/opencv/core/RotatedRect.html +* javadoc/org/opencv/core/Scalar.html +* javadoc/org/opencv/core/Size.html +* javadoc/org/opencv/core/TermCriteria.html +* javadoc/org/opencv/core/package-frame.html +* javadoc/org/opencv/core/package-summary.html +* javadoc/org/opencv/core/package-tree.html +* javadoc/org/opencv/engine/ +* javadoc/org/opencv/engine/package-frame.html +* javadoc/org/opencv/engine/package-summary.html +* javadoc/org/opencv/engine/package-tree.html +* javadoc/org/opencv/features2d/ +* javadoc/org/opencv/features2d/DescriptorExtractor.html +* javadoc/org/opencv/features2d/DescriptorMatcher.html +* javadoc/org/opencv/features2d/FeatureDetector.html +* javadoc/org/opencv/features2d/Features2d.html +* javadoc/org/opencv/features2d/package-frame.html +* javadoc/org/opencv/features2d/package-summary.html +* javadoc/org/opencv/features2d/package-tree.html +* javadoc/org/opencv/imgcodecs/ +* javadoc/org/opencv/imgcodecs/Imgcodecs.html +* javadoc/org/opencv/imgcodecs/package-frame.html +* javadoc/org/opencv/imgcodecs/package-summary.html +* javadoc/org/opencv/imgcodecs/package-tree.html +* javadoc/org/opencv/imgproc/ +* javadoc/org/opencv/imgproc/CLAHE.html +* javadoc/org/opencv/imgproc/Imgproc.html +* javadoc/org/opencv/imgproc/LineSegmentDetector.html +* javadoc/org/opencv/imgproc/Subdiv2D.html +* javadoc/org/opencv/imgproc/package-frame.html +* javadoc/org/opencv/imgproc/package-summary.html +* javadoc/org/opencv/imgproc/package-tree.html +* javadoc/org/opencv/ml/ +* javadoc/org/opencv/ml/ANN_MLP.html +* javadoc/org/opencv/ml/Boost.html +* javadoc/org/opencv/ml/DTrees.html +* javadoc/org/opencv/ml/EM.html +* javadoc/org/opencv/ml/KNearest.html +* javadoc/org/opencv/ml/LogisticRegression.html +* javadoc/org/opencv/ml/Ml.html +* javadoc/org/opencv/ml/NormalBayesClassifier.html +* javadoc/org/opencv/ml/RTrees.html +* javadoc/org/opencv/ml/SVM.html +* javadoc/org/opencv/ml/StatModel.html +* javadoc/org/opencv/ml/TrainData.html +* javadoc/org/opencv/ml/package-frame.html +* javadoc/org/opencv/ml/package-summary.html +* javadoc/org/opencv/ml/package-tree.html +* javadoc/org/opencv/objdetect/ +* javadoc/org/opencv/objdetect/BaseCascadeClassifier.html +* javadoc/org/opencv/objdetect/CascadeClassifier.html +* javadoc/org/opencv/objdetect/HOGDescriptor.html +* javadoc/org/opencv/objdetect/Objdetect.html +* javadoc/org/opencv/objdetect/package-frame.html +* javadoc/org/opencv/objdetect/package-summary.html +* javadoc/org/opencv/objdetect/package-tree.html +* javadoc/org/opencv/photo/ +* javadoc/org/opencv/photo/AlignExposures.html +* javadoc/org/opencv/photo/AlignMTB.html +* javadoc/org/opencv/photo/CalibrateCRF.html +* javadoc/org/opencv/photo/CalibrateDebevec.html +* javadoc/org/opencv/photo/CalibrateRobertson.html +* javadoc/org/opencv/photo/MergeDebevec.html +* javadoc/org/opencv/photo/MergeExposures.html +* javadoc/org/opencv/photo/MergeMertens.html +* javadoc/org/opencv/photo/MergeRobertson.html +* javadoc/org/opencv/photo/Photo.html +* javadoc/org/opencv/photo/Tonemap.html +* javadoc/org/opencv/photo/TonemapDrago.html +* javadoc/org/opencv/photo/TonemapDurand.html +* javadoc/org/opencv/photo/TonemapMantiuk.html +* javadoc/org/opencv/photo/TonemapReinhard.html +* javadoc/org/opencv/photo/package-frame.html +* javadoc/org/opencv/photo/package-summary.html +* javadoc/org/opencv/photo/package-tree.html +* javadoc/org/opencv/utils/ +* javadoc/org/opencv/utils/Converters.html +* javadoc/org/opencv/utils/package-frame.html +* javadoc/org/opencv/utils/package-summary.html +* javadoc/org/opencv/utils/package-tree.html +* javadoc/org/opencv/video/ +* javadoc/org/opencv/video/BackgroundSubtractor.html +* javadoc/org/opencv/video/BackgroundSubtractorKNN.html +* javadoc/org/opencv/video/BackgroundSubtractorMOG2.html +* javadoc/org/opencv/video/DenseOpticalFlow.html +* javadoc/org/opencv/video/DualTVL1OpticalFlow.html +* javadoc/org/opencv/video/KalmanFilter.html +* javadoc/org/opencv/video/Video.html +* javadoc/org/opencv/video/package-frame.html +* javadoc/org/opencv/video/package-summary.html +* javadoc/org/opencv/video/package-tree.html +* javadoc/org/opencv/videoio/ +* javadoc/org/opencv/videoio/VideoCapture.html +* javadoc/org/opencv/videoio/Videoio.html +* javadoc/org/opencv/videoio/package-frame.html +* javadoc/org/opencv/videoio/package-summary.html +* javadoc/org/opencv/videoio/package-tree.html +* javadoc/overview-frame.html +* javadoc/overview-summary.html +* javadoc/overview-tree.html +* javadoc/package-list +* javadoc/resources/ +* javadoc/resources/inherit.gif +* javadoc/serialized-form.html +* javadoc/stylesheet.css + +Moved Files: +------------ +Android Gradle projects use a different directory structure than ADT +Eclipse projects. Here's how the projects were restructured: + +* AndroidManifest.xml => openCVLibrary300/src/main/AndroidManifest.xml +* lint.xml => openCVLibrary300/lint.xml +* res/ => openCVLibrary300/src/main/res/ +* src/ => openCVLibrary300/src/main/java/ +* src/org/opencv/engine/OpenCVEngineInterface.aidl => openCVLibrary300/src/main/aidl/org/opencv/engine/OpenCVEngineInterface.aidl + +Next Steps: +----------- +You can now build the project. The Gradle project needs network +connectivity to download dependencies. + +Bugs: +----- +If for some reason your project does not build, and you determine that +it is due to a bug or limitation of the Eclipse to Gradle importer, +please file a bug at http://b.android.com with category +Component-Tools. + +(This import summary is for your information only, and can be deleted +after import once you are satisfied with the results.) diff --git a/info/exclude b/info/exclude new file mode 100644 index 00000000..a5196d1b --- /dev/null +++ b/info/exclude @@ -0,0 +1,6 @@ +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ diff --git a/libs/like-recyclerview-v7.jar b/libs/like-recyclerview-v7.jar new file mode 100644 index 00000000..e69de29b diff --git a/libs/picasso-2.4.0.jar b/libs/picasso-2.4.0.jar new file mode 100644 index 00000000..b835c32f Binary files /dev/null and b/libs/picasso-2.4.0.jar differ diff --git a/local.properties b/local.properties new file mode 100644 index 00000000..9e5fccb8 --- /dev/null +++ b/local.properties @@ -0,0 +1,11 @@ +## This file is automatically generated by Android Studio. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Tue Oct 04 07:43:02 CEST 2016 +sdk.dir=/Users/enriqueblascoblanquer/Library/Android/sdk diff --git a/old.iml b/old.iml new file mode 100644 index 00000000..bee8cd08 --- /dev/null +++ b/old.iml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/projectFilesBackup/.idea/workspace.xml b/projectFilesBackup/.idea/workspace.xml new file mode 100644 index 00000000..d20dfd59 --- /dev/null +++ b/projectFilesBackup/.idea/workspace.xml @@ -0,0 +1,6793 @@ + + + + + + + + + + + es + android-23 + + + + + + @style/AppTheme + + + + + @android:style/Theme.Holo.Light.DarkActionBar + + + + + @android:style/Theme.Holo.Light.DarkActionBar + + + + + @android:style/Theme.Holo.Light.DarkActionBar + + + + + @style/AppTheme + + + + + Landscape + @style/AppTheme + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @android:style/Theme.Material.Light + + + + + @style/CustomActionBarTheme + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Android + + + + + ResourceType + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1451382247683 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + file://$PROJECT_DIR$/verdnatura/src/main/java/com/verdnatura/verdnatura/fragment/scans/scanlines/compres/CompresLinesPresenterImpl.java + 80 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 00000000..d0edb9ec --- /dev/null +++ b/settings.gradle @@ -0,0 +1 @@ +include ':verdnaturaventas', ':baselibrary', ':baselibrary2' diff --git a/verdnalibrary/.gitignore b/verdnalibrary/.gitignore new file mode 100644 index 00000000..796b96d1 --- /dev/null +++ b/verdnalibrary/.gitignore @@ -0,0 +1 @@ +/build diff --git a/verdnalibrary/build.gradle b/verdnalibrary/build.gradle new file mode 100644 index 00000000..c64de63c --- /dev/null +++ b/verdnalibrary/build.gradle @@ -0,0 +1,26 @@ +apply plugin: 'com.android.library' + +android { + compileSdkVersion 23 + buildToolsVersion "23.0.2" + + defaultConfig { + minSdkVersion 15 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + testCompile 'junit:junit:4.12' + compile 'com.android.support:appcompat-v7:23.0.3' + compile project(':baselibrary2') +} diff --git a/verdnalibrary/proguard-rules.pro b/verdnalibrary/proguard-rules.pro new file mode 100644 index 00000000..f6f09589 --- /dev/null +++ b/verdnalibrary/proguard-rules.pro @@ -0,0 +1,17 @@ +# Add project specific ProGuard rules here. +# By default, the flags in this file are appended to flags specified +# in /Users/nelo/Library/Android/sdk/tools/proguard/proguard-android.txt +# You can edit the include path and order by changing the proguardFiles +# directive in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# Add any project specific keep options here: + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} diff --git a/verdnalibrary/src/androidTest/java/com/example/vernalibrary/ApplicationTest.java b/verdnalibrary/src/androidTest/java/com/example/vernalibrary/ApplicationTest.java new file mode 100644 index 00000000..75b45b17 --- /dev/null +++ b/verdnalibrary/src/androidTest/java/com/example/vernalibrary/ApplicationTest.java @@ -0,0 +1,13 @@ +package com.example.vernalibrary; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/verdnalibrary/src/main/AndroidManifest.xml b/verdnalibrary/src/main/AndroidManifest.xml new file mode 100644 index 00000000..ae851dd2 --- /dev/null +++ b/verdnalibrary/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/activity/ActivityBase.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/activity/ActivityBase.java new file mode 100644 index 00000000..e2d3e6e7 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/activity/ActivityBase.java @@ -0,0 +1,84 @@ +package com.verdnatura.verdnalibrary.activity; + +import android.content.DialogInterface; +import android.content.pm.PackageManager; +import android.os.Bundle; + +import com.nelosan.baselibrary2.comunicacion.Executer; +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; +import com.nelosan.baselibrary2.comunicacion.command.CommandCallbacks; +import com.verdnatura.verdnalibrary.command.CmdGetVersion; +import com.verdnatura.verdnalibrary.core.PreferencesManager; +import com.verdnatura.verdnalibrary.dialogs.StaticAlerts; +import com.verdnatura.verdnalibrary.core.Update; +import com.verdnatura.verdnalibrary.dialogs.DialogUpdate; + + +/** + * Created by nelo on 4/5/16. + */ +public class ActivityBase extends com.nelosan.baselibrary2.activity.ActivityBase { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + public void comprobarActualizacion() + { + final CmdGetVersion cmd = new CmdGetVersion(PreferencesManager.getAplicacion()); + cmd.setCallbacks(new CommandCallbacks() { + @Override + public void onStart() { + + } + + @Override + public void onFinish() { + Update update = cmd.getUpdate(); + try { + int version = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; + if(update != null) + if (update.getVersion() > version) + actualizar(update.getApk()); + + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + + } + + @Override + public void onRetry() { + + } + + @Override + public void onAccept() { + + } + }); + execute(cmd); + } + + public void actualizar(final String appname) + { + StaticAlerts.alertUpdate(this, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + DialogUpdate dialogUpdate = new DialogUpdate(); + Bundle bundle = new Bundle(); + bundle.putString(DialogUpdate.ACTUALIZAR, appname); + dialogUpdate.setArguments(bundle); + dialogUpdate.show(getFragmentManager(), "tagDialog"); + } + }); + } + + public void execute(CommandBase cmd) + { + Executer ejecutador = Executer.getInstance(); + ejecutador.execute(this, cmd); + } + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/adapter/AdapterScans.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/adapter/AdapterScans.java new file mode 100644 index 00000000..83d66df8 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/adapter/AdapterScans.java @@ -0,0 +1,104 @@ +package com.verdnatura.verdnalibrary.adapter; + +import android.graphics.Typeface; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.nelosan.baselibrary2.adapter.AdapterBase; +import com.verdnatura.verdnalibrary.R; +import com.verdnatura.verdnalibrary.fragment.listscans.ScanListView; +import com.verdnatura.verdnalibrary.model.Scan; + +import java.util.List; + +/** + * Created by nelo on 9/5/16. + */ +public class AdapterScans extends AdapterBase{ + + private ScanListView view; + + public AdapterScans(List elements, int item, ScanListView v) { + super(elements, item); + this.view = v; + } + + @Override + public AdapterViewHolder create(View itemView) { + return new AdapterScanHolder(itemView, view); + } + + public static class AdapterScanHolder extends AdapterViewHolder{ + + private ScanListView sView; + + private TextView txtTitle, txtHijos, txtLineas; + private ImageView imgArrow; + private RelativeLayout scanContainer; + + public AdapterScanHolder(View itemView) { + super(itemView); + } + + public AdapterScanHolder(View itemView, ScanListView v) { + super(itemView); + this.sView = v; + } + + @Override + public void loadElements(View itemView) { + txtTitle = (TextView)itemView.findViewById(R.id.scan_title); + txtLineas = (TextView)itemView.findViewById(R.id.scan_lines); + txtHijos = (TextView)itemView.findViewById(R.id.scan_childs); + imgArrow = (ImageView)itemView.findViewById(R.id.scan_image_arrow); + scanContainer = (RelativeLayout)itemView.findViewById(R.id.scan_container); + } + + @Override + public void bindElement(Object t) { + final Scan scan = (Scan)t; + txtTitle.setText(scan.getName()); + if(scan.getLevel() == 2) + txtTitle.setTypeface(null , Typeface.BOLD); + else + txtTitle.setTypeface(null , Typeface.NORMAL); + txtHijos.setText(scan.getChilds().size() + ""); + if(scan.getChilds().size() == 0) + imgArrow.setVisibility(View.INVISIBLE); + else + imgArrow.setVisibility(View.VISIBLE); + + if(scan.isDesplegado()) + imgArrow.setImageResource(R.drawable.ic_decompressed); + else + imgArrow.setImageResource(R.drawable.ic_compress); + + imgArrow.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + sView.showMoreScans(scan); + } + }); + + + for(int i = 0; i < scan.getLevel(); i++) + createViewColor(scanContainer, scan.getLevel() - 1); + } + + public void createViewColor(RelativeLayout relative, int level){ + + LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) relative.getLayoutParams(); + params.setMargins(20 * level, 0, 0, 0); + relative.setLayoutParams(params); + } + } + + @Override + public void onBindViewHolder(AdapterViewHolder viewHolder, int position) { + super.onBindViewHolder(viewHolder, position); + } + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdActualizar.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdActualizar.java new file mode 100644 index 00000000..58e05eea --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdActualizar.java @@ -0,0 +1,48 @@ +package com.verdnatura.verdnalibrary.command; + +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.Environment; + +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; +import com.verdnatura.verdnalibrary.facade.SecurityFacade; + +import java.io.File; + +public class CmdActualizar extends CommandBase { + + public File file; + public String appname; + private Context context; + + public static final String FILE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath(); + private SecurityFacade security = SecurityFacade.getInstance(); + + public CmdActualizar(String appname) + { + this.appname = appname; + } + + @Override + protected void Execute() { + super.Execute(); + try + { + File dir = new File(FILE_PATH, "/Verdnatura/download"); + dir.mkdirs(); + this.file = new File(dir, appname); + if(file.exists()) + file.delete(); + security.DownloadApk(file, "bin", appname, null); + + + } catch (Exception e) { + e.printStackTrace(); + } + } + + public File getFile() { + return file; + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdGetVersion.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdGetVersion.java new file mode 100644 index 00000000..43c1358b --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdGetVersion.java @@ -0,0 +1,30 @@ +package com.verdnatura.verdnalibrary.command; + +import com.verdnatura.verdnalibrary.facade.SecurityFacade; +import com.verdnatura.verdnalibrary.core.Update; + +/** + * Created by nelo on 3/5/16. + */ +public class CmdGetVersion extends CommandBase { + + private String App; + private Update update; + private SecurityFacade security = SecurityFacade.getInstance(); + + public CmdGetVersion(String a) + { + this.App = a; + this.setCancelable(false); + } + + @Override + protected void Execute() { + super.Execute(); + update = security.getVersion(App); + } + + public Update getUpdate() { + return update; + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdLogin.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdLogin.java new file mode 100644 index 00000000..5297de63 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdLogin.java @@ -0,0 +1,26 @@ +package com.verdnatura.verdnalibrary.command; + + +import com.nelosan.baselibrary2.comunicacion.command.CommandBase; +import com.verdnatura.verdnalibrary.facade.SecurityFacade; + +public class CmdLogin extends CommandBase { + + private String User; + private String Pass; + private SecurityFacade security = SecurityFacade.getInstance(); + + public CmdLogin(String User, String Pass) + { + this.User = User; + this.Pass = Pass; + } + + @Override + protected void Execute() { + setErrorMessage("Usuario o contraseña incorrectos"); + security.Login(User, Pass); + } + + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdObtenerSplits.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdObtenerSplits.java new file mode 100644 index 00000000..e2a0ad0a --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CmdObtenerSplits.java @@ -0,0 +1,23 @@ +package com.verdnatura.verdnalibrary.command; + +import com.verdnatura.verdnalibrary.model.Scan; + +import java.util.List; + +/** + * Created by nelo on 21/4/16. + */ +public class CmdObtenerSplits extends CommandBase { + + private List scans; + + @Override + protected void Execute() { + super.Execute(); + setErrorMessage("Fallo al descargar los scaneos"); + } + + public List getScans() { + return scans; + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CommandBase.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CommandBase.java new file mode 100644 index 00000000..c6ddb46f --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/CommandBase.java @@ -0,0 +1,12 @@ +package com.verdnatura.verdnalibrary.command; + + + +/** + * Created by nelo on 2/5/16. + */ +public class CommandBase extends com.nelosan.baselibrary2.comunicacion.command.CommandBase +{ + //protected FacadeAlmacen vAlmacen = FacadeAlmacen.getInstance(); + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/Commands.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/Commands.java new file mode 100644 index 00000000..a3f5c9a7 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/command/Commands.java @@ -0,0 +1,27 @@ +package com.verdnatura.verdnalibrary.command; + +/** + * Created by nelo on 21/4/16. + */ +public class Commands { + + public static final String login = "login"; + + public static final String get_version = "get_version"; + + public static final String obtener_splits = "obtener_splits"; + + public static final String crear_split = "crear_split"; + + public static final String add_child_split = "add_child_split"; + + public static final String nested_delete_split = "nested_delete_split"; + + public static final String add_lines_split_nested = "add_lines_split_nested"; + + + public static final String create_scan_compres = "create_scan_compres"; + + public static final String get_scans_compres = "get_scans_compres"; + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/ComprobarPermiso.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/ComprobarPermiso.java new file mode 100644 index 00000000..9162503a --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/ComprobarPermiso.java @@ -0,0 +1,31 @@ +package com.verdnatura.verdnalibrary.core; + + +import android.content.Context; +import android.view.View; + +import com.nelosan.baselibrary2.activity.ActivityBase; +import com.nelosan.baselibrary2.core.Accion; +import com.nelosan.baselibrary2.core.permisos.ComprobarPermisos; +import com.nelosan.baselibrary2.core.permisos.SolicitudPermisos; + +/** + * Created by nelo on 4/5/16. + */ +public class ComprobarPermiso extends ComprobarPermisos{ + + public static void pedirPermisoStorage(Context context, View view, String message, Accion accion) + { + String permisos[] = new String[]{ComprobarPermisos.WRITE_EXTERNAL_STORAGE}; + + SolicitudPermisos solicitud = new SolicitudPermisos((ActivityBase) context, + view, + permisos, + message, + ComprobarPermisos.PERMISO_WRITE_EXTERNAL_STORAGE, + accion); + + necesitaPermiso(solicitud); + } + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/PreferencesManager.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/PreferencesManager.java new file mode 100644 index 00000000..196e761b --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/PreferencesManager.java @@ -0,0 +1,53 @@ +package com.verdnatura.verdnalibrary.core; + +/** + * Created by nelo on 5/4/16. + */ +public class PreferencesManager extends com.nelosan.baselibrary2.core.PreferencesManager { + + public static String getUser() + { + return getSharedPreferences().getString("user", ""); + } + + public static String getPass(){ + return decodificarBase64(getSharedPreferences().getString("password", "")); + } + + public static void saveUser(String user) + { + putStringValue("user", user); + } + + public static void savePassword(String pass) + { + putStringValue("password", codificarBase64(pass)); + } + + public static void removeUser() + { + removeValue("user"); + removeValue("password"); + } + + public static String getAplicacion() + { + return getSharedPreferences().getString("aplicacion", ""); + } + + public static void setAplicacion(String aplicacion) + { + putStringValue("aplicacion", aplicacion); + } + + public static String getVersion() + { + return getSharedPreferences().getString("version", ""); + } + + public static void setVersion(String packageName) + { + putStringValue("version", packageName); + } + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/Update.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/Update.java new file mode 100644 index 00000000..70073d85 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/core/Update.java @@ -0,0 +1,35 @@ +package com.verdnatura.verdnalibrary.core; + +/** + * Created by nelo on 3/5/16. + */ +public class Update { + + private int Version = 0; + private String Apk = ""; + private boolean Requerida = false; + + public int getVersion() { + return Version; + } + + public void setVersion(int version) { + Version = version; + } + + public String getApk() { + return Apk; + } + + public void setApk(String apk) { + Apk = apk; + } + + public boolean isRequerida() { + return Requerida; + } + + public void setRequerida(boolean requerida) { + Requerida = requerida; + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/CallbackProgress.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/CallbackProgress.java new file mode 100644 index 00000000..ed42ba7c --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/CallbackProgress.java @@ -0,0 +1,10 @@ +package com.verdnatura.verdnalibrary.dialogs; + +/** + * Created by nelo on 4/5/16. + */ +public interface CallbackProgress { + + public void setProgress(int p); + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/DialogUpdate.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/DialogUpdate.java new file mode 100644 index 00000000..50b307e3 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/DialogUpdate.java @@ -0,0 +1,93 @@ +package com.verdnatura.verdnalibrary.dialogs; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.view.View; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary2.comunicacion.Executer; +import com.nelosan.baselibrary2.comunicacion.command.CommandCallbacks; +import com.nelosan.baselibrary2.dialog.DialogBase; +import com.verdnatura.verdnalibrary.R; +import com.verdnatura.verdnalibrary.command.CmdActualizar; +import com.verdnatura.verdnalibrary.facade.FacadeClient; + +import java.io.File; + + +/** + * Created by nelo on 4/5/16. + */ +public class DialogUpdate extends DialogBase { + + public static final String ACTUALIZAR = "ACTUALIZAR"; + private String appname = ""; + + private ProgressBar progress; + + @Override + protected void loadArgs(Bundle args) { + appname = args.getString(ACTUALIZAR, ""); + } + + @Override + public void setLayout() { + layout = R.layout.dialog_update; + } + + @Override + public void loadItems(View view) { + progress = (ProgressBar) view.findViewById(R.id.progrees_update); + } + + + @Override + public void onViewCreated() { + actualizar(); + } + + public void actualizar() + { + final CmdActualizar cmd = new CmdActualizar(appname); + cmd.setCallbacks(new CommandCallbacks() { + @Override + public void onStart() { + FacadeClient.getInstance().setCallback(new CallbackProgress() { + @Override + public void setProgress(int p) { + progress.setMax(100); + progress.setProgress(p); + } + }); + } + + @Override + public void onFinish() { + instalarActualizacion(cmd.getFile()); + } + + @Override + public void onRetry() { + actualizar(); + } + + @Override + public void onAccept() { + dismiss(); + } + }); + Executer ejecutador = Executer.getInstance(); + ejecutador.execute(getActivity(), cmd); + } + + public void instalarActualizacion(File file) + { + Intent intent = new Intent(Intent.ACTION_VIEW); + intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive"); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + getActivity().startActivity(intent); + this.dismiss(); + } + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/StaticAlerts.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/StaticAlerts.java new file mode 100644 index 00000000..2946e34a --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/dialogs/StaticAlerts.java @@ -0,0 +1,70 @@ +package com.verdnatura.verdnalibrary.dialogs; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; + +import com.verdnatura.verdnalibrary.fragment.listscans.ScanFileOptions; +import com.verdnatura.verdnalibrary.fragment.listscans.ScanItemClick; +import com.verdnatura.verdnalibrary.model.Scan; + + +/** + * Created by nelo on 28/4/16. + */ +public class StaticAlerts extends com.nelosan.baselibrary2.dialog.StaticAlerts{ + + public static void alertUpdate(Context context, DialogInterface.OnClickListener positive) + { + alert(context, "Actualización", "Hay una actualización disponible", "Actualizar", "Cancelar", positive, null); + } + + public static void alertScans(Context context, String[] opciones, final ScanItemClick click, final Scan scan) + { + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setTitle("¿Que desea hacer?") + .setItems(opciones, new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dialog, int position) { + switch (position) + { + case 0: + click.addChild(scan); + break; + + case 1: + click.deleteChild(); + break; + + case 3: + click.scan(scan); + break; + } + } + }); + builder.show(); + + } + + private static void alertLoadSplit(Context context, DialogInterface.OnClickListener positive, DialogInterface.OnClickListener negative) + { + alert(context, "Recuperar split", "La aplicación se ha cerrado y hay un explit por finalizar, ¿desea cargarlo?", positive, negative); + } + + public static void scanFileDialog(Context context, final ScanFileOptions click, final Scan scan) + { + alertLoadSplit(context, + new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + click.alertFilePositive(scan); + } + }, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + click.alertFileNegative(); + } + } + ); + } + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/facade/FacadeClient.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/facade/FacadeClient.java new file mode 100644 index 00000000..8d8e56a1 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/facade/FacadeClient.java @@ -0,0 +1,121 @@ +package com.verdnatura.verdnalibrary.facade; + +import android.util.Log; +import android.widget.ProgressBar; +import android.widget.Toast; + +import com.nelosan.baselibrary2.MyApplication; +import com.verdnatura.verdnalibrary.core.PreferencesManager; +import com.verdnatura.verdnalibrary.dialogs.CallbackProgress; + +import java.io.BufferedInputStream; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URL; + +/** + * Created by nelo on 5/4/16. + */ +public class FacadeClient extends com.nelosan.baselibrary2.comunicacion.facade.FacadeClient { + + private CallbackProgress callback; + + protected static FacadeClient INSTANCE; + + private synchronized static void createInstance() { + if (INSTANCE == null) { + INSTANCE = new FacadeClient(); + } + } + + public static FacadeClient getInstance() { + if (INSTANCE == null) + createInstance(); + + return INSTANCE; + } + + protected FacadeClient() { + //if(BuildConfig.DEBUG) + host = "http://172.16.200.2/silex/"; + //host = "http://www.verdnatura.es/silex/"; + } + + + @Override + protected void WriteResponseToStream(String facade, String command, String argsMessage, OutputStream resultstream) { + super.WriteResponseToStream(facade, command, argsMessage, resultstream); + InputStream is = null; + try { + URL url = generateUrl(facade, command); + HttpURLConnection connection = generateHttpUrlConection(url); + connection.setRequestProperty("Content-Type", "json"); + connection.setRequestProperty("user", PreferencesManager.getUser()); + connection.setRequestProperty("pass", PreferencesManager.getPass()); + connection.setRequestProperty("aplicacion", PreferencesManager.getAplicacion()); + //PackageManager manager = MyApplication.getContext().getPackageManager(); + //connection.setRequestProperty("version", manager.getPackageInfo(PreferencesManager.getVersion(), 0).versionName); + + if(facade.equals("update") || facade.equals("bin")) + connection.setRequestMethod(GET); + else + { + connection.setRequestMethod(POST); + OutputStream os = connection.getOutputStream(); + BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(os, "UTF-8")); + writer.write(argsMessage); + writer.flush(); + writer.close(); + os.close(); + } + connection.connect(); + + int sc = connection.getResponseCode(); + + if (sc == HttpURLConnection.HTTP_OK) + { + is = new BufferedInputStream(connection.getInputStream()); + + byte[] buffer = new byte[16 * 1024]; + int read = 0; + int totalRead = 0; + double totalContent = connection.getContentLength(); + while ((read = is.read(buffer)) != -1) { + resultstream.write(buffer, 0, read); + totalRead += read; + showProgress((int)(totalRead * 100 / totalContent)); + } + + callback = null; + + } + else { + Log.e("Error de conexion", "Error " + sc +": "+ connection.getErrorStream().toString()); + throw new RuntimeException("Error " + sc +": "+ connection.getErrorStream().toString()); + } + + + + } catch (MalformedURLException e) { + throw new RuntimeException(e.toString()); + } catch (IOException e) { + throw new RuntimeException(e.toString()); + } + } + + public void setCallback(CallbackProgress callback) { + this.callback = callback; + } + + private void showProgress(int p) + { + if(callback != null) { + callback.setProgress(p); + } + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/facade/SecurityFacade.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/facade/SecurityFacade.java new file mode 100644 index 00000000..961f535b --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/facade/SecurityFacade.java @@ -0,0 +1,38 @@ +package com.verdnatura.verdnalibrary.facade; + +import com.nelosan.baselibrary2.comunicacion.facade.FacadeBase; +import com.verdnatura.verdnalibrary.command.Commands; +import com.verdnatura.verdnalibrary.core.Update; + +import java.io.File; + +public class SecurityFacade extends FacadeBase { + + private static SecurityFacade INSTANCE = new SecurityFacade(); + + private SecurityFacade() { + super("security"); + client = FacadeClient.getInstance(); + } + + public static SecurityFacade getInstance() { + return INSTANCE; + } + + public void DownloadApk(File file, String facade, String command, Object...args) + { + Download(file, facade, command, args); + } + + public String Login(String User, String Pass) + { + return (String) Exec(String.class, Commands.login, User, Pass); + } + + public Update getVersion(String app) + { + return (Update) Exec(Update.class, Commands.get_version, app); + } + +} + diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/FragmentListScans.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/FragmentListScans.java new file mode 100644 index 00000000..851c9cbe --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/FragmentListScans.java @@ -0,0 +1,122 @@ +package com.verdnatura.verdnalibrary.fragment.listscans; + +import android.os.Bundle; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.RecyclerView; +import android.view.View; + +import com.nelosan.baselibrary2.core.DividerItemDecoration; +import com.nelosan.baselibrary2.fragment.listados.FragmentListados; +import com.verdnatura.verdnalibrary.R; +import com.verdnatura.verdnalibrary.adapter.AdapterScans; +import com.verdnatura.verdnalibrary.dialogs.StaticAlerts; +import com.verdnatura.verdnalibrary.model.Scan; + + +/** + * Created by nelo on 21/4/16. + */ +public class FragmentListScans extends FragmentListados implements ScanListView, ScanItemClick, ScanFileOptions { + + protected ScanListPresenter presenter; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + } + + @Override + public void downloadItems() { + if(presenter != null) + presenter.getScans(); + } + + @Override + public void clicItemAdapter(View v) { + Scan scan = (Scan) adapter.getItem(rcyListado.getChildAdapterPosition(v)); + String[] opciones = getActivity().getResources().getStringArray(R.array.opciones_scan); + StaticAlerts.alertScans(getActivity(), opciones, this, scan); + adapter.notifyDataSetChanged(); + } + + @Override + public void createScan(Scan scan, boolean editar) { + } + + @Override + public void onPause() { + super.onPause(); + if(presenter != null) + presenter.onPause(); + } + + @Override + public void loadArgs(Bundle args) { + super.loadArgs(args); + if(presenter != null) + presenter.loadArgs(args); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + if(presenter != null) + presenter.saveArgs(outState); + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + rcyListado.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL_LIST)); + RecyclerView.ItemAnimator itemAnimator = new DefaultItemAnimator(); + itemAnimator.setAddDuration(1000); + itemAnimator.setRemoveDuration(1000); + rcyListado.setItemAnimator(itemAnimator); + downloadItems(); + } + + @Override + public void showAlertScanExist(final Scan scan) { + StaticAlerts.scanFileDialog(getActivity(), this, scan); + } + + @Override + public void setAdapter() { + super.setAdapter(); + } + + @Override + public void showMoreScans(Scan scan) { + presenter.moreScans(scan); + adapter.notifyDataSetChanged(); + } + + @Override + public void addChild(Scan scan) { + + } + + @Override + public void deleteChild() { + + } + + @Override + public void scan(Scan scan) { + /*Bundle args = new Bundle(); + args.putParcelable(FragmentLineasSplit.SPLIT, split); + Intent intent = new Intent(getActivity(), SplitLineasActivity.class); + intent.putExtras(args); + getActivity().startActivity(intent);*/ + } + + @Override + public void alertFilePositive(Scan scan) { + scan(scan); + } + + @Override + public void alertFileNegative() { + + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanFileOptions.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanFileOptions.java new file mode 100644 index 00000000..1b92ad71 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanFileOptions.java @@ -0,0 +1,15 @@ +package com.verdnatura.verdnalibrary.fragment.listscans; + + + +import com.verdnatura.verdnalibrary.model.Scan; + +/** + * Created by nelo on 27/5/16. + */ +public interface ScanFileOptions { + + void alertFilePositive(Scan scan); + void alertFileNegative(); + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanItemClick.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanItemClick.java new file mode 100644 index 00000000..0235c07f --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanItemClick.java @@ -0,0 +1,14 @@ +package com.verdnatura.verdnalibrary.fragment.listscans; + +import com.verdnatura.verdnalibrary.model.Scan; + +/** + * Created by nelo on 26/5/16. + */ +public interface ScanItemClick { + + void addChild(Scan scan); + void deleteChild(); + void scan(Scan scan); + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListIterator.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListIterator.java new file mode 100644 index 00000000..90be9eae --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListIterator.java @@ -0,0 +1,14 @@ +package com.verdnatura.verdnalibrary.fragment.listscans; + +import com.nelosan.baselibrary2.fragment.base.BaseIterator; +import com.verdnatura.verdnalibrary.model.Scan; + +/** + * Created by nelo on 25/5/16. + */ +public interface ScanListIterator extends BaseIterator{ + + void downloadScans(); + void deleteScan(Scan scan); + void loadScanFile(); +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListIteratorImpl.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListIteratorImpl.java new file mode 100644 index 00000000..533c3d43 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListIteratorImpl.java @@ -0,0 +1,24 @@ +package com.verdnatura.verdnalibrary.fragment.listscans; + +import com.nelosan.baselibrary2.fragment.base.BaseIteratorImpl; +import com.verdnatura.verdnalibrary.model.Scan; + +/** + * Created by nelo on 31/5/16. + */ +public class ScanListIteratorImpl extends BaseIteratorImpl implements ScanListIterator { + + @Override + public void downloadScans() { + } + + @Override + public void deleteScan(Scan scan) { + + } + + @Override + public void loadScanFile() { + + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListPresenter.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListPresenter.java new file mode 100644 index 00000000..f1c6c0ca --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListPresenter.java @@ -0,0 +1,20 @@ +package com.verdnatura.verdnalibrary.fragment.listscans; + +import com.nelosan.baselibrary2.fragment.base.BasePresenter; +import com.verdnatura.verdnalibrary.model.Scan; + +import java.util.List; + +/** + * Created by nelo on 25/5/16. + */ +public interface ScanListPresenter extends BasePresenter { + + void getScans(); + void onFinishGetScans(List scans); + void onErrorGetScans(); + void onPause(); + void loadScanFile(); + void onLoadScanFileFinish(Scan scan); + void moreScans(Scan scan); +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListPresenterImpl.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListPresenterImpl.java new file mode 100644 index 00000000..78feecb4 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListPresenterImpl.java @@ -0,0 +1,154 @@ +package com.verdnatura.verdnalibrary.fragment.listscans; + +import android.os.Bundle; +import android.os.Parcelable; + +import com.nelosan.baselibrary2.fragment.base.BasePresenterImpl; +import com.verdnatura.verdnalibrary.R; +import com.verdnatura.verdnalibrary.adapter.AdapterScans; +import com.verdnatura.verdnalibrary.model.Scan; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * Created by nelo on 23/5/16. + */ +public class ScanListPresenterImpl extends BasePresenterImpl implements ScanListPresenter { + + public static final String SCANS = "SCANS"; + + private List scans; + private List originalScans; + protected ScanListIterator iterator; + + @Override + public void getScans() { + if(scans != null) + createAdapter(); + else if (iterator != null) + iterator.downloadScans(); + } + + @Override + public void onFinishGetScans(List scans) { + this.originalScans = scans; + this.scans = new ArrayList<>(); + if(this.originalScans == null || this.originalScans.size() == 0) + onErrorGetScans(); + else + prepareScans(); + view.hideProgress(); + } + + public void createcolor(Scan scan) + { + int[] colors = getContextFragment().getResources().getIntArray(R.array.scans); + int position = scans.size(); + position = position % 10; + scan.setColor(colors[position]); + } + + private void prepareScans() + { + for(Scan s : originalScans) + if(s.getParent() == 0) { + createcolor(s); + this.scans.add(s); + } + createAdapter(); + } + + public void createAdapter() + { + view.createAdapter(new AdapterScans(this.scans, R.layout.item_scans, view)); + view.setAdapter(); + } + + @Override + public void onErrorGetScans() { + view.hideProgress(); + view.showError(); + } + + @Override + public void onPause() { + scans = null; + } + + @Override + public void loadScanFile() { + if(iterator != null) + iterator.loadScanFile(); + } + + @Override + public void onLoadScanFileFinish(Scan scan) { + if(scan != null) + view.showAlertScanExist(scan); + } + + @Override + public void moreScans(Scan scan) { + if(scan.isDesplegado()) + hideScans(scan); + else + showScans(scan); + } + + private void showScans(Scan scan) { + for(Scan s : scan.getChilds()){ + s.setColor(scan.getColor()); + scans.add(scans.indexOf(scan) + 1, s); + } + scan.setDesplegado(true); + } + + private void hideScans(Scan scan) { + Iterator iterator = scans.iterator(); + Scan scanSave = null; + while (iterator.hasNext()) + { + Scan s = iterator.next(); + if(s.getParent() == scan.getId()) { + iterator.remove(); + scanSave = s; + } + } + if(scanSave != null) + hideScans(scanSave); + scan.setDesplegado(false); + } + + @Override + public void loadArgs(Bundle args) { + scans = args.getParcelableArrayList(SCANS); + } + + @Override + public void saveArgs(Bundle outs) { + outs.putParcelableArrayList(SCANS, (ArrayList) scans); + } + + /* + public void comprobarExisteSplit() + { + final Split split = (Split) FileManager.recuperarFichero(FragmentLineasSplit.FILE_SPLIT, Split.class, getActivity()); + if(split != null) + { + StaticAlerts.alertLoadSplit(getActivity(), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + loadSplitFichero(split); + } + }, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + FileManager.borrarFichero(FragmentLineasSplit.FILE_SPLIT, getActivity()); + } + } + ); + } + }*/ +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListView.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListView.java new file mode 100644 index 00000000..86c9d12e --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/listscans/ScanListView.java @@ -0,0 +1,15 @@ +package com.verdnatura.verdnalibrary.fragment.listscans; + +import com.nelosan.baselibrary2.fragment.listados.ListadosView; +import com.verdnatura.verdnalibrary.model.Scan; + +/** + * Created by nelo on 23/5/16. + */ +public interface ScanListView extends ListadosView{ + + void createScan(Scan scan, boolean editar); + void scan(Scan scan); + void showAlertScanExist(Scan scan); + void showMoreScans(Scan scan); +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/FragmentLogin.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/FragmentLogin.java new file mode 100644 index 00000000..6ea4ebd5 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/FragmentLogin.java @@ -0,0 +1,75 @@ +package com.verdnatura.verdnalibrary.fragment.login; + +import android.content.pm.PackageManager; +import android.os.Bundle; +import androidx.annotation.NonNull; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; + +import com.nelosan.baselibrary2.core.permisos.ComprobarPermisos; +import com.nelosan.baselibrary2.fragment.progress.FragmentProgress; +import com.verdnatura.verdnalibrary.core.PreferencesManager; +import com.verdnatura.verdnalibrary.R; + +/** + * Created by nelo on 5/4/16. + */ +public class FragmentLogin extends FragmentProgress implements View.OnClickListener, LoginView { + + private EditText edtUsuario, edtPass; + private Button btnLogin; + + private LoginPresenterImpl lPresenter; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setLayout(R.layout.fragment_login); + lPresenter = new LoginPresenterImpl(); + lPresenter.bindView(this); + lPresenter.setVersion(getActivity()); + } + + @Override + public void loadItems(View view) { + super.loadItems(view); + edtUsuario = (EditText)view.findViewById(R.id.edittext_usuario); + edtPass = (EditText)view.findViewById(R.id.edittext_password); + btnLogin = (Button)view.findViewById(R.id.button_login); + hideProgress(); + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + btnLogin.setOnClickListener(this); + if(!PreferencesManager.getUser().equals("") && lPresenter != null) + lPresenter.necesitaPermiso(PreferencesManager.getUser(), PreferencesManager.getPass(), getActivity(), getView()); + } + + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); + if(requestCode == ComprobarPermisos.PERMISO_WRITE_EXTERNAL_STORAGE) + if(grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED) + if(lPresenter != null) + lPresenter.login(edtUsuario.getText().toString(), edtPass.getText().toString()); + } + + @Override + public void onClick(View v) { + if(v.getId() == R.id.button_login) + if(lPresenter != null) + lPresenter.necesitaPermiso(edtUsuario.getText().toString(), edtPass.getText().toString(), getActivity(), getView()); + } + + @Override + public void onLoginSucces(){} + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + lPresenter.saveArgs(outState); + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginIteratorImpl.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginIteratorImpl.java new file mode 100644 index 00000000..5925f7b8 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginIteratorImpl.java @@ -0,0 +1,41 @@ +package com.verdnatura.verdnalibrary.fragment.login; + + +import com.nelosan.baselibrary2.comunicacion.command.CommandCallbacks; +import com.nelosan.baselibrary2.fragment.base.BaseIteratorImpl; +import com.verdnatura.verdnalibrary.command.CmdLogin; +import com.verdnatura.verdnalibrary.core.PreferencesManager; + +/** + * Created by nelo on 25/5/16. + */ +public class LoginIteratorImpl extends BaseIteratorImpl { + + public void login(final String user, final String pass) { + CmdLogin cmd = new CmdLogin(user, pass); + cmd.setCallbacks(new CommandCallbacks() { + @Override + public void onStart() { + PreferencesManager.saveUser(user); + PreferencesManager.savePassword(pass); + } + + @Override + public void onFinish() { + presenter.onLoginSucces(); + } + + @Override + public void onRetry() { + login(user, pass); + } + + @Override + public void onAccept() { + presenter.onLoginAccept(); + } + }); + execute(cmd); + } + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginPresenter.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginPresenter.java new file mode 100644 index 00000000..328aad5a --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginPresenter.java @@ -0,0 +1,13 @@ +package com.verdnatura.verdnalibrary.fragment.login; + +import com.nelosan.baselibrary2.fragment.base.BasePresenter; + +/** + * Created by nelo on 25/5/16. + */ +public interface LoginPresenter extends BasePresenter{ + + void login(String user, String pass); + void onLoginSucces(); + void onLoginAccept(); +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginPresenterImpl.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginPresenterImpl.java new file mode 100644 index 00000000..9cf0d1c8 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginPresenterImpl.java @@ -0,0 +1,58 @@ +package com.verdnatura.verdnalibrary.fragment.login; + +import android.content.Context; +import android.os.Bundle; +import androidx.annotation.NonNull; +import android.view.View; + +import com.nelosan.baselibrary2.core.Accion; +import com.nelosan.baselibrary2.fragment.base.BasePresenterImpl; +import com.verdnatura.verdnalibrary.core.ComprobarPermiso; +import com.verdnatura.verdnalibrary.core.PreferencesManager; + +/** + * Created by nelo on 22/05/16. + */ +public class LoginPresenterImpl extends BasePresenterImpl implements LoginPresenter{ + + private LoginIteratorImpl iterator; + + @Override + public void bindView(@NonNull LoginView view) { + super.bindView(view); + iterator = new LoginIteratorImpl(); + iterator.bindPresenter(this); + } + + public void setVersion(Context context) { + PreferencesManager.setVersion(context.getPackageName()); + } + + public void necesitaPermiso(final String user, final String pass, Context context, View view) { + ComprobarPermiso.pedirPermisoStorage(context, view, "Se necesitan permisos para poder descargar futuras actualizaciones", new Accion() { + @Override + public void realizarAccion() { + login(user, pass); + } + }); + } + + public void login(String user, String pass) + { + iterator.login(user, pass); + } + + @Override + public void onLoginSucces() { + view.hideProgress(); + view.hideError(); + view.onLoginSucces(); + } + + + @Override + public void onLoginAccept() { + PreferencesManager.removeUser(); + } + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginView.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginView.java new file mode 100644 index 00000000..0c4b0380 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/login/LoginView.java @@ -0,0 +1,11 @@ +package com.verdnatura.verdnalibrary.fragment.login; + +import com.nelosan.baselibrary2.fragment.progress.ProgressView; + +/** + * Created by nelo on 22/05/16. + */ +public interface LoginView extends ProgressView { + void onLoginSucces(); + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormIterator.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormIterator.java new file mode 100644 index 00000000..91918b6a --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormIterator.java @@ -0,0 +1,13 @@ +package com.verdnatura.verdnalibrary.fragment.scanform; + +import com.nelosan.baselibrary2.fragment.base.BaseIterator; +import com.verdnatura.verdnalibrary.model.Scan; + +/** + * Created by nelo on 26/5/16. + */ +public interface ScanFormIterator extends BaseIterator{ + + void createScan(Scan scan); + +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormPresenter.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormPresenter.java new file mode 100644 index 00000000..25636e55 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormPresenter.java @@ -0,0 +1,19 @@ +package com.verdnatura.verdnalibrary.fragment.scanform; + +import com.nelosan.baselibrary2.fragment.base.BasePresenter; +import com.verdnatura.verdnalibrary.model.Scan; + +/** + * Created by nelo on 26/5/16. + */ +public interface ScanFormPresenter extends BasePresenter { + + String SCAN = "SCAN"; + String EDITAR = "EDITAR"; + String PARENT = "PARENT"; + + void createScan(String name); + void onFinishCreateScan(Scan scan); + void onErrorCreateScan(); + Scan getScan(); +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormView.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormView.java new file mode 100644 index 00000000..47bc6bb4 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/fragment/scanform/ScanFormView.java @@ -0,0 +1,12 @@ +package com.verdnatura.verdnalibrary.fragment.scanform; + +import com.nelosan.baselibrary2.fragment.progress.ProgressView; + +/** + * Created by nelo on 26/5/16. + */ +public interface ScanFormView extends ProgressView { + + void updateView(); + void finishCreateScan(); +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/model/Scan.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/model/Scan.java new file mode 100644 index 00000000..343cbc61 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/model/Scan.java @@ -0,0 +1,141 @@ +package com.verdnatura.verdnalibrary.model; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 21/4/16. + */ +public class Scan implements Parcelable{ + + private int Id= 0; + private String Name = ""; + private String Date = ""; + private int Parent = 0; + private int Level = 1; + private List Lines = new ArrayList<>(); + private List Childs = new ArrayList<>(); + private boolean desplegado = false; + private int Color; + + public Scan() { + + } + + protected Scan(Parcel in) { + Id = in.readInt(); + Name = in.readString(); + Date = in.readString(); + Parent = in.readInt(); + Level = in.readInt(); + Lines = in.createTypedArrayList(ScanLine.CREATOR); + Childs = in.createTypedArrayList(Scan.CREATOR); + desplegado = in.readByte() != 0; + Color = in.readInt(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id); + dest.writeString(Name); + dest.writeString(Date); + dest.writeInt(Parent); + dest.writeInt(Level); + dest.writeTypedList(Lines); + dest.writeTypedList(Childs); + dest.writeByte((byte) (desplegado ? 1 : 0)); + dest.writeInt(Color); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public Scan createFromParcel(Parcel in) { + return new Scan(in); + } + + @Override + public Scan[] newArray(int size) { + return new Scan[size]; + } + }; + + public int getId() { + return Id; + } + + public void setId(int id) { + Id = id; + } + + public String getName() { + return Name; + } + + public void setName(String name) { + Name = name; + } + + public String getDate() { + return Date; + } + + public void setDate(String date) { + Date = date; + } + + public int getParent() { + return Parent; + } + + public void setParent(int parent) { + Parent = parent; + } + + public List getLines() { + return Lines; + } + + public void setLines(List lineas) { + Lines = lineas; + } + + public List getChilds() { + return Childs; + } + + public void setChilds(List childs) { + Childs = childs; + } + + public boolean isDesplegado() { + return desplegado; + } + + public void setDesplegado(boolean desplegado) { + this.desplegado = desplegado; + } + + public int getColor() { + return Color; + } + + public void setColor(int color) { + Color = color; + } + + public int getLevel() { + return Level; + } + + public void setLevel(int level) { + Level = level; + } +} diff --git a/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/model/ScanLine.java b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/model/ScanLine.java new file mode 100644 index 00000000..4349c5d5 --- /dev/null +++ b/verdnalibrary/src/main/java/com/verdnatura/verdnalibrary/model/ScanLine.java @@ -0,0 +1,93 @@ +package com.verdnatura.verdnalibrary.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 21/4/16. + */ +public class ScanLine implements Parcelable { + + protected int Id = 0; + protected String Code = ""; + protected String Date = ""; + protected int ScanId = 0; + protected boolean Selected = false; + + public ScanLine(){} + + + protected ScanLine(Parcel in) { + Id = in.readInt(); + Code = in.readString(); + Date = in.readString(); + ScanId = in.readInt(); + Selected = in.readByte() != 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id); + dest.writeString(Code); + dest.writeString(Date); + dest.writeInt(ScanId); + dest.writeByte((byte) (Selected ? 1 : 0)); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public ScanLine createFromParcel(Parcel in) { + return new ScanLine(in); + } + + @Override + public ScanLine[] newArray(int size) { + return new ScanLine[size]; + } + }; + + public boolean isSelected() { + return Selected; + } + + public void setSelected(boolean selected) { + Selected = selected; + } + + public int getId() { + return Id; + } + + public void setId(int id) { + Id = id; + } + + public String getCode() { + return Code; + } + + public void setCode(String code) { + Code = code; + } + + public String getDate() { + return Date; + } + + public void setDate(String date) { + Date = date; + } + + public int getScanId() { + return ScanId; + } + + public void setScanId(int scanId) { + ScanId = scanId; + } +} diff --git a/verdnalibrary/src/main/res/drawable-hdpi/ic_compress.png b/verdnalibrary/src/main/res/drawable-hdpi/ic_compress.png new file mode 100644 index 00000000..22d6a1bb Binary files /dev/null and b/verdnalibrary/src/main/res/drawable-hdpi/ic_compress.png differ diff --git a/verdnalibrary/src/main/res/drawable-hdpi/ic_decompressed.png b/verdnalibrary/src/main/res/drawable-hdpi/ic_decompressed.png new file mode 100644 index 00000000..ca143002 Binary files /dev/null and b/verdnalibrary/src/main/res/drawable-hdpi/ic_decompressed.png differ diff --git a/verdnalibrary/src/main/res/drawable-mdpi/ic_compress.png b/verdnalibrary/src/main/res/drawable-mdpi/ic_compress.png new file mode 100644 index 00000000..f2123086 Binary files /dev/null and b/verdnalibrary/src/main/res/drawable-mdpi/ic_compress.png differ diff --git a/verdnalibrary/src/main/res/drawable-mdpi/ic_decompressed.png b/verdnalibrary/src/main/res/drawable-mdpi/ic_decompressed.png new file mode 100644 index 00000000..46e9c4ef Binary files /dev/null and b/verdnalibrary/src/main/res/drawable-mdpi/ic_decompressed.png differ diff --git a/verdnalibrary/src/main/res/drawable-xhdpi/ic_compress.png b/verdnalibrary/src/main/res/drawable-xhdpi/ic_compress.png new file mode 100644 index 00000000..94c6d95a Binary files /dev/null and b/verdnalibrary/src/main/res/drawable-xhdpi/ic_compress.png differ diff --git a/verdnalibrary/src/main/res/drawable-xhdpi/ic_decompressed.png b/verdnalibrary/src/main/res/drawable-xhdpi/ic_decompressed.png new file mode 100644 index 00000000..bfc3fbc6 Binary files /dev/null and b/verdnalibrary/src/main/res/drawable-xhdpi/ic_decompressed.png differ diff --git a/verdnalibrary/src/main/res/drawable-xxhdpi/ic_compress.png b/verdnalibrary/src/main/res/drawable-xxhdpi/ic_compress.png new file mode 100644 index 00000000..920ab24d Binary files /dev/null and b/verdnalibrary/src/main/res/drawable-xxhdpi/ic_compress.png differ diff --git a/verdnalibrary/src/main/res/drawable-xxhdpi/ic_decompressed.png b/verdnalibrary/src/main/res/drawable-xxhdpi/ic_decompressed.png new file mode 100644 index 00000000..4c414f8a Binary files /dev/null and b/verdnalibrary/src/main/res/drawable-xxhdpi/ic_decompressed.png differ diff --git a/verdnalibrary/src/main/res/layout/dialog_update.xml b/verdnalibrary/src/main/res/layout/dialog_update.xml new file mode 100644 index 00000000..472045cc --- /dev/null +++ b/verdnalibrary/src/main/res/layout/dialog_update.xml @@ -0,0 +1,21 @@ + + + + + + + + + \ No newline at end of file diff --git a/verdnalibrary/src/main/res/layout/fragment_login.xml b/verdnalibrary/src/main/res/layout/fragment_login.xml new file mode 100644 index 00000000..512bb888 --- /dev/null +++ b/verdnalibrary/src/main/res/layout/fragment_login.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/verdnalibrary/src/main/res/layout/item_scans.xml b/verdnalibrary/src/main/res/layout/item_scans.xml new file mode 100644 index 00000000..80a23fc8 --- /dev/null +++ b/verdnalibrary/src/main/res/layout/item_scans.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/verdnalibrary/src/main/res/layout/layout_login.xml b/verdnalibrary/src/main/res/layout/layout_login.xml new file mode 100644 index 00000000..dcae23f0 --- /dev/null +++ b/verdnalibrary/src/main/res/layout/layout_login.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + +

+
+
+

Missing Default

+
+
+
+
+../../src/main/res/values-w720dp/dimens.xml:127: The dimen "fragment_cuenta_padding_left_text" in values-w720dp has no declaration in the base values folder; this can lead to crashes when the resource is queried in a configuration that does not match this qualifier
+ 124     <dimen name="fragment_cuenta_button_margin_right">12dp</dimen>
+ 125     <dimen name="fragment_cuenta_padding">28dp</dimen>
+ 126     <dimen name="fragment_cuenta_image_padding_right">8dp</dimen>
+ 127     <dimen name="fragment_cuenta_padding_left_text">21dp</dimen>                                    
+ 128 
+ 129     <!-- FRAGMENT FINALIZAR PEDIDO -->
+ 130     <dimen name="fragment_finalizar_pedido_padding">28dp</dimen>
+ +../../src/main/res/values-w720dp/dimens.xml:204: The dimen "item_articulo_relacionado_image_width" in values-w720dp has no declaration in the base values folder; this can lead to crashes when the resource is queried in a configuration that does not match this qualifier
+ 201     <dimen name="item_articulo_relacionado_height">212dp</dimen>
+ 202     <dimen name="item_articulo_relacionado_margin">20dp</dimen>
+ 203     <dimen name="item_articulo_relacionado_margin_left">10dp</dimen>
+ 204     <dimen name="item_articulo_relacionado_image_width">92dp</dimen>                                
+ 205     <dimen name="item_articulo_relacionado_image_height">200dp</dimen>
+ 206     <dimen name="item_articulo_relacionado_more_height">28dp</dimen>
+ 207     <dimen name="item_articulo_relacionado_margin_top_texto">10dp</dimen>
+ +
+ +
+
+ + MissingDefaultResource + + + Correctness + + + Fatal + + + Priority 6/10 + +
+
+
+
+
+
+ +
+
+
+

Disabled Checks

+
+
+One or more issues were not run by lint, either +because the check is not enabled by default, or because +it was disabled with a command line flag or via one or +more lint.xml configuration files in the project directories. +
+
+
+
+
+ +
+
+
+

Suppressing Warnings and Errors

+
+
+Lint errors can be suppressed in a variety of ways:
+
+1. With a @SuppressLint annotation in the Java code
+2. With a tools:ignore attribute in the XML file
+3. With a //noinspection comment in the source code
+4. With ignore flags specified in the build.gradle file, as explained below
+5. With a lint.xml configuration file in the project
+6. With a lint.xml configuration file passed to lint via the --config flag
+7. With the --ignore flag passed to lint.
+
+To suppress a lint warning with an annotation, add a @SuppressLint("id") annotation on the class, method or variable declaration closest to the warning instance you want to disable. The id can be one or more issue id's, such as "UnusedResources" or {"UnusedResources","UnusedIds"}, or it can be "all" to suppress all lint warnings in the given scope.
+
+To suppress a lint warning with a comment, add a //noinspection id comment on the line before the statement with the error.
+
+To suppress a lint warning in an XML file, add a tools:ignore="id" attribute on the element containing the error, or one of its surrounding elements. You also need to define the namespace for the tools prefix on the root element in your document, next to the xmlns:android declaration:
+xmlns:tools="http://schemas.android.com/tools"
+
+To suppress a lint warning in a build.gradle file, add a section like this:
+
+android {
+    lintOptions {
+        disable 'TypographyFractions','TypographyQuotes'
+    }
+}
+
+Here we specify a comma separated list of issue id's after the disable command. You can also use warning or error instead of disable to change the severity of issues.
+
+To suppress lint warnings with a configuration XML file, create a file named lint.xml and place it at the root directory of the module in which it applies.
+
+The format of the lint.xml file is something like the following:
+
+<?xml version="1.0" encoding="UTF-8"?>
+<lint>
+    <!-- Ignore everything in the test source set -->
+    <issue id="all">
+        <ignore path="*/test/*" />
+    </issue>
+
+    <!-- Disable this given check in this project -->
+    <issue id="IconMissingDensityFolder" severity="ignore" />
+
+    <!-- Ignore the ObsoleteLayoutParam issue in the given files -->
+    <issue id="ObsoleteLayoutParam">
+        <ignore path="res/layout/activation.xml" />
+        <ignore path="res/layout-xlarge/activation.xml" />
+        <ignore regexp="(foo|bar).java" />
+    </issue>
+
+    <!-- Ignore the UselessLeaf issue in the given file -->
+    <issue id="UselessLeaf">
+        <ignore path="res/layout/main.xml" />
+    </issue>
+
+    <!-- Change the severity of hardcoded strings to "error" -->
+    <issue id="HardcodedText" severity="error" />
+</lint>
+
+To suppress lint checks from the command line, pass the --ignore flag with a comma separated list of ids to be suppressed, such as:
+$ lint --ignore UnusedResources,UselessLeaf /my/project/path
+
+For more information, see http://g.co/androidstudio/suppressing-lint-warnings
+ +
+
+
+ + + + \ No newline at end of file diff --git a/verdnaturaventas/build/reports/lint-results-release-fatal.xml b/verdnaturaventas/build/reports/lint-results-release-fatal.xml new file mode 100644 index 00000000..9094fef7 --- /dev/null +++ b/verdnaturaventas/build/reports/lint-results-release-fatal.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + diff --git a/verdnaturaventas/google-services.json b/verdnaturaventas/google-services.json new file mode 100644 index 00000000..6963b2b7 --- /dev/null +++ b/verdnaturaventas/google-services.json @@ -0,0 +1,55 @@ +{ + "project_info": { + "project_number": "76654359877", + "firebase_url": "https://verdventas.firebaseio.com", + "project_id": "verdventas", + "storage_bucket": "verdventas.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:76654359877:android:909f1e548dcba4ec", + "android_client_info": { + "package_name": "com.verdnatura.verdnaturaventas" + } + }, + "oauth_client": [ + { + "client_id": "76654359877-7k4idgvacougi5lhaih21poifh42ql9i.apps.googleusercontent.com", + "client_type": 1, + "android_info": { + "package_name": "com.verdnatura.verdnaturaventas", + "certificate_hash": "ae9ec2d3adff998c0cc06830bc86d095b412f20f" + } + }, + { + "client_id": "76654359877-p1l2cbpkton7hcgbirtngobo9bqnrad7.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAvqJyp9FZPiBRHv9pmnPZAPKF_13Hq05k" + } + ], + "services": { + "analytics_service": { + "status": 1 + }, + "appinvite_service": { + "status": 2, + "other_platform_oauth_client": [ + { + "client_id": "76654359877-p1l2cbpkton7hcgbirtngobo9bqnrad7.apps.googleusercontent.com", + "client_type": 3 + } + ] + }, + "ads_service": { + "status": 2 + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/verdnaturaventas/gradle/wrapper/gradle-wrapper.jar b/verdnaturaventas/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..7a3265ee Binary files /dev/null and b/verdnaturaventas/gradle/wrapper/gradle-wrapper.jar differ diff --git a/verdnaturaventas/gradle/wrapper/gradle-wrapper.properties b/verdnaturaventas/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..47b1862f --- /dev/null +++ b/verdnaturaventas/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,7 @@ +#Thu Jun 07 13:43:49 CEST 2018 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +android.enableAapt2=false diff --git a/verdnaturaventas/gradlew b/verdnaturaventas/gradlew new file mode 100644 index 00000000..cccdd3d5 --- /dev/null +++ b/verdnaturaventas/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/verdnaturaventas/gradlew.bat b/verdnaturaventas/gradlew.bat new file mode 100644 index 00000000..e95643d6 --- /dev/null +++ b/verdnaturaventas/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/verdnaturaventas/libs/acra-4.5.0.jar b/verdnaturaventas/libs/acra-4.5.0.jar new file mode 100644 index 00000000..81d8cd0c Binary files /dev/null and b/verdnaturaventas/libs/acra-4.5.0.jar differ diff --git a/verdnaturaventas/libs/activation.jar b/verdnaturaventas/libs/activation.jar new file mode 100644 index 00000000..614a03cd Binary files /dev/null and b/verdnaturaventas/libs/activation.jar differ diff --git a/verdnaturaventas/libs/additionnal.jar b/verdnaturaventas/libs/additionnal.jar new file mode 100644 index 00000000..aeb9611f Binary files /dev/null and b/verdnaturaventas/libs/additionnal.jar differ diff --git a/verdnaturaventas/libs/mail.jar b/verdnaturaventas/libs/mail.jar new file mode 100644 index 00000000..ea594fdd Binary files /dev/null and b/verdnaturaventas/libs/mail.jar differ diff --git a/verdnaturaventas/lint.xml b/verdnaturaventas/lint.xml new file mode 100644 index 00000000..8423c0ef --- /dev/null +++ b/verdnaturaventas/lint.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/verdnaturaventas/local.properties b/verdnaturaventas/local.properties new file mode 100644 index 00000000..5251fb3b --- /dev/null +++ b/verdnaturaventas/local.properties @@ -0,0 +1,9 @@ +## This file must *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#Thu Jun 07 13:43:27 CEST 2018 +sdk.dir=/Users/enriqueblascoblanquer/Library/Android/sdk + diff --git a/verdnaturaventas/proguard-rules.pro b/verdnaturaventas/proguard-rules.pro new file mode 100644 index 00000000..7af5f987 --- /dev/null +++ b/verdnaturaventas/proguard-rules.pro @@ -0,0 +1,49 @@ +# Mantener entidades que extiendan de las de la plataforma no ofuscadas. +# Añadimos aquí todas las entidades que usemos y se registren en el manifest. +-keep public class * extends android.app.Activity +-keep public class * extends android.app.Application +-keep public class * extends android.app.Service +-keep public class * extends android.content.BroadcastReceiver +-keep public class * extends android.content.ContentProvider +-keep public class * extends android.support.v4.app.Fragment +-keep public class * extends android.app.Fragment + +# Mantenemos todo lo que extienda de View +-keep public class * extends android.view.View { + public (android.content.Context); + public (android.content.Context, android.util.AttributeSet); + public (android.content.Context, android.util.AttributeSet, int); + public void set*(...); +} + + +-dontwarn org.apache.http.** +-dontwarn org.apache.harmony.** +-dontwarn com.squareup.picasso.** +-dontwarn com.sun.mail.imap.protocol.** +-dontwarn javax.activation.** + +-keep class org.apache.http.** { *; } +-keep class org.apache.harmony.** { *; } +-keep class com.squareup.picasso.** { *; } +-keep class com.sun.mail.imap.protocol.** { *; } +-keep class javax.activation.** { *; } + +# Enumerandos, ya incluído en la plantilla +# Mantener todo lo relacionado con R, ya incluído en la plantilla. + +# Entidades creadas con reflectividad (Class.forName) +# Añadimos nuestras clases e interfaces +#-keep public class mypackage.MyClass +#-keep public interface mypackage.MyInterface +#-keep public class * implements mypackage.MyInterface + + + + +# Previene warnings de android support +-dontwarn android.support.** + +# Reduce el tamaño de la salida aun más +-repackageclasses '' +-allowaccessmodification \ No newline at end of file diff --git a/verdnaturaventas/release/output.json b/verdnaturaventas/release/output.json new file mode 100644 index 00000000..445606cb --- /dev/null +++ b/verdnaturaventas/release/output.json @@ -0,0 +1 @@ +[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":82,"versionName":"1.8.6","enabled":true,"outputFile":"verdnaturaventas-release.apk","fullName":"release","baseName":"release"},"path":"verdnaturaventas-release.apk","properties":{}}] \ No newline at end of file diff --git a/verdnaturaventas/release/verdnaturaventas-release.apk b/verdnaturaventas/release/verdnaturaventas-release.apk new file mode 100644 index 00000000..8842c0af Binary files /dev/null and b/verdnaturaventas/release/verdnaturaventas-release.apk differ diff --git a/verdnaturaventas/src/main/AndroidManifest.xml b/verdnaturaventas/src/main/AndroidManifest.xml new file mode 100644 index 00000000..2d15b730 --- /dev/null +++ b/verdnaturaventas/src/main/AndroidManifest.xml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/ActivityBase.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/ActivityBase.java new file mode 100644 index 00000000..bbdac920 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/ActivityBase.java @@ -0,0 +1,458 @@ +package com.verdnatura.verdnaturaventas; + +import android.content.ActivityNotFoundException; +import android.content.Intent; +import android.content.pm.ActivityInfo; +import android.content.res.Configuration; +import android.os.Build; +import android.os.Bundle; +import android.speech.RecognizerIntent; +import android.util.DisplayMetrics; +import android.util.Log; +import android.widget.Toast; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandOperation; + +import com.nelosan.baselibrary.dialog.DialogBuscar; +import com.nelosan.baselibrary.model.ResultadoBusqueda; +import com.verdnatura.verdnaturaventas.command.CmdBuscarArticulos; +import com.verdnatura.verdnaturaventas.command.CmdBuscarClientes; +import com.verdnatura.verdnaturaventas.command.CmdObtenerClienteById; +import com.verdnatura.verdnaturaventas.controller.ControllerArticulo; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.core.FileManager; +import com.verdnatura.verdnaturaventas.core.Static; +import com.verdnatura.verdnaturaventas.fragment.FragmentBase; +import com.verdnatura.verdnaturaventas.fragment.FragmentConfigurarPedido; +import com.verdnatura.verdnaturaventas.fragment.FragmentDetalleArticulo; +import com.verdnatura.verdnaturaventas.fragment.FragmentFamilias; +import com.verdnatura.verdnaturaventas.fragment.FragmentMain; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.Order; +import com.verdnatura.verdnaturaventas.model.ParametrosReino; +import com.verdnatura.verdnaturaventas.navigations.NavigationCarrito; +import com.verdnatura.verdnaturaventas.navigations.NavigationPanel; + +import java.util.ArrayList; +import java.util.List; + + +//public class ActivityBase extends com.nelosan.baselibrary.ActivityBase{ +public class ActivityBase extends com.nelosan.baselibrary.ActivityBase{ + protected NavigationCarrito nCarrito; + protected NavigationPanel nPanel; + protected ControllerPedido pedido; + protected ControllerPreferences preferences; + protected String textoVozPedido = ""; + + private boolean buscarClientes = false; + + public static final int MODO_CLIENTE = 1; + public static final int MODO_PEDIDO = 2; + + private static final int RESULT_BARCODE = 100; + private String serialNumber = ""; + + /******************OVERRIDE**********************/ + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + nPanel = new NavigationPanel(this); + nCarrito = new NavigationCarrito(this); + pedido = new ControllerPedido(this); + preferences = new ControllerPreferences(); + createNavigationDrawer(nPanel, nCarrito); + if(!(this instanceof Main)) + nPanel.setNombreCliente(); + + if (!isTablet()) { + // stop screen rotation on phones because + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); + } + + showTotalPedido(); + showCarritoRows(); + changeSerialNumber(); + } + + @Override + protected void onResume() { + super.onResume(); + pedido = new ControllerPedido(this); + showTotalPedido(); + showCarritoRows(); + } + + + public boolean isTablet() + { + if ((getResources().getConfiguration().screenLayout & + Configuration.SCREENLAYOUT_SIZE_MASK) >= Configuration.SCREENLAYOUT_SIZE_LARGE) { + + return true; + } + return false; + } + + /******************NAVIGATION DRAWER**********************/ + + public void showTotalPedido() + { + nCarrito.showTotalPedido(); + } + + public void showCarritoRows() + { + nCarrito.showCarritoRows(); + } + + public void buscarClientes() { + nPanel.buscarClientes(); + } + + /********************************************************/ + + + + /******************COMUNES**********************/ + + + @Override + protected void closeApp() { + + ControllerPedido pedido = new ControllerPedido(this); + pedido.setOrder(new Order()); + FileManager.borrarFichero(FileManager.PEDIO, this); + finishAffinity(); + + } + + @Override + public void autocompletarDialog(final String cadena, final DialogBuscar dialog) { + super.autocompletarDialog(cadena, dialog); + + if(buscarClientes) { + CmdBuscarClientes cmd = new CmdBuscarClientes(cadena); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + if (cadena.equals("")) { + dialog.setResultados(generateResultadosClientes(new ArrayList())); + } else { + dialog.setResultados(generateResultadosClientes(((CmdBuscarClientes) cmd).getclientes())); + } + } + }); + execute(cmd); + } + else { + + CmdBuscarArticulos cmd = new CmdBuscarArticulos(cadena, pedido.getOrder().getCalendario().getFormatFecha(), + pedido.getOrder().getConsignatarioActivo().getId_Consigna(), + pedido.getOrder().getAgencia().getId_Agencia()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + if (cadena.equals("")) { + dialog.setResultados(generateResultados(new ArrayList())); + } else { + dialog.setResultados(generateResultados(((CmdBuscarArticulos) cmd).getArticulos())); + } + } + }); + execute(cmd); + } + } + + @Override + public void clickItemDialogBuscar(ResultadoBusqueda resultado) { + super.clickItemDialogBuscar(resultado); + if(buscarClientes) + { + if(compararFragments(FragmentConfigurarPedido.class)) + fragmentActivo.showProgress(true); + + ClienteVentas c = (ClienteVentas) resultado.getValue(); + CmdObtenerClienteById cmd = new CmdObtenerClienteById(c.getId_Cliente()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + ClienteVentas cliente = ((CmdObtenerClienteById)cmd).obtenerCliente(); + if(cliente.getId_Cliente() == 0) + { + Toast.makeText(ActivityBase.this, getResources().getString(R.string.activity_base_cliente_no_existe), Toast.LENGTH_SHORT).show(); + } + else + { + Toast.makeText(ActivityBase.this, getResources().getString(R.string.activity_base_cliente_seleccionado), Toast.LENGTH_SHORT).show(); + pedido.setCliente(cliente); + refresCliente(cliente); + } + showTotalPedido(); + } + }); + execute(cmd); + buscarClientes = false; + } + else { + ArticuloVentasTags a = (ArticuloVentasTags) resultado.getValue(); + ControllerArticulo.verDetalle(a, this); + } + } + + public void refresCliente(ClienteVentas cliente) + { + if(compararFragments(FragmentConfigurarPedido.class)) + ((FragmentConfigurarPedido)fragmentActivo).setClienteOrder(cliente); + if(compararFragments(FragmentMain.class)) + ((FragmentMain)fragmentActivo).setClienteOrder(cliente); + } + + /**********************************************/ + + public List generateResultados(List articulos) + { + List resultados = new ArrayList(); + if(articulos != null) { + for (ArticuloVentasTags a : articulos) { + ResultadoBusqueda resultado = new ResultadoBusqueda(); + resultado.setNombre(a.getArticle()); + resultado.setUrl(Static.BASE_URL_SMALL + a.getFoto() + ".png"); + resultado.setValue(a); + resultados.add(resultado); + } + } + return resultados; + } + + public List generateResultadosClientes(List clientes) + { + List resultados = new ArrayList(); + for(ClienteVentas c : clientes) + { + ResultadoBusqueda resultado = new ResultadoBusqueda(); + resultado.setNombre(c.getId_Cliente() + " - " + c.getCliente()); + resultado.setValue(c); + resultados.add(resultado); + } + + return resultados; + } + + public void verFamilia(int reino, String nombre, String cadena) + { + pedido = new ControllerPedido(this); + + if(this instanceof Reino) + finish(); + + ParametrosReino parametros = new ParametrosReino(); + parametros.setReino(reino); + parametros.setNombre(nombre); + parametros.setFecha(pedido.getOrder().getCalendario().getFormatFecha()); + parametros.setConsignatario(pedido.getOrder().getConsignatarioActivo().getId_Consigna()); + parametros.setAgencia(pedido.getOrder().getAgencia().getId_Agencia()); + parametros.setCadena(cadena); + + Intent i = new Intent(this, Reino.class); + i.putExtra(FragmentFamilias.PARAMETROS, parametros); + startActivity(i); + } + + @Override + public void buscar(String cadena) { + super.buscar(cadena); + if(buscarClientes) + { + buscarClientes = false; + } + else { + + if (isNumber(cadena)) { + obtenerArticuloBarcode(cadena); + } else { + verFamilia(0, cadena, cadena); + } + } + } + + @Override + public void clickImagenDialog(DialogBuscar dialog) { + super.clickImagenDialog(dialog); + dialog.dismiss(); + if(dialog.getImagenId() == R.drawable.ic_action_camera) + startActivityForResult(new Intent(this, Scanner.class), RESULT_BARCODE); + + else { + + lanzarReconocimientoVoz(MODO_CLIENTE); + } + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + + if(requestCode == RESULT_BARCODE ) + { + if (resultCode == RESULT_OK) { + String barcode = data.getStringExtra("barcode"); + + obtenerArticuloBarcode(barcode); + + } + } + else if(requestCode == MODO_CLIENTE ){ + if (resultCode == RESULT_OK) { + ArrayList text = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); + String texto = text.get(0); + if (isNumber(texto.replace(" ", ""))) + texto = texto.replace(" ", ""); + DialogBuscar dialog = new DialogBuscar(this); + dialog.show(); + dialog.getEdtBuscar().setText(texto); + } + } + else if(requestCode == MODO_PEDIDO ) + { + if (resultCode == RESULT_OK) { + ArrayList text = data.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS); + String texto = text.get(0); + textoVozPedido = texto; + obtenerDatosPedidoVoz(); + } + } + + } + + public void obtenerArticuloBarcode(String barcode) + { + if(pedido.getOrder().getAgencia() != null) { + Bundle bundle = new Bundle(); + bundle.putString(FragmentDetalleArticulo.BARCODE, barcode); + if(compararFragments(FragmentDetalleArticulo.class)) + getFragmentManager().popBackStack(); + cambiarFragment(new FragmentDetalleArticulo(), bundle); + } + else + { + Toast.makeText(this, getResources().getString(R.string.toolbar_colores_agencia), Toast.LENGTH_SHORT).show(); + } + + } + + private static boolean isNumber(final String number) { + boolean bisNumber = false; + if (number == null) { + bisNumber = false; + } + try { + Integer.parseInt(number); + bisNumber = true; + } catch (NumberFormatException ne) { + bisNumber = false; + } + return bisNumber; + } + + public void setBuscarClientes(boolean buscarClientes) { + this.buscarClientes = buscarClientes; + } + + + public void lanzarReconocimientoVoz(int modo) + { + Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); + + try { + startActivityForResult(intent, modo); + + } catch (ActivityNotFoundException a) { + Toast t = Toast.makeText(getApplicationContext(), + getResources().getString(R.string.activity_base_articulo_no_voz), + Toast.LENGTH_SHORT); + t.show(); + } + } + + public void obtenerDatosPedidoVoz(){ + + /*textoVozPedido = textoVozPedido.toLowerCase(); + textoVozPedido = textoVozPedido.replace("cliente ", ","); + textoVozPedido = textoVozPedido.replace("quiente ", ","); + textoVozPedido = textoVozPedido.replace(" fecha ", ","); + textoVozPedido = textoVozPedido.replace(" llegada ", ","); + textoVozPedido = textoVozPedido.replace(" agencia ", ","); + + + CmdObtenerDatosComandoVoz cmd = new CmdObtenerDatosComandoVoz(textoVozPedido, pedido.getOrder().getCalendario().getFormatFecha()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + textoVozPedido = ""; + CmdObtenerDatosComandoVoz cmda = (CmdObtenerDatosComandoVoz) cmd; + pedido.getOrder().setAgencia(cmda.getAgencia()); + pedido.getOrder().setCliente(cmda.getCliente()); + cambiarFragment(new FragmentConfigurarPedido()); + + } + }); + execute(cmd);*/ + + } + + + + + public void goToHome() + { + Intent myintent = new Intent(this, Main.class); + myintent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(myintent); + } + + public ControllerPedido getPedido() { + return pedido; + } + + public NavigationPanel getnPanel() { + return nPanel; + } + + public void recalcularPrecios() + { + ((FragmentBase)fragmentActivo).recalcularPrecios(); + } + + public void logout() + { + preferences.borrarUsuario(); + FileManager.borrarFichero(FileManager.PEDIO, this); + Intent intent = new Intent(com.nelosan.baselibrary.MyApplication.getContext(), Main.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + startActivity(intent); + } + + public com.nelosan.baselibrary.fragment.FragmentBase getFragmentActivo() + { + return fragmentActivo; + } + + public String getSerialNumber(){ + return serialNumber; + } + + public void changeSerialNumber(){ + try{ + serialNumber = Build.SERIAL; + } + catch (Exception e){ + Log.e("Error serial number", e.getMessage().toString()); + } + } +} + diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Agencias.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Agencias.java new file mode 100644 index 00000000..83fdadb8 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Agencias.java @@ -0,0 +1,32 @@ +package com.verdnatura.verdnaturaventas; + +import android.os.Bundle; + +import com.verdnatura.verdnaturaventas.fragment.FragmentVistas; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarColores; + +public class Agencias extends ActivityBase { + + public boolean inicializado; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + crearToolbar(new ToolbarColores(this, "Verdnatura", true, ToolbarColores.BUSCAR_DIALOG)); + inicializado = false; + if(savedInstanceState == null) { + inicializado = true; + cambiarFragment(new FragmentVistas()); + } + } + + @Override + protected void backPress() { + super.backPress(); + if(compararFragments(FragmentVistas.class)) + finish(); + else + getFragmentManager().popBackStack(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/ArticuloDetalle.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/ArticuloDetalle.java new file mode 100644 index 00000000..df915ffd --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/ArticuloDetalle.java @@ -0,0 +1,34 @@ +package com.verdnatura.verdnaturaventas; + +import android.os.Bundle; +import com.verdnatura.verdnaturaventas.fragment.FragmentDetalleArticulo; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + + +public class ArticuloDetalle extends ActivityBase { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if(savedInstanceState == null){ + + ArticuloVentasTags articulo = getIntent().getExtras().getParcelable(FragmentDetalleArticulo.ARTICULO); + + Bundle bundle = new Bundle(); + bundle.putParcelable(FragmentDetalleArticulo.ARTICULO, null); + bundle.putParcelable(FragmentDetalleArticulo.ARTICULO_RECUPERADO, articulo); + cambiarFragment(new FragmentDetalleArticulo(), bundle); + } + + } + + @Override + protected void backPress() { + super.backPress(); + if(compararFragments(FragmentDetalleArticulo.class)) + finish(); + else + getFragmentManager().popBackStack(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Articulos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Articulos.java new file mode 100644 index 00000000..11495fa2 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Articulos.java @@ -0,0 +1,40 @@ +package com.verdnatura.verdnaturaventas; + +import android.os.Bundle; + +import com.verdnatura.verdnaturaventas.fragment.FragmentArticulos; +import com.verdnatura.verdnaturaventas.fragment.FragmentFamilias; +import com.verdnatura.verdnaturaventas.model.ParametrosReino; +import com.verdnatura.verdnaturaventas.model.Tipo; + + +/** + * Created by manuelsanchez on 12/12/17. + */ + +public class Articulos extends ActivityBase{ + + + /********************OVERRIDE***********************/ + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + Tipo tipo = getIntent().getExtras().getParcelable(FragmentArticulos.TIPO); + ParametrosReino parametros = getIntent().getExtras().getParcelable(FragmentFamilias.PARAMETROS); + + Bundle bundle = new Bundle(); + bundle.putParcelable(FragmentArticulos.TIPO, tipo); + bundle.putParcelable(FragmentFamilias.PARAMETROS, parametros); + if(savedInstanceState == null) + cambiarFragment(new FragmentArticulos(), bundle); + } + + @Override + protected void backPress() { + super.backPress(); + finish(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Cuenta.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Cuenta.java new file mode 100644 index 00000000..ebb6d823 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Cuenta.java @@ -0,0 +1,30 @@ +package com.verdnatura.verdnaturaventas; + +import android.os.Bundle; + +import com.verdnatura.verdnaturaventas.fragment.FragmentCuenta; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarVerdnatura; + + +public class Cuenta extends ActivityBase { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if(fragmentActivo == null) { + cambiarFragment(new FragmentCuenta()); + crearToolbar(new ToolbarVerdnatura(this)); + } + } + + @Override + protected void backPress() { + super.backPress(); + if(compararFragments(FragmentCuenta.class)) + finish(); + else + getFragmentManager().popBackStack(); + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Image.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Image.java new file mode 100644 index 00000000..096ed012 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Image.java @@ -0,0 +1,20 @@ +package com.verdnatura.verdnaturaventas; + +import android.os.Bundle; + +import com.verdnatura.verdnaturaventas.fragment.FragmentImage; + +public class Image extends ActivityBase { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + cambiarFragment(new FragmentImage(), getIntent().getExtras()); + } + + @Override + public void onBackPressed() { + super.onBackPressed(); + finish(); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Instrucciones.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Instrucciones.java new file mode 100644 index 00000000..89080903 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Instrucciones.java @@ -0,0 +1,57 @@ +package com.verdnatura.verdnaturaventas; + +import android.content.SharedPreferences; +import android.os.Bundle; +import android.preference.PreferenceManager; +import androidx.drawerlayout.widget.DrawerLayout; +import android.view.Gravity; +import android.view.View; + +import com.verdnatura.verdnaturaventas.fragment.FragmentInstrucciones; + + +public class Instrucciones extends ActivityBase { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + crearToolbar(null); + cambiarFragment(new FragmentInstrucciones()); + drawerLayout.setDrawerListener(new DrawerLayout.DrawerListener() { + @Override + public void onDrawerSlide(View drawerView, float slideOffset) { + + } + + @Override + public void onDrawerOpened(View drawerView) { + + } + + @Override + public void onDrawerClosed(View drawerView) { + + } + + @Override + public void onDrawerStateChanged(int newState) { + int location = ((FragmentInstrucciones)fragmentActivo).getLocation(); + if(location == FragmentInstrucciones.PANEL_CUENTA && drawerLayout.isDrawerOpen(Gravity.LEFT)) + ((FragmentInstrucciones)fragmentActivo).setSiguiente(); + if(location == FragmentInstrucciones.PANEL_CARRITO && drawerLayout.isDrawerOpen(Gravity.RIGHT)) + ((FragmentInstrucciones)fragmentActivo).setSiguiente(); + } + }); + + } + + public void marcarInstruccionesLeidas() + { + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean("instrucciones", true); + editor.commit(); + finish(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Main.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Main.java new file mode 100644 index 00000000..a75b8f12 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Main.java @@ -0,0 +1,183 @@ +package com.verdnatura.verdnaturaventas; + +import android.app.AlertDialog; +import android.content.DialogInterface; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Build; +import android.os.Bundle; +import android.util.Log; + +import com.google.android.gms.tasks.OnFailureListener; +import com.google.android.gms.tasks.OnSuccessListener; +import com.google.firebase.firestore.DocumentReference; +import com.google.firebase.firestore.FirebaseFirestore; +import com.google.firebase.iid.FirebaseInstanceId; +import com.google.firebase.iid.InstanceIdResult; +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.command.CmdGetVersion; +import com.verdnatura.verdnaturaventas.command.CmdRegistrarGCM; +import com.verdnatura.verdnaturaventas.core.FileManager; +import com.verdnatura.verdnaturaventas.fragment.FragmentConfigurarPedido; +import com.verdnatura.verdnaturaventas.fragment.FragmentGetCliente; +import com.verdnatura.verdnaturaventas.fragment.FragmentLogin; +import com.verdnatura.verdnaturaventas.fragment.FragmentMain; +import com.verdnatura.verdnaturaventas.fragment.FragmentPedidosPendientes; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.Order; + +import java.util.HashMap; +import java.util.Map; + +import androidx.annotation.NonNull; + + +public class Main extends ActivityBase { + + private boolean inicializado; + private FirebaseFirestore db; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + inicializado = false; + if(savedInstanceState != null) + inicializado = true; + db = FirebaseFirestore.getInstance(); + createView(); + + + } + + + + @Override + protected void backPress() { + super.backPress(); + if(fragmentActivo == null || compararFragments(FragmentMain.class) || compararFragments(FragmentLogin.class) || compararFragments(FragmentGetCliente.class)) + { + closeApp(); + } + else if(compararFragments(FragmentConfigurarPedido.class)) + { + cambiarFragment(new FragmentMain()); + } + else if(compararFragments(FragmentPedidosPendientes.class)) + { + pedido.setOrder(new Order()); + pedido.guardarOrder(); + showCarritoRows(); + showTotalPedido(); + cambiarFragment(new FragmentMain()); + } + else { + getFragmentManager().popBackStack(); + } + } + + private void createView() + { + ClienteVentas cliente = preferences.recuperarCliente(); + + if(!inicializado) { + FileManager.borrarFichero(FileManager.PEDIO, this); + if (preferences.usuarioLogueado() && cliente != null) { + cambiarFragment(new FragmentGetCliente()); + registrarTelefono(); + getVersion(); + saveTokenUser(); + + } else { + cambiarFragment(new FragmentLogin()); + } + + inicializado = true; + } + } + + private void saveTokenUser(){ + final ClienteVentas cliente = preferences.recuperarCliente(); + if (cliente != null) { + FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(new OnSuccessListener() { + @Override + public void onSuccess(InstanceIdResult instanceIdResult) { + String token = instanceIdResult.getToken(); + Map user = new HashMap<>(); + user.put("name",cliente.getCliente()); + user.put("token", token); + + + db.collection("users").document(String.valueOf(cliente.getId_Cliente())) + .set(user) + .addOnSuccessListener(new OnSuccessListener() { + @Override + public void onSuccess(Void aVoid) { + Log.d("tag", "DocumentSnapshot successfully written!"); + } + }) + .addOnFailureListener(new OnFailureListener() { + @Override + public void onFailure(@NonNull Exception e) { + Log.w("tag", "Error writing document", e); + } + }); + } + }); + + + } + + } + + public void registrarTelefono() + { + if(!preferences.telefonoRegistrado()){ + ClienteVentas c = preferences.recuperarCliente(); + CmdRegistrarGCM cmd = new CmdRegistrarGCM(c.getId_Cliente()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + preferences.registrarTelefono(); + } + }); + execute(cmd); + } + } + + public void getVersion() + { + CmdGetVersion cmd = new CmdGetVersion(); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + try { + int version = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; + int newVersion = ((CmdGetVersion)cmd).getVersion(); + if(version < newVersion && version != 0) + { + AlertDialog.Builder b = new AlertDialog.Builder(Main.this); + b.setMessage(getString(R.string.dialog_version_mensaje)); + b.setNegativeButton(getString(R.string.cancelar), null); + b.setPositiveButton(getResources().getString(R.string.dialog_version_playstore), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + final String appPackageName = getPackageName(); + startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName))); + } + }); + b.setTitle(getResources().getString(com.nelosan.baselibrary.R.string.aviso)); + b.show(); + + } + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + + } + }); + execute(cmd); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/MyApplication.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/MyApplication.java new file mode 100644 index 00000000..51a0896e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/MyApplication.java @@ -0,0 +1,16 @@ +package com.verdnatura.verdnaturaventas; + + +import org.acra.annotation.ReportsCrashes; + +/** + * Created by nelo on 31/03/15. + */ +@ReportsCrashes(formKey = "") +public class MyApplication extends com.nelosan.baselibrary.MyApplication { + @Override + public void onCreate() { + super.onCreate(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/MyFirebaseMessagingService.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/MyFirebaseMessagingService.java new file mode 100644 index 00000000..90f74c81 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/MyFirebaseMessagingService.java @@ -0,0 +1,73 @@ +package com.verdnatura.verdnaturaventas; + +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.graphics.BitmapFactory; +import android.media.RingtoneManager; +import android.net.Uri; +import android.util.Log; + +import com.google.firebase.messaging.FirebaseMessagingService; +import com.google.firebase.messaging.RemoteMessage; + +import androidx.core.app.NotificationCompat; + +public class MyFirebaseMessagingService extends FirebaseMessagingService { + + @Override + public void onNewToken(String token) { + Log.d("Token","Refreshed token: "+ token); + //super.onNewToken(token); + } + + @Override + public void onMessageReceived(RemoteMessage remoteMessage) { + // TODO(developer): Handle FCM messages here. + // Not getting messages here? See why this may be: https://goo.gl/39bRNJ + Log.d("MENSAJE", "From: " + remoteMessage.getFrom()); + + // Check if message contains a data payload. + if (remoteMessage.getData().size() > 0) { + Log.d("MENSAJE", "Message data payload: " + remoteMessage.getData()); + + + } + + // Check if message contains a notification payload. + if (remoteMessage.getNotification() != null) { + Log.d("MENSAJE", "Message Notification Body: " + remoteMessage.getNotification().getBody()); + } + + //sendNotification(remoteMessage); + } + + private void sendNotification(RemoteMessage remoteMessage) { + RemoteMessage.Notification notification = remoteMessage.getNotification(); + Intent intent = new Intent(this, Main.class); + intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); + PendingIntent pendingIntent = PendingIntent.getActivity(this, 0, intent, + PendingIntent.FLAG_ONE_SHOT); + + Uri defaultSoundUri= RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION); + NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this) + .setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.ic_stat_ic_notification)) + .setSmallIcon(R.drawable.ic_stat_ic_notification) + .setContentTitle(notification.getTitle()) + .setContentText(notification.getBody()) + .setAutoCancel(true) + .setSound(defaultSoundUri) + .setContentIntent(pendingIntent); + + NotificationManager notificationManager = + (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + + notificationManager.notify(0, notificationBuilder.build()); + } + + @Override + public void onDeletedMessages() { + //super.onDeletedMessages(); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Pedidos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Pedidos.java new file mode 100644 index 00000000..48b7c140 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Pedidos.java @@ -0,0 +1,26 @@ +package com.verdnatura.verdnaturaventas; + +import android.os.Bundle; +import com.verdnatura.verdnaturaventas.fragment.FragmentLineasPedido;; +import com.verdnatura.verdnaturaventas.fragment.FragmentPedidos; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarVerdnatura; + +public class Pedidos extends ActivityBase { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + crearToolbar(new ToolbarVerdnatura(this)); + cambiarFragment(new FragmentPedidos()); + } + + @Override + protected void backPress() { + super.backPress(); + if(compararFragments(FragmentLineasPedido.class)) + getFragmentManager().popBackStack(); + else { + finish(); + } + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Reino.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Reino.java new file mode 100644 index 00000000..fd974a34 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Reino.java @@ -0,0 +1,33 @@ +package com.verdnatura.verdnaturaventas; + +import android.os.Bundle; + +import com.verdnatura.verdnaturaventas.fragment.FragmentFamilias; +import com.verdnatura.verdnaturaventas.model.ParametrosReino; + + +public class Reino extends ActivityBase{ + + private ParametrosReino parametros; + + /********************OVERRIDE***********************/ + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + parametros = getIntent().getExtras().getParcelable(FragmentFamilias.PARAMETROS); + + Bundle bundle = new Bundle(); + bundle.putParcelable(FragmentFamilias.PARAMETROS, parametros); + if(savedInstanceState == null) + cambiarFragment(new FragmentFamilias(), bundle); + } + + @Override + protected void backPress() { + super.backPress(); + finish(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Scanner.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Scanner.java new file mode 100644 index 00000000..a5fdc882 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/Scanner.java @@ -0,0 +1,45 @@ +package com.verdnatura.verdnaturaventas; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; + +import me.dm7.barcodescanner.zbar.Result; +import me.dm7.barcodescanner.zbar.ZBarScannerView; + + +public class Scanner extends Activity implements ZBarScannerView.ResultHandler { + private ZBarScannerView mScannerView; + + @Override + public void onCreate(Bundle state) { + super.onCreate(state); + mScannerView = new ZBarScannerView(this); // Programmatically initialize the scanner view + setContentView(mScannerView); // Set the scanner view as the content view + } + + @Override + public void onResume() { + super.onResume(); + mScannerView.setResultHandler(this); // Register ourselves as a handler for scan results. + mScannerView.startCamera(); // Start camera on resume + } + + @Override + public void onPause() { + super.onPause(); + mScannerView.stopCamera(); // Stop camera on pause + } + + @Override + public void handleResult(Result rawResult) { + // Do something with the result here + Log.v("SCANNER", rawResult.getContents()); // Prints scan results + Log.v("SCANNER", rawResult.getBarcodeFormat().getName()); // Prints the scan format (qrcode, pdf417 etc.) + Intent returnIntent = new Intent(); + returnIntent.putExtra("barcode", rawResult.getContents()); + setResult(RESULT_OK, returnIntent); + finish(); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterAgencias.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterAgencias.java new file mode 100644 index 00000000..243a1276 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterAgencias.java @@ -0,0 +1,76 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.Agencia; + +import java.util.List; + +/** + * Created by nelo on 14/01/15. + */ +public class AdapterAgencias extends RecyclerView.Adapter implements View.OnClickListener{ + + private List agencias; + private View.OnClickListener listener; + + public AdapterAgencias(List agencias) { + this.agencias = agencias; + } + + public static class AgenciasViewHolder extends RecyclerView.ViewHolder { + + private TextView txtAgencia; + + public AgenciasViewHolder(View itemView) { + super(itemView); + + txtAgencia = (TextView)itemView.findViewById(R.id.textview_agencia); + } + + public void bindTitular(Agencia a) { + txtAgencia.setText(a.getAgencia().toUpperCase()); + } + } + + @Override + public AgenciasViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_agencia, viewGroup, false); + + itemView.setOnClickListener(this); + AgenciasViewHolder avh = new AgenciasViewHolder(itemView); + return avh; + } + + @Override + public void onBindViewHolder(AgenciasViewHolder viewHolder, int position) { + Agencia item = agencias.get(position); + viewHolder.bindTitular(item); + } + + @Override + public int getItemCount() { + return agencias.size(); + } + + public Agencia getItem(int position) + { + return agencias.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if(listener != null) + listener.onClick(view); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterArticuloRelacionado.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterArticuloRelacionado.java new file mode 100644 index 00000000..471337b7 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterArticuloRelacionado.java @@ -0,0 +1,66 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.content.Context; +import android.content.res.Resources; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +import com.nelosan.baselibrary.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.core.Format; +import com.verdnatura.verdnaturaventas.core.Static; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.List; + +/** + * Created by nelo on 4/02/15. + */ +public class AdapterArticuloRelacionado extends ArrayAdapter { + + private LayoutInflater li; + private Resources res; + + public AdapterArticuloRelacionado(Context context, int resource, List objects) { + super(context, resource, objects); + + li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + res = context.getResources(); + } + + private class ArticuloHolder { + TextView txtNombre, txtPrecio; + ImageView imvFoto; + + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) + { + ArticuloVentasTags articulo = getItem(position); + //Inflate the view + ArticuloHolder articuloHolder; + + if (convertView == null) { + articuloHolder = new ArticuloHolder(); + convertView = li.inflate(R.layout.item_articulo_relacionado, null); + articuloHolder.txtNombre = (TextView)convertView.findViewById(R.id.textview_item_articulo_relacionado_nombre); + articuloHolder.txtPrecio = (TextView)convertView.findViewById(R.id.textview_item_articulo_relacionado_precio); + articuloHolder.imvFoto = (ImageView)convertView.findViewById(R.id.imageview_item_articulo_relacionado_foto); + convertView.setTag(articuloHolder); + } else { + articuloHolder = (ArticuloHolder)convertView.getTag(); + } + + articuloHolder.txtNombre.setText(articulo.getArticle()); + articuloHolder.txtPrecio.setText(""+ Format.df.format(articulo.getPrice())+"€"); + MyApplication.downloadImg(Static.BASE_URL_SMALL + articulo.getFoto()+".png", articuloHolder.imvFoto, MyApplication.TRANSFORM_CIRCLE); + + return convertView; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterArticulos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterArticulos.java new file mode 100644 index 00000000..2896857d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterArticulos.java @@ -0,0 +1,133 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.content.Context; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.core.Colores; +import com.verdnatura.verdnaturaventas.core.Format; +import com.verdnatura.verdnaturaventas.core.LinearTags; +import com.verdnatura.verdnaturaventas.core.Static; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.List; + +/** + * Created by nelo on 21/01/15. + */ +public class AdapterArticulos extends RecyclerView.Adapter implements View.OnClickListener{ + + private List articulos; + private View.OnClickListener listener; + private boolean isGrid = false; + private Context context; + + public AdapterArticulos(List articulos, Context context) { + this.articulos = articulos; + this.context = context; + } + + public AdapterArticulos(List articulos, boolean isGrid, Context context) { + this.articulos = articulos; + this.isGrid = isGrid; + this.context = context; + } + + public static class ArticulosViewHolder extends RecyclerView.ViewHolder { + + private TextView txtNombre, txtPrecio, txtAvailable, txtDesde, txtSubname; + private ImageView imvFoto; + private ControllerPreferences prefs; + private LinearTags linearCaracteristicas; + private boolean isGrid = false; + private Context context; + + + public ArticulosViewHolder(View itemView, boolean isGrid, Context context) { + super(itemView); + prefs = new ControllerPreferences(); + this.isGrid = isGrid; + this.context = context; + + txtNombre = (TextView)itemView.findViewById(R.id.textview_item_articulo_nombre); + txtSubname = (TextView)itemView.findViewById(R.id.txtSubName); + txtPrecio = (TextView)itemView.findViewById(R.id.textview_item_articulo_precio); + txtAvailable = (TextView)itemView.findViewById(R.id.textview_item_articulo_available); + txtDesde = (TextView)itemView.findViewById(R.id.textview_item_articulo_desde); + imvFoto = (ImageView)itemView.findViewById(R.id.imageview_item_articulo_foto); + linearCaracteristicas = (LinearTags)itemView.findViewById(R.id.item_articulo_caracteristicas); + } + + public void bindTitular(ArticuloVentasTags articulo) { + txtNombre.setText(articulo.getArticle()); + txtSubname.setText(articulo.getSubName()); + txtAvailable.setText(""+(int)articulo.getAvailable()); + txtPrecio.setText(Format.df.format(articulo.getPrice()) + "€"); + + if(!prefs.verPrecios()) + { + txtPrecio.setVisibility(View.GONE); + txtDesde.setVisibility(View.GONE); + txtAvailable.setVisibility(View.GONE); + } + + else + { + txtPrecio.setVisibility(View.VISIBLE); + txtDesde.setVisibility(View.VISIBLE); + txtAvailable.setVisibility(View.VISIBLE); + } + + int color = Colores.getColor(articulo.getReino()); + txtPrecio.setTextColor(color); + MyApplication.downloadImg(Static.BASE_URL_SMALL + articulo.getFoto()+".png", imvFoto, MyApplication.TRANSFORM_NONE); + + linearCaracteristicas.generateTags(articulo.getTags()); + + } + } + + @Override + public ArticulosViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_articulo, viewGroup, false); + + itemView.setOnClickListener(this); + ArticulosViewHolder avh = new ArticulosViewHolder(itemView, isGrid, context); + return avh; + } + + @Override + public void onBindViewHolder(ArticulosViewHolder viewHolder, int position) { + ArticuloVentasTags item = articulos.get(position); + viewHolder.bindTitular(item); + } + + @Override + public int getItemCount() { + return articulos.size(); + } + + public ArticuloVentasTags getItem(int position) + { + return articulos.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if(listener != null) + listener.onClick(view); + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterCarrito.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterCarrito.java new file mode 100644 index 00000000..a130c7e8 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterCarrito.java @@ -0,0 +1,77 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.content.Context; +import android.content.res.Resources; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.core.Format; +import com.verdnatura.verdnaturaventas.model.OrderRow; + +import java.util.List; + +/** + * Created by nelo on 21/01/15. + */ +public class AdapterCarrito extends ArrayAdapter { + + private LayoutInflater li; + private Resources res; + + public AdapterCarrito(Context context, int resource, List objects) { + super(context, resource, objects); + + li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + res = context.getResources(); + } + + public class RowHolder { + public TextView txtNombre, txtPrecio, txtCantidad, txtPrecioTotal; + + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) + { + OrderRow row = getItem(position); + //Inflate the view + RowHolder rowHolder; + + if (convertView == null) { + rowHolder = new RowHolder(); + convertView = li.inflate(R.layout.item_carrito, null); + rowHolder.txtNombre = (TextView)convertView.findViewById(R.id.textview_item_carrito_nombre); + rowHolder.txtPrecio = (TextView)convertView.findViewById(R.id.textview_item_carrito_precio); + rowHolder.txtCantidad = (TextView)convertView.findViewById(R.id.textview_item_carrito_cantidad); + rowHolder.txtPrecioTotal = (TextView)convertView.findViewById(R.id.textview_item_carrito_precio_total); + convertView.setTag(rowHolder); + } else { + rowHolder = (RowHolder)convertView.getTag(); + } + + rowHolder.txtNombre.setText(row.getArticulo().getArticle()); + rowHolder.txtPrecio.setText(Format.df.format(row.getTarifa().getPrice()).replace(",", ".")+"€"); + rowHolder.txtCantidad.setText(row.getAmount()+"x"); + rowHolder.txtPrecioTotal.setText(Format.df.format(row.getTarifa().getPrice() * row.getAmount()).replace(",", ".")+"€"); + + ControllerPreferences prefs = new ControllerPreferences(); + if(!prefs.verPrecios()) + { + rowHolder.txtPrecio.setVisibility(View.GONE); + rowHolder.txtNombre.setText(row.getAmount() + " x " + row.getArticulo().getArticle()); + rowHolder.txtCantidad.setVisibility(View.GONE); + rowHolder.txtPrecioTotal.setVisibility(View.GONE); + } + + return convertView; + } + + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterCompra.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterCompra.java new file mode 100644 index 00000000..b681b259 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterCompra.java @@ -0,0 +1,81 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.content.Context; +import android.content.res.Resources; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.core.Colores; +import com.verdnatura.verdnaturaventas.core.Format; +import com.verdnatura.verdnaturaventas.model.DatosCompra; + +import java.util.List; + +/** + * Created by nelo on 22/01/15. + */ +public class AdapterCompra extends ArrayAdapter { + + private LayoutInflater li; + private Resources res; + + public AdapterCompra(Context context, int resource, List objects) { + super(context, resource, objects); + + li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + res = context.getResources(); + } + + public class DatosCompraHolder { + public TextView txtMensaje, txtPrecio, txtEspecificaciones, txtWarehouse; + + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) + { + DatosCompra datos = getItem(position); + //Inflate the view + DatosCompraHolder datosCompraHolder; + + if (convertView == null) { + datosCompraHolder = new DatosCompraHolder(); + convertView = li.inflate(R.layout.item_compra, null); + datosCompraHolder.txtMensaje = (TextView)convertView.findViewById(R.id.textview_item_compra_mensaje); + datosCompraHolder.txtPrecio = (TextView)convertView.findViewById(R.id.textview_item_compra_precio); + datosCompraHolder.txtEspecificaciones = (TextView)convertView.findViewById(R.id.textview_item_compra_especificacione); + datosCompraHolder.txtWarehouse = (TextView)convertView.findViewById(R.id.textview_item_compra_warehouse); + + int color = Colores.getColor(datos.getArticulo().getReino()); + datosCompraHolder.txtPrecio.setTextColor(color); + + convertView.setTag(datosCompraHolder); + } else { + datosCompraHolder = (DatosCompraHolder)convertView.getTag(); + } + + + datosCompraHolder.txtMensaje.setText(datos.getCantidad()+" x "); + + datosCompraHolder.txtPrecio.setText(Format.df.format(datos.getPrecio()).replace(",", ".")+"€"); + datosCompraHolder.txtEspecificaciones.setText(datos.getEspecificaciones()); + + datosCompraHolder.txtWarehouse.setText(datos.getTarifa().getWarehouse()); + + ControllerPreferences prefs = new ControllerPreferences(); + if(!prefs.verPrecios()) + { + datosCompraHolder.txtMensaje.setText(datos.getCantidad()+""); + datosCompraHolder.txtPrecio.setVisibility(View.GONE); + } + + + return convertView; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterConsignatarios.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterConsignatarios.java new file mode 100644 index 00000000..c2ceedc3 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterConsignatarios.java @@ -0,0 +1,90 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.Consignatario; + +import java.util.List; + +/** + * Created by nelo on 14/01/15. + */ +public class AdapterConsignatarios extends RecyclerView.Adapter implements View.OnClickListener, View.OnLongClickListener{ + + private List consignatarios; + private View.OnClickListener listener; + private View.OnLongClickListener longclick; + + public AdapterConsignatarios(List consignatarios) { + this.consignatarios = consignatarios; + } + + public static class ConsignatariosViewHolder extends RecyclerView.ViewHolder { + + private TextView txtTitulo, txtValue; + + public ConsignatariosViewHolder(View itemView) { + super(itemView); + + txtTitulo = (TextView)itemView.findViewById(R.id.text_item_doble_titulo); + txtValue = (TextView)itemView.findViewById(R.id.text_item_doble_valor); + } + + public void bindTitular(Consignatario c) { + txtTitulo.setText(c.getConsignatario()); + txtValue.setText(c.getDomicilio()); + } + } + + @Override + public ConsignatariosViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_simple_doble, viewGroup, false); + + itemView.setOnClickListener(this); + itemView.setOnLongClickListener(this); + ConsignatariosViewHolder avh = new ConsignatariosViewHolder(itemView); + return avh; + } + + @Override + public void onBindViewHolder(ConsignatariosViewHolder viewHolder, int position) { + Consignatario item = consignatarios.get(position); + viewHolder.bindTitular(item); + } + + @Override + public int getItemCount() { + return consignatarios.size(); + } + + public Consignatario getItem(int position) + { + return consignatarios.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + public void setLongclick(View.OnLongClickListener longclick) { + this.longclick = longclick; + } + + @Override + public void onClick(View view) { + if(listener != null) + listener.onClick(view); + } + + @Override + public boolean onLongClick(View v) { + if(longclick != null) + longclick.onLongClick(v); + return true; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterEnvios.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterEnvios.java new file mode 100644 index 00000000..1657dcc3 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterEnvios.java @@ -0,0 +1,83 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.TicketRecepcion; + +import java.util.List; + +/** + * Created by nelo on 10/11/15. + */ +public class AdapterEnvios extends RecyclerView.Adapter implements View.OnClickListener { + + private List pedidos; + private View.OnClickListener listener; + + public AdapterEnvios(List pedidos) { + this.pedidos = pedidos; + } + + public static class EnviosViewHolder extends RecyclerView.ViewHolder { + + private TextView txtConsignatario, txtFecha, txtAgencia, txtTotal, txtAlias, txtConsigna; + + public EnviosViewHolder(View itemView) { + super(itemView); + + txtFecha = (TextView)itemView.findViewById(R.id.text_item_date); + txtAgencia = (TextView)itemView.findViewById(R.id.text_item_agency); + txtTotal = (TextView)itemView.findViewById(R.id.text_item_total); + txtAlias = (TextView)itemView.findViewById(R.id.text_item_alias); + txtConsigna = (TextView)itemView.findViewById(R.id.text_item_consigna); + } + + public void bindPedido(TicketRecepcion t) { + txtFecha.setText(t.getFecha()); + txtAgencia.setText(t.getAgencia()); + txtTotal.setText(String.format("%.2f", t.getTotal())+"€"); + txtAlias.setText(t.getAlias()); + txtConsigna.setText(t.getConsigna()); + } + + } + + @Override + public EnviosViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_envio, viewGroup, false); + + itemView.setOnClickListener(this); + EnviosViewHolder avh = new EnviosViewHolder(itemView); + return avh; + } + + @Override + public void onBindViewHolder(EnviosViewHolder viewHolder, int position) { + TicketRecepcion item = pedidos.get(position); + viewHolder.bindPedido(item); + } + + @Override + public int getItemCount() { + return pedidos.size(); + } + + public TicketRecepcion getItem(int position) { + return pedidos.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if (listener != null) + listener.onClick(view); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterEnviosLineas.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterEnviosLineas.java new file mode 100644 index 00000000..0dc39b5c --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterEnviosLineas.java @@ -0,0 +1,118 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.content.Context; +import android.content.Intent; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.nelosan.baselibrary.MyApplication; +import com.verdnatura.verdnaturaventas.Image; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.core.LinearTags; +import com.verdnatura.verdnaturaventas.core.Static; +import com.verdnatura.verdnaturaventas.fragment.FragmentImage; +import com.verdnatura.verdnaturaventas.model.TicketRecepcionLineasTags; + +import java.util.List; + + +/** + * Created by nelo on 23/07/15. + */ +public class AdapterEnviosLineas extends RecyclerView.Adapter implements View.OnClickListener { + + private List pedidos; + private View.OnClickListener listener; + private Context context; + + public AdapterEnviosLineas(Context context, List pedidos) { + this.context = context; + this.pedidos = pedidos; + } + + public static class EnviosLineasViewHolder extends RecyclerView.ViewHolder { + + private Context context; + private TextView txtDescripcion, txtCantidad; + private ImageView imgFoto; + private LinearTags lnrTags; + private RelativeLayout rltLlegada; + + public EnviosLineasViewHolder(Context context, View itemView) { + super(itemView); + this.context = context; + txtDescripcion = (TextView) itemView.findViewById(R.id.textview_item_articulo_llegada_nombre); + txtCantidad = (TextView) itemView.findViewById(R.id.textview_item_articulo_llegada_cantidad); + imgFoto = (ImageView) itemView.findViewById(R.id.imageview_item_articulo_llegada_foto); + lnrTags = (LinearTags)itemView.findViewById(R.id.recepcion_tags); + rltLlegada = (RelativeLayout)itemView.findViewById(R.id.relative_item_articulo_llegada); + } + + public void bindPedido(final TicketRecepcionLineasTags t) { + txtDescripcion.setText(t.getConcepte()); + String preu = String.format("%.2f", t.getPreu()); + String total = String.format("%.2f", t.getCantidad() * t.getPreu()); + txtCantidad.setText(t.getCantidad()+"x"+ preu+"="+total); + lnrTags.generateTags(t.getTags()); + MyApplication.downloadImg(Static.BASE_URL_SMALL + t.getFoto() + ".png", imgFoto, MyApplication.TRANSFORM_CIRCLE); + + if(t.isOk()) + rltLlegada.setBackgroundColor(context.getResources().getColor(R.color.verde_login)); + else + rltLlegada.setBackgroundColor(context.getResources().getColor(R.color.blanco)); + + imgFoto.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Intent intent = new Intent(context, Image.class); + intent.putExtra(FragmentImage.IMAGEN, t.getFoto()); + context.startActivity(intent); + } + }); + } + + } + + @Override + public EnviosLineasViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_articulo_llegada, viewGroup, false); + + itemView.setOnClickListener(this); + EnviosLineasViewHolder avh = new EnviosLineasViewHolder(context, itemView); + return avh; + } + + @Override + public void onBindViewHolder(EnviosLineasViewHolder viewHolder, int position) { + TicketRecepcionLineasTags item = pedidos.get(position); + viewHolder.bindPedido(item); + } + + @Override + public int getItemCount() { + return pedidos.size(); + } + + public TicketRecepcionLineasTags getItem(int position) { + if (position < pedidos.size()){ + return pedidos.get(position); + } + return null; + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if (listener != null) + listener.onClick(view); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterImprimir.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterImprimir.java new file mode 100644 index 00000000..cebac54e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterImprimir.java @@ -0,0 +1,143 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.os.Bundle; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.dialog.DialogImprimir; +import com.verdnatura.verdnaturaventas.model.OrderImprimir; +import com.verdnatura.verdnaturaventas.model.TicketOrder; + +import java.util.List; + +/** + * Created by nelo on 30/11/15. + */ +public class AdapterImprimir extends RecyclerView.Adapter implements View.OnClickListener{ + + private List orders; + private View.OnClickListener listener; + private static ActivityBase activity; + + public AdapterImprimir(List orders, ActivityBase activity) { + this.orders = orders; + this.activity = activity; + } + + + public static class ImprimirViewHolder extends RecyclerView.ViewHolder { + + private TextView txtCliente, txtTicketFv, txtTicketPca; + private View viewSeparacion; + private LinearLayout lnrFv, lnrPca; + + + public ImprimirViewHolder(View itemView) { + super(itemView); + + txtCliente = (TextView)itemView.findViewById(R.id.textview_item_pedido_imprimir_cliente); + txtTicketFv = (TextView)itemView.findViewById(R.id.textview_item_pedido_imprimir_ticket_fv); + txtTicketPca = (TextView)itemView.findViewById(R.id.textview_item_pedido_imprimir_ticket_pca); + viewSeparacion = (View)itemView.findViewById(R.id.separacion_item_imprimir); + lnrFv = (LinearLayout)itemView.findViewById(R.id.textview_item_pedido_imprimir_linear_fv); + lnrPca = (LinearLayout)itemView.findViewById(R.id.textview_item_pedido_imprimir_linear_pca); + + + } + + public void bindTitular(OrderImprimir order) { + + txtCliente.setText(order.getCliente()); + for(final TicketOrder ticket : order.getTickets()) + { + if(ticket.getWarehouse().equals("Silla FV")) + { + txtTicketFv.setText(ticket.getTicket() + ""); + viewSeparacion.setVisibility(View.VISIBLE); + lnrFv.setVisibility(View.VISIBLE); + lnrFv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + imprimir(ticket.getTicket()); + } + }); + + + } + else if(txtTicketFv.getText().length() == 0) + { + lnrFv.setVisibility(View.GONE); + } + + if(ticket.getWarehouse().equals("Silla PCA")) + { + txtTicketPca.setText(ticket.getTicket() + ""); + viewSeparacion.setVisibility(View.VISIBLE); + lnrPca.setVisibility(View.VISIBLE); + lnrPca.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + imprimir(ticket.getTicket()); + } + }); + } + else if(txtTicketPca.getText().length() == 0) + { + lnrPca.setVisibility(View.GONE); + } + } + + } + } + + @Override + public ImprimirViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_pedido_imprimir, viewGroup, false); + + itemView.setOnClickListener(this); + ImprimirViewHolder avh = new ImprimirViewHolder(itemView); + return avh; + } + + @Override + public void onBindViewHolder(ImprimirViewHolder viewHolder, int position) { + OrderImprimir item = orders.get(position); + viewHolder.bindTitular(item); + } + + @Override + public int getItemCount() { + return orders.size(); + } + + public OrderImprimir getItem(int position) + { + return orders.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if(listener != null) + listener.onClick(view); + } + + public static void imprimir(int ticket) + { + DialogImprimir dialog = new DialogImprimir(); + Bundle bundle = new Bundle(); + bundle.putInt(DialogImprimir.TICKET, ticket); + dialog.setArguments(bundle); + dialog.show(activity.getFragmentManager(), "DialogImprimir"); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterMain.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterMain.java new file mode 100644 index 00000000..20024cfb --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterMain.java @@ -0,0 +1,86 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageView; + +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.core.Colores; +import com.verdnatura.verdnaturaventas.model.BotonMain; + +import java.util.List; + +/** + * Created by nelo on 5/11/15. + */ +public class AdapterMain extends RecyclerView.Adapter implements View.OnClickListener { + + private List botones; + private View.OnClickListener listener; + + public AdapterMain(List botones) { + this.botones = botones; + } + + public static class BotonesViewHolder extends RecyclerView.ViewHolder { + + private TextViewRoboto txtFamilia; + private ImageView imgFamilia; + private Button btnFamilia; + + public BotonesViewHolder(View itemView) { + super(itemView); + + txtFamilia = (TextViewRoboto)itemView.findViewById(R.id.textview_boton_main); + imgFamilia = (ImageView)itemView.findViewById(R.id.imageview_boton_main); + btnFamilia = (Button)itemView.findViewById(R.id.button_main); + } + + public void bindTitular(BotonMain b) { + txtFamilia.setText(b.getNombre().toLowerCase()); + imgFamilia.setImageDrawable(MyApplication.getContext().getDrawable(b.getImagen())); + btnFamilia.setBackgroundColor(Colores.getColor(b.getReino())); + } + } + + @Override + public BotonesViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_boton_main, viewGroup, false); + + itemView.setOnClickListener(this); + BotonesViewHolder avh = new BotonesViewHolder(itemView); + return avh; + } + + @Override + public void onBindViewHolder(BotonesViewHolder viewHolder, int position) { + BotonMain item = botones.get(position); + viewHolder.bindTitular(item); + } + + @Override + public int getItemCount() { + return botones.size(); + } + + public BotonMain getItem(int position) + { + return botones.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if(listener != null) + listener.onClick(view); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterOrderDiference.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterOrderDiference.java new file mode 100644 index 00000000..0e2c88eb --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterOrderDiference.java @@ -0,0 +1,91 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.content.Context; +import android.content.res.Resources; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.core.Format; +import com.verdnatura.verdnaturaventas.model.OrderDiference; + +import java.util.List; + +/** + * Created by nelo on 17/03/15. + */ +public class AdapterOrderDiference extends ArrayAdapter { + + private LayoutInflater li; + private Resources res; + private Context context; + + public AdapterOrderDiference(Context context, int resource, List objects) { + super(context, resource, objects); + + li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + res = context.getResources(); + this.context = context; + } + + public class DiferenceHolder { + public TextView txtArticulo, txtPrecio, txtPrecioAntiguo, txtCantidad, txtCantidadAntigua; + + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) + { + OrderDiference diference = getItem(position); + //Inflate the view + DiferenceHolder diferenciaHolder; + + if (convertView == null) { + diferenciaHolder = new DiferenceHolder(); + convertView = li.inflate(R.layout.item_precios_recalculados, null); + diferenciaHolder.txtArticulo = (TextView)convertView.findViewById(R.id.textview_item_precio_recalculado_articulo); + diferenciaHolder.txtPrecio = (TextView)convertView.findViewById(R.id.textview_item_precio_recalculado_texto_precio_nuevo); + diferenciaHolder.txtCantidad = (TextView)convertView.findViewById(R.id.textview_item_precio_recalculado_disponible_nuevo); + diferenciaHolder.txtPrecioAntiguo = (TextView)convertView.findViewById(R.id.textview_item_precio_recalculado_texto_precio_antiguo); + diferenciaHolder.txtCantidadAntigua = (TextView)convertView.findViewById(R.id.textview_item_precio_recalculado_disponible_antiguo); + convertView.setTag(diferenciaHolder); + } else { + diferenciaHolder = (DiferenceHolder)convertView.getTag(); + } + + diferenciaHolder.txtArticulo.setText(diference.getArticulo()); + if(diference.isEscribirPrecio()) + { + diferenciaHolder.txtPrecio.setText(diference.getPrice()+"€"); + diferenciaHolder.txtPrecioAntiguo.setText(context.getString(R.string.adapter_order_diference_precio_cambia, Format.df.format(diference.getOldPrice()))); + if(diference.getPrice() < diference.getOldPrice()) + diferenciaHolder.txtPrecio.setTextColor(context.getResources().getColor(R.color.greens)); + else + diferenciaHolder.txtPrecio.setTextColor(context.getResources().getColor(R.color.flowers)); + } + else + { + diferenciaHolder.txtPrecio.setVisibility(View.GONE); + diferenciaHolder.txtPrecioAntiguo.setVisibility(View.GONE); + } + if(diference.isEscribirDisponible()) + { + diferenciaHolder.txtCantidad.setText(""+diference.getCantidad()); + diferenciaHolder.txtCantidadAntigua.setText(context.getString(R.string.adapter_order_diference_cantidad_cambia, diference.getOldCantidad())); + diferenciaHolder.txtCantidad.setTextColor(context.getResources().getColor(R.color.flowers)); + + } + else + { + diferenciaHolder.txtCantidad.setVisibility(View.GONE); + diferenciaHolder.txtCantidadAntigua.setVisibility(View.GONE); + } + + + return convertView; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterPedidoLineas.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterPedidoLineas.java new file mode 100644 index 00000000..963f38b2 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterPedidoLineas.java @@ -0,0 +1,86 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import com.nelosan.baselibrary.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.core.LinearTags; +import com.verdnatura.verdnaturaventas.core.Static; +import com.verdnatura.verdnaturaventas.model.OrderRow; + +import java.util.List; + +/** + * Created by nelo on 26/11/15. + */ +public class AdapterPedidoLineas extends RecyclerView.Adapter implements View.OnClickListener { + + private List lineas; + private View.OnClickListener listener; + + public AdapterPedidoLineas(List lineas) { + this.lineas = lineas; + } + + public static class PedidoLineasViewHolder extends RecyclerView.ViewHolder { + + private TextView txtDescripcion, txtCantidad; + private LinearTags lnrTags; + private ImageView imgFoto; + + public PedidoLineasViewHolder(View itemView) { + super(itemView); + + txtDescripcion = (TextView) itemView.findViewById(R.id.textview_item_articulo_llegada_nombre); + txtCantidad = (TextView) itemView.findViewById(R.id.textview_item_articulo_llegada_cantidad); + lnrTags = (LinearTags)itemView.findViewById(R.id.recepcion_tags); + imgFoto = (ImageView) itemView.findViewById(R.id.imageview_item_articulo_llegada_foto); + } + + public void bindTitular(OrderRow linea) { + txtDescripcion.setText(linea.getArticulo().getArticle()); + txtCantidad.setText(linea.getAmount()+""); + lnrTags.generateTags(linea.getArticulo().getTags()); + MyApplication.downloadImg(Static.BASE_URL_SMALL + linea.getArticulo().getFoto() + ".png", imgFoto, MyApplication.TRANSFORM_CIRCLE); + } + } + + @Override + public PedidoLineasViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_articulo_llegada, viewGroup, false); + + itemView.setOnClickListener(this); + PedidoLineasViewHolder avh = new PedidoLineasViewHolder(itemView); + return avh; + } + + @Override + public void onBindViewHolder(PedidoLineasViewHolder viewHolder, int position) { + OrderRow item = lineas.get(position); + viewHolder.bindTitular(item); + } + + @Override + public int getItemCount() { + return lineas.size(); + } + + public OrderRow getItem(int position) { + return lineas.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if (listener != null) + listener.onClick(view); + } +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterPedidosPendientes.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterPedidosPendientes.java new file mode 100644 index 00000000..3033e94e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterPedidosPendientes.java @@ -0,0 +1,108 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.os.Bundle; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.dialog.DialogDeleteOrder; +import com.verdnatura.verdnaturaventas.fragment.FragmentPedidosPendientes; +import com.verdnatura.verdnaturaventas.model.OrderResumen; + +import java.util.List; + +/** + * Created by nelo on 10/11/15. + */ +public class AdapterPedidosPendientes extends RecyclerView.Adapter implements View.OnClickListener { + + private List pedidos; + private View.OnClickListener listener; + private static FragmentPedidosPendientes fragment; + + public AdapterPedidosPendientes(List pedidos) { + this.pedidos = pedidos; + } + + public AdapterPedidosPendientes(List pedidos, FragmentPedidosPendientes fragment) { + this.pedidos = pedidos; + this.fragment = fragment; + } + + public static class PedidosPendientesViewHolder extends RecyclerView.ViewHolder { + + private TextView txtConsignatario, txtFecha, txtAgencia; + private ImageView imgDelete; + + public PedidosPendientesViewHolder(View itemView) { + super(itemView); + + txtConsignatario = (TextView)itemView.findViewById(R.id.textview_item_pedido_pendiente_consignatario); + txtFecha = (TextView)itemView.findViewById(R.id.textview_item_pedido_pendiente_fecha); + txtAgencia = (TextView)itemView.findViewById(R.id.textview_item_pedido_pendiente_agencia); + imgDelete = (ImageView)itemView.findViewById(R.id.imageview_item_pedido_pendiente_delete); + + } + + public void bindPedido(final OrderResumen p) { + txtConsignatario.setText(p.getAddress()); + txtFecha.setText(p.getFecha()); + txtAgencia.setText(p.getAgency()); + imgDelete.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + borrarPedido(p); + } + }); + } + } + + @Override + public PedidosPendientesViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_pedido_pendiente, viewGroup, false); + + itemView.setOnClickListener(this); + PedidosPendientesViewHolder avh = new PedidosPendientesViewHolder(itemView); + return avh; + } + + @Override + public void onBindViewHolder(PedidosPendientesViewHolder viewHolder, int position) { + OrderResumen item = pedidos.get(position); + viewHolder.bindPedido(item); + } + + @Override + public int getItemCount() { + return pedidos.size(); + } + + public OrderResumen getItem(int position) { + return pedidos.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if (listener != null) + listener.onClick(view); + } + + public static void borrarPedido(OrderResumen order){ + DialogDeleteOrder dialog = new DialogDeleteOrder(); + Bundle bundle = new Bundle(); + bundle.putParcelable(DialogDeleteOrder.ORDER_DELETE, order); + dialog.setArguments(bundle); + dialog.setFragment(fragment); + dialog.show(fragment.getActivity().getFragmentManager(), "DialogDeleteOrder"); + + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterTipos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterTipos.java new file mode 100644 index 00000000..3c59656c --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterTipos.java @@ -0,0 +1,60 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import android.content.Context; +import android.content.res.Resources; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.core.Colores; +import com.verdnatura.verdnaturaventas.model.Tipo; + +import java.util.List; + +/** + * Created by nelo on 14/01/15. + */ +public class AdapterTipos extends ArrayAdapter { + + private LayoutInflater li; + private Resources res; + + public AdapterTipos(Context context, int resource, List objects) { + super(context, resource, objects); + + li = (LayoutInflater)getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); + res = context.getResources(); + } + + private class TipoHolder { + TextView txtTipo; + + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) + { + Tipo tipo = getItem(position); + //Inflate the view + TipoHolder tipoHolder; + + if (convertView == null) { + tipoHolder = new TipoHolder(); + convertView = li.inflate(R.layout.item_simple_izquierda, null); + tipoHolder.txtTipo = (TextView)convertView.findViewById(R.id.textview_item_simple); + + convertView.setTag(tipoHolder); + } else { + tipoHolder = (TipoHolder)convertView.getTag(); + + } + + tipoHolder.txtTipo.setTextColor(Colores.getColor(tipo.getReino())); + tipoHolder.txtTipo.setText(tipo.getTipo()); + + return convertView; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterVistas.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterVistas.java new file mode 100644 index 00000000..d8884b41 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/adapter/AdapterVistas.java @@ -0,0 +1,79 @@ +package com.verdnatura.verdnaturaventas.adapter; + +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.Vista; + +import java.util.List; + + +/** + * Created by nelo on 14/01/15. + */ +public class AdapterVistas extends RecyclerView.Adapter implements View.OnClickListener{ + + private List vistas; + private View.OnClickListener listener; + + public AdapterVistas(List vistas) { + this.vistas = vistas; + } + + + + public static class VistasViewHolder extends RecyclerView.ViewHolder { + + private TextView txtVista; + + public VistasViewHolder(View itemView) { + super(itemView); + + txtVista = (TextView)itemView.findViewById(R.id.textview_agencia); + } + + public void bindTitular(Vista v) { + txtVista.setText(v.getVista().toUpperCase()); + } + } + + @Override + public VistasViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) { + View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_agencia, viewGroup, false); + + itemView.setOnClickListener(this); + VistasViewHolder vvh = new VistasViewHolder(itemView); + return vvh; + } + + @Override + public void onBindViewHolder(VistasViewHolder viewHolder, int position) { + Vista item = vistas.get(position); + viewHolder.bindTitular(item); + } + + @Override + public int getItemCount() { + return vistas.size(); + } + + public Vista getItem(int position) + { + return vistas.get(position); + } + + public void setOnClickListener(View.OnClickListener listener) { + this.listener = listener; + } + + @Override + public void onClick(View view) { + if(listener != null) + listener.onClick(view); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBorrarPedidoPendiente.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBorrarPedidoPendiente.java new file mode 100644 index 00000000..4d031d06 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBorrarPedidoPendiente.java @@ -0,0 +1,25 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.Order; +import com.verdnatura.verdnaturaventas.model.OrderResumen; + +/** + * Created by nelo on 12/7/16. + */ +public class CmdBorrarPedidoPendiente extends CommandBase { + + private OrderResumen pedido; + + public CmdBorrarPedidoPendiente(OrderResumen p){ + this.pedido = p; + this.message = MyApplication.getContext().getResources().getString(R.string.error_borrar_pedido); + } + + @Override + protected void Execute() { + super.Execute(); + ventas.BorrarOrder(pedido); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBuscarArticulos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBuscarArticulos.java new file mode 100644 index 00000000..e92a1bc2 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBuscarArticulos.java @@ -0,0 +1,36 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.List; + +/** + * Created by nelo on 30/03/15. + */ +public class CmdBuscarArticulos extends CommandBase { + + private String cadena, fecha; + private List articulos; + private int cid, aid; + + public CmdBuscarArticulos(String cadena, String f, int consignatario, int agencia) + { + this.cadena = cadena; + this.fecha = f; + this.cid = consignatario; + this.aid = agencia; + showError = false; + } + + @Override + protected void Execute() { + super.Execute(); + + articulos = ventas.BuscarArticulos(cadena, fecha, cid, aid); + + } + + public List getArticulos() { + return articulos; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBuscarClientes.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBuscarClientes.java new file mode 100644 index 00000000..d7f3413b --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdBuscarClientes.java @@ -0,0 +1,33 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +import java.util.List; + +/** + * Created by nelo on 20/04/15. + */ +public class CmdBuscarClientes extends CommandBase{ + + private String cliente; + private List clientes; + + public CmdBuscarClientes(String c) + { + cliente = c; + showError = false; + } + + @Override + protected void Execute() { + super.Execute(); + + clientes = ventas.BuscarClientes(cliente); + + } + + public List getclientes() + { + return clientes; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdCheckMovimientos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdCheckMovimientos.java new file mode 100644 index 00000000..b81d58bb --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdCheckMovimientos.java @@ -0,0 +1,26 @@ +package com.verdnatura.verdnaturaventas.command; + + +import com.verdnatura.verdnaturaventas.model.TicketRecepcionLineasTags; + +import java.util.List; + +/** + * Created by nelo on 15/3/17. + */ + +public class CmdCheckMovimientos extends CommandBase { + + private List movimientos; + + public CmdCheckMovimientos(List m){ + movimientos = m; + showError = false; + } + + @Override + protected void Execute() { + super.Execute(); + ventas.CheckMovimientos(movimientos); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdCrearOrder.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdCrearOrder.java new file mode 100644 index 00000000..6b20970b --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdCrearOrder.java @@ -0,0 +1,41 @@ +package com.verdnatura.verdnaturaventas.command; + + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.model.Order; + +/** + * Created by nelo on 12/05/15. + */ +public class CmdCrearOrder extends CommandBase { + + private ControllerPedido pedido; + private Order order; + private String serialNumber; + + + public CmdCrearOrder(ControllerPedido p, String serialNumber) + { + this.pedido = p; + this.serialNumber = serialNumber; + this.message = MyApplication.getContext().getResources().getString(R.string.error_crear_order); + } + + @Override + protected void Execute() { + super.Execute(); + order = pedido.rellenarDatosOrder(); + order.setDeviceID(serialNumber); + + order = ventas.CrearOrder(order); + + } + + public Order getOrder() { + return order; + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdDescargarImagen.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdDescargarImagen.java new file mode 100644 index 00000000..b8968666 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdDescargarImagen.java @@ -0,0 +1,117 @@ +package com.verdnatura.verdnaturaventas.command; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.os.AsyncTask; +import android.util.Log; +import android.view.View; +import android.widget.ImageView; + +import com.verdnatura.verdnaturaventas.core.Static; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; + +/** + * Created by nelo on 20/01/15. + */ + + +public class CmdDescargarImagen extends AsyncTask { + + private ImageView image; + private Context context; + private boolean cachear; + + public CmdDescargarImagen(ImageView image, Context c, boolean cachear) + { + this.image = image; + this.context = c; + this.cachear = cachear; + } + + + @Override + protected Bitmap doInBackground(String... urls) { + return download_Image(urls[0]); + } + + @Override + protected void onPostExecute(Bitmap result) { + if(result != null) + { + image.setVisibility(View.VISIBLE); + image.setImageBitmap(result); + } + else + image.setVisibility(View.INVISIBLE); + } + + private Bitmap download_Image(String url) { + //--------------------------------------------------- + Bitmap bm = null; + try { + File dir = new File(Static.FILE_PATH, "/VerdNaturaVentas/thumbnails"); + dir.mkdirs(); + String[] troceado = url.split("/"); + String filename = troceado[troceado.length - 1]; + File imgFile = new File(dir, filename); + bm = BitmapFactory.decodeFile(imgFile.getAbsolutePath()); + + if(bm == null) + { + URL aURL = new URL(url); + URLConnection conn = aURL.openConnection(); + conn.connect(); + InputStream is = conn.getInputStream(); + BufferedInputStream bis = new BufferedInputStream(is); + //bm = reduceBitmap(bis, image.getWidth(), image.getHeight()); + bm = BitmapFactory.decodeStream(bis); + salverFicheroDisco(bm, imgFile); + bis.close(); + is.close(); + } + + + } catch (IOException e) { + Log.e("Hub", "Error getting the image from server : " + e.getMessage().toString()); + } + + return bm; + } + + public Bitmap reduceBitmap(BufferedInputStream bis, int maxAncho, int maxAlto) { + + final BitmapFactory.Options options = new BitmapFactory.Options(); + options.inJustDecodeBounds = true; + BitmapFactory.decodeStream(bis, null, options); + options.inSampleSize = (int) Math.max( + Math.ceil(options.outWidth / maxAncho), + Math.ceil(options.outHeight / maxAlto)); + options.inJustDecodeBounds = false; + Bitmap bm = BitmapFactory.decodeStream(bis, null, options); + return bm; + + } + + public void salverFicheroDisco(Bitmap bm, File f) + { + try { + FileOutputStream out = new FileOutputStream(f); + bm.compress(Bitmap.CompressFormat.PNG, 90, out); + out.flush(); + out.close(); + + } catch (Exception e) { + e.printStackTrace(); + } + + } + +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdGetVersion.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdGetVersion.java new file mode 100644 index 00000000..00e23543 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdGetVersion.java @@ -0,0 +1,54 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.core.DateControll; +import com.verdnatura.verdnaturaventas.core.FileManager; +import com.verdnatura.verdnaturaventas.fragment.FragmentLineasPedido; +import com.verdnatura.verdnaturaventas.model.TicketRecepcionLineasTags; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * Created by nelo on 22/09/15. + */ +public class CmdGetVersion extends CommandBase { + + private String version; + + @Override + protected void Execute() { + super.Execute(); + showError = false; + removeLines(); + version = ventas.GetVersion(); + + } + + public int getVersion() { + int ver; + try { + ver = Integer.parseInt(version); + }catch (Exception e){ + ver = 0; + } + return ver; + } + + public void removeLines(){ + try { + List lines = FileManager.recuperarFicheroLista(FragmentLineasPedido.RECUPERACION, TicketRecepcionLineasTags.class, activity); + List newLines = new ArrayList(); + DateControll controll = new DateControll(); + Date today = controll.stringToDate(controll.getNow(), "yyyy-MM-dd"); + for (TicketRecepcionLineasTags l : lines) { + Date lDate = controll.stringToDate(l.getFechaContar(), "yyyy-MM-dd"); + if (controll.addDays(5, lDate).getTime() > today.getTime()) + newLines.add(l); + } + + FileManager.guardarFichero(FragmentLineasPedido.RECUPERACION, newLines, activity); + } + catch (Exception e){} + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdImprimirTicket.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdImprimirTicket.java new file mode 100644 index 00000000..40bf0b52 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdImprimirTicket.java @@ -0,0 +1,24 @@ +package com.verdnatura.verdnaturaventas.command; + +public class CmdImprimirTicket extends CommandBase{ + + private String ticket; + private int warehouse; + private boolean entrada; + + public CmdImprimirTicket(String t, int warehouse, boolean entrada) + { + this.ticket = t; + this.warehouse = warehouse; + this.entrada = entrada; + } + + + @Override + public void Execute() { + + almacen.ImprimirTicket(ticket, warehouse, entrada); + + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdLogError.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdLogError.java new file mode 100644 index 00000000..a696998b --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdLogError.java @@ -0,0 +1,28 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.facade.SecurityFacade; + +/** + * Created by nelo on 19/4/16. + */ +public class CmdLogError extends CommandBase { + + private SecurityFacade security = SecurityFacade.getInstance(); + + private String error, device, user, android_version; + + public CmdLogError(String e, String d, String u, String a) + { + this.error = e; + this.device = d; + this.user = u; + this.android_version = a; + this.showError = false; + } + + @Override + protected void Execute() { + super.Execute(); + security.RegistrarLog(error, device, user, android_version); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdLogin.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdLogin.java new file mode 100644 index 00000000..5de30aeb --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdLogin.java @@ -0,0 +1,35 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.facade.SecurityFacade; + +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +public class CmdLogin extends CommandBase{ + + private String User; + private String Pass; + private SecurityFacade security = SecurityFacade.getInstance(); + private ClienteVentas Cliente; + + + public CmdLogin(String User, String Pass) + { + this.User = User; + this.Pass = Pass; + this.message = MyApplication.getContext().getString(R.string.error_login); + } + + @Override + protected void Execute() { + security.Login(User, Pass); + Cliente = ventas.ObtenerCliente(User, Pass); + } + + public ClienteVentas obtenerCliente() + { + return Cliente; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdModificarCliente.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdModificarCliente.java new file mode 100644 index 00000000..c9626a5d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdModificarCliente.java @@ -0,0 +1,27 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 24/03/15. + */ +public class CmdModificarCliente extends CommandBase { + + private ClienteVentas cliente; + + public CmdModificarCliente(ClienteVentas cv) + { + this.cliente = cv; + this.message = MyApplication.getContext().getString(R.string.error_cliente); + } + + @Override + protected void Execute() { + super.Execute(); + + ventas.ModificarCliente(cliente); + //setSuccesMessage(activity.getResources().getString(R.string.command_modificar_cliente_succes)); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdModificarPassword.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdModificarPassword.java new file mode 100644 index 00000000..9e5552d0 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdModificarPassword.java @@ -0,0 +1,30 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.facade.SecurityFacade; + +/** + * Created by nelo on 23/03/15. + */ +public class CmdModificarPassword extends CommandBase { + + private String password; + private int cid; + private SecurityFacade security = SecurityFacade.getInstance(); + + public CmdModificarPassword(String p, int c) + { + this.password = p; + this.cid = c; + this.message = MyApplication.getContext().getString(R.string.error_password); + } + + @Override + protected void Execute() { + super.Execute(); + + security.ModificarPassword(password, cid); + setSuccesMessage(activity.getResources().getString(R.string.command_modificar_password_succes)); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerAgencias.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerAgencias.java new file mode 100644 index 00000000..e51458f1 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerAgencias.java @@ -0,0 +1,45 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.Agencia; +import com.verdnatura.verdnaturaventas.model.Vista; + +import java.util.List; + +/** + * Created by nelo on 14/01/15. + */ +public class CmdObtenerAgencias extends CommandBase { + + private int Consignatario; + private String Fecha; + private List agencias; + private List vistas; + + public CmdObtenerAgencias(int c, String f) + { + this.Fecha = f; + this.Consignatario = c; + this.message = MyApplication.getContext().getResources().getString(R.string.error_agencias); + } + + @Override + protected void Execute() { + super.Execute(); + + vistas = ventas.ObtenerVistas(); + agencias = ventas.ObtenerAgencias(Fecha, Consignatario); + if(agencias.size() == 0) + setSuccesMessage(activity.getResources().getString(R.string.mensaje_no_hay_agencias)); + } + + public List getAgencias() + { + return agencias; + } + + public List getVistas() { + return vistas; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticuloBarcode.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticuloBarcode.java new file mode 100644 index 00000000..7fe9f29c --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticuloBarcode.java @@ -0,0 +1,38 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +/** + * Created by nelo on 12/01/15. + */ +public class CmdObtenerArticuloBarcode extends CommandBase { + + private int agencia, consignatario; + private String cadena = ""; + private String fecha; + private ArticuloVentasTags articulo; + + public CmdObtenerArticuloBarcode(String c, int a, int con, String f) + { + this.cadena = c; + this.fecha = f; + this.agencia = a; + this.consignatario = con; + this.message = MyApplication.getContext().getString(R.string.error_articulo); + } + + + @Override + protected void Execute() { + super.Execute(); + + articulo = ventas.ObtenerArticuloBarcode(fecha, consignatario, agencia, cadena, 0); + + } + + public ArticuloVentasTags getArticulo() { + return articulo; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticuloVenta.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticuloVenta.java new file mode 100644 index 00000000..79441f93 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticuloVenta.java @@ -0,0 +1,42 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.Tarifa; + +import java.util.List; + +/** + * Created by nelo on 13/03/15. + */ +public class CmdObtenerArticuloVenta extends CommandBase { + + private String fecha; + private int consignatario, agencia, tipo, itemId, warehouseId; + private ArticuloVentasTags articulo; + + public CmdObtenerArticuloVenta(String f, int c, int a, int t, int iid, int wid) + { + this.fecha = f; + this.consignatario = c; + this.agencia = a; + this.tipo = t; + this.itemId = iid; + this.warehouseId = wid; + this.message = MyApplication.getContext().getString(R.string.error_articulo); + } + + @Override + protected void Execute() { + super.Execute(); + + articulo = ventas.ObtenerArticuloVenta(fecha, consignatario, agencia, tipo, itemId, warehouseId); + + } + + public ArticuloVentasTags getArticulo() { + return articulo; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticulosCompradosUltimaSemana.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticulosCompradosUltimaSemana.java new file mode 100644 index 00000000..28b62330 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerArticulosCompradosUltimaSemana.java @@ -0,0 +1,24 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.List; + +/** + * Created by nelo on 12/06/15. + */ +public class CmdObtenerArticulosCompradosUltimaSemana extends CommandBase{ + + private List articulos; + + @Override + protected void Execute() { + super.Execute(); + showError = false; + articulos = ventas.ObtenerArticulosCompradosUltimaSemana(); + } + + public List getArticulos() { + return articulos; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerCliente.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerCliente.java new file mode 100644 index 00000000..7290c4c7 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerCliente.java @@ -0,0 +1,32 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 28/10/15. + */ +public class CmdObtenerCliente extends CommandBase { + + private ClienteVentas cliente; + private String user, pass; + + public CmdObtenerCliente(String u, String p) + { + this.user = u; + this.pass = p; + this.message = MyApplication.getContext().getString(R.string.error_login); + } + + + @Override + protected void Execute() { + super.Execute(); + cliente = ventas.ObtenerCliente(user, pass); + } + + public ClienteVentas getCliente() { + return cliente; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerClienteById.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerClienteById.java new file mode 100644 index 00000000..c786d86e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerClienteById.java @@ -0,0 +1,29 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 20/04/15. + */ +public class CmdObtenerClienteById extends CommandBase { + + private int Id_Cliente; + private ClienteVentas Cliente; + + + public CmdObtenerClienteById(int c) + { + this.Id_Cliente = c; + + } + + @Override + protected void Execute() { + Cliente = ventas.ObtenerClienteById(Id_Cliente); + } + + public ClienteVentas obtenerCliente() + { + return Cliente; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerCreditoRiesgo.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerCreditoRiesgo.java new file mode 100644 index 00000000..9915add1 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerCreditoRiesgo.java @@ -0,0 +1,29 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 14/05/15. + */ +public class CmdObtenerCreditoRiesgo extends CommandBase { + + private ClienteVentas cliente; + + public CmdObtenerCreditoRiesgo(ClienteVentas c){ + this.cliente = c; + this.message = MyApplication.getContext().getResources().getString(R.string.error_riesgo); + } + + @Override + protected void Execute() { + super.Execute(); + + cliente = ventas.ObtenerCreditoRiesgo(cliente); + } + + public ClienteVentas getCliente() { + return cliente; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerDatosComandoVoz.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerDatosComandoVoz.java new file mode 100644 index 00000000..e38befee --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerDatosComandoVoz.java @@ -0,0 +1,113 @@ +package com.verdnatura.verdnaturaventas.command; + +import android.content.res.Resources; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.model.Agencia; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.Consignatario; + +import java.util.List; + +/** + * Created by nelo on 8/05/15. + */ +public class CmdObtenerDatosComandoVoz extends CommandBase { + + private String texto, fecha; + private List agencias; + private List clientes; + private Agencia agencia; + private ClienteVentas cliente; + private String[] dias = new String[7]; + + + public CmdObtenerDatosComandoVoz(String t, String f) + { + texto = t; + fecha = f; + + } + + @Override + protected void Execute() { + super.Execute(); + + Resources res = activity.getResources(); + dias[0] = res.getString(R.string.sunday); + dias[1] = res.getString(R.string.monday); + dias[2] = res.getString(R.string.tuesday); + dias[3] = res.getString(R.string.wednesday); + dias[4] = res.getString(R.string.thursday); + dias[5] = res.getString(R.string.friday); + dias[6] = res.getString(R.string.saturday); + + String[] datos = texto.split(","); + for(int i = 0; i 0) + { + Consignatario con = null; + + for(Consignatario c : cliente.getConsignatarios()) + if(c.getPredeterminada() != 0) + { + con = c; + break; + } + + + agencias = ventas.ObtenerAgencias(fecha, con.getId_Consigna()); + for(Agencia a : agencias) + { + if(a.getAgencia().toLowerCase().equals(datos[3])) + { + agencia = a; + break; + } + } + + } + } + + } + + public Agencia getAgencia() { + return agencia; + } + + public ClienteVentas getCliente() { + return cliente; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidos.java new file mode 100644 index 00000000..7131b1ca --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidos.java @@ -0,0 +1,32 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.TicketRecepcion; + +import java.util.List; + +/** + * Created by nelo on 23/07/15. + */ +public class CmdObtenerPedidos extends CommandBase{ + + private int cliente; + private List pedidos; + + public CmdObtenerPedidos(int cid) + { + this.cliente = cid; + this.message = MyApplication.getContext().getString(R.string.error_pedidos); + } + + @Override + protected void Execute() { + super.Execute(); + pedidos = ventas.ObtenerPedidos(cliente); + } + + public List getPedidos() { + return pedidos; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidosPendientes.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidosPendientes.java new file mode 100644 index 00000000..5359cf05 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidosPendientes.java @@ -0,0 +1,33 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.OrderResumen; + +import java.util.List; + +/** + * Created by nelo on 10/11/15. + */ +public class CmdObtenerPedidosPendientes extends CommandBase { + + private int cliente; + private List orders; + + public CmdObtenerPedidosPendientes(int cliente){ + this.cliente = cliente; + this.message = MyApplication.getContext().getString(R.string.error_pedidos_pendientes); + } + + @Override + protected void Execute() { + super.Execute(); + + orders = ventas.ObtenerPedidosPendientes(cliente); + + } + + public List getOrders() { + return orders; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidosRealizados.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidosRealizados.java new file mode 100644 index 00000000..946303cc --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerPedidosRealizados.java @@ -0,0 +1,31 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.OrderImprimir; + +import java.util.List; + +/** + * Created by nelo on 30/11/15. + */ +public class CmdObtenerPedidosRealizados extends CommandBase { + + private List orders; + + public CmdObtenerPedidosRealizados() + { + this.message = MyApplication.getContext().getString(R.string.error_obtener_imprimir); + } + + @Override + protected void Execute() { + super.Execute(); + + orders = ventas.ObtenerPedidosRealizados(); + } + + public List getOrders() { + return orders; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerStock.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerStock.java new file mode 100644 index 00000000..1c75ccf8 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerStock.java @@ -0,0 +1,41 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.List; + +/** + * Created by nelo on 20/01/15. + */ +public class CmdObtenerStock extends CommandBase { + + private String fecha, cadena; + private int consignatario, agencia, tipo; + private List articulos; + + public CmdObtenerStock(String f, int c, int a, int t, String cad) + { + this.fecha = f; + this.consignatario = c; + this.agencia = a; + this.tipo = t; + this.cadena = cad; + if(cadena.equals("")) + cadena = null; + this.message = MyApplication.getContext().getString(R.string.error_stock); + } + + @Override + protected void Execute() { + super.Execute(); + + articulos = ventas.ObtenerStock(fecha, consignatario, agencia, tipo, cadena); + } + + public List getArticulos() { + return articulos; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerTipos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerTipos.java new file mode 100644 index 00000000..8dd4632c --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtenerTipos.java @@ -0,0 +1,45 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.Tipo; + +import java.util.List; + +/** + * Created by nelo on 12/01/15. + */ +public class CmdObtenerTipos extends CommandBase { + + private List tipos; + private int agencia, consignatario, reino; + private String cadena = ""; + private String fecha; + private ArticuloVentasTags articulo; + + public CmdObtenerTipos(int r, String c, int a, int con, String f) + { + this.reino = r; + this.cadena = c; + this.fecha = f; + this.agencia = a; + this.consignatario = con; + this.message = MyApplication.getContext().getString(R.string.error_familias); + } + + + @Override + protected void Execute() { + super.Execute(); + tipos = ventas.BuscarTipos(cadena, agencia, consignatario, fecha, reino); + + } + + public List getTipos() + { + return tipos; + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtnerDatosPasarBanco.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtnerDatosPasarBanco.java new file mode 100644 index 00000000..547794a2 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdObtnerDatosPasarBanco.java @@ -0,0 +1,38 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.DatosPasarBanco; +import com.verdnatura.verdnaturaventas.model.Order; +import com.verdnatura.verdnaturaventas.model.ParamsBanco; + +/** + * Created by nelo on 15/05/15. + */ +public class CmdObtnerDatosPasarBanco extends CommandBase { + + private double cantidad; + private String fecha; + private int cliente; + private ParamsBanco datos; + + public CmdObtnerDatosPasarBanco(double c, String f, int cl) + { + this.cantidad = c; + this.fecha = f; + this.cliente = cl; + this.message = MyApplication.getContext().getString(R.string.error_banco); + } + + @Override + protected void Execute() { + super.Execute(); + + datos = ventas.ObtenerDatosPasarBanco(cantidad, fecha, cliente); + + } + + public ParamsBanco getDatos() { + return datos; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRecalcularPrecios.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRecalcularPrecios.java new file mode 100644 index 00000000..0606e203 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRecalcularPrecios.java @@ -0,0 +1,35 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.model.Order; + +/** + * Created by nelo on 17/03/15. + */ +public class CmdRecalcularPrecios extends CommandBase { + + private Order order, nOrder; + private ControllerPedido pedido; + + public CmdRecalcularPrecios(ControllerPedido p) + { + this.pedido = p; + this.message = MyApplication.getContext().getString(R.string.error_recalcular); + } + + @Override + protected void Execute() { + super.Execute(); + + order = pedido.rellenarDatosOrder(); + + nOrder = ventas.RecalcularPrecios(order); + + } + + public Order getOrder() { + return nOrder; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRecuperarPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRecuperarPedido.java new file mode 100644 index 00000000..fad966e9 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRecuperarPedido.java @@ -0,0 +1,32 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.Order; +import com.verdnatura.verdnaturaventas.model.OrderResumen; + +/** + * Created by nelo on 11/11/15. + */ +public class CmdRecuperarPedido extends CommandBase { + + private OrderResumen orderResumen; + private Order order; + + public CmdRecuperarPedido(OrderResumen o) + { + orderResumen = o; + this.message = MyApplication.getContext().getString(R.string.error_recuperar_pedido); + } + + @Override + protected void Execute() { + super.Execute(); + + order = ventas.RecuperarOrder(orderResumen); + } + + public Order getOrder() { + return order; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRegistrarGCM.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRegistrarGCM.java new file mode 100644 index 00000000..6bc85106 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRegistrarGCM.java @@ -0,0 +1,62 @@ +package com.verdnatura.verdnaturaventas.command; + +import android.content.Context; +import android.util.Log; + +import com.google.android.gms.common.ConnectionResult; +import com.google.android.gms.common.GooglePlayServicesUtil; +//import com.google.android.gms.gcm.GoogleCloudMessaging; +import com.verdnatura.verdnaturaventas.MyApplication; + + +import java.io.IOException; + +public class CmdRegistrarGCM extends CommandBase{ + + private static final int PLAY_SERVICES_RESOLUTION_REQUEST = 9000; + //private GoogleCloudMessaging gcm; + private int cliente; + private static final String SENDER_ID = "207330605892"; + + public CmdRegistrarGCM(int c) + { + cliente = c; + showError = false; + } + + @Override + protected void Execute() { + super.Execute(); +/* + if(checkPlayServices(MyApplication.getContext())) + { + gcm = GoogleCloudMessaging.getInstance(MyApplication.getContext()); + + String regid = null; + try { + regid = gcm.register(SENDER_ID); + ventas.RegistrarGCM(cliente, regid); + } catch (IOException e) { + Log.d("GCM", "Error registro en GCM"); + } + + }*/ + + } + + private boolean checkPlayServices(Context context) { + int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(activity); + if (resultCode != ConnectionResult.SUCCESS) + { + if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) + { + GooglePlayServicesUtil.getErrorDialog(resultCode, activity, PLAY_SERVICES_RESOLUTION_REQUEST).show(); + } else { + Log.i("Play Services", "Dispositivo no soportado."); + } + return false; + } + return true; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRellenarArticulos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRellenarArticulos.java new file mode 100644 index 00000000..cada3f2d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdRellenarArticulos.java @@ -0,0 +1,27 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.List; + +/** + * Created by nelo on 22/06/15. + */ +public class CmdRellenarArticulos extends CommandBase { + + private List articulos; + + + + @Override + protected void Execute() { + super.Execute(); + + //articulos = (List) session.getValue(Static.ARTICULOS_VENDIDOS); + + } + + public List getArticulos() { + return articulos; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdSplitOrder.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdSplitOrder.java new file mode 100644 index 00000000..b5470d28 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdSplitOrder.java @@ -0,0 +1,38 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.Order; + +/** + * Created by nelo on 12/05/15. + */ +public class CmdSplitOrder extends CommandBase { + + private Order order; + private ControllerPedido pedido; + + + public CmdSplitOrder(Order o, ControllerPedido p) + { + this.order = o; + this.pedido = p; + this.message = MyApplication.getContext().getString(R.string.error_split_order); + } + + @Override + protected void Execute() { + super.Execute(); + + order = ventas.SplitOrder(order); + ClienteVentas cliente = ventas.ObtenerCreditoRiesgo(order.getCliente()); + order.setCliente(cliente); + } + + public Order getOrder() { + return order; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdTransactionEnd.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdTransactionEnd.java new file mode 100644 index 00000000..34ee8d3c --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdTransactionEnd.java @@ -0,0 +1,28 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 21/05/15. + */ +public class CmdTransactionEnd extends CommandBase { + + private String status; + private int transaction; + + public CmdTransactionEnd(String s, int t) + { + this.status = s; + this.transaction = t; + this.message = MyApplication.getContext().getString(R.string.error_transaccion); + } + + @Override + protected void Execute() { + super.Execute(); + + ventas.FinalizarTransaccion(status, transaction); + + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdVerificarAgencia.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdVerificarAgencia.java new file mode 100644 index 00000000..8dd12742 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CmdVerificarAgencia.java @@ -0,0 +1,32 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 26/11/15. + */ +public class CmdVerificarAgencia extends CommandBase { + + private int consigna, agencia; + private String fecha; + private boolean agenciaValida; + + public CmdVerificarAgencia(int consigna, int agencia, String fecha) + { + this.consigna = consigna; + this.agencia = agencia; + this.fecha = fecha; + this.message = MyApplication.getContext().getString(R.string.error_verificar_agencia); + } + + @Override + protected void Execute() { + super.Execute(); + agenciaValida = ventas.VerificarAgencia(consigna, agencia, fecha); + } + + public boolean isAgenciaValida() { + return agenciaValida; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CommandBase.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CommandBase.java new file mode 100644 index 00000000..8bf60692 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/command/CommandBase.java @@ -0,0 +1,11 @@ +package com.verdnatura.verdnaturaventas.command; + +import com.verdnatura.verdnaturaventas.facade.AlmacenFacade; +import com.verdnatura.verdnaturaventas.facade.VentasFacade; + +public class CommandBase extends com.nelosan.baselibrary.command.CommandBase{ + + protected VentasFacade ventas = VentasFacade.getInstance(); + protected AlmacenFacade almacen = AlmacenFacade.getInstance(); + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/comparador/ComparadorAgencias.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/comparador/ComparadorAgencias.java new file mode 100644 index 00000000..6ebf50de --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/comparador/ComparadorAgencias.java @@ -0,0 +1,19 @@ +package com.verdnatura.verdnaturaventas.comparador; + +import com.verdnatura.verdnaturaventas.model.Agencia; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.Comparator; + +/** + * Created by nelo on 25/02/15. + */ +public class ComparadorAgencias implements Comparator { + + @Override + public int compare(Agencia agencia1, Agencia agencia2) { + + return agencia1.getAgencia().compareTo(agencia2.getAgencia()); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/comparador/ComparadorArticulos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/comparador/ComparadorArticulos.java new file mode 100644 index 00000000..249b9a7d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/comparador/ComparadorArticulos.java @@ -0,0 +1,38 @@ +package com.verdnatura.verdnaturaventas.comparador; + +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.Comparator; + +/** + * Created by nelo on 22/01/15. + */ +public class ComparadorArticulos implements Comparator { + + public static final int ARTICLE = 1; + + private int valor; + + public ComparadorArticulos(int v) + { + this.valor = v; + } + + @Override + public int compare(ArticuloVentasTags articulo1, ArticuloVentasTags articulo2) { + + int i = 0; + + switch(valor) + { + + case ARTICLE: + i = articulo1.getArticle().compareTo(articulo2.getArticle()); + break; + + } + + return i; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerArticulo.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerArticulo.java new file mode 100644 index 00000000..2f788aff --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerArticulo.java @@ -0,0 +1,57 @@ +package com.verdnatura.verdnaturaventas.controller; + +import android.content.Intent; +import android.os.Bundle; + +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.ArticuloDetalle; +import com.verdnatura.verdnaturaventas.core.Colores; +import com.verdnatura.verdnaturaventas.core.ItemArticuloRelacionado; +import com.verdnatura.verdnaturaventas.dialog.DialogComprar; +import com.verdnatura.verdnaturaventas.fragment.FragmentDetalleArticulo; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 16/09/15. + */ +public class ControllerArticulo{ + + public static List mostrarArticulosRelacionados(List articulos, ActivityBase activity) + { + List items = new ArrayList<>(); + + if (articulos != null) { + for (final ArticuloVentasTags a : articulos) { + ItemArticuloRelacionado item = new ItemArticuloRelacionado(activity); + item.setData(a); + item.setColorPrice(Colores.getColor(a.getReino())); + items.add(item); + } + } + + return items; + } + + public static void generarDialog(ArticuloVentasTags a, ActivityBase activity) + { + DialogComprar dialog = new DialogComprar(); + Bundle bundle = new Bundle(); + bundle.putParcelable(FragmentDetalleArticulo.ARTICULO, a); + dialog.setArguments(bundle); + dialog.show(activity.getFragmentManager(), "tagDialog"); + } + + public static void verDetalle(ArticuloVentasTags a, ActivityBase activity) + { + if(activity instanceof ArticuloDetalle) + activity.finish(); + Intent i = new Intent(activity, ArticuloDetalle.class); + i.putExtra(FragmentDetalleArticulo.ARTICULO, a); + activity.startActivity(i); + + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerPedido.java new file mode 100644 index 00000000..40fc867e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerPedido.java @@ -0,0 +1,328 @@ +package com.verdnatura.verdnaturaventas.controller; + +import android.content.Intent; +import android.os.Bundle; +import android.widget.Toast; + +import com.nelosan.baselibrary.MyApplication; +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.Main; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.core.FileManager; +import com.verdnatura.verdnaturaventas.core.Format; +import com.verdnatura.verdnaturaventas.dialog.DialogFinalizarPedido; +import com.verdnatura.verdnaturaventas.fragment.FragmentNavegador; +import com.verdnatura.verdnaturaventas.model.Agencia; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.Consignatario; +import com.verdnatura.verdnaturaventas.model.DatosCompra; +import com.verdnatura.verdnaturaventas.model.Order; +import com.verdnatura.verdnaturaventas.model.OrderDiference; +import com.verdnatura.verdnaturaventas.model.OrderRow; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; + +/** + * Created by nelo on 30/01/15. + */ +public class ControllerPedido{ + + private Order order; + private ActivityBase activity; + + public static final String CALLBACK_PAGO_OK = "http://ok/"; + public static final String CALLBACK_PAGO_ERROR = "http://error/"; + + public ControllerPedido(ActivityBase a) { + activity = a; + order = (Order) FileManager.recuperarFichero(FileManager.PEDIO, Order.class, MyApplication.getContext()); + if(order == null) { + order = new Order(); + Calendar c = java.util.Calendar.getInstance(); + order.setCreateDay(c.get(Calendar.DAY_OF_MONTH)); + order.setCreateMonth(c.get(Calendar.MONTH)); + order.setCreateYear(c.get(Calendar.YEAR)); + FileManager.borrarFichero(FileManager.PEDIO, activity); + } + + } + + public double getTotal() + { + double total = 0.0; + for(OrderRow row : order.getRows()) + total += row.getAmount() * row.getTarifa().getPrice(); + + String totS = Format.df.format(total).replace(",", "."); + + return Double.valueOf(totS); + } + + public void comprar(DatosCompra dato) + { + OrderRow row = buscarRow(dato); + if(row == null) { + row = new OrderRow(); + row.setTarifa(dato.getTarifa()); + row.setAmount(dato.getCantidad()); + ArticuloVentasTags a = dato.getArticulo(); + a.setArticulosSimilares(null); + row.setArticulo(a); + order.getRows().add(row); + } + else + { + row.setAmount(row.getAmount() + dato.getCantidad()); + } + + } + + public void borrarCompra(DatosCompra dato) + { + OrderRow row = buscarRow(dato); + if(row != null) { + row.setAmount(row.getAmount() - dato.getCantidad()); + if(row.getAmount() == 0) + order.getRows().remove(row); + } + + } + + public OrderRow buscarRow(DatosCompra dato) + { + for(OrderRow row : order.getRows()) + if(row.getArticulo().getId_Article() == dato.getArticulo().getId_Article() + && row.getTarifa() == dato.getTarifa()) + return row; + + return null; + } + + public List getConsignatarios() + { + ClienteVentas cliente = order.getCliente(); + if(cliente == null) { + ControllerPreferences preferences = new ControllerPreferences(); + cliente = preferences.recuperarCliente(); + } + return cliente.getConsignatarios(); + } + + public Consignatario getConsignatarioDefecto() + { + ControllerPreferences preferences = new ControllerPreferences(); + int savedConsignatario = preferences.getconsignatarioDefecto(); + Consignatario con = null, pred = null; + List consignatarios = getConsignatarios(); + if(consignatarios != null) + for(Consignatario c : consignatarios) { + if (consignatarioDefecto(c, savedConsignatario)) { + con = c; + break; + } + if (c.getPredeterminada() != 0) + pred = c; + } + if(con == null) con = pred; + return con; + } + + private boolean consignatarioDefecto(Consignatario consignatario, int cons){ + if(cons != 0 && consignatario.getId_Consigna() == cons) + return true; + return false; + } + + public Order rellenarDatosOrder() + { + order.setCustomer_id(order.getCliente().getId_Cliente()); + order.setDelivery_method_id(order.getAgencia().getVista()); + order.setAgency_id(order.getAgencia().getId_Agencia()); + order.setAddress_id(order.getConsignatarioActivo().getId_Consigna()); + order.setFecha(order.getCalendario().getFormatFecha()); + order.setSource_app("ANDROID"); + return order; + } + + public List getDiferencias(List rows) + { + List listDiference = new ArrayList(); + + for(OrderRow or : rows) { + for (OrderRow r : order.getRows()) { + if(or.getArticulo().getId_Article() == r.getArticulo().getId_Article() + && or.getTarifa().getWarehouse_id() == r.getTarifa().getWarehouse_id() + && or.getTarifa().getRate() == r.getTarifa().getRate()) + { + OrderDiference diference = new OrderDiference(); + if(or.getTarifa().getPrice() != r.getTarifa().getPrice()) + { + diference.setPrice(or.getTarifa().getPrice()); + diference.setOldPrice(r.getTarifa().getPrice()); + //diference.setArticulo(or.getArticulo().getArticle()+" "+or.getArticulo().getMedida()+" "+or.getArticulo().getColor()); + diference.setEscribirPrecio(true); + } + + if(or.getAmount() < r.getAmount()) + { + diference.setCantidad((int)or.getArticulo().getAvailable()); + diference.setOldCantidad((int)r.getAmount()); + //diference.setArticulo(or.getArticulo().getArticle()+" "+or.getArticulo().getMedida()+" "+or.getArticulo().getColor()); + diference.setEscribirDisponible(true); + } + + if(!diference.getArticulo().equals("")) + listDiference.add(diference); + } + } + } + + return listDiference; + } + + public void restablecerValores() + { + order.setAgencia(order.getAgenciaAntigua()); + order.setAgenciaAntigua(null); + + if(order.getCalendario().getFechaAntigua() != 0) + order.getCalendario().setFecha(order.getCalendario().getFechaAntigua()); + + order.getCalendario().setFechaAntigua(0); + } + + public boolean comprobarSeleccionCliente(boolean show, ClienteVentas cliente) + { + if(cliente.getTipo().equals("trabajador") && order.getCliente() == null && order.getConsignatarioActivo() == null) { + if(show) + Toast.makeText(activity, activity.getString(R.string.select_customer), Toast.LENGTH_SHORT).show(); + return false; + } + return true; + } + + public void pagar(double cantidad) + { + Bundle bundle = new Bundle(); + bundle.putDouble(FragmentNavegador.CANTIDAD, cantidad); + activity.cerrarDrawerDerecho(); + activity.cambiarFragment(new FragmentNavegador(), bundle); + } + + /******************GETTERS Y SETTERS***************/ + + public void setAgencia(Agencia a){ + order.setAgencia(a); + guardarOrder(); + } + + public void cambiarFecha(int year, int month, int day){ + order.getCalendario().guardarFechaAntigua(); + order.getCalendario().setFecha(year, month, day); + guardarOrder(); + } + + public Order getOrder() { + return order; + } + + public void setOrder(Order order) { + this.order = order; + } + + public void guardarOrder() + { + FileManager.guardarFichero(FileManager.PEDIO, order, activity); + } + + public void setCliente(ClienteVentas c) + { + order.setCliente(c); + order.setConsignatarioActivo(getConsignatarioDefecto()); + guardarOrder(); + } + + public void setConsignatarioActivo(Consignatario c){ + order.setConsignatarioActivo(c); + guardarOrder(); + } + + public void setTransaction(String trans){ + order.setTransactionOk(trans); + guardarOrder(); + } + + public void showFinalizar(boolean deuda, boolean pagado) + { + DialogFinalizarPedido dialog = new DialogFinalizarPedido(); + Bundle bundle = new Bundle(); + bundle.putBoolean(DialogFinalizarPedido.IS_DEUDA, deuda); + bundle.putBoolean(DialogFinalizarPedido.PAGADO, pagado); + dialog.setArguments(bundle); + try { + dialog.show(activity.getFragmentManager(), "tagFinalizarPedido"); + }catch (Exception e){ + Toast.makeText(this.activity.getBaseContext(),"Error al finalizar,vuelva a intentar.",Toast.LENGTH_LONG).show(); + } + + } + + public void reiniciarPedido() + { + activity.startActivity(new Intent(activity, Main.class)); + ControllerPreferences preferences = new ControllerPreferences(); + FileManager.borrarFichero(FileManager.PEDIO, activity); + Agencia agencia = order.getAgencia(); + order = new Order(); + ClienteVentas cliente = preferences.recuperarCliente(); + order.getCalendario().setFecha(Calendar.getInstance().getTimeInMillis()); + order.setConsignatarioActivo(getConsignatarioDefecto()); + if(!cliente.getTipo().equals("trabajador")) { + order.setCliente(cliente); + order.setAgencia(agencia); + } + guardarOrder(); + } + + public void incrementarCantidad(OrderRow row, int cantidad) + { + row.setAmount(row.getAmount() + cantidad); + } + + public void borrarRow(OrderRow row) + { + if(row != null) { + order.getRows().remove(row); + guardarOrder(); + } + } + + public void setNotas(String notas) + { + order.setNotas(notas); + guardarOrder(); + } + + public void fechaToCalendar(Order order, SimpleDateFormat dateFormat){ + Date dateObj = null; + try { + dateObj = dateFormat.parse(order.getFecha()); + Calendar c = Calendar.getInstance(); + c.setTime(dateObj); + order.getCalendario().setFecha(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH)); + order.setCreateDay(c.get(Calendar.DAY_OF_MONTH)); + order.setCreateMonth(c.get(Calendar.MONTH)); + order.setCreateYear(c.get(Calendar.YEAR)); + } catch (ParseException e) { + e.printStackTrace(); + } + + } +} + diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerPreferences.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerPreferences.java new file mode 100644 index 00000000..e98bd6a5 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerPreferences.java @@ -0,0 +1,153 @@ +package com.verdnatura.verdnaturaventas.controller; + +import android.content.Context; +import android.content.SharedPreferences; +import android.preference.PreferenceManager; +import android.util.Base64; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.core.FileManager; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 7/08/15. + */ +public class ControllerPreferences { + + public static final String FILE_CLIENTE = "cliente.txt"; + + private SharedPreferences prefs; + private String user = ""; + private String pass = ""; + private Context context; + + public ControllerPreferences() { + context = MyApplication.getContext(); + prefs = PreferenceManager.getDefaultSharedPreferences(context); + recuperarUsuario(); + } + + public boolean usuarioLogueado() + { + String user = prefs.getString("user", ""); + if(user != null && !user.equals("")) + return true; + return false; + } + + public void recuperarUsuario() + { + user = prefs.getString("user", ""); + pass = prefs.getString("password", ""); + byte[] password = Base64.decode(pass.getBytes(), Base64.DEFAULT); + pass = new String(password); + } + + public void guardarUsuario(String user, String pass, ClienteVentas cliente) + { + SharedPreferences.Editor editor = prefs.edit(); + editor.putString("user", user); + String password = codificarBase64(pass); + editor.putString("password", password); + editor.commit(); + guardarCliente(cliente); + this.user = user; + this.pass = pass; + } + + public String codificarBase64(String cadena) + { + byte[] encodedBytes = Base64.encode(cadena.getBytes(), Base64.DEFAULT); + return new String(encodedBytes); + } + + public void borrarUsuario() + { + SharedPreferences.Editor editor = prefs.edit(); + editor.remove("user"); + editor.remove("password"); + editor.remove("consignatario"); + editor.commit(); + FileManager.borrarFichero(FILE_CLIENTE, context); + } + + public void guardarCliente(ClienteVentas cliente) + { + FileManager.guardarFichero(FILE_CLIENTE, cliente, context); + } + + public ClienteVentas recuperarCliente() + { + return (ClienteVentas) FileManager.recuperarFichero(FILE_CLIENTE, ClienteVentas.class, context); + } + + public String getUser() { + return user; + } + + public String getPass() { + return pass; + } + + public boolean verPrecios() + { + return prefs.getBoolean("precios", true); + } + + public void setVerPrecios() + { + SharedPreferences.Editor editor = prefs.edit(); + boolean precios = prefs.getBoolean("precios", true); + editor.putBoolean("precios", !precios); + editor.commit(); + } + + public boolean isNumeric() + { + return prefs.getBoolean("keyboard", false); + } + + public void setIsNumeric() + { + SharedPreferences.Editor editor = prefs.edit(); + boolean keyboard = prefs.getBoolean("keyboard", false); + editor.putBoolean("keyboard", !keyboard); + editor.commit(); + } + + public boolean telefonoRegistrado() + { + return prefs.getBoolean("registrado", false); + } + + public void registrarTelefono() + { + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean("registrado", true); + editor.commit(); + } + + public boolean recibirNotificaciones() + { + return prefs.getBoolean("notificaciones", true); + } + + public void setRecibirNotificaciones() + { + boolean recibir = prefs.getBoolean("notificaciones", true); + SharedPreferences.Editor editor = prefs.edit(); + editor.putBoolean("notificaciones", !recibir); + editor.commit(); + } + + public void saveConsignatarioDefecto(int consignatario){ + SharedPreferences.Editor editor = prefs.edit(); + editor.putInt("consignatario", consignatario); + editor.commit(); + } + + public int getconsignatarioDefecto(){ + return prefs.getInt("consignatario", 0); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerRecuperarPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerRecuperarPedido.java new file mode 100644 index 00000000..5ebc4f16 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/controller/ControllerRecuperarPedido.java @@ -0,0 +1,106 @@ +package com.verdnatura.verdnaturaventas.controller; + +import android.app.AlertDialog; +import android.content.DialogInterface; +import android.content.Intent; + +import com.nelosan.baselibrary.command.CommandBase; +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.Agencias; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdRecuperarPedido; +import com.verdnatura.verdnaturaventas.dialog.DialogCalendarMain; +import com.verdnatura.verdnaturaventas.fragment.FragmentMain; +import com.verdnatura.verdnaturaventas.fragment.FragmentPreciosRecalculados; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.Order; + +import java.text.SimpleDateFormat; + +/** + * Created by nelo on 19/11/15. + */ +public class ControllerRecuperarPedido { + + public static void alertaFecha(final ActivityBase activity) + { + /** SI LA FECHA ES ANTERIOR AVISAMOS **/ + + AlertDialog.Builder b = new AlertDialog.Builder(activity); + b.setMessage(activity.getString(R.string.dialog_fecha_pedido_incorrecta)); + b.setNeutralButton(activity.getString(R.string.dialog_fecha_pedido_incorrecta_borrar_pedido), null); + b.setPositiveButton(activity.getResources().getString(R.string.dialog_fecha_pedido_incorrecta_cambiar_fecha), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + DialogCalendarMain calendar = new DialogCalendarMain(); + calendar.show(activity.getFragmentManager(), "calendar"); + } + }); + b.setTitle(activity.getResources().getString(com.nelosan.baselibrary.R.string.aviso)); + b.show(); + } + + public static void realiceRecuperarPedido(ActivityBase activity, CommandBase cmd) + { + Order order = ((CmdRecuperarPedido)cmd).getOrder(); + establecerPedido(activity, order); + if(order.getAgencia() == null) + alertaAgencia(activity); + else if(order.getRows().size() > 0){ + activity.cambiarFragment(new FragmentPreciosRecalculados()); + } + else + { + activity.cambiarFragment(new FragmentMain()); + } + + } + + public static void alertaAgencia(final ActivityBase activity) + { + /** SI LA AGENCIA ES NULL AVISAMOS **/ + + AlertDialog.Builder b = new AlertDialog.Builder(activity); + b.setMessage(activity.getString(R.string.dialog_agencia_pedido_incorrecta)); + b.setNeutralButton(activity.getString(R.string.cancelar), null); + b.setPositiveButton(activity.getResources().getString(R.string.dialog_fecha_pedido_incorrecta_cambiar_agencia), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + activity.startActivity(new Intent(activity, Agencias.class)); + } + }); + b.setTitle(activity.getResources().getString(com.nelosan.baselibrary.R.string.aviso)); + b.show(); + } + + public static void establecerPedido(ActivityBase activity, Order order) + { + ControllerPedido pedido = new ControllerPedido(activity); + ControllerPreferences preferences = new ControllerPreferences(); + ClienteVentas cliente = preferences.recuperarCliente(); + order.setCliente(cliente); + pedido.setOrder(order); + pedido.fechaToCalendar(order, new SimpleDateFormat("yyyy-MM-dd")); + pedido.guardarOrder(); + activity.showTotalPedido(); + activity.showCarritoRows(); + } + + public static void alertaPedidoCambiado(final ActivityBase activity) + { + /** SI LA AGENCIA ES NULL AVISAMOS **/ + + AlertDialog.Builder b = new AlertDialog.Builder(activity); + b.setMessage(activity.getString(R.string.dialog_agencia_pedido_incorrecta)); + b.setNeutralButton(activity.getString(R.string.cancelar), null); + b.setPositiveButton(activity.getResources().getString(R.string.dialog_fecha_pedido_incorrecta_cambiar_agencia), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + activity.startActivity(new Intent(activity, Agencias.class)); + } + }); + b.setTitle(activity.getResources().getString(com.nelosan.baselibrary.R.string.aviso)); + b.show(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Colores.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Colores.java new file mode 100644 index 00000000..e8febc78 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Colores.java @@ -0,0 +1,85 @@ +package com.verdnatura.verdnaturaventas.core; + +import android.content.Context; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.Reino; + +/** + * Created by nelo on 16/03/15. + */ +public class Colores { + + public static int getColor(int reino) + { + int color = 0; + Context context = MyApplication.getContext(); + + switch(reino) + { + case Static.FLORES: + color = context.getResources().getColor(R.color.flowers); + break; + + case Static.ARTIFICIAL: + color = context.getResources().getColor(R.color.artificial); + break; + + case Static.COMPLEMENTOS: + color = context.getResources().getColor(R.color.supplements); + break; + + case Static.PLANTAS: + color = context.getResources().getColor(R.color.plants); + break; + + case Static.VERDES: + color = context.getResources().getColor(R.color.greens); + break; + + case Static.CONFECCION: + color = context.getResources().getColor(R.color.manufacturing); + break; + } + + return color; + } + + public static int getColorDark(int reino) + { + int color = 0; + int dark = reino * 11; + Context context = MyApplication.getContext(); + + switch(dark) + { + case Static.FLORES_DARK: + color = context.getResources().getColor(R.color.flowers_dark); + break; + + case Static.ARTIFICIAL_DARK: + color = context.getResources().getColor(R.color.artificial_dark); + break; + + case Static.COMPLEMENTOS_DARK: + color = context.getResources().getColor(R.color.supplements_dark); + break; + + case Static.PLANTAS_DARK: + color = context.getResources().getColor(R.color.plants_dark); + break; + + case Static.VERDES_DARK: + color = context.getResources().getColor(R.color.greens_dark); + break; + + case Static.CONFECCION_DARK: + color = context.getResources().getColor(R.color.manufacturing_dark); + break; + } + + return color; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/DateControll.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/DateControll.java new file mode 100644 index 00000000..64eeef98 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/DateControll.java @@ -0,0 +1,198 @@ +package com.verdnatura.verdnaturaventas.core; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.Locale; + +/** + * Created by nelo on 12/01/15. + */ +public class DateControll { + + private java.util.Calendar calendario; + private int ActualDay; + private long fechaAntigua = 0; + + + public DateControll() + { + calendario = java.util.Calendar.getInstance(); + calendario.add(Calendar.DAY_OF_MONTH, 1); + ActualDay = calendario.getActualMaximum(Calendar.DAY_OF_MONTH); + } + + public String getDayOfWeek() + { + int dayOfWeek = calendario.get(java.util.Calendar.DAY_OF_WEEK); + + if (java.util.Calendar.MONDAY == dayOfWeek) { + return MyApplication.getContext().getResources().getString(R.string.calendar_monday); + } else if (java.util.Calendar.TUESDAY == dayOfWeek) { + return MyApplication.getContext().getResources().getString(R.string.calendar_tuesday); + } else if (java.util.Calendar.WEDNESDAY == dayOfWeek) { + return MyApplication.getContext().getResources().getString(R.string.calendar_wednesday); + } else if (java.util.Calendar.THURSDAY == dayOfWeek) { + return MyApplication.getContext().getResources().getString(R.string.calendar_thursday); + } else if (java.util.Calendar.FRIDAY == dayOfWeek) { + return MyApplication.getContext().getResources().getString(R.string.calendar_friday); + } else if (java.util.Calendar.SATURDAY == dayOfWeek) { + return MyApplication.getContext().getResources().getString(R.string.calendar_saturday); + } else if (java.util.Calendar.SUNDAY == dayOfWeek) { + return MyApplication.getContext().getResources().getString(R.string.calendar_sunday); + } + + return ""; + } + + public String getTextMonth() + { + int month = calendario.get(java.util.Calendar.MONTH); + + if(java.util.Calendar.JANUARY == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_january); + else if(java.util.Calendar.FEBRUARY == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_february); + else if(java.util.Calendar.MARCH == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_march); + else if(java.util.Calendar.APRIL == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_april); + else if(java.util.Calendar.MAY == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_may); + else if(java.util.Calendar.JUNE == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_june); + else if(java.util.Calendar.JULY == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_july); + else if(java.util.Calendar.AUGUST == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_august); + else if(java.util.Calendar.SEPTEMBER == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_september); + else if(java.util.Calendar.OCTOBER == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_october); + else if(java.util.Calendar.NOVEMBER == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_november); + else if(java.util.Calendar.DECEMBER == month) + return MyApplication.getContext().getResources().getString(R.string.calendar_december); + + return ""; + } + + + public String getTextoFecha() + { + return getDayOfWeek() + ", "+ calendario.get(Calendar.DAY_OF_MONTH)+" de "+getTextMonth(); + } + + public String getFormatFecha() + { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + return sdf.format(calendario.getTime()); + } + + public Date stringToDate(String stringDate, String dateformat){ + DateFormat format = new SimpleDateFormat(dateformat, Locale.ENGLISH); + Date date = null; + try { + date = format.parse(stringDate); + } catch (ParseException e) { + e.printStackTrace(); + } + return date; + } + + public String dateToString(Date date, String dateformat){ + SimpleDateFormat df = new SimpleDateFormat(dateformat); + String formattedDate = df.format(date); + return formattedDate; + } + + public String getNow(){ + Calendar c = Calendar.getInstance(); + String date = dateToString(c.getTime(), "yyyy-MM-dd"); + return date; + } + + public long getFechaAntigua() + { + return fechaAntigua; + } + + public void setFechaAntigua(long fechaAntigua) { + this.fechaAntigua = fechaAntigua; + } + + public void guardarFechaAntigua() + { + fechaAntigua = calendario.getTimeInMillis(); + } + + public int getYear() + { + return calendario.get(Calendar.YEAR); + } + + public int getMonth() + { + return calendario.get(Calendar.MONTH); + } + + public int getDay() + { + return calendario.get(Calendar.DAY_OF_MONTH); + } + + public void setFecha(int year, int month, int day) + { + calendario.set(year, month, day); + } + + public void setFecha(long fecha) + { + calendario.setTimeInMillis(fecha); + } + + public Calendar getCalendario() + { + return calendario; + } + + public int getActualDay() + { + return ActualDay; + } + + public boolean isDiaMenor(int year, int month, int day) + { + Calendar c = Calendar.getInstance(); + long today = c.getTimeInMillis(); + c.set(year, month, day); + long fecha = c.getTimeInMillis(); + if(fecha < today) + return true; + else + return false; + + } + + public void setNextDateByDay(int day) + { + calendario.setTime(new Date()); + while(day != calendario.get(Calendar.DAY_OF_WEEK)) + { + calendario.add(Calendar.DATE, 1); + } + + } + + public Date addDays(int days, Date date){ + Calendar c = Calendar.getInstance(); + c.setTime(date); + c.add(Calendar.DATE, days); + return c.getTime(); + } +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ErrorReporter.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ErrorReporter.java new file mode 100644 index 00000000..e0583a8d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ErrorReporter.java @@ -0,0 +1,38 @@ +package com.verdnatura.verdnaturaventas.core; + + +import org.acra.collector.CrashReportData; +import org.acra.sender.ReportSender; +import org.acra.sender.ReportSenderException; + +public class ErrorReporter implements ReportSender { + + protected String user; + protected String pass; + + public ErrorReporter(String user, String pass){ + this.user = user; + this.pass = pass; + } + + @Override + public void send(CrashReportData report) throws ReportSenderException { + + /*ClienteVentas cliente = (ClienteVentas) Session.getInstance().getValue(Static.CLIENTE); + + String data = "USER: "+ cliente.getCliente() +"\n"+ + "ANDROID VERSION: "+report.get(ReportField.ANDROID_VERSION) + "\n"+ + "ANDROID PHONE: " + report.get(ReportField.PHONE_MODEL) + "\n"+ + "APP VERSION: " + report.get(ReportField.APP_VERSION_NAME) + "\n"+ + "STACK TRACE: "+report.get(ReportField.STACK_TRACE); + try { + GmailSender sender = new GmailSender(user, pass); + sender.sendMail("VERDNATURA VENTAS ERROR", + data, + user+"@gmail.com", + "nelo.verdnatura@gmail.com"); + } catch (Exception e) { + Log.e("SendMail", e.getMessage(), e); + } */ + } +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/FileManager.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/FileManager.java new file mode 100644 index 00000000..dbc6f1a4 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/FileManager.java @@ -0,0 +1,10 @@ +package com.verdnatura.verdnaturaventas.core; + +/** + * Created by nelo on 1/04/15. + */ +public class FileManager extends com.nelosan.baselibrary.core.FileManager { + + public static final String PEDIO = "pedido.txt"; + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Format.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Format.java new file mode 100644 index 00000000..2b23a653 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Format.java @@ -0,0 +1,13 @@ +package com.verdnatura.verdnaturaventas.core; + +import java.text.DecimalFormat; + +/** + * Created by nelo on 20/02/15. + */ +public class Format { + + public static DecimalFormat df = new DecimalFormat("0.00"); + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/GestureListener.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/GestureListener.java new file mode 100644 index 00000000..f2fe2016 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/GestureListener.java @@ -0,0 +1,87 @@ +package com.verdnatura.verdnaturaventas.core; + +import android.util.Log; +import android.view.GestureDetector; +import android.view.MotionEvent; +import android.view.View; + +/** + * Created by nelo on 10/02/15. + */ +public class GestureListener extends GestureDetector.SimpleOnGestureListener implements + View.OnTouchListener { + + public static final String TAG = "GestureListener"; + + @Override + public boolean onSingleTapUp(MotionEvent e) { + // Up motion completing a single tap occurred. + Log.i(TAG, "Single Tap Up"); + return false; + } + + @Override + public void onLongPress(MotionEvent e) { + // Touch has been long enough to indicate a long press. + // Does not indicate motion is complete yet (no up event necessarily) + Log.i(TAG, "Long Press"); + } + + @Override + public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, + float distanceY) { + // User attempted to scroll + Log.i(TAG, "Scroll"); + return false; + } + + @Override + public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, + float velocityY) { + // Fling event occurred. Notification of this one happens after an "up" event. + Log.i(TAG, "Fling"); + return false; + } + + @Override + public void onShowPress(MotionEvent e) { + // User performed a down event, and hasn't moved yet. + Log.i(TAG, "Show Press"); + } + + @Override + public boolean onDown(MotionEvent e) { + // "Down" event - User touched the screen. + Log.i(TAG, "Down"); + return false; + } + + @Override + public boolean onDoubleTap(MotionEvent e) { + // User tapped the screen twice. + Log.i(TAG, "Double tap"); + return false; + } + + @Override + public boolean onDoubleTapEvent(MotionEvent e) { + // Since double-tap is actually several events which are considered one aggregate + // gesture, there's a separate callback for an individual event within the doubletap + // occurring. This occurs for down, up, and move. + Log.i(TAG, "Event within double tap"); + return false; + } + + @Override + public boolean onSingleTapConfirmed(MotionEvent e) { + // A confirmed single-tap event has occurred. Only called when the detector has + // determined that the first tap stands alone, and is not part of a double tap. + Log.i(TAG, "Single tap confirmed"); + return false; + } + + @Override + public boolean onTouch(View v, MotionEvent event) { + return false; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/GmailSender.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/GmailSender.java new file mode 100644 index 00000000..420adce0 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/GmailSender.java @@ -0,0 +1,105 @@ +package com.verdnatura.verdnaturaventas.core; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.security.Security; +import java.util.Properties; + +import javax.activation.DataHandler; +import javax.activation.DataSource; +import javax.mail.Message; +import javax.mail.PasswordAuthentication; +import javax.mail.Session; +import javax.mail.Transport; +import javax.mail.internet.InternetAddress; +import javax.mail.internet.MimeMessage; + +import static javax.mail.Session.getDefaultInstance; + +public class GmailSender extends javax.mail.Authenticator { + private String mailhost = "smtp.gmail.com"; + private String user; + private String password; + private Session session; + + static { + Security.addProvider(new JSSEProvider()); + } + + public GmailSender(String user, String password) { + this.user = user; + this.password = password; + + Properties props = new Properties(); + props.setProperty("mail.transport.protocol", "smtp"); + props.setProperty("mail.host", mailhost); + props.put("mail.smtp.auth", "true"); + props.put("mail.smtp.port", "465"); + props.put("mail.smtp.socketFactory.port", "465"); + props.put("mail.smtp.socketFactory.class", + "javax.net.ssl.SSLSocketFactory"); + props.put("mail.smtp.socketFactory.fallback", "false"); + props.setProperty("mail.smtp.quitwait", "false"); + + session = getDefaultInstance(props, this); + } + + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(user, password); + } + + public synchronized void sendMail(String subject, String body, String sender, String recipients) throws Exception { + try{ + MimeMessage message = new MimeMessage(session); + DataHandler handler = new DataHandler((javax.activation.DataSource) new ByteArrayDataSource(body.getBytes(), "text/plain")); + message.setSender(new InternetAddress(sender)); + message.setSubject(subject); + message.setDataHandler(handler); + if (recipients.indexOf(',') > 0) + message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients)); + else + message.setRecipient(Message.RecipientType.TO, new InternetAddress(recipients)); + Transport.send(message); + }catch(Exception e){ + + } + } + + public class ByteArrayDataSource implements DataSource { + private byte[] data; + private String type; + + public ByteArrayDataSource(byte[] data, String type) { + super(); + this.data = data; + this.type = type; + } + + public void setType(String type) { + this.type = type; + } + + public String getContentType() { + if (type == null) + return "application/octet-stream"; + else + return type; + } + + public InputStream getInputStream() throws IOException { + return new ByteArrayInputStream(data); + } + + public String getName() { + return "ByteArrayDataSource"; + } + + public OutputStream getOutputStream() throws IOException { + throw new IOException("Not Supported"); + } + + + } +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemArticuloMain.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemArticuloMain.java new file mode 100644 index 00000000..312491f1 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemArticuloMain.java @@ -0,0 +1,163 @@ +package com.verdnatura.verdnaturaventas.core; + +import android.content.Context; +import androidx.cardview.widget.CardView; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import com.nelosan.baselibrary.MyApplication; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerArticulo; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.List; + +/** + * Created by nelo on 5/02/15. + */ +public class ItemArticuloMain extends LinearLayout { + + private TextView txtNombrePrimero, txtNombreSegundo, txtNombreTercero, txtNombreCuarto, txtNombreQuinto; + private TextViewRoboto txtReino; + private ImageView imgFotoPrimero, imgFotoSegundo, imgFotoTercero, imgFotoCuarto, imgFotoQuinto, imgBanner; + private CardView rltPrimero, rltSegundo, rltTercero, rltCuarto, rltQuinto; + private Context context; + private String urlFotoPrimero, urlFotoSegundo, urlFotoTercero, urlFotoCuarto, urlFotoQuinto; + private int reino; + + public ItemArticuloMain(Context context) { + super(context); + this.context = context; + + LayoutInflater.from(context).inflate(R.layout.item_mas_vendidos, this); + + //left text view + imgFotoPrimero = (ImageView) this.findViewById(R.id.imageview_fragment_mas_vendido_mas_vendido_foto); + txtNombrePrimero = (TextView) this.findViewById(R.id.textview_fragment_mas_vendido_mas_vendido_nombre); + rltPrimero = (CardView)this.findViewById(R.id.relative_item_mas_vendidos_contenedor_primero); + imgFotoSegundo = (ImageView) this.findViewById(R.id.imageview_fragment_mas_vendido_segundo_mas_vendido_foto); + txtNombreSegundo = (TextView) this.findViewById(R.id.textview_fragment_mas_vendido_segundo_mas_vendido_nombre); + rltSegundo = (CardView)this.findViewById(R.id.relative_item_mas_vendidos_contenedor_segundo); + imgFotoTercero = (ImageView) this.findViewById(R.id.imageview_fragment_mas_vendido_tercero_mas_vendido_foto); + txtNombreTercero = (TextView) this.findViewById(R.id.textview_fragment_mas_vendido_tercero_mas_vendido_nombre); + rltTercero = (CardView)this.findViewById(R.id.relative_item_mas_vendidos_contenedor_tercero); + imgFotoCuarto = (ImageView) this.findViewById(R.id.imageview_fragment_mas_vendido_cuarto_mas_vendido_foto); + txtNombreCuarto = (TextView) this.findViewById(R.id.textview_fragment_mas_vendido_cuarto_mas_vendido_nombre); + rltCuarto = (CardView)this.findViewById(R.id.relative_item_mas_vendidos_contenedor_cuarto); + imgFotoQuinto = (ImageView) this.findViewById(R.id.imageview_fragment_mas_vendido_quinto_mas_vendido_foto); + txtNombreQuinto = (TextView) this.findViewById(R.id.textview_fragment_mas_vendido_quinto_mas_vendido_nombre); + rltQuinto = (CardView)this.findViewById(R.id.relative_item_mas_vendidos_contenedor_quinto); + txtReino = (TextViewRoboto) this.findViewById(R.id.textview_item_mas_vendidos_reino); + txtReino.setTypeface(TextViewRoboto.ROBOTO_THIN); + + imgBanner = (ImageView)this.findViewById(R.id.imageview_item_mas_vendidos_banner); + } + + + public void setData(List articulos) + { + int contador = 1; + for(final ArticuloVentasTags a : articulos) + { + + switch (contador) + { + case 1: + urlFotoPrimero = a.getFoto(); + generarTarjetas(txtNombrePrimero, rltPrimero, a); + break; + + case 2: + urlFotoSegundo = a.getFoto(); + generarTarjetas(txtNombreSegundo, rltSegundo, a); + break; + + case 3: + urlFotoTercero = a.getFoto(); + generarTarjetas(txtNombreTercero, rltTercero, a); + break; + + case 4: + urlFotoCuarto = a.getFoto(); + generarTarjetas(txtNombreCuarto, rltCuarto, a); + break; + + case 5: + urlFotoQuinto = a.getFoto(); + generarTarjetas(txtNombreQuinto, rltQuinto, a); + break; + } + + contador++; + this.reino = a.getReino(); + + } + + } + + public int getReino() { + return reino; + } + + public void generarTarjetas(TextView txt, CardView card, final ArticuloVentasTags a) + { + + txt.setText(a.getArticle()); + card.setVisibility(View.VISIBLE); + card.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + if (((ActivityBase) context).getPedido().getOrder().getAgencia() != null) + ControllerArticulo.verDetalle(a, (ActivityBase) context); + else + Toast.makeText(context, getResources().getString(R.string.mensaje_seleccionar_agencia), Toast.LENGTH_SHORT).show(); + } + }); + + + } + + public void downloadFoto() + { + MyApplication.downloadImg(Static.BASE_URL_FULL + urlFotoPrimero + ".png", imgFotoPrimero, MyApplication.TRANSFORM_NONE); + MyApplication.downloadImg(Static.BASE_URL_SMALL + urlFotoSegundo + ".png", imgFotoSegundo, MyApplication.TRANSFORM_NONE); + MyApplication.downloadImg(Static.BASE_URL_SMALL + urlFotoTercero + ".png", imgFotoTercero, MyApplication.TRANSFORM_NONE); + MyApplication.downloadImg(Static.BASE_URL_SMALL + urlFotoCuarto + ".png", imgFotoCuarto, MyApplication.TRANSFORM_NONE); + MyApplication.downloadImg(Static.BASE_URL_SMALL + urlFotoQuinto + ".png", imgFotoQuinto, MyApplication.TRANSFORM_NONE); + + txtReino.setText(getTextReino()); + } + + public String getTextReino() + { + switch(reino) + { + case 1: + return context.getResources().getString(R.string.main_vendidos_flowers); + + case 2: + return context.getResources().getString(R.string.main_vendidos_plants); + + case 3: + return context.getResources().getString(R.string.main_vendidos_supplements); + + case 4: + return context.getResources().getString(R.string.main_vendidos_artificial); + + case 5: + return context.getResources().getString(R.string.main_vendidos_greens); + + case 7: + return context.getResources().getString(R.string.main_vendidos_manufacturing); + + } + + return ""; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemArticuloRelacionado.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemArticuloRelacionado.java new file mode 100644 index 00000000..2430da6a --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemArticuloRelacionado.java @@ -0,0 +1,59 @@ +package com.verdnatura.verdnaturaventas.core; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.nelosan.baselibrary.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +/** + * Created by nelo on 5/02/15. + */ +public class ItemArticuloRelacionado extends LinearLayout { + + private TextView txtNombre, txtPrecio; + private ImageView imgFoto; + private Context context; + + public ItemArticuloRelacionado(Context context) { + super(context); + this.context = context; + + LayoutInflater.from(context).inflate(R.layout.item_articulo_relacionado, this); + + //left text view + txtNombre = (TextView) this.findViewById(R.id.textview_item_articulo_relacionado_nombre); + txtPrecio = (TextView) this.findViewById(R.id.textview_item_articulo_relacionado_precio); + imgFoto = (ImageView) this.findViewById(R.id.imageview_item_articulo_relacionado_foto); + + } + + + public void setData(final ArticuloVentasTags a) + { + ControllerPreferences preferences = new ControllerPreferences(); + this.txtNombre.setText(a.getArticle()); + this.txtPrecio.setText(a.getPrice()+"€"); + if(txtPrecio.getText().equals("0.0€") || !preferences.verPrecios()) + txtPrecio.setVisibility(View.GONE); + + MyApplication.downloadImg(Static.BASE_URL_SMALL + a.getFoto() + ".png", imgFoto, MyApplication.TRANSFORM_NONE); + } + + public void setColorPrice(int color) + { + this.txtPrecio.setTextColor(color); + } + + + public ImageView getImgFoto() { + return imgFoto; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemTag.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemTag.java new file mode 100644 index 00000000..048ba51e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/ItemTag.java @@ -0,0 +1,33 @@ +package com.verdnatura.verdnaturaventas.core; + +import android.content.Context; +import android.view.LayoutInflater; +import android.widget.LinearLayout; +import android.widget.TextView; + +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 28/7/17. + */ + +public class ItemTag extends LinearLayout { + + private TextView txtTag, txtVal; + + public ItemTag(Context context) { + super(context); + LayoutInflater.from(context).inflate(R.layout.item_tag, this); + + //left text view + txtTag = (TextView) this.findViewById(R.id.tag_name); + txtVal = (TextView) this.findViewById(R.id.tag_val); + } + + public void setData(String name, String val){ + this.txtTag.setText(name); + this.txtVal.setText(val); + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/JSSEProvider.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/JSSEProvider.java new file mode 100644 index 00000000..07f141ee --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/JSSEProvider.java @@ -0,0 +1,46 @@ +package com.verdnatura.verdnaturaventas.core; + +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @author Alexander Y. Kleymenov + * @version $Revision$ + */ + + +import java.security.AccessController; +import java.security.Provider; + +public final class JSSEProvider extends Provider { + + public JSSEProvider() { + super("HarmonyJSSE", 1.0, "Harmony JSSE Provider"); + AccessController.doPrivileged(new java.security.PrivilegedAction() { + public Void run() { + put("SSLContext.TLS", + "org.apache.harmony.xnet.provider.jsse.SSLContextImpl"); + put("Alg.Alias.SSLContext.TLSv1", "TLS"); + put("KeyManagerFactory.X509", + "org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl"); + put("TrustManagerFactory.X509", + "org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl"); + return null; + } + }); + } +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/LinearTags.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/LinearTags.java new file mode 100644 index 00000000..8af15a16 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/LinearTags.java @@ -0,0 +1,41 @@ +package com.verdnatura.verdnaturaventas.core; + +import android.content.Context; +import androidx.annotation.Nullable; +import android.util.AttributeSet; +import android.widget.LinearLayout; + +import java.util.Map; + +/** + * Created by nelo on 1/8/17. + */ + +public class LinearTags extends LinearLayout { + + private Context context; + + public LinearTags(Context context) { + super(context); + this.context = context; + } + + public LinearTags(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + this.context = context; + } + + public LinearTags(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + this.context = context; + } + + public void generateTags(Map tags){ + removeAllViews(); + for (String key: tags.keySet()){ + ItemTag item = new ItemTag(context); + item.setData(key, tags.get(key)); + this.addView(item); + } + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Static.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Static.java new file mode 100644 index 00000000..d401b2f8 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/Static.java @@ -0,0 +1,29 @@ +package com.verdnatura.verdnaturaventas.core; + +import android.os.Environment; + +public class Static { + + public static final String BASE_URL_FULL = "http://verdnatura.es/vn-image-data/catalog/full/"; + public static final String BASE_URL_SMALL = "http://verdnatura.es/vn-image-data/catalog/200x200/"; + public static final String BASE_URL_LARGE = "http://verdnatura.es/vn-image-data/catalog/1600x900/"; + public static final String FILE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath(); + + /*****************MAIN**********************/ + public static final int FLORES = 1; + public static final int PLANTAS = 2; + public static final int COMPLEMENTOS = 3; + public static final int ARTIFICIAL = 4; + public static final int VERDES = 5; + public static final int CONFECCION = 7; + + /*****************COLOR DARK****************/ + public static final int FLORES_DARK = 11; + public static final int PLANTAS_DARK = 22; + public static final int COMPLEMENTOS_DARK = 33; + public static final int ARTIFICIAL_DARK = 44; + public static final int VERDES_DARK = 55; + public static final int CONFECCION_DARK = 77; + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/UtilsAndroid.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/UtilsAndroid.java new file mode 100644 index 00000000..eda8ac59 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/core/UtilsAndroid.java @@ -0,0 +1,18 @@ +package com.verdnatura.verdnaturaventas.core; + +import android.util.DisplayMetrics; + +import com.verdnatura.verdnaturaventas.ActivityBase; + +/** + * Created by nelo on 5/11/15. + */ +public class UtilsAndroid { + + public static int getWidth(ActivityBase activity) + { + DisplayMetrics displaymetrics = new DisplayMetrics(); + activity.getWindowManager().getDefaultDisplay().getMetrics(displaymetrics); + return displaymetrics.widthPixels; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertConsignatarioDefecto.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertConsignatarioDefecto.java new file mode 100644 index 00000000..dc7b3c0d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertConsignatarioDefecto.java @@ -0,0 +1,36 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; +import android.widget.Toast; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.model.Consignatario; + +/** + * Created by nelo on 31/3/17. + */ + +public class AlertConsignatarioDefecto { + + private ControllerPreferences preferences; + + public AlertConsignatarioDefecto(final Context context, final Consignatario cons){ + preferences = new ControllerPreferences(); + AlertDialog.Builder dialog = new AlertDialog.Builder(context); + dialog.setTitle(context.getResources().getString(R.string.alert_consignatario_title)); + dialog.setMessage(context.getResources().getString(R.string.alert_consignatario_message)); + dialog.setPositiveButton(context.getResources().getString(R.string.aceptar), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + preferences.saveConsignatarioDefecto(cons.getId_Consigna()); + dialog.dismiss(); + Toast.makeText(context, context.getResources().getString(R.string.alert_consignatario_toast), Toast.LENGTH_SHORT).show(); + } + }); + dialog.show(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertErrorResumenPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertErrorResumenPedido.java new file mode 100644 index 00000000..f745ed33 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertErrorResumenPedido.java @@ -0,0 +1,28 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; + +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 26/4/17. + */ + +public class AlertErrorResumenPedido { + + public AlertErrorResumenPedido(Context context, String msg){ + AlertDialog.Builder dialog = new AlertDialog.Builder(context); + dialog.setTitle("Error"); + dialog.setMessage(msg); + dialog.setPositiveButton(context.getResources().getString(R.string.aceptar), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + dialog.show(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertHome.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertHome.java new file mode 100644 index 00000000..2f03b843 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/AlertHome.java @@ -0,0 +1,39 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.app.AlertDialog; +import android.content.Context; +import android.content.DialogInterface; + +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by manuelsanchez on 12/12/17. + */ + +public class AlertHome { + + public AlertHome(Context context, final AlertPositive positive){ + AlertDialog.Builder dialog = new AlertDialog.Builder(context); + dialog.setTitle(context.getResources().getString(R.string.alert)); + dialog.setMessage(context.getResources().getString(R.string.alert_home)); + dialog.setPositiveButton(context.getResources().getString(R.string.aceptar), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + positive.alertHomePositiveClick(); + } + }); + dialog.setNegativeButton(context.getResources().getString(R.string.cancelar), new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + dialog.dismiss(); + } + }); + dialog.show(); + } + + public interface AlertPositive + { + void alertHomePositiveClick(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogBase.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogBase.java new file mode 100644 index 00000000..22573817 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogBase.java @@ -0,0 +1,74 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.app.AlertDialog; +import android.app.Dialog; +import android.app.DialogFragment; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary.command.CommandBase; +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; + +/** + * Created by nelo on 23/09/15. + */ +public class DialogBase extends DialogFragment { + + protected ActivityBase activity; + protected ControllerPedido pedido; + protected ControllerPreferences preferences; + protected LayoutInflater inflater; + protected ProgressBar progress; + protected View contenedor; + + @Override + public Dialog onCreateDialog(Bundle savedInstanceState) { + loadElements(); + AlertDialog.Builder builder = new AlertDialog.Builder(activity); + LayoutInflater inflater = getActivity().getLayoutInflater(); + View view = CreateView(); + onViewCreated(); + builder.setView(view); + Dialog dialog = builder.create(); + dialog.setCanceledOnTouchOutside(false); + return dialog; + } + + private void loadElements() + { + activity = (ActivityBase) getActivity(); + inflater = activity.getLayoutInflater(); + pedido = new ControllerPedido(activity); + preferences = new ControllerPreferences(); + } + + public View CreateView() + { + return null; + } + + public void onViewCreated() {} + + public void showProgress(boolean show) + { + if(show) + { + progress.setVisibility(View.VISIBLE); + contenedor.setVisibility(View.INVISIBLE); + } + else + { + progress.setVisibility(View.INVISIBLE); + contenedor.setVisibility(View.VISIBLE); + } + } + + public void execute(CommandBase cmd) + { + activity.execute(cmd); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarBase.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarBase.java new file mode 100644 index 00000000..e91f2944 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarBase.java @@ -0,0 +1,40 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.view.View; + +import com.nelosan.baselibrary.components.Calendar; +import com.nelosan.baselibrary.core.OnChangeDate; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.model.Order; + +/** + * Created by nelo on 27/11/15. + */ +public abstract class DialogCalendarBase extends DialogBase { + + private Calendar calendar; + private int year, month, day; + + @Override + public View CreateView() { + View view = inflater.inflate(R.layout.fragment_calendar, null); + calendar = (Calendar) view.findViewById(R.id.fragment_calendar_calendar); + return view; + } + + @Override + public void onViewCreated() { + this.year = pedido.getOrder().getCalendario().getYear(); + this.month = pedido.getOrder().getCalendario().getMonth(); + this.day = pedido.getOrder().getCalendario().getDay(); + calendar.setDate(year, month, day); + calendar.setOnChangeDate(new OnChangeDate() { + @Override + public void OnChangeDate(int year, int month, int day) { + cambiarFecha(year, month, day, pedido.getOrder()); + } + }); + } + + public abstract void cambiarFecha(int year, int month, int day, Order order); +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarMain.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarMain.java new file mode 100644 index 00000000..87261ae3 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarMain.java @@ -0,0 +1,24 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import com.verdnatura.verdnaturaventas.fragment.FragmentConfigurarPedido; +import com.verdnatura.verdnaturaventas.fragment.FragmentMain; +import com.verdnatura.verdnaturaventas.model.Order; + +/** + * Created by nelo on 17/06/15. + */ +public class DialogCalendarMain extends DialogCalendarBase { + + public void cambiarFecha(int year, int month, int day, Order order) + { + pedido.cambiarFecha(year, month, day); + pedido.guardarOrder(); + dismiss(); + + if(activity.compararFragments(FragmentMain.class)) + ((FragmentMain)activity.getFragmentActivo()).setFecha(); + else if(activity.compararFragments(FragmentConfigurarPedido.class)) + ((FragmentConfigurarPedido)activity.getFragmentActivo()).setFecha(); + + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarResumen.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarResumen.java new file mode 100644 index 00000000..0bb33a8d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCalendarResumen.java @@ -0,0 +1,20 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import com.verdnatura.verdnaturaventas.fragment.FragmentResumenPedido; +import com.verdnatura.verdnaturaventas.model.Order; + +/** + * Created by nelo on 27/11/15. + */ +public class DialogCalendarResumen extends DialogCalendarBase { + @Override + public void cambiarFecha(int year, int month, int day, Order order) { + + pedido.cambiarFecha(year, month, day); + dismiss(); + FragmentResumenPedido fragment = (FragmentResumenPedido) activity.getFragmentActivo(); + fragment.setFecha(pedido.getOrder().getCalendario().getFormatFecha()); + if(!fragment.isErrorAgency()) + fragment.verificarAgencia(); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCambiarEmail.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCambiarEmail.java new file mode 100644 index 00000000..c8c3bf67 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCambiarEmail.java @@ -0,0 +1,111 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdModificarCliente; + +import com.verdnatura.verdnaturaventas.fragment.FragmentCuenta; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 23/03/15. + */ +public class DialogCambiarEmail extends DialogBase { + + private Button btnAceptar; + private TextViewRoboto txtHeader; + private EditText edtEmail; + + private ClienteVentas cliente; + + @Override + public View CreateView() { + // TODO Auto-generated method stub + View view = inflater.inflate(R.layout.dialog_cambiar_email, null); + btnAceptar = (Button)view.findViewById(R.id.button_fragment_cambiar_email_aceptar); + edtEmail = (EditText)view.findViewById(R.id.textview_fragment_cambiar_email_nuevo); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (RelativeLayout)view.findViewById(R.id.contenedor_fragment_email); + txtHeader = (TextViewRoboto)view.findViewById(R.id.txtview_fragment_email_header); + + return view; + } + + @Override + public void onViewCreated() { + if(pedido.getOrder().getCliente() != null) + cliente = pedido.getOrder().getCliente(); + else + cliente = preferences.recuperarCliente(); + btnAceptar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + cambiarEmail(edtEmail.getText().toString()); + } + }); + txtHeader.setTypeface(TextViewRoboto.ROBOTO_THIN); + } + + public void cambiarEmail(String email) + { + if(!email.equals("") && !email.equals(cliente.getEmail())) + { + cliente.setEmail(email); + if(preferences.recuperarCliente().getId_Cliente() == cliente.getId_Cliente()) + preferences.guardarCliente(cliente); + actualizarCliente(); + } + else + { + dismiss(); + } + } + + public void actualizarCliente() + { + showProgress(true); + + CmdModificarCliente cmd = new CmdModificarCliente(cliente); + cmd.setOnFinished(new CommandOperation() { + + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + if(preferences.recuperarCliente().getId_Cliente() == cliente.getId_Cliente()) + preferences.guardarCliente(cliente); + showProgress(false); + dismiss(); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + actualizarCliente(); + } + + @Override + public void Accept(CommandBase cmd) { + showProgress(false); + } + }); + execute(cmd); + } + + @Override + public void dismiss() { + super.dismiss(); + if(activity.compararFragments(FragmentCuenta.class)) + { + if(!edtEmail.getText().toString().equals("")) + ((FragmentCuenta)activity.getFragmentActivo()).setEmail(edtEmail.getText().toString()); + } + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCambiarPassword.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCambiarPassword.java new file mode 100644 index 00000000..98a49cd9 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogCambiarPassword.java @@ -0,0 +1,130 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.app.Activity; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.Toast; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdModificarPassword; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 23/03/15. + */ +public class DialogCambiarPassword extends DialogBase { + + private EditText edtOldPassword, edtNewPassword, edtNewPassword2; + private TextViewRoboto txtHeader; + private Button btnAceptar; + private ClienteVentas cliente; + + @Override + public void onAttach(Activity activity) { + // TODO Auto-generated method stub + super.onAttach(activity); + } + + @Override + public View CreateView() { + // TODO Auto-generated method stub + View view = inflater.inflate(R.layout.dialog_cambiar_password, null); + + edtOldPassword = (EditText)view.findViewById(R.id.edittext_fragment_cuenta_numero_oldpassword); + edtNewPassword = (EditText)view.findViewById(R.id.edittext_fragment_cuenta_numero_newpassword); + edtNewPassword2 = (EditText)view.findViewById(R.id.edittext_fragment_cuenta_numero_newpassword2); + btnAceptar = (Button)view.findViewById(R.id.button_fragment_cambiar_password_aceptar); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (RelativeLayout)view.findViewById(R.id.relative_password_contenedor); + txtHeader = (TextViewRoboto)view.findViewById(R.id.txtview_fragment_password_header); + + btnAceptar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + String oldPass = edtOldPassword.getText().toString(); + String newPass = edtNewPassword.getText().toString(); + String newPass2 = edtNewPassword2.getText().toString(); + cambiarPassword(oldPass, newPass, newPass2); + } + }); + + return view; + } + + @Override + public void onViewCreated() { + if(pedido.getOrder().getCliente() != null) + cliente = pedido.getOrder().getCliente(); + else + cliente = preferences.recuperarCliente(); + txtHeader.setTypeface(TextViewRoboto.ROBOTO_THIN); + } + + public void cambiarPassword(String oldPassword, final String nuevoPassword, String nuevoPassword2) + { + String msg = comprobarPassword(oldPassword, nuevoPassword, nuevoPassword2); + if(msg.equals("")) + { + sendNewPassword(nuevoPassword); + } + else + { + Toast.makeText(activity, msg, Toast.LENGTH_SHORT).show(); + } + + } + + public void sendNewPassword(final String password) + { + String pass = preferences.codificarBase64(password); + CmdModificarPassword cmd = new CmdModificarPassword(pass, cliente.getId_Cliente()); + cmd.setOnFinished(new CommandOperation() { + + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + if(preferences.recuperarCliente().getId_Cliente() == cliente.getId_Cliente()) + preferences.guardarUsuario(preferences.getUser(), password, cliente); + dismiss(); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + sendNewPassword(password); + } + + @Override + public void Accept(CommandBase cmd) { + showProgress(false); + } + }); + execute(cmd); + } + + public String comprobarPassword(String oldPassword, String newPassword, String newPassword2) + { + String msg = ""; + + String password = preferences.getPass(); + if(password.equals(oldPassword)) + { + if(!newPassword.equals(newPassword2)) { + msg = activity.getResources().getString(R.string.fragment_cambiar_password_mensaje_aviso_uno); + } + } + else + { + msg = activity.getResources().getString(R.string.fragment_cambiar_password_mensaje_aviso_dos); + } + + return msg; + + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogComprar.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogComprar.java new file mode 100644 index 00000000..883cb92d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogComprar.java @@ -0,0 +1,275 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.os.Build; +import android.os.Bundle; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.ProgressBar; +import android.widget.Toast; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterCompra; +import com.verdnatura.verdnaturaventas.command.CmdCrearOrder; +import com.verdnatura.verdnaturaventas.fragment.FragmentDetalleArticulo; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.DatosCompra; +import com.verdnatura.verdnaturaventas.model.OrderRow; +import com.verdnatura.verdnaturaventas.model.Tarifa; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 22/01/15. + */ +public class DialogComprar extends DialogBase{ + + public static final String DATOS = "DATOS"; + + private ArticuloVentasTags articulo; + private ListView lstDatos; + private TextViewRoboto txtCantidad, txtAceptar; + private List datosSalvados, datos; + private ImageView imgPapelera; + private AdapterCompra adapter; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if(savedInstanceState != null) + { + datos = savedInstanceState.getParcelableArrayList(DATOS); + articulo = savedInstanceState.getParcelable(FragmentDetalleArticulo.ARTICULO); + } + else + { + articulo = getArguments().getParcelable(FragmentDetalleArticulo.ARTICULO); + } + + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelableArrayList(DATOS, (ArrayList) datos); + outState.putParcelable(FragmentDetalleArticulo.ARTICULO, articulo); + } + + @Override + public View CreateView() { + View view = inflater.inflate(R.layout.dialog_comprar, null); + + lstDatos = (ListView)view.findViewById(R.id.listview_dialog_comprar_datos); + txtCantidad = (TextViewRoboto) view.findViewById(R.id.textview_dialog_comprar_cantidad); + txtAceptar = (TextViewRoboto)view.findViewById(R.id.textview_dialog_comprar_aceptar); + imgPapelera = (ImageView)view.findViewById(R.id.imageview_dialogo_comprar_papelera); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (LinearLayout)view.findViewById(R.id.linearlayout_dialog_comprar); + + return view; + } + + @Override + public void onViewCreated() { + + datos = generarDatos(articulo); + adapter = new AdapterCompra(activity, R.layout.item_compra, datos); + lstDatos.setAdapter(adapter); + + lstDatos.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapter, View view, int position, long id) { + DatosCompra dato = (DatosCompra) adapter.getItemAtPosition(position); + clickComprar(dato, view); + } + }); + + txtAceptar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + AgregarLinea(); + } + }); + + + imgPapelera.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + borrarValores(); + } + }); + + datosSalvados = new ArrayList<>(); + } + + public void clickComprar(DatosCompra dato, View view) + { + int cantidad = 0; + for(OrderRow row : activity.getPedido().getOrder().getRows()) + { + if(row.getArticulo() == dato.getArticulo()) + { + cantidad = row.getAmount(); + } + } + if(getCantidadTotal() + dato.getCantidad() + cantidad <= articulo.getAvailable()) { + addDatoCompra(dato); + mostrarValores(dato, view); + } + else + { + Toast.makeText(activity, activity.getResources().getString(R.string.dialog_comprar_available), Toast.LENGTH_SHORT).show(); + } + } + + public void addDatoCompra(DatosCompra dato) + { + boolean existe = false; + + for(DatosCompra d : datosSalvados) { + if (dato.getTarifa() == d.getTarifa()) { + int cantidad = dato.getCantidad() + d.getCantidad(); + d.setCantidad(cantidad); + existe = true; + break; + } + } + + if(!existe) + { + DatosCompra da = generateDato(dato, null, null); + datosSalvados.add(da); + } + + } + + + public void mostrarValores(DatosCompra dato, View view) + { + int cantidad = 0; + + for(DatosCompra d : datosSalvados) { + if(dato.getTarifa() == d.getTarifa()) { + dato.setEspecificaciones(activity.getResources().getString(R.string.dialog_comprar_bought, d.getCantidad())); + ((AdapterCompra.DatosCompraHolder) view.getTag()).txtEspecificaciones.setText(dato.getEspecificaciones()); + } + cantidad += d.getCantidad(); + } + + txtCantidad.setText(""+cantidad); + } + + public int getCantidadTotal() + { + int cantidad = 0; + for(DatosCompra d : datosSalvados) { + cantidad += d.getCantidad(); + } + + return cantidad; + } + + public void borrarValores() + { + datosSalvados = new ArrayList(); + txtCantidad.setText("0"); + for(DatosCompra d : datos){ + int position = datos.indexOf(d); + View view = lstDatos.getChildAt(position); + d.setEspecificaciones(""); + if(view != null) + ((AdapterCompra.DatosCompraHolder) view.getTag()).txtEspecificaciones.setText(""); + + } + + } + + public void comprar(DatosCompra dato) + { + pedido.comprar(dato); + } + + public List generarDatos(ArticuloVentasTags a) + { + List datos = new ArrayList(); + + for(Tarifa t : a.getTarifas()) + { + datos.add(generateDato(null, t, a)); + } + + return datos; + } + + public DatosCompra generateDato(DatosCompra dato, Tarifa t, ArticuloVentasTags a) + { + DatosCompra da = new DatosCompra(); + + if(dato != null) + { + t = dato.getTarifa(); + a = dato.getArticulo(); + da.setCantidad(dato.getCantidad()); + da.setPrecio(dato.getPrecio()); + da.setGrouping(dato.getGrouping()); + da.setEspecificaciones(dato.getEspecificaciones()); + } + else{ + da.setCantidad(t.getGrouping()); + da.setPrecio(t.getPrice()); + da.setGrouping((int)a.getAvailable()); + } + + da.setArticulo(a); + da.setTarifa(t); + da.setItems(t.getItems()); + + return da; + } + + public void AgregarLinea() + { + showProgress(true); + for (DatosCompra d : datosSalvados) + comprar(d); + + CmdCrearOrder cmd = new CmdCrearOrder(pedido, activity.getSerialNumber()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + pedido.setOrder(((CmdCrearOrder)cmd).getOrder()); + pedido.guardarOrder(); + Toast.makeText(activity, activity.getResources().getString(R.string.activity_articulo_producto_anyadido), Toast.LENGTH_SHORT).show(); + activity.showTotalPedido(); + activity.showCarritoRows(); + DialogComprar.this.dismiss(); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + for (DatosCompra d : datosSalvados) + pedido.borrarCompra(d); + AgregarLinea(); + } + + @Override + public void Accept(CommandBase cmd) { + for (DatosCompra d : datosSalvados) + pedido.borrarCompra(d); + pedido.guardarOrder(); + Toast.makeText(activity, activity.getResources().getString(R.string.activity_articulo_producto_no_anyadido), Toast.LENGTH_SHORT).show(); + showProgress(false); + } + }); + execute(cmd); + } + +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogDeleteOrder.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogDeleteOrder.java new file mode 100644 index 00000000..e7f7bd73 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogDeleteOrder.java @@ -0,0 +1,81 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.view.View; +import android.widget.Button; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdBorrarPedidoPendiente; +import com.verdnatura.verdnaturaventas.fragment.FragmentPedidosPendientes; +import com.verdnatura.verdnaturaventas.model.OrderResumen; + +/** + * Created by nelo on 12/7/16. + */ +public class DialogDeleteOrder extends DialogBase { + + public static final String ORDER_DELETE = "ORDER_DELETE"; + + private Button btnAccept; + private OrderResumen order; + private FragmentPedidosPendientes fragment; + + + public void setFragment(FragmentPedidosPendientes fragment){ + this.fragment = fragment; + } + + @Override + public View CreateView() { + View view = inflater.inflate(R.layout.dialog_borrar_order, null); + btnAccept = (Button) view.findViewById(R.id.button_delete_order_aceptar); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (RelativeLayout)view.findViewById(R.id.relative_dialog_delete_order_container); + + order = getArguments().getParcelable(ORDER_DELETE); + + return view; + } + + @Override + public void onViewCreated() { + btnAccept.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + borrarOrder(); + } + }); + } + + public void borrarOrder(){ + showProgress(true); + CmdBorrarPedidoPendiente cmd = new CmdBorrarPedidoPendiente(order); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + if(fragment != null) + fragment.getPedidosPendientes(); + showProgress(false); + dismiss(); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + borrarOrder(); + } + + @Override + public void Accept(CommandBase cmd) { + showProgress(false); + dismiss(); + } + }); + execute(cmd); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogDeuda.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogDeuda.java new file mode 100644 index 00000000..966118d2 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogDeuda.java @@ -0,0 +1,95 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.os.Bundle; +import android.view.View; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdObtenerCreditoRiesgo; +import com.verdnatura.verdnaturaventas.command.CmdObtenerPedidos; +import com.verdnatura.verdnaturaventas.fragment.FragmentNavegador; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 25/09/15. + */ +public class DialogDeuda extends DialogBase { + + private TextViewRoboto txtResumen, txtConfirmar; + private EditText edtCantidad; + private double deuda; + + @Override + public View CreateView() { + View view = inflater.inflate(R.layout.dialog_pagar, null); + + txtResumen = (TextViewRoboto)view.findViewById(R.id.deuda_text_resumen); + txtConfirmar = (TextViewRoboto)view.findViewById(R.id.textview_fragment_resumen_precio_confirmar); + edtCantidad = (EditText)view.findViewById(R.id.deuda_cantidad_pagar); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (LinearLayout)view.findViewById(R.id.contenedor_fragment_resumen); + + return view; + } + + @Override + public void onViewCreated() { + txtConfirmar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if(edtCantidad.getText().toString().equals("")) edtCantidad.setText("0"); + String deudaS = edtCantidad.getText().toString(); + deudaS = deudaS.replace(",","."); + deuda = Double.parseDouble(deudaS); + if(deuda>0 && deuda <= 3000) { + Bundle bundle = new Bundle(); + bundle.putDouble(FragmentNavegador.CANTIDAD, deuda); + bundle.putBoolean(FragmentNavegador.DEUDA, true); + activity.cerrarDrawerIzquierdo(); + activity.cambiarFragment(new FragmentNavegador(), bundle); + dismiss(); + } + } + }); + + obtenerDeuda(); + } + + public void obtenerDeuda() + { + showProgress(true); + ClienteVentas cliente = null; + if(pedido.getOrder().getCliente() != null) + cliente = pedido.getOrder().getCliente(); + else + cliente = preferences.recuperarCliente(); + CmdObtenerCreditoRiesgo cmd = new CmdObtenerCreditoRiesgo(cliente); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + showProgress(false); + ClienteVentas c = ((CmdObtenerCreditoRiesgo) cmd).getCliente(); + deuda = c.getRiesgo(); + txtResumen.setText(getResources().getString(R.string.text_actual_debt, String.format("%.2f", deuda))); + if (deuda > 0) { + String precio = String.format("%.2f", deuda); + precio = precio.replace(",","."); + edtCantidad.setText(precio+""); + } else { + txtResumen.setText(getResources().getString(R.string.no_deuda)); + edtCantidad.setText("0"); + txtConfirmar.setText(getResources().getString(R.string.aceptar)); + } + edtCantidad.setSelection(edtCantidad.getText().length()); + } + }); + execute(cmd); + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogFinalizarPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogFinalizarPedido.java new file mode 100644 index 00000000..578d4d1d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogFinalizarPedido.java @@ -0,0 +1,97 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.os.Bundle; +import android.view.View; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 19/05/15. + */ +public class DialogFinalizarPedido extends DialogBase { + + public static final String IS_DEUDA = "IS_DEUDA"; + public static final String PAGADO = "PAGADO"; + + private TextViewRoboto txtAceptar, txtCabecera; + + private boolean isDeuda, pagado; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if(savedInstanceState != null) { + isDeuda = savedInstanceState.getBoolean(IS_DEUDA, false); + pagado = savedInstanceState.getBoolean(PAGADO, false); + } + else { + isDeuda = getArguments().getBoolean(IS_DEUDA, false); + pagado = getArguments().getBoolean(PAGADO, false); + } + + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putBoolean(IS_DEUDA, isDeuda); + outState.putBoolean(PAGADO, pagado); + } + + @Override + public View CreateView() { + View view = inflater.inflate(R.layout.fragment_finalizar_pedido, null); + + txtAceptar = (TextViewRoboto)view.findViewById(R.id.textview_fragment_finalizar_pedido_aceptar); + txtCabecera = (TextViewRoboto) view.findViewById(R.id.textview_fragment_finalizar_pedido_cabecera); + + return view; + } + + + @Override + public void onViewCreated() + { + txtCabecera.setText(getText(false)); + txtAceptar.setText(getText(true)); + + txtAceptar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if(isDeuda) + dismiss(); + else { + pedido.reiniciarPedido(); + activity.goToHome(); + } + } + }); + + setCancelable(false); + } + + public String getText(boolean button) + { + String text = ""; + if(button) { + if (isDeuda) + text = activity.getResources().getString(R.string.aceptar); + else + text = activity.getResources().getString(R.string.fragment_finalizar_pedido_aceptar); + } + else + { + if(isDeuda && pagado) + text = activity.getResources().getString(R.string.fragment_finalizar_deuda_aceptar); + if(isDeuda && !pagado) + text = activity.getResources().getString(R.string.fragment_finalizar_deuda_error); + if(!isDeuda && pagado) + text = activity.getResources().getString(R.string.fragment_finalizar_pedido_texto); + if(!isDeuda && !pagado) + text = activity.getResources().getString(R.string.fragment_finalizar_pedido_error); + } + + return text; + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogImprimir.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogImprimir.java new file mode 100644 index 00000000..4e85a1c2 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogImprimir.java @@ -0,0 +1,81 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.view.View; +import android.widget.TextView; +import android.widget.Toast; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdImprimirTicket; + + +/** + * Created by nelo on 1/12/15. + */ +public class DialogImprimir extends DialogBase { + + public static final String TICKET = "TICKET"; + private static final int WAREHOUSE_FV = 1; + private static final int WAREHOUSE_PCA = 44; + + + private TextView txtFv, txtPca; + private int ticket; + + @Override + public View CreateView() { + // TODO Auto-generated method stub + View view = inflater.inflate(R.layout.dialog_imprimir, null); + txtFv = (TextView) view.findViewById(R.id.txtview_dialog_imprimir_fv); + txtPca = (TextView) view.findViewById(R.id.txtview_dialog_imprimir_pca); + + ticket = getArguments().getInt(TICKET); + + return view; + } + + @Override + public void onViewCreated() { + txtFv.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + imprimir(WAREHOUSE_FV); + } + }); + + txtPca.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + imprimir(WAREHOUSE_PCA); + } + }); + } + + public void imprimir(final int warehouse) + { + CmdImprimirTicket cmd = new CmdImprimirTicket(ticket+"", warehouse, false); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + Toast.makeText(activity, activity.getResources().getString(R.string.dialog_print_ok), Toast.LENGTH_SHORT).show(); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + imprimir(warehouse); + } + + @Override + public void Accept(CommandBase cmd) { + dismiss(); + } + }); + execute(cmd); + + } + +} + diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogNotas.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogNotas.java new file mode 100644 index 00000000..eecddfe4 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogNotas.java @@ -0,0 +1,45 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.os.Bundle; +import android.view.View; +import android.widget.EditText; + +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 22/10/15. + */ +public class DialogNotas extends DialogBase { + + private EditText edtNotas; + private TextViewRoboto txtConfirmar; + + @Override + public View CreateView() { + View view = inflater.inflate(R.layout.dialog_notas, null); + + edtNotas = (EditText)view.findViewById(R.id.edit_pedido_notas); + txtConfirmar = (TextViewRoboto)view.findViewById(R.id.textview_fragment_notas_precio_confirmar); + + return view; + } + + @Override + public void onViewCreated() { + + if(!pedido.getOrder().getNotas().equals("")) + edtNotas.setText(pedido.getOrder().getNotas()); + + txtConfirmar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + pedido.setNotas(edtNotas.getText().toString()); + DialogValidarPedido dialog = new DialogValidarPedido(); + dialog.show(activity.getFragmentManager(), "tagDialogValidar"); + dismiss(); + } + }); + + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogValidarPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogValidarPedido.java new file mode 100644 index 00000000..8c937098 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/dialog/DialogValidarPedido.java @@ -0,0 +1,107 @@ +package com.verdnatura.verdnaturaventas.dialog; + +import android.view.View; +import android.widget.LinearLayout; +import android.widget.ProgressBar; + + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdObtenerCreditoRiesgo; +import com.verdnatura.verdnaturaventas.command.CmdSplitOrder; + +/** + * Created by nelo on 12/05/15. + */ +public class DialogValidarPedido extends DialogBase { + + private TextViewRoboto txtPrecio, txtConfirmar; + + @Override + public View CreateView() { + View view = inflater.inflate(R.layout.fragment_resumen_precio, null); + + txtPrecio = (TextViewRoboto)view.findViewById(R.id.textview_fragment_resumen_precio_precio); + txtConfirmar = (TextViewRoboto)view.findViewById(R.id.textview_fragment_resumen_precio_confirmar); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (LinearLayout)view.findViewById(R.id.contenedor_fragment_resumen); + + txtConfirmar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + splitOrder(); + } + }); + + String precio = String.format("%.2f", pedido.getOrder().getTotalConIva()); + txtPrecio.setText(precio + "€"); + + getRiesgo(); + + return view; + } + + public void splitOrder(){ + showProgress(true); + CmdSplitOrder cmd = new CmdSplitOrder(pedido.getOrder(), pedido); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + showProgress(false); + comprobarCredito(); + } + }); + execute(cmd); + } + + public void comprobarCredito() + { + boolean tieneCredito = false; + + if(pedido.getOrder().getCliente().getCredito() >= pedido.getOrder().getCliente().getRiesgo()+pedido.getTotal()) + tieneCredito = true; + + if(tieneCredito) + { + pedido.showFinalizar(false, true); + this.dismiss(); + } + else + { + double deuda = pedido.getOrder().getCliente().getRiesgo() - pedido.getOrder().getCliente().getCredito(); + pedido.pagar(pedido.getOrder().getTotalConIva() + deuda); + this.dismiss(); + } + } + + + public void getRiesgo() + { + showProgress(true); + CmdObtenerCreditoRiesgo cmd = new CmdObtenerCreditoRiesgo(pedido.getOrder().getCliente()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + pedido.getOrder().setCliente(((CmdObtenerCreditoRiesgo)cmd).getCliente()); + showProgress(false); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + getRiesgo(); + } + + @Override + public void Accept(CommandBase cmd) { + dismiss(); + } + }); + execute(cmd); + + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/AlmacenFacade.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/AlmacenFacade.java new file mode 100644 index 00000000..07dee152 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/AlmacenFacade.java @@ -0,0 +1,36 @@ +package com.verdnatura.verdnaturaventas.facade; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.verdnatura.verdnaturaventas.model.Tipo; + +import java.util.List; + +public class AlmacenFacade extends FacadeBase{ + + private static AlmacenFacade INSTANCE = new AlmacenFacade(); + private AlmacenFacade() { + setFacade("almacen"); + } + + public static AlmacenFacade getInstance() { + return INSTANCE; + } + + + public List ObtenerTipos(int warehouse, int reino) + { + String json = (String) ExecList(List.class, Commands.obtener_tipos, warehouse, reino); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public void ImprimirTicket(String ticket, int wid, boolean entrada) + { + Exec(String.class, Commands.imprimir_ticket, ticket, wid, entrada); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/Commands.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/Commands.java new file mode 100644 index 00000000..61bd1ea0 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/Commands.java @@ -0,0 +1,77 @@ +package com.verdnatura.verdnaturaventas.facade; + +public class Commands { + + + public static final String login = "login"; + + public static final String obtener_reinos = "obtener_reinos"; + + public static final String obtener_cliente = "obtener_cliente"; + + public static final String obtener_cliente_by_id = "obtener_cliente_by_id"; + + public static final String obtener_consignatarios = "obtener_consignatarios"; + + public static final String obtener_agencias = "obtener_agencias"; + + public static final String obtener_tipos = "obtener_tipos"; + + public static final String crear_orden = "crear_orden"; + + public static final String obtener_stock_tags = "obtener_stock_tags"; + + public static final String obtener_articulo_ventas_tags = "obtener_articulo_ventas_tags"; + + public static final String recalcular_precios_tags = "recalcular_precios_tags"; + + public static final String modificar_password = "modificar_password"; + + public static final String modificar_cliente = "modificar_cliente"; + + public static final String buscar_articulos_tags = "buscar_articulos_tags"; + + public static final String buscar_tipos = "buscar_tipos"; + + public static final String obtener_articulos_barcode_tags = "obtener_articulo_barcode_tags"; + + public static final String buscar_clientes = "buscar_clientes"; + + public static final String obtener_vistas = "obtener_vistas"; + + public static final String crear_order = "crear_order"; + + public static final String split_order = "split_order"; + + public static final String obtener_credito_riesgo = "obtener_credito_riesgo"; + + public static final String obtener_datos_pasar_banco = "obtener_datos_pasar_banco"; + + public static final String finalizar_transaccion = "finalizar_transaccion"; + + public static final String obtener_articulos_comprados_ultima_semana_tags = "obtener_articulos_comprados_ultima_semana_tags"; + + public static final String obtener_pedidos_tags = "obtener_pedidos_tags"; + + public static final String get_version = "get_version"; + + public static final String registrar_cliente_gcm = "registrar_cliente_gcm"; + + public static final String enviar_notificacion = "enviar_notificacion"; + + public static final String obtener_orders_activas_cliente = "obtener_orders_activas_cliente"; + + public static final String borrar_order = "borrar_order"; + + public static final String recuperar_pedido_tags = "recuperar_pedido_tags"; + + public static final String verificar_agencia = "verificar_agencia"; + + public static final String obtener_pedidos_realizados = "obtener_pedidos_realizados"; + + public static final String imprimir_ticket = "imprimir_ticket"; + + public static final String registrar_log = "registrar_log"; + + public static final String check_movimientos = "check_movimientos"; +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/ErrorInfo.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/ErrorInfo.java new file mode 100644 index 00000000..758bd13d --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/ErrorInfo.java @@ -0,0 +1,20 @@ +package com.verdnatura.verdnaturaventas.facade; + +public class ErrorInfo +{ + private String Type; + private String Message; + + public String getType() { + return Type; + } + public void setType(String type) { + Type = type; + } + public String getMessage() { + return Message; + } + public void setMessage(String message) { + Message = message; + } +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeBase.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeBase.java new file mode 100644 index 00000000..d71c43d2 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeBase.java @@ -0,0 +1,46 @@ +package com.verdnatura.verdnaturaventas.facade; + +import java.io.File; +import java.lang.reflect.Type; +import java.util.Map; + + +/** + * Created by nelo on 14/01/15. + */ +public class FacadeBase { + + private String facadeName = ""; + + private FacadeProvider facade = FacadeProvider.getInstance(); + + protected Object Exec(Type tipo, String command, Object... args) + { + return facade.Execute(tipo, facadeName, command, args); + } + + protected Object Exec(Type tipo, Map politypes, String command, Object... args) + { + return facade.Execute(tipo, politypes, facadeName, command, args); + } + + protected Object ExecList(Type tipo, String command, Object... args) + { + return facade.ExecuteList(tipo, facadeName, command, args); + } + + protected void ExecVoid(Type tipo, String command, Object... args) + { + facade.Execute(tipo, facadeName, command, args); + } + + protected void Download(File file, String command, Object...args) + { + facade.Download(file, facadeName, command, args); + } + + protected void setFacade(String facade) + { + this.facadeName = facade; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeClient.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeClient.java new file mode 100644 index 00000000..609e1403 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeClient.java @@ -0,0 +1,243 @@ +package com.verdnatura.verdnaturaventas.facade; + +import android.content.Context; +import android.util.Log; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; + +import org.apache.http.HttpResponse; +import org.apache.http.HttpStatus; +import org.apache.http.StatusLine; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.methods.HttpRequestBase; +import org.apache.http.conn.ClientConnectionManager; +import org.apache.http.conn.scheme.PlainSocketFactory; +import org.apache.http.conn.scheme.Scheme; +import org.apache.http.conn.scheme.SchemeRegistry; +import org.apache.http.conn.ssl.SSLSocketFactory; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.impl.conn.SingleClientConnManager; +import org.apache.http.params.CoreConnectionPNames; +import org.apache.http.params.HttpParams; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Type; +import java.security.KeyStore; +import java.util.Map; + +public class FacadeClient { + + private static FacadeClient INSTANCE = new FacadeClient(); + private Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + private static final String HOST = "https://app.verdnatura.es/"; + //private static final String HOST = "http://172.16.198.221:8080/"; + + /** + * tiempo de timeout en segundos de timeout de la conexion + */ + static final int CONNECTION_TIMEOUT = 10; + /** + * tiempo de timeout en segundos para esperar a los datos + */ + static final int DATA_TIMEOUT = 10; + + private DefaultHttpClient httpclient; + + private Context context; + + private FacadeClient() { + + //httpclient = new MyHttpClient(); + httpclient = new DefaultHttpClient(); + HttpParams httparams = httpclient.getParams(); + httparams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, CONNECTION_TIMEOUT * 1000); + httparams.setParameter(CoreConnectionPNames.SO_TIMEOUT, DATA_TIMEOUT * 1000); + httpclient.setParams(httparams); + context = MyApplication.getContext(); + } + + public static FacadeClient getInstance() { + return INSTANCE; + } + + public Object Execute(Type tipo, String facade, String command, Object... args) + { + String msg = InnerExecute(facade, command, args, null); + + Object obj = null; + + obj = gson.fromJson(msg, tipo); + + return obj; + } + + public Object Execute(Type tipo, Map politypes, String facade, String command, Object... args) + { + + String msg = InnerExecute(facade, command, args, null); + + Object obj = null; + + obj = gson.fromJson(msg, tipo); + return obj; + + } + + public Object ExecuteList(Type tipo, String facade, String command, Object... args) + { + String msg = InnerExecute(facade, command, args, null); + + return msg; + } + + public void Download(File file, String facade, String command, Object[] args) + { + InnerExecute(facade, command, args, file); + } + + public String DownloadString(String facade, String command, Object[] args) + { + return InnerExecute(facade, command, args, null); + } + + private String InnerExecute(String facade, String command, Object[] args, File file) + { + + String argsMessage = ""; + argsMessage = gson.toJson(args); + String msg = ""; + OutputStream output; + try + { + + if (file == null) + { + output = new ByteArrayOutputStream(); + WriteResponseToStream(facade, command, argsMessage, output); + msg = output.toString(); + output.close(); + } + else + { + output = new FileOutputStream(file); + WriteResponseToStream(facade, command, argsMessage, output); + output.close(); + } + + } + catch (FileNotFoundException e) { + // TODO Auto-generated catch block + throw new RuntimeException(e.getMessage()); + } catch (IOException e) { + // TODO Auto-generated catch block + throw new RuntimeException(e.getMessage()); + } + + + return msg; + } + + private void WriteResponseToStream(String facade, String command, String argsMessage, OutputStream resultstream) + { + + String url = HOST+facade+"/"+command; + + InputStream is = null; + Log.d("COMMAND SERVER",command.toString()); + HttpResponse response = null; + try + { + HttpRequestBase http; + + if(facade.equals("update") || facade.equals("bin")) + http = new HttpGet(url); + else + { + http = new HttpPost(url); + StringEntity st = new StringEntity(argsMessage, "UTF-8"); + ((HttpPost) http).setEntity(st); + } + + ControllerPreferences preferences = new ControllerPreferences(); + + http.addHeader("Content-Type", "json"); + http.addHeader("user", preferences.getUser()); + http.addHeader("pass", preferences.getPass()); + http.addHeader("aplicacion", "VENTAS"); + + response = httpclient.execute(http); + + StatusLine sl = response.getStatusLine(); + int sc = sl.getStatusCode(); + if (sc == HttpStatus.SC_OK || sc == 555) + { + + if(sc == 555) + { + ErrorInfo error = gson.fromJson(sl.getReasonPhrase(), ErrorInfo.class); + throw new FacadeUserException(error.getMessage(), error.getType()); + } + else + { + + is = response.getEntity().getContent(); + + double totalContent = response.getEntity().getContentLength(); + + byte[] buffer = new byte[16 * 1024]; + int read = 0; + int totalRead = 0; + while ((read = is.read(buffer)) != -1) { + resultstream.write(buffer, 0, read); + totalRead += read; + + } + Log.d("RESPUESTA SERVER",resultstream.toString()); + } + + + } + else { + throw new RuntimeException("Error " +sl.getStatusCode()+": "+sl.getReasonPhrase()); + } + + } + catch (ClientProtocolException e){ + throw new RuntimeException(e.getMessage()); + } + catch (IOException e) { + //throw new RuntimeException(e.getMessage()); + throw new RuntimeException("No se ha podido conectar con el servidor"); + } + finally + { + if(is != null) + try { + is.close(); + } catch (IOException e) { + throw new RuntimeException(e.getMessage()); + } + } + + } + + public void setContext(Context c) + { + this.context = c; + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeException.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeException.java new file mode 100644 index 00000000..91371f1a --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeException.java @@ -0,0 +1,16 @@ +package com.verdnatura.verdnaturaventas.facade; + +public class FacadeException extends RuntimeException{ + + public FacadeException(String s) { super(s); } + private String Type; + + public String getType() { + return Type; + } + public void setType(String type) { + Type = type; + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeProvider.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeProvider.java new file mode 100644 index 00000000..105e80e2 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeProvider.java @@ -0,0 +1,89 @@ +package com.verdnatura.verdnaturaventas.facade; + + +import java.io.File; +import java.lang.reflect.Type; +import java.util.Map; + +public class FacadeProvider { + + private FacadeClient client = FacadeClient.getInstance(); + + private static FacadeProvider INSTANCE = new FacadeProvider(); + + private FacadeProvider() {} + + public static FacadeProvider getInstance() { + return INSTANCE; + } + + public Object Execute(Type tipo, String facade, String command, Object... args) + { + try + { + return client.Execute(tipo, facade, command, args); + } + catch(FacadeUserException fuex) + { + throw CreateFacadeException(fuex); + } + } + + public Object ExecuteList(Type tipo, String facade, String command, Object... args) + { + try + { + return client.ExecuteList(tipo, facade, command, args); + } + catch(FacadeUserException fuex) + { + throw CreateFacadeException(fuex); + } + } + + public Object Execute(Type tipo, Map politypes, String facade, String command, Object... args) { + try + { + return client.Execute(tipo, politypes, facade, command, args); + } + catch (FacadeUserException fuex) + { + throw CreateFacadeException(fuex); + } + } + + public void Download(File file, String facade, String command, Object[] args) + { + try + { + client.Download(file, facade, command, args); + } + catch (FacadeUserException fuex) + { + throw CreateFacadeException(fuex); + } + } + + public String DownloadString(String facade, String command, Object[] args) + { + try + { + return client.DownloadString(facade, command, args); + } + catch (FacadeUserException fuex) + { + throw CreateFacadeException(fuex); + } + } + + + private FacadeException CreateFacadeException(FacadeUserException fuex) + { + FacadeException fx = new FacadeException(fuex.getMessage()); + fx.setType(fuex.Type); + return fx; + } + + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeUserException.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeUserException.java new file mode 100644 index 00000000..ae3dd287 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/FacadeUserException.java @@ -0,0 +1,18 @@ +package com.verdnatura.verdnaturaventas.facade; + +public class FacadeUserException extends RuntimeException +{ + public FacadeUserException(String message) + { + super(message); + } + + public FacadeUserException(String message, String Type) + { + super(message); + this.Type = Type; + } + + public String Type; + +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/SecurityFacade.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/SecurityFacade.java new file mode 100644 index 00000000..63c9bd2b --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/SecurityFacade.java @@ -0,0 +1,32 @@ +package com.verdnatura.verdnaturaventas.facade; + +public class SecurityFacade extends FacadeBase{ + + private static SecurityFacade INSTANCE = new SecurityFacade(); + + private SecurityFacade() { + setFacade("security"); + } + + public static SecurityFacade getInstance() { + return INSTANCE; + } + + private FacadeProvider facade = FacadeProvider.getInstance(); + + public String Login(String User, String Pass) + { + return (String) Exec(String.class, Commands.login, User, Pass); + } + + public void ModificarPassword(String password, int cid) + { + Exec(String.class, Commands.modificar_password, password, cid); + } + + public void RegistrarLog(String error, String device, String user, String android_version) + { + Exec(String.class, Commands.registrar_log, error, device, user, android_version); + } +} + diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/VentasFacade.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/VentasFacade.java new file mode 100644 index 00000000..9ecc5dda --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/facade/VentasFacade.java @@ -0,0 +1,230 @@ +package com.verdnatura.verdnaturaventas.facade; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.verdnatura.verdnaturaventas.model.Agencia; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.Consignatario; +import com.verdnatura.verdnaturaventas.model.Order; +import com.verdnatura.verdnaturaventas.model.OrderImprimir; +import com.verdnatura.verdnaturaventas.model.OrderResumen; +import com.verdnatura.verdnaturaventas.model.ParamsBanco; +import com.verdnatura.verdnaturaventas.model.TicketRecepcion; +import com.verdnatura.verdnaturaventas.model.TicketRecepcionLineasTags; +import com.verdnatura.verdnaturaventas.model.Tipo; +import com.verdnatura.verdnaturaventas.model.Vista; + +import java.util.List; + +public class VentasFacade extends FacadeBase{ + + private static VentasFacade INSTANCE = new VentasFacade(); + + private VentasFacade() { + setFacade("ventas"); + } + + public static VentasFacade getInstance() { + return INSTANCE; + } + + public List ObtenerConsignatarios(int cliente) + { + String json = (String) ExecList(List.class, Commands.obtener_consignatarios, cliente); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public List ObtenerAgencias(String fecha, int consignatario) + { + String json = (String) ExecList(List.class, Commands.obtener_agencias, fecha, consignatario); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public Order CrearOrden(String fecha, int consignatario, int agencia) + { + return (Order) Exec(Order.class, Commands.crear_orden, fecha, consignatario, agencia); + } + + public List ObtenerStock(String fecha, int consignatario, int agencia, int tipo, String cadena) + { + String json = (String) ExecList(List.class, Commands.obtener_stock_tags, fecha, consignatario, agencia, tipo, cadena); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public ClienteVentas ObtenerCliente(String User, String Pass) + { + return (ClienteVentas) Exec(ClienteVentas.class, Commands.obtener_cliente, User, Pass); + } + + public ClienteVentas ObtenerClienteById(int id) + { + return (ClienteVentas) Exec(ClienteVentas.class, Commands.obtener_cliente_by_id, id); + } + + public ArticuloVentasTags ObtenerArticuloVenta(String fecha, int consignatario, int agencia, int tipo, int iid, int wid) + { + return (ArticuloVentasTags) Exec(ArticuloVentasTags.class, Commands.obtener_articulo_ventas_tags, fecha, consignatario, agencia, tipo, iid, wid); + + } + + public Order RecalcularPrecios(Order o) + { + return (Order) Exec(Order.class, Commands.recalcular_precios_tags, o); + + } + + public void ModificarCliente(ClienteVentas cliente) + { + Exec(String.class, Commands.modificar_cliente, cliente); + + } + + public List BuscarArticulos(String cadena, String fecha, int cid, int aid) + { + String json = (String) ExecList(List.class, Commands.buscar_articulos_tags, cadena, fecha, cid, aid); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public List BuscarTipos(String cadena, int agencia, int consignatario, String fecha, int reino) + { + String json = (String) ExecList(List.class, Commands.buscar_tipos, cadena, agencia, consignatario, fecha, reino); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + + public ArticuloVentasTags ObtenerArticuloBarcode(String fecha, int consignatario, int agencia, String iid, int wid) + { + return (ArticuloVentasTags) Exec(ArticuloVentasTags.class, Commands.obtener_articulos_barcode_tags, fecha, consignatario, agencia, iid, wid); + + } + + public List BuscarClientes(String cadena) + { + String json = (String) ExecList(List.class, Commands.buscar_clientes, cadena); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public List ObtenerVistas() + { + String json = (String) ExecList(List.class, Commands.obtener_vistas); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public Order CrearOrder(Order order) + { + return (Order) Exec(Order.class, Commands.crear_order, order); + } + + public Order SplitOrder(Order order) + { + return (Order) Exec(Order.class, Commands.split_order, order); + } + + public ClienteVentas ObtenerCreditoRiesgo(ClienteVentas cliente) + { + return (ClienteVentas) Exec(ClienteVentas.class, Commands.obtener_credito_riesgo, cliente); + } + + public ParamsBanco ObtenerDatosPasarBanco(double cantidad, String fecha, int cliente) + { + return (ParamsBanco) Exec(ParamsBanco.class, Commands.obtener_datos_pasar_banco, cantidad, fecha, cliente); + } + + public void FinalizarTransaccion(String status, int id) + { + Exec(String.class, Commands.finalizar_transaccion, status, id); + } + + public List ObtenerArticulosCompradosUltimaSemana() + { + String json = (String) ExecList(List.class, Commands.obtener_articulos_comprados_ultima_semana_tags); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public List ObtenerPedidos(int cliente) + { + String json = (String) ExecList(List.class, Commands.obtener_pedidos_tags, cliente); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public String GetVersion() + { + return (String) Exec(String.class, Commands.get_version); + } + + public void RegistrarGCM(int cli, String and){ + Exec(String.class, Commands.registrar_cliente_gcm, cli, and); + } + + public void BorrarOrder(OrderResumen order) + { + Exec(String.class, Commands.borrar_order, order); + } + + public void EnviarNotificacion() + { + Exec(String.class, Commands.enviar_notificacion); + } + + public List ObtenerPedidosPendientes(int cliente) + { + String json = (String) ExecList(List.class, Commands.obtener_orders_activas_cliente, cliente); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public Order RecuperarOrder(OrderResumen orderResumen) + { + return (Order) Exec(Order.class, Commands.recuperar_pedido_tags, orderResumen); + } + + public boolean VerificarAgencia(int consigna, int agencia, String fecha) + { + return (boolean) Exec(boolean.class, Commands.verificar_agencia, consigna, agencia, fecha); + } + + public List ObtenerPedidosRealizados() + { + String json = (String) ExecList(List.class, Commands.obtener_pedidos_realizados); + + Gson gson = new GsonBuilder().setDateFormat("dd/MM/yyyy").create(); + + return gson.fromJson(json, new TypeToken>(){}.getType()); + } + + public void CheckMovimientos(List movimientos){ + Exec(String.class, Commands.check_movimientos, movimientos); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentAgencias.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentAgencias.java new file mode 100644 index 00000000..17950fcb --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentAgencias.java @@ -0,0 +1,124 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.RelativeLayout; + +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterAgencias; +import com.verdnatura.verdnaturaventas.model.Agencia; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 13/01/15. + */ +public class FragmentAgencias extends FragmentBase{ + + public static final String VISTA = "VISTA"; + public static final String AGENCIAS = "AGENCIAS"; + + private TextViewRoboto txtConsignatario, txtTitle; + private RelativeLayout rltConsignatario; + private RecyclerView lstAgencias; + + private List agencias; + private String vista; + + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + vista = args.getString(VISTA); + agencias = args.getParcelableArrayList(AGENCIAS); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putString(VISTA, vista); + outState.putParcelableArrayList(AGENCIAS, (ArrayList) agencias); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_agencia, container, false); + + rltConsignatario = (RelativeLayout)view.findViewById(R.id.relative_agencia_direccion); + txtConsignatario = (TextViewRoboto)view.findViewById(R.id.text_agencia_consignatario); + lstAgencias = (RecyclerView)view.findViewById(R.id.listview_agencias); + txtTitle = (TextViewRoboto)view.findViewById(R.id.textview_agencia_title); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + txtConsignatario.setText(getDomicilioConsignatario()); + rltConsignatario.setOnClickListener(new OnClick()); + txtTitle.setTypeface(TextViewRoboto.ROBOTO_THIN); + vista = vista.toLowerCase(); + txtTitle.setText(vista); + + rellenarLista(); + + } + + public void rellenarLista() + { + final AdapterAgencias adaptador = new AdapterAgencias(agencias); + setListControllerLayout(lstAgencias); + lstAgencias.setAdapter(adaptador); + lstAgencias.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + lstAgencias.setItemAnimator(new DefaultItemAnimator()); + adaptador.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Agencia agencia = adaptador.getItem(lstAgencias.getChildPosition(v)); + setAgenciaActiva(agencia); + } + }); + } + + @Override + protected void setClickActions(int id) { + super.setClickActions(id); + switch (id) + { + case R.id.relative_agencia_direccion: + Bundle bundle = new Bundle(); + bundle.putString(FragmentConsignatarios.TIPO, FragmentConsignatarios.TIPO_AGENCIA); + activity.cambiarFragment(new FragmentConsignatarios(), bundle); + break; + } + } + + public String getDomicilioConsignatario() + { + return pedido.getOrder().getConsignatarioActivo().getDomicilio(); + } + + public void setAgenciaActiva(Agencia a) + { + pedido.getOrder().setAgenciaAntigua(pedido.getOrder().getAgencia()); + pedido.setAgencia(a); + if(pedido.getOrder().getRows().size() > 0) + activity.cambiarFragment(new FragmentPreciosRecalculados()); + else + activity.finish(); + + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentArticulos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentArticulos.java new file mode 100644 index 00000000..feba3261 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentArticulos.java @@ -0,0 +1,148 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.graphics.Color; +import android.os.Bundle; +import android.os.Parcelable; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterArticulos; +import com.verdnatura.verdnaturaventas.command.CmdObtenerStock; +import com.verdnatura.verdnaturaventas.controller.ControllerArticulo; +import com.verdnatura.verdnaturaventas.core.Colores; +import com.verdnatura.verdnaturaventas.core.UtilsAndroid; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ParametrosReino; +import com.verdnatura.verdnaturaventas.model.Tipo; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarColores; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 13/01/15. + */ +public class FragmentArticulos extends FragmentBase{ + + public static final String TIPO = "TIPO"; + public static final String ARTICULOS = "ARTICULOS"; + + private RecyclerView lstArticulos; + private List articulos; + private ParametrosReino parametros; + private AdapterArticulos adapter; + private Tipo tipo; + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + articulos = args.getParcelableArrayList(ARTICULOS); + parametros = args.getParcelable(FragmentFamilias.PARAMETROS); + tipo = args.getParcelable(TIPO); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelableArrayList(ARTICULOS, (ArrayList) articulos); + outState.putParcelable(FragmentFamilias.PARAMETROS, parametros); + outState.putParcelable(TIPO, tipo); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + View view = inflater.inflate(R.layout.fragment_articulos, container, false); + super.onCreateView(inflater, container, args); + lstArticulos = (RecyclerView)view.findViewById(R.id.listview_fragment_articulos_articulos); + view.setBackgroundColor(Color.WHITE); + progress = (ProgressBar) view.findViewById(R.id.progress_fragment); + contenedor = lstArticulos; + + mostrarToolbarFamilias(); + return view; + } + + @Override + public void onResume() { + super.onResume(); + if(articulos == null) + verStock(); + } + + public void verStock() + { + showProgress(true); + CmdObtenerStock cmd = new CmdObtenerStock(parametros.getFecha(), parametros.getConsignatario(), parametros.getAgencia(), tipo.getId_Tipo(), parametros.getCadena()); + cmd.setOnFinished(new CommandOperation() { + + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + articulos = ((CmdObtenerStock) cmd).getArticulos(); + setAdapter(); + + showProgress(false); + } + }); + + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + verStock(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + execute(cmd); + } + + public void mostrarToolbarFamilias() + { + ToolbarColores tool = new ToolbarColores(activity, tipo.getTipo(), true, ToolbarColores.BUSCAR_DIALOG); + activity.crearToolbar(tool, Colores.getColor(tipo.getReino()), Colores.getColorDark(tipo.getReino())); + } + + @Override + public void recalcularPrecios() { + super.recalcularPrecios(); + adapter.notifyDataSetChanged(); + } + + public void setAdapter() + { + adapter = new AdapterArticulos(articulos, activity); + setListControllerLayout(lstArticulos); + lstArticulos.setAdapter(adapter); + lstArticulos.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + if(!activity.getResources().getBoolean(R.bool.is_phone)) { + adapter = new AdapterArticulos(articulos, true, activity); + lstArticulos.setAdapter(adapter); + int spanCount = (int) (UtilsAndroid.getWidth(activity) / activity.getResources().getDimension(R.dimen.item_articulo_grid_width)); + lstArticulos.setLayoutManager(new GridLayoutManager(activity, spanCount)); + } + + lstArticulos.setItemAnimator(new DefaultItemAnimator()); + adapter.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + ArticuloVentasTags a = adapter.getItem(lstArticulos.getChildPosition(v)); + ControllerArticulo.verDetalle(a, activity); + } + }); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentBase.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentBase.java new file mode 100644 index 00000000..35462a85 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentBase.java @@ -0,0 +1,113 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.app.Activity; +import android.content.DialogInterface; +import android.os.Bundle; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.view.animation.Animation; +import android.view.animation.AnimationUtils; +import android.view.animation.LayoutAnimationController; +import android.widget.ListView; +import android.widget.Toast; + +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; + + +/** + * Created by nelo on 12/01/15. + */ +public class FragmentBase extends com.nelosan.baselibrary.fragment.FragmentBase implements DialogInterface.OnDismissListener{ + + protected ControllerPedido pedido; + protected ControllerPreferences preferences; + protected ActivityBase activity; + protected boolean dialogoAbierto = false; + protected boolean inicializado = false; + + private static final String INICIALIZADO = "INICIALIZADO"; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + preferences = new ControllerPreferences(); + + Bundle args = getArguments(); + + if(savedInstanceState != null) { + inicializado = savedInstanceState.getBoolean(INICIALIZADO, true); + loadArgs(savedInstanceState); + } + + else if(args != null){ + loadArgs(args); + } + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putBoolean(INICIALIZADO, inicializado); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { + pedido = new ControllerPedido(activity); + return super.onCreateView(inflater, container, savedInstanceState); + } + + @Override + public void onAttach(Activity activity) { + super.onAttach(activity); + this.activity = (ActivityBase)activity; + } + + @Override + public void onDismiss(DialogInterface dialog) { + dialogoAbierto = false; + } + + protected void mostrarToast(String msg){ + Toast.makeText(activity, msg, Toast.LENGTH_SHORT).show(); + } + + public void recalcularPrecios() {} + + public void showElements(View... elements) + { + int i = 0; + for(View v : elements) + { + Animation items = AnimationUtils.loadAnimation(activity, R.anim.load_items); + items.setStartOffset(50 * i); + v.startAnimation(items); + i++; + } + } + + public void setListControllerLayout(ListView lst) + { + if(!inicializado) { + LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation( + activity, R.anim.item_controller); + lst.setLayoutAnimation(controller); + inicializado = true; + } + } + + public void setListControllerLayout(RecyclerView lst) + { + if(!inicializado) { + LayoutAnimationController controller = AnimationUtils.loadLayoutAnimation( + activity, R.anim.item_controller); + lst.setLayoutAnimation(controller); + inicializado = true; + } + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentConfigurarPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentConfigurarPedido.java new file mode 100644 index 00000000..6918bb32 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentConfigurarPedido.java @@ -0,0 +1,144 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.content.Intent; +import android.os.Bundle; +import androidx.cardview.widget.CardView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import com.getbase.floatingactionbutton.FloatingActionButton; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.Agencias; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.dialog.DialogCalendarMain; +import com.verdnatura.verdnaturaventas.model.Agencia; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarColores; + + +/** + * Created by nelo on 7/05/15. + */ +public class FragmentConfigurarPedido extends FragmentBase { + + private TextViewRoboto txtFecha, txtAgencia, txtClientes; + private CardView lnrFecha, lnrAgencia, lnrClientes; + private FloatingActionButton btnAceptar; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_configurar_pedido, container, false); + + lnrClientes = (CardView)view.findViewById(R.id.linear_fragment_configurar_pedido_cliente); + lnrClientes.setOnClickListener(new OnClick()); + lnrAgencia = (CardView)view.findViewById(R.id.linear_fragment_configurar_pedido_agencia); + lnrAgencia.setOnClickListener(new OnClick()); + lnrFecha = (CardView)view.findViewById(R.id.linear_fragment_configurar_pedido_fecha); + lnrFecha.setOnClickListener(new OnClick()); + txtFecha = (TextViewRoboto)view.findViewById(R.id.textview_fragment_configurar_pedido_llegada); + txtAgencia = (TextViewRoboto)view.findViewById(R.id.textview_fragment_configurar_pedido_agencia); + txtClientes = (TextViewRoboto)view.findViewById(R.id.textview_fragment_configurar_pedido_cliente); + btnAceptar = (FloatingActionButton)view.findViewById(R.id.button_fragment_configurar_pedido_aceptar); + btnAceptar.setOnClickListener(new OnClick()); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (RelativeLayout)view.findViewById(R.id.relative_fragment_configurar_perdido_contenedor); + + activity.crearToolbar(new ToolbarColores(activity, activity.getResources().getString(R.string.configurar_pedido), true, ToolbarColores.BUSCAR_DIALOG)); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + setFecha(); + + if(pedido.getOrder().getCliente() != null) + { + txtClientes.setText(pedido.getOrder().getCliente().getCliente()); + lnrAgencia.setEnabled(true); + } + if(pedido.getOrder().getCliente() != null) + { + txtClientes.setText(pedido.getOrder().getCliente().getCliente()); + } + + if(!inicializado) { + showElements(lnrClientes, lnrFecha, lnrAgencia, btnAceptar); + inicializado = true; + } + } + + @Override + public void onResume() { + super.onResume(); + pedido = new ControllerPedido(activity); + pintarAgencia(); + } + + @Override + protected void setClickActions(int id) { + super.setClickActions(id); + switch (id) + { + case R.id.linear_fragment_configurar_pedido_cliente: + activity.buscarClientes(); + break; + + case R.id.linear_fragment_configurar_pedido_agencia: + if(pedido.comprobarSeleccionCliente(true, preferences.recuperarCliente())) + startActivity(new Intent(activity, Agencias.class)); + break; + + case R.id.linear_fragment_configurar_pedido_fecha: + DialogCalendarMain dialog = new DialogCalendarMain(); + dialog.show(getFragmentManager(), "calendar"); + break; + + case R.id.button_fragment_configurar_pedido_aceptar: + finalizarConfiguracionPedido(); + break; + + } + } + + public void finalizarConfiguracionPedido() + { + activity.cambiarFragment(new FragmentMain()); + } + + + public void setClienteOrder(ClienteVentas cliente) { + this.pedido.setCliente(cliente); + txtClientes.setText(pedido.getOrder().getCliente().getCliente()); + showProgress(false); + } + + public void pintarAgencia() + { + if(pedido.getOrder() != null && pedido.getOrder().getAgencia() != null) { + Agencia a = pedido.getOrder().getAgencia(); + txtAgencia.setText(a.getAgencia().toLowerCase()); + } + else + { + txtAgencia.setText(getActivity().getResources().getString(R.string.main_select)); + } + } + + public void setFecha() + { + pedido = new ControllerPedido(activity); + pedido.setAgencia(null); + pedido.guardarOrder(); + pintarAgencia(); + txtFecha.setText(pedido.getOrder().getCalendario().getTextoFecha()); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentConsignatarios.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentConsignatarios.java new file mode 100644 index 00000000..48623732 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentConsignatarios.java @@ -0,0 +1,96 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterConsignatarios; +import com.verdnatura.verdnaturaventas.dialog.AlertConsignatarioDefecto; +import com.verdnatura.verdnaturaventas.model.Consignatario; + +/** + * Created by nelo on 14/01/15. + */ +public class FragmentConsignatarios extends FragmentBase { + + private RecyclerView lstConsignatarios; + public static final String TIPO_VISTA = "TIPO_VISTA"; + public static final String TIPO_AGENCIA = "TIPO_AGENCIA"; + public static final String TIPO = "TIPO"; + private String tipo; + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + tipo = args.getString(TIPO, ""); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putString(TIPO, tipo); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_consignatarios, container, false); + lstConsignatarios = (RecyclerView)view.findViewById(R.id.listview_fragment_consignatarios); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + rellenarLista(); + } + + public void borrarFragments() + { + activity.onBackPressed(); + if(tipo.equals(TIPO_AGENCIA)) + { + activity.onBackPressed(); + activity.onBackPressed(); + } + else if(tipo.equals(TIPO_VISTA)){ + activity.onBackPressed(); + } + } + + public void rellenarLista() + { + final AdapterConsignatarios adaptador = new AdapterConsignatarios(pedido.getConsignatarios()); + setListControllerLayout(lstConsignatarios); + lstConsignatarios.setAdapter(adaptador); + lstConsignatarios.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + lstConsignatarios.setItemAnimator(new DefaultItemAnimator()); + adaptador.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Consignatario c = adaptador.getItem(lstConsignatarios.getChildPosition(v)); + pedido.setConsignatarioActivo(c); + borrarFragments(); + activity.cambiarFragment(new FragmentVistas()); + } + }); + adaptador.setLongclick(new View.OnLongClickListener() { + @Override + public boolean onLongClick(View v) { + Consignatario c = adaptador.getItem(lstConsignatarios.getChildPosition(v)); + AlertConsignatarioDefecto dialog = new AlertConsignatarioDefecto(activity, c); + return true; + } + }); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentCuenta.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentCuenta.java new file mode 100644 index 00000000..97519fef --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentCuenta.java @@ -0,0 +1,170 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.app.Activity; +import android.os.Bundle; +import androidx.cardview.widget.CardView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.CompoundButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.Switch; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdModificarCliente; +import com.verdnatura.verdnaturaventas.dialog.DialogCambiarPassword; +import com.verdnatura.verdnaturaventas.dialog.DialogCambiarEmail; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarColores; + +/** + * Created by nelo on 24/02/15. + */ +public class FragmentCuenta extends FragmentBase { + + private TextViewRoboto txtUsuario, txtNumeroUsuario, txtMail; + private Switch swtMail, swtNotificaciones; + private ImageView imgCambiarPassword, imgEmail; + private CardView cardNumero, cardMail, cardInvoice; + private ClienteVentas cliente; + + @Override + public void onAttach(Activity activity) { + // TODO Auto-generated method stub + super.onAttach(activity); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_cuenta, container, false); + txtUsuario = (TextViewRoboto)view.findViewById(R.id.textview_fragment_cuenta_nombre_usuario); + txtNumeroUsuario = (TextViewRoboto)view.findViewById(R.id.textview_fragment_cuenta_numero_usuario); + txtMail = (TextViewRoboto)view.findViewById(R.id.textview_fragment_cuenta_nombre_mail); + swtMail = (Switch)view.findViewById(R.id.switch_fragment_cuenta_mail); + swtNotificaciones = (Switch)view.findViewById(R.id.switch_fragment_cuenta_notifications); + imgCambiarPassword = (ImageView)view.findViewById(R.id.imageview_fragment_cuenta_cambiar_password); + imgEmail = (ImageView)view.findViewById(R.id.imageview_fragment_cuenta_cambiar_email); + progress = (ProgressBar) view.findViewById(R.id.progress_fragment); + contenedor = (LinearLayout)view.findViewById(R.id.linear_cuenta_contenedor); + cardNumero = (CardView)view.findViewById(R.id.cardview_fragment_cuenta_numero); + cardMail = (CardView)view.findViewById(R.id.cardview_fragment_cuenta_mail);; + cardInvoice = (CardView)view.findViewById(R.id.cardview_fragment_cuenta_invoice); + + imgCambiarPassword.setOnClickListener(new OnClick()); + imgEmail.setOnClickListener(new OnClick()); + + swtMail.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (inicializado) + cambiarFactura(isChecked); + } + }); + + swtNotificaciones.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if(inicializado) + preferences.setRecibirNotificaciones(); + } + }); + + activity.crearToolbar(new ToolbarColores(activity, activity.getResources().getString(R.string.fragment_cuenta_cuenta), true, null)); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + if(pedido.getOrder().getCliente() != null) + cliente = pedido.getOrder().getCliente(); + else + cliente = preferences.recuperarCliente(); + + if(preferences.recuperarCliente().getId_Cliente() != cliente.getId_Cliente()) + swtNotificaciones.setVisibility(View.GONE); + + txtUsuario.setText(cliente.getName()); + txtNumeroUsuario.setText("" + cliente.getId_Cliente()); + txtMail.setText(cliente.getEmail()); + if(cliente.getMail() != 0) + swtMail.setChecked(true); + else + swtMail.setChecked(false); + swtNotificaciones.setChecked(preferences.recibirNotificaciones()); + showElements(cardNumero, cardMail, cardInvoice); + inicializado = true; + } + + @Override + protected void setClickActions(int id) { + super.setClickActions(id); + switch (id) + { + case R.id.imageview_fragment_cuenta_cambiar_password: + DialogCambiarPassword dialog = new DialogCambiarPassword(); + dialog.show(getFragmentManager(), "dialogPassword"); + break; + + case R.id.imageview_fragment_cuenta_cambiar_email: + DialogCambiarEmail dialogMail = new DialogCambiarEmail(); + dialogMail.show(getFragmentManager(), "dialogMail"); + break; + } + } + + public void cambiarFactura(boolean recibir) + { + if(recibir) + cliente.setMail(1); + else + cliente.setMail(0); + + actualizarCliente(); + } + + public void actualizarCliente() + { + showProgress(true); + + CmdModificarCliente cmd = new CmdModificarCliente(cliente); + cmd.setOnFinished(new CommandOperation() { + + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + showProgress(false); + if(preferences.recuperarCliente().getId_Cliente() == cliente.getId_Cliente()) + preferences.guardarCliente(cliente); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + actualizarCliente(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.cambiarFragment(new FragmentCuenta()); + } + }); + execute(cmd); + + } + + public void setEmail(String mail) + { + txtMail.setText(mail); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentDetalleArticulo.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentDetalleArticulo.java new file mode 100644 index 00000000..d8b5173e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentDetalleArticulo.java @@ -0,0 +1,334 @@ +package com.verdnatura.verdnaturaventas.fragment; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.github.ksoichiro.android.observablescrollview.ObservableScrollView; +import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; +import com.github.ksoichiro.android.observablescrollview.ScrollState; +import com.github.ksoichiro.android.observablescrollview.ScrollUtils; +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.nelosan.baselibrary.dialog.DialogBuscar; +import com.nineoldandroids.view.ViewHelper; +import com.nelosan.baselibrary.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdObtenerArticuloBarcode; +import com.verdnatura.verdnaturaventas.command.CmdObtenerArticuloVenta; +import com.verdnatura.verdnaturaventas.controller.ControllerArticulo; +import com.verdnatura.verdnaturaventas.core.Colores; +import com.verdnatura.verdnaturaventas.core.ItemArticuloRelacionado; +import com.verdnatura.verdnaturaventas.core.ItemTag; +import com.verdnatura.verdnaturaventas.core.LinearTags; +import com.verdnatura.verdnaturaventas.core.Static; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; + +import java.util.List; + +/** + * Created by nelo on 22/01/15. + */ +public class FragmentDetalleArticulo extends FragmentBase implements ObservableScrollViewCallbacks { + + public static final String ARTICULO = "ARTICULO"; + public static final String ARTICULO_RECUPERADO = "ARTICULO_RECUPERADO"; + public static final String BARCODE = "BARCODE"; + + private ImageView imgFoto, imgBuscar, imgCarrito, imgPanel; + private TextViewRoboto txtNombre, txtSimilares, txtDisponible, txtComprados, txtTextoDisponible, txtTextComprar, txtDescipcion; + private TextView txtToolbarTitle, txtEmpty; + private LinearLayout lnrRelacionados, lnrComprados; + private LinearTags lnrTags; + private RelativeLayout relativeLayout; + private ObservableScrollView mScrollView; + private View mToolbarView; + + private ArticuloVentasTags articulo, articuloRecuperado; + private String barcode; + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + articulo = args.getParcelable(ARTICULO); + articuloRecuperado = args.getParcelable(ARTICULO_RECUPERADO); + dialogoAbierto = args.getBoolean("DIALOGO", false); + barcode = args.getString(BARCODE, null); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelable(ARTICULO, articulo); + outState.putParcelable(ARTICULO_RECUPERADO, articuloRecuperado); + outState.putBoolean("DIALOGO", dialogoAbierto); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + activity.crearToolbar(null); + + View view = inflater.inflate(R.layout.fragment_articulo_toolbar, container, false); + + imgFoto = (ImageView)view.findViewById(R.id.imageview_fragment_articulo_foto); + txtNombre = (TextViewRoboto)view.findViewById(R.id.textview_fragment_articulo_nombre); + txtDisponible = (TextViewRoboto)view.findViewById(R.id.textview_fragment_articulo_disponible); + txtTextoDisponible = (TextViewRoboto)view.findViewById(R.id.textview_fragment_articulo_disponible_disponible); + lnrRelacionados = (LinearLayout)view.findViewById(R.id.linear_fragment_detalle_articulo_relacionados); + lnrComprados = (LinearLayout)view.findViewById(R.id.linear_fragment_detalle_articulo_comprados); + lnrTags = (LinearTags) view.findViewById(R.id.article_tags); + relativeLayout = (RelativeLayout)view.findViewById(R.id.relative_fragment_articulo_contenedor); + txtSimilares = (TextViewRoboto)view.findViewById(R.id.textview_fragment_articulo_similares); + txtComprados = (TextViewRoboto)view.findViewById(R.id.textview_fragment_articulo_comprados); + txtTextComprar = (TextViewRoboto)view.findViewById(R.id.textview_fragment_articulo_comprar); + mScrollView = (ObservableScrollView) view.findViewById(R.id.scrollview_fragment_detalle_articulo_scroll); + mToolbarView = view.findViewById(R.id.relativelayout_toolbar_colores_background); + txtToolbarTitle = (TextView)view.findViewById(R.id.textview_toolbar_colores_titulo); + txtEmpty = (TextView)view.findViewById(R.id.text_empty); + imgBuscar = (ImageView)view.findViewById(R.id.imageview_toolbar_colores_buscar); + imgPanel = (ImageView)view.findViewById(R.id.imageview_toolbar_colores_panel); + imgCarrito = (ImageView)view.findViewById(R.id.imageview_toolbar_colores_carrito); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment_articulo); + txtDescipcion = (TextViewRoboto) view.findViewById(R.id.textview_fragment_articulo_disponible_descripcion); + contenedor = relativeLayout; + + return view; + } + + public void createView(){ + + int color = Colores.getColor(articulo.getReino()); + activity.pintarBarraSuperior(Colores.getColorDark(articulo.getReino())); + txtTextComprar.setTextColor(color); + mToolbarView.setBackgroundColor(ScrollUtils.getColorWithAlpha(0, color)); + + imgBuscar.setOnClickListener(new OnClick()); + imgPanel.setOnClickListener(new OnClick()); + imgCarrito.setOnClickListener(new OnClick()); + imgFoto.setOnClickListener(new OnClick()); + txtTextComprar.setOnClickListener(new OnClick()); + + txtNombre.setText(articulo.getArticle()); + txtDisponible.setText(getActivity().getResources().getString(R.string.fragment_detalle_articulo_disponible, (int) articulo.getAvailable())); + txtTextoDisponible.setTypeface(TextViewRoboto.ROBOTO_THIN_ITALIC); + txtSimilares.setTypeface(TextViewRoboto.ROBOTO_THIN); + txtComprados.setTypeface(TextViewRoboto.ROBOTO_THIN); + txtDescipcion.setTypeface(TextViewRoboto.ROBOTO_REGULAR); + txtDescipcion.setText(articulo.getDescripcion()); + if(txtDescipcion.getText().toString().length() == 0) + txtDescipcion.setVisibility(View.GONE); + + lnrTags.generateTags(articulo.getTags()); + + /*txtUnidas.setText(articulo.getUnidades()+ " "+getResources().getString(R.string.fragment_articulo_unidades)); + if(articulo.getUnidades() >= 1) + txtUnidas.setVisibility(View.GONE);*/ + + mScrollView.setScrollViewCallbacks(this); + txtToolbarTitle.setText(articulo.getTipo()); + + if(articulo.getArticulosSimilares() != null && articulo.getArticulosSimilares().size() > 0) + mostrarArticulosRelacionados(articulo.getArticulosSimilares(), lnrRelacionados); + else + { + txtSimilares.setVisibility(View.GONE); + lnrRelacionados.setVisibility(View.GONE); + } + + if(articulo.getArticulosComprados() != null && articulo.getArticulosComprados().size() > 0) + mostrarArticulosRelacionados(articulo.getArticulosComprados(), lnrComprados); + else + { + txtComprados.setVisibility(View.GONE); + lnrComprados.setVisibility(View.GONE); + } + + MyApplication.downloadImg(Static.BASE_URL_LARGE + articulo.getFoto() + ".png", imgFoto, MyApplication.TRANSFORM_NONE); + + + } + + @Override + protected void setClickActions(int id) { + super.setClickActions(id); + switch (id) + { + case R.id.imageview_toolbar_colores_buscar: + DialogBuscar dialog = new DialogBuscar(activity, R.drawable.ic_action_camera); + dialog.show(); + break; + + case R.id.imageview_toolbar_colores_panel: + activity.abrirDrawerIzquierdo(); + break; + + case R.id.imageview_toolbar_colores_carrito: + activity.abrirDrawerDerecho(); + break; + + case R.id.imageview_fragment_articulo_foto: + Bundle bundle = new Bundle(); + bundle.putString(FragmentImage.IMAGEN, articulo.getFoto()); + activity.cambiarFragment(new FragmentImage(), bundle); + break; + + case R.id.textview_fragment_articulo_comprar: + ControllerArticulo.generarDialog(articulo, activity); + dialogoAbierto = true; + break; + } + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + if(articulo == null) { + if(barcode == null) + getArticulo(); + else + getArticuloBarcode(); + } + else + createView(); + + } + + public void getArticulo(){ + + showProgress(true); + CmdObtenerArticuloVenta cmd = new CmdObtenerArticuloVenta(pedido.getOrder().getCalendario().getFormatFecha(), pedido.getConsignatarioDefecto().getId_Consigna(), + pedido.getOrder().getAgencia().getId_Agencia(), articuloRecuperado.getId_Tipo(), articuloRecuperado.getId_Article(), articuloRecuperado.getWarehouse_id()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + ArticuloVentasTags art = ((CmdObtenerArticuloVenta) cmd).getArticulo(); + art.setId_Tipo(articuloRecuperado.getId_Tipo()); + if (art.getAvailable() > 0) { + articulo = art; + createView(); + showProgress(false); + } else { + txtEmpty.setText(getResources().getString(R.string.activity_base_articulo_no_disponible)); + txtEmpty.setVisibility(View.VISIBLE); + contenedor.setVisibility(View.GONE); + progress.setVisibility(View.GONE); + } + + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + getArticulo(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + execute(cmd); + } + + public void getArticuloBarcode() + { + showProgress(true); + CmdObtenerArticuloBarcode cmd = new CmdObtenerArticuloBarcode(barcode, pedido.getOrder().getAgencia().getId_Agencia(), + pedido.getOrder().getConsignatarioActivo().getId_Consigna(), + pedido.getOrder().getCalendario().getFormatFecha()); + + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + ArticuloVentasTags a; + try{ + a = ((CmdObtenerArticuloBarcode)cmd).getArticulo(); + }catch (Exception e){ + a = null; + } + + showProgress(false); + if(a == null) { + txtEmpty.setText(getResources().getString(R.string.activity_base_articulo_no_existe)); + contenedor.setVisibility(View.GONE); + } + + else if (a.getId_Article() == 0) { + txtEmpty.setText(getResources().getString(R.string.activity_base_articulo_no_disponible)); + contenedor.setVisibility(View.GONE); + } + + else { + articulo = a; + createView(); + } + + } + }); + + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + getArticulo(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + + execute(cmd); + } + + public void mostrarArticulosRelacionados(final List articulos, LinearLayout linear){ + final List items = ControllerArticulo.mostrarArticulosRelacionados(articulos, activity); + linear.removeAllViews(); + for(final ItemArticuloRelacionado item : items) + { + item.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + articuloRecuperado = articulos.get(items.indexOf(item)); + articulo = null; + getArticulo(); + } + }); + linear.addView(item); + } + } + + @Override + public void onScrollChanged(int scrollY, boolean firstScroll, boolean dragging) { + int baseColor = Colores.getColor(articulo.getReino()); + float alpha = Math.min(1, (float) scrollY / 230); + mToolbarView.setBackgroundColor(ScrollUtils.getColorWithAlpha(alpha, baseColor)); + ViewHelper.setTranslationY(imgFoto, scrollY / 2); + } + + @Override + public void onDownMotionEvent() { + + } + + @Override + public void onUpOrCancelMotionEvent(ScrollState scrollState) { + + } + + @Override + public void recalcularPrecios() { + super.recalcularPrecios(); + mostrarArticulosRelacionados(articulo.getArticulosSimilares(), lnrRelacionados); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentFamilias.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentFamilias.java new file mode 100644 index 00000000..f5dee407 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentFamilias.java @@ -0,0 +1,144 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.content.Intent; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.AdapterView; +import android.widget.ListView; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.Articulos; +import com.verdnatura.verdnaturaventas.R; + +import com.verdnatura.verdnaturaventas.adapter.AdapterTipos; +import com.verdnatura.verdnaturaventas.command.CmdObtenerTipos; +import com.verdnatura.verdnaturaventas.core.Colores; +import com.verdnatura.verdnaturaventas.model.ParametrosReino; +import com.verdnatura.verdnaturaventas.model.Tipo; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarColores; + +import java.util.ArrayList; +import java.util.List; + + +public class FragmentFamilias extends FragmentBase{ + + public static final String PARAMETROS = "PARAMETROS"; + public static final String TIPOS = "TIPOS"; + + private ListView lstFamilias; + private ParametrosReino parametros; + + private List tipos; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if(savedInstanceState != null) + { + tipos = savedInstanceState.getParcelableArrayList(TIPOS); + } + } + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + parametros = args.getParcelable(PARAMETROS); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelable(PARAMETROS, parametros); + outState.putParcelableArrayList(TIPOS, (ArrayList) tipos); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_listview_generico, container, false); + + lstFamilias = (ListView)view.findViewById(R.id.listview_generico); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment_listview_generico); + contenedor = lstFamilias; + mostrarToolbarFamilias(); + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + lstFamilias.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapter, View view, int position, long id) { + Tipo tipo = (Tipo) adapter.getItemAtPosition(position); + Intent intent = new Intent(activity, Articulos.class); + intent.putExtra(PARAMETROS, parametros); + intent.putExtra(FragmentArticulos.TIPO, tipo); + startActivity(intent); + } + }); + + obtenerTipos(); + } + + public void obtenerTipos() + { + if(tipos == null) { + showProgress(true); + CmdObtenerTipos cmd = new CmdObtenerTipos(parametros.getReino(), parametros.getCadena(), parametros.getAgencia(), + parametros.getConsignatario(), parametros.getFecha()); + cmd.setOnFinished(new CommandOperation() { + + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + tipos = ((CmdObtenerTipos) cmd).getTipos(); + AdapterTipos adapter = new AdapterTipos(getActivity(), R.layout.item_simple_doble, tipos); + lstFamilias.setAdapter(adapter); + showProgress(false); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + obtenerTipos(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + execute(cmd); + } + else + { + AdapterTipos adapter = new AdapterTipos(getActivity(), R.layout.item_simple_doble, tipos); + lstFamilias.setAdapter(adapter); + } + } + + public void mostrarToolbarFamilias() + { + ToolbarColores tool = new ToolbarColores(activity, parametros.getNombre(), true, ToolbarColores.BUSCAR_DIALOG); + if(parametros.getCadena().length() > 0) { + activity.crearToolbar(tool, getResources().getColor(R.color.blanco), getResources().getColor(R.color.negro)); + tool.modificarToolbarcoloresClaros(); + tool.setSeparacion(View.VISIBLE); + tool.removeIcons(); + } + else + { + activity.crearToolbar(tool, Colores.getColor(parametros.getReino()), Colores.getColorDark(parametros.getReino())); + } + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentGetCliente.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentGetCliente.java new file mode 100644 index 00000000..21f18360 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentGetCliente.java @@ -0,0 +1,81 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.app.Activity; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdObtenerCliente; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 28/10/15. + */ +public class FragmentGetCliente extends FragmentBase { + + private ProgressBar progress; + + @Override + public void onAttach(Activity activity) { + // TODO Auto-generated method stub + super.onAttach(activity); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_carga, container, false); + + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + progress.setVisibility(View.VISIBLE); + getCliente(); + } + + public void getCliente() + { + CmdObtenerCliente cmd = new CmdObtenerCliente(preferences.getUser(), preferences.getPass()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + ClienteVentas cliente = ((CmdObtenerCliente)cmd).getCliente(); + preferences.guardarCliente(cliente); + if (cliente.getTipo().equals("trabajador") && pedido.getOrder().getCliente() == null) { + activity.cambiarFragment(new FragmentConfigurarPedido()); + + } else { + pedido.getOrder().setCliente(cliente); + pedido.getOrder().setConsignatarioActivo(pedido.getConsignatarioDefecto()); + pedido.guardarOrder(); + activity.cambiarFragment(new FragmentPedidosPendientes()); + } + + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + getCliente(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.logout(); + } + }); + execute(cmd); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentImage.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentImage.java new file mode 100644 index 00000000..f6f5f7dd --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentImage.java @@ -0,0 +1,57 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; + +import com.github.chrisbanes.photoview.PhotoViewAttacher; +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.core.Static; + +/** + * Created by nelo on 6/07/15. + */ +public class FragmentImage extends FragmentBase{ + + public static final String IMAGEN = "IMAGEN"; + + private ImageView imgFoto; + private PhotoViewAttacher attacher; + + private String imagen; + + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + imagen = args.getString(IMAGEN); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putString(IMAGEN, imagen); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_imagen, container, false); + imgFoto = (ImageView) view.findViewById(R.id.imageView_fragment_imagen_imagen); + attacher = new PhotoViewAttacher(imgFoto); + return view; + } + + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + MyApplication.downloadImg(Static.BASE_URL_FULL + imagen + ".png", imgFoto, MyApplication.TRANSFORM_FULL); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentInstrucciones.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentInstrucciones.java new file mode 100644 index 00000000..33d0bd86 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentInstrucciones.java @@ -0,0 +1,135 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.app.Activity; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.TextView; + +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.Instrucciones; +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 3/02/15. + */ +public class FragmentInstrucciones extends FragmentBase { + + private TextViewRoboto txtRoboto; + private Button btnAnterior, btnSiguiente; + private int location= 0; + public static final int PANEL_INICIAL = 0; + public static final int PANEL_CUENTA = 1; + public static final int PANEL_CARRITO = 2; + public static final int PANEL_GRACIAS = 3; + public static final int PANEL_SALIR = 4; + private ActivityBase activity; + + @Override + public void onAttach(Activity activity) { + // TODO Auto-generated method stub + super.onAttach(activity); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_instrucciones, container, false); + + txtRoboto = (TextViewRoboto)view.findViewById(R.id.textviewroboto_fragment_instrucciones_instrucciones); + txtRoboto.setTypeface(TextViewRoboto.ROBOTO_THIN); + btnAnterior = (Button)view.findViewById(R.id.button_fragment_instrucciones_anterior); + btnSiguiente = (Button)view.findViewById(R.id.button_fragment_instrucciones_siguiente); + + activity = (ActivityBase)getActivity(); + + btnAnterior.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + cambiarPanel(-1); + } + }); + + btnSiguiente.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + cambiarPanel(1); + } + }); + + cambiarPanel(location); + + return view; + } + + public void cambiarPanel(int panel) + { + location += panel; + + if(location < PANEL_INICIAL) + location = PANEL_INICIAL; + + if(location > PANEL_SALIR) + location = PANEL_SALIR; + + txtRoboto.setText(mensajerPanel()); + + } + + public String mensajerPanel() + { + String mensaje = ""; + + switch (location) + { + case FragmentInstrucciones.PANEL_INICIAL: + mensaje = activity.getResources().getString(R.string.fragment_instrucciones_mensaje_1); + btnAnterior.setTextColor(activity.getResources().getColor(R.color.blanco)); + btnSiguiente.setTextColor(activity.getResources().getColor(R.color.azul_dialog_ayuda)); + btnSiguiente.setText(activity.getResources().getString(R.string.next)); + break; + + case FragmentInstrucciones.PANEL_CUENTA: + mensaje = activity.getResources().getString(R.string.fragment_instrucciones_mensaje_2); + btnAnterior.setTextColor(activity.getResources().getColor(R.color.azul_dialog_ayuda)); + btnSiguiente.setTextColor(activity.getResources().getColor(R.color.blanco)); + btnSiguiente.setText(activity.getResources().getString(R.string.next)); + break; + + case FragmentInstrucciones.PANEL_CARRITO: + mensaje = activity.getResources().getString(R.string.fragment_instrucciones_mensaje_3); + btnAnterior.setTextColor(activity.getResources().getColor(R.color.azul_dialog_ayuda)); + btnSiguiente.setTextColor(activity.getResources().getColor(R.color.blanco)); + btnSiguiente.setText(activity.getResources().getString(R.string.next)); + break; + + case FragmentInstrucciones.PANEL_GRACIAS: + mensaje = activity.getResources().getString(R.string.fragment_instrucciones_mensaje_4); + btnAnterior.setTextColor(activity.getResources().getColor(R.color.azul_dialog_ayuda)); + btnSiguiente.setTextColor(activity.getResources().getColor(R.color.azul_dialog_ayuda)); + btnSiguiente.setText(activity.getResources().getString(R.string.finish)); + break; + + case FragmentInstrucciones.PANEL_SALIR: + ((Instrucciones)activity).marcarInstruccionesLeidas(); + break; + } + + return mensaje; + } + + public void setSiguiente() + { + btnSiguiente.setTextColor(activity.getResources().getColor(R.color.azul_dialog_ayuda)); + } + + public int getLocation() + { + return location; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentLineasPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentLineasPedido.java new file mode 100644 index 00000000..96570643 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentLineasPedido.java @@ -0,0 +1,129 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterEnviosLineas; +import com.verdnatura.verdnaturaventas.command.CmdCheckMovimientos; +import com.verdnatura.verdnaturaventas.core.DateControll; +import com.verdnatura.verdnaturaventas.core.FileManager; +import com.verdnatura.verdnaturaventas.model.TicketRecepcion; +import com.verdnatura.verdnaturaventas.model.TicketRecepcionLineasTags; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 23/07/15. + */ +public class FragmentLineasPedido extends FragmentBase { + + public static final String PEDIDO = "PEDIDO"; + public static final String RECUPERACION = "RECUPERACION"; + + private RecyclerView lstLineas; + private TextViewRoboto txtCabecera; + private TicketRecepcion pedido; + private List lineasRecuperadas; + private DateControll dateControll = new DateControll(); + + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + pedido = args.getParcelable(PEDIDO); + loadPedidos(); + markLine(lineasRecuperadas, pedido.getLineas(), false); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelable(PEDIDO, pedido); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_listado_pedidos, container, false); + + lstLineas = (RecyclerView) view.findViewById(R.id.listview_fragment_listado_pedidos_listado); + txtCabecera = (TextViewRoboto)view.findViewById(R.id.textview_fragment_listado_pedidos_cabecera); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + txtCabecera.setText(getActivity().getResources().getString(R.string.fragment_listado_pedidos_recivira).toLowerCase()); + txtCabecera.setTypeface(TextViewRoboto.ROBOTO_THIN); + setAdapter(); + } + + public void setAdapter() + { + /** MOSTRAMOS LOS PEDIDOS **/ + + final AdapterEnviosLineas adaptador = new AdapterEnviosLineas(activity, pedido.getLineas()); + adaptador.setOnClickListener(new View.OnClickListener(){ + + @Override + public void onClick(View v) { + TicketRecepcionLineasTags l = adaptador.getItem(lstLineas.getChildAdapterPosition(v)); + l.setOk(!l.isOk()); + adaptador.notifyDataSetChanged(); + markLine(pedido.getLineas(), lineasRecuperadas, true); + } + }); + setListControllerLayout(lstLineas); + lstLineas.setAdapter(adaptador); + lstLineas.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + lstLineas.setItemAnimator(new DefaultItemAnimator()); + + } + + public void markLine(List origin, List dest, boolean add){ + for(TicketRecepcionLineasTags o : origin) { + boolean marked = false; + for (TicketRecepcionLineasTags d : dest) + if (o.getId_Movimiento() == d.getId_Movimiento()) { + d.setOk(o.isOk()); + marked = true; + break; + } + if(!marked && add) + lineasRecuperadas.add(o); + } + } + + public void loadPedidos() { + try { + lineasRecuperadas = FileManager.recuperarFicheroLista(RECUPERACION, TicketRecepcionLineasTags.class, activity); + if(lineasRecuperadas == null) + lineasRecuperadas = new ArrayList(); + } + catch (Exception e){ + lineasRecuperadas = new ArrayList(); + } + } + + @Override + public void onDestroyView() { + super.onDestroy(); + for(TicketRecepcionLineasTags l : lineasRecuperadas) + l.setFechaContar(dateControll.getFormatFecha()); + FileManager.guardarFichero(RECUPERACION, lineasRecuperadas, activity); + CmdCheckMovimientos cmd = new CmdCheckMovimientos(pedido.getLineas()); + execute(cmd); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentLogin.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentLogin.java new file mode 100644 index 00000000..d9678038 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentLogin.java @@ -0,0 +1,129 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.app.Activity; +import android.os.Bundle; + +import androidx.annotation.NonNull; +import androidx.drawerlayout.widget.DrawerLayout; + +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.View.OnClickListener; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ProgressBar; + +import com.google.android.gms.tasks.OnFailureListener; +import com.google.android.gms.tasks.OnSuccessListener; +import com.google.firebase.firestore.DocumentReference; +import com.google.firebase.firestore.FirebaseFirestore; +import com.google.firebase.iid.FirebaseInstanceId; +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdLogin; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarColores; + +import java.util.HashMap; +import java.util.Map; + +public class FragmentLogin extends FragmentBase{ + + private Button btnLogin; + private EditText edtUser, edtPass; + private ControllerPreferences preferences; + + + @Override + public void onAttach(Activity activity) { + // TODO Auto-generated method stub + super.onAttach(activity); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + + View view = inflater.inflate(R.layout.fragment_login, container, false); + + btnLogin = (Button)view.findViewById(R.id.button_login); + edtUser = (EditText)view.findViewById(R.id.editText_User); + edtPass = (EditText)view.findViewById(R.id.editText_Password); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + preferences = new ControllerPreferences(); + + activity.crearToolbar(new ToolbarColores(activity, "", false, ToolbarColores.BUSCAR_DIALOG)); + activity.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + if(preferences.usuarioLogueado()) + { + preferences.recuperarUsuario(); + identificarse(preferences.getUser(), preferences.getPass()); + } + + btnLogin.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + activity.cerrarTeclado(edtPass); + String user = edtUser.getText().toString(); + String pass = edtPass.getText().toString(); + identificarse(user, pass); + + } + }); + } + + public void identificarse(final String user, final String password) + { + progress.setVisibility(View.VISIBLE); + preferences.guardarUsuario(user, password, null); + CmdLogin cmd = new CmdLogin(user, password); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + ClienteVentas cliente = ((CmdLogin) cmd).obtenerCliente(); + + + + + preferences.guardarUsuario(user, password, cliente); + + if(cliente.getTipo().equals("trabajador")) + activity.cambiarFragment(new FragmentConfigurarPedido()); + else + activity.cambiarFragment(new FragmentMain()); + progress.setVisibility(View.GONE); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + identificarse(user, password); + } + + @Override + public void Accept(CommandBase cmd) { + progress.setVisibility(View.GONE); + } + }); + execute(cmd); + + } + + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentMain.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentMain.java new file mode 100644 index 00000000..a1f9c22e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentMain.java @@ -0,0 +1,290 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.content.Intent; +import android.os.Bundle; +import androidx.drawerlayout.widget.DrawerLayout; +import androidx.cardview.widget.CardView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TableRow; +import android.widget.Toast; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.Agencias; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdObtenerArticulosCompradosUltimaSemana; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.core.ItemArticuloMain; +import com.verdnatura.verdnaturaventas.core.Static; +import com.verdnatura.verdnaturaventas.dialog.DialogCalendarMain; +import com.verdnatura.verdnaturaventas.model.Agencia; +import com.verdnatura.verdnaturaventas.model.ArticuloVentasTags; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarColores; + +import java.util.ArrayList; +import java.util.List; + + +public class FragmentMain extends FragmentBase { + + private Button btnFlor, btnPlanta, btnComplementos, btnArtificial, btnVerdes, btnConfeccion; + private LinearLayout lnFecha, lnAgencia, lnrVentas; + private LinearLayout lnrContenedorFlores, lnrContenedorVerdes, lnrContenedorPlantas, lnrContenedorConfeccion, lnrContenedorArtificial, lnrContenedorComplementos; + private TableRow rowUno, rowDos, rowTres; + private TextViewRoboto txtFecha, txtAgencia; + private ProgressBar progress; + private CardView contenedorAgencias; + + private boolean dibujado = false; + private List articulos; + private ClienteVentas cliente; + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if(savedInstanceState != null) { + articulos = savedInstanceState.getParcelableArrayList("articulos"); + } + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelableArrayList("articulos", (ArrayList) articulos); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, savedInstanceState); + + View view = inflater.inflate(R.layout.fragment_main, container, false); + + btnFlor = (Button)view.findViewById(R.id.fragment_main_button_flowers); + btnPlanta = (Button)view.findViewById(R.id.fragment_main_button_plants); + btnComplementos = (Button)view.findViewById(R.id.fragment_main_button_supplements); + btnArtificial = (Button)view.findViewById(R.id.fragment_main_button_artificial); + btnVerdes = (Button)view.findViewById(R.id.fragment_main_button_greens); + btnConfeccion = (Button)view.findViewById(R.id.fragment_main_button_manufacturing); + lnrVentas = (LinearLayout)view.findViewById(R.id.linearlayout_fragment_main_ventas); + lnrContenedorFlores = (LinearLayout)view.findViewById(R.id.lnr_contenedor_flores); + lnrContenedorVerdes = (LinearLayout)view.findViewById(R.id.lnr_contenedor_verdes); + lnrContenedorPlantas = (LinearLayout)view.findViewById(R.id.lnr_contenedor_plantas); + lnrContenedorComplementos = (LinearLayout)view.findViewById(R.id.lnr_contenedor_complementos); + lnrContenedorArtificial = (LinearLayout)view.findViewById(R.id.lnr_contenedor_artificial); + lnrContenedorConfeccion = (LinearLayout)view.findViewById(R.id.lnr_contenedor_confeccion); + rowUno = (TableRow)view.findViewById(R.id.row_grid_botones_uno); + rowDos = (TableRow)view.findViewById(R.id.row_grid_botones_dos); + rowTres = (TableRow)view.findViewById(R.id.row_grid_botones_tres); + lnAgencia = (LinearLayout)view.findViewById(R.id.linear_main_agencia); + txtFecha = (TextViewRoboto)view.findViewById(R.id.text_main_fecha); + txtAgencia = (TextViewRoboto)view.findViewById(R.id.text_main_agencia); + progress = (ProgressBar)view.findViewById(R.id.progressBar_fragment_main_carga); + lnFecha = (LinearLayout)view.findViewById(R.id.linear_main_fecha); + contenedorAgencias = (CardView)view.findViewById(R.id.linearlayout_main_agencias); + + btnFlor.setOnClickListener(new OnClick()); + btnPlanta.setOnClickListener(new OnClick()); + btnComplementos.setOnClickListener(new OnClick()); + btnArtificial.setOnClickListener(new OnClick()); + btnVerdes.setOnClickListener(new OnClick()); + btnConfeccion.setOnClickListener(new OnClick()); + lnFecha.setOnClickListener(new OnClick()); + lnAgencia.setOnClickListener(new OnClick()); + + activity.crearToolbar(new ToolbarColores(activity, "Verdnatura", true, ToolbarColores.BUSCAR_DIALOG)); + activity.getDrawerLayout().setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + pedido = new ControllerPedido(activity); + activity.showTotalPedido(); + activity.showCarritoRows(); + + if(!inicializado) { + showElements(contenedorAgencias, rowUno, rowDos, rowTres); + inicializado = true; + } + + txtFecha.setText(pedido.getOrder().getCalendario().getTextoFecha()); + cliente = preferences.recuperarCliente(); + pintarAgencia(); + calcularArticulos(); + recuperarPedido(); + + } + + @Override + protected void setClickActions(int id) { + super.setClickActions(id); + + switch (id) + { + case R.id.fragment_main_button_flowers: + clickBotones(Static.FLORES, getActivity().getResources().getString(R.string.flowers)); + break; + + case R.id.fragment_main_button_plants: + clickBotones(Static.PLANTAS, getActivity().getResources().getString(R.string.plants)); + break; + + case R.id.fragment_main_button_supplements: + clickBotones(Static.COMPLEMENTOS, getActivity().getResources().getString(R.string.supplements)); + break; + + case R.id.fragment_main_button_artificial: + clickBotones(Static.ARTIFICIAL, getActivity().getResources().getString(R.string.artificial)); + break; + + case R.id.fragment_main_button_greens: + clickBotones(Static.VERDES, getActivity().getResources().getString(R.string.greens)); + break; + + case R.id.fragment_main_button_manufacturing: + clickBotones(Static.CONFECCION, getActivity().getResources().getString(R.string.manufacturing)); + break; + + case R.id.linear_main_fecha: + seleccionarFecha(); + break; + + case R.id.linear_main_agencia: + if(pedido.comprobarSeleccionCliente(true, preferences.recuperarCliente())) + startActivity(new Intent(activity, Agencias.class)); + break; + + } + + } + + public void clickBotones(int reino, String nombre) + { + if(pedido.comprobarSeleccionCliente(true, preferences.recuperarCliente())) { + if (pedido.getOrder().getAgencia() != null) + activity.verFamilia(reino, nombre, ""); + else + Toast.makeText(activity, activity.getResources().getString(R.string.mensaje_seleccionar_agencia), Toast.LENGTH_SHORT).show(); + } + } + + public void seleccionarFecha() + { + DialogCalendarMain dialog = new DialogCalendarMain(); + dialog.show(getFragmentManager(), "calendar"); + } + + @Override + public void onResume() { + super.onResume(); + if(inicializado && (articulos == null || articulos.size() == 0)) + calcularArticulos(); + else + inicializado = true; + pedido = new ControllerPedido(activity); + pintarAgencia(); + } + + public void calcularArticulos() + { + if(articulos == null || articulos.size() == 0) + { + CmdObtenerArticulosCompradosUltimaSemana cmd = new CmdObtenerArticulosCompradosUltimaSemana(); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + articulos = ((CmdObtenerArticulosCompradosUltimaSemana)cmd).getArticulos(); + if(articulos != null) + rellenarFragmentMain(); + } + }); + execute(cmd); + } + else { + dibujado = false; + rellenarFragmentMain(); + } + } + + public void rellenarFragmentMain() + { + if(!dibujado) + { + for(int i = 1; i<8; i++) + { + List arts = new ArrayList<>(); + + for(ArticuloVentasTags a: articulos) { + + if(a.getReino() == i) { + arts.add(a); + } + } + + if(arts.size() > 0 && getActivity() != null) { + ItemArticuloMain item = new ItemArticuloMain(getActivity()); + item.setData(arts); + item.downloadFoto(); + + lnrVentas.addView(item); + } + } + + dibujado = true; + } + + progress.setVisibility(View.GONE); + lnrVentas.setVisibility(View.VISIBLE); + activity.startAnimation(R.anim.load_items, lnrVentas, null); + } + + public void recuperarPedido() + { + if(pedido.getOrder() != null) { + pedido.getOrder().setAgencia(pedido.getOrder().getAgencia()); + activity.showTotalPedido(); + activity.showCarritoRows(); + } + + activity.getnPanel().setNombreCliente(); + } + + public void setClienteOrder(ClienteVentas cliente) { + this.pedido.setCliente(cliente); + } + + public void pintarAgencia() + { + if(pedido.getOrder() != null && pedido.getOrder().getAgencia() != null) { + Agencia a = pedido.getOrder().getAgencia(); + txtAgencia.setText(a.getAgencia().toLowerCase()); + } + else + { + txtAgencia.setText(getActivity().getResources().getString(R.string.main_select)); + } + } + + public void setFecha() + { + pedido = new ControllerPedido(activity); + pedido.setAgencia(null); + pedido.guardarOrder(); + pintarAgencia(); + txtFecha.setText(pedido.getOrder().getCalendario().getTextoFecha()); + activity.showTotalPedido(); + activity.showCarritoRows(); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentNavegador.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentNavegador.java new file mode 100644 index 00000000..7a5d2890 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentNavegador.java @@ -0,0 +1,223 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.net.http.SslError; +import android.os.Build; +import android.os.Bundle; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.webkit.SslErrorHandler; +import android.webkit.WebChromeClient; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.ProgressBar; + +import com.nelosan.baselibrary.command.CommandBase; + +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.command.CmdLogError; +import com.verdnatura.verdnaturaventas.command.CmdObtnerDatosPasarBanco; +import com.verdnatura.verdnaturaventas.command.CmdTransactionEnd; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.ParamsBanco; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * Created by nelo on 14/05/15. + */ +public class FragmentNavegador extends FragmentBase{ + + private WebView webView; + private ParamsBanco datos; + private double cantidad; + private boolean isDeuda; + private boolean pagado; + + public static final String DATOS_PASAR_BANCO = "DATOS_PASAR_BANCO"; + public static final String CANTIDAD = "CANTIDAD"; + public static final String DEUDA = "DEUDA"; + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + datos = args.getParcelable(DATOS_PASAR_BANCO); + cantidad = args.getDouble(CANTIDAD); + isDeuda = args.getBoolean(DEUDA, false); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelable(DATOS_PASAR_BANCO, datos); + outState.putDouble(CANTIDAD, cantidad); + outState.putBoolean(DEUDA, isDeuda); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_navegador, container, false); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + webView = (WebView)view.findViewById(R.id.webView); + contenedor = webView; + activity.crearToolbar(null); + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + if(datos == null) + obtenerDatosPasarBanco(); + else + generateWebView(); + + pagado = false; + } + + public void generateWebView() + { + showProgress(true); + webView.getSettings().setJavaScriptEnabled(true); + webView.getSettings().setDomStorageEnabled(true); + webView.setWebViewClient(new WebViewClient() { + // evita que los enlaces se abran fuera nuestra app en el navegador de android + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + transactionEnd(url, datos.getDSOrder()); + return true; + } + + @Override + public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { + getActivity().onBackPressed(); + } + }); + + webView.setWebChromeClient(new WebChromeClient() { + @Override + public void onProgressChanged(WebView view, int progress) { + if (progress == 100) { + showProgress(false); + } + } + }); + + + + String postdata = generatePostData(); + webView.postUrl(datos.getUrl(), postdata.getBytes()); + } + + public String generatePostData() + { + try { + return "Ds_SignatureVersion="+ URLEncoder.encode(datos.getDSSignature(), "UTF-8")+"&Ds_MerchantParameters=" + +URLEncoder.encode(datos.getEncodedParams(), "UTF-8")+"&Ds_Signature=" + +URLEncoder.encode(datos.getSignature(), "UTF-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + + return ""; + } + + + public void obtenerDatosPasarBanco() + { + showProgress(true); + ClienteVentas cliente = preferences.recuperarCliente(); + Date date = Calendar.getInstance().getTime(); + SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd"); + String fecha = ft.format(date); + + if(!isDeuda) { + cliente = pedido.getOrder().getCliente(); + fecha = pedido.getOrder().getFecha(); + } + + CmdObtnerDatosPasarBanco cmd = new CmdObtnerDatosPasarBanco(cantidad, fecha, cliente.getId_Cliente()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + datos = ((CmdObtnerDatosPasarBanco)cmd).getDatos(); + generateWebView(); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + obtenerDatosPasarBanco(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + execute(cmd); + } + + public void transactionEnd(final String url, final int transaccion) + { + String status = ""; + if(url.equals(pedido.CALLBACK_PAGO_OK)) + { + status = "ok"; + pagado = true; + } + else + { + status = "ko"; + pagado = false; + } + + showProgress(true); + CmdTransactionEnd cmd = new CmdTransactionEnd(status, transaccion); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + showProgress(false); + activity.onBackPressed(); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + transactionEnd(url, transaccion); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + execute(cmd); + } + + @Override + public void onDestroy() { + super.onDestroy(); + if(pedido == null) + pedido = new ControllerPedido(activity); + if(!pagado && datos != null) + { + CmdTransactionEnd cmd = new CmdTransactionEnd("ko", datos.getDSOrder()); + execute(cmd); + } + pedido.showFinalizar(isDeuda, pagado); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentOpcionesPagar.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentOpcionesPagar.java new file mode 100644 index 00000000..50f6a975 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentOpcionesPagar.java @@ -0,0 +1,57 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 12/05/15. + */ +public class FragmentOpcionesPagar extends FragmentBase { + + private TextViewRoboto txtPedido, txtDeuda, txtCabecera; + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_opciones_pago, container, false); + txtCabecera = (TextViewRoboto)view.findViewById(R.id.textview_fragment_opciones_pago_cabecera); + txtDeuda = (TextViewRoboto)view.findViewById(R.id.textview_fragment_opciones_pago_deuda); + txtPedido = (TextViewRoboto)view.findViewById(R.id.textview_fragment_opciones_pago_pedido); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + final double deuda = pedido.getOrder().getCliente().getRiesgo() - pedido.getOrder().getCliente().getCredito(); + txtCabecera.setText(getActivity().getResources().getString(R.string.fragment_opciones_pagar_deuda, deuda)); + txtDeuda.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + pagarPedido(deuda); + } + }); + + + txtPedido.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + pagarPedido(0.0); + } + }); + } + + public void pagarPedido(double cantidad) + { + pedido.pagar(pedido.getOrder().getTotalConIva() + cantidad); + //reiniciarPedido(); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentOrdersImprimir.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentOrdersImprimir.java new file mode 100644 index 00000000..c7b6e7d7 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentOrdersImprimir.java @@ -0,0 +1,118 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import android.os.Parcelable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterImprimir; +import com.verdnatura.verdnaturaventas.command.CmdObtenerPedidosRealizados; +import com.verdnatura.verdnaturaventas.model.OrderImprimir; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 30/11/15. + */ +public class FragmentOrdersImprimir extends FragmentBase { + + public static final String ORDERS_PRINT = "ORDERS_PRINT"; + + private RecyclerView lstPedidos; + private AdapterImprimir adapter; + private List orders; + private TextViewRoboto txtLabel; + private TextView txtEmpty; + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelableArrayList(ORDERS_PRINT, (ArrayList) orders); + } + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + orders = args.getParcelableArrayList(ORDERS_PRINT); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_orders_imprimir, container, false); + + lstPedidos = (RecyclerView)view.findViewById(R.id.recyclerview_fragment_pedido_imprimir_tickets); + contenedor = lstPedidos; + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + txtLabel = (TextViewRoboto)view.findViewById(R.id.textviewroboto_fragment_pedido_imprimir_label); + txtEmpty = (TextView)view.findViewById(R.id.text_empty); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + txtLabel.setTypeface(TextViewRoboto.ROBOTO_THIN); + txtEmpty.setText(activity.getResources().getString(R.string.fragment_order_imprimir_no_hay)); + txtEmpty.setVisibility(View.GONE); + if(orders == null) + rellenarLista(); + else + setAdapter(); + + } + + public void rellenarLista() + { + showProgress(true); + CmdObtenerPedidosRealizados cmd = new CmdObtenerPedidosRealizados(); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + orders = ((CmdObtenerPedidosRealizados)cmd).getOrders(); + setAdapter(); + showProgress(false); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + rellenarLista(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + execute(cmd); + } + + public void setAdapter() + { + adapter = new AdapterImprimir(orders, activity); + setListControllerLayout(lstPedidos); + lstPedidos.setAdapter(adapter); + lstPedidos.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + if(orders.size() == 0) + txtEmpty.setVisibility(View.VISIBLE); + else + txtEmpty.setVisibility(View.GONE); + + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPedidos.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPedidos.java new file mode 100644 index 00000000..f6c816f7 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPedidos.java @@ -0,0 +1,135 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterEnvios; +import com.verdnatura.verdnaturaventas.command.CmdObtenerPedidos; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.TicketRecepcion; + +import java.util.ArrayList; +import java.util.List; + + +/** + * Created by nelo on 23/07/15. + */ +public class FragmentPedidos extends FragmentBase{ + + private RecyclerView lstPedidos; + private TextView txtEmpty; + private TextViewRoboto txtCabecera; + private List pedidos; + public static final String PEDIDOS = "PEDIDOS"; + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + pedidos = args.getParcelableArrayList(PEDIDOS); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelableArrayList(PEDIDOS, (ArrayList) pedidos); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_listado_pedidos, container, false); + + lstPedidos = (RecyclerView) view.findViewById(R.id.listview_fragment_listado_pedidos_listado); + txtCabecera = (TextViewRoboto)view.findViewById(R.id.textview_fragment_listado_pedidos_cabecera); + contenedor = (LinearLayout)view.findViewById(R.id.fragment_pedidos_contenedor); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + txtEmpty = (TextView)view.findViewById(R.id.text_empty); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + txtCabecera.setText(getActivity().getResources().getString(R.string.fragment_listado_pedidos).toLowerCase()); + txtCabecera.setTypeface(TextViewRoboto.ROBOTO_THIN); + if(pedidos == null) + obtenerTickets(); + else + setAdapter(); + } + + public void obtenerTickets() + { + showProgress(true); + ClienteVentas cliente = null; + if(pedido.getOrder().getCliente() != null) + cliente = pedido.getOrder().getCliente(); + else + cliente = preferences.recuperarCliente(); + CmdObtenerPedidos cmd = new CmdObtenerPedidos(cliente.getId_Cliente()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + showProgress(false); + if (((CmdObtenerPedidos) cmd).getPedidos().size() > 0) { + pedidos = ((CmdObtenerPedidos) cmd).getPedidos(); + setAdapter(); + } else { + contenedor.setVisibility(View.GONE); + txtEmpty.setText(getResources().getString(R.string.fragment_listado_pedidos_no_pedidos)); + + } + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + obtenerTickets(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + execute(cmd); + } + + public void setAdapter() + { + /** MOSTRAMOS LOS PEDIDOS **/ + + final AdapterEnvios adaptador = new AdapterEnvios(pedidos); + setListControllerLayout(lstPedidos); + lstPedidos.setAdapter(adaptador); + lstPedidos.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + lstPedidos.setItemAnimator(new DefaultItemAnimator()); + adaptador.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + TicketRecepcion ticket = adaptador.getItem(lstPedidos.getChildPosition(v)); + Bundle bundle = new Bundle(); + bundle.putParcelable(FragmentLineasPedido.PEDIDO, ticket); + activity.cambiarFragment(new FragmentLineasPedido(), bundle); + } + }); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPedidosPendientes.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPedidosPendientes.java new file mode 100644 index 00000000..b59a426a --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPedidosPendientes.java @@ -0,0 +1,152 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import android.os.Parcelable; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterPedidosPendientes; +import com.verdnatura.verdnaturaventas.command.CmdObtenerPedidosPendientes; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.OrderResumen; +import com.verdnatura.verdnaturaventas.toolbar.ToolbarVerdnatura; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 10/11/15. + */ +public class FragmentPedidosPendientes extends FragmentBase { + + public static final String PEDIDOS = "PEDIDOS"; + public static final String VISTA_PEDIDOS = "VISTA_PEDIDOS"; + + private TextViewRoboto txtHeader; + private TextView txtNoHay; + private RecyclerView lstPedidos; + private OrderResumen orderResumen; + private boolean vistaPedidos = false; + + private List pedidos; + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + pedidos = args.getParcelableArrayList(PEDIDOS); + vistaPedidos = args.getBoolean(VISTA_PEDIDOS, false); + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelableArrayList(PEDIDOS, (ArrayList) pedidos); + + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_pedidos_pendientes, container, false); + + lstPedidos = (RecyclerView)view.findViewById(R.id.listview_fragment_pedidos_pendientes_pedidos); + txtHeader = (TextViewRoboto)view.findViewById(R.id.textview_fragment_pedidos_pendientes_title); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (RelativeLayout)view.findViewById(R.id.contenedor_pedidos_pendientes); + txtNoHay = (TextView)view.findViewById(R.id.text_empty); + + activity.crearToolbar(new ToolbarVerdnatura(activity)); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + txtHeader.setTypeface(TextViewRoboto.ROBOTO_THIN); + txtNoHay.setText(activity.getString(R.string.fragment_pedidos_pendientes_no_hay)); + txtNoHay.setVisibility(View.GONE); + getPedidosPendientes(); + } + + + public void getPedidosPendientes() + { + /** RECUPERAMOS LOS PEDIDOS PENDIENTES **/ + + showProgress(true); + txtNoHay.setVisibility(View.GONE); + ClienteVentas cliente = null; + if(pedido.getOrder().getCliente() != null) + cliente = pedido.getOrder().getCliente(); + else + cliente = preferences.recuperarCliente(); + CmdObtenerPedidosPendientes cmd = new CmdObtenerPedidosPendientes(cliente.getId_Cliente()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + pedidos = ((CmdObtenerPedidosPendientes) cmd).getOrders(); + if (pedidos.size() > 0) { + rellenarLista(); + showProgress(false); + } else { + if (vistaPedidos) { + showProgress(false); + rellenarLista(); + txtNoHay.setVisibility(View.VISIBLE); + + } else + activity.onBackPressed(); + } + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + getPedidosPendientes(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.cambiarFragment(new FragmentMain()); + } + }); + execute(cmd); + } + + public void rellenarLista() + { + /** MOSTRAMOS LOS PEDIDOS **/ + + final AdapterPedidosPendientes adaptador = new AdapterPedidosPendientes(pedidos, this); + setListControllerLayout(lstPedidos); + lstPedidos.setAdapter(adaptador); + lstPedidos.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + lstPedidos.setItemAnimator(new DefaultItemAnimator()); + adaptador.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + orderResumen = adaptador.getItem(lstPedidos.getChildPosition(v)); + Bundle bundle = new Bundle(); + bundle.putParcelable(FragmentResumenPedido.PEDIDO_RESUMEN, orderResumen); + activity.cambiarFragment(new FragmentResumenPedido(), bundle); + } + }); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPreciosRecalculados.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPreciosRecalculados.java new file mode 100644 index 00000000..44d910ee --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentPreciosRecalculados.java @@ -0,0 +1,167 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import android.util.Log; +import android.view.KeyEvent; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ListView; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.Agencias; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterOrderDiference; +import com.verdnatura.verdnaturaventas.command.CmdCrearOrder; +import com.verdnatura.verdnaturaventas.command.CmdRecalcularPrecios; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.model.Order; +import com.verdnatura.verdnaturaventas.model.OrderDiference; +import com.verdnatura.verdnaturaventas.model.OrderRow; + +import java.util.List; + + +/** + * Created by nelo on 18/03/15. + */ +public class FragmentPreciosRecalculados extends FragmentBase { + + private ListView lstDiferencias; + private Button btnAceptar, btnCancelar; + + private List diferencias; + private List rows, oldRows; + + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_precios_recalculados, container, false); + lstDiferencias = (ListView)view.findViewById(R.id.linear_fragment_recalcular_precios_list); + btnAceptar = (Button)view.findViewById(R.id.button_fragment_recalcular_precios_aceptar); + btnCancelar = (Button)view.findViewById(R.id.button_fragment_recalcular_precios_cancelar); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment_precios_recalculados); + contenedor = (RelativeLayout)view.findViewById(R.id.relative_fragment_precios_recalculados); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + + recalcularPrecios(); + + view.setOnKeyListener(new View.OnKeyListener() { + @Override + public boolean onKey(View v, int keyCode, KeyEvent event) { + Log.i("KEY", "keyCode: " + keyCode); + return false; + } + }); + + btnAceptar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + oldRows = pedido.getOrder().getRows(); + pedido.getOrder().setRows(rows); + updateOrder(); + } + }); + + + btnCancelar.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + pedido.restablecerValores(); + pedido.guardarOrder(); + exit(); + } + }); + } + + public void recalcularPrecios() + { + showProgress(true); + pedido = new ControllerPedido(activity); + CmdRecalcularPrecios cmd = new CmdRecalcularPrecios(pedido); + cmd.setOnFinished(new CommandOperation() { + + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + Order o = ((CmdRecalcularPrecios) cmd).getOrder(); + rows = o.getRows(); + diferencias = pedido.getDiferencias(o.getRows()); + if (diferencias.size() > 0) { + AdapterOrderDiference adapter = new AdapterOrderDiference(getActivity(), R.layout.item_precios_recalculados, diferencias); + lstDiferencias.setAdapter(adapter); + showProgress(false); + } else { + pedido.getOrder().setRows(o.getRows()); + pedido.guardarOrder(); + exit(); + + } + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + recalcularPrecios(); + } + + @Override + public void Accept(CommandBase cmd) { + pedido.restablecerValores(); + exit(); + } + }); + execute(cmd); + + } + + public void updateOrder() + { + showProgress(true); + CmdCrearOrder cmd = new CmdCrearOrder(pedido, activity.getSerialNumber()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + pedido.guardarOrder(); + exit(); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + updateOrder(); + } + + @Override + public void Accept(CommandBase cmd) { + pedido.getOrder().setRows(oldRows); + exit(); + } + }); + execute(cmd); + + } + + public void exit() + { + if(activity instanceof Agencias) + activity.finish(); + else + activity.cambiarFragment(new FragmentMain()); + + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentResumenPedido.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentResumenPedido.java new file mode 100644 index 00000000..2a144f9b --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentResumenPedido.java @@ -0,0 +1,267 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.content.Intent; +import android.os.Bundle; + +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import com.getbase.floatingactionbutton.FloatingActionButton; +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.Agencias; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterPedidoLineas; +import com.verdnatura.verdnaturaventas.command.CmdRecuperarPedido; +import com.verdnatura.verdnaturaventas.command.CmdVerificarAgencia; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.core.DateControll; +import com.verdnatura.verdnaturaventas.dialog.AlertErrorResumenPedido; +import com.verdnatura.verdnaturaventas.dialog.DialogCalendarResumen; +import com.verdnatura.verdnaturaventas.model.Order; +import com.verdnatura.verdnaturaventas.model.OrderResumen; + +import java.text.SimpleDateFormat; + + +/** + * Created by nelo on 26/11/15. + */ +public class FragmentResumenPedido extends FragmentBase implements View.OnClickListener { + + public static final String PEDIDO_RESUMEN = "PEDIDO_RESUMEN"; + + private TextViewRoboto txtFecha, txtAgencia; + private RecyclerView lstRows; + private FloatingActionButton fButton; + + private OrderResumen resumen; + + @Override + protected void loadArgs(Bundle args) { + super.loadArgs(args); + resumen = args.getParcelable(PEDIDO_RESUMEN); + } + + @Override + public View + onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + View view = inflater.inflate(R.layout.fragment_resumen_pedido, container, false); + + progress = (ProgressBar)view.findViewById(R.id.progress_fragment); + contenedor = (RelativeLayout)view.findViewById(R.id.linear_fragment_resumen_pedido_contenedor); + txtFecha = (TextViewRoboto)view.findViewById(R.id.text_pedido_recuperado_fecha); + txtAgencia = (TextViewRoboto)view.findViewById(R.id.text_pedido_recuperado_agencia); + lstRows = (RecyclerView)view.findViewById(R.id.recycler_fragment_pedido_recuperado_lineas_pedido); + fButton = (FloatingActionButton)view.findViewById(R.id.button_fragment_resumen_pedido_aceptar); + + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + txtAgencia.setOnClickListener(this); + txtFecha.setOnClickListener(this); + fButton.setOnClickListener(this); + recuperarPedido(); + } + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.text_pedido_recuperado_fecha: + onClickDate(); + break; + + case R.id.text_pedido_recuperado_agencia: + onClickAgency(); + break; + + case R.id.button_fragment_resumen_pedido_aceptar: + onClickConfirmButton(); + break; + } + } + + @Override + public void onResume() { + super.onResume(); + pedido = new ControllerPedido(activity); + } + + public void recuperarPedido() + { + showProgress(true); + CmdRecuperarPedido cmd = new CmdRecuperarPedido(resumen); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + Order order = ((CmdRecuperarPedido)cmd).getOrder(); + onDownloadOrder(order); + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + recuperarPedido(); + } + + @Override + public void Accept(CommandBase cmd) { + showProgress(false); + } + }); + execute(cmd); + } + + public void rellenarLista() + { + /** MOSTRAMOS LOS PEDIDOS **/ + showProgress(false); + final AdapterPedidoLineas adaptador = new AdapterPedidoLineas(pedido.getOrder().getRows()); + setListControllerLayout(lstRows); + lstRows.setAdapter(adaptador); + lstRows.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + lstRows.setItemAnimator(new DefaultItemAnimator()); + } + + public void setFecha(final String fecha) + { + pedido.getOrder().setFecha(fecha); + pedido.fechaToCalendar(pedido.getOrder(), new SimpleDateFormat("yyyy-MM-dd")); + txtFecha.setText(pedido.getOrder().getCalendario().getTextoFecha()); + } + + public void verificarAgencia() + { + showProgress(true); + CmdVerificarAgencia cmd = new CmdVerificarAgencia(pedido.getOrder().getConsignatarioActivo().getId_Consigna(), + pedido.getOrder().getAgencia().getId_Agencia(), + pedido.getOrder().getCalendario().getFormatFecha()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + + if(((CmdVerificarAgencia)cmd).isAgenciaValida()) setAgencia(pedido.getOrder().getAgencia().getAgencia().toLowerCase()); + else noValidAgency(); + showProgress(false); + } + }); + + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + verificarAgencia(); + } + + @Override + public void Accept(CommandBase cmd) { + showProgress(false); + } + }); + activity.execute(cmd); + } + + public void onDownloadOrder(Order order){ + setCliente(order); + setOrder(order); + setFecha(pedido.getOrder().getFecha()); + setAgencia(pedido.getOrder().getAgencia().getAgencia().toLowerCase()); + showProgress(false); + rellenarLista(); + } + + public void setCliente(Order order){ + /** Si el comercial esta recuperando un pedido de otro cliente **/ + if(pedido.getOrder().getCliente() != null) order.setCliente(pedido.getOrder().getCliente()); + else pedido.getOrder().setCliente(preferences.recuperarCliente()); + } + + public void setOrder(Order order){ + pedido.setOrder(order); + pedido.guardarOrder(); + } + + public void noValidAgency(){ + pedido.getOrder().setAgencia(null); + setAgencia(activity.getResources().getString(R.string.main_select)); + } + + public void setAgencia(String agencia){ + txtAgencia.setText(agencia); + txtAgencia.setVisibility(View.VISIBLE); + } + + public boolean isErrorDate(){ + DateControll actualCalendar = new DateControll(); + Log.d("TAG", actualCalendar.toString()); + DateControll pedidoCalendar = pedido.getOrder().getCalendario(); + Log.d("TAG", pedidoCalendar.toString()); + + + if (pedidoCalendar.getDay() < actualCalendar.getDay() || + pedidoCalendar.getMonth() < actualCalendar.getMonth() || + pedidoCalendar.getYear() < actualCalendar.getYear()) + return true; + return false; + } + + public boolean isErrorAgency(){ + if(pedido.getOrder().getAgencia() == null) + return true; + return false; + } + + public void onClickDate(){ + DialogCalendarResumen calendar = new DialogCalendarResumen(); + calendar.show(activity.getFragmentManager(), "calendar"); + } + + public void onClickAgency(){ + if(!isErrorDate()) { + activity.startActivity(new Intent(activity, Agencias.class)); + pedido.guardarOrder(); + } + else{ + showErrorDate(); + } + } + + public void onClickConfirmButton(){ + if(isErrorDate()) { + showErrorDate(); + } + else if (isErrorAgency()) + showErrorAgency(); + else { + pedido.guardarOrder(); + activity.cambiarFragment(new FragmentPreciosRecalculados()); + } + } + + public void showErrorDate(){ + showError(activity.getResources().getString(R.string.mensaje_fecha_menor)); + } + + public void showErrorAgency(){ + showError(activity.getResources().getString(R.string.mensaje_seleccionar_agencia)); + } + + public void showError(String msg){ + AlertErrorResumenPedido alert = new AlertErrorResumenPedido(activity, msg); + } + +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentVistas.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentVistas.java new file mode 100644 index 00000000..d7eb6147 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/fragment/FragmentVistas.java @@ -0,0 +1,184 @@ +package com.verdnatura.verdnaturaventas.fragment; + +import android.os.Bundle; +import androidx.recyclerview.widget.DefaultItemAnimator; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterVistas; +import com.verdnatura.verdnaturaventas.command.CmdObtenerAgencias; +import com.verdnatura.verdnaturaventas.comparador.ComparadorAgencias; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.model.Agencia; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.Vista; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Created by nelo on 21/04/15. + */ +public class FragmentVistas extends FragmentBase { + + private TextViewRoboto txtConsignatario, txtTitle; + private RelativeLayout rltConsignatario; + private RecyclerView lstVistas; + private List vistas; + private List agencias; + + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + if(savedInstanceState != null) { + vistas = savedInstanceState.getParcelableArrayList("vistas"); + agencias = savedInstanceState.getParcelableArrayList("agencias"); + } + } + + @Override + public void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + outState.putParcelableArrayList("vistas", (ArrayList) vistas); + outState.putParcelableArrayList("agencias", (ArrayList) agencias); + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle args) { + // TODO Auto-generated method stub + super.onCreateView(inflater, container, args); + + View view = inflater.inflate(R.layout.fragment_agencia, container, false); + progress = (ProgressBar)view.findViewById(R.id.progress_fragment_agencia); + contenedor = (LinearLayout)view.findViewById(R.id.linearlayout_fragment_agencia_contenedor); + rltConsignatario = (RelativeLayout)view.findViewById(R.id.relative_agencia_direccion); + rltConsignatario.setOnClickListener(new OnClick()); + txtConsignatario = (TextViewRoboto)view.findViewById(R.id.text_agencia_consignatario); + lstVistas = (RecyclerView)view.findViewById(R.id.listview_agencias); + lstVistas.setHasFixedSize(true); + txtTitle = (TextViewRoboto)view.findViewById(R.id.textview_agencia_title); + return view; + } + + @Override + public void onViewCreated(View view, Bundle savedInstanceState) { + super.onViewCreated(view, savedInstanceState); + ControllerPreferences preferences = new ControllerPreferences(); + ClienteVentas cliente = preferences.recuperarCliente(); + if(cliente != null && !cliente.getTipo().equals("trabajador")) + { + pedido.getOrder().setCliente(cliente); + if(pedido.getOrder().getConsignatarioActivo() == null) pedido.getOrder().setConsignatarioActivo(pedido.getConsignatarioDefecto()); + pedido.guardarOrder(); + } + txtConsignatario.setText(pedido.getOrder().getConsignatarioActivo().getDomicilio()); + String text = activity.getResources().getString(R.string.fragment_vistas_metodo_envio).toLowerCase(); + txtTitle.setText(text); + txtTitle.setTypeface(TextViewRoboto.ROBOTO_THIN); + + if(vistas == null) { + showProgress(true); + ObtenerAgencias(); + } + else + { + rellenarLista(); + } + } + + @Override + protected void setClickActions(int id) { + super.setClickActions(id); + switch (id) + { + case R.id.relative_agencia_direccion: + Bundle bundle = new Bundle(); + bundle.putString(FragmentConsignatarios.TIPO, FragmentConsignatarios.TIPO_VISTA); + activity.cambiarFragment(new FragmentConsignatarios(), bundle); + break; + } + } + + public void ObtenerAgencias() + { + CmdObtenerAgencias cmd = new CmdObtenerAgencias(pedido.getOrder().getConsignatarioActivo().getId_Consigna(), pedido.getOrder().getCalendario().getFormatFecha()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(com.nelosan.baselibrary.command.CommandBase cmd) { + vistas = ((CmdObtenerAgencias) cmd).getVistas(); + agencias = ((CmdObtenerAgencias) cmd).getAgencias(); + rellenarLista(); + if (agencias.size() > 0) { + showProgress(false); + } else { + activity.onBackPressed(); + } + } + }); + + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + ObtenerAgencias(); + } + + @Override + public void Accept(CommandBase cmd) { + activity.onBackPressed(); + } + }); + + execute(cmd); + } + + public void seleccionarVista(Vista v) + { + ArrayList agens = new ArrayList(); + + for(Agencia a : agencias){ + if (a.getVista() == v.getVista_id()) + { + agens.add(a); + } + } + + Collections.sort(agens, new ComparadorAgencias()); + + Bundle bundle = new Bundle(); + bundle.putParcelableArrayList(FragmentAgencias.AGENCIAS, agens); + bundle.putString(FragmentAgencias.VISTA, v.getVista()); + activity.cambiarFragment(new FragmentAgencias(), bundle); + } + + public void rellenarLista() + { + final AdapterVistas adaptador = new AdapterVistas(vistas); + setListControllerLayout(lstVistas); + lstVistas.setAdapter(adaptador); + lstVistas.setLayoutManager(new LinearLayoutManager(activity, LinearLayoutManager.VERTICAL, false)); + lstVistas.setItemAnimator(new DefaultItemAnimator()); + adaptador.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Vista vista = adaptador.getItem(lstVistas.getChildPosition(v)); + seleccionarVista(vista); + } + }); + + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Agencia.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Agencia.java new file mode 100644 index 00000000..4b4405c7 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Agencia.java @@ -0,0 +1,74 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 14/01/15. + */ +public class Agencia implements Parcelable{ + + private int Id_Agencia = 0; + private String Agencia = ""; + private int Vista = 0; + + public Agencia(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public Agencia createFromParcel(Parcel in) { + return new Agencia(in); + } + + @Override + public Agencia[] newArray(int size) { + return new Agencia[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id_Agencia); + dest.writeString(Agencia); + dest.writeInt(Vista); + } + + private void readFromParcel(Parcel in) { + Id_Agencia = in.readInt(); + Agencia = in.readString(); + Vista = in.readInt(); + } + + public int getId_Agencia() { + return Id_Agencia; + } + + public void setId_Agencia(int id_Agencia) { + Id_Agencia = id_Agencia; + } + + public String getAgencia() { + return Agencia; + } + + public void setAgencia(String agencia) { + Agencia = agencia; + } + + public int getVista() { + return Vista; + } + + public void setVista(int vista) { + Vista = vista; + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ArticuloVentasTags.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ArticuloVentasTags.java new file mode 100644 index 00000000..56587393 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ArticuloVentasTags.java @@ -0,0 +1,256 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Created by nelo on 20/01/15. + */ +public class ArticuloVentasTags implements Parcelable{ + + private int Id_Article = 0; + private String Article = ""; + private String foto = ""; + private int Id_Tipo = 0; + private String Tipo = ""; + private double available = 0.0; + private String Descripcion = ""; + private double price = 0.0; + private int vcalc = 0; + private int Reino = 0; + private int Unidades = 0; + private String ReinoNombre = ""; + private int warehouse_id = 0; + private Map tags = new HashMap(); + private List ArticulosSimilares = new ArrayList(); + private List ArticulosComprados = new ArrayList(); + private List tarifas = new ArrayList(); + private String subName = ""; + + + protected ArticuloVentasTags(Parcel in) { + Id_Article = in.readInt(); + Article = in.readString(); + foto = in.readString(); + Id_Tipo = in.readInt(); + Tipo = in.readString(); + available = in.readDouble(); + Descripcion = in.readString(); + price = in.readDouble(); + vcalc = in.readInt(); + Reino = in.readInt(); + Unidades = in.readInt(); + ReinoNombre = in.readString(); + warehouse_id = in.readInt(); + ArticulosSimilares = in.createTypedArrayList(ArticuloVentasTags.CREATOR); + ArticulosComprados = in.createTypedArrayList(ArticuloVentasTags.CREATOR); + tarifas = in.createTypedArrayList(Tarifa.CREATOR); + readTagsParcelable(in); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id_Article); + dest.writeString(Article); + dest.writeString(foto); + dest.writeInt(Id_Tipo); + dest.writeString(Tipo); + dest.writeDouble(available); + dest.writeString(Descripcion); + dest.writeDouble(price); + dest.writeInt(vcalc); + dest.writeInt(Reino); + dest.writeInt(Unidades); + dest.writeString(ReinoNombre); + dest.writeInt(warehouse_id); + dest.writeTypedList(ArticulosSimilares); + dest.writeTypedList(ArticulosComprados); + dest.writeTypedList(tarifas); + writeTagsParcelable(dest); + } + + public void readTagsParcelable(Parcel in){ + int size = in.readInt(); + for(int i = 0; i < size; i++){ + String key = in.readString(); + String value = in.readString(); + tags.put(key,value); + } + } + + public void writeTagsParcelable(Parcel dest){ + dest.writeInt(tags.size()); + for(Map.Entry entry : tags.entrySet()){ + dest.writeString(entry.getKey()); + dest.writeString(entry.getValue()); + } + } + + public static final Creator CREATOR = new Creator() { + @Override + public ArticuloVentasTags createFromParcel(Parcel in) { + return new ArticuloVentasTags(in); + } + + @Override + public ArticuloVentasTags[] newArray(int size) { + return new ArticuloVentasTags[size]; + } + }; + + public String getSubName() { + return subName; + } + + public void setSubName(String subName) { + this.subName = subName; + } + + public int getId_Article() { + return Id_Article; + } + + public void setId_Article(int id_Article) { + Id_Article = id_Article; + } + + public String getArticle() { + return Article; + } + + public void setArticle(String article) { + Article = article; + } + + public String getFoto() { + return foto; + } + + public void setFoto(String foto) { + this.foto = foto; + } + + public int getId_Tipo() { + return Id_Tipo; + } + + public void setId_Tipo(int id_Tipo) { + Id_Tipo = id_Tipo; + } + + public double getAvailable() { + return available; + } + + public void setAvailable(double available) { + this.available = available; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + public int getVcalc() { + return vcalc; + } + + public void setVcalc(int vcalc) { + this.vcalc = vcalc; + } + + public int getReino() { + return Reino; + } + + public void setReino(int reino) { + Reino = reino; + } + + public List getArticulosSimilares() { + return ArticulosSimilares; + } + + public void setArticulosSimilares(List articulosSimilares) { + ArticulosSimilares = articulosSimilares; + } + + public List getTarifas() { + return tarifas; + } + + public void setTarifas(List tarifas) { + this.tarifas = tarifas; + } + + public int getWarehouse_id() { + return warehouse_id; + } + + public void setWarehouse_id(int warehouse_id) { + this.warehouse_id = warehouse_id; + } + + public String getTipo() { + return Tipo; + } + + public void setTipo(String tipo) { + Tipo = tipo; + } + + public String getReinoNombre() { + return ReinoNombre; + } + + public void setReinoNombre(String reinoNombre) { + ReinoNombre = reinoNombre; + } + + public List getArticulosComprados() { + return ArticulosComprados; + } + + public void setArticulosComprados(List articulosComprados) { + ArticulosComprados = articulosComprados; + } + + public int getUnidades() { + return Unidades; + } + + public void setUnidades(int unidades) { + Unidades = unidades; + } + + public String getDescripcion() { + return Descripcion; + } + + public void setDescripcion(String descripcion) { + Descripcion = descripcion; + } + + public Map getTags() { + return tags; + } + + public void setTags(Map tags) { + this.tags = tags; + } + + @Override + public int describeContents() { + return 0; + } + +} + diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/BotonMain.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/BotonMain.java new file mode 100644 index 00000000..fbb8297b --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/BotonMain.java @@ -0,0 +1,41 @@ +package com.verdnatura.verdnaturaventas.model; + +/** + * Created by nelo on 5/11/15. + */ +public class BotonMain { + + private String Nombre; + private int Imagen; + private int Reino; + + public BotonMain(String nombre, int imagen, int reino) { + Nombre = nombre; + Imagen = imagen; + Reino = reino; + } + + public String getNombre() { + return Nombre; + } + + public void setNombre(String nombre) { + Nombre = nombre; + } + + public int getImagen() { + return Imagen; + } + + public void setImagen(int imagen) { + Imagen = imagen; + } + + public int getReino() { + return Reino; + } + + public void setReino(int reino) { + Reino = reino; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ClienteVentas.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ClienteVentas.java new file mode 100644 index 00000000..525df145 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ClienteVentas.java @@ -0,0 +1,166 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.List; + +/** + * Created by nelo on 24/02/15. + */ +public class ClienteVentas implements Parcelable{ + + private int Id_Cliente = 0; + private String Cliente = ""; + private String Domicilio = ""; + private String Email = ""; + private int Mail = 0; + private String Name = ""; + private List Consignatarios; + private List Ultimos_Tickets; + private boolean modificado = false; + private String Tipo = ""; + private double Credito = 0.0; + private double Riesgo = 0.0; + + + protected ClienteVentas(Parcel in) { + Id_Cliente = in.readInt(); + Cliente = in.readString(); + Domicilio = in.readString(); + Email = in.readString(); + Mail = in.readInt(); + Name = in.readString(); + Ultimos_Tickets = in.createStringArrayList(); + Tipo = in.readString(); + Credito = in.readDouble(); + Riesgo = in.readDouble(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public ClienteVentas createFromParcel(Parcel in) { + return new ClienteVentas(in); + } + + @Override + public ClienteVentas[] newArray(int size) { + return new ClienteVentas[size]; + } + }; + + public int getId_Cliente() { + return Id_Cliente; + } + + public void setId_Cliente(int id_Cliente) { + Id_Cliente = id_Cliente; + } + + public String getCliente() { + return Cliente; + } + + public void setCliente(String cliente) { + Cliente = cliente; + } + + public String getDomicilio() { + return Domicilio; + } + + public void setDomicilio(String domicilio) { + Domicilio = domicilio; + } + + public List getUltimos_Tickets() { + return Ultimos_Tickets; + } + + public void setUltimos_Tickets(List ultimos_Tickets) { + Ultimos_Tickets = ultimos_Tickets; + } + + public String getEmail() { + return Email; + } + + public void setEmail(String email) { + Email = email; + } + + public int getMail() { + return Mail; + } + + public void setMail(int mail) { + Mail = mail; + } + + public List getConsignatarios() { + return Consignatarios; + } + + public void setConsignatarios(List consignatarios) { + this.Consignatarios = consignatarios; + } + + public String getName() { + return Name; + } + + public void setName(String name) { + Name = name; + } + + public boolean isModificado() { + return modificado; + } + + public void setModificado(boolean modificado) { + this.modificado = modificado; + } + + public String getTipo() { + return Tipo; + } + + public void setTipo(String tipo) { + Tipo = tipo; + } + + public double getCredito() { + return Credito; + } + + public void setCredito(double credito) { + Credito = credito; + } + + public double getRiesgo() { + return Riesgo; + } + + public void setRiesgo(double riesgo) { + Riesgo = riesgo; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id_Cliente); + dest.writeString(Cliente); + dest.writeString(Domicilio); + dest.writeString(Email); + dest.writeInt(Mail); + dest.writeString(Name); + dest.writeStringList(Ultimos_Tickets); + dest.writeString(Tipo); + dest.writeDouble(Credito); + dest.writeDouble(Riesgo); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Component.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Component.java new file mode 100644 index 00000000..f89a19ee --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Component.java @@ -0,0 +1,80 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 27/05/15. + */ +public class Component implements Parcelable{ + + private int id; + private int component_id; + private double cost; + private int warehouse_id; + + protected Component(Parcel in) { + id = in.readInt(); + component_id = in.readInt(); + cost = in.readDouble(); + warehouse_id = in.readInt(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public Component createFromParcel(Parcel in) { + return new Component(in); + } + + @Override + public Component[] newArray(int size) { + return new Component[size]; + } + }; + + public int getComponent_id() { + return component_id; + } + + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public void setComponent_id(int component_id) { + this.component_id = component_id; + } + + public double getCost() { + return cost; + } + + public void setCost(double cost) { + this.cost = cost; + } + + public int getWarehouse_id() { + return warehouse_id; + } + + public void setWarehouse_id(int warehouse_id) { + this.warehouse_id = warehouse_id; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(id); + dest.writeInt(component_id); + dest.writeDouble(cost); + dest.writeInt(warehouse_id); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Consignatario.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Consignatario.java new file mode 100644 index 00000000..483b4ef9 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Consignatario.java @@ -0,0 +1,101 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 14/01/15. + */ +public class Consignatario implements Parcelable{ + + private int Id_Consigna = 0; + private String Consignatario = ""; + private int Seguro = 0; + private int Id_Agencia = 0; + private int predeterminada = 0; + private String Domicilio = ""; + + protected Consignatario(Parcel in) { + Id_Consigna = in.readInt(); + Consignatario = in.readString(); + Seguro = in.readInt(); + Id_Agencia = in.readInt(); + predeterminada = in.readInt(); + Domicilio = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public Consignatario createFromParcel(Parcel in) { + return new Consignatario(in); + } + + @Override + public Consignatario[] newArray(int size) { + return new Consignatario[size]; + } + }; + + public int getId_Consigna() { + return Id_Consigna; + } + + public void setId_Consigna(int id_Consigna) { + Id_Consigna = id_Consigna; + } + + public String getConsignatario() { + return Consignatario; + } + + public void setConsignatario(String consignatario) { + Consignatario = consignatario; + } + + public int getSeguro() { + return Seguro; + } + + public void setSeguro(int seguro) { + Seguro = seguro; + } + + public int getId_Agencia() { + return Id_Agencia; + } + + public void setId_Agencia(int id_Agencia) { + Id_Agencia = id_Agencia; + } + + public int getPredeterminada() { + return predeterminada; + } + + public void setPredeterminada(int predeterminada) { + this.predeterminada = predeterminada; + } + + public String getDomicilio() { + return Domicilio; + } + + public void setDomicilio(String domicilio) { + Domicilio = domicilio; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id_Consigna); + dest.writeString(Consignatario); + dest.writeInt(Seguro); + dest.writeInt(Id_Agencia); + dest.writeInt(predeterminada); + dest.writeString(Domicilio); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosCompra.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosCompra.java new file mode 100644 index 00000000..b5b80d10 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosCompra.java @@ -0,0 +1,126 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 22/01/15. + */ +public class DatosCompra implements Parcelable { + + private int Cantidad; + private String Especificaciones = ""; + private Tarifa Tarifa; + private ArticuloVentasTags articulo; + private double Precio; + private int grouping; + private int items; + private String Warehouse = ""; + + public DatosCompra(){} + + + protected DatosCompra(Parcel in) { + Cantidad = in.readInt(); + Especificaciones = in.readString(); + Tarifa = in.readParcelable(com.verdnatura.verdnaturaventas.model.Tarifa.class.getClassLoader()); + articulo = in.readParcelable(ArticuloVentasTags.class.getClassLoader()); + Precio = in.readDouble(); + grouping = in.readInt(); + items = in.readInt(); + Warehouse = in.readString(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Cantidad); + dest.writeString(Especificaciones); + dest.writeParcelable(Tarifa, flags); + dest.writeParcelable(articulo, flags); + dest.writeDouble(Precio); + dest.writeInt(grouping); + dest.writeInt(items); + dest.writeString(Warehouse); + } + + public static final Creator CREATOR = new Creator() { + @Override + public DatosCompra createFromParcel(Parcel in) { + return new DatosCompra(in); + } + + @Override + public DatosCompra[] newArray(int size) { + return new DatosCompra[size]; + } + }; + + public int getCantidad() { + return Cantidad; + } + + public void setCantidad(int cantidad) { + Cantidad = cantidad; + } + + public String getEspecificaciones() { + return Especificaciones; + } + + public void setEspecificaciones(String especificaciones) { + Especificaciones = especificaciones; + } + + public Tarifa getTarifa() { + return Tarifa; + } + + public void setTarifa(Tarifa tarifa) { + Tarifa = tarifa; + } + + public ArticuloVentasTags getArticulo() { + return articulo; + } + + public void setArticulo(ArticuloVentasTags articulo) { + this.articulo = articulo; + } + + public double getPrecio() { + return Precio; + } + + public void setPrecio(double precio) { + Precio = precio; + } + + public int getGrouping() { + return grouping; + } + + public void setGrouping(int grouping) { + this.grouping = grouping; + } + + public int getItems() { + return items; + } + + public void setItems(int items) { + this.items = items; + } + + @Override + public int describeContents() { + return 0; + } + + public String getWarehouse() { + return Warehouse; + } + + public void setWarehouse(String warehouse) { + Warehouse = warehouse; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosNuevaOrden.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosNuevaOrden.java new file mode 100644 index 00000000..99595e32 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosNuevaOrden.java @@ -0,0 +1,19 @@ +package com.verdnatura.verdnaturaventas.model; + +/** + * Created by nelo on 19/01/15. + */ +public class DatosNuevaOrden +{ + public String fecha; + public int cid, aid, order = -1; + public boolean crear; + + public DatosNuevaOrden(String f, int c, int a) + { + this.fecha = f; + this.cid = c; + this.aid = a; + + } +} \ No newline at end of file diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosPasarBanco.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosPasarBanco.java new file mode 100644 index 00000000..589a2afd --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/DatosPasarBanco.java @@ -0,0 +1,134 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 15/05/15. + */ +public class DatosPasarBanco implements Parcelable{ + + private int amount = 0; + private String ds_order = ""; + private int id = 0; + private int currency = 0; + private int transaction_type = 0; + private int terminal = 0; + private String url = ""; + private String merchant_url = ""; + private String signature = ""; + + protected DatosPasarBanco(Parcel in) { + amount = in.readInt(); + ds_order = in.readString(); + id = in.readInt(); + currency = in.readInt(); + transaction_type = in.readInt(); + terminal = in.readInt(); + url = in.readString(); + merchant_url = in.readString(); + signature = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public DatosPasarBanco createFromParcel(Parcel in) { + return new DatosPasarBanco(in); + } + + @Override + public DatosPasarBanco[] newArray(int size) { + return new DatosPasarBanco[size]; + } + }; + + public int getAmount() { + return amount; + } + + public void setAmount(int amount) { + this.amount = amount; + } + + public String getDs_order() { + return ds_order; + } + + public void setDs_order(String ds_order) { + this.ds_order = ds_order; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getCurrency() { + return currency; + } + + public void setCurrency(int currency) { + this.currency = currency; + } + + public int getTransaction_type() { + return transaction_type; + } + + public void setTransaction_type(int transaction_type) { + this.transaction_type = transaction_type; + } + + public int getTerminal() { + return terminal; + } + + public void setTerminal(int terminal) { + this.terminal = terminal; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getMerchant_url() { + return merchant_url; + } + + public void setMerchant_url(String merchant_url) { + this.merchant_url = merchant_url; + } + + public String getSignature() { + return signature; + } + + public void setSignature(String signature) { + this.signature = signature; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(amount); + dest.writeString(ds_order); + dest.writeInt(id); + dest.writeInt(currency); + dest.writeInt(transaction_type); + dest.writeInt(terminal); + dest.writeString(url); + dest.writeString(merchant_url); + dest.writeString(signature); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Order.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Order.java new file mode 100644 index 00000000..85bb8a9a --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Order.java @@ -0,0 +1,288 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +import com.verdnatura.verdnaturaventas.MyApplication; +import com.verdnatura.verdnaturaventas.core.DateControll; +import com.verdnatura.verdnaturaventas.core.FileManager; + +import java.util.ArrayList; +import java.util.List; +import java.util.Observable; +import java.util.Observer; + +/** + * Created by nelo on 28/01/15. + */ +public class Order implements Parcelable{ + + private int id = 0; + private int customer_id = 0; + private int delivery_method_id = 0; + private int agency_id = 0; + private int address_id = 0; + private String Fecha = ""; + private Consignatario consignatarioActivo; + private Agencia agencia, agenciaAntigua = null; + private List rows = new ArrayList(); + private DateControll calendario = new DateControll(); + private ClienteVentas cliente; + private double TotalConIva = 0.0; + private boolean PedidoSplitado = false; + private double CantidadPagar = 0.0; + private int createYear = 0, createMonth = 0, createDay = 0; + private String transactionOk; + private String Notas = ""; + private String source_app = "ANDROID"; + private String DeviceID = ""; + + public Order() { + } + + + protected Order(Parcel in) { + id = in.readInt(); + customer_id = in.readInt(); + delivery_method_id = in.readInt(); + agency_id = in.readInt(); + address_id = in.readInt(); + Fecha = in.readString(); + consignatarioActivo = in.readParcelable(Consignatario.class.getClassLoader()); + agencia = in.readParcelable(Agencia.class.getClassLoader()); + agenciaAntigua = in.readParcelable(Agencia.class.getClassLoader()); + rows = in.createTypedArrayList(OrderRow.CREATOR); + cliente = in.readParcelable(ClienteVentas.class.getClassLoader()); + TotalConIva = in.readDouble(); + PedidoSplitado = in.readByte() != 0; + CantidadPagar = in.readDouble(); + createYear = in.readInt(); + createMonth = in.readInt(); + createDay = in.readInt(); + transactionOk = in.readString(); + Notas = in.readString(); + source_app = in.readString(); + DeviceID = in.readString(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(id); + dest.writeInt(customer_id); + dest.writeInt(delivery_method_id); + dest.writeInt(agency_id); + dest.writeInt(address_id); + dest.writeString(Fecha); + dest.writeParcelable(consignatarioActivo, flags); + dest.writeParcelable(agencia, flags); + dest.writeParcelable(agenciaAntigua, flags); + dest.writeTypedList(rows); + dest.writeParcelable(cliente, flags); + dest.writeDouble(TotalConIva); + dest.writeByte((byte) (PedidoSplitado ? 1 : 0)); + dest.writeDouble(CantidadPagar); + dest.writeInt(createYear); + dest.writeInt(createMonth); + dest.writeInt(createDay); + dest.writeString(transactionOk); + dest.writeString(Notas); + dest.writeString(source_app); + dest.writeString(DeviceID); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public Order createFromParcel(Parcel in) { + return new Order(in); + } + + @Override + public Order[] newArray(int size) { + return new Order[size]; + } + }; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getAddress_id() { + return address_id; + } + + public void setAddress_id(int address_id) { + this.address_id = address_id; + } + + public List getRows() { + return rows; + } + + public void setRows(List rows) { + this.rows = rows; + } + + public Agencia getAgencia() { + return agencia; + } + + public void setAgencia(Agencia agencia) { + this.agencia = agencia; + } + + public Agencia getAgenciaAntigua() { + return agenciaAntigua; + } + + public void setAgenciaAntigua(Agencia agenciaAntigua) { + this.agenciaAntigua = agenciaAntigua; + } + + public DateControll getCalendario() { + return calendario; + } + + public void setCalendario(DateControll calendario) { + this.calendario = calendario; + } + + public void setConsignatarioActivo(Consignatario c) + { + this.consignatarioActivo = c; + } + + public Consignatario getConsignatarioActivo() + { + return consignatarioActivo; + } + + public ClienteVentas getCliente() { + return cliente; + } + + public void setCliente(ClienteVentas cliente) { + this.cliente = cliente; + } + + public double getTotalConIva() { + return TotalConIva; + } + + public void setTotalConIva(double totalConIva) { + TotalConIva = totalConIva; + } + + public int getCustomer_id() { + return customer_id; + } + + public void setCustomer_id(int customer_id) { + this.customer_id = customer_id; + } + + public int getDelivery_method_id() { + return delivery_method_id; + } + + public void setDelivery_method_id(int delivery_method_id) { + this.delivery_method_id = delivery_method_id; + } + + public int getAgency_id() { + return agency_id; + } + + public void setAgency_id(int agency_id) { + this.agency_id = agency_id; + } + + public String getFecha() { + return Fecha; + } + + public void setFecha(String fecha) { + this.Fecha = fecha; + } + + public boolean isPedidoSplitado() { + return PedidoSplitado; + } + + public void setPedidoSplitado(boolean pedidoSplitado) { + PedidoSplitado = pedidoSplitado; + } + + public double getCantidadPagar() { + return CantidadPagar; + } + + public void setCantidadPagar(double cantidadPagar) { + CantidadPagar = cantidadPagar; + } + + public int getCreateYear() { + return createYear; + } + + public void setCreateYear(int createYear) { + this.createYear = createYear; + + } + + public int getCreateMonth() { + return createMonth; + } + + public void setCreateMonth(int createMonth) { + this.createMonth = createMonth; + } + + public int getCreateDay() { + return createDay; + } + + public void setCreateDay(int createDay) { + this.createDay = createDay; + } + + public String getTransactionOk() { + return transactionOk; + } + + public void setTransactionOk(String transactionOk) { + this.transactionOk = transactionOk; + } + + public String getNotas() { + return Notas; + } + + public void setNotas(String notas) { + Notas = notas; + } + + public String getSource_app() { + return source_app; + } + + public void setSource_app(String source_app) { + this.source_app = source_app; + } + + public String getDeviceID() { + return DeviceID; + } + + public void setDeviceID(String deviceID) { + DeviceID = deviceID; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderDiference.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderDiference.java new file mode 100644 index 00000000..6ff61cc0 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderDiference.java @@ -0,0 +1,110 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 17/03/15. + */ +public class OrderDiference implements Parcelable{ + + private String articulo = ""; + private double oldPrice, price; + private int oldCantidad, cantidad; + private boolean escribirPrecio = false, escribirDisponible = false; + + public OrderDiference() + { + + } + + protected OrderDiference(Parcel in) { + articulo = in.readString(); + oldPrice = in.readDouble(); + price = in.readDouble(); + oldCantidad = in.readInt(); + cantidad = in.readInt(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public OrderDiference createFromParcel(Parcel in) { + return new OrderDiference(in); + } + + @Override + public OrderDiference[] newArray(int size) { + return new OrderDiference[size]; + } + }; + + public String getArticulo() { + return articulo; + } + + public void setArticulo(String articulo) { + this.articulo = articulo; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + public int getCantidad() { + return cantidad; + } + + public void setCantidad(int cantidad) { + this.cantidad = cantidad; + } + + public double getOldPrice() { + return oldPrice; + } + + public void setOldPrice(double oldPrice) { + this.oldPrice = oldPrice; + } + + public int getOldCantidad() { + return oldCantidad; + } + + public void setOldCantidad(int oldCantidad) { + this.oldCantidad = oldCantidad; + } + + public boolean isEscribirPrecio() { + return escribirPrecio; + } + + public void setEscribirPrecio(boolean escribirPrecio) { + this.escribirPrecio = escribirPrecio; + } + + public boolean isEscribirDisponible() { + return escribirDisponible; + } + + public void setEscribirDisponible(boolean escribirDisponible) { + this.escribirDisponible = escribirDisponible; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(articulo); + dest.writeDouble(oldPrice); + dest.writeDouble(price); + dest.writeInt(oldCantidad); + dest.writeInt(cantidad); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderImprimir.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderImprimir.java new file mode 100644 index 00000000..19e7b912 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderImprimir.java @@ -0,0 +1,81 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.List; + +/** + * Created by nelo on 30/11/15. + */ +public class OrderImprimir implements Parcelable{ + + private int Id = 0; + private String Cliente = ""; + private String App = ""; + private List Tickets; + + protected OrderImprimir(Parcel in) { + Id = in.readInt(); + Cliente = in.readString(); + App = in.readString(); + Tickets = in.createTypedArrayList(TicketOrder.CREATOR); + } + + public static final Creator CREATOR = new Creator() { + @Override + public OrderImprimir createFromParcel(Parcel in) { + return new OrderImprimir(in); + } + + @Override + public OrderImprimir[] newArray(int size) { + return new OrderImprimir[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id); + dest.writeString(Cliente); + dest.writeString(App); + dest.writeTypedList(Tickets); + } + + public int getId() { + return Id; + } + + public void setId(int id) { + Id = id; + } + + public String getCliente() { + return Cliente; + } + + public void setCliente(String cliente) { + Cliente = cliente; + } + + public String getApp() { + return App; + } + + public void setApp(String app) { + App = app; + } + + public List getTickets() { + return Tickets; + } + + public void setTickets(List tickets) { + Tickets = tickets; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderResumen.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderResumen.java new file mode 100644 index 00000000..774f3b8e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderResumen.java @@ -0,0 +1,126 @@ +package com.verdnatura.verdnaturaventas.model; + + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 10/11/15. + */ +public class OrderResumen implements Parcelable{ + + private int id = 0; + private int customer_id = 0; + private int delivery_method_id = 0; + private int agency_id = 0; + private String agency = ""; + private int address_id = 0; + private String address = ""; + private String Fecha = ""; + + protected OrderResumen(Parcel in) { + id = in.readInt(); + customer_id = in.readInt(); + delivery_method_id = in.readInt(); + agency_id = in.readInt(); + agency = in.readString(); + address_id = in.readInt(); + address = in.readString(); + Fecha = in.readString(); + } + + public OrderResumen(){} + + public static final Creator CREATOR = new Creator() { + @Override + public OrderResumen createFromParcel(Parcel in) { + return new OrderResumen(in); + } + + @Override + public OrderResumen[] newArray(int size) { + return new OrderResumen[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(id); + dest.writeInt(customer_id); + dest.writeInt(delivery_method_id); + dest.writeInt(agency_id); + dest.writeString(agency); + dest.writeInt(address_id); + dest.writeString(address); + dest.writeString(Fecha); + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getCustomer_id() { + return customer_id; + } + + public void setCustomer_id(int customer_id) { + this.customer_id = customer_id; + } + + public int getDelivery_method_id() { + return delivery_method_id; + } + + public void setDelivery_method_id(int delivery_method_id) { + this.delivery_method_id = delivery_method_id; + } + + public int getAgency_id() { + return agency_id; + } + + public void setAgency_id(int agency_id) { + this.agency_id = agency_id; + } + + public int getAddress_id() { + return address_id; + } + + public void setAddress_id(int address_id) { + this.address_id = address_id; + } + + public String getFecha() { + return Fecha; + } + + public void setFecha(String fecha) { + Fecha = fecha; + } + + public String getAgency() { + return agency; + } + + public void setAgency(String agency) { + this.agency = agency; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderRow.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderRow.java new file mode 100644 index 00000000..aa6b617f --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/OrderRow.java @@ -0,0 +1,106 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 28/01/15. + */ +public class OrderRow implements Parcelable{ + + private int id = 0; + private int order_id = 0; + private int amount = 0; + private int amount_old = 0; + private Tarifa tarifa; + private ArticuloVentasTags articulo; + + public OrderRow() + { + + } + + protected OrderRow(Parcel in) { + id = in.readInt(); + order_id = in.readInt(); + amount = in.readInt(); + amount_old = in.readInt(); + tarifa = in.readParcelable(Tarifa.class.getClassLoader()); + articulo = in.readParcelable(ArticuloVentasTags.class.getClassLoader()); + } + + public static final Creator CREATOR = new Creator() { + @Override + public OrderRow createFromParcel(Parcel in) { + return new OrderRow(in); + } + + @Override + public OrderRow[] newArray(int size) { + return new OrderRow[size]; + } + }; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getOrder_id() { + return order_id; + } + + public void setOrder_id(int order_id) { + this.order_id = order_id; + } + + public int getAmount() { + return amount; + } + + public void setAmount(int amount) { + this.amount = amount; + } + + public Tarifa getTarifa() { + return tarifa; + } + + public void setTarifa(Tarifa tarifa) { + this.tarifa = tarifa; + } + + public ArticuloVentasTags getArticulo() { + return articulo; + } + + public void setArticulo(ArticuloVentasTags articulo) { + this.articulo = articulo; + } + + public int getAmount_old() { + return amount_old; + } + + public void setAmount_old(int amount_old) { + this.amount_old = amount_old; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(id); + dest.writeInt(order_id); + dest.writeInt(amount); + dest.writeInt(amount_old); + dest.writeParcelable(tarifa, flags); + dest.writeParcelable(articulo, flags); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ParametrosReino.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ParametrosReino.java new file mode 100644 index 00000000..d1d2034a --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ParametrosReino.java @@ -0,0 +1,99 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 11/09/15. + */ +public class ParametrosReino implements Parcelable{ + + private int reino, consignatario, agencia; + private String fecha, nombre, cadena; + + public ParametrosReino(){} + + protected ParametrosReino(Parcel in) { + reino = in.readInt(); + consignatario = in.readInt(); + agencia = in.readInt(); + fecha = in.readString(); + nombre = in.readString(); + cadena = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public ParametrosReino createFromParcel(Parcel in) { + return new ParametrosReino(in); + } + + @Override + public ParametrosReino[] newArray(int size) { + return new ParametrosReino[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(reino); + dest.writeInt(consignatario); + dest.writeInt(agencia); + dest.writeString(fecha); + dest.writeString(nombre); + dest.writeString(cadena); + } + + public int getReino() { + return reino; + } + + public void setReino(int reino) { + this.reino = reino; + } + + public int getConsignatario() { + return consignatario; + } + + public void setConsignatario(int consignatario) { + this.consignatario = consignatario; + } + + public int getAgencia() { + return agencia; + } + + public void setAgencia(int agencia) { + this.agencia = agencia; + } + + public String getFecha() { + return fecha; + } + + public void setFecha(String fecha) { + this.fecha = fecha; + } + + public String getNombre() { + return nombre; + } + + public void setNombre(String nombre) { + this.nombre = nombre; + } + + public String getCadena() { + return cadena; + } + + public void setCadena(String cadena) { + this.cadena = cadena; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ParamsBanco.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ParamsBanco.java new file mode 100644 index 00000000..609b0e72 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/ParamsBanco.java @@ -0,0 +1,92 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 22/01/16. + */ +public class ParamsBanco implements Parcelable{ + + private String EncodedParams = ""; + private String Signature = ""; + private String DSSignature = ""; + private String Url = ""; + private int DSOrder = 0; + + protected ParamsBanco(Parcel in) { + EncodedParams = in.readString(); + Signature = in.readString(); + DSSignature = in.readString(); + Url = in.readString(); + DSOrder = in.readInt(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public ParamsBanco createFromParcel(Parcel in) { + return new ParamsBanco(in); + } + + @Override + public ParamsBanco[] newArray(int size) { + return new ParamsBanco[size]; + } + }; + + public String getEncodedParams() { + return EncodedParams; + } + + public void setEncodedParams(String encodedParams) { + EncodedParams = encodedParams; + } + + public String getSignature() { + return Signature; + } + + public void setSignature(String signature) { + Signature = signature; + } + + public String getDSSignature() { + return DSSignature; + } + + public void setDSSignature(String DSSignature) { + this.DSSignature = DSSignature; + } + + public String getUrl() { + return Url; + } + + public void setUrl(String url) { + Url = url; + } + + public int getDSOrder() { + return DSOrder; + } + + public void setDSOrder(int DSOrder) { + this.DSOrder = DSOrder; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(EncodedParams); + dest.writeString(Signature); + dest.writeString(DSSignature); + dest.writeString(Url); + dest.writeInt(DSOrder); + } +} + + diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Tarifa.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Tarifa.java new file mode 100644 index 00000000..0261b295 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Tarifa.java @@ -0,0 +1,125 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.List; + +/** + * Created by nelo on 12/03/15. + */ +public class Tarifa implements Parcelable{ + + private int Id_Article; + private int rate; + private int grouping; + private int warehouse_id; + private String warehouse; + private int items; + private double price; + private List Components; + + protected Tarifa(Parcel in) { + Id_Article = in.readInt(); + rate = in.readInt(); + grouping = in.readInt(); + warehouse_id = in.readInt(); + warehouse = in.readString(); + items = in.readInt(); + price = in.readDouble(); + Components = in.createTypedArrayList(Component.CREATOR); + } + + public static final Creator CREATOR = new Creator() { + @Override + public Tarifa createFromParcel(Parcel in) { + return new Tarifa(in); + } + + @Override + public Tarifa[] newArray(int size) { + return new Tarifa[size]; + } + }; + + public int getId_Article() { + return Id_Article; + } + + public void setId_Article(int id_Article) { + Id_Article = id_Article; + } + + public int getRate() { + return rate; + } + + public void setRate(int rate) { + this.rate = rate; + } + + public int getGrouping() { + return grouping; + } + + public void setGrouping(int grouping) { + this.grouping = grouping; + } + + public int getWarehouse_id() { + return warehouse_id; + } + + public void setWarehouse_id(int warehouse_id) { + this.warehouse_id = warehouse_id; + } + + public double getPrice() { + return price; + } + + public void setPrice(double price) { + this.price = price; + } + + public int getItems() { + return items; + } + + public void setItems(int items) { + this.items = items; + } + + public List getComponents() { + return Components; + } + + public void setComponents(List components) { + Components = components; + } + + public String getWarehouse() { + return warehouse; + } + + public void setWarehouse(String warehouse) { + this.warehouse = warehouse; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id_Article); + dest.writeInt(rate); + dest.writeInt(grouping); + dest.writeInt(warehouse_id); + dest.writeString(warehouse); + dest.writeInt(items); + dest.writeDouble(price); + dest.writeTypedList(Components); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketOrder.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketOrder.java new file mode 100644 index 00000000..8aa619f5 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketOrder.java @@ -0,0 +1,59 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 30/11/15. + */ +public class TicketOrder implements Parcelable{ + + private int Ticket = 0; + private String Warehouse = ""; + + protected TicketOrder(Parcel in) { + Ticket = in.readInt(); + Warehouse = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public TicketOrder createFromParcel(Parcel in) { + return new TicketOrder(in); + } + + @Override + public TicketOrder[] newArray(int size) { + return new TicketOrder[size]; + } + }; + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Ticket); + dest.writeString(Warehouse); + } + + public int getTicket() { + return Ticket; + } + + public void setTicket(int ticket) { + Ticket = ticket; + } + + public String getWarehouse() { + return Warehouse; + } + + public void setWarehouse(String warehouse) { + Warehouse = warehouse; + } + + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketRecepcion.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketRecepcion.java new file mode 100644 index 00000000..0e3bf510 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketRecepcion.java @@ -0,0 +1,116 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by nelo on 23/07/15. + */ +public class TicketRecepcion implements Parcelable{ + + private int Id_Ticket = 0; + private String Fecha = ""; + private String Agencia = ""; + private List Lineas = new ArrayList(); + private double Total = 0; + private String Alias = ""; + private String Consigna = ""; + + + protected TicketRecepcion(Parcel in) { + Id_Ticket = in.readInt(); + Fecha = in.readString(); + Agencia = in.readString(); + Lineas = in.createTypedArrayList(TicketRecepcionLineasTags.CREATOR); + Total = in.readDouble(); + Alias = in.readString(); + Consigna = in.readString(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id_Ticket); + dest.writeString(Fecha); + dest.writeString(Agencia); + dest.writeTypedList(Lineas); + dest.writeDouble(Total); + dest.writeString(Alias); + dest.writeString(Consigna); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public TicketRecepcion createFromParcel(Parcel in) { + return new TicketRecepcion(in); + } + + @Override + public TicketRecepcion[] newArray(int size) { + return new TicketRecepcion[size]; + } + }; + + public int getId_Ticket() { + return Id_Ticket; + } + + public void setId_Ticket(int id_Ticket) { + Id_Ticket = id_Ticket; + } + + public String getFecha() { + return Fecha; + } + + public void setFecha(String fecha) { + Fecha = fecha; + } + + public String getAgencia() { + return Agencia; + } + + public void setAgencia(String agencia) { + Agencia = agencia; + } + + public List getLineas() { + return Lineas; + } + + public void setLineas(List lineas) { + Lineas = lineas; + } + + public double getTotal() { + return Total; + } + + public void setTotal(double total) { + Total = total; + } + + public String getAlias() { + return Alias; + } + + public void setAlias(String alias) { + Alias = alias; + } + + public String getConsigna() { + return Consigna; + } + + public void setConsigna(String consigna) { + Consigna = consigna; + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketRecepcionLineasTags.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketRecepcionLineasTags.java new file mode 100644 index 00000000..90532d89 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/TicketRecepcionLineasTags.java @@ -0,0 +1,146 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.HashMap; +import java.util.Map; + +/** + * Created by nelo on 23/07/15. + */ +public class TicketRecepcionLineasTags implements Parcelable{ + + private int Id_Movimiento = 0; + private String Concepte = ""; + private int Cantidad = 0; + private String Foto = ""; + private float Preu = 0; + private boolean Ok = false; + private String FechaContar = ""; + private Map Tags = new HashMap(); + + + protected TicketRecepcionLineasTags(Parcel in) { + Id_Movimiento = in.readInt(); + Concepte = in.readString(); + Cantidad = in.readInt(); + Foto = in.readString(); + Preu = in.readFloat(); + Ok = in.readByte() != 0; + FechaContar = in.readString(); + readTagsParcelable(in); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Id_Movimiento); + dest.writeString(Concepte); + dest.writeInt(Cantidad); + dest.writeString(Foto); + dest.writeFloat(Preu); + dest.writeByte((byte) (Ok ? 1 : 0)); + dest.writeString(FechaContar); + writeTagsParcelable(dest); + } + + public void readTagsParcelable(Parcel in){ + int size = in.readInt(); + for(int i = 0; i < size; i++){ + String key = in.readString(); + String value = in.readString(); + Tags.put(key,value); + } + } + + public void writeTagsParcelable(Parcel dest){ + dest.writeInt(Tags.size()); + for(Map.Entry entry : Tags.entrySet()){ + dest.writeString(entry.getKey()); + dest.writeString(entry.getValue()); + } + } + + public static final Creator CREATOR = new Creator() { + @Override + public TicketRecepcionLineasTags createFromParcel(Parcel in) { + return new TicketRecepcionLineasTags(in); + } + + @Override + public TicketRecepcionLineasTags[] newArray(int size) { + return new TicketRecepcionLineasTags[size]; + } + }; + + public String getConcepte() { + return Concepte; + } + + public void setConcepte(String concepte) { + Concepte = concepte; + } + + public String getFoto() { + return Foto; + } + + public void setFoto(String foto) { + Foto = foto; + } + + @Override + public int describeContents() { + return 0; + } + + + public float getPreu() { + return Preu; + } + + public void setPreu(float preu) { + Preu = preu; + } + + public int getId_Movimiento() { + return Id_Movimiento; + } + + public void setId_Movimiento(int id_Movimiento) { + Id_Movimiento = id_Movimiento; + } + + public boolean isOk() { + return Ok; + } + + public void setOk(boolean ok) { + Ok = ok; + } + + public String getFechaContar() { + return FechaContar; + } + + public void setFechaContar(String fechaContar) { + FechaContar = fechaContar; + } + + public Map getTags() { + return Tags; + } + + public void setTags(Map tags) { + Tags = tags; + } + + public int getCantidad() { + return Cantidad; + } + + public void setCantidad(int cantidad) { + Cantidad = cantidad; + } +} + diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Tipo.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Tipo.java new file mode 100644 index 00000000..e8d810bf --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Tipo.java @@ -0,0 +1,79 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 15/01/15. + */ +public class Tipo implements Parcelable{ + + public int Tipo_Id = 0; + public String Tipo = ""; + private int Reino_id = 0; + private String ReinoNombre = ""; + + protected Tipo(Parcel in) { + Tipo_Id = in.readInt(); + Tipo = in.readString(); + Reino_id = in.readInt(); + ReinoNombre = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public Tipo createFromParcel(Parcel in) { + return new Tipo(in); + } + + @Override + public Tipo[] newArray(int size) { + return new Tipo[size]; + } + }; + + public int getId_Tipo() { + return Tipo_Id; + } + + public void setId_Tipo(int Tipo_Id) { + Tipo_Id = Tipo_Id; + } + + public String getTipo() { + return Tipo; + } + + public void setTipo(String tipo) { + Tipo = tipo; + } + + public int getReino() { + return Reino_id; + } + + public void setReino(int reino) { + Reino_id = reino; + } + + public String getReinoNombre() { + return ReinoNombre; + } + + public void setReinoNombre(String reinoNombre) { + ReinoNombre = reinoNombre; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(Tipo_Id); + dest.writeString(Tipo); + dest.writeInt(Reino_id); + dest.writeString(ReinoNombre); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Vista.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Vista.java new file mode 100644 index 00000000..23bb51aa --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/model/Vista.java @@ -0,0 +1,68 @@ +package com.verdnatura.verdnaturaventas.model; + +import android.os.Parcel; +import android.os.Parcelable; + +/** + * Created by nelo on 21/04/15. + */ +public class Vista implements Parcelable{ + + private int vista_id = 0; + private String vista = ""; + private String code = ""; + + protected Vista(Parcel in) { + vista_id = in.readInt(); + vista = in.readString(); + code = in.readString(); + } + + public static final Creator CREATOR = new Creator() { + @Override + public Vista createFromParcel(Parcel in) { + return new Vista(in); + } + + @Override + public Vista[] newArray(int size) { + return new Vista[size]; + } + }; + + public int getVista_id() { + return vista_id; + } + + public void setVista_id(int vista_id) { + this.vista_id = vista_id; + } + + public String getVista() { + return vista; + } + + public void setVista(String vista) { + this.vista = vista; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(vista_id); + dest.writeString(vista); + dest.writeString(code); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/navigations/NavigationCarrito.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/navigations/NavigationCarrito.java new file mode 100644 index 00000000..8f77178e --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/navigations/NavigationCarrito.java @@ -0,0 +1,367 @@ +package com.verdnatura.verdnaturaventas.navigations; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.MenuItem; +import android.view.View; +import android.view.animation.Animation; +import android.widget.AdapterView; +import android.widget.ImageView; +import android.widget.ListView; +import android.widget.PopupMenu; +import android.widget.ProgressBar; +import android.widget.RelativeLayout; +import android.widget.Toast; + +import com.nelosan.baselibrary.command.CommandBase; +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.core.CommandError; +import com.nelosan.baselibrary.core.CommandOperation; +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.ArticuloDetalle; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.adapter.AdapterCarrito; +import com.verdnatura.verdnaturaventas.command.CmdCrearOrder; +import com.verdnatura.verdnaturaventas.controller.ControllerArticulo; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.core.Format; +import com.verdnatura.verdnaturaventas.dialog.DialogValidarPedido; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; +import com.verdnatura.verdnaturaventas.model.OrderRow; + +/** + * Created by nelo on 13/02/15. + */ +public class NavigationCarrito extends RelativeLayout { + + private TextViewRoboto textNTotal, textNPrecioTotal, txtCliente, txtAgencia, txtValidarCompra; + private View separacion, viewTotal; + private ListView listLineas; + private ActivityBase activity; + private ImageView imgOpciones; + private ControllerPreferences preferences; + private ControllerPedido pedido; + private ProgressBar progress; + private RelativeLayout contenedor; + + public NavigationCarrito(final Context context) { + super(context); + + this.activity = (ActivityBase) context; + pedido = new ControllerPedido(activity); + preferences = new ControllerPreferences(); + + LayoutInflater.from(context).inflate(R.layout.carrito, this); + textNTotal = (TextViewRoboto)findViewById(R.id.textview_navigation_drawer_pedido_total); + textNPrecioTotal = (TextViewRoboto)findViewById(R.id.textview_navigation_drawer_pedido_total_euros); + txtCliente = (TextViewRoboto)findViewById(R.id.textview_navigation_pedido_cliente); + txtAgencia = (TextViewRoboto)findViewById(R.id.textview_navigation_pedido_agencia); + txtValidarCompra = (TextViewRoboto)findViewById(R.id.textview_navigation_drawer_carrito_validar_compra); + imgOpciones = (ImageView)findViewById(R.id.imageview_navigation_pedido_opcions); + listLineas = (ListView)findViewById(R.id.listview_navigation_pedido_lineas); + separacion = (View)findViewById(R.id.view_navigation_pedido_separacion); + viewTotal = (RelativeLayout)findViewById(R.id.relative_navigation_pedido_total); + progress = (ProgressBar)findViewById(R.id.progress_fragment); + contenedor = (RelativeLayout)findViewById(R.id.relative_carrito_contenedor); + + generateData(); + } + + public void generateData() + { + txtValidarCompra.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + ClienteVentas cliente = preferences.recuperarCliente(); + if(cliente.getCliente().equals("demo")) + Toast.makeText(activity, activity.getResources().getString(R.string.mensaje_demo), Toast.LENGTH_SHORT).show(); + else + crearOrder(); + } + }); + generarItemOptions(); + generateOptionsMenu(); + } + + + public void generateOptionsMenu() + { + imgOpciones.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + PopupMenu menu = new PopupMenu(activity, v); + menu.getMenu().add(1, 0, 1, activity.getResources().getString(R.string.navigation_carrito_vaciar_carrito)); + ClienteVentas cliente = preferences.recuperarCliente(); + if (cliente.getTipo().equals("trabajador")) { + menu.getMenu().add(1, 1, 1, activity.getResources().getString(R.string.navigation_carrito_borrar_pedido)); + } + menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { + @Override + public boolean onMenuItemClick(MenuItem item) { + switch (item.getItemId()) { + case 0: + vaciarOrder(); + break; + + case 1: + pedido.reiniciarPedido(); + break; + } + return true; + } + }); + menu.show(); + } + }); + } + + public void generarItemOptions() + { + listLineas.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapter, final View view, int position, long id) { + PopupMenu menu = new PopupMenu(activity, view); + + final OrderRow row = (OrderRow) adapter.getItemAtPosition(position); + + menu.getMenu().add(1, 0, 1, activity.getResources().getString(R.string.navigation_ver_articulo)); + + int cantidad = row.getTarifa().getGrouping(); + + if (row.getTarifa().getRate() != 3) + menu.getMenu().add(1, 1, 1, activity.getResources().getString(R.string.navigation_carrito_anyadir, cantidad)); + + if (row.getAmount() - cantidad > 0) { + menu.getMenu().add(1, 2, 1, activity.getResources().getString(R.string.navigation_carrito_eliminar, cantidad)); + } + + menu.getMenu().add(1, 3, 1, activity.getResources().getString(R.string.navigation_carrito_borrar)); + + final int finalCantidad = cantidad; + menu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { + @Override + public boolean onMenuItemClick(MenuItem item) { + + switch (item.getItemId()) { + case 0: + if (activity instanceof ArticuloDetalle) { + activity.finish(); + } + ControllerArticulo.verDetalle(row.getArticulo(), activity); + activity.cerrarDrawerDerecho(); + break; + + case 1: + actualizarPedido(row, finalCantidad); + break; + + case 2: + actualizarPedido(row, -finalCantidad); + break; + + case 3: + actualizarPedido(row, -row.getAmount()); + break; + + } + + return true; + } + }); + + menu.show(); + } + }); + } + + public Animation.AnimationListener crearAnimationListener(final OrderRow row) + { + final AdapterCarrito adapter = (AdapterCarrito) listLineas.getAdapter(); + + if(row == null) + adapter.notifyDataSetChanged(); + + Animation.AnimationListener end = new Animation.AnimationListener() { + @Override + public void onAnimationStart(Animation animation) { + + } + + @Override + public void onAnimationEnd(Animation animation) { + activity.showCarritoRows(); + activity.showTotalPedido(); + } + + @Override + public void onAnimationRepeat(Animation animation) { + + } + }; + + return end; + } + + public void showTotalPedido() + { + ControllerPedido pedido = new ControllerPedido(activity); + ClienteVentas cliente = preferences.recuperarCliente(); + if(pedido.getOrder().getCliente() != null) + txtCliente.setText(pedido.getOrder().getCliente().getCliente()); + else + txtCliente.setText(""); + + if(pedido.getOrder().getAgencia() != null) + txtAgencia.setText(pedido.getOrder().getAgencia().getAgencia() + ", "+pedido.getOrder().getCalendario().getTextoFecha()); + else + txtAgencia.setText(""); + + + if(pedido.getOrder() == null) + { + textNTotal.setText(activity.getResources().getString(R.string.navigation_carrito_no_se_ha_creado)); + textNPrecioTotal.setText(""); + } + else + { + textNTotal.setText(activity.getResources().getString(R.string.navigation_carrito_total)); + textNPrecioTotal.setText(Format.df.format(pedido.getTotal()).replace(",", ".") + "€"); + } + + if(!preferences.verPrecios()) + { + separacion.setVisibility(View.GONE); + viewTotal.setVisibility(View.GONE); + } + else + { + separacion.setVisibility(View.VISIBLE); + viewTotal.setVisibility(View.VISIBLE); + } + + if(pedido.getOrder().getAgencia() == null) + contenedor.setVisibility(View.GONE); + + else + contenedor.setVisibility(View.VISIBLE); + + + } + + public void showCarritoRows() + { + pedido = new ControllerPedido(activity); + if(pedido.getOrder() != null) { + AdapterCarrito adapter = new AdapterCarrito(activity, R.layout.item_carrito, pedido.getOrder().getRows()); + listLineas.setAdapter(adapter); + } + } + + public void crearOrder() + { + pedido = new ControllerPedido(activity); + if(pedido.getTotal() > 0) { + DialogValidarPedido dialog = new DialogValidarPedido(); + dialog.show(activity.getFragmentManager(), "tagDialogValidar"); + } + else + { + Toast.makeText(activity, getResources().getString(R.string.activity_validar_pedido_no_articulos), Toast.LENGTH_SHORT).show(); + } + } + + public void actualizarPedido(final OrderRow row, final int cantidad) + { + showProgress(true); + + pedido.incrementarCantidad(row, cantidad); + CmdCrearOrder cmd = new CmdCrearOrder(pedido, activity.getSerialNumber()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + pedido.setOrder(((CmdCrearOrder)cmd).getOrder()); + pedido.guardarOrder(); + activity.showTotalPedido(); + activity.showCarritoRows(); + showProgress(false); + + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + + pedido.incrementarCantidad(row, -cantidad); + actualizarPedido(row, cantidad); + } + + @Override + public void Accept(CommandBase cmd) { + pedido.incrementarCantidad(row, -cantidad); + pedido.guardarOrder(); + showProgress(false); + } + }); + activity.execute(cmd); + } + + public void vaciarOrder() + { + showProgress(true); + for (OrderRow row : pedido.getOrder().getRows()) { + row.setAmount_old(row.getAmount()); + row.setAmount(0); + + } + CmdCrearOrder cmd = new CmdCrearOrder(pedido, activity.getSerialNumber()); + cmd.setOnFinished(new CommandOperation() { + @Override + public void Realice(CommandBase cmd) { + pedido.setOrder(((CmdCrearOrder)cmd).getOrder()); + pedido.guardarOrder(); + activity.showTotalPedido(); + activity.showCarritoRows(); + showProgress(false); + + } + }); + cmd.setErrorManager(new CommandError() { + @Override + public void Retry(CommandBase cmd) { + for (OrderRow row : pedido.getOrder().getRows()) { + row.setAmount_old(0); + row.setAmount(row.getAmount_old()); + } + vaciarOrder(); + } + + @Override + public void Accept(CommandBase cmd) { + for (OrderRow row : pedido.getOrder().getRows()) { + row.setAmount_old(0); + row.setAmount(row.getAmount_old()); + } + pedido.guardarOrder(); + showProgress(false); + } + }); + activity.execute(cmd); + } + + + public void showProgress(boolean show) + { + if(show) + { + progress.setVisibility(View.VISIBLE); + contenedor.setVisibility(View.INVISIBLE); + } + else + { + progress.setVisibility(View.INVISIBLE); + contenedor.setVisibility(View.VISIBLE); + } + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/navigations/NavigationPanel.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/navigations/NavigationPanel.java new file mode 100644 index 00000000..86c1e3f8 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/navigations/NavigationPanel.java @@ -0,0 +1,248 @@ +package com.verdnatura.verdnaturaventas.navigations; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; + +import com.nelosan.baselibrary.components.TextViewRoboto; +import com.nelosan.baselibrary.dialog.DialogBuscar; +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.Cuenta; +import com.verdnatura.verdnaturaventas.Instrucciones; +import com.verdnatura.verdnaturaventas.Main; +import com.nelosan.baselibrary.MyApplication; +import com.verdnatura.verdnaturaventas.Pedidos; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; +import com.verdnatura.verdnaturaventas.core.Static; +import com.verdnatura.verdnaturaventas.dialog.AlertHome; +import com.verdnatura.verdnaturaventas.dialog.DialogDeuda; +import com.verdnatura.verdnaturaventas.dialog.DialogValidarPedido; +import com.verdnatura.verdnaturaventas.fragment.FragmentConfigurarPedido; +import com.verdnatura.verdnaturaventas.fragment.FragmentMain; +import com.verdnatura.verdnaturaventas.fragment.FragmentOrdersImprimir; +import com.verdnatura.verdnaturaventas.fragment.FragmentPedidosPendientes; +import com.verdnatura.verdnaturaventas.model.ClienteVentas; + +/** + * Created by nelo on 13/02/15. + */ +public class NavigationPanel extends LinearLayout implements AlertHome.AlertPositive { + + private RelativeLayout rltCuenta, rltSalir, rltBuscarCliente, rltPedidoMio, rltConfigurarPedido, + rltPagar, rltPrecios, rltHome, rltPedidos, rltImprimir, rltEnvios, rltKeyboard; + private LinearLayout lnrComerciales; + private ActivityBase activity; + private TextViewRoboto textNombre, txtPrecios, txtKeyboard; + private ControllerPreferences preferences; + + public NavigationPanel(Context context) { + super(context); + + LayoutInflater.from(context).inflate(R.layout.panel, this); + + lnrComerciales = (LinearLayout)findViewById(R.id.linear_item_panel_comerciales); + + rltCuenta = (RelativeLayout)findViewById(R.id.navigation_relative_cuenta); + rltCuenta.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_cuenta)); + + rltSalir = (RelativeLayout)findViewById(R.id.navigation_relative_salir); + rltSalir.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_salir)); + + rltBuscarCliente = (RelativeLayout)findViewById(R.id.navigation_relative_buscar_cliente); + rltBuscarCliente.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_buscar_cliente)); + + rltPedidoMio = (RelativeLayout)findViewById(R.id.navigation_relative_pedido_mio); + rltPedidoMio.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_pedido_mio)); + + rltPagar = (RelativeLayout)findViewById(R.id.navigation_relative_pagar); + rltPagar.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_pagar)); + + rltPrecios = (RelativeLayout)findViewById(R.id.navigation_relative_precios); + rltPrecios.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_precios)); + + rltKeyboard = (RelativeLayout)findViewById(R.id.navigation_relative_keyboard); + rltKeyboard.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_keyboard)); + + rltHome = (RelativeLayout)findViewById(R.id.navigation_relative_home); + rltHome.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_home)); + + rltPedidos = (RelativeLayout)findViewById(R.id.navigation_relative_orders); + rltPedidos.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_orders)); + + rltEnvios = (RelativeLayout)findViewById(R.id.navigation_relative_shippings); + rltEnvios.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_shippings)); + + rltConfigurarPedido = (RelativeLayout)findViewById(R.id.navigation_relative_pedido_configurar); + rltConfigurarPedido.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_pedido_configurar)); + + rltImprimir = (RelativeLayout)findViewById(R.id.navigation_relative_pedido_print_ticket); + rltImprimir.setOnClickListener(new ClickNavigationItem(R.id.navigation_relative_pedido_print_ticket)); + + textNombre = (TextViewRoboto)findViewById(R.id.navigation_textview_nombre_usuario); + txtPrecios = (TextViewRoboto)findViewById(R.id.textview_ver_precios); + txtKeyboard = (TextViewRoboto)findViewById(R.id.txtview_keyboard); + + activity = (ActivityBase)context; + preferences = new ControllerPreferences(); + + if(!preferences.verPrecios()) + txtPrecios.setText(activity.getResources().getString(R.string.navigation_panel_ver_precios)); + else + txtPrecios.setText(activity.getResources().getString(R.string.navigation_panel_ocultar_precios)); + + if(!preferences.isNumeric()) + txtKeyboard.setText(activity.getResources().getString(R.string.navigation_panel_keyboard_numeric)); + else + txtKeyboard.setText(activity.getResources().getString(R.string.navigation_panel_keyboard_alphabetical)); + + if(!(activity instanceof Main)) + rltPedidos.setVisibility(View.GONE); + else + rltPedidos.setVisibility(View.VISIBLE); + } + + @Override + public void alertHomePositiveClick() { + activity.goToHome(); + } + + private class ClickNavigationItem implements View.OnClickListener{ + + private int opcion; + + public ClickNavigationItem(int opcion) + { + this.opcion = opcion; + } + + @Override + public void onClick(View v) { + switch (opcion) + { + case R.id.navigation_relative_salir: + + activity.logout(); + break; + + case R.id.navigation_relative_cuenta: + if(!activity.getClass().getName().equals("com.verdnatura.verdnaturaventas.Cuenta")) { + activity.startActivity(new Intent(activity, Cuenta.class)); + } + activity.getDrawerLayout().closeDrawer(Gravity.LEFT); + break; + + case R.id.navigation_relative_buscar_cliente: + buscarClientes(); + break; + + case R.id.navigation_relative_pedido_mio: + pedidoMio(); + break; + + case R.id.navigation_relative_pagar: + DialogDeuda dialog = new DialogDeuda(); + dialog.show(activity.getFragmentManager(), "tagDeuda"); + break; + + case R.id.navigation_relative_precios: + preferences.setVerPrecios(); + activity.recalcularPrecios(); + activity.showTotalPedido(); + activity.showCarritoRows(); + if(!preferences.verPrecios()) + txtPrecios.setText(activity.getResources().getString(R.string.navigation_panel_ver_precios)); + else + txtPrecios.setText(activity.getResources().getString(R.string.navigation_panel_ocultar_precios)); + activity.cerrarDrawerIzquierdo(); + break; + + case R.id.navigation_relative_keyboard: + preferences.setIsNumeric(); + if(preferences.isNumeric()) + txtKeyboard.setText(activity.getResources().getString(R.string.navigation_panel_keyboard_alphabetical)); + else + txtKeyboard.setText(activity.getResources().getString(R.string.navigation_panel_keyboard_numeric)); + activity.cerrarDrawerIzquierdo(); + break; + + case R.id.navigation_relative_home: + AlertHome alertHome = new AlertHome(activity, NavigationPanel.this); + break; + + case R.id.navigation_relative_pedido_configurar: + activity.cambiarFragment(new FragmentConfigurarPedido()); + activity.cerrarDrawerIzquierdo(); + break; + + case R.id.navigation_relative_orders: + activity.cerrarDrawerIzquierdo(); + Bundle bundle = new Bundle(); + bundle.putBoolean(FragmentPedidosPendientes.VISTA_PEDIDOS, true); + activity.cambiarFragment(new FragmentPedidosPendientes(), bundle); + break; + + case R.id.navigation_relative_pedido_print_ticket: + if(!activity.compararFragments(FragmentOrdersImprimir.class)) + activity.cambiarFragment(new FragmentOrdersImprimir()); + activity.cerrarDrawerIzquierdo(); + break; + + case R.id.navigation_relative_shippings: + if(!activity.getClass().getName().equals("com.verdnatura.verdnaturaventas.Pedidos")) { + activity.startActivity(new Intent(activity, Pedidos.class)); + } + activity.getDrawerLayout().closeDrawer(Gravity.LEFT); + break; + + } + } + } + + public void setNombreCliente() + { + ClienteVentas cliente = preferences.recuperarCliente(); + ControllerPedido pedido = activity.getPedido(); + + if(cliente == null) + cliente = pedido.getOrder().getCliente(); + try{ + textNombre.setText(cliente.getCliente()); + }catch (Exception e){ + textNombre.setText(""); + } + + + if(cliente.getTipo().equals("trabajador") && activity instanceof Main) + { + lnrComerciales.setVisibility(View.VISIBLE); + } + + if(cliente.getCliente().equals("demo")) + rltCuenta.setVisibility(View.GONE); + + } + + public void pedidoMio() + { + ClienteVentas cliente = preferences.recuperarCliente(); + activity.refresCliente(cliente); + activity.cerrarDrawerIzquierdo(); + activity.showTotalPedido(); + } + + public void buscarClientes() + { + activity.setBuscarClientes(true); + activity.cerrarDrawerIzquierdo(); + DialogBuscar dialog = new DialogBuscar(activity); + dialog.show(); + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/receiver/GCMBroadcastReceiver.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/receiver/GCMBroadcastReceiver.java new file mode 100644 index 00000000..3a7f8815 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/receiver/GCMBroadcastReceiver.java @@ -0,0 +1,19 @@ +package com.verdnatura.verdnaturaventas.receiver; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import androidx.legacy.content.WakefulBroadcastReceiver; + +/** + * Created by nelo on 28/07/15. + */ +public class GCMBroadcastReceiver extends WakefulBroadcastReceiver { + @Override + public void onReceive(Context context, Intent intent) { + ComponentName comp = new ComponentName(context.getPackageName(), GCMIntentService.class.getName()); + startWakefulService(context, (intent.setComponent(comp))); + setResultCode(Activity.RESULT_OK); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/receiver/GCMIntentService.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/receiver/GCMIntentService.java new file mode 100644 index 00000000..d0d479fa --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/receiver/GCMIntentService.java @@ -0,0 +1,90 @@ +package com.verdnatura.verdnaturaventas.receiver; + +import android.app.IntentService; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import androidx.core.app.NotificationCompat; + +//import com.google.android.gms.gcm.GoogleCloudMessaging; +import com.verdnatura.verdnaturaventas.Pedidos; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; + +/** + * Created by nelo on 28/07/15. + */ +public class GCMIntentService extends IntentService { + + private ControllerPreferences preferences; + + public GCMIntentService() + { + super("GCMIntentService"); + preferences = new ControllerPreferences(); + } + private static final int NOTIF_ALERTA_ID = 1; + + @Override + protected void onHandleIntent(Intent intent) { + /*String mensaje = ""; + Bundle extras = intent.getExtras(); + /*GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this); + String tipoMensaje = gcm.getMessageType(intent); + if(!extras.isEmpty()) + { + + /* if(GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(tipoMensaje)) + { + mensaje = extras.getString("mensaje"); + } + String title = extras.getString("titulo"); + String type = extras.getString("type"); + if(mensaje.length() > 0 && preferences.recibirNotificaciones()) + mostrarNotification(mensaje, title, type); + } + GCMBroadcastReceiver.completeWakefulIntent(intent);*/ + } + + private void mostrarNotification(String msg, String title, String type) + { + /* NotificationManager mNotificationManager = + (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); + + NotificationCompat.Builder mBuilder = + new NotificationCompat.Builder(this) + .setSmallIcon(R.drawable.ic_notification) + .setContentTitle(title) + .setContentText(msg); + + Intent intent = crearIntent(type); + PendingIntent contIntent = PendingIntent.getActivity(this, 0, intent, 0); + + mBuilder.setContentIntent(contIntent); + mBuilder.setAutoCancel(true); + mBuilder.setColor(getResources().getColor(R.color.verde_login)); + mBuilder.setLights(0xff8fd400, 1000, 2000); + mBuilder.setVibrate(new long[]{500, 500, 500, 500}); + Uri path = Uri.parse("android.resource://com.verdnatura.verdnaturaventas/" + R.raw.ping); + mBuilder.setSound(path); + + mNotificationManager.notify(NOTIF_ALERTA_ID, mBuilder.build());*/ + } + + public Intent crearIntent(String type) + { + switch (type) + { + case "PEDIDO": + Intent intent = new Intent(this, Pedidos.class); + return intent; + } + + return null; + + } + +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/toolbar/ToolbarColores.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/toolbar/ToolbarColores.java new file mode 100644 index 00000000..20c0863c --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/toolbar/ToolbarColores.java @@ -0,0 +1,89 @@ +package com.verdnatura.verdnaturaventas.toolbar; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.Toast; + +import com.nelosan.baselibrary.dialog.DialogBuscar; +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.R; +import com.verdnatura.verdnaturaventas.controller.ControllerPedido; +import com.verdnatura.verdnaturaventas.controller.ControllerPreferences; + +/** + * Created by nelo on 1/04/15. + */ +public class ToolbarColores extends com.nelosan.baselibrary.toolbar.ToolbarColores { + + private ImageView imgPanel, imgCarrito; + + public ToolbarColores(Context context, String titulo, boolean buscar, String tipo) { + super(context, titulo, buscar, tipo); + LayoutInflater.from(context).inflate(R.layout.toolbar_colores, this); + + imgPanel = (ImageView)findViewById(R.id.imageview_toolbar_colores_panel); + imgPanel.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + activity.abrirDrawerIzquierdo(); + } + }); + + imgCarrito = (ImageView)findViewById(R.id.imageview_toolbar_colores_carrito); + imgCarrito.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + activity.abrirDrawerDerecho(); + } + }); + + if(!buscar) + { + imgPanel.setVisibility(View.GONE); + imgCarrito.setVisibility(View.GONE); + } + else + { + imgPanel.setVisibility(View.VISIBLE); + imgCarrito.setVisibility(View.VISIBLE); + } + + } + + @Override + public void clickBuscar() { + buscar(); + } + + public void buscar() + { + if(((ActivityBase)activity).getPedido().getOrder().getAgencia() == null) + Toast.makeText(activity, activity.getResources().getString(R.string.toolbar_colores_agencia), Toast.LENGTH_SHORT).show(); + else + { + DialogBuscar dialog = new DialogBuscar(activity, R.drawable.ic_action_camera); + ControllerPreferences preferences = new ControllerPreferences(); + dialog.show(); + dialog.setKeyboard(preferences.isNumeric()); + } + } + + public void removeIcons() + { + this.imgCarrito.setVisibility(View.GONE); + this.imgPanel.setVisibility(View.GONE); + this.imgBuscar.setVisibility(View.GONE); + RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)txtTitulo.getLayoutParams(); + params.addRule(RelativeLayout.ALIGN_PARENT_LEFT); + txtTitulo.setLayoutParams(params); + txtTitulo.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + buscar(); + } + }); + } +} diff --git a/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/toolbar/ToolbarVerdnatura.java b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/toolbar/ToolbarVerdnatura.java new file mode 100644 index 00000000..7e303933 --- /dev/null +++ b/verdnaturaventas/src/main/java/com/verdnatura/verdnaturaventas/toolbar/ToolbarVerdnatura.java @@ -0,0 +1,25 @@ +package com.verdnatura.verdnaturaventas.toolbar; + +import android.content.Context; +import android.view.LayoutInflater; +import android.widget.ImageView; +import android.widget.RelativeLayout; + +import com.verdnatura.verdnaturaventas.ActivityBase; +import com.verdnatura.verdnaturaventas.R; + +/** + * Created by nelo on 26/03/15. + */ +public class ToolbarVerdnatura extends RelativeLayout { + + private ActivityBase activity; + private ImageView imgPerson; + + public ToolbarVerdnatura(Context context) { + super(context); + + activity = (ActivityBase)context; + LayoutInflater.from(context).inflate(R.layout.toolbar_verdnatura, this); + } +} diff --git a/verdnaturaventas/src/main/res/anim/abrir_articulo.xml b/verdnaturaventas/src/main/res/anim/abrir_articulo.xml new file mode 100644 index 00000000..4eec0ae3 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/abrir_articulo.xml @@ -0,0 +1,15 @@ + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/borrar_del_pedido.xml b/verdnaturaventas/src/main/res/anim/borrar_del_pedido.xml new file mode 100644 index 00000000..fccfecd7 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/borrar_del_pedido.xml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/incrementar_cantidad.xml b/verdnaturaventas/src/main/res/anim/incrementar_cantidad.xml new file mode 100644 index 00000000..4061d0de --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/incrementar_cantidad.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/instrucciones_cuenta.xml b/verdnaturaventas/src/main/res/anim/instrucciones_cuenta.xml new file mode 100644 index 00000000..5ddc7ea0 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/instrucciones_cuenta.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/instrucciones_pedido.xml b/verdnaturaventas/src/main/res/anim/instrucciones_pedido.xml new file mode 100644 index 00000000..2a265249 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/instrucciones_pedido.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/item_controller.xml b/verdnaturaventas/src/main/res/anim/item_controller.xml new file mode 100644 index 00000000..17ac1940 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/item_controller.xml @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/load_fragment.xml b/verdnaturaventas/src/main/res/anim/load_fragment.xml new file mode 100644 index 00000000..5cf50576 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/load_fragment.xml @@ -0,0 +1,8 @@ + + + + diff --git a/verdnaturaventas/src/main/res/anim/load_items.xml b/verdnaturaventas/src/main/res/anim/load_items.xml new file mode 100644 index 00000000..a473150b --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/load_items.xml @@ -0,0 +1,7 @@ + + + diff --git a/verdnaturaventas/src/main/res/anim/load_items_list.xml b/verdnaturaventas/src/main/res/anim/load_items_list.xml new file mode 100644 index 00000000..1ec3b322 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/load_items_list.xml @@ -0,0 +1,7 @@ + + + diff --git a/verdnaturaventas/src/main/res/anim/marcar_total.xml b/verdnaturaventas/src/main/res/anim/marcar_total.xml new file mode 100644 index 00000000..9788dde8 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/marcar_total.xml @@ -0,0 +1,17 @@ + + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/mostrar_detalle.xml b/verdnaturaventas/src/main/res/anim/mostrar_detalle.xml new file mode 100644 index 00000000..ac646e94 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/mostrar_detalle.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/quitar_detalle.xml b/verdnaturaventas/src/main/res/anim/quitar_detalle.xml new file mode 100644 index 00000000..36a23851 --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/quitar_detalle.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/anim/reducir_cantidad.xml b/verdnaturaventas/src/main/res/anim/reducir_cantidad.xml new file mode 100644 index 00000000..0ade25db --- /dev/null +++ b/verdnaturaventas/src/main/res/anim/reducir_cantidad.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/color/mcv_text_date_dark.xml b/verdnaturaventas/src/main/res/color/mcv_text_date_dark.xml new file mode 100644 index 00000000..dfcb5d14 --- /dev/null +++ b/verdnaturaventas/src/main/res/color/mcv_text_date_dark.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + diff --git a/verdnaturaventas/src/main/res/color/mcv_text_date_light.xml b/verdnaturaventas/src/main/res/color/mcv_text_date_light.xml new file mode 100644 index 00000000..975f974a --- /dev/null +++ b/verdnaturaventas/src/main/res/color/mcv_text_date_light.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/confeccion.png b/verdnaturaventas/src/main/res/drawable-hdpi/confeccion.png new file mode 100644 index 00000000..cfed668a Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/confeccion.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_accept.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_accept.png new file mode 100644 index 00000000..700fc815 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_accept.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_airplane_mode_off.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_airplane_mode_off.png new file mode 100644 index 00000000..ae91c620 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_airplane_mode_off.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_back.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_back.png new file mode 100644 index 00000000..58d22d6d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_back.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_camera.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_camera.png new file mode 100644 index 00000000..87649ad1 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_camera.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_discard.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_discard.png new file mode 100644 index 00000000..9c717dd3 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_discard.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_edit.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_edit.png new file mode 100644 index 00000000..5f7c6eff Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_edit.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_email.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_email.png new file mode 100644 index 00000000..2e585513 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_email.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_forward.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_forward.png new file mode 100644 index 00000000..347e2e26 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_forward.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_go_to_today.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_go_to_today.png new file mode 100644 index 00000000..2ae3ee5f Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_go_to_today.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_help.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_help.png new file mode 100644 index 00000000..382d314c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_help.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_ic_ralletes_blanques.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_ic_ralletes_blanques.png new file mode 100644 index 00000000..a31e9729 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_ic_ralletes_blanques.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_labels.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_labels.png new file mode 100644 index 00000000..c4909aed Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_labels.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_mic_blanco.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_mic_blanco.png new file mode 100644 index 00000000..444ebc61 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_mic_blanco.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_overflow.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_overflow.png new file mode 100644 index 00000000..002fc4bf Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_overflow.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_person.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_person.png new file mode 100644 index 00000000..9fd81097 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_person.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_secure.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_secure.png new file mode 100644 index 00000000..287ae2fb Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_secure.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_send_now.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_send_now.png new file mode 100644 index 00000000..7e0d46d2 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_send_now.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_settings.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_settings.png new file mode 100644 index 00000000..0eb78f7c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_settings.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_shipping.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_shipping.png new file mode 100644 index 00000000..11e439ad Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_shipping.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_view_as_grid.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_view_as_grid.png new file mode 100644 index 00000000..c2dd7f1d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_view_as_grid.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_view_as_list.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_view_as_list.png new file mode 100644 index 00000000..e08afae8 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_action_view_as_list.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_carrito.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_carrito.png new file mode 100644 index 00000000..c517b40a Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_carrito.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_delete.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_delete.png new file mode 100644 index 00000000..f6ede997 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_delete.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_launcher.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..c02b474c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_nav_menu.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_nav_menu.png new file mode 100644 index 00000000..2997055d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_nav_menu.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_notification.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_notification.png new file mode 100644 index 00000000..e33047f9 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_notification.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/ic_payment.png b/verdnaturaventas/src/main/res/drawable-hdpi/ic_payment.png new file mode 100644 index 00000000..e103e34a Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/ic_payment.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/login_letras.png b/verdnaturaventas/src/main/res/drawable-hdpi/login_letras.png new file mode 100644 index 00000000..7e1f1986 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/login_letras.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/panel.png b/verdnaturaventas/src/main/res/drawable-hdpi/panel.png new file mode 100644 index 00000000..3611e183 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/panel.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/rsz_artificial.png b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_artificial.png new file mode 100644 index 00000000..b57a793c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_artificial.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/rsz_complementos.png b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_complementos.png new file mode 100644 index 00000000..8d750a8d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_complementos.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/rsz_flor.png b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_flor.png new file mode 100644 index 00000000..7516bd4e Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_flor.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/rsz_plantas.png b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_plantas.png new file mode 100644 index 00000000..85463552 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_plantas.png differ diff --git a/verdnaturaventas/src/main/res/drawable-hdpi/rsz_verdes.png b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_verdes.png new file mode 100644 index 00000000..cbc848c0 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-hdpi/rsz_verdes.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/confeccion.png b/verdnaturaventas/src/main/res/drawable-ldpi/confeccion.png new file mode 100644 index 00000000..530e4ae4 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/confeccion.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/ic_action_ic_ralletes_blanques.png b/verdnaturaventas/src/main/res/drawable-ldpi/ic_action_ic_ralletes_blanques.png new file mode 100644 index 00000000..a9dc4633 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/ic_action_ic_ralletes_blanques.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/ic_launcher.png b/verdnaturaventas/src/main/res/drawable-ldpi/ic_launcher.png new file mode 100644 index 00000000..63cffce9 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/ic_launcher.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/ic_notification.png b/verdnaturaventas/src/main/res/drawable-ldpi/ic_notification.png new file mode 100644 index 00000000..f54a6670 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/ic_notification.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/ic_payment.png b/verdnaturaventas/src/main/res/drawable-ldpi/ic_payment.png new file mode 100644 index 00000000..427e5a46 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/ic_payment.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/login_letras.png b/verdnaturaventas/src/main/res/drawable-ldpi/login_letras.png new file mode 100644 index 00000000..24ac05e5 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/login_letras.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/panel.png b/verdnaturaventas/src/main/res/drawable-ldpi/panel.png new file mode 100644 index 00000000..44bd8b6c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/panel.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/rsz_artificial.png b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_artificial.png new file mode 100644 index 00000000..19df1821 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_artificial.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/rsz_complementos.png b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_complementos.png new file mode 100644 index 00000000..496477d5 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_complementos.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/rsz_flor.png b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_flor.png new file mode 100644 index 00000000..6853534e Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_flor.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/rsz_plantas.png b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_plantas.png new file mode 100644 index 00000000..78999959 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_plantas.png differ diff --git a/verdnaturaventas/src/main/res/drawable-ldpi/rsz_verdes.png b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_verdes.png new file mode 100644 index 00000000..6da55d5e Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-ldpi/rsz_verdes.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/confeccion.png b/verdnaturaventas/src/main/res/drawable-mdpi/confeccion.png new file mode 100644 index 00000000..1c81a664 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/confeccion.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_accept.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_accept.png new file mode 100644 index 00000000..41107b87 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_accept.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_airplane_mode_off.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_airplane_mode_off.png new file mode 100644 index 00000000..c69ba7ab Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_airplane_mode_off.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_back.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_back.png new file mode 100644 index 00000000..8da54cde Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_back.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_camera.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_camera.png new file mode 100644 index 00000000..bf2af6e5 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_camera.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_discard.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_discard.png new file mode 100644 index 00000000..9dfb7cc2 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_discard.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_edit.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_edit.png new file mode 100644 index 00000000..650b4d89 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_edit.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_email.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_email.png new file mode 100644 index 00000000..1fc44434 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_email.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_forward.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_forward.png new file mode 100644 index 00000000..74aad50d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_forward.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_go_to_today.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_go_to_today.png new file mode 100644 index 00000000..e3adca9c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_go_to_today.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_help.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_help.png new file mode 100644 index 00000000..5876cdea Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_help.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_ic_ralletes_blanques.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_ic_ralletes_blanques.png new file mode 100644 index 00000000..1942d94b Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_ic_ralletes_blanques.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_labels.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_labels.png new file mode 100644 index 00000000..4b0a1138 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_labels.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_mic_blanco.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_mic_blanco.png new file mode 100644 index 00000000..b4b79192 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_mic_blanco.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_overflow.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_overflow.png new file mode 100644 index 00000000..6f0fb23f Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_overflow.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_person.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_person.png new file mode 100644 index 00000000..359da1c1 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_person.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_secure.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_secure.png new file mode 100644 index 00000000..d4921723 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_secure.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_send_now.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_send_now.png new file mode 100644 index 00000000..ab3db5f8 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_send_now.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_settings.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_settings.png new file mode 100644 index 00000000..c290e590 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_settings.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_shipping.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_shipping.png new file mode 100644 index 00000000..acc842e6 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_shipping.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_view_as_grid.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_view_as_grid.png new file mode 100644 index 00000000..4aa31d9c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_view_as_grid.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_view_as_list.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_view_as_list.png new file mode 100644 index 00000000..4fe0edfa Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_action_view_as_list.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_carrito.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_carrito.png new file mode 100644 index 00000000..670391c8 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_carrito.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_delete.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_delete.png new file mode 100644 index 00000000..4ea7bba3 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_delete.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_launcher.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..d083d170 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_notification.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_notification.png new file mode 100644 index 00000000..0e0268f7 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_notification.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/ic_payment.png b/verdnaturaventas/src/main/res/drawable-mdpi/ic_payment.png new file mode 100644 index 00000000..8349a799 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/ic_payment.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/login_letras.png b/verdnaturaventas/src/main/res/drawable-mdpi/login_letras.png new file mode 100644 index 00000000..2ce760d7 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/login_letras.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/panel.png b/verdnaturaventas/src/main/res/drawable-mdpi/panel.png new file mode 100644 index 00000000..6ef85526 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/panel.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/rsz_complementos.png b/verdnaturaventas/src/main/res/drawable-mdpi/rsz_complementos.png new file mode 100644 index 00000000..f44c8c1d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/rsz_complementos.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/rsz_flor.png b/verdnaturaventas/src/main/res/drawable-mdpi/rsz_flor.png new file mode 100644 index 00000000..e069a4bb Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/rsz_flor.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/rsz_plantas.png b/verdnaturaventas/src/main/res/drawable-mdpi/rsz_plantas.png new file mode 100644 index 00000000..7ce8ea70 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/rsz_plantas.png differ diff --git a/verdnaturaventas/src/main/res/drawable-mdpi/rsz_verdes.png b/verdnaturaventas/src/main/res/drawable-mdpi/rsz_verdes.png new file mode 100644 index 00000000..20437d05 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-mdpi/rsz_verdes.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/confeccion.png b/verdnaturaventas/src/main/res/drawable-xhdpi/confeccion.png new file mode 100644 index 00000000..89be5cb9 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/confeccion.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_accept.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_accept.png new file mode 100644 index 00000000..6ee32b64 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_accept.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_airplane_mode_off.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_airplane_mode_off.png new file mode 100644 index 00000000..5af4e1aa Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_airplane_mode_off.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_back.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_back.png new file mode 100644 index 00000000..d5760406 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_back.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_camera.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_camera.png new file mode 100644 index 00000000..b4bd762f Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_camera.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_discard.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_discard.png new file mode 100644 index 00000000..db69d6c2 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_discard.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_edit.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_edit.png new file mode 100644 index 00000000..8ab436d8 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_edit.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_email.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_email.png new file mode 100644 index 00000000..b91e4b26 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_email.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_forward.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_forward.png new file mode 100644 index 00000000..1a158c1d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_forward.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_go_to_today.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_go_to_today.png new file mode 100644 index 00000000..3e6c6436 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_go_to_today.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_help.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_help.png new file mode 100644 index 00000000..19a9df33 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_help.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_ic_ralletes_blanques.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_ic_ralletes_blanques.png new file mode 100644 index 00000000..06a09c6b Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_ic_ralletes_blanques.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_labels.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_labels.png new file mode 100644 index 00000000..5e65adb1 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_labels.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_mic_blanco.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_mic_blanco.png new file mode 100644 index 00000000..a026da70 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_mic_blanco.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_overflow.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_overflow.png new file mode 100644 index 00000000..7ba4e10e Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_overflow.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_person.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_person.png new file mode 100644 index 00000000..03eeb8d6 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_person.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_secure.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_secure.png new file mode 100644 index 00000000..2a089838 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_secure.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_send_now.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_send_now.png new file mode 100644 index 00000000..ff0e369e Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_send_now.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_settings.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_settings.png new file mode 100644 index 00000000..999d0f0d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_settings.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_shipping.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_shipping.png new file mode 100644 index 00000000..de005cc3 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_shipping.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_view_as_grid.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_view_as_grid.png new file mode 100644 index 00000000..f4c44308 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_view_as_grid.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_view_as_list.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_view_as_list.png new file mode 100644 index 00000000..a38638e4 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_action_view_as_list.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_carrito.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_carrito.png new file mode 100644 index 00000000..fbb95660 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_carrito.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_delete.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_delete.png new file mode 100644 index 00000000..9c1985d1 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_delete.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_launcher.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 00000000..cf269dba Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_nav_menu.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_nav_menu.png new file mode 100644 index 00000000..6c480aff Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_nav_menu.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_notification.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_notification.png new file mode 100644 index 00000000..73c92f02 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_notification.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/ic_payment.png b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_payment.png new file mode 100644 index 00000000..549a18ad Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/ic_payment.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/login_letras.png b/verdnaturaventas/src/main/res/drawable-xhdpi/login_letras.png new file mode 100644 index 00000000..c83cf553 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/login_letras.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/panel.png b/verdnaturaventas/src/main/res/drawable-xhdpi/panel.png new file mode 100644 index 00000000..9592a2f8 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/panel.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_artificial.png b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_artificial.png new file mode 100644 index 00000000..d2208c32 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_artificial.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_complementos.png b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_complementos.png new file mode 100644 index 00000000..c49218ba Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_complementos.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_flor.png b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_flor.png new file mode 100644 index 00000000..56fae170 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_flor.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_plantas.png b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_plantas.png new file mode 100644 index 00000000..37264aac Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_plantas.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_verdes.png b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_verdes.png new file mode 100644 index 00000000..9ece7751 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xhdpi/rsz_verdes.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/confeccion.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/confeccion.png new file mode 100644 index 00000000..cef70a80 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/confeccion.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_accept.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_accept.png new file mode 100644 index 00000000..68c41dec Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_accept.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_airplane_mode_off.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_airplane_mode_off.png new file mode 100644 index 00000000..164f20da Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_airplane_mode_off.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_back.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_back.png new file mode 100644 index 00000000..5b41aa4d Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_back.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_camera.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_camera.png new file mode 100644 index 00000000..e8740547 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_camera.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_discard.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_discard.png new file mode 100644 index 00000000..b522daff Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_discard.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_edit.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_edit.png new file mode 100644 index 00000000..f2b2078b Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_edit.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_email.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_email.png new file mode 100644 index 00000000..b137ccf1 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_email.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_forward.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_forward.png new file mode 100644 index 00000000..fe1d67cf Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_forward.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_go_to_today.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_go_to_today.png new file mode 100644 index 00000000..5a05ceb9 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_go_to_today.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_help.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_help.png new file mode 100644 index 00000000..c5a34319 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_help.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_ic_ralletes_blanques.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_ic_ralletes_blanques.png new file mode 100644 index 00000000..fa6cc94c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_ic_ralletes_blanques.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_labels.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_labels.png new file mode 100644 index 00000000..cfd237f1 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_labels.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_mic_blanco.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_mic_blanco.png new file mode 100644 index 00000000..b2fe0711 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_mic_blanco.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_overflow.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_overflow.png new file mode 100644 index 00000000..5a603b6b Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_overflow.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_person.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_person.png new file mode 100644 index 00000000..fd1bcdd4 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_person.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_secure.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_secure.png new file mode 100644 index 00000000..d8c094ed Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_secure.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_send_now.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_send_now.png new file mode 100644 index 00000000..373dde23 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_send_now.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_settings.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_settings.png new file mode 100644 index 00000000..530227e2 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_settings.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_shipping.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_shipping.png new file mode 100644 index 00000000..85074e65 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_shipping.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_view_as_grid.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_view_as_grid.png new file mode 100644 index 00000000..75ef2d83 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_view_as_grid.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_view_as_list.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_view_as_list.png new file mode 100644 index 00000000..b00a85f6 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_action_view_as_list.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_carrito.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_carrito.png new file mode 100644 index 00000000..4b9e2a9c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_carrito.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_delete.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_delete.png new file mode 100644 index 00000000..7dfa388a Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_delete.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_launcher.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 00000000..1b4b700c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_nav_menu.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_nav_menu.png new file mode 100644 index 00000000..13f5cb6f Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_nav_menu.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_notification.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_notification.png new file mode 100644 index 00000000..2fc44826 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_notification.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_payment.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_payment.png new file mode 100644 index 00000000..83c78d9c Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/ic_payment.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/login_letras.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/login_letras.png new file mode 100644 index 00000000..79250fea Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/login_letras.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/panel.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/panel.png new file mode 100644 index 00000000..95065785 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/panel.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_artificial.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_artificial.png new file mode 100644 index 00000000..3018d6a0 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_artificial.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_complementos.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_complementos.png new file mode 100644 index 00000000..5c9c8c19 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_complementos.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_flor.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_flor.png new file mode 100644 index 00000000..7441f6f1 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_flor.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_plantas.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_plantas.png new file mode 100644 index 00000000..d53d5d61 Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_plantas.png differ diff --git a/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_verdes.png b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_verdes.png new file mode 100644 index 00000000..e07498da Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable-xxhdpi/rsz_verdes.png differ diff --git a/verdnaturaventas/src/main/res/drawable/corners_white.xml b/verdnaturaventas/src/main/res/drawable/corners_white.xml new file mode 100644 index 00000000..89f927c6 --- /dev/null +++ b/verdnaturaventas/src/main/res/drawable/corners_white.xml @@ -0,0 +1,6 @@ + + + + diff --git a/verdnaturaventas/src/main/res/drawable/ic_keyboard.xml b/verdnaturaventas/src/main/res/drawable/ic_keyboard.xml new file mode 100644 index 00000000..54b22e56 --- /dev/null +++ b/verdnaturaventas/src/main/res/drawable/ic_keyboard.xml @@ -0,0 +1,9 @@ + + + diff --git a/verdnaturaventas/src/main/res/drawable/ic_stat_ic_notification.png b/verdnaturaventas/src/main/res/drawable/ic_stat_ic_notification.png new file mode 100644 index 00000000..2568b4bb Binary files /dev/null and b/verdnaturaventas/src/main/res/drawable/ic_stat_ic_notification.png differ diff --git a/verdnaturaventas/src/main/res/layout-w720dp-land/fragment_cuenta.xml b/verdnaturaventas/src/main/res/layout-w720dp-land/fragment_cuenta.xml new file mode 100644 index 00000000..4da080df --- /dev/null +++ b/verdnaturaventas/src/main/res/layout-w720dp-land/fragment_cuenta.xml @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/verdnaturaventas/src/main/res/layout-w720dp-land/fragment_main.xml b/verdnaturaventas/src/main/res/layout-w720dp-land/fragment_main.xml new file mode 100644 index 00000000..dfe5b8f1 --- /dev/null +++ b/verdnaturaventas/src/main/res/layout-w720dp-land/fragment_main.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/verdnaturaventas/src/main/res/layout-w720dp-land/grid_botones.xml b/verdnaturaventas/src/main/res/layout-w720dp-land/grid_botones.xml new file mode 100644 index 00000000..61e47802 --- /dev/null +++ b/verdnaturaventas/src/main/res/layout-w720dp-land/grid_botones.xml @@ -0,0 +1,197 @@ + + + + + + + + +