-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from Diversion2k22/HazArdDonationInfo
Rearranged the kotlin files in packages
- Loading branch information
Showing
27 changed files
with
395 additions
and
216 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
36 changes: 0 additions & 36 deletions
36
app/src/main/java/com/hazard/samarpan/DashboardFragment.kt
This file was deleted.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
app/src/main/java/com/hazard/samarpan/adapters/ClothAdapter.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,32 @@ | ||
package com.hazard.samarpan.adapters | ||
|
||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import android.widget.ImageView | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.hazard.samarpan.R | ||
|
||
class ClothAdapter(private var clothList: ArrayList<Int>) : | ||
RecyclerView.Adapter<ClothAdapter.ViewHolder>() { | ||
|
||
override fun getItemCount() = clothList.size | ||
|
||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
holder.clothImage.setImageDrawable(holder.itemView.context.getDrawable(clothList[position])) | ||
|
||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
val view: View = LayoutInflater.from(parent.context) | ||
.inflate(R.layout.clothing_item_dashboard, parent, false) | ||
return ViewHolder(view) | ||
} | ||
|
||
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { | ||
var clothImage: ImageView = itemView.findViewById(R.id.cloth_image) | ||
|
||
|
||
} | ||
} | ||
|
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
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
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
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/hazard/samarpan/user/DonationInfoFragment.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,23 @@ | ||
package com.hazard.samarpan.user | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.hazard.samarpan.R | ||
|
||
class DonationInfoFragment: Fragment() { | ||
|
||
private var itemView: View? = null | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
itemView=layoutInflater.inflate(R.layout.donation_info_fragment,container,false) | ||
|
||
return itemView | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/hazard/samarpan/user/UserDashboardFragment.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,46 @@ | ||
package com.hazard.samarpan.user | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.google.android.material.floatingactionbutton.FloatingActionButton | ||
import com.hazard.samarpan.adapters.ClothAdapter | ||
import com.hazard.samarpan.R | ||
|
||
class UserDashboardFragment : Fragment() { | ||
|
||
private lateinit var clothRecycler: RecyclerView | ||
private var donate: FloatingActionButton?= null | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, | ||
container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View? { | ||
|
||
val v = layoutInflater.inflate(R.layout.user_dashboard_fragment, container, false) | ||
|
||
donate = v.findViewById(R.id.btnDonate) | ||
|
||
var clothList: ArrayList<Int> = ArrayList() | ||
for (i in 1..15) { | ||
clothList.add(R.drawable.ic_uploadimage) | ||
} | ||
clothRecycler = v.findViewById(R.id.clothing_recycler) | ||
clothRecycler.layoutManager = | ||
LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false) | ||
clothRecycler.adapter = ClothAdapter(clothList) | ||
|
||
|
||
donate?.setOnClickListener { | ||
val donationInfo= DonationInfoFragment() | ||
activity?.supportFragmentManager?.beginTransaction()?.replace(R.id.fragment_container2,donationInfo)?.commit() | ||
} | ||
return v | ||
|
||
} | ||
} |
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
Oops, something went wrong.