-
Notifications
You must be signed in to change notification settings - Fork 749
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
Upgrade androidx activity and fragment to 1.5.0 #6436
Conversation
Bumps activity from 1.4.0 to 1.5.0. --- updated-dependencies: - dependency-name: androidx.activity:activity dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps `fragment` from 1.4.1 to 1.5.0. Updates `fragment-ktx` from 1.4.1 to 1.5.0 Updates `fragment-testing` from 1.4.1 to 1.5.0 --- updated-dependencies: - dependency-name: androidx.fragment:fragment-ktx dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: androidx.fragment:fragment-testing dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Bump fragment from 1.4.1 to 1.5.0
…tivity-activity-1.5.0 Bump activity from 1.4.0 to 1.5.0
…r. Rework this part a bit.
@@ -53,6 +53,7 @@ android { | |||
|
|||
dependencies { | |||
implementation libs.androidx.appCompat | |||
implementation libs.androidx.fragmentKtx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be able to useaddMenuProvider
in DebugMaterialThemeActivity
this@DebugMaterialThemeActivity, | ||
"Menu ${menuItem.title} clicked!", | ||
Toast.LENGTH_SHORT | ||
).show() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added this toast to have a visual feedback
### Please use the MenuProvider interface now | ||
onCreateOptionsMenu | ||
onOptionsItemSelected | ||
onPrepareOptionsMenu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not deprecated (yet?) on Activities, and better to avoid using a mix of solutions (this was not working well)
@@ -249,6 +253,30 @@ abstract class VectorBaseActivity<VB : ViewBinding> : AppCompatActivity(), Maver | |||
} | |||
} | |||
|
|||
private fun setupMenu() { | |||
// Always add a MenuProvider to handle the back action from the Toolbar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean even if getMenuRes()
returns -1
state.displayMode is RoomDevToolViewState.Mode.EditEventContent || | ||
state.displayMode is RoomDevToolViewState.Mode.SendEventForm | ||
} | ||
else -> true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is quite dirty and would deserve a rework...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
20e8061
to
f7a0615
Compare
(FTR I will try to update our API to manage menu). EDIT Done in the latest commits. |
SonarCloud Quality Gate failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the update 💯 I didn't notice any new issues with a smoke test across the app
I wonder if we should be using nulls
rather than -1
to highlight the absence of menus but not a blocker since that was the existing convention
Yes, probably a bit better. the only case where we use "-1" is here https://github.com/vector-im/element-android/blob/944b447d938b117bc422feaec38f59dd60af046f/vector/src/main/java/im/vector/app/features/call/transfer/CallTransferPagerAdapter.kt#L51 |
Type of change
Content
Upgrade androidx activity and fragment to 1.5.0
The main work done here is the management of the menu, to avoid using deprecated methods.
Did a quick smoke test, everything is fine so far.
Will test the PiP behavior.
Motivation and context
Being up to date with the latest dependencies!
Screenshots / GIFs
Tests
Tested devices
Checklist