-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tharyck Gusmao
committed
Jul 24, 2022
1 parent
d5c7ee1
commit fcaa170
Showing
36,452 changed files
with
6,750,053 additions
and
75 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
android/fitnesstracker/app/src/main/java/com/fitnesstracker/ListCalcActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package com.fitnesstracker | ||
|
||
import android.content.Context | ||
import androidx.appcompat.app.AppCompatActivity | ||
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.TextView | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
|
||
class ListCalcActivity : AppCompatActivity() { | ||
lateinit var rvMain: RecyclerView; | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_list_calc_acitivy) | ||
|
||
val extras: Bundle? = intent.extras; | ||
|
||
if(extras != null){ | ||
val type = extras.getString("type"); | ||
|
||
val registers: List<Register> = SqlHelper(this).getRegisterBy(type); | ||
|
||
rvMain = findViewById(R.id.recycler_view_list); | ||
rvMain.layoutManager = LinearLayoutManager(this) | ||
rvMain.adapter = MainAdapter(registers, this); | ||
} | ||
} | ||
private class MainAdapter( | ||
private val mainItems: List<Register>, | ||
private val context: Context | ||
): RecyclerView.Adapter<MainAdapter.MainViewHolder>(){ | ||
inner class MainViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { | ||
|
||
fun bind(item: Register) { | ||
|
||
val textView = itemView.findViewById<TextView>(R.id.title_item); | ||
val responseView = itemView.findViewById<TextView>(R.id.title_response); | ||
val dateView = itemView.findViewById<TextView>(R.id.title_date); | ||
textView.text = item.type; | ||
responseView.text = item.response.toString(); | ||
dateView.text = item.createdDate; | ||
|
||
} | ||
|
||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MainViewHolder { | ||
return MainViewHolder(LayoutInflater.from(context).inflate(R.layout.main_register,parent,false)) | ||
} | ||
|
||
override fun onBindViewHolder(holder: MainViewHolder, position: Int) { | ||
var mainItemCurrent = mainItems.get(position) | ||
holder.bind(mainItemCurrent) | ||
} | ||
|
||
override fun getItemCount(): Int { | ||
return mainItems.size | ||
} | ||
|
||
|
||
|
||
|
||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
android/fitnesstracker/app/src/main/java/com/fitnesstracker/Register.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package com.fitnesstracker | ||
|
||
class Register { | ||
lateinit var type:String; | ||
var response:Double = 0.0; | ||
lateinit var createdDate:String; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
android/fitnesstracker/app/src/main/res/layout/activity_list_calc_acitivy.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout 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=".ListCalcActivity"> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:id="@+id/recycler_view_list" | ||
tools:listitem="@layout/main_register" | ||
tools:itemCount="5" | ||
|
||
/> | ||
|
||
</LinearLayout> |
42 changes: 42 additions & 0 deletions
42
android/fitnesstracker/app/src/main/res/layout/main_register.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?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="wrap_content" | ||
android:layout_marginBottom="10dp" | ||
> | ||
|
||
<LinearLayout | ||
android:id="@+id/btn_imc" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:gravity="center" | ||
android:orientation="vertical" | ||
android:padding="10dp" | ||
app:layout_constraintDimensionRatio="1:1" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent"> | ||
|
||
|
||
<TextView | ||
android:id="@+id/title_item" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/label_imc" /> | ||
|
||
<TextView | ||
android:id="@+id/title_response" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/label_imc" /> | ||
|
||
<TextView | ||
android:id="@+id/title_date" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/label_imc" /> | ||
</LinearLayout> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<menu xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<item android:id="@+id/nmenu_list" | ||
android:title="@string/buscar" | ||
></item> | ||
</menu> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.