Skip to content

Commit

Permalink
fix: Adapted searchview functionality in FileDisplayActivity and Fold…
Browse files Browse the repository at this point in the history
…erPickerActivity
  • Loading branch information
Aitorbp committed Jul 10, 2024
1 parent fd1a314 commit f5f140c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,12 @@ import android.util.TypedValue
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.widget.EditText
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.ScrollView
import android.widget.TextView
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.SearchView
import androidx.core.content.ContextCompat
import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
Expand Down Expand Up @@ -555,19 +552,6 @@ class FileDisplayActivity : FileActivity(),

inflater.inflate(R.menu.main_menu, menu)

(menu.findItem(R.id.action_search).actionView as SearchView).run {
maxWidth = Int.MAX_VALUE
queryHint = resources.getString(R.string.actionbar_search)

val textHint = findViewById<EditText>(androidx.appcompat.R.id.search_src_text)
val closeButton = findViewById<ImageView>(androidx.appcompat.R.id.search_close_btn)
val searchButton = findViewById<ImageView>(androidx.appcompat.R.id.search_button)

searchButton.setBackgroundColor(getColor(R.color.actionbar_start_color))
textHint.setHintTextColor(getColor(R.color.search_view_hint_text))
closeButton.setColorFilter(getColor(R.color.white))
background = getDrawable(R.drawable.rounded_search_view)
}
selectAllMenuItem = menu.findItem(R.id.action_select_all)
if (secondFragment == null) {
selectAllMenuItem?.isVisible = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@ import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.widget.EditText
import android.widget.ImageView
import androidx.annotation.StringRes
import androidx.appcompat.widget.SearchView
import androidx.core.view.isVisible
import com.owncloud.android.R
import com.owncloud.android.databinding.FilesFolderPickerBinding
Expand Down Expand Up @@ -161,20 +158,6 @@ open class FolderPickerActivity : FileActivity(),
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
menuInflater.inflate(R.menu.main_menu, menu)
menu?.let {
val menuItem = it.findItem(R.id.action_search)
(menuItem.actionView as SearchView).apply {
maxWidth = Int.MAX_VALUE
queryHint = resources.getString(R.string.actionbar_search)

val textHint = findViewById<EditText>(androidx.appcompat.R.id.search_src_text)
val closeButton = findViewById<ImageView>(androidx.appcompat.R.id.search_close_btn)
val searchButton = findViewById<ImageView>(androidx.appcompat.R.id.search_button)

searchButton.setBackgroundColor(getColor(R.color.actionbar_start_color))
textHint.setHintTextColor(getColor(R.color.search_view_hint_text))
closeButton.setColorFilter(getColor(R.color.white))
background = getDrawable(R.drawable.rounded_search_view)
}
it.removeItem(it.findItem(R.id.action_share_current_folder)?.itemId ?: 0)
}
return true
Expand Down

0 comments on commit f5f140c

Please sign in to comment.