This commit is contained in:
Tucan444 2021-05-08 08:17:43 +02:00
parent 87d435c354
commit 8ae7ad6c8c
38 changed files with 206 additions and 190 deletions

@ -0,0 +1,123 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="XML">
<option name="FORCE_REARRANGE_MODE" value="1" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="1.8" />
<bytecodeTargetLevel target="11" />
</component>
</project>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
</set>
</option>
</component>
</project>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 144 KiB

@ -9,6 +9,8 @@ import android.view.View
import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.AnimationUtils
import android.widget.RelativeLayout
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat.startActivity
import androidx.core.view.setPadding
import androidx.recyclerview.widget.RecyclerView
@ -32,6 +34,7 @@ class FileViewsAdapter(private val context: Context, private val fileViews: Arra
var textInfo: String? = null
var imgInfo: String? = null
var pdfUrl: String? = null
var generalUrl: String? = null
var opened = false
init {
@ -39,7 +42,9 @@ class FileViewsAdapter(private val context: Context, private val fileViews: Arra
if (!opened) {
itemView.downloadFileBtn.visibility = View.VISIBLE
itemView.downloadFileBtn.startAnimation(fadeIn)
if (generalUrl == null) {
itemView.showFileBtn.startAnimation(rotateOpen)
}
fileView?.let {
textInfo?.let {
@ -70,17 +75,18 @@ class FileViewsAdapter(private val context: Context, private val fileViews: Arra
pdfUrl?.let {
itemView.pdfContent.visibility = View.VISIBLE
ServerManagement.serverManager.loadPdfView(itemView.pdfContent, pdfUrl!!, true)
println("current page is: ${itemView.pdfContent.currentPage}")
}
}
} else {
if (generalUrl == null) {
itemView.showFileBtn.startAnimation(rotateClose)
itemView.textContent.textSize = 0F
itemView.textContent.setPadding(0)
}
val downloadBtnVanishActionThread = Thread(DownloadBtnVanishAction())
downloadBtnVanishActionThread.start()
itemView.textContent.textSize = 0F
itemView.textContent.setPadding(0)
itemView.imageContent.visibility = View.GONE
itemView.pdfContent.visibility = View.GONE
}
@ -109,6 +115,11 @@ class FileViewsAdapter(private val context: Context, private val fileViews: Arra
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(pdfUrl))
startActivity(context, browserIntent, null)
}
generalUrl?.let {
val browserIntent = Intent(Intent.ACTION_VIEW, Uri.parse(generalUrl))
startActivity(context, browserIntent, null)
}
}
}
@ -123,6 +134,20 @@ class FileViewsAdapter(private val context: Context, private val fileViews: Arra
fileView.pdfUrl?.let {
pdfUrl = it
}
fileView.generalUrl?.let {
generalUrl = it
itemView.showFileBtn.visibility = View.INVISIBLE
// setting new margins
var params = itemView.downloadFileBtn.layoutParams as ConstraintLayout.LayoutParams
params.marginEnd = 24
itemView.downloadFileBtn.layoutParams = params
params = itemView.showFileBtn.layoutParams as ConstraintLayout.LayoutParams
params.marginEnd = 0
itemView.showFileBtn.layoutParams = params
}
itemView.filenameText.text = fileView.filename.replace("_", " ")
itemView.fileDescription.text = fileView.fileDescription

@ -41,6 +41,8 @@ class infoFragment : Fragment(R.layout.fragment_info) {
updateSensorsRecyclerView()
updateFileViewsRecyclerView()
//file_views_recycler_view.isNestedScrollingEnabled = false
try {
executeLoadFunction = args.executeLoadFuntion
} catch (e: Throwable) {
@ -168,7 +170,7 @@ class infoFragment : Fragment(R.layout.fragment_info) {
}
// handling images
if ("jpg png".contains(filetype)) {
else if ("jpg png".contains(filetype)) {
val fileView = FileView(filetype, filename, fileDescription, null, "$serverId|||||$filename.$filetype")
if (!FileViewsSupplier.checkIfContains(fileView)) {
FileViewsSupplier.appendFileView(fileView)
@ -177,7 +179,7 @@ class infoFragment : Fragment(R.layout.fragment_info) {
}
// handling pdf files
if ("pdf".contains(filetype)) {
else if ("pdf".contains(filetype)) {
val fileView = FileView(filetype, filename, fileDescription, null, null, "${ServerManagement.baseUrl}files/$serverId/$filename.$filetype")
if (!FileViewsSupplier.checkIfContains(fileView)) {
FileViewsSupplier.appendFileView(fileView)
@ -185,6 +187,14 @@ class infoFragment : Fragment(R.layout.fragment_info) {
}
}
else {
val fileView = FileView(filetype, filename, fileDescription, null, 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") }
}
@ -290,6 +300,7 @@ class infoFragment : Fragment(R.layout.fragment_info) {
try {
file_views_recycler_view.post {
val layoutManager = LinearLayoutManager(context)
layoutManager.orientation = LinearLayoutManager.VERTICAL
file_views_recycler_view.layoutManager = layoutManager

@ -1,7 +1,8 @@
package com.example.wikispot.modelsForAdapters
data class FileView(val filetype: String, val filename: String, val fileDescription: String,
var textInfo: String? = null, var imgInfo: String? = null, var pdfUrl: String? = null)
var textInfo: String? = null, var imgInfo: String? = null, var pdfUrl: String? = null,
var generalUrl: String? = null)
object FileViewsSupplier {

@ -1,170 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.core.widget.NestedScrollView 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"
@ -67,7 +67,8 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/labeled_values_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false"/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@ -95,7 +96,8 @@
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/file_views_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
android:layout_height="wrap_content"
android:nestedScrollingEnabled="false" />
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
@ -139,4 +141,4 @@
</LinearLayout>
</ScrollView>
</androidx.core.widget.NestedScrollView>

@ -47,7 +47,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="More colors"
android:text="@string/more_colors"
android:background="@drawable/text_background_gradient"
android:padding="5dp"
android:textColor="?attr/textOnTextBgColor"
@ -64,6 +64,7 @@
android:layout_marginStart="16dp"
app:layout_constraintBottom_toBottomOf="@+id/moreColorsSwitchText"
app:layout_constraintStart_toEndOf="@+id/moreColorsSwitchText"
app:layout_constraintTop_toTopOf="@+id/moreColorsSwitchText" />
app:layout_constraintTop_toTopOf="@+id/moreColorsSwitchText"
tools:ignore="UseSwitchCompatOrMaterialXml" />
</androidx.constraintlayout.widget.ConstraintLayout>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 26 KiB

@ -13,4 +13,5 @@
<string name="number_of_people">Anzahl der Personen :</string>
<string name="status">Status :</string>
<string name="temperature">Temperatur :</string>
<string name="more_colors">Mehr Farben</string>
</resources>

@ -13,4 +13,5 @@
<string name="number_of_people">Número de personas:</string>
<string name="open">Abierto</string>
<string name="closed">Cerrado</string>
<string name="more_colors">Mas colores</string>
</resources>

@ -13,4 +13,5 @@
<string name="number_of_people">Nombre de personnes :</string>
<string name="open">Ouvert</string>
<string name="closed">Fermé</string>
<string name="more_colors">Plus de couleurs</string>
</resources>

@ -13,4 +13,5 @@
<string name="number_of_people">人々の数 </string>
<string name="status">状態 </string>
<string name="temperature">温度:</string>
<string name="more_colors">より多くの色</string>
</resources>

@ -13,4 +13,5 @@
<string name="number_of_people">Число людей :</string>
<string name="open">Открыть</string>
<string name="closed">Закрыто</string>
<string name="more_colors">Больше цветов</string>
</resources>

@ -14,4 +14,5 @@
<string name="open">Otvorené</string>
<string name="closed">Zatvorené</string>
<string name="temperature">Teplota :</string>
<string name="more_colors">Viac farieb</string>
</resources>

@ -13,4 +13,5 @@
<string name="number_of_people">人数 </string>
<string name="temperature">温度 </string>
<string name="status">地位 </string>
<string name="more_colors">更多颜色</string>
</resources>

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#84ABFC</color>
<color name="ic_launcher_background">#3DDC84</color>
</resources>

@ -17,4 +17,5 @@
<string name="files">Files</string>
<string name="dark_theme">Dark theme</string>
<string name="more_colors">More colors</string>
</resources>