diff options
9 files changed, 628 insertions, 314 deletions
diff --git a/Client/BrzoDoLokacije/.idea/deploymentTargetDropDown.xml b/Client/BrzoDoLokacije/.idea/deploymentTargetDropDown.xml deleted file mode 100644 index 748026e..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"> - <targetSelectedWithDropDown> - <Target> - <type value="QUICK_BOOT_TARGET" /> - <deviceKey> - <Key> - <type value="VIRTUAL_DEVICE_PATH" /> - <value value="C:\Users\TAMARA\.android\avd\Pixel_3a_XL_API_33.avd" /> - </Key> - </deviceKey> - </Target> - </targetSelectedWithDropDown> - <timeTargetWasSelectedWithDropDown value="2022-11-14T22:24:25.011085400Z" /> - </component> -</project>
\ 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 150adbf..1be978d 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 @@ -4,12 +4,19 @@ 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 @@ -22,13 +29,8 @@ import retrofit2.converter.gson.GsonConverterFactory class FragmentHomePage : 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 + + private lateinit var btnBack:ImageView /* override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -40,96 +42,35 @@ class FragmentHomePage : Fragment() { ): 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() - rvPopular=view.findViewById(R.id.rvFragmentHomePagePopular) - rvNewest=view.findViewById(R.id.rvFragmentHomePageNewest) - rvBestRated=view.findViewById(R.id.rvFragmentHomePageBestRated) - //pokupi sve objave iz baze' - getAllPosts() - - + var fm: FragmentTransaction =childFragmentManager.beginTransaction() + fm.replace(R.id.flFragmentHomePageMainContent, FragmentHomePageMainScroll()) + fm.commit() + btnBack.setOnClickListener{ + changeLocationViewToScrollView() + setBtnBackInvisible() + } return view } - private fun getAllPosts(){ - val api = Retrofit.Builder() - .addConverterFactory(GsonConverterFactory.create()) - .baseUrl(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(); - } - }) + fun changeScrollVIewToLocationView(){ + var fm: FragmentTransaction =childFragmentManager.beginTransaction() + fm.replace(R.id.flFragmentHomePageMainContent, FragmentShowPostsByLocation()) + fm.commit() } - - 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()) - - } - + fun changeLocationViewToScrollView(){ + var fm: FragmentTransaction =childFragmentManager.beginTransaction() + fm.replace(R.id.flFragmentHomePageMainContent, FragmentHomePageMainScroll()) + fm.commit() } - 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()) - } + fun setBtnBackInvisible(){ + btnBack.isVisible=false } - - 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()) - } - + fun setBtnBackVisible(){ + btnBack.isVisible=true } - - - -}
\ No newline at end of file +} 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/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/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/layout/fragment_home_page.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page.xml index ead86e7..5d9e62c 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 @@ -89,211 +89,28 @@ 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" /> - <ScrollView - android:id="@+id/svFragmentHomePageMainScroll" - android:layout_width="0dp" + <FrameLayout + android:id="@+id/flFragmentHomePageMainContent" + android:layout_width="match_parent" android:layout_height="0dp" android:layout_marginStart="16dp" - android:layout_marginTop="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/cvFragmentHomePageSearch" - app:layout_constraintVertical_bias="0.0"> - - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:orientation="vertical" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="parent" - app:layout_constraintVertical_bias="0.0"> - - <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/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_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" - /> - - <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:text="Najposećenije" - android:textStyle="bold" - android:layout_gravity="left" - /> - - <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> + 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_show_posts.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_show_posts.xml index 64ad74c..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 @@ -52,10 +52,12 @@ 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/btnSortDirection" @@ -63,12 +65,12 @@ 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" - android:padding="@dimen/component_padding" app:layout_constraintStart_toEndOf="@+id/btnSortType" - tools:layout_editor_absoluteY="0dp" - android:background="@color/white"/> + app:layout_constraintTop_toTopOf="parent" /> <ImageButton android:id="@+id/btnLinearLayout" @@ -83,7 +85,7 @@ app:layout_constraintEnd_toStartOf="@+id/btnGridLayout" app:layout_constraintHorizontal_bias="1.0" app:layout_constraintStart_toEndOf="@+id/btnSortDirection" - tools:layout_editor_absoluteY="0dp" /> + app:layout_constraintTop_toTopOf="parent" /> <ImageButton android:id="@+id/btnGridLayout" @@ -92,12 +94,12 @@ 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_full" - android:padding="@dimen/component_padding" - android:clickable="true" app:layout_constraintStart_toEndOf="@+id/btnSortDirection" - tools:layout_editor_absoluteY="0dp" /> + app:layout_constraintTop_toTopOf="parent" /> </androidx.constraintlayout.widget.ConstraintLayout> <androidx.swiperefreshlayout.widget.SwipeRefreshLayout android:layout_height="match_parent" 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 |