Skip to content

Commit

Permalink
Added item for excersice
Browse files Browse the repository at this point in the history
  • Loading branch information
amrhossamdev committed Apr 7, 2024
1 parent c1cd98b commit c89fd39
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ dependencies {
implementation("com.google.android.gms:play-services-basement:18.3.0")
// json helper
implementation("com.google.code.gson:gson:2.10")
// progress indicators
implementation("com.tbuonomo:dotsindicator:5.0")


testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ class ExerciseInfoActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_exercise_info)



viewPager = findViewById(R.id.viewPager)
toggleButtonGroup = findViewById(R.id.toggle_button_group)

Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/drawable/ic_close.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="31dp"
android:height="31dp"
android:viewportWidth="31"
android:viewportHeight="31">
<path
android:fillColor="#B9A4FF"
android:fillType="evenOdd"
android:pathData="M15.5,31C19.611,31 23.553,29.367 26.46,26.46C29.367,23.553 31,19.611 31,15.5C31,11.389 29.367,7.447 26.46,4.54C23.553,1.633 19.611,0 15.5,0C11.389,0 7.447,1.633 4.54,4.54C1.633,7.447 0,11.389 0,15.5C0,19.611 1.633,23.553 4.54,26.46C7.447,29.367 11.389,31 15.5,31ZM12.995,10.255C12.629,9.902 12.14,9.707 11.632,9.711C11.124,9.716 10.638,9.92 10.279,10.279C9.92,10.638 9.716,11.124 9.711,11.632C9.707,12.14 9.902,12.629 10.255,12.995L12.76,15.5L10.255,18.005C10.07,18.184 9.922,18.398 9.821,18.634C9.719,18.87 9.666,19.125 9.664,19.382C9.661,19.639 9.71,19.894 9.808,20.132C9.905,20.371 10.049,20.587 10.231,20.769C10.413,20.951 10.629,21.095 10.868,21.192C11.106,21.289 11.361,21.338 11.618,21.336C11.875,21.334 12.13,21.281 12.366,21.179C12.602,21.077 12.816,20.93 12.995,20.745L15.5,18.24L18.005,20.745C18.371,21.098 18.86,21.293 19.368,21.289C19.876,21.284 20.362,21.08 20.721,20.721C21.08,20.362 21.284,19.876 21.289,19.368C21.293,18.86 21.098,18.371 20.745,18.005L18.24,15.5L20.745,12.995C21.098,12.629 21.293,12.14 21.289,11.632C21.284,11.124 21.08,10.638 20.721,10.279C20.362,9.92 19.876,9.716 19.368,9.711C18.86,9.707 18.371,9.902 18.005,10.255L15.5,12.76L12.995,10.255Z" />
</vector>
103 changes: 103 additions & 0 deletions app/src/main/res/layout/item_excersice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/grey_900"
android:orientation="vertical">


<TextView
android:id="@+id/excersiceName"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:text="Chest press"
android:textColor="@color/white"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/exitButton"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toEndOf="@+id/exitButton"
app:layout_constraintTop_toTopOf="@+id/exitButton" />

<TextView
android:id="@+id/excersiceDesc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:text="Chest press"
android:textAlignment="center"
android:textColor="@color/white"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/exerciseGIf" />

<ImageButton
android:id="@+id/exitButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:background="@null"
android:src="@drawable/ic_close"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<ImageView
android:id="@+id/exerciseGIf"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:scaleType="centerCrop"
android:src="@drawable/temp1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/exitButton" />

<TextView
android:id="@+id/excerscieCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="15 reps"
android:textColor="@color/primary_200"
android:textSize="24sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/excersiceDesc"
app:layout_constraintVertical_bias="0.19999999" />

<TextView
android:id="@+id/excerscieSetCounts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:text="set 1/4"
android:textColor="@color/white"
android:textSize="14sp"
app:layout_constraintBottom_toTopOf="@+id/worm_dots_indicator"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />


<com.tbuonomo.viewpagerdotsindicator.WormDotsIndicator
android:id="@+id/worm_dots_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:dotsColor="@color/primary_400"
app:dotsCornerRadius="8dp"
app:dotsSize="16dp"
app:dotsSpacing="4dp"
app:dotsStrokeColor="@color/primary_400"
app:dotsStrokeWidth="2dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/excerscieCount"
app:layout_constraintVertical_bias="0.47000003" />
</androidx.constraintlayout.widget.ConstraintLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<string name="crush_today_s_workout">Crush Today’s Workout</string>
<string name="today_s_diet">Today’s diet</string>
<string name="view">view</string>
<string name="my_trainer">my trainer</string>
<string name="my_trainer">Trainer</string>
<string name="workouts">Workouts</string>
<string name="nutrition">Nutrition</string>
<string name="more">More</string>
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
#org.gradle.jvmargs=-Xmx1024m -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xms512m -Xmx1024m
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configureondemand=true
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
Expand Down

0 comments on commit c89fd39

Please sign in to comment.