aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ShowPostsHomePageAdapter.kt5
-rw-r--r--Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentHomePageMainScroll.kt21
-rw-r--r--Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_location_on_24.xml5
-rw-r--r--Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_star_rate_24.xml5
-rw-r--r--Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page.xml36
-rw-r--r--Client/BrzoDoLokacije/app/src/main/res/layout/fragment_home_page_main_scroll.xml45
-rw-r--r--Client/BrzoDoLokacije/app/src/main/res/layout/post_item_home_page.xml113
-rw-r--r--Client/BrzoDoLokacije/app/src/main/res/values/styles.xml1
8 files changed, 183 insertions, 48 deletions
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 3391355..acea646 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
@@ -47,6 +47,8 @@ class ShowPostsHomePageAdapter(var postPreview:MutableList<PostPreview>,val acti
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)
+ private val locationDetail:TextView=view.findViewById(R.id.tvPIHPLocationDetail)
+ private val rating:TextView=view.findViewById(R.id.tvPIHPRecension)
fun bindView(postPreview:PostPreview){
//background.setImageURI(postPreview.images[0]._id.to)
@@ -56,6 +58,9 @@ inner class PostViewHolder(view: View):RecyclerView.ViewHolder(view){
.into(background)
}
locationName.text=postPreview.location.name
+ rating.text=postPreview.ratings.toString()
+ locationDetail.text="Srbija, Kragujevac"
+
}
}
} \ 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
index cf811df..3846d6c 100644
--- 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
@@ -4,8 +4,11 @@ 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.LinearLayout
import android.widget.Toast
+import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentTransaction
import androidx.recyclerview.widget.LinearLayoutManager
@@ -17,6 +20,7 @@ import com.example.brzodolokacije.Models.PostPreview
import com.example.brzodolokacije.R
import com.example.brzodolokacije.Services.RetrofitHelper
import com.example.brzodolokacije.Services.SharedPreferencesHelper
+import kotlinx.android.synthetic.main.fragment_home_page_main_scroll.*
import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
@@ -42,9 +46,11 @@ class FragmentHomePageMainScroll : Fragment() {
private lateinit var location_amusement_park: ImageButton
private lateinit var location_attraction: ImageButton
private lateinit var location_landmark: ImageButton
-
+private lateinit var change:Button
private lateinit var filter: LocationType
private lateinit var filterString: String
+ private lateinit var ll1: LinearLayout
+ private lateinit var ll2:LinearLayout
override fun onCreateView(
@@ -59,7 +65,9 @@ class FragmentHomePageMainScroll : Fragment() {
rvPopular=view.findViewById(R.id.rvFragmentHomePagePopular)
rvNewest=view.findViewById(R.id.rvFragmentHomePageNewest)
rvBestRated=view.findViewById(R.id.rvFragmentHomePageBestRated)
-
+ //change=view.findViewById(R.id.change)
+ ll1=view.findViewById(R.id.ll1)
+ ll2=view.findViewById(R.id.ll2)
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)
@@ -174,9 +182,14 @@ class FragmentHomePageMainScroll : Fragment() {
parentFrag.setBtnBackVisible()
}
+ /* ll1.isVisible=true
+ ll2.isVisible=false
+ change.setOnClickListener {
+ ll1.isVisible=true
+ ll2.isVisible=false
+ }
-
-
+*/
return view
}
diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_location_on_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_location_on_24.xml
new file mode 100644
index 0000000..c0bbc95
--- /dev/null
+++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_location_on_24.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#F1DB24"
+ 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="M12,2C8.13,2 5,5.13 5,9c0,5.25 7,13 7,13s7,-7.75 7,-13c0,-3.87 -3.13,-7 -7,-7zM12,11.5c-1.38,0 -2.5,-1.12 -2.5,-2.5s1.12,-2.5 2.5,-2.5 2.5,1.12 2.5,2.5 -1.12,2.5 -2.5,2.5z"/>
+</vector>
diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_star_rate_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_star_rate_24.xml
new file mode 100644
index 0000000..cdafe07
--- /dev/null
+++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_baseline_star_rate_24.xml
@@ -0,0 +1,5 @@
+<vector android:height="24dp" android:tint="#F1DB24"
+ 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="M14.43,10l-2.43,-8l-2.43,8l-7.57,0l6.18,4.41l-2.35,7.59l6.17,-4.69l6.18,4.69l-2.35,-7.59l6.17,-4.41z"/>
+</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 5d9e62c..cbde9c6 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
@@ -4,6 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
+ android:background="#f6f6f6"
tools:context=".Fragments.FragmentHomePage">
@@ -11,13 +12,12 @@
android:id="@+id/tvFragmentHomePageHelloName"
android:layout_width="0dp"
android:layout_height="wrap_content"
- android:layout_marginStart="16dp"
+ android:layout_marginStart="20dp"
android:layout_marginTop="56dp"
- android:layout_marginEnd="107dp"
android:text="Zdravo, Mia"
- app:layout_constraintEnd_toStartOf="@+id/cvFragmentHomePageProfile"
- app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintEnd_toEndOf="parent"
+ app:layout_constraintStart_toEndOf="@+id/cvFragmentHomePageProfile"
app:layout_constraintTop_toTopOf="parent" />
<androidx.cardview.widget.CardView
@@ -25,11 +25,10 @@
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_gravity="center"
- android:layout_marginTop="24dp"
- android:layout_marginEnd="24dp"
+ android:layout_marginStart="20dp"
+ android:layout_marginTop="20dp"
app:cardCornerRadius="250dp"
- app:layout_constraintEnd_toEndOf="parent"
- app:layout_constraintStart_toEndOf="@+id/tvFragmentHomePageHelloName"
+ app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<ImageView
@@ -38,10 +37,11 @@
android:layout_height="70dp"
android:scaleType="centerCrop"
android:src="@drawable/ic_baseline_person_24"
- tools:ignore="ContentDescription" />
+ tools:ignore="ContentDescription"
+ tools:layout_editor_absoluteX="9dp"
+ tools:layout_editor_absoluteY="15dp" />
</androidx.cardview.widget.CardView>
-
<TextView
android:id="@+id/tvFragmentHomePageSearch"
android:layout_width="wrap_content"
@@ -49,6 +49,7 @@
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:text="Pretraži lokacije"
+ android:visibility="invisible"
android:textSize="20sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
@@ -59,9 +60,10 @@
android:id="@+id/cvFragmentHomePageSearch"
android:layout_width="0dp"
android:layout_height="40dp"
- android:layout_marginTop="10dp"
android:layout_marginStart="16dp"
+ android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
+ android:layout_marginBottom="15dp"
android:elevation="0dp"
app:cardCornerRadius="20dp"
app:layout_constraintEnd_toEndOf="parent"
@@ -73,10 +75,10 @@
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" />
+ android:backgroundTint="@color/white"
+ android:hint=" Pretraži lokacije"
+ android:inputType="textPersonName"
+ android:paddingLeft="15dp" />
<com.google.android.material.button.MaterialButton
android:layout_width="49dp"
@@ -104,8 +106,6 @@
android:id="@+id/flFragmentHomePageMainContent"
android:layout_width="match_parent"
android:layout_height="0dp"
- android:layout_marginStart="16dp"
- android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -113,4 +113,6 @@
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
index 90d1037..2883291 100644
--- 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
@@ -12,9 +12,14 @@
<androidx.cardview.widget.CardView
+ android:backgroundTint="#f6f6f6"
+android:layout_marginTop="16dp"
android:id="@+id/cvFragmentHomePageText1"
android:layout_width="match_parent"
- android:layout_height="wrap_content">
+ android:layout_height="wrap_content"
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
+ >
<TextView
android:id="@+id/tvFragmentHomePagePopular"
@@ -37,12 +42,16 @@
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
android:id="@+id/rvFragmentHomePagePopular"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp" />
<HorizontalScrollView
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
android:id="@+id/hsvFragmentHomePageLocationButtonScroll"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -128,8 +137,25 @@
</LinearLayout>
</HorizontalScrollView>
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="vertical">
+<LinearLayout
+ android:orientation="vertical"
+ android:id="@+id/ll1"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
+ android:backgroundTint="#f6f6f6"
+ android:layout_marginStart="25dp"
+ android:layout_marginEnd="16dp"
android:id="@+id/cvFragmentHomePageText2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -153,11 +179,23 @@
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
android:id="@+id/rvFragmentHomePageNewest"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
+</LinearLayout>
+ <LinearLayout
+ android:id="@+id/ll2"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
+ android:backgroundTint="#f6f6f6"
+
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
android:id="@+id/cvFragmentHomePageText3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@@ -181,10 +219,13 @@
</androidx.cardview.widget.CardView>
<androidx.recyclerview.widget.RecyclerView
+ android:layout_marginStart="16dp"
+ android:layout_marginEnd="16dp"
android:id="@+id/rvFragmentHomePageBestRated"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
+</LinearLayout></LinearLayout>
+</LinearLayout>
</LinearLayout>
-
</ScrollView> \ 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 441f97b..9d26ddc 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
@@ -2,46 +2,109 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="150dp"
- android:layout_height="180dp">
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
<com.google.android.material.imageview.ShapeableImageView
- android:id="@+id/ivPIHPBackground"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:layout_marginTop="8dp"
- android:layout_marginEnd="16dp"
- android:layout_marginBottom="8dp"
- android:scaleType="fitXY"
+ android:id="@+id/imageView9"
+ android:layout_width="170dp"
+ android:layout_height="240dp"
+ android:layout_marginStart="4dp"
+ android:layout_marginBottom="10dp"
+ android:layout_marginEnd="4dp"
+ android:layout_marginTop="4dp"
+ android:elevation="3dp"
+ android:src="@color/white"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
+
app:layout_constraintTop_toTopOf="parent"
- app:shapeAppearanceOverlay="@style/Circular"
- app:srcCompat="@drawable/b1" />
+ app:shapeAppearanceOverlay="@style/Circular" />
<com.google.android.material.imageview.ShapeableImageView
- android:id="@+id/ivPIHPMenu"
+ android:id="@+id/ivPIHPBackground"
android:layout_width="0dp"
- android:layout_height="22dp"
- app:layout_constraintBottom_toBottomOf="@+id/ivPIHPBackground"
-
- app:layout_constraintEnd_toEndOf="@+id/ivPIHPBackground"
- app:layout_constraintHorizontal_bias="0.0"
- app:layout_constraintStart_toStartOf="@+id/ivPIHPBackground"
- app:shapeAppearanceOverlay="@style/roundedBottom"
- app:srcCompat="@color/dark_blue_transparent" />
+ android:layout_height="180dp"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="14dp"
+ android:layout_marginEnd="12dp"
+ android:elevation="3dp"
+ android:scaleType="fitXY"
+ app:layout_constraintBottom_toBottomOf="@+id/imageView9"
+ app:layout_constraintEnd_toEndOf="@+id/imageView9"
+ app:layout_constraintHorizontal_bias="1.0"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toTopOf="parent"
+ app:layout_constraintVertical_bias="0.04"
+ app:shapeAppearanceOverlay="@style/Circular"
+ app:srcCompat="@drawable/b1" />
<TextView
android:id="@+id/tvPIHPLocationName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:layout_marginStart="8dp"
+ android:layout_marginStart="16dp"
+ android:layout_marginTop="4dp"
+ android:elevation="3dp"
android:text="TextView"
- android:textColor="@color/white"
- android:textSize="10dp"
- app:layout_constraintStart_toStartOf="@+id/ivPIHPMenu"
- app:layout_constraintTop_toTopOf="@+id/ivPIHPMenu" />
+ android:textSize="14sp"
+ android:textStyle="bold"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/ivPIHPBackground" />
+
+ <TextView
+ android:id="@+id/tvPIHPRecension"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginTop="8dp"
+
+ android:layout_marginEnd="8dp"
+ android:elevation="3dp"
+ android:text="TextView"
+ android:textSize="11dp"
+ android:textStyle="bold"
+ app:layout_constraintEnd_toEndOf="@+id/imageView9"
+ app:layout_constraintTop_toBottomOf="@+id/ivPIHPBackground" />
+
+ <ImageView
+ android:id="@+id/imageView10"
+
+ android:layout_width="15dp"
+ android:layout_height="15dp"
+ android:layout_marginTop="8dp"
+ android:elevation="3dp"
+ app:layout_constraintEnd_toStartOf="@+id/tvPIHPRecension"
+ app:layout_constraintTop_toBottomOf="@+id/ivPIHPBackground"
+ app:srcCompat="@drawable/ic_baseline_star_rate_24" />
+
+ <ImageView
+ android:id="@+id/imageView11"
+
+ android:layout_width="20dp"
+ android:layout_height="19dp"
+ android:layout_marginStart="12dp"
+ android:layout_marginTop="2dp"
+ android:elevation="3dp"
+ app:layout_constraintStart_toStartOf="parent"
+ app:layout_constraintTop_toBottomOf="@+id/tvPIHPLocationName"
+ app:srcCompat="@drawable/ic_baseline_location_on_24" />
+
+ <TextView
+ android:id="@+id/tvPIHPLocationDetail"
+
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="4dp"
+ android:layout_marginTop="2dp"
+ android:elevation="3dp"
+ android:text="TextView"
+ android:textSize="11dp"
+ app:layout_constraintEnd_toEndOf="@+id/imageView9"
+ app:layout_constraintHorizontal_bias="0.0"
+ app:layout_constraintStart_toEndOf="@+id/imageView11"
+ app:layout_constraintTop_toBottomOf="@+id/tvPIHPLocationName" />
+ " />
</androidx.constraintlayout.widget.ConstraintLayout> \ No newline at end of file
diff --git a/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml b/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml
index d8a3730..cad0a8a 100644
--- a/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml
+++ b/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml
@@ -12,6 +12,7 @@
</style>
<style name="Circular">
<item name="cornerSize">20dp</item>
+
</style>
<style name="roundedBottom">
<item name="cornerSizeBottomLeft">20dp</item>