Skip to content

Commit

Permalink
REM-937 - Fix setting up Search view
Browse files Browse the repository at this point in the history
  • Loading branch information
naz013 committed Jan 18, 2025
1 parent c8cc399 commit 0e63b1a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.elementary.tasks.home
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.FrameLayout
import androidx.activity.enableEdgeToEdge
Expand Down Expand Up @@ -191,6 +192,10 @@ class BottomNavActivity :
hint: String,
adapter: RecyclerView.Adapter<*>
) {
if (findViewById<View>(anchorId) == null) {
Logger.i(TAG, "Can't find anchor with id: $anchorId, skipping search view initialization")
return
}
val searchView = SearchView(this)
searchView.hint = hint
searchView.layoutParams = CoordinatorLayout.LayoutParams(binding.container.layoutParams).apply {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class HomeFragment :
}
}
searchableFragmentCallback?.setSearchViewParams(
binding.searchBar.id,
R.id.search_bar,
getString(R.string.search_everywhere),
searchAdapter,
this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.elementary.tasks.reminder.build.valuedialog.controller
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.elementary.tasks.R
import com.github.naz013.domain.Place
import com.github.naz013.common.datetime.DateTimeManager
import com.elementary.tasks.databinding.BuilderItemMapBinding
Expand Down Expand Up @@ -52,7 +53,7 @@ class MapController(
}

parentFragment.childFragmentManager.beginTransaction()
.replace(binding.mapFrameView.id, simpleMapFragment)
.replace(R.id.map_frame_view, simpleMapFragment)
.addToBackStack(null)
.commit()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class FullscreenMapFragment : BaseNonToolbarFragment<FragmentReminderFullscreenM
}

childFragmentManager.beginTransaction()
.replace(binding.mapContainer.id, googleMap)
.replace(R.id.map_container, googleMap)
.commit()

this.simpleMapFragment = googleMap
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/fragment_reminder_fullscreen_map.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
android:layout_height="match_parent">

<LinearLayout
android:id="@+id/mapContainer"
android:id="@+id/map_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:transitionName="map" />

<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/mapButton"
android:id="@+id/map_button"
style="@style/UiComponentExtendedFab"
android:layout_width="wrap_content"
android:layout_height="60dp"
Expand Down

0 comments on commit 0e63b1a

Please sign in to comment.