-
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.
Adding WeeklyWorkoutActivity but without Timeline part.
- Loading branch information
1 parent
5799300
commit 22d082e
Showing
9 changed files
with
313 additions
and
7 deletions.
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
48 changes: 48 additions & 0 deletions
48
app/src/main/java/com/modarb/android/ui/workout/activites/WeeklyWorkoutActivity.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,48 @@ | ||
package com.modarb.android.ui.workout.activites | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.os.Bundle | ||
import android.view.View | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.modarb.android.R | ||
import com.modarb.android.ui.workout.adapters.WorkoutAdapter | ||
import com.modarb.android.ui.workout.models.WorkoutModel | ||
//import com.modarb.android.ui.workout.models.YourItem2 | ||
|
||
class WeeklyWorkoutActivity : AppCompatActivity() { | ||
private lateinit var recyclerView: RecyclerView | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_weekly_workout) | ||
|
||
|
||
recyclerView = findViewById(R.id.recyclerView) | ||
recyclerView.layoutManager = LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false) | ||
recyclerView.visibility = View.VISIBLE | ||
|
||
val itemList: ArrayList<WorkoutModel> = ArrayList() | ||
|
||
val workout1 = WorkoutModel(R.drawable.chest_press, "chest press", "4 sets x 12-15 reps", "chest") | ||
val workout2 = WorkoutModel(R.drawable.deadlift, "Deadlift", "4 sets x 10-12 reps", "full body") | ||
|
||
itemList.add(workout1) | ||
itemList.add(workout2) | ||
|
||
val recyclerView: RecyclerView = findViewById(R.id.recyclerView) | ||
val layoutManager = LinearLayoutManager(this) | ||
recyclerView.layoutManager = layoutManager | ||
|
||
val adapter = WorkoutAdapter(itemList) | ||
recyclerView.adapter = adapter | ||
|
||
|
||
|
||
// val itemList2: ArrayList<YourItem2> = ArrayList() | ||
// itemList2.add(YourItem2("D1")) | ||
// itemList2.add(YourItem2("D2")) | ||
// itemList2.add(YourItem2("D3")) | ||
// itemList2.add(YourItem2("D4")) | ||
|
||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
app/src/main/java/com/modarb/android/ui/workout/adapters/TimelineWeeklyWorkoutAdapter.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,38 @@ | ||
package com.modarb.android.ui.workout.adapters | ||
|
||
//import android.view.LayoutInflater | ||
//import android.view.View | ||
//import android.view.ViewGroup | ||
//import android.widget.TextView | ||
//import androidx.recyclerview.widget.RecyclerView | ||
//import com.github.vipulasri.timelineview.TimelineView | ||
//import com.modarb.android.R | ||
//import com.modarb.android.ui.workout.models.YourItem2 | ||
// | ||
//class TimelineWeeklyWorkoutAdapter (private val dataList: List<YourItem2>) : RecyclerView.Adapter<TimelineWeeklyWorkoutAdapter.YourViewHolder>() { | ||
// | ||
// inner class YourViewHolder(itemView: View, viewType: Int) : RecyclerView.ViewHolder(itemView) { | ||
// private val timelineView: TimelineView = itemView.findViewById(R.id.timeline) | ||
// val textView: TextView = itemView.findViewById(R.id.textView) | ||
// | ||
// init { | ||
// timelineView.initLine(viewType) | ||
// } | ||
// } | ||
// | ||
// override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): YourViewHolder { | ||
// val view = LayoutInflater.from(parent.context).inflate(R.layout.item_timeline2, parent, false) | ||
// return YourViewHolder(view, viewType) | ||
// } | ||
// | ||
// override fun onBindViewHolder(holder: YourViewHolder, position: Int) { | ||
// val currentItem = dataList[position] | ||
// holder.textView.text = currentItem.textView | ||
// } | ||
// | ||
// override fun getItemCount() = dataList.size | ||
// | ||
// override fun getItemViewType(position: Int): Int { | ||
// return TimelineView.getTimeLineViewType(position, itemCount) | ||
// } | ||
//} |
3 changes: 3 additions & 0 deletions
3
app/src/main/java/com/modarb/android/ui/workout/models/YourItem2.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,3 @@ | ||
package com.modarb.android.ui.workout.models | ||
|
||
//data class YourItem2(val textView: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<shape xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:shape="rectangle"> | ||
<solid android:color="@color/gray_700"/> | ||
<corners android:radius="16dp" /> | ||
</shape> |
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,183 @@ | ||
<?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" | ||
android:background="@color/black" | ||
tools:context=".ui.workout.activites.WeeklyWorkoutActivity"> | ||
|
||
<ImageView | ||
android:id="@+id/imageView" | ||
android:layout_width="28dp" | ||
android:layout_height="37dp" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginTop="28dp" | ||
android:src="@drawable/line1" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
tools:ignore="ContentDescription" /> | ||
|
||
<TextView | ||
android:id="@+id/textView" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="28dp" | ||
android:gravity="start" | ||
android:text="@string/Week1_foundation" | ||
android:textColor="@color/white" | ||
android:textSize="20sp" | ||
app:layout_constraintStart_toEndOf="@+id/imageView" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/textView2" | ||
android:layout_width="0dp" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="8dp" | ||
android:gravity="start" | ||
android:paddingTop="2dp" | ||
android:text="@string/Week1_description" | ||
android:textColor="@color/white_600" | ||
android:textSize="16sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="@+id/textView" | ||
app:layout_constraintTop_toBottomOf="@+id/textView" /> | ||
|
||
|
||
<com.github.vipulasri.timelineview.TimelineView | ||
android:id="@+id/timeline" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:endLineColor="@color/primary_400" | ||
app:lineOrientation="horizontal" | ||
app:markerInCenter="true" | ||
app:lineStyle="dash" | ||
app:lineStyleDashGap="4dp" | ||
app:lineStyleDashLength="8dp" | ||
app:lineWidth="2dp" | ||
app:markerPaddingBottom="16dp" | ||
app:markerPaddingLeft="16dp" | ||
app:markerPaddingRight="16dp" | ||
app:markerPaddingTop="16dp" | ||
app:markerSize="20dp" | ||
app:startLineColor="@color/primary_400" | ||
app:layout_constraintBottom_toTopOf="@+id/frameLayout" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView2" | ||
app:layout_constraintVertical_bias="0.5" /> | ||
|
||
<FrameLayout | ||
android:id="@+id/frameLayout" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
android:layout_marginStart="8dp" | ||
android:layout_marginTop="50dp" | ||
android:layout_marginEnd="8dp" | ||
android:background="@drawable/grey700_shape" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/textView2"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<TextView | ||
android:id="@+id/textView4" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="52dp" | ||
android:layout_marginTop="24dp" | ||
android:fontFamily="@font/montserrat" | ||
android:gravity="center" | ||
android:padding="8dp" | ||
android:text="@string/sets_20" | ||
android:textColor="@color/white_smoke" | ||
android:textSize="16sp" | ||
app:layout_constraintEnd_toStartOf="@+id/textView3" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toEndOf="@+id/textView5" | ||
app:layout_constraintTop_toBottomOf="@+id/textView6" /> | ||
|
||
<TextView | ||
android:id="@+id/textView5" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginStart="16dp" | ||
android:layout_marginTop="24dp" | ||
android:fontFamily="@font/montserrat" | ||
android:gravity="center" | ||
android:padding="8dp" | ||
android:text="@string/exercises_6" | ||
android:textColor="@color/white_smoke" | ||
android:textSize="16sp" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView6" /> | ||
|
||
<TextView | ||
android:id="@+id/textView3" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="24dp" | ||
android:layout_marginEnd="12dp" | ||
android:fontFamily="@font/montserrat" | ||
android:gravity="center" | ||
android:padding="8dp" | ||
android:text="@string/Duration_40_50_min" | ||
android:textColor="@color/white_smoke" | ||
android:textSize="16sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView6" /> | ||
|
||
<TextView | ||
android:id="@+id/textView6" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="16dp" | ||
android:fontFamily="@font/montserrat" | ||
android:gravity="center" | ||
android:padding="8dp" | ||
android:text="@string/Day1_4_Full_body" | ||
android:textColor="@color/primary_50" | ||
android:textSize="20sp" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.495" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:id="@+id/recyclerView" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:visibility="visible" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/textView4" | ||
app:layout_constraintVertical_bias="0.041" /> | ||
|
||
<Button | ||
android:id="@+id/startButton" | ||
android:layout_width="240dp" | ||
android:layout_height="wrap_content" | ||
android:backgroundTint="@color/button" | ||
android:padding="12dp" | ||
android:text="@string/start" | ||
android:textSize="20sp" | ||
android:textStyle="bold" | ||
app:cornerRadius="12dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.496" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/recyclerView" | ||
app:layout_constraintVertical_bias="0.873" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</FrameLayout> | ||
</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,25 @@ | ||
<?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"> | ||
|
||
<TextView | ||
android:id="@+id/textView" | ||
android:layout_width="80dp" | ||
android:layout_height="28dp" | ||
android:background="@drawable/neon_blue_shape" | ||
android:gravity="center" | ||
android:paddingTop="2dp" | ||
android:textColor="@color/white_500" | ||
android:textSize="16sp" | ||
tools:text="Day" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintHorizontal_bias="0.0" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" | ||
app:layout_constraintVertical_bias="0.0" /> | ||
</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
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