diff options
author | branislav.radivojevic <wafflemynxyt@gmail.com> | 2022-11-20 21:36:18 +0100 |
---|---|---|
committer | branislav.radivojevic <wafflemynxyt@gmail.com> | 2022-11-20 21:36:18 +0100 |
commit | 19150be02821c304cd40fbf4df10d64436648db3 (patch) | |
tree | efb68ea00b522ffb77abd1981891175d35997d5f /Client | |
parent | e6bb1a00d7010a04ecbbdaf3592d4cba4a05e2e1 (diff) |
tags(samo izgled),user history,viewtick on post
Diffstat (limited to 'Client')
5 files changed, 90 insertions, 3 deletions
diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityAddPost.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityAddPost.kt index f79769d..ef026a5 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityAddPost.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Activities/ActivityAddPost.kt @@ -44,6 +44,9 @@ class ActivityAddPost : AppCompatActivity() { private lateinit var descriptionString:String private lateinit var post:Button private lateinit var addLocation:Button + private lateinit var tagLayout:LinearLayout + private lateinit var tagButtons:List<Button> + private lateinit var tagAutoText: AutoCompleteTextView val incorectCoord:Double=1000.0 val LOCATIONREQCODE=123 var longitude:Double=incorectCoord @@ -70,6 +73,12 @@ class ActivityAddPost : AppCompatActivity() { post=findViewById<View>(R.id.btnActivityAddPostPost) as Button addLocation=findViewById<View>(R.id.btnActivityAddPostAddLocation) as Button + val tags=resources.getStringArray(R.array.Tags) + //Log.d("Main",tags[0].toString()) + val tagadapter = ArrayAdapter(this,android.R.layout.simple_list_item_1,tags) + tagAutoText= findViewById(R.id.acTags) as AutoCompleteTextView + tagAutoText.setAdapter(tagadapter) + progressDialog= ProgressDialog(this) progressDialog!!.setMessage("Molimo sacekajte!!!") progressDialog!!.setCancelable(false) diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ShowPostsAdapter.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ShowPostsAdapter.kt index cf16689..e09cd06 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ShowPostsAdapter.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Adapters/ShowPostsAdapter.kt @@ -13,6 +13,7 @@ import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.RecyclerView import com.bumptech.glide.Glide import com.example.brzodolokacije.Activities.ActivitySinglePost +import com.example.brzodolokacije.Activities.NavigationActivity import com.example.brzodolokacije.Interfaces.IBackendApi import com.example.brzodolokacije.Models.LocationType import com.example.brzodolokacije.Models.PostPreview @@ -63,6 +64,19 @@ class ShowPostsAdapter (val activity:Activity,val items : MutableList<PostPrevie val intent:Intent = Intent(activity,ActivitySinglePost::class.java) var b=Bundle() //getItem(position)!!.location.type=LocationType.ADA + //--------------------------------------------------------------- call back to add view tick + val Api= RetrofitHelper.getInstance() + val request=Api.addView("Bearer "+token,getItem(position)!!._id) + request.enqueue(object : retrofit2.Callback<PostPreview?> { + override fun onResponse(call: Call<PostPreview?>, response: Response<PostPreview?>) { + + } + + override fun onFailure(call: Call<PostPreview?>, t: Throwable) { + + } + }) + //--------------------------------------------------------------- b.putParcelable("selectedPost",getItem(position)!!) intent.putExtras(b) activity.startActivity(intent) diff --git a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt index 6d09251..9d94013 100644 --- a/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt +++ b/Client/BrzoDoLokacije/app/src/main/java/com/example/brzodolokacije/Interfaces/IBackendApi.kt @@ -26,6 +26,8 @@ interface IBackendApi { fun resetpass(@Body obj:ResetPass):Call<ResponseBody> @GET("/api/post") fun getPosts(@Header("Authorization") authHeader:String):Call<MutableList<PostPreview>> + @GET("/api/Post/posts/{id}") + fun addView(@Header("Authorization") authHeader:String,@Path("id") id:String):Call<PostPreview> @POST("/api/Location/add") fun addLocation(@Header("Authorization") authHeader:String,@Body obj: Location ):Call<Location> @Multipart diff --git a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_add_post.xml b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_add_post.xml index 21dce5e..c0b1ab7 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/layout/activity_add_post.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/layout/activity_add_post.xml @@ -19,7 +19,7 @@ <Button android:id="@+id/nextImage" android:layout_width="78dp" - android:layout_height="499dp" + android:layout_height="0dp" android:background="@drawable/rounded_transparent_button" android:gravity="right" android:padding="30dp" @@ -33,7 +33,7 @@ <Button android:id="@+id/previousImage" android:layout_width="70dp" - android:layout_height="497dp" + android:layout_height="0dp" android:background="@drawable/rounded_transparent_button" android:gravity="left" @@ -117,7 +117,7 @@ android:ems="10" android:hint="Reykjavik, Iceland" android:inputType="textEmailAddress" - app:layout_constraintBottom_toTopOf="@+id/btnActivityAddPostPost" + app:layout_constraintBottom_toTopOf="@+id/llTags" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" /> @@ -149,5 +149,26 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="@+id/isActivityAddPostSwitcher" /> + <LinearLayout + android:id="@+id/llTags" + android:layout_width="0dp" + android:layout_height="50dp" + android:layout_marginLeft="20dp" + android:layout_marginRight="20dp" + android:orientation="horizontal" + app:layout_constraintBottom_toTopOf="@+id/acTags" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent"></LinearLayout> + + <AutoCompleteTextView + android:id="@+id/acTags" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="20dp" + android:minHeight="48dp" + android:hint="Dodaj tag" + app:layout_constraintBottom_toTopOf="@+id/btnActivityAddPostPost" + app:layout_constraintStart_toStartOf="parent" /> + </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file diff --git a/Client/BrzoDoLokacije/app/src/main/res/values/strings.xml b/Client/BrzoDoLokacije/app/src/main/res/values/strings.xml index a969148..fef04ac 100644 --- a/Client/BrzoDoLokacije/app/src/main/res/values/strings.xml +++ b/Client/BrzoDoLokacije/app/src/main/res/values/strings.xml @@ -6,4 +6,45 @@ <string name="title_activity_maps">MapsActivity</string> <string name="dodaj_objavu">Dodaj objavu</string> <string name="todo">TODO</string> + + + <!-- example lista tagova, make actual list for app --> + <string-array name="Tags"> + <item>GRAD</item> + <item>ULICA</item> + <item>JEZERO</item> + <item>REKA</item> + <item>PLAZA</item> + <item>OKEAN</item> + <item>MORE</item> + <item>MOREUZ</item> + <item>MOST</item> + <item>BANJA</item> + <item>PLANINA</item> + <item>VISORAVAN</item> + <item>PIRAMIDA</item> + <item>LIVADA</item> + <item>SELO</item> + <item>OSTRVO</item> + <item>POLUOSTRVO</item> + <item>KLISURA</item> + <item>ARHIPELAG</item> + <item>ADA</item> + <item>DELTA</item> + <item>FJORD</item> + <item>GEJZIR</item> + <item>IZVOR</item> + <item>KOTLINA</item> + <item>MINERALNI_IZVOR</item> + <item>PECINA</item> + <item>SUMA</item> + <item>VODOPAD</item> + <item>VULKAN</item> + <item>MUZEJ</item> + <item>ZAMAK</item> + <item>TRG</item> + <item>SPOMENIK</item> + <item>PARK</item> + <item>ZGRADA</item> + </string-array> </resources>
\ No newline at end of file |