|
@@ -63,21 +63,21 @@ class MainActivity : AppCompatActivity() {
|
63
|
63
|
|
64
|
64
|
val request = ServiceBuilder.buildService(TrefleService::class.java)
|
65
|
65
|
val call : Call<PlantListss> = request.getPlants(getString(R.string.TOKEN))
|
66
|
|
-//// Log.i("Call Plant List", call.toString())
|
|
66
|
+// Log.i("Call Plant List", call.toString())
|
67
|
67
|
call.enqueue(object : Callback<PlantListss>{
|
68
|
68
|
override fun onResponse(call: Call<PlantListss>, response: Response<PlantListss>) {
|
69
|
|
-// Log.i("response", response.body().toString())
|
|
69
|
+//// Log.i("response", response.body().toString())
|
70
|
70
|
if (response.isSuccessful){
|
71
|
71
|
// Log.i("Status", "Respones fue succesful")
|
72
|
72
|
recyclerView = findViewById<RecyclerView>(R.id.recyclerView)
|
73
|
|
-//// progress_bar.visibility = View.GONE
|
|
73
|
+////// progress_bar.visibility = View.GONE
|
74
|
74
|
recyclerView.apply {
|
75
|
|
-// Log.i("velllllllllllllllllllll", response.body().toString())
|
|
75
|
+//// Log.i("velllllllllllllllllllll", response.body().toString())
|
76
|
76
|
setHasFixedSize(true)
|
77
|
|
-// layoutManager = LinearLayoutManager(this@MainActivity)
|
78
|
|
-// adapter = FlowerAdapter(response.body()!!.data)
|
79
|
|
-// recyclerView.setAdapter(adapter)
|
80
|
|
-// recyclerView.setLayoutManager(layoutManager)
|
|
77
|
+ layoutManager = LinearLayoutManager(this@MainActivity)
|
|
78
|
+ adapter = FlowerAdapter(response.body()!!.data)
|
|
79
|
+ recyclerView.setAdapter(adapter)
|
|
80
|
+ recyclerView.setLayoutManager(layoutManager)
|
81
|
81
|
}
|
82
|
82
|
}
|
83
|
83
|
}
|