diff options
author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-11-15 17:32:45 +0000 |
---|---|---|
committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-11-15 17:32:45 +0000 |
commit | 19b7461db83097911940f37ecd2484c2149cb054 (patch) | |
tree | d3070c8c5821e04bbc3139f431eaf89509ff7955 /Client | |
parent | e5ff284cfc4b1944d13034ff183efef49f631e4b (diff) | |
parent | c8eb6ba248aff872a4f4d2aa7ccde50aacad73a6 (diff) |
Merge branch 'develop' into 'master'
Merge develop > master
See merge request BrzoDoLokacije2022/odyssey/brzodolokacije!6
Diffstat (limited to 'Client')
79 files changed, 2815 insertions, 461 deletions
diff --git a/Client/BrzoDoLokacije/.idea/deploymentTargetDropDown.xml b/Client/BrzoDoLokacije/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index a3aab99..0000000 --- a/Client/BrzoDoLokacije/.idea/deploymentTargetDropDown.xml +++ /dev/null @@ -1,17 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<project version="4"> - <component name="deploymentTargetDropDown"> - <runningDeviceTargetSelectedWithDropDown> - <Target> - <type value="RUNNING_DEVICE_TARGET" /> - <deviceKey> - <Key> - <type value="SERIAL_NUMBER" /> - <value value="prvcgybaa6f6zhpv" /> - </Key> - </deviceKey> - </Target> - </runningDeviceTargetSelectedWithDropDown> - <timeTargetWasSelectedWithDropDown value="2022-11-09T23:36:53.200298Z" /> - </component> -</project>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/build.gradle b/Client/BrzoDoLokacije/app/build.gradle index 08a26bf..db4ed1b 100644 --- a/Client/BrzoDoLokacije/app/build.gradle +++ b/Client/BrzoDoLokacije/app/build.gradle @@ -47,7 +47,11 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.5.1' implementation 'com.google.android.material:material:1.7.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' implementation 'com.google.android.gms:play-services-maps:18.1.0' + implementation 'com.google.android.gms:play-services-location:21.0.1' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.recyclerview:recyclerview:1.2.1' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' @@ -61,4 +65,8 @@ dependencies { //Glide implementation 'com.github.bumptech.glide:glide:4.12.0' annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' + + //OSMDROID + implementation 'org.osmdroid:osmdroid-android:6.1.14' + implementation 'com.github.MKergall:osmbonuspack:6.9.0' }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus.xml b/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus.xml new file mode 100644 index 0000000..34823a6 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus.xml @@ -0,0 +1,11 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="#333333" + android:alpha="0.6"> + <path + android:fillColor="@android:color/white" + android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus_color.xml b/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus_color.xml new file mode 100644 index 0000000..af3270c --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus_color.xml @@ -0,0 +1,11 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="#1C789A" + android:alpha="0.8"> + <path + android:fillColor="@android:color/white" + android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus_color_1.xml b/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus_color_1.xml new file mode 100644 index 0000000..b643016 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-anydpi/add_profile_picture_plus_color_1.xml @@ -0,0 +1,16 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="#1C789A" + android:alpha="0.8"> + <group android:scaleX="1.2" + android:scaleY="1.2" + android:translateX="-2.4" + android:translateY="-2.4"> + <path + android:fillColor="@android:color/white" + android:pathData="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM17,13h-4v4h-2v-4L7,13v-2h4L11,7h2v4h4v2z"/> + </group> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus.png Binary files differnew file mode 100644 index 0000000..ac7f48c --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus_color.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus_color.png Binary files differnew file mode 100644 index 0000000..c58371e --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus_color.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus_color_1.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus_color_1.png Binary files differnew file mode 100644 index 0000000..74786ad --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-hdpi/add_profile_picture_plus_color_1.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus.png Binary files differnew file mode 100644 index 0000000..e853535 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus_color.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus_color.png Binary files differnew file mode 100644 index 0000000..62eeb35 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus_color.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus_color_1.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus_color_1.png Binary files differnew file mode 100644 index 0000000..eb81643 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-mdpi/add_profile_picture_plus_color_1.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus.png Binary files differnew file mode 100644 index 0000000..66fa4aa --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus_color.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus_color.png Binary files differnew file mode 100644 index 0000000..6cad473 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus_color.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus_color_1.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus_color_1.png Binary files differnew file mode 100644 index 0000000..35f6294 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xhdpi/add_profile_picture_plus_color_1.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus.png Binary files differnew file mode 100644 index 0000000..89b14f1 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus_color.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus_color.png Binary files differnew file mode 100644 index 0000000..a15759e --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus_color.png diff --git a/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus_color_1.png b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus_color_1.png Binary files differnew file mode 100644 index 0000000..a0cab62 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/debug/res/drawable-xxhdpi/add_profile_picture_plus_color_1.png diff --git a/Client/BrzoDoLokacije/app/src/main/AndroidManifest.xml b/Client/BrzoDoLokacije/app/src/main/AndroidManifest.xml index ef57e6c..56bdb58 100644 --- a/Client/BrzoDoLokacije/app/src/main/AndroidManifest.xml +++ b/Client/BrzoDoLokacije/app/src/main/AndroidManifest.xml @@ -14,7 +14,10 @@ <uses-permission android:name="android.permission.CAMERA" android:required="true" - android:requiredFeature="true" /> <!-- SVOJSTVA --> + android:requiredFeature="true" /> + <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> + + <!-- SVOJSTVA --> <uses-feature android:name="android.hardware.camera" android:required="true" /> @@ -37,37 +40,18 @@ android:usesCleartextTraffic="true" tools:targetApi="31"> - <!-- - TODO: Before you run your application, you need a Google Maps API key. - - To get one, follow the directions here: - - https://developers.google.com/maps/documentation/android-sdk/get-api-key - - Once you have your API key (it starts with "AIza"), define a new property in your - project's local.properties file (e.g. MAPS_API_KEY=Aiza...), and replace the - "YOUR_API_KEY" string in this file with "${MAPS_API_KEY}". - --> <meta-data android:name="com.google.android.geo.API_KEY" android:value="YOUR_API_KEY" /> - <activity - android:name=".Activities.MapsActivity" - android:exported="false" - android:label="@string/title_activity_maps" /> - <activity - android:name=".Activities.ActivityCapturePost" - android:exported="false"> - <meta-data - android:name="android.app.lib_name" - android:value="" /> - </activity> - <activity android:name=".Activities.ActivitySinglePost" /> - <activity android:name=".Activities.ActivityAddPost" /> + <activity android:name=".Activities.MapsActivity" android:screenOrientation="portrait" /> + <activity android:name=".Activities.ActivityCapturePost" android:screenOrientation="portrait" /> + <activity android:name=".Activities.ActivitySinglePost" android:screenOrientation="portrait" /> + <activity android:name=".Activities.ActivityAddPost" android:screenOrientation="portrait" /> <activity android:name=".Activities.SplashPage" - android:exported="true"> + android:exported="true" + android:screenOrientation="portrait" > <intent-filter> <action android:name="android.intent.action.MAIN" /> @@ -78,17 +62,12 @@ android:name="android.app.lib_name" android:value="" /> </activity> - <activity android:name=".Activities.ActivityForgottenPasswordVerify" /> - <activity android:name=".Activities.ActivityForgottenPassword" /> - <activity android:name=".Activities.ActivityLoginRegister" /> - <activity android:name=".Activities.NavigationActivity" /> - <activity - android:name=".MainActivity" - android:exported="false"> - <meta-data - android:name="android.app.lib_name" - android:value="" /> - </activity> + <activity android:name=".Activities.ActivityForgottenPasswordVerify" android:screenOrientation="portrait" /> + <activity android:name=".Activities.ActivityForgottenPassword" android:screenOrientation="portrait" /> + <activity android:name=".Activities.ActivityLoginRegister" android:screenOrientation="portrait" /> + <activity android:name=".Activities.NavigationActivity" android:screenOrientation="portrait" /> + <activity android:name=".MainActivity" android:screenOrientation="portrait" /> + <provider android:name="androidx.core.content.FileProvider" diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityAddPost.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityAddPost.kt index 40d8f11..b9e4fd7 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityAddPost.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityAddPost.kt @@ -12,6 +12,7 @@ import android.widget.* import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat +import androidx.core.view.isVisible import com.example.brzodolokacije.Models.Location import com.example.brzodolokacije.Models.LocationType import com.example.brzodolokacije.Models.PostPreview @@ -19,6 +20,7 @@ import com.example.brzodolokacije.R import com.example.brzodolokacije.Services.RetrofitHelper import com.example.brzodolokacije.Services.SharedPreferencesHelper import okhttp3.MediaType +import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.MultipartBody import okhttp3.RequestBody import retrofit2.Call @@ -52,7 +54,7 @@ class ActivityAddPost : AppCompatActivity() { //paths= ArrayList() - uploadFromGallery=findViewById<View>(R.id.btnActivityAddPostUploadFromGallery) as Button + uploadFromGallery=findViewById<View>(R.id.btnActivityAddPostUploadFromGalleryVisible) as Button showNextImage=findViewById<View>(R.id.nextImage) as Button showPreviousImage=findViewById<View>(R.id.previousImage) as Button switcher=findViewById<View>(R.id.isActivityAddPostSwitcher) as ImageSwitcher @@ -139,6 +141,7 @@ class ActivityAddPost : AppCompatActivity() { //veci broj slika if (data!!.getClipData() != null) { + var count = data!!.clipData!!.itemCount for (i in 0..count - 1) { @@ -148,6 +151,7 @@ class ActivityAddPost : AppCompatActivity() { // prikaz ucitanih switcher.setImageURI(uploadedImages!![0]) + uploadFromGallery.isVisible=false place=0 //jedna slika } else if (data?.getData() != null) { @@ -155,6 +159,7 @@ class ActivityAddPost : AppCompatActivity() { //prikaz jedne ucitane switcher.setImageURI(data.data!!) + uploadFromGallery.isVisible=false } } } @@ -207,9 +212,9 @@ class ActivityAddPost : AppCompatActivity() { description.text.clear() //loc //desc - var locReq=RequestBody.create(MediaType.parse("text/plain"),loc) - var descReq=RequestBody.create(MediaType.parse("text/plain"),desc) - var idReq=RequestBody.create(MediaType.parse("text/plain"),"dsa") + var locReq=RequestBody.create("text/plain".toMediaTypeOrNull(),loc) + var descReq=RequestBody.create("text/plain".toMediaTypeOrNull(),desc) + var idReq=RequestBody.create("text/plain".toMediaTypeOrNull(),"dsa") val imagesParts = arrayOfNulls<MultipartBody.Part>( uploadedImages!!.size ) @@ -224,7 +229,7 @@ class ActivityAddPost : AppCompatActivity() { file!!.writeBytes(inputStream!!.readBytes()) - var imageBody=RequestBody.create(MediaType.parse("image/*"),file) + var imageBody=RequestBody.create("image/*".toMediaTypeOrNull(),file) imagesParts[i]=MultipartBody.Part.createFormData("images",file.name,imageBody) } var jwtString= SharedPreferencesHelper.getValue("jwt",this) diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityCapturePost.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityCapturePost.kt index 951ccf5..e2dbb7c 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityCapturePost.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityCapturePost.kt @@ -1,149 +1,258 @@ package com.example.brzodolokacije.Activities import android.Manifest -import android.app.Activity import android.content.Intent import android.content.pm.PackageManager import android.graphics.Bitmap import android.graphics.Color import android.net.Uri -import androidx.appcompat.app.AppCompatActivity import android.os.Bundle -import android.os.Environment -import android.os.Environment.getExternalStoragePublicDirectory import android.provider.MediaStore +import android.util.Log import android.view.View import android.widget.Button import android.widget.EditText import android.widget.ImageView import android.widget.Toast +import androidx.activity.result.contract.ActivityResultContracts +import androidx.appcompat.app.AppCompatActivity import androidx.core.app.ActivityCompat import androidx.core.content.ContextCompat -import androidx.core.content.FileProvider +import androidx.core.view.isVisible +import com.example.brzodolokacije.Models.Location +import com.example.brzodolokacije.Models.LocationType +import com.example.brzodolokacije.Models.PostPreview import com.example.brzodolokacije.R -import kotlinx.android.synthetic.main.fragment_profile.* +import com.example.brzodolokacije.Services.RetrofitHelper +import com.example.brzodolokacije.Services.SharedPreferencesHelper +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.MultipartBody +import okhttp3.RequestBody +import retrofit2.Call +import retrofit2.Response +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream import java.io.File -import java.io.IOException -import java.text.SimpleDateFormat -import java.util.* -import kotlin.collections.ArrayList +import java.io.InputStream + class ActivityCapturePost : AppCompatActivity() { - lateinit var currentPhotoPath: String + private lateinit var takePhoto: Button private lateinit var location: EditText private lateinit var description: EditText - private lateinit var locationString:String - private lateinit var descriptionString:String - private lateinit var post:Button - private lateinit var showImage:ImageView - private var uploadedImages:ArrayList<Uri?>?=null - private lateinit var photoPath:String - private lateinit var photoURI:Uri - - @Throws(IOException::class) - private fun createImageFile(): File { - val timeStamp: String = SimpleDateFormat("yyyyMMdd_HHmmss").format(Date()) - val storageDir: File? = getExternalFilesDir(Environment.DIRECTORY_PICTURES) - return File.createTempFile( - "JPEG_${timeStamp}_", /* prefix */ - ".jpg", /* suffix */ - storageDir /* directory */ - ).apply { - currentPhotoPath = absolutePath - } - } + private lateinit var locationString: String + private lateinit var descriptionString: String + private lateinit var post: Button + private lateinit var showImage: ImageView + private var uploadedImages: Uri? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_capture_post) + location = findViewById<View>(R.id.etActivityCapturePostLocation) as EditText + description = findViewById<View>(R.id.etActivityCapturePostDescription) as EditText + post = findViewById<View>(R.id.btnActivityCapturePostPost) as Button + showImage = findViewById<View>(R.id.ivActivityCapturePostImage) as ImageView + takePhoto = findViewById<View>(R.id.btnActivityCapturePostCaptureVisible) as Button + //dodavanje sa kamere + + ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //provera da li je odobrena upotreba skladista - if(ContextCompat.checkSelfPermission(this@ActivityCapturePost, Manifest.permission.READ_EXTERNAL_STORAGE) - != PackageManager.PERMISSION_GRANTED){ - ActivityCompat.requestPermissions(this@ActivityCapturePost, arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE),101) + if (ContextCompat.checkSelfPermission( + this@ActivityCapturePost, + Manifest.permission.READ_EXTERNAL_STORAGE + ) + != PackageManager.PERMISSION_GRANTED + ) { + ActivityCompat.requestPermissions( + this@ActivityCapturePost, + arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE), + 101 + ) } //provera da li je odobrena upotreba kamere - if(ContextCompat.checkSelfPermission(this@ActivityCapturePost, Manifest.permission.CAMERA) - != PackageManager.PERMISSION_GRANTED){ - ActivityCompat.requestPermissions(this@ActivityCapturePost, arrayOf(Manifest.permission.CAMERA),101) + if (ContextCompat.checkSelfPermission( + this@ActivityCapturePost, + Manifest.permission.CAMERA + ) + != PackageManager.PERMISSION_GRANTED + ) { + ActivityCompat.requestPermissions( + this@ActivityCapturePost, + arrayOf(Manifest.permission.CAMERA), + 101 + ) } //provera da li je odobren upis u skladiste - if(ContextCompat.checkSelfPermission(this@ActivityCapturePost, Manifest.permission.WRITE_EXTERNAL_STORAGE) - != PackageManager.PERMISSION_GRANTED){ - ActivityCompat.requestPermissions(this@ActivityCapturePost, arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE),101) + if (ContextCompat.checkSelfPermission( + this@ActivityCapturePost, + Manifest.permission.WRITE_EXTERNAL_STORAGE + ) + != PackageManager.PERMISSION_GRANTED + ) { + ActivityCompat.requestPermissions( + this@ActivityCapturePost, + arrayOf(Manifest.permission.WRITE_EXTERNAL_STORAGE), + 101 + ) } + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - location=findViewById<View>(R.id.etActivityCapturePostLocation) as EditText - description=findViewById<View>(R.id.etActivityCapturePostDescription) as EditText - post=findViewById<View>(R.id.btnActivityCapturePostPost) as Button - showImage=findViewById<View>(R.id.ivActivityCapturePostImage) as ImageView - takePhoto=findViewById<View>(R.id.btnActivityCapturePostCapture) as Button - - //dodavanje sa kamere takePhoto.setOnClickListener { - Toast.makeText( - applicationContext, "camera intent button", Toast.LENGTH_LONG - ).show(); - Intent(MediaStore.ACTION_IMAGE_CAPTURE).also { takePictureIntent -> - takePictureIntent.resolveActivity(packageManager)?.also { - val photoFile: File? = try { - createImageFile() - } catch (ex: IOException) { - null - } - photoFile?.also { - photoURI= FileProvider.getUriForFile( - this, - "com.example.android.fileprovider", - it - ) - takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI) - startActivityForResult(takePictureIntent, 123) - } - } + + val APP_TAG = "BrzoDoLokacije" + val takePictureIntent = Intent(MediaStore.ACTION_IMAGE_CAPTURE) + /* val timeStamp: String = SimpleDateFormat("yyyyMMdd_HHmmss").format(Date()) + //val storageDir: File? = getExternalFilesDir(Environment.DIRECTORY_PICTURES) + //val photo= File(storageDir,"JPEG_${timeStamp}.jpg") + + val mediaStorageDir = File(getExternalFilesDir(Environment.DIRECTORY_PICTURES), APP_TAG) + if (!mediaStorageDir.exists() && !mediaStorageDir.mkdirs()) { + Log.d(APP_TAG, "failed to create directory") } + var photoFile = File(mediaStorageDir.path + File.separator + "${APP_TAG}_${timeStamp}.jpg") + if (photoFile != null) { + val fileProvider: Uri = + FileProvider.getUriForFile(this, "com.codepath.fileprovider", photoFile!!) + intent.putExtra(MediaStore.EXTRA_OUTPUT, fileProvider) + } +*/ + cameraActivityResultLauncher.launch(takePictureIntent) } - post.setOnClickListener{ - locationString=location.text.toString().trim() - descriptionString=description.text.toString().trim() + + post.setOnClickListener { + locationString = location.text.toString().trim() + descriptionString = description.text.toString().trim() //prazan unos? - if(locationString.isEmpty()) { - location.hint="Unesite lokaciju" + if (locationString.isEmpty()) { + location.hint = "Unesite lokaciju" location.setHintTextColor(Color.RED) - } - if(descriptionString.isEmpty()) { - description.hint="Unesite lokaciju" + }else + if (descriptionString.isEmpty()) { + description.hint = "Unesite opis" description.setHintTextColor(Color.RED) + }else if(f!=null){ + uploadLocation() } - /*if(!locationString.isEmpty() && !descriptionString.isEmpty()){ - //dodaj u bazu - }*/ + } } - override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { - super.onActivityResult(requestCode, resultCode, data) - if (resultCode == Activity.RESULT_OK && requestCode == 123 && data != null){ - Toast.makeText( - applicationContext, "camera intent", Toast.LENGTH_LONG - ).show(); + var f:File?=null + private val cameraActivityResultLauncher = + registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> + if (result.resultCode === RESULT_OK && result.data != null) { + val bundle = result.data!!.extras + val bitmap = bundle!!["data"] as Bitmap? + val outputStream = ByteArrayOutputStream() + bitmap!!.compress(Bitmap.CompressFormat.PNG,100,outputStream) + val bitmapdata = outputStream.toByteArray() + val inputstream: InputStream = ByteArrayInputStream(bitmapdata) + f=File.createTempFile("temp","12345") + f!!.writeBytes(inputstream!!.readBytes()) + - showImage.setImageURI(photoURI) - Toast.makeText( - applicationContext, currentPhotoPath, Toast.LENGTH_LONG - ).show(); - /*var photo:Bitmap=data.extras!!.get("data") as Bitmap - showImage.setImageBitmap(photo)*/ + showImage.setImageBitmap(bitmap) + takePhoto.isVisible=false + + } + } + fun uploadLocation() { + val api = RetrofitHelper.getInstance() + var loc: Location = Location("",locationString,"","","",0.0,0.0, LocationType.GRAD) + var jwtString= SharedPreferencesHelper.getValue("jwt",this) + var data=api.addLocation("Bearer "+jwtString,loc) + + + data.enqueue(object : retrofit2.Callback<Location?> { + override fun onResponse(call: Call<Location?>, response: Response<Location?>) { + if(response.isSuccessful()){ + Toast.makeText( + applicationContext, "USPEH", Toast.LENGTH_LONG + ).show(); + uploadPost(response.body()!!._id) + Log.d("MAIN","RADI") + Log.d("MAIN","RADI") + + }else { + + if (response.errorBody() != null) { + Log.d("Main",response.errorBody()!!.string()) + } + Log.d("Main",response.message()) + } + + + } + + override fun onFailure(call: Call<Location?>, t: Throwable) { + Log.d("Main",t.toString()) + } + }) + } + fun uploadPost(loc:String){ + val api = RetrofitHelper.getInstance() + var desc=descriptionString + description.text.clear() + //loc + //desc + var locReq= RequestBody.create("text/plain".toMediaTypeOrNull(),loc) + var descReq= RequestBody.create("text/plain".toMediaTypeOrNull(),desc) + var idReq= RequestBody.create("text/plain".toMediaTypeOrNull(),"dsa") + val imagesParts = arrayOfNulls<MultipartBody.Part>( + 1 + ) + + var imageBody= RequestBody.create("image/*".toMediaTypeOrNull(),f!!) + imagesParts[0]= MultipartBody.Part.createFormData("images",f!!.name,imageBody) + + var jwtString= SharedPreferencesHelper.getValue("jwt",this) + var data=api.addPost("Bearer "+jwtString,imagesParts,idReq,descReq,locReq) + + + data.enqueue(object : retrofit2.Callback<PostPreview?> { + override fun onResponse(call: Call<PostPreview?>, response: Response<PostPreview?>) { + if(response.isSuccessful()){ + Toast.makeText( + applicationContext, "USPEH", Toast.LENGTH_LONG + ).show(); + }else { + + if (response.errorBody() != null) { + Toast.makeText( + applicationContext, + response.errorBody()!!.string(), + Toast.LENGTH_LONG + ).show(); + Log.d("Main",response.errorBody()!!.string()) + } + } + + + } + + override fun onFailure(call: Call<PostPreview?>, t: Throwable) { + Toast.makeText( + applicationContext, t.toString(), Toast.LENGTH_LONG + ).show(); + Log.d("Main",t.toString()) + } + }) + } } -}
\ No newline at end of file + + + + diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivitySinglePost.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivitySinglePost.kt index 32cb3ef..ea82cda 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivitySinglePost.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivitySinglePost.kt @@ -1,45 +1,212 @@ package com.example.brzodolokacije.Activities import android.os.Bundle -import android.os.Handler -import android.os.Looper +import android.util.Log +import android.widget.Adapter +import android.widget.Toast import androidx.appcompat.app.AppCompatActivity +import androidx.fragment.app.Fragment import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.example.brzodolokacije.Adapters.CommentsAdapter import com.example.brzodolokacije.Adapters.PostImageAdapter -import com.example.brzodolokacije.Models.PostImage -import com.example.brzodolokacije.Models.PostPreview +import com.example.brzodolokacije.Models.* import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.RetrofitHelper +import com.example.brzodolokacije.Services.SharedPreferencesHelper import com.example.brzodolokacije.databinding.ActivitySinglePostBinding +import okhttp3.ResponseBody +import okhttp3.internal.notifyAll +import retrofit2.Call +import retrofit2.Response class ActivitySinglePost : AppCompatActivity() { private lateinit var binding: ActivitySinglePostBinding - private var layoutManagerVar: RecyclerView.LayoutManager? = null - private var adapterVar: RecyclerView.Adapter<PostImageAdapter.ViewHolder>? = null - private var recyclerView: RecyclerView?=null + private var layoutManagerImages: RecyclerView.LayoutManager? = null + private var layoutManagerComments: RecyclerView.LayoutManager? = null + private var adapterImages: RecyclerView.Adapter<PostImageAdapter.ViewHolder>? = null + private var adapterComments: RecyclerView.Adapter<CommentsAdapter.ViewHolder>? = null + private var recyclerViewImages: RecyclerView?=null + private var recyclerViewComments: RecyclerView?=null private lateinit var post:PostPreview + private var comments:MutableList<CommentSend>?=mutableListOf() + private var starNumber:Number=0 override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding=ActivitySinglePostBinding.inflate(layoutInflater) setContentView(binding.root) post= intent.extras?.getParcelable("selectedPost")!! - //load data for the list //instantiate adapter and linearLayout - adapterVar= PostImageAdapter(this@ActivitySinglePost, post.images as MutableList<PostImage>) - layoutManagerVar= LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false) - recyclerView = binding.rvMain + adapterImages= PostImageAdapter(this@ActivitySinglePost, post.images as MutableList<PostImage>) + layoutManagerImages= LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false) + recyclerViewImages = binding.rvMain + buildRecyclerViewComments() + requestGetComments() + // set recyclerView attributes - recyclerView?.setHasFixedSize(true) - recyclerView?.layoutManager = layoutManagerVar - recyclerView?.adapter = adapterVar + recyclerViewImages?.setHasFixedSize(true) + recyclerViewImages?.layoutManager = layoutManagerImages + recyclerViewImages?.adapter = adapterImages loadTextComponents() + setRatingListeners() + } + + fun buildRecyclerViewComments(){ + recyclerViewComments=binding.rvComments + adapterComments=CommentsAdapter(comments as MutableList<CommentSend>) + layoutManagerComments= LinearLayoutManager(this@ActivitySinglePost,LinearLayoutManager.VERTICAL,false) + recyclerViewComments!!.setHasFixedSize(true) + recyclerViewComments!!.layoutManager=layoutManagerComments + recyclerViewComments!!.adapter= adapterComments + } + + fun setRatingListeners(){ + val emptyStar=R.drawable.empty_star + val fullStar=R.drawable.full_star + + + binding.rateStar1.setOnClickListener { + Toast.makeText(this,"kliknuta prva zvezdica",Toast.LENGTH_SHORT).show() + binding.rateStar1.setImageResource(fullStar) + binding.rateStar2.setImageResource(emptyStar) + binding.rateStar3.setImageResource(emptyStar) + binding.rateStar4.setImageResource(emptyStar) + binding.rateStar5.setImageResource(emptyStar) + starNumber=1 + } + binding.rateStar2.setOnClickListener { + Toast.makeText(this,"kliknuta druga zvezdica",Toast.LENGTH_SHORT).show() + binding.rateStar1.setImageResource(fullStar) + binding.rateStar2.setImageResource(fullStar) + binding.rateStar3.setImageResource(emptyStar) + binding.rateStar4.setImageResource(emptyStar) + binding.rateStar5.setImageResource(emptyStar) + starNumber=2 + } + binding.rateStar3.setOnClickListener { + Toast.makeText(this,"kliknuta treca zvezdica",Toast.LENGTH_SHORT).show() + binding.rateStar1.setImageResource(fullStar) + binding.rateStar2.setImageResource(fullStar) + binding.rateStar3.setImageResource(fullStar) + binding.rateStar4.setImageResource(emptyStar) + binding.rateStar5.setImageResource(emptyStar) + starNumber=3 + } + binding.rateStar4.setOnClickListener { + Toast.makeText(this,"kliknuta cetvrta zvezdica",Toast.LENGTH_SHORT).show() + binding.rateStar1.setImageResource(fullStar) + binding.rateStar2.setImageResource(fullStar) + binding.rateStar3.setImageResource(fullStar) + binding.rateStar4.setImageResource(fullStar) + binding.rateStar5.setImageResource(emptyStar) + starNumber=4 + } + binding.rateStar5.setOnClickListener { + Toast.makeText(this,"kliknuta peta zvezdica",Toast.LENGTH_SHORT).show() + binding.rateStar1.setImageResource(fullStar) + binding.rateStar2.setImageResource(fullStar) + binding.rateStar3.setImageResource(fullStar) + binding.rateStar4.setImageResource(fullStar) + binding.rateStar5.setImageResource(fullStar) + starNumber=5 + } + binding.submitRating.setOnClickListener{ + if(starNumber.toInt()>0){ + val rating= RatingReceive(starNumber.toInt(),post._id) + requestAddRating(rating) + Toast.makeText(this,"poslato",Toast.LENGTH_SHORT).show() + } + } + binding.btnPostComment.setOnClickListener { + if(binding.NewComment.text.isNotEmpty()){ + val comment=CommentReceive(binding.NewComment.text.toString(),"") + requestAddComment(comment) + + + } + else{ + Toast.makeText(this@ActivitySinglePost,"Unesite tekst komentara.",Toast.LENGTH_LONG).show() + } + } + + } + + fun requestAddComment(comment:CommentReceive){ + val postApi= RetrofitHelper.getInstance() + val token= SharedPreferencesHelper.getValue("jwt", this@ActivitySinglePost) + val request=postApi.addComment("Bearer "+token,post._id,comment) + request.enqueue(object : retrofit2.Callback<ResponseBody?> { + override fun onResponse(call: Call<ResponseBody?>, response: Response<ResponseBody?>) { + if(response.isSuccessful){ + requestGetComments() + binding.NewComment.text.clear() + }else{ + if(response.errorBody()!=null) + Log.d("main1",response.message().toString()) + } + + + } + + override fun onFailure(call: Call<ResponseBody?>, t: Throwable) { + Log.d("main2",t.message.toString()) + } + }) } + fun requestGetComments(){ + val postApi= RetrofitHelper.getInstance() + val token= SharedPreferencesHelper.getValue("jwt", this@ActivitySinglePost) + val request=postApi.getComments("Bearer "+token,post._id) + request.enqueue(object : retrofit2.Callback<MutableList<CommentSend>?> { + override fun onResponse(call: Call<MutableList<CommentSend>?>, response: Response<MutableList<CommentSend>?>) { + if(response.isSuccessful){ + comments= response.body()!! + if(comments!=null && comments!!.isNotEmpty()){ + buildRecyclerViewComments() + if(comments!=null) + binding.tvCommentCount.text=comments?.size.toString() + else + binding.tvCommentCount.text="0" + } + }else{ + if(response.errorBody()!=null) + Log.d("main1",response.message().toString()) + } + + + } + + override fun onFailure(call: Call<MutableList<CommentSend>?>, t: Throwable) { + Log.d("main2",t.message.toString()) + } + }) + } + + fun requestAddRating(rating:RatingReceive){ + val postApi= RetrofitHelper.getInstance() + val token= SharedPreferencesHelper.getValue("jwt", this@ActivitySinglePost) + val request=postApi.addRating("Bearer "+token,post._id,rating) + request.enqueue(object : retrofit2.Callback<ResponseBody?> { + override fun onResponse(call: Call<ResponseBody?>, response: Response<ResponseBody?>) { + if(response.isSuccessful){ + Toast.makeText( + this@ActivitySinglePost, "prosao zahtev", Toast.LENGTH_LONG + ).show() + }else{ + if(response.errorBody()!=null) + Log.d("main1",response.errorBody().toString()) + } + - private fun loadImages(){ + } + override fun onFailure(call: Call<ResponseBody?>, t: Throwable) { + Log.d("main2",t.message.toString()) + } + }) } private fun loadTextComponents() { @@ -59,4 +226,4 @@ class ActivitySinglePost : AppCompatActivity() { } } -}
\ No newline at end of file +} diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/NavigationActivity.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/NavigationActivity.kt index 0a69722..604b373 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/NavigationActivity.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/NavigationActivity.kt @@ -7,6 +7,7 @@ import android.view.View import android.widget.Button import android.widget.ImageButton import android.widget.Toast +import androidx.appcompat.app.AppCompatDelegate import androidx.fragment.app.Fragment import com.example.brzodolokacije.Fragments.* import com.example.brzodolokacije.R @@ -24,15 +25,17 @@ class NavigationActivity : AppCompatActivity() { Toast.makeText( applicationContext, "Open ", Toast.LENGTH_LONG ).show(); + val fragmentHomePage=FragmentHomePage() val fragmentShowPosts=FragmentShowPosts() val browseFragment=FragmentBrowse() val addPostFragment= FragmentAddNew() val profileFragment=FragmentProfile() val bottomNav=findViewById<View>(R.id.bottomNavigationView) as BottomNavigationView - setCurrentFragment(fragmentShowPosts) + setCurrentFragment(fragmentHomePage) bottomNav.setOnNavigationItemSelectedListener { when(it.itemId){ - R.id.navHome->setCurrentFragment(fragmentShowPosts) + R.id.navHomePage->setCurrentFragment(fragmentHomePage) + R.id.navAllPosts->setCurrentFragment(fragmentShowPosts) //R.id.navAddPost->setCurrentFragment(addPostFragment) R.id.navAddPost->showBottomSheetAddNew() R.id.navBrowse->setCurrentFragment(browseFragment) @@ -93,6 +96,7 @@ class NavigationActivity : AppCompatActivity() { var newLocation=bottomSheetDialog.findViewById<View>(R.id.btnBottomSheetAddNewLocation) as ImageButton newPost.setOnClickListener{ + bottomSheetDialog.dismiss() showBottomSheetAddPost() } diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/CommentsAdapter.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/CommentsAdapter.kt new file mode 100644 index 0000000..d43057f --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/CommentsAdapter.kt @@ -0,0 +1,38 @@ +package com.example.brzodolokacije.Adapters + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import com.example.brzodolokacije.Models.CommentSend +import com.example.brzodolokacije.databinding.SingleCommentBinding + +class CommentsAdapter (val items : MutableList<CommentSend>) + : RecyclerView.Adapter<CommentsAdapter.ViewHolder>(){ + //constructer has one argument - list of objects that need to be displayed + //it is bound to xml of single item + private lateinit var binding: SingleCommentBinding + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { + val inflater = LayoutInflater.from(parent.context) + binding=SingleCommentBinding.inflate(inflater,parent,false) + return ViewHolder(binding) + } + override fun onBindViewHolder(holder: ViewHolder, position: Int){ + //sets components of particular item + holder.bind(items[position]) + } + override fun getItemCount(): Int { + try{ + return items.size + }catch (e:Exception){ + return 0 + } + } + inner class ViewHolder(itemView : SingleCommentBinding) : RecyclerView.ViewHolder(itemView.root){ + fun bind(item : CommentSend){ + binding.apply { + tvCommentAuthor.text=item.username + tvCommentText.text=item.comment + } + } + } +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ShowPostsHomePageAdapter.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ShowPostsHomePageAdapter.kt new file mode 100644 index 0000000..c382cf7 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ShowPostsHomePageAdapter.kt @@ -0,0 +1,48 @@ +package com.example.brzodolokacije.Adapters + +import android.app.Activity +import android.util.Log +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.core.net.toUri +import androidx.recyclerview.widget.RecyclerView +import com.bumptech.glide.Glide +import com.example.brzodolokacije.Models.PostPreview +import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.RetrofitHelper +import java.security.AccessController.getContext + +class ShowPostsHomePageAdapter(var postPreview:MutableList<PostPreview>,val activity:Activity): + RecyclerView.Adapter<ShowPostsHomePageAdapter.PostViewHolder>() { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): PostViewHolder { + Log.d("main","***********************************************adapter******************************************************") + val view=LayoutInflater.from(parent.context).inflate(R.layout.post_item_home_page,parent,false) + return PostViewHolder(view) + } + + override fun onBindViewHolder(holder: PostViewHolder, position: Int) { + return holder.bindView(postPreview[position] ) + } + + override fun getItemCount(): Int { + return postPreview.size + } + + +inner class PostViewHolder(view: View):RecyclerView.ViewHolder(view){ + private val background:com.google.android.material.imageview.ShapeableImageView=view.findViewById(R.id.ivPIHPBackground) + private val locationName:TextView=view.findViewById(R.id.tvPIHPLocationName) + + fun bindView(postPreview:PostPreview){ + //background.setImageURI(postPreview.images[0]._id.to) + if(postPreview.images.isNotEmpty()) { + Glide.with(activity) + .load(RetrofitHelper.baseUrl + "/api/post/image/" + postPreview.images[0]._id) + .into(background) + } + locationName.text=postPreview.location.name + } +} + }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentBrowse.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentBrowse.kt index 1bd98a0..5ba3785 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentBrowse.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentBrowse.kt @@ -1,60 +1,299 @@ package com.example.brzodolokacije.Fragments +import android.Manifest +import android.content.Context +import android.content.pm.PackageManager +import android.location.Location +import android.location.LocationManager +import android.os.Build import android.os.Bundle -import androidx.fragment.app.Fragment +import android.os.Looper +import android.os.StrictMode +import android.os.StrictMode.ThreadPolicy +import android.preference.PreferenceManager +import android.util.DisplayMetrics +import android.view.KeyEvent import android.view.LayoutInflater import android.view.View +import android.view.View.OnKeyListener import android.view.ViewGroup +import android.widget.Toast +import androidx.core.app.ActivityCompat +import androidx.core.content.ContextCompat +import androidx.fragment.app.Fragment import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.GeocoderHelper +import com.google.android.gms.location.* +import com.google.android.material.button.MaterialButton +import com.google.android.material.floatingactionbutton.FloatingActionButton +import com.google.android.material.textfield.TextInputEditText +import org.osmdroid.config.Configuration +import org.osmdroid.tileprovider.tilesource.TileSourceFactory +import org.osmdroid.util.GeoPoint +import org.osmdroid.views.MapView +import org.osmdroid.views.overlay.Marker +import org.osmdroid.views.overlay.ScaleBarOverlay +import org.osmdroid.views.overlay.compass.CompassOverlay +import org.osmdroid.views.overlay.compass.InternalCompassOrientationProvider +import org.osmdroid.views.overlay.gestures.RotationGestureOverlay +import org.osmdroid.views.overlay.mylocation.GpsMyLocationProvider +import org.osmdroid.views.overlay.mylocation.MyLocationNewOverlay -// TODO: Rename parameter arguments, choose names that match -// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER -private const val ARG_PARAM1 = "param1" -private const val ARG_PARAM2 = "param2" -/** - * A simple [Fragment] subclass. - * Use the [FragmentBrowse.newInstance] factory method to - * create an instance of this fragment. - */ class FragmentBrowse : Fragment(R.layout.fragment_browse) { - // TODO: Rename and change types of parameters - private var param1: String? = null - private var param2: String? = null + var map: MapView? = null + var mLocationOverlay:MyLocationNewOverlay?=null + var mRotationGestureOverlay:RotationGestureOverlay?=null + var mScaleBarOverlay: ScaleBarOverlay?=null + var mCompassOverlay:CompassOverlay?=null + private lateinit var locationManager: LocationManager + private lateinit var searchButton: MaterialButton + private lateinit var gpsButton:FloatingActionButton + private lateinit var searchBar: TextInputEditText + var client: FusedLocationProviderClient? = null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - arguments?.let { - param1 = it.getString(ARG_PARAM1) - param2 = it.getString(ARG_PARAM2) - } + + } override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_browse, container, false) - } - - companion object { - /** - * Use this factory method to create a new instance of - * this fragment using the provided parameters. - * - * @param param1 Parameter 1. - * @param param2 Parameter 2. - * @return A new instance of fragment FragmentBrowse. - */ - // TODO: Rename and change types and number of parameters - @JvmStatic - fun newInstance(param1: String, param2: String) = - FragmentBrowse().apply { - arguments = Bundle().apply { - putString(ARG_PARAM1, param1) - putString(ARG_PARAM2, param2) - } + var v:View=inflater.inflate(R.layout.fragment_browse, container, false) + val ctx: Context = requireContext() + Configuration.getInstance().load(ctx,PreferenceManager.getDefaultSharedPreferences(ctx)); + map=v.findViewById(R.id.FragmentBrowseMapView) as MapView + map!!.setTileSource(TileSourceFactory.MAPNIK); + setUpMap() + searchButton=v.findViewById<View>(R.id.FragmentBrowseSearchButton) as MaterialButton + gpsButton=v.findViewById<View>(R.id.FragmentBrowseMyLocation) as FloatingActionButton + searchBar=v.findViewById<View>(R.id.FragmentBrowseSearchBar) as TextInputEditText + client=LocationServices.getFusedLocationProviderClient(requireActivity()) + searchButton.setOnClickListener{ + searchMap() + + } + gpsButton.setOnClickListener{ + getLocation() + } + searchBar.setOnKeyListener(OnKeyListener { v1, keyCode, event -> // If the event is a key-down event on the "enter" button + if (event.action === KeyEvent.ACTION_DOWN && + keyCode == KeyEvent.KEYCODE_ENTER + ) { + // Perform action on key press + searchMap() + return@OnKeyListener true } + false + }) + + return v + } + + override fun onResume() { + super.onResume() + map!!.onResume() } + override fun onPause() { + super.onPause() + map!!.onPause() + } + fun setUpMap(){ + //Set up controlls and startPoint + map!!.setBuiltInZoomControls(true); + map!!.setMultiTouchControls(true); + val mapController = map!!.controller + mapController.setZoom(15) + fixNetworkPolicy() + + //my location + //checkLocPerm() + mLocationOverlay = MyLocationNewOverlay(GpsMyLocationProvider(context), map) + mLocationOverlay!!.enableMyLocation() + map!!.getOverlays().add(this.mLocationOverlay) + + //start point + val startPoint = GeoPoint(44.0107,20.9181)//dodati nasu lokaciju TODO + mapController.setCenter(startPoint) + + //rotation gestures + mRotationGestureOverlay = RotationGestureOverlay(context, map) + mRotationGestureOverlay!!.setEnabled(true) + map!!.setMultiTouchControls(true) + map!!.getOverlays().add(this.mRotationGestureOverlay) + //Map scale bar + val dm:DisplayMetrics=requireContext().resources.displayMetrics + mScaleBarOverlay = ScaleBarOverlay(map); + mScaleBarOverlay!!.setCentred(true); + mScaleBarOverlay!!.setScaleBarOffset(dm.widthPixels / 2, 10); + map!!.getOverlays().add(this.mScaleBarOverlay); + + //Compass + this.mCompassOverlay = + CompassOverlay(context, InternalCompassOrientationProvider(context), map) + mCompassOverlay!!.enableCompass() + map!!.getOverlays().add(this.mCompassOverlay) + } + fun checkLocPerm(){ + if (ContextCompat.checkSelfPermission( + requireContext(), + Manifest.permission.ACCESS_FINE_LOCATION + ) + != PackageManager.PERMISSION_GRANTED + ) { + ActivityCompat.requestPermissions( + requireActivity(), + arrayOf(Manifest.permission.ACCESS_FINE_LOCATION), + 101 + ) + } + } + + fun fixNetworkPolicy(){ + val SDK_INT = Build.VERSION.SDK_INT + if (SDK_INT > 8) { + val policy = ThreadPolicy.Builder() + .permitAll().build() + StrictMode.setThreadPolicy(policy) + //your codes here + } + } + fun searchMap(){ + var geocoder= GeocoderHelper.getInstance() + //Log.d("Main",geocoder!!.getFromLocationName("Paris",1)[0].countryName) + var locString=searchBar.text.toString().trim() + if(locString==null || locString=="") + Toast.makeText(requireContext(),"Unesite naziv lokacije",Toast.LENGTH_SHORT) + else{ + var result=geocoder!!.getFromLocationName(locString,1)[0] + if(result==null) + Toast.makeText(requireContext(),"Nepostojeca lokacija",Toast.LENGTH_SHORT) + else{ + //move to spot + val searchPoint = GeoPoint(result.latitude,result.longitude) + val startMarker = Marker(map) + startMarker.setPosition(searchPoint) + startMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_BOTTOM) + map!!.getOverlays().add(startMarker) + map!!.controller.animateTo(searchPoint) + + + } + } + } + private fun getLocation() { + if (ContextCompat.checkSelfPermission( + requireActivity(), + Manifest.permission + .ACCESS_FINE_LOCATION) + == PackageManager + .PERMISSION_GRANTED + && ContextCompat.checkSelfPermission( + requireActivity(), + Manifest.permission + .ACCESS_COARSE_LOCATION) + == PackageManager + .PERMISSION_GRANTED) { + // When permission is granted + // Call method + getCurrentLocation() + } + else { + requestPermissions( + arrayOf( + Manifest.permission.ACCESS_FINE_LOCATION, + Manifest.permission.ACCESS_COARSE_LOCATION + ), + 111 + ) + + } + } + override fun onRequestPermissionsResult( + requestCode: Int, permissions: Array<String?>, + grantResults: IntArray + ) { + super.onRequestPermissionsResult( + requestCode, permissions, grantResults + ) + // Check condition + if (requestCode == 111 && grantResults.size > 0 + && (grantResults[0] + grantResults[1] + == PackageManager.PERMISSION_GRANTED) + ) { + // When permission are granted + // Call method + getCurrentLocation() + } else { + // When permission are denied + // Display toast + Toast + .makeText( + activity, + "Permission denied", + Toast.LENGTH_SHORT + ) + .show() + } + } + @Suppress("MissingPermission") + private fun getCurrentLocation(){ + val locationManager = requireActivity() + .getSystemService( + Context.LOCATION_SERVICE + ) as LocationManager + checkLocPerm() + if (locationManager.isProviderEnabled( + LocationManager.GPS_PROVIDER) + || locationManager.isProviderEnabled( + LocationManager.NETWORK_PROVIDER)){ + + client!!.getLastLocation().addOnCompleteListener {task -> + var location = task.result + if(location == null) { + val locationRequest: LocationRequest = LocationRequest() + .setPriority( + LocationRequest.PRIORITY_HIGH_ACCURACY + ) + .setInterval(10000) + .setFastestInterval( + 1000 + ) + .setNumUpdates(1) + + val locationCallback: LocationCallback = object : LocationCallback() { + override fun onLocationResult( + locationResult: LocationResult + ) { + // Initialize + // location + val location1: Location? = locationResult + .lastLocation + // Set latitude + map!!.controller.animateTo(GeoPoint(location1!!.latitude,location1!!.longitude)) + Toast.makeText(requireContext()," "+location1!!.latitude,Toast.LENGTH_LONG) + + } + } + client!!.requestLocationUpdates( + locationRequest, + locationCallback, + Looper.myLooper()); + } else { + map!!.controller.animateTo(GeoPoint(location!!.latitude,location!!.longitude)) + Toast.makeText(requireContext()," "+location.latitude,Toast.LENGTH_LONG) + } + + + + } + } + + + + +} }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentHomePage.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentHomePage.kt new file mode 100644 index 0000000..1be978d --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentHomePage.kt @@ -0,0 +1,76 @@ +package com.example.brzodolokacije.Fragments + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Button +import android.widget.ImageButton +import android.widget.ImageView +import android.widget.ScrollView +import android.widget.Toast +import androidx.core.view.isVisible +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentTransaction +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.brzodolokacije.Adapters.ShowPostsHomePageAdapter +import com.example.brzodolokacije.Interfaces.IBackendApi +import com.example.brzodolokacije.Models.LocationType +import com.example.brzodolokacije.Models.PostPreview +import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.RetrofitHelper.baseUrl +import com.example.brzodolokacije.Services.SharedPreferencesHelper +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory + + +class FragmentHomePage : Fragment() { + + private lateinit var btnBack:ImageView + /* override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + }*/ + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + var view:View= inflater.inflate(R.layout.fragment_home_page, container, false) + btnBack=view.findViewById(R.id.btnFragmentHomePageBack) + setBtnBackInvisible() + + var fm: FragmentTransaction =childFragmentManager.beginTransaction() + fm.replace(R.id.flFragmentHomePageMainContent, FragmentHomePageMainScroll()) + fm.commit() + + btnBack.setOnClickListener{ + changeLocationViewToScrollView() + setBtnBackInvisible() + } + + + return view + } + fun changeScrollVIewToLocationView(){ + var fm: FragmentTransaction =childFragmentManager.beginTransaction() + fm.replace(R.id.flFragmentHomePageMainContent, FragmentShowPostsByLocation()) + fm.commit() + } + fun changeLocationViewToScrollView(){ + var fm: FragmentTransaction =childFragmentManager.beginTransaction() + fm.replace(R.id.flFragmentHomePageMainContent, FragmentHomePageMainScroll()) + fm.commit() + } + fun setBtnBackInvisible(){ + btnBack.isVisible=false + } + fun setBtnBackVisible(){ + btnBack.isVisible=true + } +} diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentHomePageMainScroll.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentHomePageMainScroll.kt new file mode 100644 index 0000000..bde4dd2 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentHomePageMainScroll.kt @@ -0,0 +1,263 @@ +package com.example.brzodolokacije.Fragments + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.ImageButton +import android.widget.Toast +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentTransaction +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.brzodolokacije.Adapters.ShowPostsHomePageAdapter +import com.example.brzodolokacije.Interfaces.IBackendApi +import com.example.brzodolokacije.Models.LocationType +import com.example.brzodolokacije.Models.PostPreview +import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.RetrofitHelper +import com.example.brzodolokacije.Services.SharedPreferencesHelper +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory + +class FragmentHomePageMainScroll : Fragment() { + + private lateinit var posts : MutableList<PostPreview> + private lateinit var mostViewedPosts : MutableList<PostPreview> + private lateinit var newestPosts : MutableList<PostPreview> + private lateinit var bestRatedPosts:MutableList<PostPreview> + private lateinit var rvPopular: RecyclerView + private lateinit var rvNewest: RecyclerView + private lateinit var rvBestRated: RecyclerView + //NAVIGATION BUTTONS + private lateinit var location_city: ImageButton + private lateinit var location_beach: ImageButton + private lateinit var location_mountain: ImageButton + private lateinit var location_lake: ImageButton + private lateinit var location_spa: ImageButton + private lateinit var location_waterfall: ImageButton + private lateinit var location_amusement_park: ImageButton + private lateinit var location_attraction: ImageButton + private lateinit var location_landmark: ImageButton + + private lateinit var filter: LocationType + private lateinit var filterString: String + + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + + val view= inflater.inflate(R.layout.fragment_home_page_main_scroll, container, false) + + + + rvPopular=view.findViewById(R.id.rvFragmentHomePagePopular) + rvNewest=view.findViewById(R.id.rvFragmentHomePageNewest) + rvBestRated=view.findViewById(R.id.rvFragmentHomePageBestRated) + + location_amusement_park=view.findViewById(R.id.btnFragmentHomePagelocation_amusement_park) + location_attraction=view.findViewById(R.id.btnFragmentHomePagelocation_attraction) + location_beach=view.findViewById(R.id.btnFragmentHomePagelocation_beach) + location_lake=view.findViewById(R.id.btnFragmentHomePagelocation_lake) + location_city=view.findViewById(R.id.btnFragmentHomePagelocation_city) + location_landmark=view.findViewById(R.id.btnFragmentHomePagelocation_landmark) + location_mountain=view.findViewById(R.id.btnFragmentHomePagelocation_mountain) + location_spa=view.findViewById(R.id.btnFragmentHomePagelocation_spa) + location_waterfall=view.findViewById(R.id.btnFragmentHomePagelocation_waterfall) + + //pokupi sve objave iz baze' + getAllPosts() + + var bundle=Bundle() + var fragment=FragmentShowPostsByLocation() + + location_spa.setOnClickListener { + Toast.makeText( + activity, "BANJAAAAAAAAAAAAAAA", Toast.LENGTH_LONG + ).show(); + filter=LocationType.BANJA + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + + + } + location_waterfall.setOnClickListener { + filter=LocationType.VODOPAD + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + + + } + location_mountain.setOnClickListener { + filter=LocationType.PLANINA + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + + + } + location_landmark.setOnClickListener { + filter=LocationType.LOKALITET + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + + + } + location_city.setOnClickListener { + filter=LocationType.GRAD + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + + } + location_lake.setOnClickListener { + filter=LocationType.JEZERO + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + + } + location_attraction.setOnClickListener { + filter=LocationType.ATRAKCIJA + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + } + location_amusement_park.setOnClickListener { + filter=LocationType.ZABAVNI_PARK + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + + } + location_beach.setOnClickListener { + filter=LocationType.PLAZA + filterString=filter.toString() + bundle.putString("data",filterString) + fragment.arguments=bundle + val parentFrag: FragmentHomePage = this@FragmentHomePageMainScroll.getParentFragment() as FragmentHomePage + parentFrag.changeScrollVIewToLocationView() + parentFrag.setBtnBackVisible() + + } + + + + return view + } + + private fun getAllPosts(){ + val api = Retrofit.Builder() + .addConverterFactory(GsonConverterFactory.create()) + .baseUrl(RetrofitHelper.baseUrl) + .build() + .create(IBackendApi::class.java) + val token= SharedPreferencesHelper.getValue("jwt", requireActivity()) + val data=api.getPosts("Bearer "+token) + + data.enqueue(object : Callback<MutableList<PostPreview>> { + override fun onResponse( + call: Call<MutableList<PostPreview>>, + response: Response<MutableList<PostPreview>> + ) { + if (response.body() == null) { +// Toast.makeText( +// activity, "get all null", Toast.LENGTH_LONG +// ).show(); + + return + } + //refresh list +// Toast.makeText( +// activity, "get all ", Toast.LENGTH_LONG +// ).show(); + posts = response.body()!!.toMutableList<PostPreview>() + getPopularPosts(posts) + getNewestPosts(posts) + getBestRatedPosts(posts) + } + + override fun onFailure(call: Call<MutableList<PostPreview>>, t: Throwable) { +// Toast.makeText( +// activity,"nema objava", Toast.LENGTH_LONG +// ).show(); + } + }) + } + + private fun getPopularPosts(allPosts:MutableList<PostPreview>){//most viewed +// Toast.makeText( +// activity, "get all mv ", Toast.LENGTH_LONG +// ).show(); + mostViewedPosts=allPosts + mostViewedPosts.sortByDescending { it.views } + rvPopular.apply { + layoutManager= LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL,false) + adapter= ShowPostsHomePageAdapter(mostViewedPosts,requireActivity()) + + } + + } + private fun getNewestPosts(allPosts:MutableList<PostPreview>){ +// Toast.makeText( +// activity, "get all r ", Toast.LENGTH_LONG +// ).show(); + newestPosts=allPosts/// izmeniti nakon dodavanja datuma u model!!!!!! + newestPosts.sortBy { it.ratings} + rvNewest.apply { + layoutManager= LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL,false) + adapter= ShowPostsHomePageAdapter(newestPosts,requireActivity()) + } + } + + private fun getBestRatedPosts(allPosts:MutableList<PostPreview>){ +// Toast.makeText( +// activity, "get all br ", Toast.LENGTH_LONG +// ).show(); + bestRatedPosts=allPosts + bestRatedPosts.sortByDescending { it.ratings } + rvBestRated.apply { + layoutManager= LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL,false) + adapter= ShowPostsHomePageAdapter(bestRatedPosts,requireActivity()) + } + + } + +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentProfile.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentProfile.kt index 243cab0..a792598 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentProfile.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentProfile.kt @@ -1,14 +1,32 @@ package com.example.brzodolokacije.Fragments +import android.content.Intent +import android.net.Uri import android.os.Bundle -import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import android.widget.Button +import android.widget.ImageView import android.widget.TextView +import android.widget.Toast +import androidx.appcompat.app.AppCompatActivity +import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentTransaction +import com.bumptech.glide.Glide +import com.example.brzodolokacije.Models.UserReceive import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.RetrofitHelper +import com.example.brzodolokacije.Services.SharedPreferencesHelper +import com.google.android.material.button.MaterialButton +import com.google.android.material.imageview.ShapeableImageView +import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.MultipartBody +import okhttp3.RequestBody +import okhttp3.ResponseBody +import retrofit2.Call +import retrofit2.Response +import java.io.File // TODO: Rename parameter arguments, choose names that match // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER @@ -35,6 +53,8 @@ class FragmentProfile : Fragment(R.layout.fragment_profile) { private lateinit var showMyPosts: Button private lateinit var showMyData: Button private lateinit var showMyRecensions: Button + private lateinit var profilePicture: ImageView + private lateinit var profilePicturePlus: MaterialButton override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? @@ -49,16 +69,15 @@ class FragmentProfile : Fragment(R.layout.fragment_profile) { showMyPosts=view.findViewById<View>(R.id.btnFragmentProfileShowMyPosts) as Button showMyData=view.findViewById<View>(R.id.btnFragmentProfileShowMyData) as Button showMyRecensions=view.findViewById<View>(R.id.btnFragmentProfileShowMyRecensions) as Button + profilePicture=view.findViewById<View>(R.id.tvFragmentProfileProfilePicture) as ImageView + profilePicturePlus=view.findViewById<View>(R.id.btnFragmentProfileProfilePicturePlus) as MaterialButton //podaci iz baze showMyPosts.setOnClickListener{ - var fm: FragmentTransaction =childFragmentManager.beginTransaction() - - fm.replace(R.id.flFragmentProfileFragmentContainer, FragmentUserPosts()) - fm.commit() + openMyPosts() } @@ -71,15 +90,105 @@ class FragmentProfile : Fragment(R.layout.fragment_profile) { } showMyRecensions.setOnClickListener{ - + getProfileInfo() var fm: FragmentTransaction =childFragmentManager.beginTransaction() fm.replace(R.id.flFragmentProfileFragmentContainer, FragmentMyRecensions()) fm.commit() } - + profilePicturePlus.setOnClickListener{ + addProfilePicture() + } + getProfileInfo() + openMyPosts() return view } + fun openMyPosts(){ + var fm: FragmentTransaction =childFragmentManager.beginTransaction() + + fm.replace(R.id.flFragmentProfileFragmentContainer, FragmentUserPosts()) + fm.commit() + } + + private fun addProfilePicture(){ + val intent= Intent(Intent.ACTION_PICK) + intent.action = Intent.ACTION_GET_CONTENT + intent.type="image/*" + startActivityForResult(Intent.createChooser(intent,"Izaberi profilnu sliku"),201) + } + private fun uploadProfilePicture(imageUri:Uri){ + val api =RetrofitHelper.getInstance() + var inputStream=requireActivity().getContentResolver().openInputStream(imageUri) + val file: File = File.createTempFile("temp","pfp") + file!!.writeBytes(inputStream!!.readBytes()) + var imageReq=RequestBody.create("image/*".toMediaTypeOrNull(),file) + val imageBody: MultipartBody.Part = MultipartBody.Part.createFormData("image", file.name, imageReq) + val token= SharedPreferencesHelper.getValue("jwt", requireActivity()) + val req=api.setPfp("Bearer "+token,imageBody) + + req.enqueue(object : retrofit2.Callback<ResponseBody?> { + override fun onResponse(call: Call<ResponseBody?>, response: Response<ResponseBody?>) { + if(response.isSuccessful()){ + getProfileInfo() + }else{ + if(response.errorBody()!=null) + Toast.makeText(activity, response.errorBody()!!.string(), Toast.LENGTH_LONG).show(); + } + } + override fun onFailure(call: Call<ResponseBody?>, t: Throwable) { + Toast.makeText( + activity, t.toString(), Toast.LENGTH_LONG + ).show(); + } + }) + } + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + //nakon otvaranja + if(requestCode==201 && resultCode== AppCompatActivity.RESULT_OK){ + var imageUri=data!!.data + uploadProfilePicture(imageUri!!) + + } + } + + private fun getProfileInfo(){ + val authApi=RetrofitHelper.getInstance() + val token= SharedPreferencesHelper.getValue("jwt", requireActivity()) + val request=authApi.selfProfile("Bearer "+token) + + request.enqueue(object : retrofit2.Callback<UserReceive?> { + override fun onResponse(call: Call<UserReceive?>, response: Response<UserReceive?>) { + if(response.isSuccessful()){ + setUserInfo(response.body()!!) + }else{ + if(response.errorBody()!=null) + Toast.makeText(activity, response.errorBody()!!.string(), Toast.LENGTH_LONG).show(); + } + } + override fun onFailure(call: Call<UserReceive?>, t: Throwable) { + Toast.makeText( + activity, t.toString(), Toast.LENGTH_LONG + ).show(); + } + }) + } + private fun setUserInfo(user:UserReceive){ + name.setText(user.name) + username.setText("@"+user.username) + postsCount.setText(user.postcount.toString()) + + followersCount.setText("to do") + followingCount.setText("to do") + + //Add Profile image + if(user.pfp!=null) { + Glide.with(requireActivity()) + .load(RetrofitHelper.baseUrl + "/api/post/image/" + user.pfp!!._id) + .circleCrop()//Round image + .into(profilePicture) + } + } }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentShowPosts.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentShowPosts.kt index 73744d4..83f6429 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentShowPosts.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentShowPosts.kt @@ -8,9 +8,12 @@ import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.ImageButton import android.widget.Toast +import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import com.example.brzodolokacije.Activities.NavigationActivity import com.example.brzodolokacije.Adapters.SampleAdapter import com.example.brzodolokacije.Adapters.ShowPostsAdapter @@ -19,29 +22,53 @@ import com.example.brzodolokacije.R import com.example.brzodolokacije.Services.RetrofitHelper import com.example.brzodolokacije.Services.SharedPreferencesHelper import com.example.brzodolokacije.databinding.FragmentHomeBinding +import com.example.brzodolokacije.databinding.FragmentShowPostsBinding +import kotlinx.android.synthetic.main.fragment_show_posts.* +import kotlinx.android.synthetic.main.fragment_show_posts.view.* import okhttp3.ResponseBody import retrofit2.Call import retrofit2.Response -class FragmentShowPosts : Fragment() { +class FragmentShowPosts : Fragment(), SwipeRefreshLayout.OnRefreshListener { - private lateinit var binding: FragmentShowPosts + private lateinit var binding: FragmentShowPostsBinding private var posts : MutableList<PostPreview> = mutableListOf() - private var layoutManagerVar: RecyclerView.LayoutManager? = null + private var linearManagerVar: RecyclerView.LayoutManager? = null private var adapterVar: RecyclerView.Adapter<ShowPostsAdapter.ViewHolder>? = null private var recyclerView: RecyclerView?=null + private var gridManagerVar: RecyclerView.LayoutManager?=null + private var swipeRefreshLayout:SwipeRefreshLayout?=null override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - //load data for the list - loadData() - Log.d("main","greska") + binding=FragmentShowPostsBinding.inflate(layoutInflater) //instantiate adapter and linearLayout + adapterVar=ShowPostsAdapter(requireActivity(),posts) + linearManagerVar= LinearLayoutManager(activity) + gridManagerVar=GridLayoutManager(activity,2) + } + + fun setUpListeners(rootView: View?){ + rootView?.findViewById<ImageButton>(R.id.btnGridLayout)?.setOnClickListener() { + if(recyclerView?.layoutManager!=gridManagerVar){ + recyclerView?.layoutManager=gridManagerVar + } + Log.d("main","klik") + } + + rootView?.findViewById<ImageButton>(R.id.btnLinearLayout)?.setOnClickListener() { + if(recyclerView?.layoutManager!=linearManagerVar){ + recyclerView?.layoutManager=linearManagerVar + } + Log.d("main","klik") + } + } + + fun requestToBack(){ val postApi= RetrofitHelper.getInstance() val token=SharedPreferencesHelper.getValue("jwt", requireActivity()) val request=postApi.getPosts("Bearer "+token) - request.enqueue(object : retrofit2.Callback<MutableList<PostPreview>?> { override fun onResponse(call: Call<MutableList<PostPreview>?>, response: Response<MutableList<PostPreview>?>) { if(response.isSuccessful){ @@ -50,6 +77,7 @@ class FragmentShowPosts : Fragment() { Toast.makeText( activity, "prosao zahtev", Toast.LENGTH_LONG ).show() + swipeRefreshLayout?.isRefreshing=false }else{ if(response.errorBody()!=null) Toast.makeText(activity, response.errorBody()!!.string(), Toast.LENGTH_LONG).show(); @@ -64,30 +92,8 @@ class FragmentShowPosts : Fragment() { ).show(); } }) - - adapterVar=ShowPostsAdapter(requireActivity(),posts) - layoutManagerVar= LinearLayoutManager(activity) } - private fun loadData() { - posts.add(PostPreview("123","asdasd", - Location("asd","Ajfelov toranj","Pariz", - "Francuska","idk",1.1,1.1, LocationType.GRAD),"opsiopsaid",13, - 4.3f,mutableListOf(),mutableListOf())) - posts.add(PostPreview("123","asdasd", - Location("asd","Ajfelov toranj","Pariz", - "Francuska","idk",1.1,1.1, LocationType.GRAD),"opsiopsaid",13, - 4.3f,mutableListOf(),mutableListOf())) - posts.add(PostPreview("123","asdasd", - Location("asd","Ajfelov toranj","Pariz", - "Francuska","idk",1.1,1.1, LocationType.GRAD),"opsiopsaid",13, - 4.3f,mutableListOf(),mutableListOf())) - posts.add(PostPreview("123","asdasd", - Location("asd","Ajfelov toranj","Pariz", - "Francuska","idk",1.1,1.1, LocationType.GRAD),"opsiopsaid",13, - 4.3f,mutableListOf(),mutableListOf())) - } - override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? @@ -96,9 +102,27 @@ class FragmentShowPosts : Fragment() { recyclerView = rootView?.findViewById(R.id.rvMain) // set recyclerView attributes recyclerView?.setHasFixedSize(true) - recyclerView?.layoutManager = layoutManagerVar + //recyclerView?.layoutManager = linearManagerVar + recyclerView?.layoutManager = linearManagerVar recyclerView?.adapter = adapterVar + setUpListeners(rootView) + swipeRefreshLayout = rootView?.findViewById<View>(R.id.swipeContainer) as SwipeRefreshLayout + swipeRefreshLayout?.setOnRefreshListener(this) + swipeRefreshLayout?.setColorSchemeResources( + R.color.purple_200, + R.color.teal_200, + R.color.dark_blue_transparent, + R.color.purple_700 + ) + swipeRefreshLayout?.post(kotlinx.coroutines.Runnable { + swipeRefreshLayout?.isRefreshing=true + requestToBack() + }) return rootView } + override fun onRefresh() { + requestToBack() + } + }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentShowPostsByLocation.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentShowPostsByLocation.kt new file mode 100644 index 0000000..f9accc8 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentShowPostsByLocation.kt @@ -0,0 +1,96 @@ +package com.example.brzodolokacije.Fragments + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.Toast +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView +import androidx.recyclerview.widget.StaggeredGridLayoutManager +import com.example.brzodolokacije.Adapters.ShowPostsHomePageAdapter +import com.example.brzodolokacije.Interfaces.IBackendApi +import com.example.brzodolokacije.Models.Post +import com.example.brzodolokacije.Models.PostPreview +import com.example.brzodolokacije.R +import com.example.brzodolokacije.Services.RetrofitHelper +import com.example.brzodolokacije.Services.SharedPreferencesHelper +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory + +class FragmentShowPostsByLocation : Fragment() { + + private lateinit var posts : MutableList<PostPreview> + private lateinit var rvPosts:RecyclerView + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + val view= inflater.inflate(R.layout.fragment_show_posts_by_location, container, false) + + rvPosts=view.findViewById(R.id.rvFragmentShowPostsByLocationPosts)as RecyclerView + + val args=this.arguments + val filterString=args?.get("data").toString() + + getPosts(filterString) + + + + return view + } + + + private fun getPosts(location:String){ + val api = Retrofit.Builder() + .addConverterFactory(GsonConverterFactory.create()) + .baseUrl(RetrofitHelper.baseUrl) + .build() + .create(IBackendApi::class.java) + val token= SharedPreferencesHelper.getValue("jwt", requireActivity()) + val data=api.getPosts("Bearer "+token) + + data.enqueue(object : Callback<MutableList<PostPreview>> { + override fun onResponse(call: Call<MutableList<PostPreview>>, response: Response<MutableList<PostPreview>>) { + if (response.body() == null) { + Toast.makeText( + activity, "get all null", Toast.LENGTH_LONG + ).show(); + + return + } + //refresh list +// Toast.makeText( +// activity, "get all ", Toast.LENGTH_LONG +// ).show(); + var posts = response.body()!!.toMutableList<PostPreview>() + showPosts(posts) + } + + override fun onFailure(call: Call<MutableList<PostPreview>>, t: Throwable) { + Toast.makeText( + activity,"nema objava", Toast.LENGTH_LONG + ).show(); + } + }) + } + + private fun showPosts(posts:MutableList<PostPreview>){ +// Toast.makeText( +// activity, "get all sp ", Toast.LENGTH_LONG +// ).show(); + + rvPosts.apply { + layoutManager= GridLayoutManager(activity,2) + adapter= ShowPostsHomePageAdapter(posts,requireActivity()) + + } + + } +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserPosts.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserPosts.kt index 561de10..f1f2257 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserPosts.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentUserPosts.kt @@ -1,60 +1,115 @@ package com.example.brzodolokacije.Fragments +import android.content.Intent import android.os.Bundle import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.recyclerview.widget.GridLayoutManager +import androidx.recyclerview.widget.RecyclerView +import com.example.brzodolokacije.Adapters.ShowPostsAdapter +import com.example.brzodolokacije.Models.PostPreview +import com.example.brzodolokacije.Services.RetrofitHelper +import com.example.brzodolokacije.Services.SharedPreferencesHelper +import com.google.android.material.button.MaterialButton +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response + + +import android.widget.Toast +import androidx.core.content.ContextCompat +import androidx.recyclerview.widget.DividerItemDecoration +import androidx.recyclerview.widget.LinearLayoutManager +import com.example.brzodolokacije.Adapters.ShowPostsHomePageAdapter +import com.example.brzodolokacije.Interfaces.IBackendApi import com.example.brzodolokacije.R -// TODO: Rename parameter arguments, choose names that match -// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER -private const val ARG_PARAM1 = "param1" -private const val ARG_PARAM2 = "param2" +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory +import android.widget.Button +import android.widget.ImageButton +import android.widget.TextView +import com.example.brzodolokacije.Activities.ActivityAddPost +import com.example.brzodolokacije.Activities.ActivityCapturePost +import com.example.brzodolokacije.Activities.ActivityForgottenPassword + +import com.google.android.material.bottomsheet.BottomSheetDialog -/** - * A simple [Fragment] subclass. - * Use the [FragmentUserPosts.newInstance] factory method to - * create an instance of this fragment. - */ -class FragmentUserPosts : Fragment() { - // TODO: Rename and change types of parameters - private var param1: String? = null - private var param2: String? = null +class FragmentUserPosts : Fragment() { + private lateinit var posts : MutableList<PostPreview> + private lateinit var rvPosts: RecyclerView + private lateinit var addNewPost:TextView override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - arguments?.let { - param1 = it.getString(ARG_PARAM1) - param2 = it.getString(ARG_PARAM2) - } - } + } override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle? ): View? { - // Inflate the layout for this fragment - return inflater.inflate(R.layout.fragment_user_posts, container, false) + + val view =inflater.inflate(R.layout.fragment_user_posts, container, false) + + addNewPost=view.findViewById<View>(R.id.tvFragmentUserPostsAddPost) as TextView + addNewPost.setOnClickListener { + var bottomSheetDialog2: BottomSheetDialog + bottomSheetDialog2= BottomSheetDialog(requireContext()) + bottomSheetDialog2.setContentView(R.layout.bottom_sheet_add_new_post) + bottomSheetDialog2.show() + + var close=bottomSheetDialog2.findViewById<View>(R.id.btnBottomSheetAddNewPostClose) as ImageButton + var openAddPost=bottomSheetDialog2.findViewById<View>(R.id.btnBottomSheetAddNewPostOpenAddPost) as ImageButton + var capturePost=bottomSheetDialog2.findViewById<View>(R.id.btnBottomSheetAddNewPostOpenCapturePost) as ImageButton + + openAddPost.setOnClickListener{ + val intent = Intent (getActivity(), ActivityAddPost::class.java) + getActivity()?.startActivity(intent) + } + + capturePost.setOnClickListener{ + val intent = Intent (getActivity(), ActivityCapturePost::class.java) + getActivity()?.startActivity(intent) + } + close.setOnClickListener { + bottomSheetDialog2.dismiss() + } + } + + rvPosts=view.findViewById(R.id.rvFragmentUserPostsPosts) as RecyclerView + getPosts() + return view } - companion object { - /** - * Use this factory method to create a new instance of - * this fragment using the provided parameters. - * - * @param param1 Parameter 1. - * @param param2 Parameter 2. - * @return A new instance of fragment FragmentUserPosts. - */ - // TODO: Rename and change types and number of parameters - @JvmStatic - fun newInstance(param1: String, param2: String) = - FragmentUserPosts().apply { - arguments = Bundle().apply { - putString(ARG_PARAM1, param1) - putString(ARG_PARAM2, param2) + fun getPosts(){ + val api = RetrofitHelper.getInstance() + val token= SharedPreferencesHelper.getValue("jwt", requireActivity()) + val data=api.getMyPosts("Bearer "+token) + + data.enqueue(object : Callback<MutableList<PostPreview>> { + override fun onResponse( + call: Call<MutableList<PostPreview>>, + response: Response<MutableList<PostPreview>> + ) { + if (response.body() == null) { + return } + posts = response.body()!!.toMutableList<PostPreview>() + loadPosts() } + override fun onFailure(call: Call<MutableList<PostPreview>>, t: Throwable) { + + } + }) + } + private fun loadPosts(){//most viewed + rvPosts.apply { + layoutManager= GridLayoutManager(requireContext(),2,GridLayoutManager.VERTICAL,false) + adapter= ShowPostsAdapter(requireActivity(),posts) + + } } + }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt index c712597..2f5cff1 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt @@ -1,11 +1,10 @@ package com.example.brzodolokacije.Interfaces +import com.example.brzodolokacije.Models.* import com.example.brzodolokacije.Models.Auth.JustMail import com.example.brzodolokacije.Models.Auth.Login import com.example.brzodolokacije.Models.Auth.Register import com.example.brzodolokacije.Models.Auth.ResetPass -import com.example.brzodolokacije.Models.Location -import com.example.brzodolokacije.Models.PostPreview import okhttp3.MultipartBody import okhttp3.Request import okhttp3.RequestBody @@ -36,7 +35,25 @@ interface IBackendApi { ,@Part("description") description:RequestBody ,@Part("locationId") locationId:RequestBody ):Call<PostPreview> + @POST("api/Post/posts/{id}/addrating") + fun addRating(@Header("Authorization") authHeader:String,@Path("id") id:String,@Body rating: RatingReceive):Call<ResponseBody> + @POST("api/Post/posts/{id}/addcomment") + fun addComment(@Header("Authorization") authHeader:String,@Path("id") id:String,@Body rating: CommentReceive):Call<ResponseBody> + @GET("api/Post/posts/{id}/listcomments") + fun getComments(@Header("Authorization") authHeader:String,@Path("id") id:String):Call<MutableList<CommentSend>> - //@POST("putanja") + + @Multipart + @POST("/api/user/profile/pfp") + fun setPfp(@Header("Authorization") authHeader:String, @Part image: MultipartBody.Part):Call<ResponseBody> + @GET("/api/user/profile") + fun selfProfile(@Header("Authorization") authHeader:String):Call<UserReceive> + @GET("/api/user/{username}/profile") + fun getProfile(@Header("Authorization") authHeader:String,@Path("username") username:String):Call<UserReceive> + + @GET("/api/user/posts") + fun getMyPosts(@Header("Authorization") authHeader:String):Call<MutableList<PostPreview>> + +//@POST("putanja") //fun add(@Body obj:Post,@Header("Authorization") authHeader:String):Call<Post> }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/LocationType.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/LocationType.kt index a078863..4714bab 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/LocationType.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/LocationType.kt @@ -1,7 +1,45 @@ package com.example.brzodolokacije.Models enum class LocationType { - GRAD,ULICA,JEZERO,REKA,PLAZA,OKEAN, MORE, MOREUZ, MOST,BANJA, - PLANINA, VISORAVAN, PIRAMIDA, LIVADA, SELO, OSTRVO, POLUOSTRVO, KLISURA, ARHIPELAG, - ADA, DELTA, FJORD, GEJZIR, IZVOR, KOTLINA, MINERALNI_IZVOR, PECINA ,SUMA, VODOPAD,VULKAN + GRAD, + ULICA, + JEZERO, + REKA, + PLAZA, + OKEAN, + MORE, + MOREUZ, + MOST, + BANJA, + PLANINA, + VISORAVAN, + PIRAMIDA, + LIVADA, + SELO, + OSTRVO, + POLUOSTRVO, + KLISURA, + ARHIPELAG, + ADA, + DELTA, + FJORD, + GEJZIR, + IZVOR, + KOTLINA, + MINERALNI_IZVOR, + PECINA, + SUMA, + VODOPAD, + VULKAN, + + AERODROM, + ZABAVNI_PARK, + PRODAVNICA, + ATRAKCIJA, + ZOOLOSKI_VRT, + TRZNI_CENTAR, + PARK, + LOKALITET, + + }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/Post.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/Post.kt index 9b9afaa..3bbcc0c 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/Post.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/Post.kt @@ -33,8 +33,9 @@ data class PostPreview ( var description:String, var views:Int, var ratings:Float, - var comments:List<Comment>?, + var comments:List<CommentSend>?, var images:List<PostImage> + //nedostaju datum i vreme kreiranja ):Parcelable @@ -46,7 +47,28 @@ data class Comment ( var timeStamp: LocalDateTime ):Parcelable +@Parcelize +data class CommentSend( + var _id: String, + var userId: String, + var comment: String, + var parentId: String, + //var timestamp:LocalDateTime, + var username: String, + var replies: List<CommentSend>? +):Parcelable + +data class CommentReceive( + var comment: String, + var parentId: String +) + data class Rating( var useridval :String, var rating:Int +) + +data class RatingReceive( + var rating:Int, + var postId:String )
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/User.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/User.kt index 52090f9..c726978 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/User.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Models/User.kt @@ -20,4 +20,13 @@ data class User ( var postIds:List<Int>, var postNumber:Int +) +data class UserReceive( + var _id:String, + var name:String, + var username:String, + var email:String, + var creationDate: Date, + var pfp:PostImage?, + var postcount:Int )
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/GeocoderHelper.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/GeocoderHelper.kt new file mode 100644 index 0000000..f7a59fa --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/GeocoderHelper.kt @@ -0,0 +1,14 @@ +package com.example.brzodolokacije.Services + +import org.osmdroid.bonuspack.location.GeocoderNominatim + +object GeocoderHelper { + private var geocoder:GeocoderNominatim?=null + private val userAgent="Mozilla/5.0 (Linux; Android 11; SM-A326BR Build/RP1A.200720.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/100.0.4896.88 Mobile Safari/537.36" + public fun getInstance(): GeocoderNominatim? { + if(geocoder==null){ + geocoder= GeocoderNominatim(userAgent) + } + return geocoder + } +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt index 88685e4..43c2109 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt @@ -7,8 +7,8 @@ import retrofit2.converter.gson.GsonConverterFactory object RetrofitHelper { - //val baseUrl="http://10.0.2.2:5279" - val baseUrl="http://147.91.204.115:10082" + val baseUrl="http://10.0.2.2:5279" + //val baseUrl="http://147.91.204.115:10082" private var retrofit_noauth: IBackendApi? = null private var retrofit_auth: IBackendApi? = null diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/empty_star.webp b/Client/BrzoDoLokacije/app/src/main/res/drawable/empty_star.webp Binary files differnew file mode 100644 index 0000000..cea48aa --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/empty_star.webp diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/filter.png b/Client/BrzoDoLokacije/app/src/main/res/drawable/filter.png Binary files differindex 4342c2c..745a5e8 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/drawable/filter.png +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/filter.png diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/full_star.png b/Client/BrzoDoLokacije/app/src/main/res/drawable/full_star.png Binary files differnew file mode 100644 index 0000000..e3f605d --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/full_star.png diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/grid.png b/Client/BrzoDoLokacije/app/src/main/res/drawable/grid.png Binary files differdeleted file mode 100644 index 03d9ef9..0000000 --- a/Client/BrzoDoLokacije/app/src/main/res/drawable/grid.png +++ /dev/null diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/grid_full.png b/Client/BrzoDoLokacije/app/src/main/res/drawable/grid_full.png Binary files differnew file mode 100644 index 0000000..9bed50a --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/grid_full.png diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_add_a_photo_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_add_a_photo_24.xml new file mode 100644 index 0000000..b7e751b --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_add_a_photo_24.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#274352" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M3,4V1h2v3h3v2H5v3H3V6H0V4H3zM6,10V7h3V4h7l1.83,2H21c1.1,0 2,0.9 2,2v12c0,1.1 -0.9,2 -2,2H5c-1.1,0 -2,-0.9 -2,-2V10H6zM13,19c2.76,0 5,-2.24 5,-5s-2.24,-5 -5,-5s-5,2.24 -5,5S10.24,19 13,19zM9.8,14c0,1.77 1.43,3.2 3.2,3.2s3.2,-1.43 3.2,-3.2s-1.43,-3.2 -3.2,-3.2S9.8,12.23 9.8,14z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_add_photo_alternate_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_add_photo_alternate_24.xml new file mode 100644 index 0000000..5f6b662 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_add_photo_alternate_24.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#274352" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M19,7v2.99s-1.99,0.01 -2,0L17,7h-3s0.01,-1.99 0,-2h3L17,2h2v3h3v2h-3zM16,11L16,8h-3L13,5L5,5c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2v-8h-3zM5,19l3,-4 2,3 3,-4 4,5L5,19z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_arrow_back_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_arrow_back_24.xml new file mode 100644 index 0000000..09fe069 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_arrow_back_24.xml @@ -0,0 +1,5 @@ +<vector android:autoMirrored="true" android:height="24dp" + android:tint="#274352" android:viewportHeight="24" + android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M20,11H7.83l5.59,-5.59L12,4l-8,8 8,8 1.41,-1.41L7.83,13H20v-2z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_list_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_list_24.xml new file mode 100644 index 0000000..49f6624 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_list_24.xml @@ -0,0 +1,5 @@ +<vector android:autoMirrored="true" android:height="24dp" + android:tint="#274352" android:viewportHeight="24" + android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M3,13h2v-2L3,11v2zM3,17h2v-2L3,15v2zM3,9h2L5,7L3,7v2zM7,13h14v-2L7,11v2zM7,17h14v-2L7,15v2zM7,7v2h14L21,7L7,7z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_person_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_person_24.xml new file mode 100644 index 0000000..a1623e2 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_person_24.xml @@ -0,0 +1,10 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="24dp" + android:height="24dp" + android:viewportWidth="24" + android:viewportHeight="24" + android:tint="?attr/colorControlNormal"> + <path + android:fillColor="@android:color/white" + android:pathData="M12,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zM12,14c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_post_add_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_post_add_24.xml new file mode 100644 index 0000000..32f0448 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_post_add_24.xml @@ -0,0 +1,9 @@ +<vector android:height="24dp" android:tint="#274352" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M17,19.22H5V7h7V5H5C3.9,5 3,5.9 3,7v12c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2v-7h-2V19.22z"/> + <path android:fillColor="@android:color/white" android:pathData="M19,2h-2v3h-3c0.01,0.01 0,2 0,2h3v2.99c0.01,0.01 2,0 2,0V7h3V5h-3V2z"/> + <path android:fillColor="@android:color/white" android:pathData="M7,9h8v2h-8z"/> + <path android:fillColor="@android:color/white" android:pathData="M7,12l0,2l8,0l0,-2l-3,0z"/> + <path android:fillColor="@android:color/white" android:pathData="M7,15h8v2h-8z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_search_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_search_24.xml new file mode 100644 index 0000000..5f22c2e --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_search_24.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#274352" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/list_empty.png b/Client/BrzoDoLokacije/app/src/main/res/drawable/list_empty.png Binary files differnew file mode 100644 index 0000000..3568c49 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/list_empty.png diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_amusement_park.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_amusement_park.xml new file mode 100644 index 0000000..c6b2c37 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_amusement_park.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="58dp" + android:height="57dp" + android:viewportWidth="58" + android:viewportHeight="57"> + <path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M0.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> + <path + android:fillColor="#FF093A4C" + android:pathData="M40.62 31.65c0.38 0.24 0.84 0.23 1.02 0 0.19-0.24 0.03-0.62-0.35-0.84l-6.65-3.87c-0.38-0.22-1.02-0.28-1.42-0.13l-2.38 0.9c-0.4 0.15-0.93 0.27-1.16 0.27-0.24 0-0.44-0.42-0.44-0.94v-9.11c0-0.52 0.34-0.94 0.76-0.94h17.23c0.43 0 0.77-0.43 0.77-0.95v-3.06c0-0.52-0.33-1.06-0.73-1.21L29.12 5.11c-0.4-0.15-1.06-0.15-1.46 0L9.73 11.77C9.33 11.92 9 12.47 9 12.98v3.06c0 0.52 0.34 0.94 0.76 0.94h17.01c0.42 0 0.76 0.43 0.76 0.95v9.12c0 0.25-0.08 0.49-0.22 0.67-0.15 0.17-0.34 0.27-0.54 0.27h-0.3c-0.43 0-1.02-0.3-1.32-0.66l-4.1-4.92c-0.3-0.36-0.9-0.66-1.32-0.66h-1.9c-0.41 0-0.92-0.31-1.12-0.69-0.2-0.38-0.65-0.69-1-0.69-0.37 0-0.48 0.36-0.25 0.8l0.03 0.06c0.23 0.44 0.23 1.16 0 1.6l-2.04 4c-0.11 0.23-0.15 0.5-0.13 0.76 0.03 0.26 0.13 0.5 0.28 0.68l0.15 0.16c0.31 0.35 0.87 0.44 1.24 0.2l2.2-1.44c0.37-0.24 0.86-0.09 1.09 0.35l2.41 4.64c0.1 0.22 0.15 0.49 0.12 0.74-0.03 0.26-0.13 0.5-0.29 0.67l-1.1 1.16c-0.32 0.33-0.51 1.02-0.42 1.53l1.43 7.81c0.1 0.51 0.5 0.82 0.91 0.7l1-0.31c0.2-0.07 0.36-0.22 0.47-0.44 0.1-0.21 0.14-0.47 0.1-0.72l-0.96-5.29c-0.05-0.24-0.01-0.5 0.1-0.72 0.1-0.22 0.27-0.38 0.47-0.45l2.44-0.82c0.5-0.15 1-0.23 1.5-0.25h0.31c0.42 0 0.76 0.43 0.76 0.94v9.38c0 0.25-0.08 0.5-0.22 0.67-0.15 0.18-0.34 0.27-0.54 0.27h-17c-0.2 0-0.4 0.1-0.54 0.28C9.08 47.5 9 47.74 9 48v3.05C9 51.58 9.34 52 9.76 52h37.16c0.42 0 0.76-0.42 0.76-0.95V48c0-0.25-0.08-0.5-0.22-0.67-0.15-0.18-0.34-0.28-0.54-0.28H30c-0.2 0-0.4-0.1-0.53-0.27-0.15-0.17-0.23-0.42-0.23-0.67v-9.37c0-0.52 0.34-0.94 0.76-0.94h0.88c0.42 0 1.1 0.1 1.5 0.24l2.45 0.83c0.4 0.13 0.66 0.66 0.57 1.17l-0.97 5.28c-0.04 0.25 0 0.51 0.1 0.73 0.11 0.21 0.28 0.37 0.48 0.43l1 0.3c0.09 0.04 0.19 0.04 0.29 0.03 0.1-0.02 0.19-0.06 0.27-0.13 0.09-0.06 0.16-0.15 0.22-0.25s0.1-0.21 0.12-0.33l1.43-7.82c0.1-0.51-0.08-1.19-0.4-1.52-0.3-0.32-0.58-1.01-0.6-1.53l-0.13-2.77c-0.02-0.51 0.27-0.75 0.64-0.52l2.77 1.71Z"/> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_attraction.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_attraction.xml new file mode 100644 index 0000000..7174bda --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_attraction.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="57dp" + android:height="57dp" + android:viewportWidth="57" + android:viewportHeight="57"> + <path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M0.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> + <path + android:fillColor="#FF093A4C" + android:pathData="M44.1 32.23c0.41-1.34 0.63-2.76 0.63-4.23 0-1.47-0.22-2.89-0.63-4.23 1.4-1.05 1.83-2.98 0.92-4.52-0.92-1.54-2.84-2.15-4.47-1.49-2.02-2.08-4.62-3.56-7.48-4.23-0.26-1.72-1.76-3.03-3.57-3.03-1.81 0-3.31 1.31-3.55 3.03-2.86 0.67-5.47 2.15-7.5 4.23-1.63-0.66-3.55-0.05-4.47 1.49-0.91 1.54-0.48 3.46 0.92 4.52-0.41 1.34-0.63 2.76-0.63 4.23 0 1.47 0.22 2.89 0.63 4.23-1.4 1.05-1.83 2.98-0.92 4.52 0.92 1.54 2.84 2.15 4.47 1.49 0.71 0.73 1.48 1.38 2.32 1.96l-2.41 5.3h3.36l1.76-3.83c0.79 0.33 1.61 0.6 2.47 0.8 0.24 1.72 1.74 3.03 3.55 3.03 1.81 0 3.31-1.31 3.55-3.03 0.82-0.19 1.63-0.45 2.4-0.77l1.75 3.8h3.37l-2.4-5.25c0.86-0.6 1.67-1.26 2.4-2.01 1.63 0.66 3.57 0.05 4.46-1.49 0.9-1.54 0.47-3.47-0.93-4.52Zm-11.8 7.58c-0.67-0.8-1.67-1.31-2.8-1.31s-2.15 0.5-2.81 1.31c-0.72-0.16-1.42-0.37-2.08-0.65l2.56-5.58c1.47 0.58 3.1 0.59 4.59 0.04l2.54 5.56c-0.64 0.27-1.3 0.48-2 0.63Zm-5.52-11.78c0-1.45 1.2-2.62 2.68-2.62 1.5 0 2.7 1.17 2.7 2.63 0 1.45-1.2 2.62-2.7 2.62-1.48 0-2.68-1.17-2.68-2.63Zm14.74 3.49c-1.1 0.12-2.11 0.71-2.72 1.73-0.57 0.98-0.61 2.1-0.22 3.06-0.5 0.51-1.04 0.96-1.6 1.38l-2.7-5.86c0.88-1.03 1.4-2.34 1.4-3.78 0-3.3-2.78-5.96-6.2-5.96-3.42 0-6.2 2.67-6.2 5.96 0 1.4 0.5 2.7 1.35 3.73l-2.73 5.93c-0.55-0.4-1.07-0.84-1.56-1.33 0.47-0.98 0.43-2.13-0.16-3.13-0.6-1.03-1.66-1.64-2.8-1.73-0.39-1.2-0.58-2.45-0.58-3.77 0-1.11 0.16-2.2 0.45-3.23 1.18-0.05 2.32-0.67 2.95-1.75 0.66-1.1 0.63-2.42 0.02-3.47 1.65-1.71 3.78-2.96 6.18-3.55 0.61 1.03 1.77 1.75 3.1 1.75s2.49-0.7 3.1-1.75c2.4 0.6 4.53 1.87 6.16 3.59-0.57 1.03-0.59 2.32 0.06 3.41 0.62 1.05 1.72 1.66 2.86 1.75 0.29 1.03 0.45 2.12 0.45 3.25 0 1.32-0.21 2.58-0.6 3.77Z"/> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_beach.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_beach.xml new file mode 100644 index 0000000..c42b8a5 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_beach.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="57dp" + android:height="57dp" + android:viewportWidth="57" + android:viewportHeight="57"> + <path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M0.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> + <path + android:fillColor="#FF093A4C" + android:pathData="M25 13.94c1.63-2.73 4.32-4.72 7.48-5.54C35.64 7.6 39 8.02 41.83 9.6c2.84 1.57 4.9 4.17 5.75 7.21 0.85 3.04 0.4 6.28-1.23 9l-0.47 0.78c-0.15 0.27-0.41 0.46-0.72 0.53-0.3 0.08-0.62 0.04-0.9-0.11l-8.19-4.55-4.56 7.7c3.17 0.92 5.9 3.03 7.84 5.75-0.86-0.06-1.7 0.2-2.4 0.7-2.26-2.86-5.52-4.7-9.03-4.7-3.52 0-6.78 1.84-9.05 4.7-0.68-0.5-1.53-0.75-2.38-0.7 2.64-3.7 6.73-6.27 11.43-6.27 0.38 0 0.76 0.02 1.14 0.05l4.97-8.37-9.07-5.05c-0.27-0.15-0.47-0.4-0.55-0.69-0.08-0.29-0.04-0.6 0.12-0.86l0.46-0.78Zm2.17 0.93l4.03 2.23 0.02-0.03c1.27-1.69 2.46-2.98 4.02-4.12 1.16-0.83 2.41-1.54 3.72-2.13-2.15-0.73-4.5-0.72-6.64 0.02-2.14 0.73-3.96 2.16-5.15 4.03Zm11.4 6.33c1.1-1.86 1.62-3.32 1.8-4.75 0.16-1.14 0.1-2.3-0.13-3.7-1.49 0.68-2.62 1.32-3.57 2.01-1.27 0.93-2.28 2-3.42 3.49l5.32 2.95Zm2.04 1.14l3.81 2.12c1.04-1.83 1.42-3.93 1.1-6-0.3-2.05-1.31-3.96-2.85-5.42 0.17 1.28 0.21 2.48 0.05 3.7-0.23 1.8-0.9 3.55-2.1 5.6ZM17.84 38.95c-0.08-0.23-0.24-0.44-0.45-0.58-0.21-0.14-0.46-0.2-0.72-0.2-0.26 0.01-0.5 0.1-0.7 0.26-0.2 0.15-0.34 0.37-0.4 0.6-0.4 1.59-1.16 2.46-2.03 2.96-0.91 0.53-2.07 0.73-3.36 0.73-0.31 0-0.61 0.12-0.83 0.34C9.12 43.27 9 43.56 9 43.86c0 0.3 0.12 0.6 0.35 0.8C9.57 44.89 9.87 45 10.18 45c1.51 0 3.15-0.23 4.58-1.06 0.85-0.5 1.57-1.17 2.09-1.99 2.82 3.47 8.33 3.45 11.07-0.03 2.78 3.54 8.41 3.5 11.2-0.13 0.75 0.99 1.73 1.8 2.87 2.35 1.13 0.56 2.39 0.85 3.66 0.86 0.31 0 0.62-0.12 0.84-0.33 0.22-0.22 0.34-0.5 0.34-0.8 0-0.31-0.12-0.6-0.34-0.81-0.22-0.22-0.53-0.34-0.84-0.34-2.32 0-4.64-1.45-5.4-3.76-0.08-0.23-0.23-0.43-0.43-0.57-0.2-0.14-0.45-0.22-0.7-0.22-0.24 0-0.49 0.08-0.69 0.22-0.2 0.14-0.35 0.33-0.43 0.56-1.52 4.42-7.48 4.36-8.96 0.18-0.08-0.22-0.24-0.42-0.44-0.56-0.2-0.13-0.44-0.2-0.68-0.2-0.25 0-0.49 0.07-0.7 0.2-0.2 0.14-0.34 0.34-0.42 0.56-1.5 4.18-7.44 4.24-8.96-0.18Z"/> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_city.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_city.xml new file mode 100644 index 0000000..a0a3a26 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_city.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="57dp" + android:height="57dp" + android:viewportWidth="57" + android:viewportHeight="57"> + <path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M0.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> + <path + android:fillColor="#FF093A4C" + android:fillType="evenOdd" + android:pathData="M12 45c0-0.27 0.1-0.52 0.3-0.7 0.18-0.2 0.43-0.3 0.7-0.3h30c0.27 0 0.52 0.1 0.7 0.3 0.2 0.18 0.3 0.43 0.3 0.7 0 0.27-0.1 0.52-0.3 0.7-0.18 0.2-0.43 0.3-0.7 0.3H13c-0.27 0-0.52-0.1-0.7-0.3-0.2-0.18-0.3-0.43-0.3-0.7Z"/> + <path + android:fillColor="#FF093A4C" + android:fillType="evenOdd" + android:pathData="M16 24v20h5V24h-5Zm-1-2c-0.27 0-0.52 0.1-0.7 0.3-0.2 0.18-0.3 0.43-0.3 0.7v22c0 0.27 0.1 0.52 0.3 0.7 0.18 0.2 0.43 0.3 0.7 0.3h7c0.27 0 0.52-0.1 0.7-0.3 0.2-0.18 0.3-0.43 0.3-0.7V23c0-0.27-0.1-0.52-0.3-0.7-0.18-0.2-0.43-0.3-0.7-0.3h-7Z"/> + <path + android:fillColor="#FF093A4C" + android:fillType="evenOdd" + android:pathData="M21 6l16 6v14h-5c-0.27 0-0.52 0.1-0.7 0.3-0.2 0.18-0.3 0.43-0.3 0.7v17H21V6Zm3 9h2v2h-2v-2Zm6 0h-2v2h2v-2Zm2 0h2v2h-2v-2Zm-6 4h-2v2h2v-2Zm2 0h2v2h-2v-2Zm6 0h-2v2h2v-2Zm-10 4h2v2h-2v-2Zm6 0h-2v2h2v-2Zm2 0h2v2h-2v-2Zm-6 4h-2v2h2v-2Zm2 0h2v2h-2v-2Zm-4 4h2v2h-2v-2Zm6 0h-2v2h2v-2Zm-4 4h-2v2h2v-2Zm2 0h2v2h-2v-2Zm-4 4h2v2h-2v-2Zm6 0h-2v2h2v-2Z"/> + <path + android:fillColor="#FF093A4C" + android:fillType="evenOdd" + android:pathData="M33 28v16h7V28h-7Zm-1-2c-0.27 0-0.52 0.1-0.7 0.3-0.2 0.18-0.3 0.43-0.3 0.7v18c0 0.27 0.1 0.52 0.3 0.7 0.18 0.2 0.43 0.3 0.7 0.3h9c0.27 0 0.52-0.1 0.7-0.3 0.2-0.18 0.3-0.43 0.3-0.7V27c0-0.27-0.1-0.52-0.3-0.7-0.18-0.2-0.43-0.3-0.7-0.3h-9Z"/> + <path + android:fillColor="#FF093A4C" + android:fillType="evenOdd" + android:pathData="M38 32h-3v-2h3v2Zm0 4h-3v-2h3v2Zm0 4h-3v-2h3v2Zm0 4h-3v-2h3v2ZM19 15v8h-2v-8h2Z"/> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_lake.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_lake.xml new file mode 100644 index 0000000..65648f7 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_lake.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="61dp" + android:height="57dp" + android:viewportWidth="61" + android:viewportHeight="57"> + <path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M2.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> + <path + android:fillColor="#FF093A4C" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M2.51 47.5H58.5c-0.26 5.01-4.41 9-9.49 9H12c-5.08 0-9.23-3.99-9.49-9Z"/> + <path + android:fillColor="#FF093A4C" + android:pathData="M33.12 4.62c-3.08-0.45-11.25 5.9-11.25 5.9l5.29 8.39 8.12 8.43 6.51 4.96 6.65 1.38 3.76 1.62H40.6l-22.74-2.84-1.61-4.73 3.3 1.1-2.67-5.44h4.15l-2.16-5.67 2.66-0.81 1.82-2.76-1.48-3.62s-1.5-1.36-2.11-1.34c-2.64 0.08-8 5.6-11.14 8.91-3.46 3.64-6.71 3.86-6.71 3.86v25.5h57.18V35.3h-5.41l-3.51-2.36-5.67-2.36 1.9-1.14-5.03-3-2.52-5.96 3.28 1.14L37.1 16h1.52l-2.2-3.57-0.85-5.53s-1.66-2.17-2.45-2.28m5.53 32.11c1.3 0.23 2.55 0.55 3.99-0.01 2.37-0.89 4.09 0.37 6.37 0.61-2.18 0.24-3.98-1-6.2-0.13-2.05 0.76-3.6-0.07-5.47-0.47h1.3M3.7 32.13l25.34 3.17H3.7v-3.17Zm11.43 5.1c-1.48 0.22-2.8-0.63-4.3-0.03-1.62 0.6-2.8-0.2-4.31-0.47h1.17c0.96 0.13 1.9 0.4 2.93 0h2.61c0.6 0.17 1.22 0.39 1.9 0.5m-3.62 8.23c-2.37 0.88-4.09-0.38-6.38-0.62 2.19-0.23 3.99 1 6.2 0.14 2.37-0.89 4.1 0.37 6.38 0.61-2.18 0.24-3.98-1-6.2-0.13m15.87-5.5c-1.61-0.15-2.9 0.26-4.41 0.68-2.78 0.76-4.8-0.74-7.42-1.17l0.28-0.03c1.32-0.13 2.42 0.36 3.72 0.49 1.61 0.15 2.9-0.26 4.41-0.68 2.78-0.76 4.8 0.74 7.42 1.17-1.45 0.24-2.6-0.32-4-0.45m13.1 3.88c-2.78 0.76-4.8-0.74-7.41-1.17l0.28-0.03c1.31-0.13 2.41 0.36 3.72 0.49 1.6 0.15 2.89-0.26 4.4-0.68 2.78-0.76 4.8 0.74 7.42 1.17-1.45 0.24-2.6-0.32-4-0.45-1.61-0.16-2.9 0.25-4.4 0.67M51.28 46c-2.37 0.88-4.08-0.37-6.37-0.62 2.18-0.23 3.98 1 6.2 0.14 2.37-0.89 4.1 0.37 6.38 0.61-2.19 0.24-3.99-1-6.2-0.13Zm6.37-5.99c-1.48 0.23-2.79-0.62-4.3-0.02-1.68 0.62-2.87-0.26-4.48-0.5 0.1-0.02 0.17-0.02 0.21-0.02 1.4-0.12 2.66 0.6 4.1 0.04 1.67-0.62 2.87 0.26 4.47 0.5"/> + <path + android:fillColor="#FF093A4C" + android:pathData="M40.6 14.48l4.96 9.19 5.03 6.91 1.1-0.85 1.38 1.19 6.02 2.43V16.62s-3.7-1.47-4.99-1.52c-0.8-0.04-3.13 0.66-3.13 0.66l4.98 5.34c-4.17-1.15-4.98-5.34-4.98-5.34s-1.86-1.13-2.54-1.33c-0.7-0.21-2.87-0.28-2.87-0.28L52.2 24.9c-5.67-0.86-4.7-7-6.64-10.75 0 0-1.49-2.79-2.29-3.34-0.74-0.52-2.65-0.31-3.43-0.76-0.91-0.53-2.04-2.72-3-3.15-0.29-0.13-1.26 0-1.26 0l3 5.05 2.03 2.53Z"/> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_landmark.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_landmark.xml new file mode 100644 index 0000000..3ed6824 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_landmark.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="57dp" + android:height="57dp" + android:viewportWidth="57" + android:viewportHeight="57"> + <path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M0.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> + <group> + <path + android:fillColor="#FF093A4C" + android:pathData="M49.13 14.74L29.44 7.17c-0.6-0.23-1.27-0.23-1.88 0L7.87 14.74C7.62 14.84 7.4 15 7.24 15.23 7.08 15.45 7 15.72 7 15.99v3.1c0 0.75 0.6 1.35 1.34 1.35h40.32c0.74 0 1.34-0.6 1.34-1.35V16c0-0.56-0.35-1.06-0.87-1.25Zm-36.76 8.38v13.44h-1.34c-0.74 0-1.34 0.6-1.34 1.35v4.03H47.3V37.9c0-0.75-0.6-1.35-1.34-1.35h-1.34V23.12h-5.38v13.44h-8.06V23.12H25.8v13.44h-8.06V23.12h-5.38Zm36.29 21.5H8.34C7.6 44.63 7 45.23 7 45.98v2.69C7 49.4 7.6 50 8.34 50h40.32C49.4 50 50 49.4 50 48.66v-2.7c0-0.73-0.6-1.34-1.34-1.34Z"/> + </group> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_mountain.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_mountain.xml new file mode 100644 index 0000000..4f436f7 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_mountain.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="58dp" + android:height="57dp" + android:viewportWidth="58" + android:viewportHeight="57"> + <path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M0.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> + <path + android:fillColor="#FF093A4C" + android:pathData="M20.86 7l-2.34 9.07 2.5 4.06 1.44-2.66 3.37 2.8 1.58-5.03L20.86 7Zm15.29 3.96l-2.9 4.39 0.96 2.3 1.97-1.96 1.63 3.88 0.93-1.97-2.6-6.64Zm-7.52 5.82l-1.97 6.28-3.72-3.07-1.8 3.39-3.18-5.14L10 49h11.4c4.1-1.54 12.18-5.14 12.35-9.63 0.15-4.34-9.8-3.94-9.98-8.27-0.13-3.55 7.61-7.39 7.61-7.39s-4.87 3.93-4.27 6.44c1.16 4.8 11.32 2.5 12.9 7.18C41.18 40.8 37 46.8 35.31 49H51L39.55 19.69l-1.8 3.87-2.13-5.02-1.99 1.98-1.46-3.54-1.54 2.3-2-2.5Z"/> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_spa.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_spa.xml new file mode 100644 index 0000000..ff19c94 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_spa.xml @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" +android:width="57dp" +android:height="57dp" +android:viewportWidth="57" +android:viewportHeight="57"> +<path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M0.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> +<path + android:strokeColor="#FF093A4C" + android:strokeWidth="2" + android:pathData="M28.5 45c-2.76 0-5.44-0.45-9.21-3.1C11.92 36.76 11 20.26 11 20.26s8.29 1.03 11.97 4.13M28.5 45c2.76 0 5.44-0.45 9.21-3.1C45.08 36.76 46 20.26 46 20.26s-8.29 1.03-11.97 4.13M28.5 45c2.76 0 7.37-2.06 7.37-11.34S28.5 12 28.5 12s-7.37 12.38-7.37 21.66S25.73 45 28.5 45Z"/> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/location_waterfall.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_waterfall.xml new file mode 100644 index 0000000..b909b31 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/location_waterfall.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="utf-8"?> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="57dp" + android:height="57dp" + android:viewportWidth="57" + android:viewportHeight="57"> + <path + android:fillColor="#FFFFFFFF" + android:strokeColor="#FF093A4C" + android:strokeWidth="1" + android:pathData="M0.5 10c0-5.25 4.25-9.5 9.5-9.5h37c5.25 0 9.5 4.25 9.5 9.5v37c0 5.25-4.25 9.5-9.5 9.5h-37c-5.25 0-9.5-4.25-9.5-9.5z"/> + <path + android:fillColor="#FF093A4C" + android:pathData="M43.3 7.57c-1.12 0-2.23 0.58-3.4 1.8-0.33 0.35-0.65 0.72-0.97 1.09 0.31 0.5 0.51 1.13 0.65 1.66 0.47-0.56 0.93-1.12 1.38-1.6 0.85-0.9 1.6-1.4 2.26-1.32 1.35 0.18 2 0.6 2.49 1.16 0.5 0.56 0.85 1.35 1.38 2.26l1.27-0.86c-0.46-0.8-0.84-1.7-1.55-2.52-1.23-1.09-2.38-1.67-3.5-1.67ZM16.56 9.1c-4.48 0.02-6.53 1.58-8.03 3.22l1.08 1.14c1.46-1.6 2.94-2.86 7.55-2.73l2.9 2.92h1.26c-0.02-0.8-0.65-1.56-1.06-2.02-1.25-1.45-2.02-2.53-3.7-2.53Zm12.32 0.88c-0.85 0-1.7 0.02-2.49 0.05 0.32 0.75 0.47 1.56 0.56 2.24 0.08 1.04-1.31 1.1-1.5 0.21-0.1-0.77-0.38-1.77-0.74-2.35-1.28 0.09-2.43 0.2-3.39 0.33 0.61 0.8 1.51 1.96 1.51 2.79 0.04 8.06-0.23 16.18-0.81 24.34 0.13-0.16 0.27-0.3 0.4-0.44 0.71-0.69 1.55-1.23 2.53-1.17 0.23 0.02 0.44 0.06 0.64 0.12 0.01-1.49 0.05-2.77 0-3.99 0.45 0.5 0.9 0.9 1.52-0.05 0.06 1.58-0.01 3.19-0.03 5.11 0.1 0.1 0.17 0.2 0.25 0.3 0.63 0.77 1.13 1.72 1.55 2.66 0.15 0.34 0.29 0.67 0.41 1 0.11-5.08 0.04-10.15-0.18-15.22 0.72 1.01 1.11 0.63 1.5-0.08 0.23 5.09 0.3 10.18 0.2 15.27 0.95-1.02 2.1-2.06 3.49-2.03 0.34 0 0.65 0.09 0.94 0.22v-2.14c0.67 0.8 1.13 0.62 1.52 0l-0.02 3.43c0.3 0.32 0.58 0.7 0.82 1.05 0.33-0.18 0.75-0.4 1.25-0.63l-0.47-6.64c0.5 0.5 1 0.9 1.5-0.12l0.45 6.15c0.56-0.2 1.14-0.38 1.72-0.45-0.94-8.4-2.12-17.25-3.72-26.63-0.11-0.66-0.27-1.31-0.5-1.76-0.2-0.44-0.41-0.65-0.72-0.72-1.53-0.37-3.17-0.6-4.81-0.72 0.72 1.54 0.7 3.14 0.72 4.46 0.09 0.97-1.45 1.53-1.51 0.02-0.03-1.68 0.01-3.19-1.07-4.58-0.5-0.02-1-0.03-1.52-0.03Zm7.63 2.83c0.95 3.93 1.73 10.73 2.27 14.74-0.07 1.58-1.2 1.2-1.5 0.23-0.54-4.04-1.35-10.88-2.24-14.56 0.84 0.7 1.35 0.62 1.47-0.4Zm-10.69 1.8c0.3 4.94 0.2 9.8-0.06 14.6 0.02 1-1.28 1.27-1.5-0.09 0.25-4.76 0.34-9.55 0.05-14.4 0.75 1.2 1.2 0.84 1.51-0.1Zm4.33 2.02c0.27 2.48 0.36 3.86 0.33 5.39-0.54 0.85-1.04 0.7-1.52-0.04 0.04-1.44-0.06-2.71-0.3-5.17 0.58 0.78 1.07 0.6 1.49-0.18Zm4.39 2.45c0.29 4.55 0.36 8.08 0.47 13.9-0.42 0.5-0.82 1.06-1.51 0.04-0.11-5.82-0.19-9.31-0.47-13.83 0.63 0.83 1.1 0.54 1.51-0.11ZM13.87 35.32c-0.9-0.02-1.36 1.7-1.12 2.63 0.3 1.24 2.92 2.23 2.92 2.23s-0.17-4.81-1.8-4.86Zm3.98-0.03c-0.07 0.05-0.1 0.12-0.14 0.2-0.35 0.9 1.9 2.08 1.9 2.08s0.5-1.56 0.05-2.05c-0.4-0.43-1.4-0.63-1.8-0.23Zm26.83-0.34h-0.1c-0.99 0.2-1.17 2.14-0.7 3.14 0 0 1.58-0.82 1.66-1.62 0.07-0.56-0.34-1.5-0.86-1.52Zm2.5 1.84c-1.7 0.1-1.4 5.26-1.4 5.26S48.1 41.11 48.4 40c0.29-1.1-0.14-3.27-1.21-3.2Zm-23.74 1.55c-0.55 0.53-1.1 1.31-1.57 2.11-0.95 1.6-1.58 3.24-1.58 3.24l-0.3 0.78c-1.85-1-3.1-1.51-4.86-1.58-1.13-0.05-2.08 1.03-2.3 2.01-0.12 0.57 0 1.28 0.76 2.3 10.12 1.33 26.1 1.9 34.52 0.04 0.3-1.48-0.2-2.5-1.1-3.41-0.97-1.01-2.5-1.76-3.77-2.2-0.61-0.22-2.1 0.1-3.31 0.62-1.23 0.52-2.22 1.12-2.22 1.12l-0.62 0.38-0.38-0.63s-0.4-0.66-0.95-1.3c-0.56-0.63-1.3-1.13-1.49-1.13-0.55-0.01-1.74 0.82-2.65 1.82-0.9 0.99-1.56 2-1.56 2l-0.92 1.39-0.43-1.65s-0.45-1.71-1.2-3.42c-0.39-0.86-0.85-1.7-1.33-2.3-1.06-1.21-1.7-1.18-2.74-0.19ZM9.99 39.5c-0.36 0-0.67 0.1-0.83 0.4-0.7 1.3 2.59 3.54 2.59 3.54s0.57-2.39-0.09-3.18c-0.35-0.41-1.07-0.75-1.67-0.76Z"/> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/post_comment.webp b/Client/BrzoDoLokacije/app/src/main/res/drawable/post_comment.webp Binary files differnew file mode 100644 index 0000000..fc677d1 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/post_comment.webp diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/sort.png b/Client/BrzoDoLokacije/app/src/main/res/drawable/sort.png Binary files differindex 828cd01..b4fd960 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/drawable/sort.png +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/sort.png diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_add_post.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_add_post.xml index 5af0c1f..a7a6e06 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_add_post.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_add_post.xml @@ -10,6 +10,7 @@ android:id="@+id/isActivityAddPostSwitcher" android:layout_width="0dp" android:layout_height="0dp" + android:elevation="10dp" app:layout_constraintBottom_toTopOf="@+id/btnActivityAddPostUploadFromGallery" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -45,60 +46,95 @@ tools:ignore="SpeakableTextPresentCheck" /> <Button + android:clickable="false" android:id="@+id/btnActivityAddPostUploadFromGallery" - android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_width="177dp" + android:layout_height="19dp" android:text="Otvori galeriju" + android:visibility="invisible" + app:cornerRadius="20dp" app:layout_constraintBottom_toTopOf="@+id/tvActivityAddPostLocationtext" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.497" app:layout_constraintStart_toStartOf="parent" /> <TextView android:id="@+id/tvActivityAddPostLocationtext" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="16dp" android:text="Lokacija" app:layout_constraintBottom_toTopOf="@+id/etActivityAddPostLocation" - app:layout_constraintEnd_toEndOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" /> <EditText android:id="@+id/etActivityAddPostLocation" android:layout_width="match_parent" android:layout_height="50dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" android:ems="10" android:hint="Reykjavik, Iceland" android:inputType="textEmailAddress" app:layout_constraintBottom_toTopOf="@+id/tvActivityAddPostDescriptiontext" - app:layout_constraintEnd_toEndOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> <TextView android:id="@+id/tvActivityAddPostDescriptiontext" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" android:text="Opis" app:layout_constraintBottom_toTopOf="@+id/etActivityAddPostDescription" - app:layout_constraintEnd_toEndOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> <EditText android:id="@+id/etActivityAddPostDescription" android:layout_width="match_parent" android:layout_height="50dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" android:ems="10" android:hint="Reykjavik, Iceland" android:inputType="textEmailAddress" app:layout_constraintBottom_toTopOf="@+id/btnActivityAddPostPost" - app:layout_constraintEnd_toEndOf="parent" /> + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" /> <Button android:id="@+id/btnActivityAddPostPost" - android:layout_width="200dp" + android:layout_width="250dp" android:layout_height="40dp" + android:layout_marginBottom="12dp" android:background="@drawable/rounded_cyan_button" android:backgroundTint="#1C789A" android:text="Objavi" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.496" app:layout_constraintStart_toStartOf="parent" /> + <com.google.android.material.button.MaterialButton + android:id="@+id/btnActivityAddPostUploadFromGalleryVisible" + android:layout_width="50dp" + android:layout_height="wrap_content" + android:stateListAnimator="@null" + app:backgroundTint="#00FFFFFF" + app:icon="@drawable/ic_baseline_add_photo_alternate_24" + app:iconGravity="textEnd" + app:iconSize="40dp" + app:iconTint="#1C7696" + app:layout_constraintBottom_toBottomOf="@+id/isActivityAddPostSwitcher" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="@+id/isActivityAddPostSwitcher" /> + </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_capture_post.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_capture_post.xml index 91517a7..23d34ee 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_capture_post.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_capture_post.xml @@ -8,33 +8,39 @@ <ImageView android:id="@+id/ivActivityCapturePostImage" - android:layout_width="408dp" - android:layout_height="319dp" + android:layout_width="413dp" + android:layout_height="0dp" android:layout_marginTop="4dp" + android:scaleType="fitCenter" + app:layout_constraintBottom_toTopOf="@+id/btnActivityCapturePostCapture" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" + tools:ignore="ImageContrastCheck" tools:srcCompat="@tools:sample/avatars" /> <Button android:id="@+id/btnActivityCapturePostCapture" - android:layout_width="60dp" - android:layout_height="wrap_content" - android:layout_marginTop="68dp" + android:layout_width="68dp" + android:layout_height="15dp" + android:visibility="invisible" app:cornerRadius="30dp" app:icon="@android:drawable/ic_menu_camera" + app:iconTint="#FFFFFF" + android:clickable="false" app:layout_constraintBottom_toTopOf="@+id/tvActivityCapturePostLocationtext" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.498" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/ivActivityCapturePostImage" /> + tools:ignore="SpeakableTextPresentCheck" /> <TextView android:id="@+id/tvActivityCapturePostLocationtext" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="464dp" + android:layout_marginStart="16dp" + android:layout_marginTop="516dp" + android:layout_marginEnd="16dp" android:text="Lokacija" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" @@ -45,20 +51,26 @@ android:id="@+id/etActivityCapturePostLocation" android:layout_width="match_parent" android:layout_height="50dp" + android:layout_marginStart="16dp" android:layout_marginTop="4dp" + android:layout_marginEnd="16dp" android:ems="10" android:hint="Reykjavik, Iceland" android:inputType="textEmailAddress" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tvActivityCapturePostLocationtext" /> + app:layout_constraintTop_toBottomOf="@+id/tvActivityCapturePostLocationtext" + tools:ignore="DuplicateSpeakableTextCheck,TextContrastCheck" + android:importantForAutofill="no" /> <TextView android:id="@+id/tvActivityCapturePostDescriptiontext" android:layout_width="match_parent" android:layout_height="wrap_content" + android:layout_marginStart="16dp" android:layout_marginTop="8dp" + android:layout_marginEnd="16dp" android:text="Opis" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="1.0" @@ -69,26 +81,49 @@ android:id="@+id/etActivityCapturePostDescription" android:layout_width="match_parent" android:layout_height="50dp" + android:layout_marginStart="16dp" android:layout_marginTop="4dp" + android:layout_marginEnd="16dp" android:ems="10" android:hint="Reykjavik, Iceland" android:inputType="textEmailAddress" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tvActivityCapturePostDescriptiontext" /> + app:layout_constraintTop_toBottomOf="@+id/tvActivityCapturePostDescriptiontext" + tools:ignore="TextContrastCheck" + android:importantForAutofill="no" /> <Button android:id="@+id/btnActivityCapturePostPost" - android:layout_width="200dp" - android:layout_height="40dp" + android:layout_width="244dp" + android:layout_height="35dp" + android:layout_marginStart="32dp" + android:layout_marginEnd="32dp" + android:layout_marginBottom="16dp" android:background="@drawable/rounded_cyan_button" android:backgroundTint="#1C789A" android:text="Objavi" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintDimensionRatio="w,1:1" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.431" - app:layout_constraintStart_toStartOf="parent" /> + app:layout_constraintHorizontal_bias="0.495" + app:layout_constraintStart_toStartOf="parent" + tools:ignore="TouchTargetSizeCheck" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/btnActivityCapturePostCaptureVisible" + android:layout_width="50dp" + android:layout_height="wrap_content" + android:stateListAnimator="@null" + app:backgroundTint="#00FFFFFF" + app:icon="@drawable/ic_baseline_add_a_photo_24" + app:iconGravity="textEnd" + app:iconSize="40dp" + app:iconTint="#1C7696" + app:layout_constraintBottom_toTopOf="@+id/btnActivityCapturePostCapture" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_single_post.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_single_post.xml index 00d3460..7c1f8bc 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_single_post.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_single_post.xml @@ -1,127 +1,296 @@ <?xml version="1.0" encoding="utf-8"?> -<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + + +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" + android:padding="@dimen/component_padding" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".Activities.ActivitySinglePost"> - - <androidx.recyclerview.widget.RecyclerView + <ScrollView + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:fillViewport="true"> + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="match_parent"> + <androidx.recyclerview.widget.RecyclerView android:id="@+id/rvMain" android:layout_width="match_parent" - android:layout_height="443dp" + android:paddingBottom="@dimen/component_padding" + android:layout_height="400dp" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent"> - </androidx.recyclerview.widget.RecyclerView> - <LinearLayout + + +<androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:gravity="bottom" + app:layout_constraintTop_toBottomOf="@id/rvMain" + tools:layout_editor_absoluteX="0dp"> + + <TextView + android:id="@+id/tvLocationParent" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="Drzava, grad" + app:layout_constraintTop_toBottomOf="@+id/tvLocationType" + tools:layout_editor_absoluteX="0dp" /> + + <TextView + android:id="@+id/tvTitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="Naslov" + android:textSize="@dimen/header1_size" + android:textStyle="bold" /> + + <TextView + android:id="@+id/tvLocationType" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="Tip lokacije" + app:layout_constraintTop_toBottomOf="@+id/tvTitle" + tools:layout_editor_absoluteX="0dp" /> + + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/constraintLayout" android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical"> + android:layout_height="wrap_content" + android:layout_marginTop="20dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvLocationParent"> - <TextView - android:id="@+id/tvTitle" + <LinearLayout + android:id="@+id/linearLayout" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="Naslov" /> + android:orientation="horizontal" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + + <ImageView + android:id="@+id/star1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@android:drawable/btn_star_big_on" /> + + <ImageView + android:id="@+id/star2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@android:drawable/btn_star_big_on" /> + + <ImageView + android:id="@+id/star3" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@android:drawable/btn_star_big_on" /> + + <ImageView + android:id="@+id/star4" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@android:drawable/btn_star_big_on" /> + + <ImageView + android:id="@+id/star5" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_weight="1" + android:src="@android:drawable/btn_star_big_on" /> + </LinearLayout> <TextView - android:id="@+id/tvLocationType" + android:id="@+id/tvRating" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginTop="11dp" - android:text="tip lokacije" /> + android:padding="@dimen/text_padding" + android:text="4.2" + android:textStyle="bold" + app:layout_constraintEnd_toStartOf="@+id/tvNumberOfRatings" + tools:layout_editor_absoluteY="4dp" /> <TextView - android:id="@+id/tvLocationParent" + android:id="@+id/tvNumberOfRatings" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="Drzava, grad" /> + android:padding="@dimen/text_padding" + android:text="(10,500)" + app:layout_constraintEnd_toEndOf="parent" + tools:layout_editor_absoluteY="4dp" /> <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/constraintLayout3" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:background="@drawable/rounded_picture_background" + android:elevation="5dp" + android:padding="@dimen/component_padding" + app:layout_constraintTop_toBottomOf="@+id/linearLayout" + tools:layout_editor_absoluteX="0dp"> - <LinearLayout - android:layout_width="213dp" - android:layout_height="27dp" - android:orientation="horizontal"> + <TextView + android:id="@+id/tvDescriptionLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="Opis" + android:textStyle="bold" /> - <ImageView - android:id="@+id/star1" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> + <TextView + android:id="@+id/tvDescription" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="TextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextView" + app:layout_constraintTop_toBottomOf="@+id/tvDescriptionLabel" /> + </androidx.constraintlayout.widget.ConstraintLayout> - <ImageView - android:id="@+id/star2" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> + <LinearLayout + android:id="@+id/linearLayout2" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_weight="1" + android:orientation="horizontal" + android:paddingVertical="@dimen/component_padding" + app:layout_constraintTop_toBottomOf="@id/constraintLayout3"> - <ImageView - android:id="@+id/star3" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> + <ImageButton + android:id="@+id/rateStar1" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:scaleType="centerCrop" + android:layout_weight="1" + android:backgroundTint="@color/white" + android:src="@drawable/empty_star" /> - <ImageView - android:id="@+id/star4" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> + <ImageButton + android:id="@+id/rateStar2" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:scaleType="centerCrop" + android:layout_weight="1" + android:backgroundTint="@color/white" + android:src="@drawable/empty_star" /> + + <ImageButton + android:id="@+id/rateStar3" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:scaleType="centerCrop" + android:layout_weight="1" + android:backgroundTint="@color/white" + android:src="@drawable/empty_star" /> + + <ImageButton + android:id="@+id/rateStar4" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:scaleType="centerCrop" + android:layout_weight="1" + android:backgroundTint="@color/white" + android:src="@drawable/empty_star" /> - <ImageView - android:id="@+id/star5" - android:layout_width="wrap_content" + <ImageButton + android:id="@+id/rateStar5" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:scaleType="centerCrop" + android:layout_weight="1" + android:backgroundTint="@color/white" + android:src="@drawable/empty_star" /> + + <Button + android:id="@+id/submitRating" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_weight="1" + android:backgroundTint="@color/white" + android:text="ok" + android:layout_gravity="center_vertical" + android:textColor="@color/black" + /> + </LinearLayout> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:layout_constraintTop_toBottomOf="@id/linearLayout2"> + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:id="@+id/postCommentLayout" + android:orientation="horizontal" + app:layout_constraintStart_toStartOf="parent" > + <EditText + android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> + android:hint="Unesite komentar ovde" + android:id="@+id/NewComment" + /> + + <ImageButton + android:id="@+id/btnPostComment" + android:layout_width="50dp" + android:scaleType="fitCenter" + android:layout_height="50dp" + android:src="@drawable/post_comment" + android:backgroundTint="@color/white"/> </LinearLayout> - <TextView - android:id="@+id/tvRating" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginEnd="8dp" - android:text="4.2" - app:layout_constraintEnd_toStartOf="@+id/textView10" - tools:layout_editor_absoluteY="0dp" /> <TextView - android:id="@+id/tvNumberOfRatings" + android:id="@+id/tvCommentLabel" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="(10,500)" - app:layout_constraintEnd_toEndOf="parent" - tools:layout_editor_absoluteY="0dp" /> - </androidx.constraintlayout.widget.ConstraintLayout> - - <androidx.constraintlayout.widget.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_margin="10dp" - android:padding="10dp" - android:background="@drawable/rounded_picture_background" - android:elevation="5dp"> + app:layout_constraintTop_toBottomOf="@id/postCommentLayout" + android:padding="@dimen/text_padding" + android:text="Komentari" + android:textStyle="bold" /> <TextView - android:id="@+id/tvDescription" + android:id="@+id/tvCommentCount" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="TextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextView" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="0.048" - app:layout_constraintStart_toStartOf="parent" - tools:layout_editor_absoluteY="4dp" /> - </androidx.constraintlayout.widget.ConstraintLayout> - </LinearLayout> + android:padding="@dimen/text_padding" + app:layout_constraintTop_toBottomOf="@id/postCommentLayout" + android:text="3" + app:layout_constraintStart_toEndOf="@id/tvCommentLabel" /> + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvComments" + android:layout_width="match_parent" + android:layout_height="wrap_content" + app:layout_constraintTop_toBottomOf="@id/tvCommentLabel" + android:nestedScrollingEnabled="false"> -</LinearLayout>
\ No newline at end of file + </androidx.recyclerview.widget.RecyclerView> + </androidx.constraintlayout.widget.ConstraintLayout> + </androidx.constraintlayout.widget.ConstraintLayout> +</androidx.constraintlayout.widget.ConstraintLayout> +</androidx.constraintlayout.widget.ConstraintLayout> +</ScrollView> +</androidx.constraintlayout.widget.ConstraintLayout> diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_browse.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_browse.xml index 3287683..9e6dd9d 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_browse.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_browse.xml @@ -1,14 +1,74 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".Fragments.FragmentBrowse"> - <!-- TODO: Update blank fragment layout --> - <TextView - android:layout_width="match_parent" - android:layout_height="match_parent" - android:text="Browse" /> -</FrameLayout>
\ No newline at end of file + + <org.osmdroid.views.MapView + android:id="@+id/FragmentBrowseMapView" + android:layout_width="fill_parent" + android:layout_height="fill_parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + /> + + + + <com.google.android.material.floatingactionbutton.FloatingActionButton + android:id="@+id/FragmentBrowseMyLocation" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentStart="true" + android:backgroundTint="#FFFFFF" + android:layout_marginBottom="80dp" + android:clickable="true" + android:focusable="true" + android:tint="#FFFFFF" + app:layout_constraintBottom_toBottomOf="@+id/FragmentBrowseMapView" + app:layout_constraintEnd_toEndOf="parent" + app:rippleColor="#FFFFFF" + app:srcCompat="@android:drawable/ic_menu_mylocation" /> + + <androidx.cardview.widget.CardView + android:id="@+id/FragmentBrowseCardViewSearch" + android:layout_width="0dp" + android:layout_marginTop="60dp" + android:layout_height="40dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:elevation="0dp" + app:cardCornerRadius="20dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent"> + + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/FragmentBrowseSearchBar" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/rounded_white_button_login" + android:hint=" Pretraga" + android:inputType="textPersonName" + android:paddingLeft="15dp" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/FragmentBrowseSearchButton" + android:layout_width="49dp" + android:layout_height="match_parent" + android:layout_gravity="right" + android:background="#00FFFFFF" + app:backgroundTint="#00FFFFFF" + app:cornerRadius="16dp" + app:icon="@drawable/ic_baseline_search_24" + app:iconTint="#333D70" /> + + </androidx.cardview.widget.CardView> + + +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page.xml new file mode 100644 index 0000000..5d9e62c --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".Fragments.FragmentHomePage"> + + + <TextView + android:id="@+id/tvFragmentHomePageHelloName" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + + android:layout_marginTop="56dp" + android:layout_marginEnd="107dp" + android:text="Zdravo, Mia" + app:layout_constraintEnd_toStartOf="@+id/cvFragmentHomePageProfile" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <androidx.cardview.widget.CardView + android:id="@+id/cvFragmentHomePageProfile" + android:layout_width="70dp" + android:layout_height="70dp" + android:layout_gravity="center" + android:layout_marginTop="24dp" + android:layout_marginEnd="24dp" + app:cardCornerRadius="250dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@+id/tvFragmentHomePageHelloName" + app:layout_constraintTop_toTopOf="parent"> + + <ImageView + android:id="@+id/ivFragmentHomePageProfile" + android:layout_width="70dp" + android:layout_height="70dp" + android:scaleType="centerCrop" + android:src="@drawable/ic_baseline_person_24" + tools:ignore="ContentDescription" /> + </androidx.cardview.widget.CardView> + + + <TextView + android:id="@+id/tvFragmentHomePageSearch" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="16dp" + android:layout_marginTop="8dp" + android:text="Pretraži lokacije" + android:textSize="20sp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/cvFragmentHomePageProfile" /> + + <androidx.cardview.widget.CardView + android:id="@+id/cvFragmentHomePageSearch" + android:layout_width="0dp" + android:layout_height="40dp" + android:layout_marginTop="10dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:elevation="0dp" + app:cardCornerRadius="20dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvFragmentHomePageSearch"> + + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/etFragmentHomePageSearch" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/rounded_white_button_login" + android:hint=" Pretraga" + android:paddingLeft="15dp" + android:inputType="textPersonName" /> + + <com.google.android.material.button.MaterialButton + android:layout_width="49dp" + android:layout_height="match_parent" + android:layout_gravity="right" + android:background="#00FFFFFF" + app:backgroundTint="#00FFFFFF" + app:cornerRadius="16dp" + app:icon="@drawable/ic_baseline_search_24" + app:iconTint="#333D70" /> + + </androidx.cardview.widget.CardView> + + <!--***************************SCROLL****************************************--> + <ImageView + android:id="@+id/btnFragmentHomePageBack" + android:layout_width="63dp" + android:layout_height="40dp" + android:clickable="true" + android:src="@drawable/ic_baseline_arrow_back_24" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/cvFragmentHomePageSearch" /> + + <FrameLayout + android:id="@+id/flFragmentHomePageMainContent" + android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="8dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/btnFragmentHomePageBack"> + + </FrameLayout> +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page_main_scroll.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page_main_scroll.xml new file mode 100644 index 0000000..90d1037 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page_main_scroll.xml @@ -0,0 +1,190 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".Fragments.FragmentHomePageMainScroll"> + +<LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + + + <androidx.cardview.widget.CardView + android:id="@+id/cvFragmentHomePageText1" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <TextView + android:id="@+id/tvFragmentHomePagePopular" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:layout_gravity="left" + android:text="Popularno" + android:textStyle="bold" /> + + <TextView + android:id="@+id/tvFragmentHomePagePopularShowAll" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:clickable="true" + android:text="Prikaži sve" + + tools:ignore="TouchTargetSizeCheck" /> + + </androidx.cardview.widget.CardView> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvFragmentHomePagePopular" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginBottom="16dp" /> + + <HorizontalScrollView + android:id="@+id/hsvFragmentHomePageLocationButtonScroll" + android:layout_width="match_parent" + android:layout_height="wrap_content" + + > + + <LinearLayout + android:id="@+id/llFragmentHomePageLocationButtonLayout" + android:layout_width="wrap_content" + android:layout_height="match_parent"> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_city" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_marginRight="10dp" + android:background="@drawable/location_city" + tools:ignore="SpeakableTextPresentCheck" /> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_beach" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_marginRight="10dp" + android:background="@drawable/location_beach" + tools:ignore="SpeakableTextPresentCheck" /> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_mountain" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_marginRight="10dp" + android:background="@drawable/location_mountain" + tools:ignore="SpeakableTextPresentCheck" /> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_lake" + android:layout_width="60dp" + android:layout_height="match_parent" + android:layout_marginRight="10dp" + android:background="@drawable/location_lake" + tools:ignore="SpeakableTextPresentCheck" /> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_spa" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_marginRight="10dp" + android:background="@drawable/location_spa" + tools:ignore="SpeakableTextPresentCheck" /> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_waterfall" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_marginRight="10dp" + android:background="@drawable/location_waterfall" + tools:ignore="SpeakableTextPresentCheck" /> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_amusement_park" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_marginRight="10dp" + android:background="@drawable/location_amusement_park" + tools:ignore="SpeakableTextPresentCheck" /> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_attraction" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_marginRight="10dp" + android:background="@drawable/location_attraction" + tools:ignore="SpeakableTextPresentCheck" /> + + <ImageButton + android:id="@+id/btnFragmentHomePagelocation_landmark" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_marginRight="10dp" + android:background="@drawable/location_landmark" + tools:ignore="SpeakableTextPresentCheck" /> + + </LinearLayout> + </HorizontalScrollView> + + <androidx.cardview.widget.CardView + android:id="@+id/cvFragmentHomePageText2" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp"> + + <TextView + android:id="@+id/tvFragmentHomePageNewest" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="left" + android:text="Najnovije" + android:textStyle="bold" /> + + <TextView + android:id="@+id/tvFragmentHomePageNewestShowAll" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:clickable="true" + android:text="Prikaži sve" /> + </androidx.cardview.widget.CardView> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvFragmentHomePageNewest" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + + <androidx.cardview.widget.CardView + android:id="@+id/cvFragmentHomePageText3" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="16dp"> + + <TextView + android:id="@+id/tvFragmentHomePageBestRated" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="left" + android:text="Najposećenije" + android:textStyle="bold" /> + + <TextView + android:id="@+id/tvFragmentHomePageBestRatedShowAll" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="right" + android:clickable="true" + android:text="Prikaži sve" /> + </androidx.cardview.widget.CardView> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvFragmentHomePageBestRated" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + +</LinearLayout> + +</ScrollView>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_profile.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_profile.xml index e7cccff..c75e1e4 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_profile.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_profile.xml @@ -6,7 +6,6 @@ android:layout_height="match_parent" tools:context=".Fragments.FragmentProfile"> - <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" @@ -46,7 +45,7 @@ android:layout_marginEnd="20dp" android:adjustViewBounds="true" android:background="#E8FFFFFF" - android:elevation="20dp" + android:elevation="1dp" android:scaleType="fitEnd" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintHorizontal_bias="0.494" @@ -55,25 +54,48 @@ app:shapeAppearanceOverlay="@style/imageViewRoundedEdge" /> - <com.google.android.material.imageview.ShapeableImageView - android:id="@+id/tvFragmentProfileProfilePicture" - android:layout_width="150dp" - android:layout_height="150dp" + <androidx.cardview.widget.CardView + android:id="@+id/cvFragmentHomePageProfile" + android:layout_width="140dp" + android:layout_height="140dp" android:layout_gravity="center" - android:layout_margin="5dp" - android:layout_marginTop="4dp" - android:layout_marginEnd="108dp" - android:adjustViewBounds="true" - android:elevation="21dp" - android:scaleType="fitCenter" - android:src="@drawable/ic_launcher_background" + android:layout_marginTop="24dp" + android:elevation="10dp" + app:cardCornerRadius="250dp" app:layout_constraintBottom_toTopOf="@+id/tableLayout" - app:layout_constraintEnd_toEndOf="@+id/imageView3" - app:layout_constraintHorizontal_bias="0.483" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.498" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/imageView3" - app:layout_constraintVertical_bias="1.0" - app:shapeAppearanceOverlay="@style/imageViewCircle" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.887"> + + <ImageView + + android:id="@+id/tvFragmentProfileProfilePicture" + android:layout_width="140dp" + android:layout_height="140dp" + android:elevation="10dp" + android:scaleType="centerCrop" + android:src="@drawable/ic_baseline_person_24" + tools:ignore="ContentDescription" /> + </androidx.cardview.widget.CardView> + + <com.google.android.material.button.MaterialButton + android:id="@+id/btnFragmentProfileProfilePicturePlus" + android:layout_width="54dp" + android:layout_height="54dp" + android:layout_marginEnd="32dp" + android:layout_marginBottom="4dp" + app:backgroundTint="#FFFFFF" + app:cornerRadius="100dp" + app:icon="@drawable/ic_baseline_add_a_photo_24" + app:iconGravity="start" + app:iconTint="#3C5C6E" + app:layout_constraintBottom_toTopOf="@+id/tableLayout" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.72" + app:layout_constraintStart_toStartOf="parent" + tools:ignore="SpeakableTextPresentCheck" /> <TableLayout android:id="@+id/tableLayout" @@ -99,6 +121,7 @@ android:layout_height="match_parent" android:text="Petar Petrović" /> </TableRow> + <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content" @@ -112,6 +135,7 @@ android:gravity="center" android:text="#PetarP" /> </TableRow> + <Space android:layout_height="20dp"></Space> <TableRow @@ -159,6 +183,7 @@ </TableRow> </TableLayout> + <View android:id="@+id/divider" android:layout_width="409dp" @@ -198,17 +223,6 @@ app:layout_constraintStart_toEndOf="@+id/btnFragmentProfileShowMyRecensions" app:layout_constraintTop_toBottomOf="@+id/tvFragmentProfileInfoContainer" /> - <FrameLayout - android:id="@+id/flFragmentProfileFragmentContainer" - android:layout_width="409dp" - android:layout_height="319dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="@+id/divider"> - - </FrameLayout> - <Button android:id="@+id/btnFragmentProfileShowMyRecensions" android:layout_width="wrap_content" @@ -217,10 +231,21 @@ android:layout_marginTop="4dp" android:backgroundTint="#FFFFFF" android:stateListAnimator="@null" - android:textColor="@color/cardview_dark_background" android:text="Recenzije" + android:textColor="@color/cardview_dark_background" app:layout_constraintStart_toEndOf="@+id/btnFragmentProfileShowMyPosts" app:layout_constraintTop_toBottomOf="@+id/tvFragmentProfileInfoContainer" /> + <FrameLayout + android:id="@+id/flFragmentProfileFragmentContainer" + android:layout_width="409dp" + android:layout_height="319dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="@+id/divider"> + </FrameLayout> </androidx.constraintlayout.widget.ConstraintLayout> + + </FrameLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_show_posts.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_show_posts.xml index 02512d4..5dfbc98 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_show_posts.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_show_posts.xml @@ -7,14 +7,40 @@ xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".Fragments.FragmentShowPosts"> - <EditText - android:id="@+id/editTextTextPersonName2" - android:layout_width="wrap_content" - android:layout_height="50dp" - android:layout_gravity="center_horizontal" - android:ems="10" - android:inputType="textPersonName" - android:text="Name" /> + <androidx.cardview.widget.CardView + android:id="@+id/cvSearch" + android:layout_width="match_parent" + android:layout_height="40dp" + android:layout_marginTop="10dp" + android:layout_marginStart="16dp" + android:layout_marginEnd="16dp" + android:elevation="0dp" + app:cardCornerRadius="20dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvFragmentHomePageSearch"> + + + <com.google.android.material.textfield.TextInputEditText + android:id="@+id/etFragmentHomePageSearch" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@drawable/rounded_white_button_login" + android:hint=" Pretraga" + android:paddingLeft="15dp" + android:inputType="textPersonName" /> + + <com.google.android.material.button.MaterialButton + android:layout_width="49dp" + android:layout_height="match_parent" + android:layout_gravity="right" + android:background="#00FFFFFF" + app:backgroundTint="#00FFFFFF" + app:cornerRadius="16dp" + app:icon="@drawable/ic_baseline_search_24" + app:iconTint="#333D70" /> + + </androidx.cardview.widget.CardView> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" @@ -22,52 +48,63 @@ <ImageButton - android:id="@+id/button3" + android:id="@+id/btnSortType" android:layout_width="50dp" android:layout_height="50dp" android:layout_alignParentRight="true" - android:src="@drawable/filter" + android:background="@color/white" + android:padding="@dimen/component_padding" android:scaleType="centerCrop" - android:background="@color/white"/> + android:src="@drawable/filter" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> <ImageButton - android:id="@+id/imageButton1" + android:id="@+id/btnSortDirection" android:layout_width="50dp" android:layout_height="50dp" android:layout_marginStart="8dp" android:layout_weight="1" + android:background="@color/white" + android:padding="@dimen/component_padding" android:scaleType="centerCrop" android:src="@drawable/sort" - app:layout_constraintStart_toEndOf="@+id/button3" - tools:layout_editor_absoluteY="0dp" - android:background="@color/white"/> + app:layout_constraintStart_toEndOf="@+id/btnSortType" + app:layout_constraintTop_toTopOf="parent" /> <ImageButton - android:id="@+id/imageButton2" + android:id="@+id/btnLinearLayout" android:layout_width="50dp" android:layout_height="50dp" android:layout_marginEnd="16dp" android:layout_weight="1" android:background="@color/white" + android:padding="@dimen/component_padding" android:scaleType="centerCrop" - android:src="@drawable/list" - app:layout_constraintEnd_toStartOf="@+id/imageButton3" + android:src="@drawable/list_empty" + app:layout_constraintEnd_toStartOf="@+id/btnGridLayout" app:layout_constraintHorizontal_bias="1.0" - app:layout_constraintStart_toEndOf="@+id/imageButton1" - tools:layout_editor_absoluteY="0dp" /> + app:layout_constraintStart_toEndOf="@+id/btnSortDirection" + app:layout_constraintTop_toTopOf="parent" /> <ImageButton - android:id="@+id/imageButton3" + android:id="@+id/btnGridLayout" android:layout_width="50dp" android:layout_height="50dp" android:layout_marginStart="248dp" android:layout_weight="1" android:background="@color/white" + android:clickable="true" + android:padding="@dimen/component_padding" android:scaleType="centerCrop" - android:src="@drawable/grid" - app:layout_constraintStart_toEndOf="@+id/imageButton1" - tools:layout_editor_absoluteY="0dp" /> + android:src="@drawable/grid_full" + app:layout_constraintStart_toEndOf="@+id/btnSortDirection" + app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> +<androidx.swiperefreshlayout.widget.SwipeRefreshLayout + android:layout_height="match_parent" + android:layout_width="match_parent" + android:id="@+id/swipeContainer"> <androidx.recyclerview.widget.RecyclerView android:id="@+id/rvMain" @@ -77,5 +114,7 @@ app:layout_constraintTop_toTopOf="parent" > </androidx.recyclerview.widget.RecyclerView> +</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> + </LinearLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_show_posts_by_location.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_show_posts_by_location.xml new file mode 100644 index 0000000..1e6305f --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_show_posts_by_location.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + tools:context=".Fragments.FragmentShowPostsByLocation"> + + <!-- TODO: Update blank fragment layout --> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvFragmentShowPostsByLocationPosts" + android:layout_width="match_parent" + android:layout_height="wrap_content" /> + +</LinearLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_posts.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_posts.xml index 185719b..effb6e5 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_posts.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_user_posts.xml @@ -1,14 +1,44 @@ <?xml version="1.0" encoding="utf-8"?> -<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + +android:orientation="vertical" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".Fragments.FragmentUserPosts"> + <!-- TODO: Update blank fragment layout --> - <TextView + <androidx.cardview.widget.CardView + android:layout_marginTop="35dp" + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:layout_marginEnd="110dp" + android:src="@drawable/ic_baseline_post_add_24" + /> + + <TextView + android:id="@+id/tvFragmentUserPostsAddPost" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="end" + android:layout_marginEnd="20dp" + android:clickable="true" + android:text="@string/dodaj_objavu" + android:textSize="15sp" + android:focusable="true" /> + </androidx.cardview.widget.CardView> + + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvFragmentUserPostsPosts" android:layout_width="match_parent" - android:layout_height="match_parent" - android:text="@string/hello_blank_fragment" /> + android:layout_height="wrap_content" + /> -</FrameLayout>
\ No newline at end of file + </LinearLayout> diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/post_item_home_page.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/post_item_home_page.xml new file mode 100644 index 0000000..441f97b --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/post_item_home_page.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="150dp" + android:layout_height="180dp"> + + <com.google.android.material.imageview.ShapeableImageView + android:id="@+id/ivPIHPBackground" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="8dp" + android:layout_marginEnd="16dp" + android:layout_marginBottom="8dp" + android:scaleType="fitXY" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:shapeAppearanceOverlay="@style/Circular" + app:srcCompat="@drawable/b1" /> + + <com.google.android.material.imageview.ShapeableImageView + android:id="@+id/ivPIHPMenu" + android:layout_width="0dp" + android:layout_height="22dp" + app:layout_constraintBottom_toBottomOf="@+id/ivPIHPBackground" + + app:layout_constraintEnd_toEndOf="@+id/ivPIHPBackground" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="@+id/ivPIHPBackground" + app:shapeAppearanceOverlay="@style/roundedBottom" + app:srcCompat="@color/dark_blue_transparent" /> + + <TextView + android:id="@+id/tvPIHPLocationName" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:text="TextView" + android:textColor="@color/white" + android:textSize="10dp" + app:layout_constraintStart_toStartOf="@+id/ivPIHPMenu" + app:layout_constraintTop_toTopOf="@+id/ivPIHPMenu" /> + + +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/post_preview.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/post_preview.xml index dafd3b9..dad1d41 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/post_preview.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/post_preview.xml @@ -14,6 +14,7 @@ android:id="@+id/locationImage" android:layout_width="match_parent" android:layout_height="250dp" + android:layout_marginTop="16dp" android:outlineProvider="background" android:scaleType="centerCrop" app:layout_constraintBottom_toBottomOf="parent" diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml new file mode 100644 index 0000000..f219ea2 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/single_comment.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:padding="@dimen/component_padding" + xmlns:app="http://schemas.android.com/apk/res-auto"> + <TextView + android:id="@+id/tvCommentAuthor" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="autor" + android:textStyle="bold" + android:padding="@dimen/text_padding"/> + <TextView + android:id="@+id/tvCommentText" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:text="autor" + android:padding="@dimen/text_padding" + app:layout_constraintTop_toBottomOf="@id/tvCommentAuthor"/> + +</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/menu/bottom_nav_menu.xml b/Client/BrzoDoLokacije/app/src/main/res/menu/bottom_nav_menu.xml index da6577e..c024570 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/menu/bottom_nav_menu.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/menu/bottom_nav_menu.xml @@ -1,19 +1,23 @@ <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item - android:id="@+id/navHome" - android:title="Home" + android:id="@+id/navHomePage" + android:title="Početna strana" android:icon="@drawable/ic_nav_home"/> <item + android:id="@+id/navAllPosts" + android:icon="@drawable/ic_baseline_list_24" + android:title="Sve objave" /> + <item android:id="@+id/navBrowse" - android:title="Browse" + android:title="Pretraga" android:icon="@drawable/ic_nav_browse"/> <item android:id="@+id/navAddPost" - android:title="Post" + android:title="Dodaj" android:icon="@drawable/ic_nav_addpost"/> <item android:id="@+id/navProfile" - android:title="Profile" + android:title="Profil" android:icon="@drawable/ic_nav_profile"/> </menu>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/values/dimens.xml b/Client/BrzoDoLokacije/app/src/main/res/values/dimens.xml index b789d50..181591b 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/values/dimens.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/values/dimens.xml @@ -1,3 +1,8 @@ <resources> - <dimen name="fab_margin">16dp</dimen> - </resources>
\ No newline at end of file + <dimen name="fab_margin">16dp</dimen> + <dimen name="text_padding">5dp</dimen> + <dimen name="header1_size">20dp</dimen> + <dimen name="component_padding">10dp</dimen> + <dimen name="list_item_spacing">16dp</dimen> + <dimen name="list_item_spacing_half">8dp</dimen> +</resources>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/values/strings.xml b/Client/BrzoDoLokacije/app/src/main/res/values/strings.xml index 6770d14..a969148 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/values/strings.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/values/strings.xml @@ -4,4 +4,6 @@ <string name="hello_blank_fragment">Hello blank fragment</string> <string name="dim">16dp</string> <string name="title_activity_maps">MapsActivity</string> + <string name="dodaj_objavu">Dodaj objavu</string> + <string name="todo">TODO</string> </resources>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml b/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml index 2dee0ab..d8a3730 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml @@ -10,4 +10,11 @@ <item name="cornerSize">15dp</item> <item name="color">@color/white</item> </style> + <style name="Circular"> + <item name="cornerSize">20dp</item> + </style> + <style name="roundedBottom"> + <item name="cornerSizeBottomLeft">20dp</item> + <item name="cornerSizeBottomRight">20dp</item> + </style> </resources>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/settings.gradle b/Client/BrzoDoLokacije/settings.gradle index dc8bcc0..1e867ec 100644 --- a/Client/BrzoDoLokacije/settings.gradle +++ b/Client/BrzoDoLokacije/settings.gradle @@ -10,6 +10,7 @@ dependencyResolutionManagement { repositories { google() mavenCentral() + maven{url "https://jitpack.io"} } } rootProject.name = "BrzoDoLokacije" |