Ayuda! Necesito poner un boton con un link en mi app
Publicado por Javier (1 intervención) el 17/02/2021 04:42:44
Estaba trabajando con un amigo en esta app y la verdad soy muy nuevo en esto, yo se que les parece muy sencillo a algunos pero si me pudieran decir como ponerlo de debajo del texto " Aqui va la descripcion del producto " se trataria de un boton que al tocarlo te llevaria al siguiente link https://i.pinimg.com/originals/fd/3c/cd/fd3ccd7b49e366b4206f5ac7f8fa8dac.gif
Aqui esta nuestro codigo
se lo agradezco de CORAZON al que me ayude, por favor


Aqui esta nuestro codigo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Main Activity.java
package com.example.recyclerview.activity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.SearchView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import android.content.Intent;
import android.os.Bundle;
import com.example.recyclerview.R;
import com.example.recyclerview.adaptador.RecyclerAdapter;
import com.example.recyclerview.model.ItemList;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends AppCompatActivity implements RecyclerAdapter.RecyclerItemClick, SearchView.OnQueryTextListener {
private RecyclerView rvLista;
private SearchView svSearch;
private RecyclerAdapter adapter;
private List<ItemList> items;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initViews();
initValues();
initListener();
}
private void initViews(){
rvLista = findViewById(R.id.rvLista);
svSearch = findViewById(R.id.svSearch);
}
private void initValues() {
LinearLayoutManager manager = new LinearLayoutManager(this);
rvLista.setLayoutManager(manager);
items = getItems();
adapter = new RecyclerAdapter(items, this);
rvLista.setAdapter(adapter);
}
private void initListener() {
svSearch.setOnQueryTextListener(this);
}
private List<ItemList> getItems() {
List<ItemList> itemLists = new ArrayList<>();
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov6));
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov1));
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov5));
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov3));
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov2));
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov20));
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov12));
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov18));
itemLists.add(new ItemList("Producto 1", "Aqui va la descripcion del producto", R.drawable.prov17));
return itemLists;
}
@Override
public void itemClick(ItemList item) {
Intent intent = new Intent(this, DetailActivity.class);
intent.putExtra("itemDetail", item);
startActivity(intent);
}
@Override
public boolean onQueryTextSubmit(String query) {
return false;
}
@Override
public boolean onQueryTextChange(String newText) {
adapter.filter(newText);
return false;
}
}
Activity main.xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.MainActivity">
<androidx.appcompat.widget.SearchView
android:id="@+id/svSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:iconifiedByDefault="false"
app:queryHint="Buscar titulo"
app:layout_constraintTop_toTopOf="parent"/>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rvLista"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/svSearch"
app:layout_constraintVertical_bias="0.0" />
</androidx.constraintlayout.widget.ConstraintLayout>
se lo agradezco de CORAZON al que me ayude, por favor


Valora esta pregunta


0