Problems using the library #18
Replies: 15 comments 11 replies
-
|
Did you add Jitpack to your build.gradle ? @alejandroR9 |
Beta Was this translation helpful? Give feedback.
-
|
If I add it in fact until I get an error in the last part here:
$last_release"
El vie, 24 jun 2022 a la(s) 13:42, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… Did you add Jitpack to your build.gradle ? @alejandroR9
<https://github.com/alejandroR9>
—
Reply to this email directly, view it on GitHub
<#18 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2FEGBYKDFLOXDYXO3TVQX6RFANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Sorry now I get this error:
Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than
version 23 declared in library [com.github.kojofosu:Quantitizer:1.6.7]
C:\Users\user\.gradle\caches\transforms-3\42a1799ff1401e7969bd2a8edc3cc053\transformed\Quantitizer-1.6.7\AndroidManifest.xml
as the library might be using APIs not available in 19
Suggestion: use a compatible library with a minSdk of at most 19,
or increase this project's minSdk version to at least 23,
or use tools:overrideLibrary="com.mcdev.quantitizerlibrary" to force usage
(may lead to runtime failures)
That came out when I clean and rebuild the project.
El vie, 24 jun 2022 a la(s) 13:55, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… just replace latest_release with the latest release...which in this case
is 1.6.7
so your implementation will be
implementation "com.github.kojofosu:Quantitizer:1.6.7"
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2DNH7U53J4TMFB22CLVQYADHANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Hello, I was able to solve the error by changing to version 23, thank
you very much, but I got 3 errors in my code, could you help me
please?
El vie, 24 jun 2022 a la(s) 16:37, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… the minimum SDK supported for the library is 23
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2B3UDMB3BOHCMEQF5DVQYTDLANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Thank you I really appreciate it:
I get an error in this
```java
package com.example.alphaapporiginal;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.example.alphaapporiginal.Modal.Productos;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.database.DataSnapshot;
import com.google.firebase.database.DatabaseError;
import com.google.firebase.database.DatabaseReference;
import com.google.firebase.database.FirebaseDatabase;
import com.google.firebase.database.ValueEventListener;
import com.mcdev.quantitizerlibrary.HorizontalQuantitizer;
import com.squareup.picasso.Picasso;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
public class ProductoDetallesActivity extends AppCompatActivity {
private Button agregarCarrito;
private HorizontalQuantitizer numeroBoton;
private ImageView productoImagen;
private TextView productoPrecio,productoDescripcion,productoNombre;
private String productoID = "", estado= "Normal",CurrentUserID;
private FirebaseAuth auth;
@OverRide
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_producto_detalles);
productoID = getIntent().getStringExtra("pid");
agregarCarrito=(Button) findViewById(R.id.boton_siguiente_detalles);
numeroBoton=(HorizontalQuantitizer)findViewById(R.id.numero_boton);
productoImagen=(ImageView)findViewById(R.id.producto_imagen_detalles);
productoPrecio=(TextView)findViewById(R.id.producto_precio_detalles);
productoDescripcion=(TextView)findViewById(R.id.producto_descripcion_detalles);
productoNombre=(TextView)findViewById(R.id.producto_nombre_detalles);
ObtenerDatosProducto(productoID);
auth=FirebaseAuth.getInstance();
CurrentUserID = auth.getCurrentUser().getUid();
agregarCarrito.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
if (estado.equals("Pedido") || estado.equals("Enviado")){
Toast.makeText(ProductoDetallesActivity.this,
"Esperando a que el primero pedido finalice.....",
Toast.LENGTH_SHORT).show();
}else{
agregarAlaLista();
}
}
});
}
@OverRide
protected void onStart() {
super.onStart();
VerificarEstadoOrden();
}
private void agregarAlaLista() {
String CurrentTime,CurrentDate;
Calendar calendar = Calendar.getInstance();
SimpleDateFormat data = new SimpleDateFormat("MM-dd-yyyy");
CurrentDate=data.format(calendar.getTime());
SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss");
CurrentTime=time.format(calendar.getTime());
final DatabaseReference CartListRef =
FirebaseDatabase.getInstance("https://alphaapporiginal-default-rtdb.firebaseio.com/").getReference().child("Carrito");
final HashMap<String,Object> map = new HashMap<>();
map.put("pid",productoID);
map.put("nombre",productoNombre.getText().toString());
map.put("precio",productoPrecio.getText().toString());
map.put("fecha",CurrentDate);
map.put("hora",CurrentTime);
map.put("cantidad",numeroBoton);
map.put("descuento","");
CartListRef.child("Usuario
Compra").child(CurrentUserID).child("Productos").child(productoID).updateChildren(map).addOnCompleteListener(new
OnCompleteListener<Void>() {
@OverRide
public void ***@***.*** Task<Void> task) {
if (task.isSuccessful()){
CartListRef.child("Administracion").child(CurrentUserID).child("Productos").child(productoID).updateChildren(map).addOnCompleteListener(new
OnCompleteListener<Void>() {
@OverRide
public void ***@***.*** Task<Void> task) {
if (task.isSuccessful()){
Toast.makeText(ProductoDetallesActivity.this, "Agregado...",
Toast.LENGTH_SHORT).show();
Intent intent = new
Intent(ProductoDetallesActivity.this,PrincipalActivity.class);
startActivity(intent);
}
}
});
}
}
});
}
private void ObtenerDatosProducto(String productoID) {
DatabaseReference ProductoRef =
FirebaseDatabase.getInstance("https://alphaapporiginal-default-rtdb.firebaseio.com/").getReference().child("Productos");
ProductoRef.child(productoID).addValueEventListener(new
ValueEventListener() {
@OverRide
public void ***@***.*** DataSnapshot snapshot) {
if (snapshot.exists()){
Productos productos = snapshot.getValue(Productos.class);
productoNombre.setText(productos.getNombre());
productoDescripcion.setText(productos.getDescripcion());
productoPrecio.setText(productos.getPrecioven());
Picasso.get().load(productos.getImagen()).into(productoImagen);
}
}
@OverRide
public void ***@***.*** DatabaseError error) {
}
});
}
private void VerificarEstadoOrden() {
DatabaseReference OrdenRef;
OrdenRef= FirebaseDatabase.getInstance("https://alphaapporiginal-default-rtdb.firebaseio.com/").getReference().child("Ordenes").child(CurrentUserID);
OrdenRef.addValueEventListener(new ValueEventListener() {
@OverRide
public void ***@***.*** DataSnapshot snapshot) {
if (snapshot.exists()){
String envioStado =
snapshot.child("estado").getValue().toString();
if (envioStado.equals("Enviado")){
estado="Enviado";
}else if (envioStado.equals("No enviado")){
estado="Pedido ";
}
}
}
@OverRide
public void ***@***.*** DatabaseError error) {
}
});
}
}
```
........................LOGCAT
```
2022-07-01 12:18:04.617 3346-3346/com.example.alphaapporiginal
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.alphaapporiginal, PID: 3346
com.google.firebase.database.DatabaseException: Found conflicting getters
for name: getOverlay
at
com.google.firebase.database.core.utilities.encoding.CustomClassMapper$BeanMapper.(CustomClassMapper.java:478)
at
com.google.firebase.database.core.utilities.encoding.CustomClassMapper.loadOrCreateBeanMapperForClass(CustomClassMapper.java:330)
at
com.google.firebase.database.core.utilities.encoding.CustomClassMapper.serialize(CustomClassMapper.java:167)
at
com.google.firebase.database.core.utilities.encoding.CustomClassMapper.serialize(CustomClassMapper.java:142)
at
com.google.firebase.database.core.utilities.encoding.CustomClassMapper.convertToPlainJavaTypes(CustomClassMapper.java:66)
at
com.google.firebase.database.DatabaseReference.updateChildrenInternal(DatabaseReference.java:412)
at
com.google.firebase.database.DatabaseReference.updateChildren(DatabaseReference.java:392)
at
com.example.alphaapporiginal.ProductoDetallesActivity.agregarAlaLista(ProductoDetallesActivity.java:94)
at
com.example.alphaapporiginal.ProductoDetallesActivity.access$100(ProductoDetallesActivity.java:31)
at
com.example.alphaapporiginal.ProductoDetallesActivity$1.onClick(ProductoDetallesActivity.java:62)
at android.view.View.performClick(View.java:7448)
at
com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1194)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
El vie, 1 jul 2022 a la(s) 15:24, Kojo Fosu Bempa Edue (
***@***.***) escribió:
yeah, sure always happy to help
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2C5XLQZ7IVMNCMWFIDVR5HXXANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
```
|
Beta Was this translation helpful? Give feedback.
-
|
THIS IS MY CLASS
package com.example.alphaapporiginal.Modal;
public class Productos {
private String
nombre,descripcion,precioven,imagen,categoria,pid,fecha,hora,cantidad,preciocom;
public Productos(){}
public Productos(String nombre, String descripcion, String
precioven, String imagen, String categoria, String pid, String fecha,
String hora, String cantidad, String preciocom) {
this.nombre = nombre;
this.descripcion = descripcion;
this.precioven = precioven;
this.imagen = imagen;
this.categoria = categoria;
this.pid = pid;
this.fecha = fecha;
this.hora = hora;
this.cantidad = cantidad;
this.preciocom = preciocom;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public String getPrecioven() {
return precioven;
}
public void setPrecioven(String precioven) {
this.precioven = precioven;
}
public String getImagen() {
return imagen;
}
public void setImagen(String imagen) {
this.imagen = imagen;
}
public String getCategoria() {
return categoria;
}
public void setCategoria(String categoria) {
this.categoria = categoria;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getFecha() {
return fecha;
}
public void setFecha(String fecha) {
this.fecha = fecha;
}
public String getHora() {
return hora;
}
public void setHora(String hora) {
this.hora = hora;
}
public String getCantidad() {
return cantidad;
}
public void setCantidad(String cantidad) {
this.cantidad = cantidad;
}
public String getPreciocom() {
return preciocom;
}
public void setPreciocom(String preciocom) {
this.preciocom = preciocom;
}
}
El vie, 1 jul 2022 a la(s) 16:00, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… let me see your Productos.java class...it seems there is a getter field
getOverlay which is conflicting with firebase @alejandroR9
<https://github.com/alejandroR9>
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2HLBQFJP7QMJVT3JXDVR5L5BANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Hello, it's me again, please could you help me, I still can't find the
solution to the error.
El vie, 1 jul 2022 a la(s) 16:07, Knight Rider ***@***.***)
escribió:
… THIS IS MY CLASS
package com.example.alphaapporiginal.Modal;
public class Productos {
private String nombre,descripcion,precioven,imagen,categoria,pid,fecha,hora,cantidad,preciocom;
public Productos(){}
public Productos(String nombre, String descripcion, String precioven, String imagen, String categoria, String pid, String fecha, String hora, String cantidad, String preciocom) {
this.nombre = nombre;
this.descripcion = descripcion;
this.precioven = precioven;
this.imagen = imagen;
this.categoria = categoria;
this.pid = pid;
this.fecha = fecha;
this.hora = hora;
this.cantidad = cantidad;
this.preciocom = preciocom;
}
public String getNombre() {
return nombre;
}
public void setNombre(String nombre) {
this.nombre = nombre;
}
public String getDescripcion() {
return descripcion;
}
public void setDescripcion(String descripcion) {
this.descripcion = descripcion;
}
public String getPrecioven() {
return precioven;
}
public void setPrecioven(String precioven) {
this.precioven = precioven;
}
public String getImagen() {
return imagen;
}
public void setImagen(String imagen) {
this.imagen = imagen;
}
public String getCategoria() {
return categoria;
}
public void setCategoria(String categoria) {
this.categoria = categoria;
}
public String getPid() {
return pid;
}
public void setPid(String pid) {
this.pid = pid;
}
public String getFecha() {
return fecha;
}
public void setFecha(String fecha) {
this.fecha = fecha;
}
public String getHora() {
return hora;
}
public void setHora(String hora) {
this.hora = hora;
}
public String getCantidad() {
return cantidad;
}
public void setCantidad(String cantidad) {
this.cantidad = cantidad;
}
public String getPreciocom() {
return preciocom;
}
public void setPreciocom(String preciocom) {
this.preciocom = preciocom;
}
}
El vie, 1 jul 2022 a la(s) 16:00, Kojo Fosu Bempa Edue (
***@***.***) escribió:
> let me see your Productos.java class...it seems there is a getter field
> getOverlay which is conflicting with firebase @alejandroR9
> <https://github.com/alejandroR9>
>
> —
> Reply to this email directly, view it on GitHub
> <#18 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ANUMD2HLBQFJP7QMJVT3JXDVR5L5BANCNFSM5ZYU6RGQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
-
|
Hello, thank you very much, I already know what the error could be and
I think it is because of the button
map.put("cantidad",numeroBoton);
map.put("cantidad",numeroBoton.getNumber();
I was guided by an example about the button ElegantNumberButton
and use the function getNumber() and with that it worked
);
final DatabaseReference CartListRef =
FirebaseDatabase.getInstance("https://alphaapporiginal-default-rtdb.firebaseio.com/").getReference().child("Carrito");
final HashMap<String,Object> map = new HashMap<>();
map.put("pid",productoID);
map.put("nombre",productoNombre.getText().toString());
map.put("precio",productoPrecio.getText().toString());
map.put("fecha",CurrentDate);
map.put("hora",CurrentTime);
map.put("cantidad",numeroBoton.getAnimation());
map.put("descuento","");
CartListRef.child("Usuario
Compra").child(CurrentUserID).child("Productos").child(productoID).updateChildren(map).addOnCompleteListener(new
OnCompleteListener<Void>() {
@OverRide
public void ***@***.*** Task<Void> task) {
if (task.isSuccessful()){
CartListRef.child("Administracion").child(CurrentUserID).child("Productos").child(productoID).updateChildren(map).addOnCompleteListener(new
OnCompleteListener<Void>() {
@OverRide
public void ***@***.*** Task<Void> task) {
if (task.isSuccessful()){
Toast.makeText(ProductoDetallesActivity.this,
"Agregago...", Toast.LENGTH_SHORT).show();
Intent intent = new
Intent(ProductoDetallesActivity.this,PrincipalActivity.class);
startActivity(intent);
}
}
});
}
}
});
El dom, 3 jul 2022 a la(s) 14:01, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… yeah i thought it was an issue with your product class....I'm looking into
the issue ...if i get anything, I'll let you know
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2HSU42GC34Z6AMPRNTVSHPQHANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
If you please help me I don't know what else to add when I put
getAnimation();
I get an error in this:
Process: com.example.alphaapporiginal, PID: 3106
java.lang.NumberFormatException: s == null
at java.lang.Integer.parseInt(Integer.java:577)
at java.lang.Integer.valueOf(Integer.java:801)
at
com.example.alphaapporiginal.CarritoActivity$2.onBindViewHolder(CarritoActivity.java:86)
at
com.example.alphaapporiginal.CarritoActivity$2.onBindViewHolder(CarritoActivity.java:78)
at
com.firebase.ui.database.FirebaseRecyclerAdapter.onBindViewHolder(FirebaseRecyclerAdapter.java:149)
at
androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
at
androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
at
androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
at
androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
at
androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
at
androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
at
androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
at
androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
at
androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at
androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
at
androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
at
androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
at
androidx.recyclerview.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1897)
at
androidx.recyclerview.widget.RecyclerView$1.run(RecyclerView.java:414)
at
android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:727)
at
android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
2022-07-05 10:25:15.958 567-1488/system_process E/TaskPersister: File error
accessing recents directory (directory doesn't exist?).
2022-07-05 10:25:28.746 185-196/? ***@***.***:
Error opening kernel wakelock stats for: wakeup34: Permission denied
2022-07-05 10:25:28.765 185-196/? ***@***.***:
Error opening kernel wakelock stats for: wakeup35: Permission denied
2022-07-05 10:25:36.669 567-1488/system_process E/TaskPersister: File error
accessing recents directory (directory doesn't exist?).
2022-07-05 10:25:41.482 408-408/? E/netmgr: qemu_pipe_open_ns:62: Could not
connect to the 'pipe:qemud:network' service: Invalid argument
2022-07-05 10:25:41.482 408-408/? E/netmgr: Failed to open QEMU pipe
'qemud:network': Invalid argument
2022-07-05 10:25:43.920 410-410/? E/wifi_forwarder: qemu_pipe_open_ns:62:
Could not connect to the 'pipe:qemud:wififorward' service: Invalid argument
2022-07-05 10:25:43.920 410-410/? E/wifi_forwarder: RemoteConnection failed
to initialize: RemoteConnection failed to open pipe
2022-07-05 10:25:57.812 185-196/? ***@***.***:
Error opening kernel wakelock stats for: wakeup34: Permission denied
2022-07-05 10:25:57.828 185-196/? ***@***.***:
Error opening kernel wakelock stats for: wakeup35: Permission denied
2022-07-05 10:26:01.454 152-152/? E/SELinux: avc: denied { find } for
interface=android.hardware.memtrack::IMemtrack
sid=u:r:gmscore_app:s0:c512,c768 pid=1317
scontext=u:r:gmscore_app:s0:c512,c768
tcontext=u:object_r:hal_memtrack_hwservice:s0 tclass=hwservice_manager
permissive=0
2022-07-05 10:26:01.457 1317-3186/com.google.android.gms E/memtrack:
Couldn't load memtrack module
2022-07-05 10:26:12.139 1668-3191/com.google.android.gms E/ConfigFileUtils:
Failed to read config file:
/data/user_de/0/com.google.android.gms/app_chimera/next_container.pb: open
failed: ENOENT (No such file or directory)
CarritoActivity
Especially the error I get here:
double UnTipoPrecio =
(Double.valueOf(model.getPrecio()))*Integer.valueOf(model.getCantidad());
FirebaseRecyclerAdapter<Carrito,CarritoViewHolder> adapter = new
FirebaseRecyclerAdapter<Carrito, CarritoViewHolder>(options) {
@OverRide
protected void ***@***.*** CarritoViewHolder holder,
int position, @nonnull Carrito model) {
holder.carProductoNombre.setText(model.getNombre());
holder.carProductoCantidad.setText("Cantidad: "+model.getCantidad());
holder.carProductoPrecio.setText("Precio: $ "+model.getPrecio());
double UnTipoPrecio =
(Double.valueOf(model.getPrecio()))*Integer.valueOf(model.getCantidad());
PrecioTotalD = PrecioTotalD+UnTipoPrecio;
TotalPrecio.setText("Total: "+String.valueOf(PrecioTotalD));
holder.itemView.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
CharSequence options[] = new CharSequence[]{
"Editar",
"Eliminar"
};
AlertDialog.Builder builder = new
AlertDialog.Builder(CarritoActivity.this);
builder.setTitle("Opciones del Producto");
builder.setItems(options, new
DialogInterface.OnClickListener() {
@OverRide
public void onClick(DialogInterface dialog, int i) {
if (i==0){
Intent intent = new
Intent(CarritoActivity.this,ProductoDetallesActivity.class);
intent.putExtra("pid",model.getPid());
startActivity(intent);
}
if (i==1){
CartListRef.child("Usuario Compra")
.child(CurrentUserId)
.child("Productos")
.child(model.getPid()).removeValue()
.addOnCompleteListener(new
OnCompleteListener<Void>() {
@OverRide
public void
***@***.*** Task<Void> task) {
if (task.isSuccessful()){
Toast.makeText(CarritoActivity.this, "Producto Eliminado",
Toast.LENGTH_SHORT).show();
Intent intent = new
Intent(CarritoActivity.this,PrincipalActivity.class);
startActivity(intent);
}
}
});
}
}
});
builder.show();
}
});
}
@nonnull
@OverRide
public CarritoViewHolder ***@***.*** ViewGroup
parent, int viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.car_item_layout,
parent,false);
CarritoViewHolder holder = new CarritoViewHolder(view);
return holder;
}
};
El lun, 4 jul 2022 a la(s) 23:02, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… That's nice to know
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2DHXPTC5QQP5DIZR3TVSOXT7ANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
it's not that i'm just trying to make it work
El mar, 5 jul 2022 a la(s) 10:36, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… why do you want to get animation?
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2GZVKBFAA6C4MW4JEDVSRJBRANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
You also speak Spanish ? My English is not very good
El mar, 5 jul 2022 a la(s) 10:47, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… Text me on Twiiter : https://twitter.com/McDerek_...lets hop on a call so
i can assist
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2FYH6BNAAKI253ZTL3VSRKJNANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
hehehehe I understand what do you think if I show you my code by zoom and
so you can see my error better?
please
El mar, 5 jul 2022 a la(s) 11:17, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… lol no...I only speak English..okay ill just take my time and look through
that code snippet you sent above and see if I can come up with a solution
for you
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2AMQO7PBKWA3X7S3ETVSRNZBANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
Hello good morning, sorry I was able to find the small problem but I get an
error, could you help me again please?
El mar, 5 jul 2022 a la(s) 11:28, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… yeah that was what i was suggesting .
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2GI54IJIK4RW5OKSS3VSRPCVANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
this is the link i will show you the code
https://meet.google.com/ttv-hpzw-sfr
El mar, 5 jul 2022 a la(s) 11:28, Kojo Fosu Bempa Edue (
***@***.***) escribió:
… yeah that was what i was suggesting .
—
Reply to this email directly, view it on GitHub
<#18 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUMD2GI54IJIK4RW5OKSS3VSRPCVANCNFSM5ZYU6RGQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
|
map.put("cantidad",numeroBoton.getAnimation());
I put getAnimation on the Quantitizer button but I get an error on this
2022-07-04 21:18:05.653 1783-1783/com.example.alphaapporiginal
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.alphaapporiginal, PID: 1783
java.lang.NumberFormatException: s == null
at java.lang.Integer.parseInt(Integer.java:577)
at java.lang.Integer.valueOf(Integer.java:801)
at com.example.alphaapporiginal.CarritoActivity$2.onBindViewHolder(CarritoActivity.java:86)
at com.example.alphaapporiginal.CarritoActivity$2.onBindViewHolder(CarritoActivity.java:78)
at com.firebase.ui.database.FirebaseRecyclerAdapter.onBindViewHolder(FirebaseRecyclerAdapter.java:149)
at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:7065)
at androidx.recyclerview.widget.RecyclerView$Adapter.bindViewHolder(RecyclerView.java:7107)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryBindViewHolderByDeadline(RecyclerView.java:6012)
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.java:6279)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6118)
at androidx.recyclerview.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:6114)
at androidx.recyclerview.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2303)
at androidx.recyclerview.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1627)
at androidx.recyclerview.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1587)
at androidx.recyclerview.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:665)
at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:4134)
at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3851)
at androidx.recyclerview.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1897)
at androidx.recyclerview.widget.RecyclerView$1.run(RecyclerView.java:414)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
at android.view.Choreographer.doCallbacks(Choreographer.java:796)
at android.view.Choreographer.doFrame(Choreographer.java:727)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
I get an error on line 86:
double UnTipoPrecio =
(Double.valueOf(model.getPrecio()))*Integer.valueOf(model.getCantidad());
I get an error on line 78:
line 78: FirebaseRecyclerAdapter<Carrito,CarritoViewHolder> adapter =
new FirebaseRecyclerAdapter<Carrito, CarritoViewHolder>(options) {
@OverRide
protected void ***@***.*** CarritoViewHolder holder,
int position, @nonnull Carrito model) {
holder.carProductoNombre.setText(model.getNombre());
holder.carProductoCantidad.setText("Cantidad: "+model.getCantidad());
holder.carProductoPrecio.setText("Precio: $ "+model.getPrecio());
double UnTipoPrecio =
(Double.valueOf(model.getPrecio()))*Integer.valueOf(model.getCantidad());
PrecioTotalD = PrecioTotalD+UnTipoPrecio;
TotalPrecio.setText("Total: "+String.valueOf(PrecioTotalD));
holder.itemView.setOnClickListener(new View.OnClickListener() {
@OverRide
public void onClick(View v) {
CharSequence options[] = new CharSequence[]{
"Editar",
"Eliminar"
};
AlertDialog.Builder builder = new
AlertDialog.Builder(CarritoActivity.this);
builder.setTitle("Opciones del Producto");
builder.setItems(options, new
DialogInterface.OnClickListener() {
@OverRide
public void onClick(DialogInterface dialog, int i) {
if (i==0){
Intent intent = new
Intent(CarritoActivity.this,ProductoDetallesActivity.class);
intent.putExtra("pid",model.getPid());
startActivity(intent);
}
if (i==1){
CartListRef.child("Usuario Compra")
.child(CurrentUserId)
.child("Productos")
.child(model.getPid()).removeValue()
.addOnCompleteListener(new
OnCompleteListener<Void>() {
@OverRide
public void
***@***.*** Task<Void> task) {
if (task.isSuccessful()){
Toast.makeText(CarritoActivity.this, "Producto Eliminado",
Toast.LENGTH_SHORT).show();
Intent intent = new
Intent(CarritoActivity.this,PrincipalActivity.class);
startActivity(intent);
}
}
});
}
}
});
builder.show();
}
});
}
@nonnull
@OverRide
public CarritoViewHolder ***@***.*** ViewGroup
parent, int viewType) {
View view =
LayoutInflater.from(parent.getContext()).inflate(R.layout.car_item_layout,
parent,false);
CarritoViewHolder holder = new CarritoViewHolder(view);
return holder;
}
};
El lun, 4 jul 2022 a la(s) 21:15, Knight Rider ***@***.***)
escribió:
… Hello, thank you very much, I already know what the error could be and I think it is because of the button
map.put("cantidad",numeroBoton);
map.put("cantidad",numeroBoton.getNumber();
I was guided by an example about the button ElegantNumberButton
and use the function getNumber() and with that it worked
);
final DatabaseReference CartListRef = FirebaseDatabase.getInstance("https://alphaapporiginal-default-rtdb.firebaseio.com/").getReference().child("Carrito");
final HashMap<String,Object> map = new HashMap<>();
map.put("pid",productoID);
map.put("nombre",productoNombre.getText().toString());
map.put("precio",productoPrecio.getText().toString());
map.put("fecha",CurrentDate);
map.put("hora",CurrentTime);
map.put("cantidad",numeroBoton.getAnimation());
map.put("descuento","");
CartListRef.child("Usuario Compra").child(CurrentUserID).child("Productos").child(productoID).updateChildren(map).addOnCompleteListener(new OnCompleteListener<Void>() {
@OverRide
public void ***@***.*** Task<Void> task) {
if (task.isSuccessful()){
CartListRef.child("Administracion").child(CurrentUserID).child("Productos").child(productoID).updateChildren(map).addOnCompleteListener(new OnCompleteListener<Void>() {
@OverRide
public void ***@***.*** Task<Void> task) {
if (task.isSuccessful()){
Toast.makeText(ProductoDetallesActivity.this, "Agregago...", Toast.LENGTH_SHORT).show();
Intent intent = new Intent(ProductoDetallesActivity.this,PrincipalActivity.class);
startActivity(intent);
}
}
});
}
}
});
El dom, 3 jul 2022 a la(s) 14:01, Kojo Fosu Bempa Edue (
***@***.***) escribió:
> yeah i thought it was an issue with your product class....I'm looking
> into the issue ...if i get anything, I'll let you know
>
> —
> Reply to this email directly, view it on GitHub
> <#18 (reply in thread)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/ANUMD2HSU42GC34Z6AMPRNTVSHPQHANCNFSM5ZYU6RGQ>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Could you please help me I follow the steps to implement the library but I get an error in this: implementation "com.github.kojofosu:Quantitizer:$latest_release"
in android studio I get an error maybe it's because of the quotes or $latest_releas
or do you know of any other similar library, please help
Beta Was this translation helpful? Give feedback.
All reactions