Skip to content

Commit

Permalink
New communities
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaailashsharma authored and HeyfromNandini committed Nov 25, 2023
1 parent c0e27cd commit 74ad980
Show file tree
Hide file tree
Showing 45 changed files with 869 additions and 73 deletions.
6 changes: 6 additions & 0 deletions .idea/other.xml

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

5 changes: 5 additions & 0 deletions app/src/main/java/app/waste2wealth/com/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ import app.waste2wealth.com.login.onboarding.SmsBroadcastReceiver
import app.waste2wealth.com.login.onboarding.SmsBroadcastReceiver.SmsBroadcastReceiverListener
import app.waste2wealth.com.navigation.NavigationController
import app.waste2wealth.com.navigation.Screens
import app.waste2wealth.com.newcommunities.CommunitiesScreen
import app.waste2wealth.com.ui.theme.Waste2WealthTheme
import app.waste2wealth.com.ui.theme.appBackground
import com.google.accompanist.navigation.animation.rememberAnimatedNavController
import com.google.accompanist.permissions.ExperimentalPermissionsApi
import com.google.accompanist.permissions.rememberMultiplePermissionsState
import com.google.accompanist.systemuicontroller.rememberSystemUiController
import com.google.android.gms.auth.api.phone.SmsRetriever
import com.google.android.play.integrity.internal.c
import dagger.hilt.android.AndroidEntryPoint
import javax.annotation.Nullable

Expand Down Expand Up @@ -99,12 +101,15 @@ class MainActivity : ComponentActivity() {
val scaffoldState = rememberScaffoldState()
val client = SmsRetriever.getClient(this)
client.startSmsUserConsent(null)
println(it)

NavigationController(
scaffoldState,
locationViewModel,
navController,
it
)

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import app.waste2wealth.com.ui.theme.textColor
import com.jet.firestore.JetFirestore
import com.jet.firestore.getListOfObjects
import app.waste2wealth.com.communities.CommunitiesViewModel
import app.waste2wealth.com.newcommunities.CommunitiesScreen
import app.waste2wealth.com.profile.ProfileImage
import app.waste2wealth.com.ui.theme.CardColor
import app.waste2wealth.com.ui.theme.CardTextColor
Expand Down Expand Up @@ -235,83 +236,88 @@ fun CommunitiesSection(
expanded = true
},
) {
ExposedDropdownMenuBox(
modifier = Modifier,
expanded = expanded,
onExpandedChange = { expanded = it }
) {
Row(
verticalAlignment = Alignment.Bottom,
modifier = Modifier,
) {
Text(
text = selectedType,
color = textColor,
fontSize = 30.sp,
fontFamily = monteBold,
)
Icon(
imageVector = Icons.Default.ArrowDropDown,
contentDescription = null,
tint = textColor,
modifier = Modifier
.size(25.dp)
.padding(bottom = 7.dp)
)
}

DropdownMenu(
expanded = expanded,
onDismissRequest = { expanded = false },
modifier = Modifier
.weight(1f)
.background(appBackground)
) {
typeOfCommunities.forEach { type ->
DropdownMenuItem(
onClick = {
selectedType = type
expanded = false
}
) {
Text(
text = type,
color = textColor
)
}
}
}
}
// ExposedDropdownMenuBox(
// modifier = Modifier,
// expanded = expanded,
// onExpandedChange = { expanded = it }
// ) {
// Row(
// verticalAlignment = Alignment.Bottom,
// modifier = Modifier,
// ) {
// Text(
// text = selectedType,
// color = textColor,
// fontSize = 30.sp,
// fontFamily = monteBold,
// )
// Icon(
// imageVector = Icons.Default.ArrowDropDown,
// contentDescription = null,
// tint = textColor,
// modifier = Modifier
// .size(25.dp)
// .padding(bottom = 7.dp)
// )
// }
//
// DropdownMenu(
// expanded = expanded,
// onDismissRequest = { expanded = false },
// modifier = Modifier
// .weight(1f)
// .background(appBackground)
// ) {
// typeOfCommunities.forEach { type ->
// DropdownMenuItem(
// onClick = {
// selectedType = type
// expanded = false
// }
// ) {
// Text(
// text = type,
// color = textColor
// )
// }
// }
// }
// }
}
Row(
modifier = Modifier
.fillMaxWidth()
.padding(top = 15.dp, end = 0.dp, start = 20.dp),
horizontalArrangement = Arrangement.End,
.padding(top = 15.dp),
horizontalArrangement = Arrangement.Center,
verticalAlignment = Alignment.CenterVertically
) {
Row(
modifier = Modifier.padding(end = 25.dp),
modifier = Modifier,
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.End
horizontalArrangement = Arrangement.Center
) {
Icon(
painter = painterResource(id = R.drawable.coins),
contentDescription = "coins",
modifier = Modifier
.size(30.dp)
.padding(end = 5.dp),
tint = Color.Unspecified
)
AutoResizedText(
text = pointsEarned.toString(),
color = textColor,
fontSize = 15.sp,
softWrap = false,
fontFamily = monteNormal,
)
// Icon(
// painter = painterResource(id = R.drawable.coins),
// contentDescription = "coins",
// modifier = Modifier
// .size(30.dp)
// .padding(end = 5.dp),
// tint = Color.Unspecified
// )
// AutoResizedText(
// text = pointsEarned.toString(),
// color = textColor,
// fontSize = 15.sp,
// softWrap = false,
// fontFamily = monteNormal,
// )
Text(
text = "Communities Events",
color = textColor,
fontSize = 30.sp,
fontWeight = FontWeight.SemiBold
)
}

}
}
}
Expand Down Expand Up @@ -411,7 +417,7 @@ fun CommunitiesSection(
}

}
Pager2(
CommunitiesScreen(
viewModel,
progress2,
paddingValues,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ import app.waste2wealth.com.UserDatastore
import app.waste2wealth.com.collectwaste.CollectWaste
import app.waste2wealth.com.collectwaste.CollectWasteInfo
import app.waste2wealth.com.collectwaste.SuccessfullyCollected
import app.waste2wealth.com.communities.CommunitiesViewModel
import app.waste2wealth.com.communities.ui.CommunitiesSection
import app.waste2wealth.com.dashboard.NewDashboard
import app.waste2wealth.com.location.LocationViewModel
import app.waste2wealth.com.login.CompleteProfile
import app.waste2wealth.com.login.LoginPage
import app.waste2wealth.com.login.onboarding.Onboarding
import app.waste2wealth.com.login.onboarding.SettingUp
import app.waste2wealth.com.newcommunities.CommunityInfo
import app.waste2wealth.com.profile.NewProfileScreen
import app.waste2wealth.com.reportwaste.ReportWaste
import app.waste2wealth.com.reportwaste.ReportWasteViewModel
Expand Down Expand Up @@ -142,11 +144,12 @@ fun NavigationController(

}
composable(Screens.Community.route) {
CommunitiesSection(
paddingValues = paddingValues,
email = email.value,
name = name.value,
)
// CommunitiesSection(
// paddingValues = paddingValues,
// email = email.value,
// name = name.value,
// )
CommunityInfo()
}
composable(Screens.ReportWaste.route) {
ReportWaste(
Expand Down
Loading

0 comments on commit 74ad980

Please sign in to comment.