Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a9a0b42
Изменены настройки проекта и добавлена связь с БД Firestore
GenerallRoss Jun 24, 2022
96dc273
Сделал рефракторинг кода
GenerallRoss Jun 24, 2022
68ea470
fix edittexts
Azmekin Jun 24, 2022
9f2c55f
Добавлена запись в БД
GenerallRoss Jun 24, 2022
68c064a
Добавлена запись в БД, исправлено считывание и рефракторинг Dasgboard…
GenerallRoss Jun 24, 2022
8a7e08a
Merge remote-tracking branch 'origin/diman' into diman
GenerallRoss Jun 24, 2022
38e2aca
add Toast
Azmekin Jun 24, 2022
669e998
По другому сделан адаптер для списка
GenerallRoss Jun 25, 2022
19c9aa2
Добавлен подробный просмотр товара
GenerallRoss Jun 25, 2022
93da487
ну и
Azmekin Jun 25, 2022
eb54109
и
GenerallRoss Jun 24, 2022
2179600
Сделал рефракторинг кода
GenerallRoss Jun 24, 2022
47aaf3e
Добавлена запись в БД
GenerallRoss Jun 24, 2022
131662a
Добавлена запись в БД, исправлено считывание и рефракторинг Dasgboard…
GenerallRoss Jun 24, 2022
7329478
color new
Azmekin Jun 24, 2022
2a2fd88
spinner add
Azmekin Jun 24, 2022
bb67b91
spinner add
Azmekin Jun 25, 2022
2fabc4b
ok manager
Azmekin Jun 25, 2022
b7ee3df
Переделан дизайн
GenerallRoss Jun 26, 2022
d86646e
Merge remote-tracking branch 'origin/diman' into diman
GenerallRoss Jun 26, 2022
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 .idea/compiler.xml

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

17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

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

3 changes: 1 addition & 2 deletions .idea/gradle.xml

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

13 changes: 12 additions & 1 deletion .idea/misc.xml

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

33 changes: 21 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'com.android.application'
id 'kotlin-android'

id 'com.google.gms.google-services'
id 'kotlin-android-extensions'
}

android {
Expand Down Expand Up @@ -34,24 +34,33 @@ android {
buildFeatures {
viewBinding true
}
buildToolsVersion '30.0.3'
}

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.annotation:annotation:1.3.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
testImplementation 'junit:junit:4.+'
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.annotation:annotation:1.4.0'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.1'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
implementation 'com.google.firebase:firebase-firestore:24.2.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.firebase:firebase-database:20.0.5'
implementation 'com.google.firebase:firebase-auth-ktx:21.0.6'
implementation 'com.google.firebase:firebase-functions-ktx:20.1.0'
implementation 'com.google.firebase:firebase-database-ktx:20.0.5'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation platform('com.google.firebase:firebase-bom:29.1.0')
implementation platform('com.google.firebase:firebase-bom:30.2.0')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx' //авторизация
implementation 'com.google.firebase:firebase-firestore-ktx' //база данных
Expand Down
22 changes: 7 additions & 15 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
{
"project_info": {
"project_number": "616512963878",
"project_id": "needit-d5458",
"storage_bucket": "needit-d5458.appspot.com"
"project_number": "795793707622",
"project_id": "needitdatabase",
"storage_bucket": "needitdatabase.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:616512963878:android:77990f2f50bf9860616de7",
"mobilesdk_app_id": "1:795793707622:android:7e2e8c39717f12f41493a7",
"android_client_info": {
"package_name": "com.example.needit"
}
},
"oauth_client": [
{
"client_id": "616512963878-nccs5llrdekuphj9ppelb7nm23lennsu.apps.googleusercontent.com",
"client_type": 1,
"android_info": {
"package_name": "com.example.needit",
"certificate_hash": "29283c9cdaef3f327e3a28f8cdb15bed876e6ddc"
}
},
{
"client_id": "616512963878-bu9fga62pcao7npqgokigjpsm96brla9.apps.googleusercontent.com",
"client_id": "795793707622-8ohbiprm058j4mskthgg5p6clmmh54u1.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyBZNktC30xrxQ8FYJgYM2vyJRC6VfS2dd0"
"current_key": "AIzaSyD8t70MlvibD4bk5Qa6IsxiKmtYGX-V0kU"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "616512963878-bu9fga62pcao7npqgokigjpsm96brla9.apps.googleusercontent.com",
"client_id": "795793707622-8ohbiprm058j4mskthgg5p6clmmh54u1.apps.googleusercontent.com",
"client_type": 3
}
]
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.NeedIt">


<activity
android:name=".MainActivity"
android:exported="false" />
Expand All @@ -24,6 +22,9 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".activityes.ui.dashboard.DetailDashActivity"
android:exported="false"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
package com.example.needit.activityes

import android.os.Bundle
import com.google.android.material.bottomnavigation.BottomNavigationView
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import androidx.fragment.app.Fragment
import com.example.needit.R
import com.example.needit.activityes.ui.dashboard.DashboardFragment
import com.example.needit.activityes.ui.notifications.NotificationsFragment

import com.example.needit.databinding.ActivityNavigationBinding
import kotlinx.android.synthetic.main.activity_navigation.*

class Navigation_Activity : AppCompatActivity() {

private lateinit var binding: ActivityNavigationBinding
private val dashboardFragment = DashboardFragment()
private val notificationsFragment = NotificationsFragment()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_navigation)
replaceFragment(dashboardFragment)

nav_view.setOnNavigationItemSelectedListener {
when(it.itemId) {
R.id.navigation_dashboard -> replaceFragment(dashboardFragment)
R.id.navigation_notifications -> replaceFragment(notificationsFragment)
}
true
}
}

binding = ActivityNavigationBinding.inflate(layoutInflater)
setContentView(binding.root)

val navView: BottomNavigationView = binding.navView

val navController = findNavController(R.id.nav_host_fragment_activity_navigation)
// Passing each menu ID as a set of Ids because each
// menu should be considered as top level destinations.
val appBarConfiguration = AppBarConfiguration(
setOf(
R.id.navigation_notifications , R.id.navigation_dashboard //, R.id.navigation_home
)
)
setupActionBarWithNavController(navController, appBarConfiguration)
navView.setupWithNavController(navController)
private fun replaceFragment(fragment: Fragment) {
if(fragment !=null) {
val transition = supportFragmentManager.beginTransaction()
transition.replace(R.id.nav_host_fragment_activity_navigation, fragment)
transition.commit()
}
}
}
Original file line number Diff line number Diff line change
@@ -1,41 +1,60 @@
package com.example.needit.activityes.ui.dashboard

import android.service.autofill.OnClickAction
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Toast
import androidx.recyclerview.widget.RecyclerView
import com.example.needit.R
import com.example.needit.databinding.RecyclerViewItemBinding
import kotlinx.android.synthetic.main.recycler_view_item.view.*

//Stegancev
class DashAdapter:RecyclerView.Adapter<DashAdapter.DashHolder>() {
val requestList=ArrayList<PersonRequest>()
class DashHolder(item:View):RecyclerView.ViewHolder(item){
val binding=RecyclerViewItemBinding.bind(item)
fun bind(personRequest: PersonRequest) = with(binding){
textView1.text=personRequest.Name
textView2.text=personRequest.Description
ImageVievTest.setImageResource(R.drawable.ic_baseline_settings_applications_24)
Contacts.text="+7999999999"
class DashAdapter(private val onClickLis: onClickLis) :
RecyclerView.Adapter<DashAdapter.DashHolder>() {
val requestList = ArrayList<PersonRequest>()


}
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DashHolder {
val view= LayoutInflater.from(parent.context).inflate(R.layout.recycler_view_item,parent,false)
val view =
LayoutInflater.from(parent.context).inflate(R.layout.recycler_view_item, parent, false)
return DashHolder(view)
}

override fun onBindViewHolder(holder: DashHolder, position: Int) {
holder.bind(requestList[position],)

holder.bind(requestList[position])
holder.itemView.button.setOnClickListener {
holder.itemView.helpIcon.visibility= View.VISIBLE
}
holder.itemView.setOnClickListener {
onClickLis.onClikeded(position)
}

}

override fun getItemCount(): Int {
return requestList.size
return requestList.size
}
fun addReq(personRequest: PersonRequest){


fun addReq(personRequest: PersonRequest) {
requestList.add(personRequest)
notifyDataSetChanged()
}


class DashHolder(item: View) : RecyclerView.ViewHolder(item) {
val binding = RecyclerViewItemBinding.bind(item)
fun bind(personRequest: PersonRequest) = with(binding) {
textView1.text = personRequest.name
textView2.text = personRequest.description
ImageVievTest.setImageResource(R.drawable.ic_baseline_settings_applications_24)
Contacts.text = "+7999999999"


}
}
}
Loading