Skip to content
Open
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 @@ -25,12 +25,16 @@ class MorePublicationsAdapter(
var publicationList: MutableList<Publication>,
private val prefUtils: PrefUtils,
private val mAdapterOnClickHandler: AdapterOnClickHandler?,
private val isOnboarding: Boolean = false) :
private val isOnboarding: Boolean = false,
private val mAdapterOnClicker:AdapterOnClicker?) :
RecyclerView.Adapter<MorePublicationsAdapter.MorePublicationVH>() {

interface AdapterOnClickHandler {
fun onFollowClick(wasFollowed: Boolean)
}
interface AdapterOnClicker{
fun onMorePublicationClicked(publication: Publication, isOnboarding: Boolean)
}

class MorePublicationVH(
val binding: ItemMorePublicationBinding
Expand Down Expand Up @@ -133,16 +137,7 @@ class MorePublicationsAdapter(
}

holder.binding.clPublicationLayout.setOnClickListener { view ->
val intent = Intent(view.context, PublicationProfileActivity::class.java)
intent.putExtra(Publication.INTENT_KEY, currentItem)
intent.putParcelableExtra(
NavigationSource.INTENT_KEY, if (isOnboarding) {
NavigationSource.ONBOARDING
} else {
NavigationSource.MORE_PUBLICATIONS
}
)
view.context.startActivity(intent)
mAdapterOnClicker?.onMorePublicationClicked(currentItem,isOnboarding)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import io.reactivex.schedulers.Schedulers
*
* @see {@link com.cornellappdev.volume.R.layout#fragment_onboarding_two}
*/
class OnboardingFragTwo : Fragment(), MorePublicationsAdapter.AdapterOnClickHandler {
class OnboardingFragTwo : Fragment(), MorePublicationsAdapter.AdapterOnClickHandler, MorePublicationsAdapter.AdapterOnClicker {

interface DataPassListener {
fun onPublicationFollowed(numFollowed: Int)
Expand Down Expand Up @@ -145,7 +145,7 @@ class OnboardingFragTwo : Fragment(), MorePublicationsAdapter.AdapterOnClickHand
publicationRV = onboardingBinding.rvPublications
with(publicationRV) {
adapter =
MorePublicationsAdapter(allPublicationsList, prefUtils, this@OnboardingFragTwo)
MorePublicationsAdapter(allPublicationsList, prefUtils, this@OnboardingFragTwo, mAdapterOnClicker = this@OnboardingFragTwo)
layoutManager = LinearLayoutManager(context)
setHasFixedSize(true)
}
Expand Down Expand Up @@ -173,4 +173,6 @@ class OnboardingFragTwo : Fragment(), MorePublicationsAdapter.AdapterOnClickHand
super.onDestroyView()
_binding = null
}

override fun onMorePublicationClicked(publication: Publication, isOnboarding: Boolean) = Unit
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import io.reactivex.schedulers.Schedulers
* @see {@link com.cornellappdev.volume.R.layout#fragment_publications}
*/
class PublicationsFragment : Fragment(), FollowingHorizontalAdapter.AdapterOnClickHandler,
MorePublicationsAdapter.AdapterOnClickHandler {
MorePublicationsAdapter.AdapterOnClickHandler, MorePublicationsAdapter.AdapterOnClicker {

private lateinit var resultLauncher: ActivityResultLauncher<Intent>
private lateinit var prefUtils: PrefUtils
Expand Down Expand Up @@ -319,7 +319,8 @@ class PublicationsFragment : Fragment(), FollowingHorizontalAdapter.AdapterOnCli
MorePublicationsAdapter(
morePublications,
prefUtils,
this@PublicationsFragment
this@PublicationsFragment,
mAdapterOnClicker = this@PublicationsFragment
)
layoutManager = LinearLayoutManager(context)
setHasFixedSize(true)
Expand Down Expand Up @@ -373,4 +374,19 @@ class PublicationsFragment : Fragment(), FollowingHorizontalAdapter.AdapterOnCli
override fun onFollowClick(wasFollowed: Boolean) {
setupPublicationsView(binding, isRefreshing = true)
}


override fun onMorePublicationClicked(publication: Publication, isOnboarding: Boolean) {
val intent = Intent(view?.context, PublicationProfileActivity::class.java)
intent.putExtra(Publication.INTENT_KEY, publication)
intent.putParcelableExtra(
NavigationSource.INTENT_KEY, if (isOnboarding) {
NavigationSource.ONBOARDING
} else {
NavigationSource.MORE_PUBLICATIONS
}
)
resultLauncher.launch(intent)
}

}
3 changes: 2 additions & 1 deletion app/src/main/res/layout/fragment_debrief_checkout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="110dp"
android:text="@string/x_h_ago"
android:text=""
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="@id/iv_article_image"
app:layout_constraintTop_toBottomOf="@id/iv_article_image" />
<!-- @string/x_h_ago-->

<TextView
android:id="@+id/tv_dot"
Expand Down
200 changes: 2 additions & 198 deletions app/src/main/res/layout/fragment_debrief_main.xml
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3612530a34a309e9c10cd8ad4c0b0a07d1cd09d7
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<<<<<<< HEAD
=======
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
>>>>>>> f4f8cd8 (Add main debrief fragment)
=======
>>>>>>> 3612530a34a309e9c10cd8ad4c0b0a07d1cd09d7

<ImageView
android:id="@+id/iv_volume_logo"
android:layout_width="244dp"
android:layout_height="76dp"
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3612530a34a309e9c10cd8ad4c0b0a07d1cd09d7
android:layout_marginTop="36dp"
android:contentDescription="@string/description_main_volume_logo"
app:layout_constraintLeft_toLeftOf="parent"
Expand All @@ -40,7 +23,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="@string/your_weekly_debrief"
android:text="@string/your_weekly_debrief_date"
android:textSize="17sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
Expand All @@ -57,51 +40,11 @@
android:textSize="16sp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="@+id/tv_your_debrief" />
<<<<<<< HEAD
=======
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="36dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:contentDescription="@string/description_main_volume_logo"
app:srcCompat="@drawable/volume_title"
tools:srcCompat="@drawable/volume_title"/>

<TextView
android:id="@+id/tv_your_debrief"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/iv_volume_logo"
android:layout_marginTop="16dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
style="@style/begum_black"
android:textSize="17sp"
android:text="@string/your_weekly_debrief"/>

<TextView
android:id="@+id/tv_in_the_past_week"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@+id/tv_your_debrief"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginTop="36dp"
android:layout_marginLeft="40dp"
style="@style/begum_black"
android:textSize="16sp"
android:text="@string/in_the_past_week"/>
>>>>>>> f4f8cd8 (Add main debrief fragment)
=======
>>>>>>> 3612530a34a309e9c10cd8ad4c0b0a07d1cd09d7

<ImageView
android:id="@+id/iv_volume_bars"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3612530a34a309e9c10cd8ad4c0b0a07d1cd09d7
android:layout_marginLeft="44dp"
android:layout_marginTop="26dp"
android:contentDescription="@string/description_volume_bars_logo"
Expand Down Expand Up @@ -146,64 +89,11 @@
app:layout_constraintBottom_toBottomOf="@id/tv_read"
app:layout_constraintLeft_toRightOf="@id/tv_number_articles_read"
app:layout_constraintTop_toTopOf="@id/tv_read" />
<<<<<<< HEAD
=======
app:layout_constraintTop_toBottomOf="@id/tv_in_the_past_week"
android:layout_marginTop="26dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="44dp"
android:contentDescription="@string/description_volume_bars_logo"
app:srcCompat="@drawable/volume_three_bars"
tools:srcCompat="@drawable/volume_three_bars"/>

<TextView
android:id="@+id/tv_read"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/iv_volume_bars"
app:layout_constraintBottom_toBottomOf="@id/iv_volume_bars"
app:layout_constraintLeft_toRightOf="@id/iv_volume_bars"
android:layout_marginLeft="26dp"
style="@style/begum_black"
android:textSize="17sp"
android:text="@string/read"/>

<TextView
android:id="@+id/tv_number_articles_read"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tv_read"
app:layout_constraintBottom_toBottomOf="@id/tv_read"
app:layout_constraintLeft_toRightOf="@id/tv_read"
android:layout_marginLeft="8dp"
style="@style/begum_black"
android:textColor="@color/volume_orange"
android:textSize="36sp"
android:text="@string/number_read_articles"/>

<TextView
android:id="@+id/read_articles"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tv_read"
app:layout_constraintBottom_toBottomOf="@id/tv_read"
app:layout_constraintLeft_toRightOf="@id/tv_number_articles_read"
android:layout_marginLeft="8dp"
style="@style/begum_black"
android:textSize="17sp"
android:text="@string/articles"/>
>>>>>>> f4f8cd8 (Add main debrief fragment)
=======
>>>>>>> 3612530a34a309e9c10cd8ad4c0b0a07d1cd09d7

<ImageView
android:id="@+id/iv_shoutout"
android:layout_width="24dp"
android:layout_height="24dp"
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 3612530a34a309e9c10cd8ad4c0b0a07d1cd09d7
android:layout_marginLeft="44dp"
android:layout_marginTop="26dp"
android:contentDescription="@string/description_shout_out_icon"
Expand Down Expand Up @@ -301,7 +191,7 @@
<TextView
android:id="@+id/tv_you_were_top"
style="@style/begum_black"
android:layout_width="wrap_content"
android:layout_width="250dp"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginTop="76dp"
Expand All @@ -322,91 +212,5 @@
android:textSize="36dp"
app:layout_constraintLeft_toRightOf="@id/tv_you_were_top"
app:layout_constraintTop_toTopOf="@id/tv_you_were_top" />
<<<<<<< HEAD
=======
app:layout_constraintTop_toBottomOf="@id/iv_volume_bars"
android:layout_marginTop="26dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="44dp"
android:contentDescription="@string/description_shout_out_icon"
app:srcCompat="@drawable/orange_shoutout"
tools:srcCompat="@drawable/orange_shoutout"/>

<TextView
android:id="@+id/tv_gave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/iv_shoutout"
app:layout_constraintBottom_toBottomOf="@id/iv_shoutout"
app:layout_constraintLeft_toRightOf="@id/iv_shoutout"
android:layout_marginLeft="26dp"
style="@style/begum_black"
android:textSize="17sp"
android:text="@string/gave"/>

<TextView
android:id="@+id/tv_number_articles_shouted"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tv_gave"
app:layout_constraintBottom_toBottomOf="@id/tv_gave"
app:layout_constraintLeft_toRightOf="@id/tv_gave"
android:layout_marginLeft="8dp"
style="@style/begum_black"
android:textColor="@color/volume_orange"
android:textSize="36sp"
android:text="@string/number_shouted_articles"/>

<TextView
android:id="@+id/shouts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/tv_gave"
app:layout_constraintBottom_toBottomOf="@id/tv_gave"
app:layout_constraintLeft_toRightOf="@id/tv_number_articles_shouted"
android:layout_marginLeft="8dp"
style="@style/begum_black"
android:textSize="17sp"
android:text="@string/shouts"/>

<!-- <ImageView-->
<!-- android:id="@+id/iv_bookmark_icon"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- app:layout_constraintTop_toBottomOf="@id/iv_shoutout"-->
<!-- android:layout_marginTop="26dp"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- android:layout_marginLeft="44dp"-->
<!-- android:contentDescription="@string/description_bookmark_icon"-->
<!-- app:srcCompat="@drawable/orange_bookmark_svg"-->
<!-- tools:srcCompat="@drawable/orange_bookmark_svg"/>-->

<TextView
android:id="@+id/you_were_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@+id/iv_shoutout"
android:layout_marginTop="76dp"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_marginLeft="40dp"
style="@style/begum_black"
android:textSize="17dp"
android:text="@string/you_were_top"/>

<TextView
android:id="@+id/tv_top_percent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="@id/you_were_top"
android:layout_marginTop="-18dp"
app:layout_constraintLeft_toRightOf="@id/you_were_top"
android:layout_marginLeft="8dp"
style="@style/begum_black"
android:textColor="@color/volume_orange"
android:textSize="36dp"
android:text="@string/top_percent"/>
>>>>>>> f4f8cd8 (Add main debrief fragment)
=======
>>>>>>> 3612530a34a309e9c10cd8ad4c0b0a07d1cd09d7

</androidx.constraintlayout.widget.ConstraintLayout>
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_debrief_share.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="110dp"
android:text="@string/x_h_ago"
android:text=""
android:textSize="14sp"
app:layout_constraintLeft_toLeftOf="@id/iv_article_image"
app:layout_constraintTop_toBottomOf="@id/iv_article_image" />

<!-- @string/x_h_ago-->
<TextView
android:id="@+id/tv_dot"
style="@style/lato_gray"
Expand Down
Loading