<style name="AppTheme" parent="Theme.AppCompat.DayNight"> OR <style name="AppTheme" parent="Theme.MaterialComponents.DayNight">
?android:attr/textColorPrimary
res/values/colors.xml
res/values-night/colors.xml
Da: SMS
Messaggio: Il tuo codice univoco è 1234.
implementation "com.google.android.gms:play-services-auth:17.0.0" implementation "com.google.android.gms:play-services-auth-api-phone:17.1.0"
smsRetriever.startSmsUserConsent( senderPhoneNumber /* or null */)
val consentIntent = extras.getParcelable<Intent>( SmsRetriever.EXTRA_CONSENT_INTENT)
startActivityForResult( consentIntent, SMS_CONSENT_REQUEST)
val message = data. getStringExtra( SmsRetriever.EXTRA_SMS_MESSAGE)
<html> <head> <script src="https://www.gstatic.com/assistant/interactivecanvas/api/interactive_canvas.min.js"></script> </head> <body> <script> const callbacks = { onUpdate(data) { // update game state based on intent response data }, }; interactiveCanvas.ready(callbacks); </script> </body> </html>
<speak> Go from <mark name="here"/> here, to <mark name="there"/> there! </speak>
// Estimate the body part positions of a single person. // Pass in a Bitmap and obtain a Person object. estimateSinglePose(bitmap: Bitmap): Person {...}
// Person class holds a list of key points and an associated confidence score. class Person { var keyPoints: List<KeyPoint> = listOf<KeyPoint>() var score: Float = 0.0f }
// KeyPoint class holds information about each bodyPart, position, and score. class KeyPoint { var bodyPart: BodyPart = BodyPart.NOSE var position: Position = Position() var score: Float() = 0.0f } // Position class contains the x and y coordinates of a key point on the bitmap. class Position { var x: Int = 0 var y: Int = 0 } // BodyPart class holds the names of seventeen body parts. enum class BodyPart { NOSE, LEFT_EYE, RIGHT_EYE, ... RIGHT_ANKLE }
view.systemUiVisibility = // Tells the system that the window wishes the content to // be laid out at the most extreme scenario. See the docs for // more information on the specifics View.SYSTEM_UI_FLAG_LAYOUT_STABLE or // Tells the system that the window wishes the content to // be laid out as if the navigation bar was hidden View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
<!-- values-v29/themes.xml --> <style name="Theme.MyApp"> <item name="android:navigationBarColor"> @android:color/transparent </item> <!-- Optional, if drawing behind the status bar too --> <item name="android:statusBarColor"> @android:color/transparent </item> </style>
allprojects { afterEvaluate { extensions.findByName('kapt')?.arguments { arg("dagger.formatGeneratedSource", "disabled") arg("dagger.gradle.incremental", "enabled") } } }
kapt { arguments { arg('dagger.formatGeneratedSource', 'disabled') arg('dagger.gradle.incremental', 'enabled') } }
@Inject @field:MinimumBalance lateinit var minimumBalance: BigDecimal
@Inject @MinimumBalance lateinit var minimumBalance: BigDecimal // @MinimumBalance is ignored!
@Module object NetworkModule { @JvmStatic @Provides fun provideOkHttpClient(): OkHttpClient { return OkHttpClient.Builder().build() } }
@Module abstract class NetworkModule { @Binds abstract fun provideService(retrofitService: RetrofitService): Service @Module companion object { @JvmStatic @Provides fun provideOkHttpClient(): OkHttpClient { return return OkHttpClient.Builder().build() } } }
@Module(includes = [OkHttpClientModule::java]) abstract class NetworkModule { @Binds abstract fun provideService(retrofitService: RetrofitService): Service } @Module object OkHttpClientModule { @JvmStatic @Provides fun provideOkHttpClient(): OkHttpClient { return OkHttpClient.Builder().build() } }
class MyVMFactory @Inject constructor( private val vmMap: Map<String, @JvmSuppressWildcards Provider<ViewModel>> ) { ... }
@Provides fun provideNetworkPrinter() = NetworkPrinter() @Provides fun provideNetworkPrinter(): NetworkPrinter = NetworkPrinter() @Provides fun provideNetworkPrinter(): NetworkPrinter { return NetworkPrinter() }
@Provides // configures a `Printer` fun providePrinter(): Printer = NetworkPrinter() @Provides // configures a `NetworkPrinter`, not a plain `Printer`! fun providePrinter() = NetworkPrinter()
Benvenuto → Informazioni su GDG → Prossimo evento → Ultimo evento
/** Handles the welcome intent. */ app.intent(‘Default Welcome Intent’, (conv) => conv.data.intentFulfilled = [0, 0, 0, 0, 0, 0]; // code}
“SUGGESTIONS”: { “MENU”: [ “About GDG”, “Next event”, “Last event”, “# of Members”, “Organizer’s Name”, “Bye” ] },
/** * Records which options the user has complete * @param {obj} conv, the conversation object. * @param num conv, the conversation object. * @return {null} none. */ function recordsIntentFulfillment(conv, intentName) { const convertIntentValue = { 'gdg': 0, 'next event': 1, 'last event': 2, 'members': 3, 'organizer': 4, }; conv.data.intentFulfilled[convertIntentValue[intentName]] = 1; return null; }
/** * Handles the Dialogflow intent named ‘next event’. */ app.intent(‘next event’, async (conv) => { recordsIntentFulfillment(conv, ‘next event’); // logic of the message conv.ask(new Suggestions(selectSuggestionChips(conv)));