Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fc28e9a
wip added ui for poll func
KrishnaTech6 Jun 25, 2023
163bb27
update: ui for poll create and view
KrishnaTech6 Jun 27, 2023
620bd64
added create poll button in ViewDoubtsFragment
KrishnaTech6 Jun 27, 2023
cd6d5dd
view poll vieholder added , changes in ui
KrishnaTech6 Jun 28, 2023
16cea41
added poll view in main feed with multiple options, poll func WIP
KrishnaTech6 Jun 29, 2023
742efc2
poll vote WIP
KrishnaTech6 Jun 29, 2023
d89d9e4
fix fatal NPE for ViewDoubtViewModel (#73)
PratthamArora Jun 29, 2023
a3f8688
Added icon animations to upvote and downvote icons for Doubts and Ans…
PratthamArora Jun 29, 2023
7bc68f2
added create poll button in ViewDoubtsFragment
KrishnaTech6 Jun 27, 2023
2363a42
view poll vieholder added , changes in ui
KrishnaTech6 Jun 28, 2023
93c8459
added poll view in main feed with multiple options, poll func WIP
KrishnaTech6 Jun 29, 2023
fb31868
changes
KrishnaTech6 Jun 30, 2023
3935a35
changes
KrishnaTech6 Jun 30, 2023
9802125
fix fatal NPE for ViewDoubtViewModel (#73)
PratthamArora Jun 29, 2023
2d8d6b0
automatically close keyboard after search query is submitted (#70)
PratthamArora Jun 29, 2023
28c9cfb
bottom nav icons changes
Jun 25, 2023
aeca466
removed voting usecase from onBind
Jun 25, 2023
26a054f
on pressing back on bottom nav redirects to home frag
Jun 25, 2023
37c66c8
in app notif implemented
Jun 26, 2023
ae71a9e
Home Screen Filter Tags (#77)
Aditya13s Jun 29, 2023
67bbafb
development 0.1.4 merge fixes (#83)
sidsharma2002 Jun 29, 2023
0422c05
setted up year text (#85)
sidsharma2002 Jun 29, 2023
ce6a871
change tag analytics name (#84)
Aditya13s Jun 29, 2023
ec98ead
Badge Feature (#86)
Aditya13s Jul 1, 2023
a11e900
fixed feed refresh issue (#87)
Aditya13s Jul 4, 2023
d1c5b5d
UI revamp (#88)
sidsharma2002 Jul 11, 2023
f6b432a
image support in doubts and static thumbnail in user-profile
Jul 13, 2023
7b884c3
version change
Jul 13, 2023
7359167
wip added ui for poll func
KrishnaTech6 Jun 25, 2023
72bbc3c
update: ui for poll create and view
KrishnaTech6 Jun 27, 2023
024151e
added create poll button in ViewDoubtsFragment
KrishnaTech6 Jun 27, 2023
aee9b5d
view poll vieholder added , changes in ui
KrishnaTech6 Jun 28, 2023
e9d058b
added poll view in main feed with multiple options, poll func WIP
KrishnaTech6 Jun 29, 2023
a29b47c
changes
KrishnaTech6 Jul 16, 2023
f3799f6
changes
KrishnaTech6 Jul 17, 2023
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
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ android {
minSdk 28
targetSdk 33
versionCode 10
versionName "0.1.7"
versionName "0.1.7-poll"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ class FragNavigator constructor(

fun moveToCreatePollFragment(){
supportFragmentManager.beginTransaction()
.setCustomAnimations(
/* enter = */ R.anim.slide_in_right,
/* exit = */ R.anim.slide_out_left,
/* popEnter = */ R.anim.slide_in_left,
/* popExit = */ R.anim.slide_out_right)
.replace(containerId, CreatePollFragment())
.addToBackStack(null)
.setReorderingAllowed(true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.content.Intent
import com.doubtless.doubtless.screens.onboarding.OnBoardingActivity
import com.doubtless.doubtless.screens.auth.LoginActivity
import com.doubtless.doubtless.screens.main.MainActivity
import com.doubtless.doubtless.screens.poll.CreatePollFragment

class Router {

Expand All @@ -22,5 +23,4 @@ class Router {
val i = Intent(activity, OnBoardingActivity::class.java)
activity.startActivity(i)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class ViewDoubtsFragment : Fragment() {
}

override fun onCreatePollClicked() {

navigator.moveToCreatePollFragment()
}

override fun onPollOptionClicked(position: Int) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import kotlin.collections.set
class ViewDoubtsViewModel constructor(
private val fetchHomeFeedUseCase: FetchHomeFeedUseCase,
private val analyticsTracker: AnalyticsTracker,
private val userManager: UserManager
private val userManager: UserManager,
) : ViewModel() {

private val _homeEntities = mutableListOf<FeedEntity>()
Expand Down Expand Up @@ -88,32 +88,32 @@ class ViewDoubtsViewModel constructor(

val entitiesFromServer = mutableListOf<FeedEntity>()

val pollOptions = listOf("Krishna", "Sneha", "Dhiraj")
if (_homeEntities.isEmpty()) {
entitiesFromServer.add(FeedEntity.getOptionButtons())
entitiesFromServer.add(FeedEntity.getPollEntity(pollOptions))
}


result.data.forEach { doubtData ->
_homeEntities.addAll(entitiesFromServer)
_fetchedHomeEntities.postValue(Resource.Success(entitiesFromServer))
fetchHomeFeedUseCase.notifyDistinctDocsFetched(
docsFetched = homeEntities.size
)

isLoading = false
}


_homeEntities.addAll(entitiesFromServer)
_fetchedHomeEntities.postValue(Resource.Success(entitiesFromServer))
fetchHomeFeedUseCase.notifyDistinctDocsFetched(
docsFetched = homeEntities.size
- /* subtract one for search entity, ideally should have counted Type = Doubt size */ 1
)

isLoading = false
}
val pollOptions = listOf("Option 1", "Option 2", "Option 3")
// for page 1 call add search and options button entity
if (_homeEntities.isEmpty())
entitiesFromServer.add(0, FeedEntity.getSearchEntity())
if (_homeEntities.isEmpty())
entitiesFromServer.add(1, FeedEntity.getOptionButtons())
if(_homeEntities.isEmpty())
entitiesFromServer.add(6, FeedEntity.getPollEntity(pollOptions) )

_homeEntities.addAll(entitiesFromServer)
_fetchedHomeEntities.postValue(Resource.Success(entitiesFromServer))
fetchHomeFeedUseCase.notifyDistinctDocsFetched(
docsFetched = homeEntities.size
- /* subtract one for search entity, ideally should have counted Type = Doubt size */ 1
)
isLoading = false
}

fun refreshList(tag: String?) {
_homeEntities.clear()
Expand All @@ -125,7 +125,7 @@ class ViewDoubtsViewModel constructor(
class Factory constructor(
private val fetchHomeFeedUseCase: FetchHomeFeedUseCase,
private val analyticsTracker: AnalyticsTracker,
private val userManager: UserManager
private val userManager: UserManager,
) : ViewModelProvider.Factory {

override fun <T : ViewModel> create(modelClass: Class<T>): T {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,10 @@ data class FeedEntity(
) {
companion object {
const val TYPE_DOUBT = 1
const val TYPE_SEARCH = 2
const val TYPE_SEARCH_RESULT = 3
const val TYPE_USER_PROFILE = 4
const val TYPE_BUTTONS = 5
const val TYPE_POLL = 6

fun getSearchEntity(): FeedEntity {
return FeedEntity(TYPE_SEARCH, null, null)
}
const val TYPE_SEARCH_RESULT = 2
const val TYPE_USER_PROFILE = 3
const val TYPE_BUTTONS = 4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this type buttons?

const val TYPE_POLL = 5

fun getOptionButtons(): FeedEntity{
return FeedEntity(TYPE_BUTTONS, null, null)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.doubtless.doubtless.screens.poll

data class PollData(
val id: String? = null,
val pollOptions: List<String>? = null,
val pollOptionVotes: List<String>? = null,
val totalVotes: String? = null,

)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.doubtless.doubtless.screens.poll

class PollFuncUseCase {
}