Skip to content

Commit

Permalink
Merge pull request #15 from 1HazArd1/HazArdDonationInfo
Browse files Browse the repository at this point in the history
User Dashboard Categories
  • Loading branch information
1HazArd1 authored Oct 15, 2022
2 parents fa11df3 + 50e0470 commit 1874316
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 82 deletions.
19 changes: 9 additions & 10 deletions app/src/main/java/com/hazard/samarpan/ngo/NgoSignup2Fragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class NgoSignup2Fragment : Fragment() {
private var officeAdd: String? = ""
private var orgPin: String? = ""
private var orgPass: String? = ""

private var category: String? = ""

private lateinit var registerAuth: FirebaseAuth
Expand All @@ -58,7 +59,6 @@ class NgoSignup2Fragment : Fragment() {
v?.findViewById<AutoCompleteTextView>(R.id.ngosignup_select_orgtype_items)
autoCompleteTV?.setAdapter(arrayAdapter)


registerAuth = Firebase.auth

orgName = arguments?.getString("Name").toString().trim()
Expand All @@ -70,16 +70,14 @@ class NgoSignup2Fragment : Fragment() {

autoCompleteTV?.setOnClickListener {
category = autoCompleteTV.text.toString()
if (category != "") {
if (category == "Others") {
tilCategoryOthers?.visibility = View.VISIBLE
etCategoryOthers?.setOnClickListener {
category = etCategoryOthers?.text.toString()
}
} else {
category = autoCompleteTV.text.toString().trim()
tilCategoryOthers?.visibility = View.GONE
if (category == "Others") {
tilCategoryOthers?.visibility = View.VISIBLE
etCategoryOthers?.setOnClickListener {
category = etCategoryOthers?.text.toString()
}
} else {
tilCategoryOthers?.visibility = View.GONE
category = autoCompleteTV.text.toString().trim()
}
}

Expand Down Expand Up @@ -113,6 +111,7 @@ class NgoSignup2Fragment : Fragment() {
ngoInfo["PhoneNumber"] = orgPhone!!
ngoInfo["Address"] = officeAdd!!
ngoInfo["Pin Code"] = orgPin!!
ngoInfo["Category"] = category!!
ngoInfo["isDonor"] = "0"

// add the value of the org type from the dropdown and upload document
Expand Down
Binary file added app/src/main/res/drawable/bags.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/books.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/clothing.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/financial.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/food.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions app/src/main/res/drawable/ic_baseline_perm_identity_24.xml

This file was deleted.

Binary file added app/src/main/res/drawable/kitchen_wares.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/shoes.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/stationeries.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/toys.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
173 changes: 111 additions & 62 deletions app/src/main/res/layout/user_dashboard_fragment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="10dp"
android:background="@color/theme_background">

<androidx.core.widget.NestedScrollView
Expand All @@ -21,18 +22,17 @@

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="?actionBarSize">
android:layout_height="wrap_content">


<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="@font/righteous"
android:text="@string/app_name"
android:padding="15dp"
android:layout_centerVertical="true"
android:textColor="@color/theme_text_color_heading"
android:textSize="22sp" />
android:textSize="30sp" />

<ImageButton
android:id="@+id/profile_button"
Expand All @@ -51,7 +51,6 @@
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="150dp"

android:layout_marginTop="25dp"
android:src="@color/theme_color_light" />

Expand All @@ -75,7 +74,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight=".5"
android:fontFamily="@font/righteous"
android:fontFamily="@font/roboto_bold"
android:gravity="center"
android:text="@string/view_more"
android:textColor="@color/theme_text_color_body"
Expand All @@ -89,150 +88,200 @@

<androidx.cardview.widget.CardView
android:id="@+id/cat_1"
android:layout_width="60dp"
android:layout_height="60dp"
android:backgroundTint="@color/theme_color_light"
app:cardCornerRadius="30dp"
android:layout_width="90dp"
android:layout_height="100dp"
app:layout_constraintEnd_toStartOf="@id/cat_2"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="13dp"
android:src="@drawable/ic_uploadimage" />
android:layout_height="70dp"
android:src="@drawable/clothing" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="12sp"
android:fontFamily="@font/roboto_medium"
android:textColor="@color/theme_text_color_body"
android:gravity="center"
android:text="Clothing"/>

</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/cat_2"
android:layout_width="60dp"
android:layout_height="60dp"
android:backgroundTint="@color/theme_color_light"
app:cardCornerRadius="30dp"
android:layout_width="90dp"
android:layout_height="100dp"
app:layout_constraintEnd_toStartOf="@id/cat_3"
app:layout_constraintStart_toEndOf="@id/cat_1"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="13dp"
android:src="@drawable/ic_uploadimage" />
android:layout_height="70dp"
android:src="@drawable/kitchen_wares" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="12sp"
android:fontFamily="@font/roboto_medium"
android:textColor="@color/theme_text_color_body"
android:gravity="center"
android:text="KitchenWares"/>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/cat_3"
android:layout_width="60dp"
android:layout_height="60dp"
android:backgroundTint="@color/theme_color_light"
app:cardCornerRadius="30dp"
android:layout_width="90dp"
android:layout_height="100dp"
app:layout_constraintEnd_toStartOf="@id/cat_4"
app:layout_constraintStart_toEndOf="@id/cat_2"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="13dp"
android:src="@drawable/ic_uploadimage" />
android:layout_height="70dp"
android:src="@drawable/toys" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="12sp"
android:fontFamily="@font/roboto_medium"
android:textColor="@color/theme_text_color_body"
android:gravity="center"
android:text="Toys"/>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/cat_4"
android:layout_width="60dp"
android:layout_height="60dp"
android:backgroundTint="@color/theme_color_light"
app:cardCornerRadius="30dp"
android:layout_width="90dp"
android:layout_height="100dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/cat_3"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="13dp"
android:src="@drawable/ic_uploadimage" />
android:layout_height="70dp"
android:src="@drawable/stationeries" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="12sp"
android:fontFamily="@font/roboto_medium"
android:textColor="@color/theme_text_color_body"
android:gravity="center"
android:text="Stationeries"/>
</androidx.cardview.widget.CardView>

</androidx.constraintlayout.widget.ConstraintLayout>


<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="25dp">

<androidx.cardview.widget.CardView
android:id="@+id/cat_5"
android:layout_width="60dp"
android:layout_height="60dp"
android:backgroundTint="@color/theme_color_light"
app:cardCornerRadius="30dp"
android:layout_width="90dp"
android:layout_height="100dp"
app:layout_constraintEnd_toStartOf="@id/cat_6"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="13dp"
android:src="@drawable/ic_uploadimage" />
android:layout_height="70dp"
android:src="@drawable/shoes" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="12sp"
android:fontFamily="@font/roboto_medium"
android:textColor="@color/theme_text_color_body"
android:gravity="center"
android:text="Shoes"/>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/cat_6"
android:layout_width="60dp"
android:layout_height="60dp"
android:backgroundTint="@color/theme_color_light"
app:cardCornerRadius="30dp"
android:layout_width="90dp"
android:layout_height="100dp"
app:layout_constraintEnd_toStartOf="@id/cat_7"
app:layout_constraintStart_toEndOf="@id/cat_5"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="13dp"
android:src="@drawable/ic_uploadimage" />
android:layout_height="70dp"
android:src="@drawable/books" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="12sp"
android:fontFamily="@font/roboto_medium"
android:textColor="@color/theme_text_color_body"
android:gravity="center"
android:text="Books"/>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/cat_7"
android:layout_width="60dp"
android:layout_height="60dp"
android:backgroundTint="@color/theme_color_light"
app:cardCornerRadius="30dp"
android:layout_width="90dp"
android:layout_height="100dp"
app:layout_constraintEnd_toStartOf="@id/cat_8"
app:layout_constraintStart_toEndOf="@id/cat_6"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="13dp"
android:src="@drawable/ic_uploadimage" />
android:layout_height="70dp"
android:src="@drawable/food" />

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="12sp"
android:fontFamily="@font/roboto_medium"
android:textColor="@color/theme_text_color_body"
android:gravity="center"
android:text="Food-Items"/>
</androidx.cardview.widget.CardView>

<androidx.cardview.widget.CardView
android:id="@+id/cat_8"
android:layout_width="60dp"
android:layout_height="60dp"
android:backgroundTint="@color/theme_color_light"
app:cardCornerRadius="30dp"
android:layout_width="90dp"
android:layout_height="100dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/cat_7"
app:layout_constraintTop_toTopOf="parent">

<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="13dp"
android:src="@drawable/ic_uploadimage" />
android:layout_height="70dp"
android:src="@drawable/bags" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textSize="12sp"
android:fontFamily="@font/roboto_medium"
android:textColor="@color/theme_text_color_body"
android:gravity="center"
android:text="Bags"/>
</androidx.cardview.widget.CardView>

</androidx.constraintlayout.widget.ConstraintLayout>


<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="100dp"
Expand Down

0 comments on commit 1874316

Please sign in to comment.