Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shop frontend #188

Merged
merged 5 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,29 @@ class BackgroundShopActivity : AppCompatActivity()
enableEdgeToEdge()
binding = ActivityBackgroundShopBinding.inflate(layoutInflater)
setContentView(binding.root)

// Setup of Items
val background1 = binding.shopItemBackground1
background1.shopItemName.text = "*BG Name Here"
background1.shopItemImage.setImageResource(R.drawable.shop_background_1)
background1.milkcoinsComponent.milkcoinsAmount.reInitialiseComponent(R.color.background_price_start, R.color.background_price_end)

val background2 = binding.shopItemBackground2
background2.shopItemName.text = "*BG Name Here"
background2.shopItemImage.setImageResource(R.drawable.shop_background_2)
background2.milkcoinsComponent.milkcoinsAmount.reInitialiseComponent(R.color.background_price_start, R.color.background_price_end)

val background3 = binding.shopItemBackground3
background3.shopItemName.text = "*BG Name Here"
background3.shopItemImage.setImageResource(R.drawable.shop_background_3)
background3.milkcoinsComponent.milkcoinsAmount.reInitialiseComponent(R.color.background_price_start, R.color.background_price_end)

val background4 = binding.shopItemBackground4
background4.shopItemName.text = "*BG Name Here"
background4.shopItemImage.setImageResource(R.drawable.shop_background_4)
background4.milkcoinsComponent.milkcoinsAmount.reInitialiseComponent(R.color.background_price_start, R.color.background_price_end)

// Setup Coins
binding.backgroundShopCoins.milkcoinsAmount.reInitialiseComponent(R.color.background_balance_start, R.color.background_balance_end)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,29 @@ class ItemShopActivity : AppCompatActivity()
enableEdgeToEdge()
binding = ActivityItemShopBinding.inflate(layoutInflater)
setContentView(binding.root)

// Setup of Items
val background1 = binding.shopItem1
background1.shopItemName.text = "Nick's Creatine"
background1.shopItemImage.setImageResource(R.drawable.item_nick)
background1.milkcoinsComponent.milkcoinsAmount.reInitialiseComponent(R.color.item_nick_start, R.color.item_nick_end)

val background2 = binding.shopItem2
background2.shopItemName.text = "Michael's Earphones"
background2.shopItemImage.setImageResource(R.drawable.item_michael)
background2.milkcoinsComponent.milkcoinsAmount.reInitialiseComponent(R.color.item_michael_start, R.color.item_michael_end)

val background3 = binding.shopItem3
background3.shopItemName.text = "Harvey's Cookies"
background3.shopItemImage.setImageResource(R.drawable.item_harvey)
background3.milkcoinsComponent.milkcoinsAmount.reInitialiseComponent(R.color.item_harvey_start, R.color.item_harvey_end)

val background4 = binding.shopItem4
background4.shopItemName.text = "Jasper's Hoodie"
background4.shopItemImage.setImageResource(R.drawable.item_jasper)
background4.milkcoinsComponent.milkcoinsAmount.reInitialiseComponent(R.color.item_jasper_start, R.color.item_jasper_end)

// Setup Coins
binding.backgroundShopCoins.milkcoinsAmount.reInitialiseComponent(R.color.background_balance_start, R.color.background_balance_end)
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/item_anneme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/item_harvey.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/item_jasper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/item_michael.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/item_nick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/item_shop_backdrop.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/milkcoin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/shop_background_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/shop_background_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/shop_background_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/shop_background_4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions app/src/main/res/drawable/shop_item_label_background.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/white"/>
<corners android:radius="10dp"/>
</shape>
Binary file added app/src/main/res/drawable/shop_item_shelf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
123 changes: 120 additions & 3 deletions app/src/main/res/layout/activity_background_shop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,127 @@
android:layout_height="match_parent"
tools:context=".screens.shop.BackgroundShopActivity">

<TextView
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="background shop"
android:gravity="center"/>
android:src="@drawable/background_shop_backdrop"
android:scaleType="centerCrop"/>

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="20dp"
android:paddingBottom="10dp">

<include layout="@layout/component_milkcoins_amount"
android:id="@+id/background_shop_coins"
android:layout_width="140dp"
android:layout_height="120dp"
android:layout_marginTop="-10dp"
android:layout_marginRight="-7dp"
android:layout_gravity="end"/>

<za.co.varsitycollege.st10204902.purrsonaltrainer.frontend_logic.GradientTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-40dp"
android:text="Purrfect"
android:fontFamily="@font/knicknack_black"
android:textSize="50sp"
app:startColor="@color/shop_header_color"
app:endColor="@color/shop_header_color"
app:strokeColor="@color/default_stroke_color"
app:strokeWidth="15dp"
android:elevation="2dp"/>

<za.co.varsitycollege.st10204902.purrsonaltrainer.frontend_logic.GradientTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-67dp"
android:text="Scenery"
android:fontFamily="@font/knicknack_black"
android:textSize="50sp"
app:startColor="@color/routine_end_color"
app:endColor="@color/routine_end_color"
app:strokeColor="@color/default_stroke_color"
app:strokeWidth="15dp" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<ImageView
android:layout_height="500dp"
android:layout_width="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:src="@drawable/shop_item_shelf"
android:scaleType="fitCenter"
android:layout_marginBottom="90dp"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent">

<include layout="@layout/component_shop_item"
android:id="@+id/shop_item_background_1"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<include layout="@layout/component_shop_item"
android:layout_weight="1"
android:id="@+id/shop_item_background_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginTop="-160dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<ImageView
android:layout_height="500dp"
android:layout_width="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:src="@drawable/shop_item_shelf"
android:scaleType="fitCenter"
android:layout_marginBottom="90dp"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent">

<include layout="@layout/component_shop_item"
android:id="@+id/shop_item_background_3"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<include layout="@layout/component_shop_item"
android:layout_weight="1"
android:id="@+id/shop_item_background_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>
123 changes: 120 additions & 3 deletions app/src/main/res/layout/activity_item_shop.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,127 @@
android:layout_height="match_parent"
tools:context=".screens.shop.ItemShopActivity">

<TextView
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="item shop"
android:gravity="center"/>
android:src="@drawable/item_shop_backdrop"
android:scaleType="centerCrop"/>

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingTop="20dp"
android:paddingBottom="10dp">

<include layout="@layout/component_milkcoins_amount"
android:id="@+id/background_shop_coins"
android:layout_width="140dp"
android:layout_height="120dp"
android:layout_marginTop="-10dp"
android:layout_marginRight="-7dp"
android:layout_gravity="end"/>

<za.co.varsitycollege.st10204902.purrsonaltrainer.frontend_logic.GradientTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-40dp"
android:text="Paw-Some"
android:fontFamily="@font/knicknack_black"
android:textSize="50sp"
app:startColor="@color/shop_header_color"
app:endColor="@color/shop_header_color"
app:strokeColor="@color/default_stroke_color"
app:strokeWidth="15dp"
android:elevation="2dp"/>

<za.co.varsitycollege.st10204902.purrsonaltrainer.frontend_logic.GradientTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="-60dp"
android:text="Gear"
android:fontFamily="@font/knicknack_black"
android:textSize="50sp"
app:startColor="@color/routine_end_color"
app:endColor="@color/routine_end_color"
app:strokeColor="@color/default_stroke_color"
app:strokeWidth="15dp" />

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<ImageView
android:layout_height="500dp"
android:layout_width="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:src="@drawable/shop_item_shelf"
android:scaleType="fitCenter"
android:layout_marginBottom="90dp"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent">

<include layout="@layout/component_shop_item"
android:id="@+id/shop_item_1"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<include layout="@layout/component_shop_item"
android:layout_weight="1"
android:id="@+id/shop_item_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_marginTop="-200dp"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1">

<ImageView
android:layout_height="500dp"
android:layout_width="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:src="@drawable/shop_item_shelf"
android:scaleType="fitCenter"
android:layout_marginBottom="90dp"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintTop_toTopOf="parent">

<include layout="@layout/component_shop_item"
android:id="@+id/shop_item_3"
android:layout_weight="1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

<include layout="@layout/component_shop_item"
android:layout_weight="1"
android:id="@+id/shop_item_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>
30 changes: 30 additions & 0 deletions app/src/main/res/layout/component_milkcoins_amount.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_gravity="center_horizontal">

<ImageView
android:layout_width="65dp"
android:layout_height="65dp"
android:src="@drawable/milkcoin"
android:layout_gravity="center_vertical"/>

<za.co.varsitycollege.st10204902.purrsonaltrainer.frontend_logic.GradientTextView
android:layout_marginTop="10dp"
android:id="@+id/milkcoins_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="-22dp"
android:text="25"
android:fontFamily="@font/knicknack_black"
android:textSize="55sp"
app:startColor="@color/soft_lime_green"
app:endColor="@color/olive_green"
app:strokeColor="@color/default_stroke_color"
app:strokeWidth="15dp"
android:layout_gravity="center_vertical"/>

</LinearLayout>
Loading
Loading