Layout fix

History fix
This commit is contained in:
tom5079
2020-09-15 23:19:26 +09:00
parent 4207ea494d
commit c7e75aacf0
5 changed files with 18 additions and 13 deletions

View File

@@ -21,7 +21,7 @@ android {
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 30 targetSdkVersion 30
versionCode 59 versionCode 59
versionName "5.0.3-hotfix1" versionName "5.0.3-hotfix2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true vectorDrawables.useSupportLibrary = true
} }

View File

@@ -12,7 +12,7 @@
"filters": [], "filters": [],
"properties": [], "properties": [],
"versionCode": 59, "versionCode": 59,
"versionName": "5.0.3-hotfix1", "versionName": "5.0.3-hotfix2",
"enabled": true, "enabled": true,
"outputFile": "app-release.apk" "outputFile": "app-release.apk"
} }

View File

@@ -82,9 +82,12 @@ class FloatingSearchViewDayNight @JvmOverloads constructor(context: Context, att
override fun onSuggestionClicked(searchSuggestion: SearchSuggestion?) { override fun onSuggestionClicked(searchSuggestion: SearchSuggestion?) {
when (searchSuggestion) { when (searchSuggestion) {
is TagSuggestion -> { is TagSuggestion -> {
val tag = "${searchSuggestion.n}:${searchSuggestion.s.replace(Regex("\\s"), "_")}"
with(searchInputView.text) { with(searchInputView.text) {
delete(if (lastIndexOf(' ') == -1) 0 else lastIndexOf(' ')+1, length) delete(if (lastIndexOf(' ') == -1) 0 else lastIndexOf(' ') + 1, length)
append("${searchSuggestion.n}:${searchSuggestion.s.replace(Regex("\\s"), "_")} ")
if (!this.contains(tag))
append("$tag ")
} }
} }
is Suggestion -> { is Suggestion -> {

View File

@@ -59,6 +59,8 @@ class SavedSet <T: Any> (private val file: File, private val any: T, private val
override fun add(element: T): Boolean { override fun add(element: T): Boolean {
load() load()
set.remove(element)
return set.add(element).also { return set.add(element).also {
save() save()
} }
@@ -67,6 +69,8 @@ class SavedSet <T: Any> (private val file: File, private val any: T, private val
override fun addAll(elements: Collection<T>): Boolean { override fun addAll(elements: Collection<T>): Boolean {
load() load()
set.removeAll(elements)
return set.addAll(elements).also { return set.addAll(elements).also {
save() save()
} }

View File

@@ -162,16 +162,14 @@
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
app:layout_constraintTop_toBottomOf="@id/galleryblock_type" app:layout_constraintTop_toBottomOf="@id/galleryblock_type"
app:layout_constraintBottom_toTopOf="@id/galleryblock_padding"
app:layout_constraintLeft_toRightOf="@id/galleryblock_thumbnail" /> app:layout_constraintLeft_toRightOf="@id/galleryblock_thumbnail" />
<View <androidx.constraintlayout.widget.Barrier
android:id="@+id/galleryblock_padding" android:id="@+id/padding"
android:layout_width="0dp" android:layout_width="wrap_content"
android:layout_height="0dp" android:layout_height="wrap_content"
app:layout_constraintRight_toRightOf="parent" app:barrierDirection="bottom"
app:layout_constraintTop_toBottomOf="@id/galleryblock_language" app:constraint_referenced_ids="galleryblock_language"/>
app:layout_constraintBottom_toTopOf="@id/galleryblock_tag_group"/>
<com.google.android.material.chip.ChipGroup <com.google.android.material.chip.ChipGroup
android:id="@+id/galleryblock_tag_group" android:id="@+id/galleryblock_tag_group"
@@ -181,7 +179,7 @@
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
app:chipSpacing="4dp" app:chipSpacing="4dp"
app:layout_constraintTop_toBottomOf="@id/galleryblock_padding" app:layout_constraintTop_toBottomOf="@id/padding"
app:layout_constraintLeft_toRightOf="@id/galleryblock_thumbnail" app:layout_constraintLeft_toRightOf="@id/galleryblock_thumbnail"
app:layout_constraintRight_toRightOf="parent"/> app:layout_constraintRight_toRightOf="parent"/>