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

Fix home dining prefs #597

Merged
merged 16 commits into from
Jan 26, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix issue where the app crashes on first run after emulator restarts.
  • Loading branch information
meiron03 committed Jan 6, 2024
commit d370cd17ecbd5b268603ea1d27ba7aebaae88d2c
Original file line number Diff line number Diff line change
@@ -24,10 +24,6 @@ class MoreFragment : Fragment() {
super.onCreate(savedInstanceState)
mActivity = activity as MainActivity
mActivity.closeKeyboard()
parentFragmentManager.beginTransaction()
.replace(R.id.more_frame, PreferenceFragment())
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit()
}

override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
@@ -37,6 +33,14 @@ class MoreFragment : Fragment() {
return view
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
childFragmentManager.beginTransaction()
.replace(R.id.more_frame, PreferenceFragment())
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit()
}

private fun initAppBar(view: View) {
view.date_view.text = Utils.getCurrentSystemTime()
// Appbar behavior init
Original file line number Diff line number Diff line change
@@ -113,7 +113,7 @@ class PreferenceFragment : PreferenceFragmentCompat() {
val aboutFeaturePref: Preference? = findPreference("pref_about_feature")
aboutFeaturePref?.setOnPreferenceClickListener {
mActivity.supportFragmentManager.beginTransaction()
.replace(R.id.more_frame, AboutFragment())
.replace(R.id.content_frame, AboutFragment())
.addToBackStack(null)
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN)
.commit()
@@ -254,4 +254,4 @@ class PreferenceFragment : PreferenceFragmentCompat() {
private const val PathAtPenn = "https://path.at.upenn.edu/"
private const val PennPortal = "https://portal.apps.upenn.edu/penn_portal"
}
}
}
3 changes: 2 additions & 1 deletion PennMobile/src/main/res/layout/fragment_about.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,8 @@
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/coordinator"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:background="@color/white">

<LinearLayout
android:layout_width="match_parent"
Loading