Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REM-937 - Fix setting up Search view #287

Merged
merged 1 commit into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading