Podczas korzystania z układów opartych na xml przy użyciu AppCompat 22.1.0 nie wszystkie obsługiwane widgety są przyciemniane lub tematyczne dla moich Fragmentów z Androidem 4.4.AppCompat v22.1.0 niepoprawne stosowanie wszystkich widżetów XML dla fragmentów
Widzę to zachowanie z następujących widżetów (inni nie testowane):
- RadioButton (Brak koloru odcień)
- CheckBox (Brak koloru odcień)
- Spinner (domyślny motyw Urządzenie jest stosowane)
- EditText (Device domyślny motyw jest stosowana)
- RatingBar (Device domyślny motyw jest stosowana)
- Przycisk (defaul Device t temat jest stosowany)
Wcześniej pracował w AppCompat v22.0.0.
ekranu (lewy 4,4, prawy 5,0):
MainActivity.java:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
if (savedInstanceState == null) {
getSupportFragmentManager()
.beginTransaction()
.add(R.id.container, new PlaceholderFragment())
.commit();
}
}
public static class PlaceholderFragment extends Fragment {
public PlaceholderFragment() {
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_main, container, false);
return rootView;
}
}
}
fragment_main.xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="RadioButton test"/>
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="CheckBox test"/>
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="@array/someStrings"/>
</LinearLayout>
Themes.xml
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"></style>
</resources>
Naprawiono za pomocą 22.1.1 –
Rzeczywiście! Szybka reakcja od Google! –