diff options
author | TAMARA JERINIC <tamara.jerinic@gmail.com> | 2022-12-05 21:20:56 +0100 |
---|---|---|
committer | TAMARA JERINIC <tamara.jerinic@gmail.com> | 2022-12-05 21:20:56 +0100 |
commit | 4eab4ea8df9e3aeb7db8c86fd54a6fa9d59d11a7 (patch) | |
tree | d20cf2b48ac00416e20871d8171d372f149e1c3f | |
parent | 71bfced6c95b79399fc1faf0adfd0af9f87edcd1 (diff) |
Izmenjena struktura stranice za prikaz objave.
13 files changed, 634 insertions, 269 deletions
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 f3d8a63..5a1e8b1 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 @@ -6,10 +6,17 @@ import android.graphics.drawable.ColorDrawable import android.os.Bundle import android.preference.PreferenceManager import android.util.Log +import android.view.ViewGroup +import android.view.ViewGroup.LayoutParams +import android.widget.Button +import android.widget.ImageView import android.widget.TextView import android.widget.Toast import androidx.appcompat.app.AppCompatActivity +import androidx.constraintlayout.widget.ConstraintLayout import androidx.core.content.ContextCompat +import androidx.core.view.isGone +import androidx.core.view.isVisible import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import com.example.brzodolokacije.Adapters.CommentsAdapter @@ -21,6 +28,7 @@ import com.example.brzodolokacije.Services.SharedPreferencesHelper import com.example.brzodolokacije.databinding.ActivitySinglePostBinding import com.google.android.material.bottomsheet.BottomSheetDialog import com.google.gson.Gson +import kotlinx.android.synthetic.main.activity_single_post.view.* import org.osmdroid.config.Configuration import org.osmdroid.tileprovider.tilesource.TileSourceFactory import org.osmdroid.util.GeoPoint @@ -43,17 +51,38 @@ class ActivitySinglePost : AppCompatActivity() { private var starNumber:Number=0 private lateinit var userData:UserReceive private lateinit var user:TextView + private lateinit var linearLayout2:ConstraintLayout + private lateinit var btnChangeHeightUp:ImageView + private lateinit var btnChangeHeightDown:ImageView + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding=ActivitySinglePostBinding.inflate(layoutInflater) setContentView(binding.root) post= intent.extras?.getParcelable("selectedPost")!! + btnChangeHeightUp=findViewById(R.id.activitySinglePostChangeHeightUp) + btnChangeHeightDown=findViewById(R.id.activitySinglePostChangeHeightDown) + + btnChangeHeightDown.isVisible=false + btnChangeHeightDown.isGone=true + btnChangeHeightDown.isClickable=false + btnChangeHeightUp.isVisible=true + btnChangeHeightUp.isGone=false + btnChangeHeightUp.isClickable=true + + linearLayout2=findViewById(R.id.linearLayout2) + + linearLayout2.setOnClickListener { + linearLayout2.getLayoutParams().height= ViewGroup.LayoutParams.MATCH_PARENT; + } + //instantiate adapter and linearLayout adapterImages= PostImageAdapter(this@ActivitySinglePost, post.images as MutableList<PostImage>) layoutManagerImages= LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL,false) recyclerViewImages = binding.rvMain + /* buildRecyclerViewComments() requestGetComments() @@ -67,7 +96,7 @@ class ActivitySinglePost : AppCompatActivity() { val alreadyrated= RatingReceive(starNumber.toInt(),post._id) requestAddRating(alreadyrated) - + */ binding.tvUser.setOnClickListener { val intent: Intent = Intent(this@ActivitySinglePost,ActivityUserProfile::class.java) var b= Bundle() @@ -78,16 +107,39 @@ class ActivitySinglePost : AppCompatActivity() { getMap() } + + btnChangeHeightUp.setOnClickListener { + btnChangeHeightUp.isVisible=false + btnChangeHeightUp.isGone=true + btnChangeHeightUp.isClickable=false + btnChangeHeightDown.isVisible=true + btnChangeHeightDown.isGone=false + btnChangeHeightDown.isClickable=true + linearLayout2.setMinHeight(0); + linearLayout2.setMinimumHeight(0); + linearLayout2.getLayoutParams().height= ViewGroup.LayoutParams.MATCH_PARENT; + } + btnChangeHeightDown.setOnClickListener { + btnChangeHeightDown.isVisible=false + btnChangeHeightDown.isGone=true + btnChangeHeightDown.isClickable=false + btnChangeHeightUp.isVisible=true + btnChangeHeightUp.isGone=false + btnChangeHeightUp.isClickable=true + linearLayout2.setMinHeight(0); + linearLayout2.setMinimumHeight(0); + linearLayout2.getLayoutParams().height= ViewGroup.LayoutParams.WRAP_CONTENT; + } } fun getMap(){ - val mapDialogue = BottomSheetDialog(this@ActivitySinglePost, android.R.style.Theme_Black_NoTitleBar) + /*val mapDialogue = BottomSheetDialog(this@ActivitySinglePost, android.R.style.Theme_Black_NoTitleBar) mapDialogue.getWindow()?.setBackgroundDrawable(ColorDrawable(Color.argb(100, 0, 0, 0))) mapDialogue.setContentView(R.layout.map_dialogue) mapDialogue.setCancelable(true) - mapDialogue.setCanceledOnTouchOutside(true) + mapDialogue.setCanceledOnTouchOutside(true)*/ var map: MapView? = null Configuration.getInstance().load(this, PreferenceManager.getDefaultSharedPreferences(this)); - map=mapDialogue.findViewById(R.id.MapDialogueMapView) + map=findViewById(R.id.MapDialogueMapView) //findViewById(R.id.MapDialogueMapView) as MapView map!!.setTileSource(TileSourceFactory.MAPNIK); map!!.setBuiltInZoomControls(true); @@ -103,11 +155,10 @@ class ActivitySinglePost : AppCompatActivity() { startMarker.setAnchor(Marker.ANCHOR_CENTER, Marker.ANCHOR_CENTER) map!!.getOverlays().add(startMarker) map!!.controller.setCenter(LocMarker) - mapDialogue.show() - - } + } +/* fun buildRecyclerViewComments(){ recyclerViewComments=binding.rvComments adapterComments=CommentsAdapter(comments as MutableList<CommentSend>,this@ActivitySinglePost) @@ -377,4 +428,6 @@ class ActivitySinglePost : AppCompatActivity() { binding.tvCommentCount.text=(Integer.parseInt(binding.tvCommentCount.text.toString())+1).toString() binding.tvCommentCount.invalidate() } + + */ } 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 index 06713ec..96e332a 100644 --- 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 @@ -125,7 +125,7 @@ class CommentsAdapter (val items : MutableList<CommentSend>,val activity: Activi var adapter:CommentsAdapter=rv.adapter as CommentsAdapter adapter.items.add(0,newComment) rv.adapter=adapter - (activity as ActivitySinglePost).addedComment() + //(activity as ActivitySinglePost).addedComment() } } }
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/FragmentSinglePostComments.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/FragmentSinglePostComments.kt new file mode 100644 index 0000000..046bdf6 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/FragmentSinglePostComments.kt @@ -0,0 +1,59 @@ +package com.example.brzodolokacije + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [FragmentSinglePostComments.newInstance] factory method to + * create an instance of this fragment. + */ +class FragmentSinglePostComments : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_single_post_comments, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment FragmentSinglePostComments. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + FragmentSinglePostComments().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentSinglePostDescription.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentSinglePostDescription.kt new file mode 100644 index 0000000..1a7e7da --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Fragments/FragmentSinglePostDescription.kt @@ -0,0 +1,60 @@ +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 com.example.brzodolokacije.R + +// TODO: Rename parameter arguments, choose names that match +// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER +private const val ARG_PARAM1 = "param1" +private const val ARG_PARAM2 = "param2" + +/** + * A simple [Fragment] subclass. + * Use the [FragmentSinglePostDescription.newInstance] factory method to + * create an instance of this fragment. + */ +class FragmentSinglePostDescription : Fragment() { + // TODO: Rename and change types of parameters + private var param1: String? = null + private var param2: String? = null + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + arguments?.let { + param1 = it.getString(ARG_PARAM1) + param2 = it.getString(ARG_PARAM2) + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + // Inflate the layout for this fragment + return inflater.inflate(R.layout.fragment_single_post_description, container, false) + } + + companion object { + /** + * Use this factory method to create a new instance of + * this fragment using the provided parameters. + * + * @param param1 Parameter 1. + * @param param2 Parameter 2. + * @return A new instance of fragment FragmentSinglePostDescription. + */ + // TODO: Rename and change types and number of parameters + @JvmStatic + fun newInstance(param1: String, param2: String) = + FragmentSinglePostDescription().apply { + arguments = Bundle().apply { + putString(ARG_PARAM1, param1) + putString(ARG_PARAM2, param2) + } + } + } +}
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt index 43c2109..88685e4 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Services/RetrofitHelper.kt @@ -7,8 +7,8 @@ import retrofit2.converter.gson.GsonConverterFactory object RetrofitHelper { - val baseUrl="http://10.0.2.2:5279" - //val baseUrl="http://147.91.204.115:10082" + //val baseUrl="http://10.0.2.2:5279" + val baseUrl="http://147.91.204.115:10082" private var retrofit_noauth: IBackendApi? = null private var retrofit_auth: IBackendApi? = null diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/gradient2.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/gradient2.xml new file mode 100644 index 0000000..0d73580 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/gradient2.xml @@ -0,0 +1,28 @@ +<vector xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:aapt="http://schemas.android.com/aapt" + android:width="324dp" + android:height="43dp" + android:viewportWidth="324" + android:viewportHeight="43"> + <group> + <path + android:pathData="M0 0H324V43H0z"> + <aapt:attr name="android:fillColor"> + <gradient + android:type="linear" + android:startX="162" + android:startY="0" + android:endX="162" + android:endY="43"> + <item + android:color="#1A192124" + android:offset="0.2"/> + + <item + android:color="#FA192124" + android:offset="1"/> + </gradient> + </aapt:attr> + </path> + </group> +</vector>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_keyboard_arrow_down_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_keyboard_arrow_down_24.xml new file mode 100644 index 0000000..ee6e4de --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_keyboard_arrow_down_24.xml @@ -0,0 +1,5 @@ +<vector android:height="30dp" android:tint="#747474" + android:viewportHeight="24" android:viewportWidth="24" + android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M8.12,9.29L12,13.17l3.88,-3.88c0.39,-0.39 1.02,-0.39 1.41,0 0.39,0.39 0.39,1.02 0,1.41l-4.59,4.59c-0.39,0.39 -1.02,0.39 -1.41,0L6.7,10.7c-0.39,-0.39 -0.39,-1.02 0,-1.41 0.39,-0.38 1.03,-0.39 1.42,0z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_keyboard_arrow_up_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_keyboard_arrow_up_24.xml new file mode 100644 index 0000000..0d6676b --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_keyboard_arrow_up_24.xml @@ -0,0 +1,5 @@ +<vector android:height="30dp" android:tint="#747474" + android:viewportHeight="24" android:viewportWidth="24" + android:width="30dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M8.12,14.71L12,10.83l3.88,3.88c0.39,0.39 1.02,0.39 1.41,0 0.39,-0.39 0.39,-1.02 0,-1.41L12.7,8.71c-0.39,-0.39 -1.02,-0.39 -1.41,0L6.7,13.3c-0.39,0.39 -0.39,1.02 0,1.41 0.39,0.38 1.03,0.39 1.42,0z"/> +</vector> diff --git a/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_star_outline_24.xml b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_star_outline_24.xml new file mode 100644 index 0000000..e97ab0a --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/drawable/ic_round_star_outline_24.xml @@ -0,0 +1,5 @@ +<vector android:height="24dp" android:tint="#747474" + android:viewportHeight="24" android:viewportWidth="24" + android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M19.65,9.04l-4.84,-0.42 -1.89,-4.45c-0.34,-0.81 -1.5,-0.81 -1.84,0L9.19,8.63l-4.83,0.41c-0.88,0.07 -1.24,1.17 -0.57,1.75l3.67,3.18 -1.1,4.72c-0.2,0.86 0.73,1.54 1.49,1.08l4.15,-2.5 4.15,2.51c0.76,0.46 1.69,-0.22 1.49,-1.08l-1.1,-4.73 3.67,-3.18c0.67,-0.58 0.32,-1.68 -0.56,-1.75zM12,15.4l-3.76,2.27 1,-4.28 -3.32,-2.88 4.38,-0.38L12,6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z"/> +</vector> 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 e3cabb5..744a2a2 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_single_post.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_single_post.xml @@ -1,310 +1,194 @@ <?xml version="1.0" encoding="utf-8"?> - <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" + xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" - android:padding="@dimen/component_padding" - xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:app="http://schemas.android.com/apk/res-auto" tools:context=".Activities.ActivitySinglePost"> - <ScrollView - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:fillViewport="true"> - <androidx.constraintlayout.widget.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="match_parent"> - <androidx.recyclerview.widget.RecyclerView + + <androidx.recyclerview.widget.RecyclerView android:id="@+id/rvMain" android:layout_width="match_parent" + android:layout_height="0dp" + android:layout_margin="0dp" android:paddingBottom="@dimen/component_padding" - android:layout_height="400dp" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent"> - </androidx.recyclerview.widget.RecyclerView> - - - -<androidx.constraintlayout.widget.ConstraintLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:gravity="bottom" - app:layout_constraintTop_toBottomOf="@id/rvMain" - tools:layout_editor_absoluteX="0dp"> - - <TextView - android:id="@+id/tvLocationParent" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="top|start" - android:padding="@dimen/text_padding" - android:text="Drzava, grad" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tvLocationType" /> - - <TextView - android:id="@+id/tvTitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="top|start" - android:padding="@dimen/text_padding" - android:text="Naslov" - android:textSize="@dimen/header1_size" - android:textStyle="bold" - app:layout_constraintStart_toStartOf="parent" /> - - <TextView - android:id="@+id/tvLocationType" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="top|start" - android:padding="@dimen/text_padding" - android:text="Tip lokacije" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tvTitle" /> - - <TextView - android:id="@+id/tvUser" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:clickable="true" - android:gravity="top|start" - android:padding="@dimen/text_padding" - android:text="User" + app:layout_constraintBottom_toTopOf="@+id/linearLayout2" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tvLocationParent" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.0" /> <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/constraintLayout" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginTop="36dp" + android:id="@+id/linearLayout2" + android:layout_width="408dp" + android:layout_height="723dp" + android:layout_marginBottom="8dp" + android:background="@drawable/view_top_corner_radius" + android:elevation="30dp" + android:padding="16dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintHorizontal_bias="1.0" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toBottomOf="@+id/tvLocationParent"> + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toStartOf="parent"> + - <LinearLayout - android:id="@+id/linearLayout" + <TextView + android:id="@+id/tvTitle" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:orientation="horizontal" + android:layout_marginTop="24dp" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="Naslov" + style="@style/title" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent"> + app:layout_constraintTop_toTopOf="parent" /> - <ImageView - android:id="@+id/star1" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> - - <ImageView - android:id="@+id/star2" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> + <ImageView + android:id="@+id/imageView12" + android:layout_width="30dp" + android:layout_height="30dp" + android:src="@drawable/ic_baseline_location_on_24" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvTitle" /> - <ImageView - android:id="@+id/star3" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> + <TextView + android:id="@+id/tvLocationParent" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="Drzava, grad" + app:layout_constraintStart_toEndOf="@+id/imageView12" + app:layout_constraintTop_toBottomOf="@+id/tvTitle" /> - <ImageView - android:id="@+id/star4" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> + <TextView + android:id="@+id/tvLocationType" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginEnd="16dp" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="Tip lokacije" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvTitle" /> - <ImageView - android:id="@+id/star5" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_weight="1" - android:src="@android:drawable/btn_star_big_on" /> - </LinearLayout> + <TextView + android:id="@+id/tvUser" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="4dp" + android:clickable="true" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="User" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvLocationType" /> <TextView android:id="@+id/tvRating" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="24dp" + android:layout_marginEnd="4dp" android:padding="@dimen/text_padding" android:text="4.2" android:textStyle="bold" app:layout_constraintEnd_toStartOf="@+id/tvNumberOfRatings" - tools:layout_editor_absoluteY="4dp" /> + app:layout_constraintTop_toTopOf="parent" /> <TextView android:id="@+id/tvNumberOfRatings" android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_marginTop="24dp" android:padding="@dimen/text_padding" android:text="(10,500)" app:layout_constraintEnd_toEndOf="parent" - tools:layout_editor_absoluteY="4dp" /> - - <androidx.constraintlayout.widget.ConstraintLayout - android:id="@+id/constraintLayout3" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:background="@drawable/rounded_picture_background" - android:elevation="5dp" - android:padding="@dimen/component_padding" - app:layout_constraintTop_toBottomOf="@+id/linearLayout" - tools:layout_editor_absoluteX="0dp"> - - <TextView - android:id="@+id/tvDescriptionLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="top|start" - android:padding="@dimen/text_padding" - android:text="Opis" - android:textStyle="bold" /> - - <TextView - android:id="@+id/tvDescription" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:text="TextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextView" - app:layout_constraintTop_toBottomOf="@+id/tvDescriptionLabel" /> - - </androidx.constraintlayout.widget.ConstraintLayout> + app:layout_constraintTop_toTopOf="parent" /> + + <ImageView + android:id="@+id/activitySinglePostChangeHeightUp" + android:layout_width="100dp" + android:layout_height="30dp" + android:clickable="true" + android:src="@drawable/ic_round_keyboard_arrow_up_24" + android:text="Button" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <ImageView + android:id="@+id/activitySinglePostChangeHeightDown" + android:layout_width="100dp" + android:layout_height="30dp" + android:clickable="true" + android:src="@drawable/ic_round_keyboard_arrow_down_24" + android:text="Button" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <LinearLayout - android:id="@+id/linearLayout2" + <org.osmdroid.views.MapView + android:id="@+id/MapDialogueMapView" android:layout_width="match_parent" - android:layout_height="match_parent" - android:layout_weight="1" - android:orientation="horizontal" - android:paddingVertical="@dimen/component_padding" - app:layout_constraintTop_toBottomOf="@id/constraintLayout3"> - - <ImageButton - android:id="@+id/rateStar1" - android:layout_width="30dp" - android:layout_height="40dp" - android:layout_gravity="center_vertical" - android:layout_weight="1" - android:backgroundTint="@color/white" - android:scaleType="centerCrop" - android:src="@drawable/empty_star" /> - - <ImageButton - android:id="@+id/rateStar2" - android:layout_width="30dp" - android:layout_height="40dp" - android:layout_gravity="center_vertical" - android:layout_weight="1" - android:backgroundTint="@color/white" - android:scaleType="centerCrop" - android:src="@drawable/empty_star" /> - - <ImageButton - android:id="@+id/rateStar3" - android:layout_width="30dp" - android:layout_height="40dp" - android:layout_gravity="center_vertical" - android:layout_weight="1" - android:backgroundTint="@color/white" - android:scaleType="centerCrop" - android:src="@drawable/empty_star" /> - - <ImageButton - android:id="@+id/rateStar4" - android:layout_width="30dp" - android:layout_height="40dp" - android:layout_gravity="center_vertical" - android:layout_weight="1" - android:backgroundTint="@color/white" - android:scaleType="centerCrop" - android:src="@drawable/empty_star" /> - - <ImageButton - android:id="@+id/rateStar5" - android:layout_width="30dp" - android:layout_height="40dp" - android:layout_gravity="center_vertical" - android:layout_weight="1" - android:backgroundTint="@color/white" - android:scaleType="centerCrop" - android:src="@drawable/empty_star" /> - - <Button - android:id="@+id/submitRating" - android:layout_width="30dp" - android:layout_height="40dp" - android:layout_gravity="center_vertical" - android:layout_weight="1" - android:backgroundTint="@color/white" - android:text="ok" - android:textColor="@color/black" /> - </LinearLayout> + android:layout_height="150dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvUser" /> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" - android:layout_height="wrap_content" - app:layout_constraintTop_toBottomOf="@id/linearLayout2"> + android:layout_height="400dp" + android:layout_marginTop="8dp" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/MapDialogueMapView"> - <LinearLayout - android:id="@+id/postCommentLayout" - android:layout_width="match_parent" + <Button + android:id="@+id/btnActivitySinglePostDescription" + android:layout_width="150dp" android:layout_height="wrap_content" - android:orientation="horizontal" - app:layout_constraintStart_toStartOf="parent"> + android:layout_marginStart="8dp" + android:layout_marginTop="8dp" + android:layout_marginBottom="8dp" + android:backgroundTint="#FFFFFF" + android:stateListAnimator="@null" + android:text="opis" + android:textColor="@color/cardview_dark_background" + app:layout_constraintBottom_toTopOf="@+id/flFragmentProfileFragmentContainer" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - <EditText - android:id="@+id/NewComment" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_weight="1" - android:hint="Unesite komentar ovde" /> - - <ImageButton - android:id="@+id/btnPostComment" - android:layout_width="50dp" - android:layout_height="50dp" - android:backgroundTint="@color/white" - android:scaleType="fitCenter" - android:src="@drawable/post_comment" /> - </LinearLayout> - - - <TextView - android:id="@+id/tvCommentLabel" - android:layout_width="wrap_content" + <Button + android:id="@+id/btnActivitySinglePostComments" + android:layout_width="150dp" android:layout_height="wrap_content" - android:padding="@dimen/text_padding" + android:layout_marginTop="8dp" + android:layout_marginEnd="8dp" + android:layout_marginBottom="8dp" + android:backgroundTint="#FFFFFF" + android:stateListAnimator="@null" android:text="Komentari" - android:textStyle="bold" - app:layout_constraintTop_toBottomOf="@id/postCommentLayout" /> - - <TextView - android:id="@+id/tvCommentCount" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:padding="@dimen/text_padding" - android:text="0" - app:layout_constraintStart_toEndOf="@id/tvCommentLabel" - app:layout_constraintTop_toBottomOf="@id/postCommentLayout" /> - - <androidx.recyclerview.widget.RecyclerView - android:id="@+id/rvComments" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:nestedScrollingEnabled="false" - app:layout_constraintTop_toBottomOf="@id/tvCommentLabel"> - - </androidx.recyclerview.widget.RecyclerView> + android:textColor="@color/cardview_dark_background" + app:layout_constraintBottom_toTopOf="@+id/flFragmentProfileFragmentContainer" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <FrameLayout + android:id="@+id/flFragmentProfileFragmentContainer" + android:layout_width="409dp" + android:layout_height="330dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/btnActivitySinglePostComments" + app:layout_constraintVertical_bias="1.0"></FrameLayout> </androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout> -</androidx.constraintlayout.widget.ConstraintLayout> -</androidx.constraintlayout.widget.ConstraintLayout> -</ScrollView> -</androidx.constraintlayout.widget.ConstraintLayout> + + </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_comments.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_comments.xml new file mode 100644 index 0000000..cb5db29 --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_comments.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout 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:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".FragmentSinglePostComments"> + + <androidx.constraintlayout.widget.ConstraintLayout + android:layout_width="match_parent" + android:layout_height="wrap_content"> + + + <TextView + android:id="@+id/tvCommentLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="@dimen/text_padding" + android:text="Komentari" + android:textStyle="bold" + style="@style/title" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/tvCommentCount" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:padding="@dimen/text_padding" + android:text="0" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.0" + app:layout_constraintStart_toEndOf="@+id/tvCommentLabel" + app:layout_constraintTop_toTopOf="parent" /> + + </androidx.constraintlayout.widget.ConstraintLayout> + + <androidx.recyclerview.widget.RecyclerView + android:id="@+id/rvComments" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:nestedScrollingEnabled="false" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + tools:layout_editor_absoluteY="282dp"> + + </androidx.recyclerview.widget.RecyclerView> + + <LinearLayout + android:id="@+id/postCommentLayout" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> + + <EditText + android:id="@+id/NewComment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_weight="1" + android:hint="Unesite komentar ovde" /> + + <ImageButton + android:id="@+id/btnPostComment" + android:layout_width="50dp" + android:layout_height="50dp" + android:backgroundTint="@color/white" + android:scaleType="fitCenter" + android:src="@drawable/post_comment" /> + + </LinearLayout> + +</LinearLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_description.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_description.xml new file mode 100644 index 0000000..c2ad49b --- /dev/null +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/fragment_single_post_description.xml @@ -0,0 +1,187 @@ +<?xml version="1.0" encoding="utf-8"?> +<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + android:layout_width="match_parent" + android:layout_height="match_parent" + tools:context=".Fragments.FragmentSinglePostDescription"> + <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/constraintLayout3" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:background="@drawable/rounded_picture_background" + android:padding="@dimen/component_padding" + app:layout_constraintTop_toBottomOf="@+id/linearLayout" + tools:layout_editor_absoluteX="0dp"> + + <TextView + android:id="@+id/tvDescriptionLabel" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginStart="8dp" + android:layout_marginEnd="362dp" + android:gravity="top|start" + android:padding="@dimen/text_padding" + android:text="Opis" + android:textSize="@dimen/header1_size" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/tvDescription" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="TextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextViewTextView" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvDescriptionLabel" /> + + + <TextView + android:id="@+id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="32dp" + android:text="Oceni" + android:textColor="@color/cardview_dark_background" + android:textSize="@dimen/header1_size" + android:textStyle="bold" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.005" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvDescription" /> + + <LinearLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:orientation="horizontal" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/title"> + + <ImageView + android:id="@+id/rateStar1" + android:layout_width="50dp" + android:layout_height="50dp" + android:scaleType="centerCrop" + android:src="@drawable/ic_round_star_outline_24" /> + + <ImageView + android:id="@+id/rateStar2" + android:layout_width="50dp" + android:layout_height="50dp" + android:scaleType="centerCrop" + android:src="@drawable/ic_round_star_outline_24" /> + + <ImageView + android:id="@+id/rateStar3" + android:layout_width="50dp" + android:layout_height="50dp" + android:scaleType="centerCrop" + android:src="@drawable/ic_round_star_outline_24" /> + + <ImageView + android:id="@+id/rateStar4" + android:layout_width="50dp" + android:layout_height="50dp" + android:scaleType="centerCrop" + android:src="@drawable/ic_round_star_outline_24" /> + + <ImageView + android:id="@+id/rateStar5" + android:layout_width="50dp" + android:layout_height="50dp" + android:scaleType="centerCrop" + android:src="@drawable/ic_round_star_outline_24" /> + + + </LinearLayout> + <!--<LinearLayout + android:id="@+id/linearLayout2" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginTop="24dp" + + + android:paddingVertical="@dimen/component_padding" + app:layout_constraintTop_toBottomOf="@id/constraintLayout3" + tools:layout_editor_absoluteX="10dp"> + + + <TextView + android:id="@+id/title" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="Oceni" + style="@style/title" + android:textColor="@color/cardview_dark_background" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@+id/tvDescriptionLabel" /> + + <ImageButton + android:id="@+id/rateStar1" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:layout_weight="1" + + android:scaleType="centerCrop" + android:src="@drawable/empty_star" /> + + <ImageButton + android:id="@+id/rateStar2" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:layout_weight="1" + + android:scaleType="centerCrop" + android:src="@drawable/empty_star" /> + + <ImageButton + android:id="@+id/rateStar3" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:layout_weight="1" + + android:scaleType="centerCrop" + android:src="@drawable/empty_star" /> + + <ImageButton + android:id="@+id/rateStar4" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:layout_weight="1" + + android:scaleType="centerCrop" + android:src="@drawable/empty_star" /> + + <ImageButton + android:id="@+id/rateStar5" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:layout_weight="1" + + android:scaleType="centerCrop" + android:src="@drawable/ic_round_star_outline_24"> + + <Button + android:id="@+id/submitRating" + android:layout_width="30dp" + android:layout_height="40dp" + android:layout_gravity="center_vertical" + android:layout_weight="1" + + android:text="ok"/> + </LinearLayout>--> + + </androidx.constraintlayout.widget.ConstraintLayout> + + +</FrameLayout>
\ 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 ca3ca44..7ec8c64 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/values/styles.xml @@ -23,4 +23,9 @@ <item name="cornerSizeTopLeft">10dp</item> <item name="cornerSizeTopRight">10dp</item> </style> + + <style name="title"> + <item name="android:textSize">@dimen/header1_size</item> + <item name="android:textStyle">bold</item> + </style> </resources>
\ No newline at end of file |