chromeos / optimized-for-chromeos Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Not a bug, but rather something that tripped me up when converting to Kotlin:
override fun onCreateContextMenu(menu: ContextMenu, v: View,
menuInfo: ContextMenu.ContextMenuInfo) {
super.onCreateContextMenu(menu, v, menuInfo)
val inflater: MenuInflater = menuInflater
inflater.inflate(R.menu.context_menu, menu)
}
menuInfo can be null in this case, so to avoid runtime exception, allow it to be nullable in the method signature:
menuInfo: ContextMenu.ContextMenuInfo?
In step 6 "Ctrl- Based Shortcuts", it is stated that:
Support for Ctrl- commands and, on Android O and later, for Alt- and Shift- commands can be added using
[dispatchKeyShortcutEvent](https://developer.android.com/reference/android/view/Window.Callback#dispatchKeyShortcutEvent(android.view.KeyEvent))
.
I'm not sure what is meant by "on Android O and later". As I read it, Alt- commands won't work on versions before Android O, but when using dispatchKeyShortcutEvent
on my Chromebook (that is running Android N / 7.1.1), the method is triggered when pressing e.g. CTRL+A, but also ALT+A (however not SHIFT+A).
ColorStateList colorStateList = new ColorStateList(new int[][]{{}}, new int[]{Color.argb(127, 0, 255, 0)});
new ColorStateList(new int[][]{{}}, new int[]{Color.argb(127, 0, 255, 0)})
could be simplified to
ColorStateList.valueOf(Color.argb(127, 0, 255, 0))
since it only has a default color.
However, I think a better solution would be to utilize ColorStateList further; instead of setting backgroundTintList
to this color when hovered and then null
when not hovered, show off the ability to use android:state_hovered="true"
.
So let's add tooltips for each of the photos with the dinosaur's name using the setTootltipText() method.
setTootltipText
should be setTooltipText
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.