Skip to content

Commit

Permalink
1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
muramrr committed Dec 30, 2020
1 parent f41959a commit af4eaeb
Show file tree
Hide file tree
Showing 22 changed files with 195 additions and 126 deletions.
12 changes: 12 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ["https://www.patreon.com/muramrr", "https://www.donationalerts.com/r/muramrr"]
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
# roove [![GitHub license](https://img.shields.io/github/license/muramrr/roove)](https://github.com/muramrr/roove/blob/master/LICENSE) [![](https://img.shields.io/badge/minSDK-21-blue)](https://shields.io/) [![](https://img.shields.io/badge/TargetSDK-29-green)](https://shields.io/)

A simple dating app based on tinder-style cards.


Used libraries/patterns:
**Dating app with tinder-style cards & choosing place for a date.**

*Note: this app doesn't use GPS or other systems to obtain user real physical location*

![Logo](https://github.com/muramrr/roove/blob/master/media/roove_logo_1024_500.png)


### Used libraries/patterns:
* MVVM pattern;
* Dagger 2;
* RxJava 2;
Expand All @@ -16,7 +22,9 @@ Used libraries/patterns:
* Facebook SDK to login.


![Logo](https://github.com/muramrr/roove/blob/master/media/roove_logo_256.png)
[![](https://github.com/muramrr/roove/blob/master/media/google-play-badge.png)](https://play.google.com/store/apps/details?id=com.mmdev.roove)



### Setup

Expand Down
22 changes: 11 additions & 11 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Created by Andrii Kovalchuk
* Copyright (c) 2020. All rights reserved.
* Last modified 08.04.20 17:44
* Last modified 03.07.20 20:31
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -64,8 +64,8 @@ android {
jvmTarget = JavaVersion.VERSION_1_8
}

dataBinding {
enabled true
buildFeatures {
dataBinding = true
}

kapt {
Expand All @@ -87,11 +87,11 @@ dependencies {
implementation project(':data')

//core
implementation 'androidx.core:core-ktx:1.3.0-beta01'
implementation 'androidx.core:core-ktx:1.5.0-alpha01'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0-beta01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'com.google.android.material:material:1.2.0-alpha02'
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta6'
implementation 'com.google.android.material:material:1.3.0-alpha01'

//custom UI
implementation 'com.yuyakaido.android:card-stack-view:2.3.4'
Expand All @@ -103,11 +103,11 @@ dependencies {
implementation libs.firebaseCore
implementation libs.firestorage
implementation libs.firestore
implementation 'com.google.firebase:firebase-messaging:20.1.5'
implementation 'com.google.firebase:firebase-messaging:20.2.1'
//firebase analytics
implementation 'com.google.firebase:firebase-analytics:17.3.0'
implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta03'
implementation 'com.google.firebase:firebase-perf:19.0.5'
implementation 'com.google.firebase:firebase-analytics:17.4.3'
implementation 'com.google.firebase:firebase-crashlytics:17.1.0'
implementation 'com.google.firebase:firebase-perf:19.0.7'


//facebook auth
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Created by Andrii Kovalchuk
* Copyright (c) 2020. All rights reserved.
* Last modified 02.04.20 17:36
* Last modified 03.07.20 20:30
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -62,15 +62,15 @@ class RegistrationFragment: BaseFragment<AuthViewModel>(true){

override fun onAttach(context: Context) {
super.onAttach(context)
cityList = mapOf(getString(R.string.russia_ekb) to "ekb",
getString(R.string.russia_krasnoyarsk) to "krasnoyarsk",
getString(R.string.russia_krd) to "krd",
getString(R.string.russia_kzn) to "kzn",
getString(R.string.russia_msk) to "msk",
getString(R.string.russia_nnv) to "nnv",
getString(R.string.russia_nsk) to "nsk",
getString(R.string.russia_sochi) to "sochi",
getString(R.string.russia_spb) to "spb")
cityList = mapOf(getString(R.string.russia_ekb) to getString(R.string.city_api_ekb),
getString(R.string.russia_krasnoyarsk) to getString(R.string.city_api_krasnoyarsk),
getString(R.string.russia_krd) to getString(R.string.city_api_krd),
getString(R.string.russia_kzn) to getString(R.string.city_api_kzn),
getString(R.string.russia_msk) to getString(R.string.city_api_msk),
getString(R.string.russia_nnv) to getString(R.string.city_api_nnv),
getString(R.string.russia_nsk) to getString(R.string.city_api_nsk),
getString(R.string.russia_sochi) to getString(R.string.city_api_sochi),
getString(R.string.russia_spb) to getString(R.string.city_api_spb))
}

override fun onCreate(savedInstanceState: Bundle?) {
Expand Down Expand Up @@ -163,7 +163,7 @@ class RegistrationFragment: BaseFragment<AuthViewModel>(true){


//step 3 age
sliderAge.setOnChangeListener { _, value ->
sliderAge.addOnChangeListener { _, value, _ ->
age = value.toInt()
tvAgeDisplay.text = age.toString()
}
Expand Down Expand Up @@ -211,7 +211,7 @@ class RegistrationFragment: BaseFragment<AuthViewModel>(true){


//step 4 city
val cityAdapter = ArrayAdapter(context!!,
val cityAdapter = ArrayAdapter(requireContext(),
R.layout.drop_text_item,
cityList.map { it.key })
dropdownCityChooser.setAdapter(cityAdapter)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Created by Andrii Kovalchuk
* Copyright (c) 2020. All rights reserved.
* Last modified 07.03.20 19:17
* Last modified 02.06.20 17:20
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -22,7 +22,7 @@ import kotlin.math.abs
*/
class HorizontalCarouselLayoutManager: LinearLayoutManager {

private val mShrinkAmount = 0.15f
private val mShrinkAmount = 0.25f
private val mShrinkDistance = 0.9f

constructor(context: Context?): super(context)
Expand All @@ -33,17 +33,19 @@ class HorizontalCarouselLayoutManager: LinearLayoutManager {
override fun scrollVerticallyBy(dy: Int, recycler: Recycler?, state: RecyclerView.State?): Int {
return if (orientation == VERTICAL) {
val scrolled = super.scrollVerticallyBy(dy, recycler, state)
val midpoint = height / 2f
val d0 = 0f
val d1 = mShrinkDistance * midpoint
val s0 = 1f
val s1 = 1f - mShrinkAmount
for (i in 0 until childCount) {
val child = getChildAt(i)
if (child != null) {
val midpoint = height / 2f
val d1 = mShrinkDistance * midpoint
val childMidpoint = (getDecoratedBottom(child) + getDecoratedTop(child)) / 2f
val d = d1.coerceAtMost(abs(midpoint - childMidpoint))
val scale = s0 + (s1 - s0) * (d - d0) / (d1 - d0)
var scale = s0 + (s1 - s0) * (d - d0) / (d1 - d0)
if (scale.isNaN()) scale = 0f

child.scaleX = scale
child.scaleY = scale
}
Expand All @@ -56,18 +58,20 @@ class HorizontalCarouselLayoutManager: LinearLayoutManager {
override fun scrollHorizontallyBy(dx: Int, recycler: Recycler?, state: RecyclerView.State?): Int {
return if (orientation == HORIZONTAL) {
val scrolled = super.scrollHorizontallyBy(dx, recycler, state)
val midpoint = width / 2f
val d0 = 0f
val d1 = mShrinkDistance * midpoint
val s0 = 1f
val s1 = 1f - mShrinkAmount
for (i in 0 until childCount) {

val child = getChildAt(i)
if (child != null) {
val midpoint = width / 2f
val d1 = mShrinkDistance * midpoint
val childMidpoint = (getDecoratedRight(child) + getDecoratedLeft(child)) / 2f
val d = d1.coerceAtMost(abs(midpoint - childMidpoint))
val scale = s0 + (s1 - s0) * (d - d0) / (d1 - d0)
var scale = s0 + (s1 - s0) * (d - d0) / (d1 - d0)
if (scale.isNaN()) scale = 0f

child.scaleX = scale
child.scaleY = scale
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Created by Andrii Kovalchuk
* Copyright (c) 2020. All rights reserved.
* Last modified 07.04.20 17:58
* Last modified 02.06.20 17:24
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -222,6 +222,7 @@ class ChatFragment : BaseFragment<ChatViewModel>() {
//touch event guarantee that if user want to scroll or touches recycler with messages
//keyboard hide and editText focus clear
setOnTouchListener { v, _ ->
v.performClick()
val iMM = v.context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
iMM.hideSoftInputFromWindow(v.windowToken, InputMethodManager.HIDE_NOT_ALWAYS)
edTextMessageInput.clearFocus()
Expand Down Expand Up @@ -298,7 +299,7 @@ class ChatFragment : BaseFragment<ChatViewModel>() {
val namePhoto = DateFormat.format("yyyy-MM-dd_hhmmss", Date()).toString()
mFilePathImageCamera = File(context?.getExternalFilesDir(Environment.DIRECTORY_PICTURES),
namePhoto + "camera.jpg")
val photoURI = FileProvider.getUriForFile(context!!,
val photoURI = FileProvider.getUriForFile(requireContext(),
BuildConfig.APPLICATION_ID + ".provider",
mFilePathImageCamera)
val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE).apply {
Expand Down Expand Up @@ -377,7 +378,7 @@ class ChatFragment : BaseFragment<ChatViewModel>() {
}

private fun showReportDialog() {
val materialDialogPicker = MaterialAlertDialogBuilder(context)
val materialDialogPicker = MaterialAlertDialogBuilder(requireContext())
.setItems(arrayOf(getString(R.string.report_chooser_photos),
getString(R.string.report_chooser_behavior),
getString(R.string.report_chooser_fake))) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Created by Andrii Kovalchuk
* Copyright (c) 2020. All rights reserved.
* Last modified 10.04.20 16:51
* Last modified 03.07.20 20:28
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -46,7 +46,7 @@ class ConversationsFragment: BaseFragment<ConversationsViewModel>(){
associatedViewModel = getViewModel()

associatedViewModel.getDeleteConversationStatus().observe(this, Observer {
if (it) context?.showToastText("successfully deleted")
if (it) context?.showToastText(getString(R.string.toast_text_delete_success))
})

}
Expand Down Expand Up @@ -88,14 +88,14 @@ class ConversationsFragment: BaseFragment<ConversationsViewModel>(){

MaterialAlertDialogBuilder(context)
.setCancelable(false)
.setTitle("Удалить диалог?")
.setMessage("Это полностью удалит переписку и пару с пользователем")
.setPositiveButton("Удалить") { dialog, _ ->
.setTitle(getString(R.string.dialog_conversation_delete_title))
.setMessage(getString(R.string.dialog_conversation_delete_message))
.setPositiveButton(getString(R.string.dialog_delete_btn_positive_text)) { dialog, _ ->
associatedViewModel.deleteConversation(adapter.getItem(itemPosition))
adapter.removeAt(itemPosition)
dialog.dismiss()
}
.setNegativeButton("Отмена") { dialog, _ ->
.setNegativeButton(getString(R.string.dialog_delete_btn_negative_text)) { dialog, _ ->
adapter.notifyItemChanged(itemPosition)
dialog.dismiss()
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/mmdev/roove/ui/main/MainFlowFragment.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Created by Andrii Kovalchuk
* Copyright (c) 2020. All rights reserved.
* Last modified 09.04.20 16:18
* Last modified 01.06.20 17:03
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -34,7 +34,7 @@ class MainFlowFragment: FlowFragment() {
.root

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
val bottomNavigationHeight = containerBottomNavigation.height

//set selected bottom menu item on startup
bottomNavigationView.selectedItemId = R.id.bottomCards
fabCards.isSelected = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Created by Andrii Kovalchuk
* Copyright (c) 2020. All rights reserved.
* Last modified 07.04.20 13:52
* Last modified 01.06.20 16:55
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -41,8 +41,8 @@ import kotlinx.android.synthetic.main.fragment_profile.*

class ProfileFragment: BaseFragment<RemoteRepoViewModel>() {

private val userPhotosAdapter = ImagePagerAdapter(listOf())
private val mPlacesToGoAdapter = PlacesToGoAdapter(listOf())
private val userPhotosAdapter = ImagePagerAdapter()
private val mPlacesToGoAdapter = PlacesToGoAdapter()

private var isReported: Boolean = false
private var fabVisible: Boolean = false
Expand Down Expand Up @@ -165,7 +165,7 @@ class ProfileFragment: BaseFragment<RemoteRepoViewModel>() {
}

private fun showReportDialog() {
val materialDialogPicker = MaterialAlertDialogBuilder(context)
val materialDialogPicker = MaterialAlertDialogBuilder(requireContext())
.setItems(arrayOf(getString(R.string.report_chooser_photos),
getString(R.string.report_chooser_behavior),
getString(R.string.report_chooser_fake))) { _, itemIndex ->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Created by Andrii Kovalchuk
* Copyright (c) 2020. All rights reserved.
* Last modified 07.04.20 14:37
* Last modified 02.06.20 17:22
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -124,9 +124,9 @@ class SettingsFragment: BaseFragment<RemoteRepoViewModel>(true) {

rvSettingsUserPhotosList.apply {
adapter = mSettingsPhotoAdapter
layoutManager = HorizontalCarouselLayoutManager(this.context, HORIZONTAL, false)
//item decorator to make first and last item align center
addItemDecoration(CenterFirstLastItemDecoration())
layoutManager = HorizontalCarouselLayoutManager(this.context, HORIZONTAL, false)
//adjust auto swipe to item center
val snapHelper: SnapHelper = LinearSnapHelper()
snapHelper.attachToRecyclerView(this)
Expand Down Expand Up @@ -193,7 +193,7 @@ class SettingsFragment: BaseFragment<RemoteRepoViewModel>(true) {
val namePhoto = DateFormat.format("yyyy-MM-dd_hhmmss", Date()).toString()
mFilePathImageCamera = File(context?.getExternalFilesDir(Environment.DIRECTORY_PICTURES),
currentUser.baseUserInfo.name + namePhoto + "camera.jpg")
val photoURI = FileProvider.getUriForFile(context!!,
val photoURI = FileProvider.getUriForFile(requireContext(),
BuildConfig.APPLICATION_ID + ".provider",
mFilePathImageCamera)
val intent = Intent(MediaStore.ACTION_IMAGE_CAPTURE).apply {
Expand Down
Loading

0 comments on commit af4eaeb

Please sign in to comment.