0% found this document useful (0 votes)
5 views10 pages

Code Empowerherwellness Copy Paste

The document contains code for an Android application focused on a personalized PCOS plan, featuring buttons to access various YouTube exercise videos and a user interface with sections for daily progress tracking, meal recommendations, and workout plans. It includes XML layouts for displaying user data and recommendations, as well as Kotlin code for handling user input and displaying personalized workout and meal plans based on symptoms and preferences. The application aims to assist users in managing their PCOS through structured plans and resources.

Uploaded by

prachipingale001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views10 pages

Code Empowerherwellness Copy Paste

The document contains code for an Android application focused on a personalized PCOS plan, featuring buttons to access various YouTube exercise videos and a user interface with sections for daily progress tracking, meal recommendations, and workout plans. It includes XML layouts for displaying user data and recommendations, as well as Kotlin code for handling user input and displaying personalized workout and meal plans based on symptoms and preferences. The application aims to assist users in managing their PCOS through structured plans and resources.

Uploaded by

prachipingale001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

val exerciseVideo4: Button = findViewById(R.id.

exerciseVideo4)
exerciseVideo4.setOnClickListener {
openYouTubeVideo("https://www.youtube.com/@Yogawale")
}
val exerciseVideo5: Button = findViewById(R.id.exerciseVideo5)
exerciseVideo5.setOnClickListener {
openYouTubeVideo("https://www.youtube.com/@DrSupriyaPuranikIVF")
}
val exerciseVideo6: Button = findViewById(R.id.exerciseVideo6)
exerciseVideo6.setOnClickListener {
openYouTubeVideo("https://www.youtube.com/@HerHealthcareatHome")
}
val exerciseVideo7: Button = findViewById(R.id.exerciseVideo7)
exerciseVideo7.setOnClickListener {
openYouTubeVideo("https://www.youtube.com/@DrAshaGavadeUmangHospital")
}
val exerciseVideo8: Button = findViewById(R.id.exerciseVideo8)
exerciseVideo8.setOnClickListener {
openYouTubeVideo("https://www.youtube.com/@DrAshaGavadeUmangHospital")
}

<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp"
android:background="@color/light_pink">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center_horizontal">

<!-- Title Section -->


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="My PCOS Plan"
android:textSize="22sp"
android:textStyle="bold"
android:textColor="@android:color/black"
android:layout_marginBottom="10dp"/>

<!-- Calendar Section (Days and Dates) -->


<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">

<!-- Individual Day with Date -->


<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/calendar_circle_selected">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="M"
android:textSize="16sp"
android:textColor="@android:color/black"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="27"
android:textSize="14sp"
android:textColor="@android:color/black"/>
</LinearLayout>

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
android:gravity="center"
android:padding="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/calendar_circle">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="T"
android:textSize="16sp"
android:textColor="@android:color/black"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="28"
android:textSize="14sp"
android:textColor="@android:color/black"/>
</LinearLayout>

<!-- Add similar LinearLayouts for W, T, F, S, S -->


</LinearLayout>
</HorizontalScrollView>

<!-- Daily Progress Tracking Section -->


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginTop="15dp">

<!-- Carbs Card -->


<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="120dp"
android:background="@drawable/card_bg"
android:gravity="center"
android:padding="10dp"
android:orientation="vertical">

<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_food"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Carbs"
android:textSize="16sp"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0/150"
android:textSize="14sp"/>
</LinearLayout>

<!-- Workout Card -->


<LinearLayout
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="120dp"
android:background="@drawable/card_bg"
android:gravity="center"
android:padding="10dp"
android:orientation="vertical"
android:layout_marginLeft="10dp">

<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/ic_workout"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Workout"
android:textSize="16sp"
android:textStyle="bold"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0/4 days this week"
android:textSize="14sp"/>
</LinearLayout>
</LinearLayout>

<!-- Tab Section (Today's Meals | Today's Workout) -->


<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="20dp">

<Button
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Today's Meals"
android:textColor="@android:color/white"
android:backgroundTint="@color/pink"/>

<Button
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="Today's Workout"
android:textColor="@android:color/white"
android:backgroundTint="@color/gray"/>
</LinearLayout>

<!-- Meals Section -->


<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">

<!-- Breakfast Card -->


<LinearLayout
android:layout_width="200dp"
android:layout_height="wrap_content"
android:background="@drawable/card_bg"
android:padding="10dp"
android:orientation="vertical"
android:marginRight="10dp">

<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:src="@drawable/breakfast"
android:scaleType="centerCrop"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Breakfast"
android:textSize="16sp"
android:textStyle="bold"
android:layout_marginTop="5dp"/>
</LinearLayout>

<!-- Lunch Card -->


<LinearLayout
android:layout_width="200dp"
android:layout_height="wrap_content"
android:background="@drawable/card_bg"
android:padding="10dp"
android:orientation="vertical">

<ImageView
android:layout_width="match_parent"
android:layout_height="100dp"
android:src="@drawable/lunch"
android:scaleType="centerCrop"/>

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Lunch"
android:textSize="16sp"
android:textStyle="bold"
android:layout_marginTop="5dp"/>
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>

</LinearLayout>
</ScrollView>

Activity_recommendations.xml

<ScrollView

xmlns:android="http://schemas.android.com/apk/res/android"

android:layout_width="match_parent"
android:layout_height="match_parent"

android:padding="20dp">

<LinearLayout

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:orientation="vertical">

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="📊 Your Personalized PCOD Plan"

android:textSize="22sp"

android:textStyle="bold"

android:layout_marginBottom="20dp"/>

<!-- Show User Data -->

<TextView android:id="@+id/text_symptom" android:layout_width="wrap_content"


android:layout_height="wrap_content"/>

<TextView android:id="@+id/text_weight" android:layout_width="wrap_content"


android:layout_height="wrap_content"/>

<TextView android:id="@+id/text_height" android:layout_width="wrap_content"


android:layout_height="wrap_content"/>

<TextView android:id="@+id/text_activity" android:layout_width="wrap_content"


android:layout_height="wrap_content"/>

<TextView android:id="@+id/text_diet" android:layout_width="wrap_content"


android:layout_height="wrap_content"/>

<!-- Workout Recommendation -->

<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"


android:text="🏋 Workout Plan:" android:textSize="18sp" android:textStyle="bold"/>

<TextView android:id="@+id/text_workout" android:layout_width="wrap_content"


android:layout_height="wrap_content"/>
<!-- Meal Recommendation -->

<TextView android:layout_width="wrap_content" android:layout_height="wrap_content"


android:text="🍽 Meal Plan:" android:textSize="18sp" android:textStyle="bold"/>

<TextView android:id="@+id/text_meal_plan" android:layout_width="wrap_content"


android:layout_height="wrap_content"/>

</LinearLayout>

</ScrollView>

RecommendationsActivity.kt

package com.example.pcodtracker

import android.os.Bundle

import android.widget.TextView

import androidx.appcompat.app.AppCompatActivity

class RecommendationsActivity : AppCompatActivity() {

private lateinit var symptomText: TextView

private lateinit var weightText: TextView

private lateinit var heightText: TextView

private lateinit var activityText: TextView

private lateinit var dietText: TextView

private lateinit var workoutText: TextView

private lateinit var mealPlanText: TextView

override fun onCreate(savedInstanceState: Bundle?) {

super.onCreate(savedInstanceState)

setContentView(R.layout.activity_recommendations)
// Initialize Views

symptomText = findViewById(R.id.text_symptom)

weightText = findViewById(R.id.text_weight)

heightText = findViewById(R.id.text_height)

activityText = findViewById(R.id.text_activity)

dietText = findViewById(R.id.text_diet)

workoutText = findViewById(R.id.text_workout)

mealPlanText = findViewById(R.id.text_meal_plan)

// Get Data from Intent

val symptom = intent.getStringExtra("SYMPTOM")

val weight = intent.getStringExtra("WEIGHT")

val height = intent.getStringExtra("HEIGHT")

val activityLevel = intent.getStringExtra("ACTIVITY")

val dietPreference = intent.getStringExtra("DIET")

// Set Data

symptomText.text = "Symptom: $symptom"

weightText.text = "Weight: $weight kg"

heightText.text = "Height: $height cm"

activityText.text = "Activity Level: $activityLevel"

dietText.text = "Diet Preference: $dietPreference"

// Set Recommended Workouts

workoutText.text = getWorkoutRecommendation(symptom, activityLevel)

// Set Recommended Meal Plan

mealPlanText.text = getMealPlanRecommendation(dietPreference, symptom)

private fun getWorkoutRecommendation(symptom: String?, activityLevel: String?): String {


return when (symptom) {

"Weight Gain" -> "✅ Cardio (30 mins) + Strength Training (15 mins)"

"Hormonal Imbalance" -> "✅ Yoga (20 mins) + Light Walking (30 mins)"

"Fatigue" -> "✅ Light Stretching + 10,000 Steps"

else -> "✅ General: 30 mins Brisk Walk + Bodyweight Exercises"

private fun getMealPlanRecommendation(diet: String?, symptom: String?): String {

return when (diet) {

"Vegetarian" -> "🥗 Leafy Greens, Lentils, Whole Grains"

"Non-Vegetarian" -> "🍗 Lean Chicken, Fish, Eggs, Vegetables"

"Vegan" -> "🌱 Tofu, Nuts, Whole Grains, Fruits"

else -> "🥑 Balanced: Protein + Healthy Fats + Complex Carbs"

API KEY FOR YT= AIzaSyDKqu06NLfNMeNXuNw7p9EQBjw4XyxZ6KA

You might also like