Skip to content

Commit

Permalink
Merge pull request #150 from DimensionSrl/feature/updates
Browse files Browse the repository at this point in the history
Meet tab updates
  • Loading branch information
RudiThoeni authored Dec 3, 2024
2 parents 2958960 + b737b52 commit a83354b
Show file tree
Hide file tree
Showing 40 changed files with 1,079 additions and 500 deletions.
18 changes: 18 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 14 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
android {

namespace "it.bz.noi.community"
compileSdk 34
compileSdk 35

// Version Code - Start
def Properties versionProps = new Properties()
Expand All @@ -31,7 +31,7 @@ android {
defaultConfig {
applicationId "it.bz.noi.community"
minSdkVersion 24
targetSdkVersion 33
targetSdkVersion 34
versionCode code
versionName "1.0.0"

Expand Down Expand Up @@ -89,26 +89,23 @@ android {
}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
testImplementation 'junit:junit:4.13.2'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1'

// DataStore Preferences
implementation("androidx.datastore:datastore-preferences:1.0.0")
implementation("androidx.datastore:datastore-preferences:1.1.1")

// Android LifeCycle
def lifecycle_version = "2.6.2"
def lifecycle_version = "2.8.7"
implementation "androidx.lifecycle:lifecycle-common:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
Expand All @@ -119,10 +116,10 @@ dependencies {
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.google.code.gson:gson:2.10.1'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'

// Kotlin Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0'

// Glide
implementation 'com.github.bumptech.glide:glide:4.16.0'
Expand All @@ -132,10 +129,10 @@ dependencies {
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"

// Paging 3
implementation "androidx.paging:paging-runtime-ktx:3.2.1"
implementation "androidx.paging:paging-runtime-ktx:3.3.4"

// BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:32.6.0')
implementation platform('com.google.firebase:firebase-bom:33.6.0')
// When using the BoM, you don't specify versions in Firebase library dependencies
implementation 'com.google.firebase:firebase-crashlytics-ktx'
implementation 'com.google.firebase:firebase-messaging-ktx'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enum class AccountType(val code: String? = null) {

fun Account.getAccountType(): AccountType {
val categories = type.split(",")
AccountType.values().forEach {
AccountType.entries.forEach {
if (categories.contains(it.code))
return it
}
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/java/it/bz/noi/community/ui/FilterViewHolder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ class HeaderViewHolder(private val binding: VhHeaderBinding) : RecyclerView.View
fun bind(header: String) {
binding.headerTextView.text = header
}

}

class FilterViewHolder(private val binding: VhSwitchBinding, updateResultsListener: UpdateResultsListener, exclusive: Boolean = false) : RecyclerView.ViewHolder(binding.root) {
Expand All @@ -30,7 +29,7 @@ class FilterViewHolder(private val binding: VhSwitchBinding, updateResultsListen
if (exclusive && filter.checked)
turnOffOtherSwitch()

updateResultsListener.updateResults()
updateResultsListener.updateResults(filter)
}
}

Expand All @@ -46,7 +45,6 @@ class FilterViewHolder(private val binding: VhSwitchBinding, updateResultsListen
switch.callOnClick()
}
}

}
}
}
Expand All @@ -61,5 +59,5 @@ class FilterViewHolder(private val binding: VhSwitchBinding, updateResultsListen
}

interface UpdateResultsListener {
fun updateResults()
fun updateResults(filter: FilterValue)
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,22 @@ import it.bz.noi.community.ui.ViewModelFactory
import it.bz.noi.community.ui.WebViewFragment
import it.bz.noi.community.ui.today.events.EventClickListener
import it.bz.noi.community.ui.today.events.EventsAdapter
import it.bz.noi.community.ui.today.events.EventsItemDecoration
import it.bz.noi.community.utils.DateUtils
import it.bz.noi.community.utils.Status
import it.bz.noi.community.utils.Utils
import it.bz.noi.community.utils.Utils.getEventDescription
import it.bz.noi.community.utils.Utils.getEventName
import it.bz.noi.community.utils.Utils.getEventOrganizer
import it.bz.noi.community.utils.Utils.getImageUrl
import kotlinx.coroutines.ExperimentalCoroutinesApi
import java.util.*

@OptIn(ExperimentalCoroutinesApi::class)
class EventDetailsFragment : Fragment(), EventClickListener {
private lateinit var binding: FragmentEventDetailsBinding

private var _binding: FragmentEventDetailsBinding? = null
private val binding get() = _binding!!

private val args: EventDetailsFragmentArgs by navArgs()

Expand Down Expand Up @@ -93,19 +98,25 @@ class EventDetailsFragment : Fragment(), EventClickListener {
postponeEnterTransition()
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View {
binding = FragmentEventDetailsBinding.inflate(inflater)
_binding = FragmentEventDetailsBinding.inflate(inflater)
return binding.root
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

binding.rvSuggestedEvents.apply {
addItemDecoration(EventsItemDecoration())
layoutManager = LinearLayoutManager(requireContext(), HORIZONTAL, false)
adapter = suggestedEventsAdapter

Expand Down
16 changes: 16 additions & 0 deletions app/src/main/java/it/bz/noi/community/ui/meet/CategoryFilter.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
package it.bz.noi.community.ui.meet

import it.bz.noi.community.data.models.AccountType

/**
* The category filter for the meet filters.
*/
enum class CategoryFilter(val types: List<AccountType>) {
ALL(listOf()),
COMPANY(listOf(AccountType.COMPANY)),
STARTUP(listOf(AccountType.STARTUP)),
RESEARCH_INSTITUTION(listOf(AccountType.RESEARCH_INSTITUTION))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
package it.bz.noi.community.ui.meet

import it.bz.noi.community.data.models.Contact

interface ContactDetailListener {
fun openContactDetail(contact: Contact)
}
30 changes: 30 additions & 0 deletions app/src/main/java/it/bz/noi/community/ui/meet/ContactVH.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// SPDX-FileCopyrightText: NOI Techpark <digital@noi.bz.it>
//
// SPDX-License-Identifier: AGPL-3.0-or-later
package it.bz.noi.community.ui.meet

import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import it.bz.noi.community.data.models.Contact
import it.bz.noi.community.databinding.VhContactBinding

class ContactVH(private val binding: VhContactBinding, detailListener: ContactDetailListener) : RecyclerView.ViewHolder(binding.root) {

private lateinit var contact: Contact

init {
binding.root.setOnClickListener {
detailListener.openContactDetail(contact)
}
}

fun bind(c: Contact) {
contact = c

binding.contactName.text = c.fullName
binding.companyName.text = c.companyName
binding.companyName.isVisible = c.companyName != null
binding.contactIcon.text = "${c.firstName[0]}${c.lastName[0]}"
}

}
Loading

0 comments on commit a83354b

Please sign in to comment.