diff --git a/.gradle/7.2/executionHistory/executionHistory.bin b/.gradle/7.2/executionHistory/executionHistory.bin
index 5d98c86..f0b2b38 100644
Binary files a/.gradle/7.2/executionHistory/executionHistory.bin and b/.gradle/7.2/executionHistory/executionHistory.bin differ
diff --git a/.gradle/7.2/executionHistory/executionHistory.lock b/.gradle/7.2/executionHistory/executionHistory.lock
index e434d92..4c03e61 100644
Binary files a/.gradle/7.2/executionHistory/executionHistory.lock and b/.gradle/7.2/executionHistory/executionHistory.lock differ
diff --git a/.gradle/7.2/fileHashes/fileHashes.bin b/.gradle/7.2/fileHashes/fileHashes.bin
index 11d08e1..a618931 100644
Binary files a/.gradle/7.2/fileHashes/fileHashes.bin and b/.gradle/7.2/fileHashes/fileHashes.bin differ
diff --git a/.gradle/7.2/fileHashes/fileHashes.lock b/.gradle/7.2/fileHashes/fileHashes.lock
index 3ecc1b9..d9bed9c 100644
Binary files a/.gradle/7.2/fileHashes/fileHashes.lock and b/.gradle/7.2/fileHashes/fileHashes.lock differ
diff --git a/.gradle/7.2/fileHashes/resourceHashesCache.bin b/.gradle/7.2/fileHashes/resourceHashesCache.bin
index bfba9cc..5169f45 100644
Binary files a/.gradle/7.2/fileHashes/resourceHashesCache.bin and b/.gradle/7.2/fileHashes/resourceHashesCache.bin differ
diff --git a/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/.gradle/buildOutputCleanup/buildOutputCleanup.lock
index dcb8a12..85e26ac 100644
Binary files a/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
diff --git a/.gradle/buildOutputCleanup/outputFiles.bin b/.gradle/buildOutputCleanup/outputFiles.bin
index cecc769..fd81a4d 100644
Binary files a/.gradle/buildOutputCleanup/outputFiles.bin and b/.gradle/buildOutputCleanup/outputFiles.bin differ
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 706844f..7c71af9 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -6,15 +6,16 @@
-
+
-
+
+
-
+
diff --git a/.idea/navEditor.xml b/.idea/navEditor.xml
index 3797663..4165cb8 100644
--- a/.idea/navEditor.xml
+++ b/.idea/navEditor.xml
@@ -176,15 +176,36 @@
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 1d894f7..a81b65d 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -14,15 +14,24 @@
-
+
+
+
+
+
+
+
-
+
+
+
+
@@ -74,10 +83,10 @@
-
+
@@ -122,6 +131,8 @@
+
+
@@ -447,7 +458,21 @@
1649683396869
-
+
+ 1649684325481
+
+
+
+ 1649684325481
+
+
+ 1649947921894
+
+
+
+ 1649947921894
+
+
@@ -536,6 +561,8 @@
-
+
+
+
\ No newline at end of file
diff --git a/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/customViews/RoundedFrameLayout.kt b/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/customViews/RoundedFrameLayout.kt
new file mode 100644
index 0000000..67fb5c3
--- /dev/null
+++ b/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/customViews/RoundedFrameLayout.kt
@@ -0,0 +1,102 @@
+package com.github.bgrebennikov.devbuff.presentation.ui.customViews
+
+import android.content.Context
+import android.graphics.Canvas
+import android.graphics.Path
+import android.graphics.RectF
+import android.util.AttributeSet
+import android.widget.FrameLayout
+import com.github.bgrebennikov.devbuff.R
+
+class RoundedFrameLayout @JvmOverloads constructor(
+ context: Context,
+ attrs: AttributeSet? = null,
+ defStyle: Int = 0
+) : FrameLayout(
+ context, attrs, defStyle
+) {
+
+ private var path: Path? = null
+ private var cornerTopLeftRadius: Int = 0
+ private var cornerTopRightRadius: Int = 0
+ private var cornerBottomLeftRadius: Int = 0
+ private var cornerBottomRightRadius: Int = 0
+
+ init {
+ val a = context.theme.obtainStyledAttributes(
+ attrs, R.styleable.RoundedFrameLayout,
+ 0, 0
+ )
+
+ val cornersRadius = a.getDimensionPixelSize(R.styleable.RoundedFrameLayout_cornerRadius, 0)
+
+ cornerTopLeftRadius = a.getDimensionPixelSize(R.styleable.RoundedFrameLayout_cornerRadiusTopLeft, cornersRadius)
+ cornerTopRightRadius = a.getDimensionPixelSize(R.styleable.RoundedFrameLayout_cornerRadiusTopRight, cornersRadius)
+ cornerBottomLeftRadius = a.getDimensionPixelSize(R.styleable.RoundedFrameLayout_cornerRadiusBottomLeft, cornersRadius)
+ cornerBottomRightRadius = a.getDimensionPixelSize(R.styleable.RoundedFrameLayout_cornerRadiusBottomRight, cornersRadius)
+
+ a.recycle()
+
+ }
+
+ fun setCornersRadius(radius: Int){
+ cornerTopLeftRadius = radius
+ cornerTopRightRadius = radius
+ cornerBottomLeftRadius = radius
+ cornerBottomRightRadius = radius
+
+ invalidate()
+ }
+
+ fun setCornersRadiusTopLeft(radius: Int){
+ cornerTopLeftRadius = radius
+ invalidate()
+ }
+
+ fun setCornersRadiusTopRight(radius: Int){
+ cornerTopRightRadius = radius
+ invalidate()
+ }
+
+ fun setCornersRadiusBottomLeft(radius: Int){
+ cornerBottomLeftRadius = radius
+ invalidate()
+ }
+
+ fun setCornersRadiusBottomRight(radius: Int){
+ cornerBottomRightRadius = radius
+ invalidate()
+ }
+
+ override fun draw(canvas: Canvas) {
+ canvas.save()
+ path?.let {
+ canvas.clipPath(it)
+ }
+ super.draw(canvas)
+ canvas.restore()
+ }
+
+ override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) {
+ super.onSizeChanged(w, h, oldw, oldh)
+
+ val rect = RectF(0f, 0f, w.toFloat(), h.toFloat())
+ path = Path().apply {
+ addRoundRect(
+ rect, floatArrayOf(
+ cornerTopLeftRadius.toFloat(),
+ cornerTopLeftRadius.toFloat(),
+ cornerTopRightRadius.toFloat(),
+ cornerTopRightRadius.toFloat(),
+ cornerBottomLeftRadius.toFloat(),
+ cornerBottomLeftRadius.toFloat(),
+ cornerBottomRightRadius.toFloat(),
+ cornerBottomRightRadius.toFloat()
+ ), Path.Direction.CW
+ )
+ close()
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/fragments/ApplyIdeaFragment.kt b/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/fragments/ApplyIdeaFragment.kt
new file mode 100644
index 0000000..ee9fe03
--- /dev/null
+++ b/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/fragments/ApplyIdeaFragment.kt
@@ -0,0 +1,46 @@
+package com.github.bgrebennikov.devbuff.presentation.ui.fragments
+
+import android.app.Dialog
+import android.content.res.Configuration
+import android.os.Bundle
+import androidx.fragment.app.Fragment
+import android.view.LayoutInflater
+import android.view.View
+import android.view.ViewGroup
+import androidx.fragment.app.DialogFragment
+import com.github.bgrebennikov.devbuff.R
+import com.github.bgrebennikov.devbuff.databinding.FragmentApplyIdeaBinding
+import com.google.android.material.bottomsheet.BottomSheetBehavior
+import com.google.android.material.bottomsheet.BottomSheetDialogFragment
+
+
+class ApplyIdeaFragment : BottomSheetDialogFragment() {
+
+ private var _binding: FragmentApplyIdeaBinding? = null
+ val binding get() = _binding!!
+
+
+ override fun onCreateView(
+ inflater: LayoutInflater,
+ container: ViewGroup?,
+ savedInstanceState: Bundle?
+ ): View {
+ _binding = FragmentApplyIdeaBinding.inflate(inflater, container, false)
+ return binding.root
+ }
+
+ override fun onStart() {
+ super.onStart()
+ val behavior = BottomSheetBehavior.from(requireView().parent as View)
+ behavior.skipCollapsed = false
+ if(resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE){
+ behavior.state = BottomSheetBehavior.STATE_EXPANDED
+ }
+ }
+
+ override fun onDestroyView() {
+ super.onDestroyView()
+ _binding = null
+ }
+
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/fragments/IdeaDetailsFragment.kt b/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/fragments/IdeaDetailsFragment.kt
index 50e18fe..42943ed 100644
--- a/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/fragments/IdeaDetailsFragment.kt
+++ b/app/src/main/java/com/github/bgrebennikov/devbuff/presentation/ui/fragments/IdeaDetailsFragment.kt
@@ -8,6 +8,7 @@ import android.widget.Toast
import androidx.navigation.fragment.findNavController
import androidx.navigation.fragment.navArgs
import com.github.bgrebennikov.devbuff.common.TAG
+import com.github.bgrebennikov.devbuff.common.extensions.findMainNavController
import com.github.bgrebennikov.devbuff.data.local.explore.Status
import com.github.bgrebennikov.devbuff.databinding.FragmentIdeaDetailsBinding
import com.github.bgrebennikov.devbuff.presentation.ui.adapters.explore.ideaDetails.IdeaSpecialistsAdapter
@@ -18,9 +19,9 @@ class IdeaDetailsFragment : BaseFragment(
FragmentIdeaDetailsBinding::inflate
) {
- private val args : IdeaDetailsFragmentArgs by navArgs()
+ private val args: IdeaDetailsFragmentArgs by navArgs()
- private val ideaInfo by lazy{
+ private val ideaInfo by lazy {
args.ideaInfo
}
@@ -42,13 +43,13 @@ class IdeaDetailsFragment : BaseFragment(
binding.alreadyLoadedInfo = ideaInfo
Log.i(TAG, "onViewCreated: $ideaInfo")
- with(binding.ideaSpecialistsList){
- adapter = adapterSpecialists
- }
+// with(binding.ideaSpecialistsList){
+// adapter = adapterSpecialists
+// }
- viewModel.loadSingleIdea(ideaInfo.id).observe(viewLifecycleOwner){
+ viewModel.loadSingleIdea(ideaInfo.id).observe(viewLifecycleOwner) {
it.let { apiResponse ->
- when(apiResponse.status){
+ when (apiResponse.status) {
Status.LOADING -> {
binding.isLoading = true
@@ -58,6 +59,7 @@ class IdeaDetailsFragment : BaseFragment(
binding.isLoading = false
binding.ideaInfo = idea
adapterSpecialists.items = idea.specialist
+ handleJoinClick()
}
Status.ERROR -> apiResponse.message?.let { error ->
@@ -76,8 +78,16 @@ class IdeaDetailsFragment : BaseFragment(
}
-
-
+ private fun handleJoinClick() {
+ with(binding.ideaJoinBtn){
+ setOnClickListener {
+ findMainNavController().navigate(
+ IdeaDetailsFragmentDirections
+ .actionIdeaDetailsFragmentToApplyIdeaFragment()
+ )
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/bg_rect_rounded_white.xml b/app/src/main/res/drawable/bg_rect_rounded_white.xml
index 9a9a882..a659341 100644
--- a/app/src/main/res/drawable/bg_rect_rounded_white.xml
+++ b/app/src/main/res/drawable/bg_rect_rounded_white.xml
@@ -3,7 +3,10 @@
android:shape="rectangle"
>
-
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_apply_idea.xml b/app/src/main/res/layout/fragment_apply_idea.xml
new file mode 100644
index 0000000..7a23399
--- /dev/null
+++ b/app/src/main/res/layout/fragment_apply_idea.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_idea_details.xml b/app/src/main/res/layout/fragment_idea_details.xml
index ae3f701..0fc4843 100644
--- a/app/src/main/res/layout/fragment_idea_details.xml
+++ b/app/src/main/res/layout/fragment_idea_details.xml
@@ -26,11 +26,14 @@
app:layoutDescription="@xml/fragment_idea_details_xml_scene"
tools:context=".presentation.ui.fragments.IdeaDetailsFragment">
+
+ tools:layout_editor_absoluteY="98dp"
+ tools:src="@raw/sample_image" />
+ android:layout_height="wrap_content">
+
-
-
-
-
+ tools:text="@string/lorem_ipsum" />
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/navigation/nav_user_explore.xml b/app/src/main/res/navigation/nav_user_explore.xml
index 72da84e..0a15238 100644
--- a/app/src/main/res/navigation/nav_user_explore.xml
+++ b/app/src/main/res/navigation/nav_user_explore.xml
@@ -22,5 +22,13 @@
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml
index 6111daf..b016ecc 100644
--- a/app/src/main/res/values/attrs.xml
+++ b/app/src/main/res/values/attrs.xml
@@ -10,4 +10,12 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/xml/fragment_idea_details_xml_scene.xml b/app/src/main/res/xml/fragment_idea_details_xml_scene.xml
index efd8818..6504d4f 100644
--- a/app/src/main/res/xml/fragment_idea_details_xml_scene.xml
+++ b/app/src/main/res/xml/fragment_idea_details_xml_scene.xml
@@ -9,6 +9,7 @@
motion:duration="1000">
+