/ Ako prispôsobiť firebase auth ui - android, firebase, firebase-authentication, android-spinner, firebaseui

Ako prispôsobiť firebase auth ui - android, firebase, firebase-authentication, android-spinner, firebaseui

Používam Firebase Auth Ui od číslaoverenie. Mám niekoľko požiadaviek, kde potrebujem zmeniť text a farbu pozadia krajiny dropper položky. Používam to nižšie štýl, ale to nezmení farbu rozbaľovacieho pozadia alebo farbu textu položky.

style name="FirebaseUI.CountrySpinner" parent="Widget.AppCompat.Spinner.Underlined">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textAppearance">?android:attr/textAppearanceMedium</item>
<item name="android:dropDownItemStyle">@style/mySpinnerItemStyle</item>
</style>

<style name="mySpinnerItemStyle" parent="@android:style/Widget.Holo.DropDownItem.Spinner">
<item name="android:textColor">@color/colorVerifyButtonText</item>
</style>

Čo robím zle, pomôžte mi.

odpovede:

0 pre odpoveď č. 1

Budete chcieť rozšíriť FirebaseUI tému a preniesť to do možností staviteľ. Príklad:

<style name="GreenTheme" parent="FirebaseUI">
<!-- Required for sign-in flow styling -->
<item name="colorPrimary">@color/material_green_500</item>
<item name="colorPrimaryDark">@color/material_green_700</item>
<item name="colorAccent">@color/material_purple_a700</item>

<item name="colorControlNormal">@color/material_green_500</item>
<item name="colorControlActivated">@color/material_lime_a700</item>
<item name="colorControlHighlight">@color/material_green_a200</item>
<item name="android:windowBackground">@color/material_green_50</item>
</style>

A v jazyku Java:

startActivityForResult(
AuthUI.getInstance(this).createSignInIntentBuilder()
// ...
.setTheme(R.style.GreenTheme)
.build());

A dokumenty: https://github.com/firebase/FirebaseUI-Android/blob/master/auth/README.md#themes

V podstate budete chcieť rozšíriť štýl FirebaseUI s rozbaľovacím atribútom.