diff options
| author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-11-13 21:39:39 +0100 | 
|---|---|---|
| committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-11-13 21:39:39 +0100 | 
| commit | 68373f0f911f8f2634a935cd2e815d6763cb6993 (patch) | |
| tree | 3ae3195f2b45f61e7baa0a11542c41b864a89e0e | |
| parent | 7c4295f6edd0074733c628300bdb4e6c8b4fd8ef (diff) | |
| parent | 4e37b6235815f29b8a4a3cd3309207a5b580431b (diff) | |
Merge branch 'develop' of http://gitlab.pmf.kg.ac.rs/BrzoDoLokacije2022/odyssey/brzodolokacije into develop
# Conflicts:
#	Client/BrzoDoLokacije/app/build.gradle
20 files changed, 607 insertions, 227 deletions
| diff --git a/Client/BrzoDoLokacije/app/build.gradle b/Client/BrzoDoLokacije/app/build.gradle index 8739bf1..db4ed1b 100644 --- a/Client/BrzoDoLokacije/app/build.gradle +++ b/Client/BrzoDoLokacije/app/build.gradle @@ -50,6 +50,8 @@ dependencies {      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' diff --git a/Client/BrzoDoLokacije/app/src/main/AndroidManifest.xml b/Client/BrzoDoLokacije/app/src/main/AndroidManifest.xml index e33932c..56bdb58 100644 --- a/Client/BrzoDoLokacije/app/src/main/AndroidManifest.xml +++ b/Client/BrzoDoLokacije/app/src/main/AndroidManifest.xml @@ -40,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" /> @@ -81,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/ActivitySinglePost.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivitySinglePost.kt index 69a2bed..8dd7eea 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,36 +1,35 @@  package com.example.brzodolokacije.Activities -import android.content.res.Resources  import android.os.Bundle -import android.os.Handler -import android.os.Looper  import android.util.Log -import android.widget.ImageButton +import android.widget.Adapter  import android.widget.Toast  import androidx.appcompat.app.AppCompatActivity  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.Adapters.ShowPostsAdapter -import com.example.brzodolokacije.Models.PostImage -import com.example.brzodolokacije.Models.PostPreview -import com.example.brzodolokacije.Models.Rating -import com.example.brzodolokacije.Models.RatingReceive +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?) { @@ -38,20 +37,31 @@ class ActivitySinglePost : AppCompatActivity() {          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 @@ -109,7 +119,66 @@ class ActivitySinglePost : AppCompatActivity() {                  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) +            } +        } + +    } + +    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() +                    Toast.makeText( +                        this@ActivitySinglePost, "prosao zahtev", Toast.LENGTH_LONG +                    ).show() +                }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){ 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 78822ab..ce8cdb2 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 @@ -30,7 +30,7 @@ class NavigationActivity : AppCompatActivity() {          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.navHomePage->setCurrentFragment(fragmentHomePage) 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 index 62a4636..c382cf7 100644 --- 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 @@ -1,5 +1,6 @@  package com.example.brzodolokacije.Adapters +import android.app.Activity  import android.util.Log  import android.view.LayoutInflater  import android.view.View @@ -7,11 +8,14 @@ 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>): -    RecyclerView.Adapter<PostViewHolder>() { +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) @@ -26,13 +30,19 @@ class ShowPostsHomePageAdapter(var postPreview:MutableList<PostPreview>):          return postPreview.size      } -} -class PostViewHolder(view: View):RecyclerView.ViewHolder(view){ + +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 +} +    }
\ 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 index 874d9de..150adbf 100644 --- 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 @@ -14,13 +14,13 @@ 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 kotlinx.android.synthetic.main.activity_single_post.view.*  import retrofit2.Call  import retrofit2.Callback  import retrofit2.Response  import retrofit2.Retrofit  import retrofit2.converter.gson.GsonConverterFactory +  class FragmentHomePage : Fragment() {      private lateinit var posts : MutableList<PostPreview>      private lateinit var mostViewedPosts : MutableList<PostPreview> @@ -28,6 +28,7 @@ class FragmentHomePage : Fragment() {      private lateinit var bestRatedPosts:MutableList<PostPreview>      private lateinit var rvPopular: RecyclerView      private lateinit var rvNewest:RecyclerView +    private lateinit var rvBestRated:RecyclerView      /* override fun onCreate(savedInstanceState: Bundle?) {           super.onCreate(savedInstanceState) @@ -41,7 +42,8 @@ class FragmentHomePage : Fragment() {          var view:View= inflater.inflate(R.layout.fragment_home_page, container, false)          rvPopular=view.findViewById(R.id.rvFragmentHomePagePopular) -        rvNewest=view.findViewById(R.id.rvFragmentHomePageLatest) +        rvNewest=view.findViewById(R.id.rvFragmentHomePageNewest) +        rvBestRated=view.findViewById(R.id.rvFragmentHomePageBestRated)          //pokupi sve objave iz baze'              getAllPosts() @@ -60,7 +62,7 @@ class FragmentHomePage : Fragment() {          val token= SharedPreferencesHelper.getValue("jwt", requireActivity())          val data=api.getPosts("Bearer "+token) -        data.enqueue(object : Callback<MutableList<PostPreview>>{ +        data.enqueue(object : Callback<MutableList<PostPreview>> {              override fun onResponse(                  call: Call<MutableList<PostPreview>>,                  response: Response<MutableList<PostPreview>> @@ -97,8 +99,8 @@ class FragmentHomePage : Fragment() {          mostViewedPosts=allPosts          mostViewedPosts.sortByDescending { it.views }          rvPopular.apply { -            layoutManager=LinearLayoutManager(activity,LinearLayoutManager.HORIZONTAL,false) -            adapter=ShowPostsHomePageAdapter(mostViewedPosts) +            layoutManager= LinearLayoutManager(activity,LinearLayoutManager.HORIZONTAL,false) +            adapter= ShowPostsHomePageAdapter(mostViewedPosts,requireActivity())          } @@ -111,7 +113,7 @@ class FragmentHomePage : Fragment() {          newestPosts.sortBy { it.ratings}          rvNewest.apply {              layoutManager=LinearLayoutManager(activity,LinearLayoutManager.HORIZONTAL,false) -            adapter=ShowPostsHomePageAdapter(newestPosts) +            adapter=ShowPostsHomePageAdapter(newestPosts,requireActivity())          }      } @@ -121,6 +123,11 @@ class FragmentHomePage : Fragment() {          ).show();          bestRatedPosts=allPosts          bestRatedPosts.sortByDescending { it.ratings } +        rvBestRated.apply { +            layoutManager=LinearLayoutManager(activity,LinearLayoutManager.HORIZONTAL,false) +            adapter=ShowPostsHomePageAdapter(bestRatedPosts,requireActivity()) +        } +      } 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 ac13bca..cd23a65 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,13 +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 com.example.brzodolokacije.Models.Rating -import com.example.brzodolokacije.Models.RatingReceive  import okhttp3.MultipartBody  import okhttp3.Request  import okhttp3.RequestBody @@ -40,6 +37,12 @@ interface IBackendApi {                                                              ):Call<PostPreview>      @POST("api/Post/posts/{id}/addrating")      fun addRating(@Header("Authorization") authHeader:String,@Path("id") id:String,@Body rating: RatingReceive):Call<ResponseBody> -    //@POST("putanja") +    @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")      //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 a1eb5d0..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,7 +33,7 @@ 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 @@ -47,6 +47,22 @@ 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 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/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_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_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/layout/activity_single_post.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_single_post.xml index 9c30136..cbfc063 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 @@ -227,6 +227,57 @@                  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:hint="Unesite komentar ovde" +                    android:id="@+id/NewComment" +                    /> + +                <ImageButton +                    android:id="@+id/btnPostComment" +                    android:layout_width="wrap_content" +                    android:layout_height="50dp" /> +            </LinearLayout> + + +            <TextView +                android:id="@+id/tvCommentLabel" +                android:layout_width="wrap_content" +                android:layout_height="wrap_content" +                app:layout_constraintTop_toBottomOf="@id/postCommentLayout" +                android:padding="@dimen/text_padding" +                android:text="Komentari" +                android:textStyle="bold" /> + +            <TextView +                android:id="@+id/tvCommentCount" +                android:layout_width="wrap_content" +                android:layout_height="wrap_content" +                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"> + +            </androidx.recyclerview.widget.RecyclerView> +        </androidx.constraintlayout.widget.ConstraintLayout>      </androidx.constraintlayout.widget.ConstraintLayout>  </androidx.constraintlayout.widget.ConstraintLayout> 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 index 7d1c73a..ead86e7 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page.xml @@ -6,20 +6,9 @@      android:layout_height="match_parent"      tools:context=".Fragments.FragmentHomePage"> -    <!-- TODO: Update blank fragment layout --> - -    <androidx.recyclerview.widget.RecyclerView -        android:id="@+id/rvFragmentHomePagePopular" -        android:layout_width="0dp" -        android:layout_height="160dp" -        android:layout_marginStart="16dp" -        app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintHorizontal_bias="0.0" -        app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/textView9" />      <TextView -        android:id="@+id/textView8" +        android:id="@+id/tvFragmentHomePageHelloName"          android:layout_width="0dp"          android:layout_height="wrap_content"          android:layout_marginStart="16dp" @@ -27,195 +16,284 @@          android:layout_marginTop="56dp"          android:layout_marginEnd="107dp"          android:text="Zdravo, Mia" -        app:layout_constraintEnd_toStartOf="@+id/cardView" +        app:layout_constraintEnd_toStartOf="@+id/cvFragmentHomePageProfile"          app:layout_constraintStart_toStartOf="parent"          app:layout_constraintTop_toTopOf="parent" />      <androidx.cardview.widget.CardView -        android:id="@+id/cardView" -        android:layout_width="85dp" -        android:layout_height="85dp" +        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/textView8" +        app:layout_constraintStart_toEndOf="@+id/tvFragmentHomePageHelloName"          app:layout_constraintTop_toTopOf="parent">          <ImageView -            android:id="@+id/fup_profile_picture_id" -            android:layout_width="85dp" -            android:layout_height="85dp" +            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/textView7" +        android:id="@+id/tvFragmentHomePageSearch"          android:layout_width="wrap_content"          android:layout_height="wrap_content"          android:layout_marginStart="16dp" -        android:layout_marginTop="24dp" +        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/cardView" /> +        app:layout_constraintTop_toBottomOf="@+id/cvFragmentHomePageProfile" /> -    <com.google.android.material.textfield.TextInputEditText -        android:id="@+id/editTextTextPersonName3" +    <androidx.cardview.widget.CardView +        android:id="@+id/cvFragmentHomePageSearch"          android:layout_width="0dp" -        android:layout_height="48dp" +        android:layout_height="40dp" +        android:layout_marginTop="10dp"          android:layout_marginStart="16dp" -        android:layout_marginTop="8dp"          android:layout_marginEnd="16dp" -        android:background="@drawable/rounded_white_button_login" -        android:ems="10" -        android:hint="  Pretraga" -        android:inputType="textPersonName" +        android:elevation="0dp" +        app:cardCornerRadius="20dp"          app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintHorizontal_bias="0.0"          app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/textView7" /> +        app:layout_constraintTop_toBottomOf="@+id/tvFragmentHomePageSearch"> -    <TextView -        android:id="@+id/textView9" -        android:layout_width="wrap_content" -        android:layout_height="wrap_content" -        android:layout_marginStart="16dp" -        android:layout_marginTop="36dp" -        android:layout_marginEnd="200dp" -        android:text="Popularno" -        android:textStyle="bold" -        app:layout_constraintEnd_toStartOf="@+id/textView11" -        app:layout_constraintHorizontal_bias="0.0" -        app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/editTextTextPersonName3" /> -    <TextView -        android:id="@+id/textView11" -        android:layout_width="64dp" -        android:layout_height="19dp" -        android:layout_marginTop="36dp" -        android:layout_marginEnd="16dp" -        android:clickable="true" -        android:minHeight="48dp" -        android:text="Prikaži sve" -        app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/editTextTextPersonName3" -        tools:ignore="TouchTargetSizeCheck" /> +        <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****************************************-->      <ScrollView -        android:id="@+id/scrollview" -        android:layout_width="match_parent" -        android:layout_height="wrap_content" +        android:id="@+id/svFragmentHomePageMainScroll" +        android:layout_width="0dp" +        android:layout_height="0dp" +        android:layout_marginStart="16dp" +        android:layout_marginTop="16dp" +        android:layout_marginEnd="16dp" +        app:layout_constraintBottom_toBottomOf="parent"          app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintHorizontal_bias="0.0"          app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/rvFragmentHomePagePopular"> +        app:layout_constraintTop_toBottomOf="@+id/cvFragmentHomePageSearch" +        app:layout_constraintVertical_bias="0.0">          <LinearLayout -            android:id="@+id/linearLayout2"              android:layout_width="match_parent"              android:layout_height="wrap_content" -            android:layout_marginStart="16dp" -            android:layout_marginTop="8dp" -            android:orientation="horizontal" +            android:orientation="vertical" +            app:layout_constraintBottom_toBottomOf="parent"              app:layout_constraintEnd_toEndOf="parent" -            app:layout_constraintStart_toStartOf="parent"> +            app:layout_constraintStart_toStartOf="parent" +            app:layout_constraintTop_toBottomOf="parent" +            app:layout_constraintVertical_bias="0.0"> -            <ImageButton -                android:id="@+id/imageButton4" -                android:layout_width="wrap_content" +            <androidx.cardview.widget.CardView +                android:id="@+id/cvFragmentHomePageText1" +                android:layout_width="match_parent"                  android:layout_height="wrap_content" -                android:layout_weight="1" -                android:background='@color/white' -                android:src="@drawable/location_beach" -                tools:ignore="SpeakableTextPresentCheck" /> +                > -            <ImageButton -                android:id="@+id/imageButton6" +                <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" /> -                android:layout_width="wrap_content" -                android:layout_height="wrap_content" -                android:layout_weight="1" -                android:background='@color/white' -                android:src="@drawable/location_mountain" -                tools:ignore="SpeakableTextPresentCheck" /> - -            <ImageButton -                android:id="@+id/imageButton5" -                android:layout_width="wrap_content" +                <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_marginRight="5dp" -                android:layout_weight="1" -                android:background='@color/white' -                android:src="@drawable/location_city" -                tools:ignore="SpeakableTextPresentCheck" /> - -            <ImageButton -                android:id="@+id/imageView8" -                android:layout_width="wrap_content" +                android:layout_marginBottom="16dp" +            /> +            <HorizontalScrollView +                android:id="@+id/hsvFragmentHomePageLocationButtonScroll" +                android:layout_width="match_parent"                  android:layout_height="wrap_content" -                android:layout_marginRight="5dp" -                android:layout_weight="1" -                android:background="#00FFFFFF" -                android:elevation="20dp" -                android:src="@drawable/location_lake" -                tools:ignore="SpeakableTextPresentCheck" /> - -            <ImageButton -                android:id="@+id/imageButton7" -                android:layout_width="wrap_content" + +                > + +                <LinearLayout +                    android:id="@+id/llFragmentHomePageLocationButtonLayout" +                    android:layout_width="wrap_content" +                    android:layout_height="match_parent"> + +                    <ImageButton +                        android:id="@+id/imageButton4" +                        android:layout_width="60dp" +                        android:layout_height="60dp" +                        android:layout_marginRight="10dp" +                        android:background="@drawable/location_city" +                        tools:ignore="SpeakableTextPresentCheck" /> + +                    <ImageButton +                        android:id="@+id/imageButton6" +                        android:layout_width="60dp" +                        android:layout_height="60dp" +                        android:layout_marginRight="10dp" +                        android:background="@drawable/location_beach" +                        tools:ignore="SpeakableTextPresentCheck" /> + +                    <ImageButton +                        android:id="@+id/imageButton5" +                        android:layout_width="60dp" +                        android:layout_height="60dp" +                        android:layout_marginRight="10dp" +                        android:background="@drawable/location_mountain" +                        tools:ignore="SpeakableTextPresentCheck" /> + +                    <ImageButton +                        android:id="@+id/imageView8" +                        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/imageButton16" +                        android:layout_width="60dp" +                        android:layout_height="60dp" +                        android:layout_marginRight="10dp" +                        android:background="@drawable/location_spa" +                        tools:ignore="SpeakableTextPresentCheck" /> + +                    <ImageButton +                        android:id="@+id/imageButton7" +                        android:layout_width="60dp" +                        android:layout_height="60dp" +                        android:layout_marginRight="10dp" +                        android:background="@drawable/location_waterfall" +                        tools:ignore="SpeakableTextPresentCheck" /> + +                    <ImageButton +                        android:id="@+id/imageButton11" +                        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/imageButton10" +                        android:layout_width="60dp" +                        android:layout_height="60dp" +                        android:layout_marginRight="10dp" +                        android:background="@drawable/location_attraction" +                        tools:ignore="SpeakableTextPresentCheck" /> + +                    <ImageButton +                        android:id="@+id/imageButton15" +                        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_marginRight="5dp" -                android:layout_weight="1" -                android:background='@color/white' -                android:src="@drawable/location_waterfall" -                tools:ignore="SpeakableTextPresentCheck" /> +                android:layout_marginTop="16dp"> +                <TextView +                    android:id="@+id/tvFragmentHomePageNewest" +                    android:layout_width="wrap_content" +                    android:layout_height="wrap_content" +                    android:text="Najnovije" +                    android:textStyle="bold" +                    android:layout_gravity="left" +                    /> -        </LinearLayout> -    </ScrollView> +                <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> -    <TextView -        android:id="@+id/textView12" -        android:layout_width="wrap_content" -        android:layout_height="wrap_content" +            <androidx.recyclerview.widget.RecyclerView +                android:id="@+id/rvFragmentHomePageNewest" +                android:layout_width="match_parent" +                android:layout_height="wrap_content" /> -        android:layout_marginStart="16dp" -        android:layout_marginTop="12dp" -        android:text="Najnovije" -        android:textStyle="bold" -        app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintHorizontal_bias="0.0" -        app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/scrollview" /> +            <androidx.cardview.widget.CardView +                android:id="@+id/cvFragmentHomePageText3" +                android:layout_width="match_parent" +                android:layout_height="wrap_content" +                android:layout_marginTop="16dp"> -    <androidx.recyclerview.widget.RecyclerView -        android:id="@+id/rvFragmentHomePageLatest" -        android:layout_width="0dp" -        android:layout_height="174dp" -        android:layout_marginStart="16dp" -        app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintStart_toStartOf="parent" -        app:layout_constraintTop_toBottomOf="@+id/textView12" /> +                <TextView +                    android:id="@+id/tvFragmentHomePageBestRated" +                    android:layout_width="wrap_content" +                    android:layout_height="wrap_content" +                    android:text="Najposećenije" +                    android:textStyle="bold" +                    android:layout_gravity="left" +                    /> -    <TextView -        android:id="@+id/textView13" -        android:layout_width="wrap_content" -        android:layout_height="wrap_content" -        android:layout_marginTop="12dp" -        android:layout_marginEnd="16dp" -        android:clickable="true" -        android:text="Prikaži sve" -        app:layout_constraintEnd_toEndOf="parent" -        app:layout_constraintHorizontal_bias="1.0" -        app:layout_constraintStart_toEndOf="@+id/textView12" -        app:layout_constraintTop_toBottomOf="@+id/scrollview" -        tools:ignore="TouchTargetSizeCheck" /> +                <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>  </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file 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 index f8ff70e..441f97b 100644 --- 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 @@ -3,12 +3,12 @@      xmlns:app="http://schemas.android.com/apk/res-auto"      xmlns:tools="http://schemas.android.com/tools"      android:layout_width="150dp" -    android:layout_height="150dp"> +    android:layout_height="180dp">      <com.google.android.material.imageview.ShapeableImageView          android:id="@+id/ivPIHPBackground" -        android:layout_width="0dp" -        android:layout_height="150dp" +        android:layout_width="match_parent" +        android:layout_height="match_parent"          android:layout_marginTop="8dp"          android:layout_marginEnd="16dp"          android:layout_marginBottom="8dp" 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/values/dimens.xml b/Client/BrzoDoLokacije/app/src/main/res/values/dimens.xml index 10ed08f..181591b 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/values/dimens.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/values/dimens.xml @@ -1,6 +1,8 @@  <resources> -      <dimen name="fab_margin">16dp</dimen> +    <dimen name="fab_margin">16dp</dimen>      <dimen name="text_padding">5dp</dimen>      <dimen name="header1_size">20dp</dimen>      <dimen name="component_padding">10dp</dimen> -   </resources>
\ No newline at end of file +    <dimen name="list_item_spacing">16dp</dimen> +    <dimen name="list_item_spacing_half">8dp</dimen> +</resources>
\ No newline at end of file | 
