android-theme

Change the project theme in Android Studio?

放肆的年华 提交于 2019-12-02 20:07:16
I created some project using the light theme and now I want to change it to dark and I can't figure out how to do that. BTW, I'm not asking on how to do it in code, just how to change the project's default theme. Shahzeb In the AndroidManifest.xml, under the application tag, you can set the theme of your choice. To customize the theme, press Ctrl + Click on android:theme = "@style/AppTheme" in the Android manifest file. It will open styles.xml file where you can change the parent attribute of the style tag. At parent= in styles.xml you can browse all available styles by using auto-complete

Android Preference Fragment Text Color

我与影子孤独终老i 提交于 2019-12-02 19:11:04
I want to change the text color in android preferences fragment. I am currently using a custom theme to change the checkbox image, background, onClick highlighting and it all works great...besides the text color. I don't want to use a default theme, I want to have my own theme so it all looks how I want to but just change the text color, can someone please help. styles.xml <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> <style name="selectedTextStyle"> <item name="android:textSize">18sp</item> </style> <style name="buttonTextStyle">

icon with real color shows black background

℡╲_俬逩灬. 提交于 2019-12-02 18:59:13
问题 Using the new theme Theme.MaterialComponents when placing an icon on a button shows me a black box, how can I place an icon with its real color? <Button android:id="@+id/idGoogle" app:icon="@drawable/ic_google" app:iconTintMode="add"/> 回答1: The solution <Button android:id="@+id/idGoogle" app:icon="@drawable/ic_google" app:iconTint="@null"/> 来源: https://stackoverflow.com/questions/54637591/icon-with-real-color-shows-black-background

Customize android action bar

拜拜、爱过 提交于 2019-12-02 18:24:16
问题 I'm trying to create a new theme and customize the action bar: <resources> <style name="Theme.Shappy.Red" parent="Theme.Sherlock.Light"> <item name="android:actionBarStyle">@style/ActionBar.Shappy.Red</item> ... ... [some_other_customizations] </style> <!-- Action bar --> <style name="ActionBar.Shappy.Red" parent="@style/Widget.Sherlock.Light.ActionBar.Solid"> <item name="android:background">#ffb70000</item> <item name="android:titleTextStyle">@style/ActionBar.Title.Shappy.Red</item> </style>

Read Newer Theme Attributes On Older Platform

陌路散爱 提交于 2019-12-02 17:30:34
I am trying to read attribute values from themes and styles which were designed for platforms that are newer than I am running my application on. Please don't ask why. If you know anything about the libraries I write then you should already know that I like to push the capabilities of the platform :) I am operating under the presumption that when Android styles are compiled the attribute constants are what is used for the keys and therefore should theoretically be able to be read on any platform somehow. This is what I have observed to be happening with layout XMLs in my other libraries with

Change title color in toolbar?

不问归期 提交于 2019-12-02 17:30:14
I have a toolbar that I use, and set title with: ((ActionBarActivity)getActivity()).getSupportActionBar().setTitle("Home"); Is there a way to change the color from black to white? I tried making its own theme and setting it in the xml like this, but no dice: <resources> <!-- Base application theme. --> <style name="AppTheme2" parent="Theme.AppCompat"> <item name="android:windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="colorPrimary">@color/primary</item> <item name="colorPrimaryDark">@color/primary_dark</item> <item name="colorAccent">@color/accent</item> <item

What is difference among styles.xml and themes.xml

时间秒杀一切 提交于 2019-12-02 16:29:59
May I know what is the difference between styles.xml and themes.xml ? To me, they just look same as both XML are in the same format. <style name="... <item name="... So, in my app which provide customization coloring, size, drawable, ... do I need both styles.xml and themes.xml as well? How should I decide which XML to put in which file? Out of the whole page of the Styles and Themes . You may be looking for this line. When you apply a style to a single View in the layout, the properties defined by the style are applied only to that View. If a style is applied to a ViewGroup, the child View

How to set the holo dark theme in a Android app?

流过昼夜 提交于 2019-12-02 14:33:51
How can I set the dark holo theme in my app? At this time I got this: <style name="AppTheme" parent="android:Theme.Holo.Light" /> But when I change it to: <style name="AppTheme" parent="android:Theme.Holo.Dark" /> I get an error error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Dark'. How to solve the problem? change parent="android:Theme.Holo.Dark" to parent="android:Theme.Holo" The holo dark theme is called Holo By default android will set Holo to the Dark theme. There is no theme called Holo.Dark, there's only Holo.Light, that's why

How to switch themes (night mode) without restarting the activity?

十年热恋 提交于 2019-12-02 14:30:15
I have made a few apps that support multiple themes, but I always had to restart the app when user switches theme, because setTheme() needs to be called before setContentView() . I was okay with it, until I discovered this app. It can seamlessly switch between two themes, and with transitions/animations too! Please give me some hints on how this was implemented (and animations too). Thanks! @Alexander Hanssen's answer basically has answered this... Don't know why it was not accepted... Maybe because of the finish()/startActivity(). I voted for it and I tried to comment but cannot... Anyway, I

How to Android Holo Theme style dialog box buttons

我的梦境 提交于 2019-12-02 13:51:53
I'm creating a Dialog Box on Holo Theme and want to follow the OS default way of displaying the buttons. So far I have created the dialog box but the buttons don't render in the way it does in the apps done in Holo for ICS. How can I do this? My intended look & feel is and I am able to reach till here SimonSays a bit late, but maybe someone is still interested in that. this works pretty good for me. ... <!-- EDIT: be carefull, "?android:attr/dividerHorizontal" is only supported since API 11 just avoid it in prior OSs. --> <View android:layout_width="fill_parent" android:layout_height="1dip"