From c41a2c81e9c2b2e0fd9a8125d38bc2a9dc68c9dd Mon Sep 17 00:00:00 2001 From: Tucan444 <66880425+Tucan444@users.noreply.github.com> Date: Wed, 14 Apr 2021 14:04:01 +0200 Subject: [PATCH] more changes --- app/WikiSpot/.idea/dictionaries/ben44.xml | 1 + .../wikispot/activities/MainActivity.kt | 191 +++++++++++------- .../wikispot/adapters/ChatMessagesAdapter.kt | 44 ++++ .../wikispot/adapters/FileViewsAdapter.kt | 110 ++++++++++ .../wikispot/adapters/PlacePreviewsAdapter.kt | 5 +- .../wikispot/fragments/chatFragment.kt | 28 ++- .../wikispot/fragments/debugFragment.kt | 18 +- .../wikispot/fragments/homeFragment.kt | 10 +- .../wikispot/fragments/infoFragment.kt | 118 ++++++++--- .../example/wikispot/fragments/mapFragment.kt | 48 ++++- .../wikispot/modelClasses/JsonManager.kt | 4 +- .../wikispot/modelClasses/JsonManagerLite.kt | 8 +- .../wikispot/modelClasses/ServerManager.kt | 20 +- .../modelsForAdapters/ExploreListModel.kt | 9 +- .../modelsForAdapters/FilesListModel.kt | 34 ++++ .../modelsForAdapters/MessagesListModel.kt | 20 ++ .../modelsForAdapters/SensorsListModel.kt | 2 +- .../example/wikispot/projectScopeVariables.kt | 10 +- .../src/main/res/anim/close_rotation_anim.xml | 11 + .../src/main/res/anim/open_rotation_anim.xml | 11 + .../drawable/ic_sharp_arrow_drop_up_24.xml | 10 + .../app/src/main/res/layout/file_view.xml | 76 +++++++ .../app/src/main/res/layout/fragment_chat.xml | 15 +- .../src/main/res/layout/fragment_debug.xml | 2 +- .../app/src/main/res/layout/fragment_home.xml | 2 +- .../app/src/main/res/layout/fragment_info.xml | 28 +++ .../app/src/main/res/layout/fragment_map.xml | 24 ++- .../app/src/main/res/layout/message.xml | 44 ++++ .../navigation/main_activity_navigation.xml | 10 +- .../app/src/main/res/values/strings.xml | 1 + 30 files changed, 755 insertions(+), 159 deletions(-) create mode 100644 app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/ChatMessagesAdapter.kt create mode 100644 app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/FileViewsAdapter.kt create mode 100644 app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/FilesListModel.kt create mode 100644 app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/MessagesListModel.kt create mode 100644 app/WikiSpot/app/src/main/res/anim/close_rotation_anim.xml create mode 100644 app/WikiSpot/app/src/main/res/anim/open_rotation_anim.xml create mode 100644 app/WikiSpot/app/src/main/res/drawable/ic_sharp_arrow_drop_up_24.xml create mode 100644 app/WikiSpot/app/src/main/res/layout/file_view.xml create mode 100644 app/WikiSpot/app/src/main/res/layout/message.xml diff --git a/app/WikiSpot/.idea/dictionaries/ben44.xml b/app/WikiSpot/.idea/dictionaries/ben44.xml index 27f442e..3783499 100644 --- a/app/WikiSpot/.idea/dictionaries/ben44.xml +++ b/app/WikiSpot/.idea/dictionaries/ben44.xml @@ -2,6 +2,7 @@ backstack + datatype filetype initing diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/activities/MainActivity.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/activities/MainActivity.kt index 19ef4a7..e80b76f 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/activities/MainActivity.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/activities/MainActivity.kt @@ -1,27 +1,29 @@ package com.example.wikispot.activities -import android.content.Intent import android.graphics.Bitmap import android.os.Bundle import android.util.DisplayMetrics import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatDelegate +import androidx.fragment.app.Fragment import androidx.navigation.findNavController import androidx.navigation.ui.setupWithNavController import androidx.recyclerview.widget.LinearLayoutManager import com.example.wikispot.* +import com.example.wikispot.adapters.FileViewsAdapter import com.example.wikispot.adapters.LabeledValuesAdapter +import com.example.wikispot.adapters.PlacePreviewsAdapter import com.example.wikispot.fragments.* import com.example.wikispot.modelClasses.JsonManager import com.example.wikispot.modelClasses.JsonManagerLite import com.example.wikispot.modelClasses.SettingsSaveManager -import com.example.wikispot.modelsForAdapters.LabeledValue -import com.example.wikispot.modelsForAdapters.LabeledValuesSupplier -import com.example.wikispot.modelsForAdapters.PlacePreview -import com.example.wikispot.modelsForAdapters.PlaceSupplier +import com.example.wikispot.modelsForAdapters.* import com.google.android.gms.maps.model.LatLng import kotlinx.android.synthetic.main.activity_main.* +import kotlinx.android.synthetic.main.fragment_explore.* +import kotlinx.android.synthetic.main.fragment_home.* import kotlinx.android.synthetic.main.fragment_info.* +import kotlinx.android.synthetic.main.fragment_info.view.* class MainActivity : AppCompatActivity() { @@ -46,11 +48,15 @@ class MainActivity : AppCompatActivity() { askToQuit() } is infoFragment -> { - currentlyShownFragment.goExploreFragment() + println(CustomBackstackVariables.infoFragmentBackDestination) + when (CustomBackstackVariables.infoFragmentBackDestination) { + "exploreFragment" -> { currentlyShownFragment.goExploreFragment() } + "mapFragment" -> {currentlyShownFragment.goMapFragment()} + } + } } } catch (e: Throwable) { println(e) } - } override fun onCreate(savedInstanceState: Bundle?) { @@ -82,47 +88,32 @@ class MainActivity : AppCompatActivity() { val dataReceiver1: (String) -> Unit = { data1: String -> val json = JsonManager(this, data1, "JSONObject") val names = json.currentJsonObject!!.names() - println("[debug] $data1") try { mainFragmentHost.childFragmentManager.fragments[0]?.let { - when (it) { - is chatFragment -> { - } - is exploreFragment -> { - } - is homeFragment -> { - LabeledValuesSupplier.wipeData() + if (it is homeFragment) { + LabeledValuesSupplier.wipeData() - for (n in 0 until names!!.length()) { - val labeledValue = LabeledValue(names[n].toString(), json.getAttributeContent(names[n].toString())) - if (!LabeledValuesSupplier.checkIfContains(labeledValue)) { - LabeledValuesSupplier.appendLabeledValue(labeledValue) - } - } - - it.labeled_values_recycler_view.post { - val layoutManager = LinearLayoutManager(it.requireContext()) - layoutManager.orientation = LinearLayoutManager.VERTICAL - it.labeled_values_recycler_view.layoutManager = layoutManager - - val adapter = LabeledValuesAdapter(it.requireContext(), LabeledValuesSupplier.labeledValues) - it.labeled_values_recycler_view.adapter = adapter + for (n in 0 until names!!.length()) { + val labeledValue = LabeledValue(names[n].toString(), json.getAttributeContent(names[n].toString())) + if (!LabeledValuesSupplier.checkIfContains(labeledValue)) { + LabeledValuesSupplier.appendLabeledValue(labeledValue) } } - is mapFragment -> { + + it.labeled_values_recycler_view.post { + val layoutManager = LinearLayoutManager(it.requireContext()) + layoutManager.orientation = LinearLayoutManager.VERTICAL + it.labeled_values_recycler_view.layoutManager = layoutManager + + val adapter = LabeledValuesAdapter(it.requireContext(), LabeledValuesSupplier.labeledValues) + it.labeled_values_recycler_view.adapter = adapter } - is settingsFragment -> { - } - is infoFragment -> { - } - else -> println("[debug] unknown fragment in sensorsConnection") } } - } catch (e: Throwable) { println(e) } + } catch (e: Throwable) { println("[debug] Exception in main activity, sensors connection : $e") } } - println(data0) if (!ServerManagement.serverManager.checkIfConnectionAlreadyExists("sensorsConnection")){ ServerManagement.serverManager.addReceiverConnection(dataReceiver1, this, "sensorsConnection", data0.toInt(), ServerManagement.sensors_keyword) @@ -133,13 +124,82 @@ class MainActivity : AppCompatActivity() { var json = JsonManager(this, data1) json = JsonManager(this, json.findJsonObjectByAttribute("ID", data0.toInt()), "JSONObject") val positionsList = json.getAttributeContent("location").split(",") - MapManagement.connectedServerTitle = json.getAttributeContentByPath("description/title") MapManagement.connectedServerPosition = LatLng(positionsList[0].toDouble(), positionsList[1].toDouble()) } if (!ServerManagement.serverManager.checkIfConnectionAlreadyExists("mapConnection")){ ServerManagement.serverManager.addReceiverConnection(dataReceiver2, this, "mapConnection", data0.toInt(), "", "GET_WHOLE_ARRAY") } + + val dataReceiver3: (String) -> Unit = { data1: String -> + val json = JsonManager(this, data1) + json.findJsonObjectByAttribute("ID", data0.toInt()) + + fun updateFileViewsRecyclerView(fragment: Fragment) { + try { + fragment.homeFragmentInnerFragment?.let { + it.file_views_recycler_view.post { + val layoutManager = LinearLayoutManager(fragment.requireContext()) + layoutManager.orientation = LinearLayoutManager.VERTICAL + it.file_views_recycler_view.layoutManager = layoutManager + + val adapter = FileViewsAdapter(fragment.requireContext(), FileViewsSupplier.fileViews) + it.file_views_recycler_view.adapter = adapter + } + } + } catch (e: Throwable) { println("[debug] e1 that i couldnt fix so try catch Exception: $e") } + } + + try { + mainFragmentHost.childFragmentManager.fragments[0]?.let { + when (it) { + + is homeFragment -> { + + json.getAttributeContent("files") + + for (n in 0 until json.currentJsonAttribute1!!.length()) { + val fileInfo = JsonManagerLite(json.getAttributeContentByPath("files/$n"), "JSONObject") + val filetype = fileInfo.getAttributeContentByPath("format").split(".")[1] + val filename = fileInfo.getAttributeContentByPath("name") + + // handling text + if ("txt json".contains(filetype)) { + val fileView = FileView(filetype, filename, "$data0|||||$filename.$filetype") + if (!FileViewsSupplier.checkIfContains(fileView)) { + FileViewsSupplier.appendFileView(fileView) + updateFileViewsRecyclerView(it) + } + } + + // handling images + if ("jpg png".contains(filetype)) { + val fileView = FileView(filetype, filename, null, "$data0|||||$filename.$filetype") + if (!FileViewsSupplier.checkIfContains(fileView)) { + FileViewsSupplier.appendFileView(fileView) + updateFileViewsRecyclerView(it) + } + } + + // handling pdf files + if ("pdf".contains(filetype)) { + val fileView = FileView(filetype, filename, null, null, "${ServerManagement.baseUrl}files/$data0/$filename.$filetype") + if (!FileViewsSupplier.checkIfContains(fileView)) { + FileViewsSupplier.appendFileView(fileView) + updateFileViewsRecyclerView(it) + } + + } + + } + } + } + } + } catch (e: Throwable) { println("[debug] Exception in main activity, files data request : $e") } + + } + + ServerManagement.serverManager.addReceiverConnection(dataReceiver3, this, "fileViewsConnection", data0.toInt(), "", "GET_WHOLE_ARRAY") } ServerManagement.serverManager.getData(dataReceiver0, this, 0, "", "connected_id", 3) @@ -150,6 +210,7 @@ class MainActivity : AppCompatActivity() { PlaceSupplier.saveToCache(this) ServerManagement.serverManager.deleteConnection("sensorsConnection") ServerManagement.serverManager.deleteConnection("mapConnection") + ServerManagement.serverManager.deleteConnection("fileViewsConnection") ServerManagement.serverManager.deleteConnection("exploreListConnection") super.onPause() } @@ -186,9 +247,7 @@ class MainActivity : AppCompatActivity() { val dataReceiver: (String) -> Unit = { data: String -> val json = JsonManager(this, data) - if (PlaceSupplier.controlJson == null) { - PlaceSupplier.controlJson = JsonManagerLite(data) - } + PlaceSupplier.controlJson = JsonManagerLite(data) for (i in 1 until json.getLengthOfJsonArray()) { @@ -218,6 +277,26 @@ class MainActivity : AppCompatActivity() { ServerManagement.serverManager.getImage(imageReceiver, id, "test.png", 3) } + + // checking if location wasn't changed + if ((containingPlace != null) and (containingPlace?.location != location)) { + containingPlace?.location = location + + try { + mainFragmentHost.childFragmentManager.fragments[0]?.let { + if (it is exploreFragment) { + it.explore_recycler_view.post { + val layoutManager = LinearLayoutManager(it.requireContext()) + layoutManager.orientation = LinearLayoutManager.VERTICAL + it.explore_recycler_view.layoutManager = layoutManager + + val adapter = PlacePreviewsAdapter(it.requireContext(), PlaceSupplier.places) + it.explore_recycler_view.adapter = adapter + } + } + } + } catch (e: Throwable) { println("[debug] e4 that i couldnt fix si try catch Exception: $e") } + } } json.clearSelectedAttribute() @@ -227,34 +306,4 @@ class MainActivity : AppCompatActivity() { ServerManagement.serverManager.addReceiverConnection(dataReceiver, this, "exploreListConnection", 0, "", "GET_WHOLE_ARRAY", 10000) } - private fun restartAppPartially() { // todo remove if not used - val intent = Intent(applicationContext, MainActivity::class.java) - - var currentNavHostFragmentName = "homeFragment" - - try { - when (mainFragmentHost.childFragmentManager.fragments[0]) { - is chatFragment -> { - currentNavHostFragmentName = "chatFragment" - } - is exploreFragment -> { - currentNavHostFragmentName = "exploreFragment" - } - is homeFragment -> { - currentNavHostFragmentName = "homeFragment" - } - is mapFragment -> { - currentNavHostFragmentName = "mapFragment" - } - is settingsFragment -> { - currentNavHostFragmentName = "settingsFragment" - } - } - } catch (e: Throwable) { println(e) } - - intent.putExtra(IntentsKeys.startFragment, currentNavHostFragmentName) - - startActivity(intent) - finish() - } } diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/ChatMessagesAdapter.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/ChatMessagesAdapter.kt new file mode 100644 index 0000000..8b8dcd2 --- /dev/null +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/ChatMessagesAdapter.kt @@ -0,0 +1,44 @@ +package com.example.wikispot.adapters + +import android.content.Context +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import com.example.wikispot.R +import com.example.wikispot.modelsForAdapters.Message +import kotlinx.android.synthetic.main.message.view.* + + +class ChatMessagesAdapter(private val context: Context, private val messages: Array) : RecyclerView.Adapter() { + + inner class MyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ + + var message: Message? = null + var pos: Int = 0 + + fun setData(message: Message?, pos: Int) { + message?.let { + itemView.message_author_text.text = message.author + itemView.message_content_text.text = message.content + } + + this.message = message + this.pos = pos + } + } + + override fun onBindViewHolder(holder: MyViewHolder, position: Int) { + val message = messages[position] + holder.setData(message, position) + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder { + val view = LayoutInflater.from(context).inflate(R.layout.message, parent, false) + return MyViewHolder(view) + } + + override fun getItemCount(): Int { + return messages.size + } +} diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/FileViewsAdapter.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/FileViewsAdapter.kt new file mode 100644 index 0000000..4fa6e91 --- /dev/null +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/FileViewsAdapter.kt @@ -0,0 +1,110 @@ +package com.example.wikispot.adapters + +import android.content.Context +import android.graphics.Bitmap +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.view.animation.Animation +import android.view.animation.AnimationUtils +import androidx.recyclerview.widget.RecyclerView +import com.example.wikispot.R +import com.example.wikispot.ServerManagement +import com.example.wikispot.modelsForAdapters.FileView +import kotlinx.android.synthetic.main.file_view.view.* + + +class FileViewsAdapter(private val context: Context, private val fileViews: Array) : RecyclerView.Adapter() { + + private val rotateOpen: Animation by lazy { AnimationUtils.loadAnimation(context, R.anim.open_rotation_anim) } + private val rotateClose: Animation by lazy { AnimationUtils.loadAnimation(context, R.anim.close_rotation_anim) } + + inner class MyViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){ + + var fileView: FileView? = null + var pos: Int = 0 + var textInfo: String? = null + var imgInfo: String? = null + var pdfUrl: String? = null + var opened = false + + init { + itemView.setOnClickListener { + if (!opened) { + itemView.showFileBtn.startAnimation(rotateOpen) + + fileView?.let { + textInfo?.let { + itemView.textContent.textSize = 18F + val dataReceiver: (String) -> Unit = { data: String -> + itemView.textContent.post { + itemView.textContent.text = data + } + } + + val textInformation = textInfo!!.split("|||||") + + ServerManagement.serverManager.getData(dataReceiver, itemView.context, textInformation[0].toInt(), textInformation[1]) + } + imgInfo?.let { + itemView.imageContent.visibility = View.VISIBLE + val imageReceiver2: (Bitmap) -> Unit = { bitmap: Bitmap -> + itemView.imageContent.post { + itemView.imageContent.setImageBitmap(bitmap) + } + } + + val imgInformation = imgInfo!!.split("|||||") + + ServerManagement.serverManager.getImage(imageReceiver2, imgInformation[0].toInt(), imgInformation[1]) + } + pdfUrl?.let { + itemView.pdfContent.visibility = View.VISIBLE + ServerManagement.serverManager.loadPdfView(itemView.pdfContent, pdfUrl!!) + } + } + } else { + itemView.showFileBtn.startAnimation(rotateClose) + itemView.textContent.textSize = 0F + itemView.imageContent.visibility = View.GONE + itemView.pdfContent.visibility = View.GONE + } + + opened = !opened + } + } + + fun setData(fileView: FileView?, pos: Int) { + fileView?.let { + fileView.textInfo?.let { + textInfo = it + } + fileView.imgInfo?.let { + imgInfo = it + } + fileView.pdfUrl?.let { + pdfUrl = it + } + + itemView.filename_text.text = fileView.filename + } + + this.fileView = fileView + this.pos = pos + } + } + + override fun onBindViewHolder(holder: MyViewHolder, position: Int) { + val fileView = fileViews[position] + holder.setData(fileView, position) + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder { + val view = LayoutInflater.from(context).inflate(R.layout.file_view, parent, false) + return MyViewHolder(view) + } + + override fun getItemCount(): Int { + return fileViews.size + } +} diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/PlacePreviewsAdapter.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/PlacePreviewsAdapter.kt index 093ee15..c50f8ca 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/PlacePreviewsAdapter.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/adapters/PlacePreviewsAdapter.kt @@ -4,8 +4,10 @@ import android.content.Context import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.fragment.app.Fragment import androidx.navigation.Navigation import androidx.recyclerview.widget.RecyclerView +import com.example.wikispot.CustomBackstackVariables import com.example.wikispot.R import com.example.wikispot.ServerManagement import com.example.wikispot.fragments.exploreFragmentDirections @@ -25,6 +27,7 @@ class PlacePreviewsAdapter(private val context: Context, private val placePrevie init { itemView.setOnClickListener { + CustomBackstackVariables.infoFragmentBackDestination = "exploreFragment" ServerManagement.selectedServerId = currentPlacePreview?.id!! val action = exploreFragmentDirections.navigateToInfoFragment(true) Navigation.findNavController(it).navigate(action) @@ -32,7 +35,7 @@ class PlacePreviewsAdapter(private val context: Context, private val placePrevie itemView.item_location_img.setOnClickListener { if (location != null) { - val action = exploreFragmentDirections.navigateToMapFragment(location!!, currentPlacePreview!!.title) + val action = exploreFragmentDirections.navigateToMapFragment(location!!) Navigation.findNavController(it).navigate(action) } } diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/chatFragment.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/chatFragment.kt index fba0890..9f735d7 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/chatFragment.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/chatFragment.kt @@ -2,11 +2,35 @@ package com.example.wikispot.fragments import android.os.Bundle import androidx.fragment.app.Fragment -import android.view.LayoutInflater import android.view.View -import android.view.ViewGroup +import androidx.recyclerview.widget.LinearLayoutManager import com.example.wikispot.R +import com.example.wikispot.adapters.ChatMessagesAdapter +import com.example.wikispot.adapters.FileViewsAdapter +import com.example.wikispot.modelsForAdapters.MessagesSupplier +import kotlinx.android.synthetic.main.fragment_chat.* +import kotlinx.android.synthetic.main.fragment_info.* class chatFragment : Fragment(R.layout.fragment_chat) { + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + updateRecyclerView() + } + + private fun updateRecyclerView() { + + chat_messages_recycler_view.post { + val layoutManager = LinearLayoutManager(context) + layoutManager.orientation = LinearLayoutManager.VERTICAL + chat_messages_recycler_view.layoutManager = layoutManager + + val adapter = context?.let { ChatMessagesAdapter(it, MessagesSupplier.messages) } + chat_messages_recycler_view.adapter = adapter + } + + } + } \ No newline at end of file diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/debugFragment.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/debugFragment.kt index 474f151..0b304f8 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/debugFragment.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/debugFragment.kt @@ -1,9 +1,6 @@ package com.example.wikispot.fragments import android.annotation.SuppressLint -import android.graphics.Bitmap -import android.graphics.BitmapFactory -import android.net.Uri import android.os.Bundle import android.view.View import androidx.fragment.app.Fragment @@ -41,19 +38,16 @@ class debugFragment : Fragment(R.layout.fragment_debug) { override fun run() { val inputStream = java.net.URL("${ServerManagement.baseUrl}files/1/sample.pdf").openStream() - val uri = Uri.parse("${ServerManagement.baseUrl}files/1/sample.pdf") Thread.sleep(500) - pdfView.post { - println("asdfsdfsdfs") - //pdfView.fromUri(uri).load() - pdfView.fromStream(inputStream).pages(0).load() - pdfView.zoomTo(pdfView.width / 490.0F) - println("[debug] zoom is ${pdfView.width / 490.0F}") - println(pdfView.width) + pdfContent.post { + pdfContent.fromStream(inputStream).load() + pdfContent.zoomTo(pdfContent.width / 490.0F) + println("[debug] zoom is ${pdfContent.width / 490.0F}") + println(pdfContent.width) Thread.sleep(1000) - println(pdfView.currentPage) + println(pdfContent.currentPage) } ServerManagement.totalNumberOfRequestsSent += 1 diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/homeFragment.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/homeFragment.kt index 7b19155..695c825 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/homeFragment.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/homeFragment.kt @@ -35,15 +35,17 @@ class homeFragment : Fragment(R.layout.fragment_home) { infoFragmentLoadedIn = true homeFragmentInnerFragment.post { - homeFragmentInnerFragment.let { fragment -> + homeFragmentInnerFragment?.let { fragment -> fragment.mainTitle.text = json.getAttributeContentByPath("description/title") fragment.mainDescription.text = json.getAttributeContentByPath("description/description_l") } } val imageReceiver: (Bitmap) -> Unit = { bitmap: Bitmap -> - homeFragmentInnerFragment.post { - homeFragmentInnerFragment.mainImage.setImageBitmap(bitmap) + homeFragmentInnerFragment?.let { + homeFragmentInnerFragment.post { + homeFragmentInnerFragment.mainImage.setImageBitmap(bitmap) + } } } @@ -65,4 +67,4 @@ class homeFragment : Fragment(R.layout.fragment_home) { private fun loadCache() {} private fun saveCache() {} -} \ No newline at end of file +} diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/infoFragment.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/infoFragment.kt index 65f87d9..574c6ae 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/infoFragment.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/infoFragment.kt @@ -9,15 +9,20 @@ import androidx.navigation.fragment.navArgs import androidx.recyclerview.widget.LinearLayoutManager import com.example.wikispot.R import com.example.wikispot.ServerManagement +import com.example.wikispot.adapters.FileViewsAdapter import com.example.wikispot.adapters.LabeledValuesAdapter import com.example.wikispot.modelClasses.JsonManager +import com.example.wikispot.modelClasses.JsonManagerLite +import com.example.wikispot.modelsForAdapters.FileView +import com.example.wikispot.modelsForAdapters.FileViewsSupplier import com.example.wikispot.modelsForAdapters.LabeledValue import com.example.wikispot.modelsForAdapters.LabeledValuesSupplier import com.google.android.gms.maps.model.LatLng import kotlinx.android.synthetic.main.fragment_info.* +import java.io.File -class infoFragment() : Fragment(R.layout.fragment_info) { +class infoFragment : Fragment(R.layout.fragment_info) { private val args: infoFragmentArgs by navArgs() var location: LatLng? = null @@ -26,7 +31,10 @@ class infoFragment() : Fragment(R.layout.fragment_info) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - updateRecyclerView() + LabeledValuesSupplier.wipeData() + FileViewsSupplier.wipeData() + updateSensorsRecyclerView() + updateFileViewsRecyclerView() try { loadAutomatically = args.loadAutomatically @@ -39,7 +47,7 @@ class infoFragment() : Fragment(R.layout.fragment_info) { locationBtn.setOnClickListener { if (loadAutomatically) { if (location != null) { - val action = infoFragmentDirections.infoFragmentToMapFragment(location!!, mainTitle.text.toString()) + val action = infoFragmentDirections.infoFragmentToMapFragment(location!!) Navigation.findNavController(it).navigate(action) } } else { @@ -52,19 +60,20 @@ class infoFragment() : Fragment(R.layout.fragment_info) { val serverId = ServerManagement.selectedServerId val dataReceiver: (String) -> Unit = { data: String -> - try { - context?.let { + context?.let { + try { val json = JsonManager(requireContext(), data) json.findJsonObjectByAttribute("ID", serverId) mainTitle.post { mainTitle.text = json.getAttributeContentByPath("description/title") } + mainDescription.post { this.mainDescription.text = json.getAttributeContentByPath("description/description_s") } - val imageReceiver: (Bitmap) -> Unit = { bitmap: Bitmap -> + val imageReceiver1: (Bitmap) -> Unit = { bitmap: Bitmap -> mainImage.post { mainImage?.let { mainImage.setImageBitmap(bitmap) @@ -75,30 +84,69 @@ class infoFragment() : Fragment(R.layout.fragment_info) { val coordinates = json.getAttributeContent("location").split(",") location = LatLng(coordinates[0].toDouble(), coordinates[1].toDouble()) - ServerManagement.serverManager.getImage(imageReceiver, json.getAttributeContent("ID").toInt(), "test0.jpg", 2) - } - } catch (e: Throwable) { println(e) } + ServerManagement.serverManager.getImage(imageReceiver1, json.getAttributeContent("ID").toInt(), "test0.jpg", 2) + + // getting files + + json.getAttributeContent("files") + + for (n in 0 until json.currentJsonAttribute1!!.length()) { + val fileInfo = JsonManagerLite(json.getAttributeContentByPath("files/$n"), "JSONObject") + val filetype = fileInfo.getAttributeContentByPath("format").split(".")[1] + val filename = fileInfo.getAttributeContentByPath("name") + + // handling text + if ("txt json".contains(filetype)) { + val fileView = FileView(filetype, filename, "$serverId|||||$filename.$filetype") + if (!FileViewsSupplier.checkIfContains(fileView)) { + FileViewsSupplier.appendFileView(fileView) + updateFileViewsRecyclerView() + } + } + + // handling images + if ("jpg png".contains(filetype)) { + val fileView = FileView(filetype, filename, null, "$serverId|||||$filename.$filetype") + if (!FileViewsSupplier.checkIfContains(fileView)) { + FileViewsSupplier.appendFileView(fileView) + updateFileViewsRecyclerView() + } + } + + // handling pdf files + if ("pdf".contains(filetype)) { + val fileView = FileView(filetype, filename, null, null, "${ServerManagement.baseUrl}files/$serverId/$filename.$filetype") + if (!FileViewsSupplier.checkIfContains(fileView)) { + FileViewsSupplier.appendFileView(fileView) + updateFileViewsRecyclerView() + } + + } + } + } catch (e: Throwable) { println("[debug] exception in infoFragment load data request Exception: $e") } + } } val sensorsDataReceiver: (String) -> Unit = {data: String -> try { context?.let { - println("[debug][info fragment] $data") val json = JsonManager(requireContext(), data, "JSONObject") val names = json.currentJsonObject!!.names() LabeledValuesSupplier.wipeData() - for (n in 0 until names!!.length()) { - val labeledValue = LabeledValue(names[n].toString(), json.getAttributeContent(names[n].toString())) - if (!LabeledValuesSupplier.checkIfContains(labeledValue)) { - LabeledValuesSupplier.appendLabeledValue(labeledValue) + if (names != null) { + for (n in 0 until names.length()) { + val labeledValue = LabeledValue(names[n].toString(), json.getAttributeContent(names[n].toString())) + if (!LabeledValuesSupplier.checkIfContains(labeledValue)) { + LabeledValuesSupplier.appendLabeledValue(labeledValue) + } } } - updateRecyclerView() + updateSensorsRecyclerView() } - } catch (e: Throwable) { println(e) } + } catch (e: Throwable) { println("[debug] Exception in info fragment, load, sensorsDataReceiver : $e") } } context?.let { @@ -106,7 +154,6 @@ class infoFragment() : Fragment(R.layout.fragment_info) { ServerManagement.serverManager.addReceiverConnection(sensorsDataReceiver, requireContext(), "infoFragmentSensorsConnection", serverId, ServerManagement.sensors_keyword) } - } override fun onPause() { @@ -114,16 +161,33 @@ class infoFragment() : Fragment(R.layout.fragment_info) { super.onPause() } - private fun updateRecyclerView() { + private fun updateSensorsRecyclerView() { - labeled_values_recycler_view.post { - val layoutManager = LinearLayoutManager(context) - layoutManager.orientation = LinearLayoutManager.VERTICAL - labeled_values_recycler_view.layoutManager = layoutManager + try { + labeled_values_recycler_view.post { + val layoutManager = LinearLayoutManager(context) + layoutManager.orientation = LinearLayoutManager.VERTICAL + labeled_values_recycler_view.layoutManager = layoutManager - val adapter = context?.let { LabeledValuesAdapter(it, LabeledValuesSupplier.labeledValues) } - labeled_values_recycler_view.adapter = adapter - } + val adapter = context?.let { LabeledValuesAdapter(it, LabeledValuesSupplier.labeledValues) } + labeled_values_recycler_view.adapter = adapter + } + } catch (e: Throwable) { println("[debug] e3 that i couldnt fix so try catch Exception: $e") } + + } + + private fun updateFileViewsRecyclerView() { + + try { + file_views_recycler_view.post { + val layoutManager = LinearLayoutManager(context) + layoutManager.orientation = LinearLayoutManager.VERTICAL + file_views_recycler_view.layoutManager = layoutManager + + val adapter = context?.let { FileViewsAdapter(it, FileViewsSupplier.fileViews) } + file_views_recycler_view.adapter = adapter + } + } catch (e: Throwable) { println("[debug] e2 that i couldnt fix so try catch Exception: $e") } } @@ -131,4 +195,8 @@ class infoFragment() : Fragment(R.layout.fragment_info) { Navigation.findNavController(mainTitle).navigate(R.id.navigateBackToExploreFragment) } + fun goMapFragment() { + Navigation.findNavController(mainTitle).navigate(R.id.infoFragment_to_mapFragment) + } + } diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/mapFragment.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/mapFragment.kt index 7e842d4..9e6c5b4 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/mapFragment.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/fragments/mapFragment.kt @@ -5,21 +5,29 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment +import androidx.navigation.Navigation import androidx.navigation.fragment.navArgs +import com.example.wikispot.CustomBackstackVariables import com.example.wikispot.MapManagement import com.example.wikispot.R +import com.example.wikispot.ServerManagement +import com.example.wikispot.modelsForAdapters.PlaceSupplier import com.google.android.gms.maps.CameraUpdateFactory +import com.google.android.gms.maps.GoogleMap import com.google.android.gms.maps.OnMapReadyCallback import com.google.android.gms.maps.SupportMapFragment import com.google.android.gms.maps.model.LatLng +import com.google.android.gms.maps.model.Marker import com.google.android.gms.maps.model.MarkerOptions +import kotlinx.android.synthetic.main.fragment_map.* +import java.time.Clock -class mapFragment : Fragment() { +class mapFragment : Fragment(), GoogleMap.OnMarkerClickListener { val args: mapFragmentArgs by navArgs() private var loadFromMapManager = true var location: LatLng? = null - var markerTitle: String? = null + var lastClickedMarkerTitle = "" private val callback = OnMapReadyCallback { googleMap -> /** @@ -38,17 +46,22 @@ class mapFragment : Fragment() { try { location = args.location - markerTitle = args.markerTitle loadFromMapManager = false } catch (e: Throwable) { println("[debug] Exception in Map Fragment while getting args: $e") } if (loadFromMapManager) { - googleMap.addMarker(MarkerOptions().position(MapManagement.connectedServerPosition!!).title(MapManagement.connectedServerTitle)) - googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(MapManagement.connectedServerPosition, 16.0F)) + googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(MapManagement.connectedServerPosition, 15.0F)) } else { - googleMap.addMarker(MarkerOptions().position(location!!).title(markerTitle)) - googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(location, 16.0F)) + googleMap.animateCamera(CameraUpdateFactory.newLatLngZoom(location, 15.0F)) } + + // loading other markers + for (n in PlaceSupplier.places.indices) { + val coordinates = PlaceSupplier.places[n]?.location!!.split(",") + googleMap.addMarker(MarkerOptions().position(LatLng(coordinates[0].toDouble(), coordinates[1].toDouble())).title(PlaceSupplier.places[n]?.title)) + } + + googleMap.setOnMarkerClickListener(this) } override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { @@ -60,4 +73,23 @@ class mapFragment : Fragment() { val mapFragment = childFragmentManager.findFragmentById(R.id.map) as SupportMapFragment? mapFragment?.getMapAsync(callback) } -} \ No newline at end of file + + override fun onMarkerClick(marker: Marker?): Boolean { + marker?.let { + if (marker.title == lastClickedMarkerTitle) { + for (n in PlaceSupplier.places.indices) { + if (marker.title == PlaceSupplier.places[n]!!.title) { + CustomBackstackVariables.infoFragmentBackDestination = "mapFragment" + ServerManagement.selectedServerId = PlaceSupplier.places[n]!!.id!! + val action = mapFragmentDirections.mapFragmentToInfoFragment() + Navigation.findNavController(navControllerView).navigate(action) + } + } + } + lastClickedMarkerTitle = marker.title + println("[debug] marker title ${marker.title}") + println(System.currentTimeMillis()) + } + return false + } +} diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/JsonManager.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/JsonManager.kt index bed1385..c7f78ae 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/JsonManager.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/JsonManager.kt @@ -11,8 +11,8 @@ data class JsonManager(private val context: Context, val data: String, val input var jsonArray: JSONArray? = null var currentJsonObject: JSONObject? = null - private var currentJsonAttribute0: JSONObject? = null - private var currentJsonAttribute1: JSONArray? = null + var currentJsonAttribute0: JSONObject? = null + var currentJsonAttribute1: JSONArray? = null init { if (inputType == "JSONArray") { diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/JsonManagerLite.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/JsonManagerLite.kt index a75ab67..9df0f44 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/JsonManagerLite.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/JsonManagerLite.kt @@ -1,9 +1,5 @@ package com.example.wikispot.modelClasses -import android.content.Context -import com.example.wikispot.getStringFromSharedPreferences -import com.example.wikispot.saveString -import com.example.wikispot.showToast import org.json.JSONArray import org.json.JSONObject @@ -94,7 +90,7 @@ data class JsonManagerLite(val data: String, val inputType: String = "JSONArray" val currentJsonAttributesBackup = listOf(currentJsonAttribute0, currentJsonAttribute1) // backing up selected jsonAttributes // getting the attribute - clearSelectedAttribute() + clearSelectedAttributes() var result: Any? = null for (step in steps) { try { @@ -115,7 +111,7 @@ data class JsonManagerLite(val data: String, val inputType: String = "JSONArray" return result.toString() } - fun clearSelectedAttribute() { + fun clearSelectedAttributes() { currentJsonAttribute0 = null currentJsonAttribute1 = null } diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/ServerManager.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/ServerManager.kt index 6093ded..362bfcb 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/ServerManager.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelClasses/ServerManager.kt @@ -5,6 +5,8 @@ import android.graphics.Bitmap import android.graphics.BitmapFactory import android.widget.TextView import com.example.wikispot.ServerManagement +import com.github.barteksc.pdfviewer.PDFView +import kotlinx.android.synthetic.main.file_view.view.* import okhttp3.* import org.json.JSONArray import org.json.JSONObject @@ -101,7 +103,7 @@ class ServerManager { } } - fun getImage(imageReceiver: (Bitmap) -> Unit, serverId: Int, path: String, numberOfAttempts: Int) { + fun getImage(imageReceiver: (Bitmap) -> Unit, serverId: Int, path: String, numberOfAttempts: Int = 2) { val imageRequestThread = Thread(ImageRequest(imageReceiver, serverId, path, numberOfAttempts)) imageRequestThread.start() } @@ -125,6 +127,22 @@ class ServerManager { } } + fun loadPdfView(view: PDFView, url: String) { + val pdfLoadingRequestThread = Thread(PdfLoadingRequest(view, url)) + pdfLoadingRequestThread.start() + } + + inner class PdfLoadingRequest(val view: PDFView, val url: String): Runnable { + override fun run() { + val inputStream = java.net.URL(url).openStream() + view.post { + view.fromStream(inputStream).load() + view.zoomTo(view.width / 490.0F) + } + } + + } + // connections fun clearConnections() { diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/ExploreListModel.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/ExploreListModel.kt index d581a34..a571ce9 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/ExploreListModel.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/ExploreListModel.kt @@ -11,7 +11,7 @@ import com.example.wikispot.saveString import com.google.android.gms.maps.model.LatLng import org.json.JSONArray -data class PlacePreview(var title: String, var description: String, val location: String? = null, var img: Bitmap? = null, val id: Int?=null) { +data class PlacePreview(var title: String, var description: String, var location: String? = null, var img: Bitmap? = null, val id: Int?=null) { init { val words = description.split(" ") @@ -38,7 +38,11 @@ object PlaceSupplier { var controlJson: JsonManagerLite? = null - var places = arrayOf() + var places = arrayOf( + PlacePreview("River", "", "39.94071648123733,-85.9346308193051"), + PlacePreview("Velky Manin", "", "49.12590793522579,18.49571849264312"), + PlacePreview("Klapy", "", "49.161527643132175,18.41231657316252") + ) fun appendPlace(place: PlacePreview) { val array = places.copyOf(places.size + 1) @@ -123,7 +127,6 @@ object PlaceSupplier { } } } - return false } diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/FilesListModel.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/FilesListModel.kt new file mode 100644 index 0000000..307b074 --- /dev/null +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/FilesListModel.kt @@ -0,0 +1,34 @@ +package com.example.wikispot.modelsForAdapters + +import android.graphics.Bitmap + +data class FileView(val filetype: String, val filename: String, var textInfo: String? = null, var imgInfo: String? = null, var pdfUrl: String? = null) + + +object FileViewsSupplier { + + var fileViews = arrayOf() + + fun appendFileView(fileView: FileView) { + val array = fileViews.copyOf(fileViews.size + 1) + array[fileViews.size] = fileView + fileViews = array + } + + fun checkIfContains(fileView: FileView): Boolean{ + for (n in fileViews.indices) { + if (fileViews[n]!!.filename == fileView.filename) { + if (fileViews[n]!!.filetype == fileView.filetype) { + return true + } + } + } + return false + } + + fun wipeData() { + fileViews = arrayOf() + } + +} + diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/MessagesListModel.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/MessagesListModel.kt new file mode 100644 index 0000000..5a0b4e5 --- /dev/null +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/MessagesListModel.kt @@ -0,0 +1,20 @@ +package com.example.wikispot.modelsForAdapters + +data class Message(val author: String, val content: String) + + +object MessagesSupplier { + + var messages = arrayOf() + + fun appendMessage(message: Message) { + val array = messages.copyOf(messages.size + 1) + array[messages.size] = message + messages = array + } + + fun wipeData() { + messages = arrayOf() + } + +} diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/SensorsListModel.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/SensorsListModel.kt index 1949851..ba91a35 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/SensorsListModel.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/modelsForAdapters/SensorsListModel.kt @@ -23,7 +23,7 @@ object LabeledValuesSupplier { } fun wipeData() { - labeledValues = arrayOf() + labeledValues = arrayOf() } } diff --git a/app/WikiSpot/app/src/main/java/com/example/wikispot/projectScopeVariables.kt b/app/WikiSpot/app/src/main/java/com/example/wikispot/projectScopeVariables.kt index 9dc0c24..4666e55 100644 --- a/app/WikiSpot/app/src/main/java/com/example/wikispot/projectScopeVariables.kt +++ b/app/WikiSpot/app/src/main/java/com/example/wikispot/projectScopeVariables.kt @@ -24,7 +24,7 @@ object ServerManagement { const val viewConnectionOnCheckWait: Long = 5000 const val dataRequestOnAttemptWait: Long = 2000 const val imageRequestOnAttemptWait: Long = 2000 - const val baseUrl = "http://192.168.1.230:8000/" + const val baseUrl = "http://192.168.1.156:8000/" var selectedServerId = 0 const val sensors_keyword = "_[{(S,e,n,s,o,r,s)}]_" @@ -33,8 +33,7 @@ object ServerManagement { } object MapManagement { - var connectedServerPosition: LatLng? = null - var connectedServerTitle: String? = null + var connectedServerPosition: LatLng? = LatLng(0.toDouble(), 0.toDouble()) } @@ -44,6 +43,11 @@ object ScreenParameters { } +object CustomBackstackVariables { + var infoFragmentBackDestination = "exploreFragment" +} + + object ThemeOptions { var darkTheme = false diff --git a/app/WikiSpot/app/src/main/res/anim/close_rotation_anim.xml b/app/WikiSpot/app/src/main/res/anim/close_rotation_anim.xml new file mode 100644 index 0000000..a3cdc2f --- /dev/null +++ b/app/WikiSpot/app/src/main/res/anim/close_rotation_anim.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/WikiSpot/app/src/main/res/anim/open_rotation_anim.xml b/app/WikiSpot/app/src/main/res/anim/open_rotation_anim.xml new file mode 100644 index 0000000..8daa2fe --- /dev/null +++ b/app/WikiSpot/app/src/main/res/anim/open_rotation_anim.xml @@ -0,0 +1,11 @@ + + + + + + \ No newline at end of file diff --git a/app/WikiSpot/app/src/main/res/drawable/ic_sharp_arrow_drop_up_24.xml b/app/WikiSpot/app/src/main/res/drawable/ic_sharp_arrow_drop_up_24.xml new file mode 100644 index 0000000..dcd2b09 --- /dev/null +++ b/app/WikiSpot/app/src/main/res/drawable/ic_sharp_arrow_drop_up_24.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/WikiSpot/app/src/main/res/layout/file_view.xml b/app/WikiSpot/app/src/main/res/layout/file_view.xml new file mode 100644 index 0000000..08570c1 --- /dev/null +++ b/app/WikiSpot/app/src/main/res/layout/file_view.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/WikiSpot/app/src/main/res/layout/fragment_chat.xml b/app/WikiSpot/app/src/main/res/layout/fragment_chat.xml index f8471bb..ef3710e 100644 --- a/app/WikiSpot/app/src/main/res/layout/fragment_chat.xml +++ b/app/WikiSpot/app/src/main/res/layout/fragment_chat.xml @@ -8,18 +8,15 @@ tools:background="@drawable/chat_fragment_gradient_background" tools:context=".fragments.chatFragment"> - + app:layout_constraintTop_toTopOf="parent" /> \ No newline at end of file diff --git a/app/WikiSpot/app/src/main/res/layout/fragment_debug.xml b/app/WikiSpot/app/src/main/res/layout/fragment_debug.xml index 39982a6..ea198c2 100644 --- a/app/WikiSpot/app/src/main/res/layout/fragment_debug.xml +++ b/app/WikiSpot/app/src/main/res/layout/fragment_debug.xml @@ -55,7 +55,7 @@ + + + + + + + + diff --git a/app/WikiSpot/app/src/main/res/layout/fragment_map.xml b/app/WikiSpot/app/src/main/res/layout/fragment_map.xml index b913885..089f897 100644 --- a/app/WikiSpot/app/src/main/res/layout/fragment_map.xml +++ b/app/WikiSpot/app/src/main/res/layout/fragment_map.xml @@ -1,8 +1,20 @@ - \ No newline at end of file + xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="horizontal"> + + + + \ No newline at end of file diff --git a/app/WikiSpot/app/src/main/res/layout/message.xml b/app/WikiSpot/app/src/main/res/layout/message.xml new file mode 100644 index 0000000..790c155 --- /dev/null +++ b/app/WikiSpot/app/src/main/res/layout/message.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/WikiSpot/app/src/main/res/navigation/main_activity_navigation.xml b/app/WikiSpot/app/src/main/res/navigation/main_activity_navigation.xml index d93f6c8..1a3a002 100644 --- a/app/WikiSpot/app/src/main/res/navigation/main_activity_navigation.xml +++ b/app/WikiSpot/app/src/main/res/navigation/main_activity_navigation.xml @@ -45,9 +45,13 @@ - + + + Automatically download attachments for incoming emails Only download attachments when manually requested + Files \ No newline at end of file