Skip to content

Commit

Permalink
Merge pull request #32 from sspaceless/dev
Browse files Browse the repository at this point in the history
Patch 1.2
  • Loading branch information
kizukkk authored Jun 4, 2023
2 parents aaf2aab + 804882e commit 72d07cc
Show file tree
Hide file tree
Showing 27 changed files with 481 additions and 251 deletions.
48 changes: 26 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,35 @@

<h1>Навігація</h1>

* [Огляд єПотреба](#Огляд)
* [Технології](#Технології)
* [Встановлення](#Встановлення)
* [Команда](#Команда)
* [Огляд єПотреба](#Огляд)


<h1>Технлогії</h1>

- **Платформа**: Android & Firebase
- **Android API**: 31
- **IDE**: Android Studio, VS Code
- **Мова**: Kotlin + KTX
- **Аутентифікація**: Firebase Auth (*Phone Provider*)
- **Дизайн**: Figma
- **Організація процесу розробки**: Miro, GitHub
- **Шрифт**: [Fixel Font](https://fixel.macpaw.com/?gclid=Cj0KCQjw_r6hBhDdARIsAMIDhV-hiscld-F8_wp7oukBdCr8XKNrSkMZ4hbsxe1RnMrTb_Kx2mePRfwaAmNIEALw_wcB)

<h1>Встановлення</h1>

Перейти в розділ release, завантажити .apk файл.


<h1>Команда</h1>

Над даним проєктом працювала творче об'єднання єКоманда:
* Боднар Ілля - розробка UI, організація;
* Неживих Марія - розробка дизайну, тестування;
* Марковський Данило - розробка бізнес логіки, архітектури, налаштування бекенд сервісів.


<h1>Огляд</h1>

Expand Down Expand Up @@ -161,26 +186,5 @@
</tbody>
</table>

<h1>Технлогії</h1>

- **Платформа**: Android & Firebase
- **Android API**: 31
- **IDE**: Android Studio, VS Code
- **Мова**: Kotlin + KTX
- **Аутентифікація**: Firebase Auth (*Phone Provider*)
- **Дизайн**: Figma
- **Організація процесу розробки**: Miro, GitHub


<h1>Встановлення</h1>

Перейти в розділ release, завантажити .apk файл.


<h1>Команда</h1>

Над даним проєктом працювала творче об'єднання єКоманда:
* Боднар Ілля - розробка UI, організація;
* Неживих Марія - розробка дизайну, тестування;
* Марковський Данило - розробка бізнес логіки, архітектури, налаштування бекенд сервісів.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ android {
minSdk 28
targetSdk 33
versionCode 1
versionName "1.0"
versionName "1.5"
resourceConfigurations += ["en", "ua"]
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
22 changes: 15 additions & 7 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
{
"project_info": {
"project_number": "809327395541",
"project_id": "e-potreba",
"storage_bucket": "e-potreba.appspot.com"
"project_number": "166621933311",
"project_id": "e-potreba-2a821",
"storage_bucket": "e-potreba-2a821.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:809327395541:android:7ced9895b13c1c06ac985c",
"mobilesdk_app_id": "1:166621933311:android:6a88d5c4eebaf78a18e6ca",
"android_client_info": {
"package_name": "com.eteam.epotreba"
}
},
"oauth_client": [
{
"client_id": "809327395541-2068d3mqrs1m8urf7369pmp6r891asj8.apps.googleusercontent.com",
"client_id": "166621933311-jdgbt6dblettk8hji0psu73a5maccnt5.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.eteam.epotreba",
"certificate_hash": "58c3dc9e7aa4b2f4edba1f95f05530b9efe2aa43"
}
},
{
"client_id": "166621933311-df5acgmctv6r1374ukdjm6f43eg021g0.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAm0o_LBBazrxQvAD0GH3yw3uqV1jib3hQ"
"current_key": "AIzaSyD0vZrSIIMpD_YtJLSr_UiXtw8_5Uo4ELk"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "809327395541-2068d3mqrs1m8urf7369pmp6r891asj8.apps.googleusercontent.com",
"client_id": "166621933311-df5acgmctv6r1374ukdjm6f43eg021g0.apps.googleusercontent.com",
"client_type": 3
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import com.eteam.epotreba.presentation.dialog_fragment.EditMarkerDialogFragment
import com.eteam.epotreba.presentation.viewModel.MainViewModel
import kotlinx.coroutines.launch

class EditMarkerFragment : Fragment(R.layout.fragment_edit_marker) {
class EditMarkerFragment : Fragment(R.layout.fragment_marker_edit) {


private val viewModel: MainViewModel by activityViewModels()
Expand All @@ -29,7 +29,7 @@ class EditMarkerFragment : Fragment(R.layout.fragment_edit_marker) {
savedInstanceState: Bundle?
): View {

val view = inflater.inflate(R.layout.fragment_edit_marker, container, false)
val view = inflater.inflate(R.layout.fragment_marker_edit, container, false)

title = view.findViewById(R.id.edit_title)
about = view.findViewById(R.id.edit_about)
Expand Down Expand Up @@ -74,8 +74,13 @@ class EditMarkerFragment : Fragment(R.layout.fragment_edit_marker) {
deleteButton.setOnClickListener {
lifecycleScope.launch {
viewModel.delete(viewModel.passMarker)
viewModel.updateList()
}
val transaction = activity?.supportFragmentManager?.beginTransaction()
if(transaction != null){
transaction.replace(R.id.fragmentContainerView, ToiletsListFragment())
transaction.commit()
}
removeFragment()
}

return view
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.eteam.epotreba.presentation.fragment

import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.EditText
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
Expand All @@ -15,6 +17,7 @@ import com.eteam.epotreba.domain.usecase.SaveMarkerUseCase
import com.eteam.epotreba.presentation.viewModel.MainViewModel
import com.google.android.gms.maps.model.LatLng
import kotlinx.coroutines.launch
import com.eteam.epotreba.R


class MarkerCreateFragment : Fragment() {
Expand All @@ -35,19 +38,44 @@ class MarkerCreateFragment : Fragment() {

binding.createButton.setOnClickListener {

val title: String = binding.titleField.text.toString()
val about: String = binding.aboutField.text.toString();
val lat: Double = binding.latField.text.toString().toDouble();
val lng: Double = binding.lngField.text.toString().toDouble();
val price: Double = binding.priceField.text.toString().toDouble();
val title: String;
val about: String;
val lat: Double;
val lng: Double

try {
title = getDataFromRequiredField(binding.titleField)
lat = getDataFromRequiredField(binding.latField).toDouble()
lng = getDataFromRequiredField(binding.lngField).toDouble()
about = getDataFromRequiredField(binding.aboutField)

} catch (e: NullPointerException) {
Log.wtf("MarkerCreateFields", "Fields must be not null")
return@setOnClickListener

}
val price: Double = if(binding.priceField.text.isNotEmpty())
binding.priceField.text.toString().toDouble()
else 0.0


if (price > 1000) {
binding.priceField.error = getString(R.string.fragment_marker_create_price_alert)
return@setOnClickListener
}

val marker = MarkerModel(
title, about, LatLng(lat, lng), 0.0, viewModel.currentUser!!.uid, price
)


saveMarkerUseCase.execute(marker)

Toast.makeText(viewModel.getApplication(), "Успішно додано!", Toast.LENGTH_LONG).show()
Toast.makeText(
viewModel.getApplication(),
R.string.fragment_marker_create_successful,
Toast.LENGTH_LONG
).show()
lifecycleScope.launch {
viewModel.updateList()
requireActivity().supportFragmentManager.popBackStack()
Expand All @@ -58,4 +86,17 @@ class MarkerCreateFragment : Fragment() {
return binding.root
}

private fun getDataFromRequiredField(field: EditText): String {

field.text.takeIf { it.isEmpty() }?.let {
field.error = getString(R.string.fragment_marker_create_required)

throw NullPointerException()
}

return field.text.toString()


}

}
Binary file added app/src/main/res/font/fixel_display_bold.ttf
Binary file not shown.
18 changes: 18 additions & 0 deletions app/src/main/res/font/fixel_display_family.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:fontStyle="normal"
android:fontWeight="400"
android:font="@font/fixel_display_regular" />

<font
android:fontStyle="normal"
android:fontWeight="500"
android:font="@font/fixel_display_medium" />

<font
android:fontStyle="normal"
android:fontWeight="700"
android:font="@font/fixel_display_bold" />

</font-family>
Binary file added app/src/main/res/font/fixel_display_medium.ttf
Binary file not shown.
Binary file added app/src/main/res/font/fixel_display_regular.ttf
Binary file not shown.
Binary file added app/src/main/res/font/fixel_text_regular.ttf
Binary file not shown.
10 changes: 7 additions & 3 deletions app/src/main/res/layout/activity_location_grant_notification.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
android:layout_marginStart="15dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="15dp"
android:text="Помилка розташування"
android:fontFamily="@font/fixel_display_family"
android:text="@string/activity_location_not_title"
android:textSize="34sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -25,7 +26,8 @@
android:layout_marginStart="25dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="25dp"
android:text="Для коректної роботи застосунку треба надати доступ до визначення поточного розташування пристрою"
android:fontFamily="@font/fixel_display_family"
android:text="@string/activity_location_not_message"
android:textAlignment="center"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -37,8 +39,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="35dp"
android:text="Надати права"
android:fontFamily="@font/fixel_display_family"
android:text="@string/activity_location_grand"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView20" />
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
app:layout_constraintBottom_toBottomOf="parent"
app:itemTextAppearanceActive="@style/Widget.BottomNavigationView"
app:menu="@menu/bottom_navigation" />
</androidx.constraintlayout.widget.ConstraintLayout>
12 changes: 8 additions & 4 deletions app/src/main/res/layout/activity_profile_create.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fontFamily="@font/fixel_display_family"
android:paddingEnd="15dp"
android:text="Your Name"
android:text="@string/activity_profile_create_name"
android:textFontWeight="500"
android:textSize="18sp"
tools:ignore="RtlSymmetry" />

Expand All @@ -36,8 +38,8 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:inputType="textPersonName"
android:text="Enter your name..." />
android:fontFamily="@font/fixel_display_family"
android:inputType="textPersonName" />
</LinearLayout>

<!-- <LinearLayout-->
Expand Down Expand Up @@ -81,7 +83,9 @@
android:layout_height="wrap_content"
android:layout_marginTop="35dp"
android:layout_marginBottom="531dp"
android:text="Confirm"
android:fontFamily="@font/fixel_display_family"
android:text="@string/activity_sign_in_confirm"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/res/layout/activity_sign_in.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
android:layout_marginStart="100dp"
android:layout_marginTop="80dp"
android:layout_marginEnd="100dp"
android:fontFamily="@font/fixel_display_family"
android:text="@string/activity_sign_in_title"
android:textFontWeight="500"
android:textSize="28sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand All @@ -26,6 +28,7 @@
android:layout_marginTop="15dp"
android:layout_marginEnd="100dp"
android:ems="10"
android:fontFamily="@font/fixel_display_family"
android:inputType="phone"
android:textSize="24sp"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -41,6 +44,7 @@
android:layout_marginStart="100dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="100dp"
android:fontFamily="@font/fixel_display_family"
android:text="@string/fragment_profile_edit_phone"
android:textSize="22sp"
app:layout_constraintEnd_toEndOf="parent"
Expand All @@ -55,6 +59,7 @@
android:layout_marginStart="100dp"
android:layout_marginTop="25dp"
android:layout_marginEnd="100dp"
android:fontFamily="@font/fixel_display_family"
android:text="@string/activity_sign_in_code"
android:textSize="22sp"
android:visibility="gone"
Expand All @@ -71,6 +76,7 @@
android:layout_marginTop="15dp"
android:layout_marginEnd="100dp"
android:ems="10"
android:fontFamily="@font/fixel_display_family"
android:inputType="number"
android:textSize="24sp"
android:visibility="gone"
Expand All @@ -85,7 +91,9 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:fontFamily="@font/fixel_display_family"
android:text="@string/activity_sign_in_next"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/code_field" />
Expand Down
Loading

0 comments on commit 72d07cc

Please sign in to comment.