Im currently developing an app which has a Settings menu. My App uses a dark theme as default theme, and i need to change Title and Summary text color. I also want to use icons like the Android 10 Settings menu:
How can i replicate this menu and with what component?
Is PreferencesMenu a valuable component to do this?
To do this you can use RecyclerView and adapt a designed row.Design the row with a ImageView and two TextViews.Design as you wish for Text colors.In adapter just pass text and drawables as android 10.
You can use SVG drawables.
Set color at layout like this,
android:textColor="#color/colorlightblue"
Related
I am creating an app in android studio using java , I want to create a theme appearance setting like YouTube where user have 3 options to select one of them... 1) Use device theme 2) Dark theme 3) Light theme. But I don't know how to implement it in java activity and xml activity, can anyone help me ?
here I am attaching screenshot of what I want.
enter image description here
Here's a comprehensive description of how you might achieve that using XML layouts and styles: https://developer.android.com/guide/topics/ui/look-and-feel/darktheme
If you're completely new to XML theming in Android, then watch this video first: https://www.youtube.com/watch?v=Owkf8DhAOSo
It is calls Dialog with radiobuttons. All about it + implementation example - https://suragch.medium.com/adding-a-list-to-an-android-alertdialog-e13c1df6cf00
I have five background images which are displayed back to back after a certain time interval. I have to add a page indicator for backgrounds so that user can know which background is currently selected. The user should also be able to select next backgrounds using tv remote.
I cannot compromise tv look and feel for rail and its contents which are displayed on the screen.
I also need to resize background image. I do not want the image to be full screen and its size should cover half portion of tv only. Background image should overlap first rails content to an extent.
I am not getting any such sample or blogs depicting customization of background. Any help would be really appreciated..!!!
Try to use layout themes for TV.
Android Themes can provide a basis for layouts in your TV apps.
You should use a theme to modify the display of your app activities
that are meant to run on a TV device. This section explains which
themes you should use.
Style and Themes can be:
A style is a collection of attributes that specify the look and format
for a View or window. A style can specify attributes such as height,
padding, font color, font size, background color, and much more. A
style is defined in an XML resource that is separate from the XML that
specifies the layout.
You can see samples codes as well from the documentation.
I added two fragments inside my Activity. One fragment is for displaying background and indicator. While another fragment is extending BrowseFragment of leanback library, and is used to display rails/headers as is depicted in tv app android sample which is generated via android studio.
I have found several answers on here as to how to change the background color and add a custom icon to the title bar in android studio but am having difficulties finding an answer for how to use a custom image as the background instead of just a color in the title bar. Any help would be much appreciated. Thanks.
sadly you cannot add images as the background on both the header and textView/webView that's why you don't see any apps on android with image backgrounds. you could try using html instead of xml, like:
replace colors.xml, styles.xml, ect with colors.html, styles.html, ect
but i doubt that will work. hopefully they will add this feature later in the android sdk.
Is there a way to replicate the color changing ability provided by QKSMS .
It allows a user to select a color and then changes the app color and everything to that color.This is all done dynamically the moment the user chooses a specific color.
You can try this cool online tool: http://android-holo-colors.com
This enables you to create many themes for app widgets with your preferred color. You can then change your app theme by saving values for your theme in SharesPreferences or something similar and apply them in onCreate of each activity you have in your app. You can also create the themes easily in styles.xml. For each view, it has its own style with its own attributes so you will need to learn how to edit the theme of each view you want by searching...
Hope that helps.
Some Examples:
ActionBar:
https://developer.android.com/training/basics/actionbar/styling.html
Buttons:
https://www.androidcookbook.com/Recipe.seam?recipeId=3307
SeekBar:
Android - styling seek bar
Switch:
How can I style an Android Switch?
And a lot more... You will have to search for what you want.
I'm using Delphi XE7 for developing mobile application. And how can I change the colour of the TToolbar component in Firemonkey mobile application? I can not find the option in the Object Inspector. Is there any other option to change the colour of this component. And I'm targeting Android platform.
Method #1: In Firemonkey most components can be contained within most other components. Place a TRectangle inside of your TToolBar component. Align it to Contents. Change the Fill color to the color you want. Change the Stroke.Kind property to None. Done.
Method #2: You can also do this by modifying the style. Drop the TToolBar on the form. Right click it and select Edit Custom Style.... You should see a toolbar1style1: TStyleObject in the Struction window. Find TRectangle in the Tool Palette. Drag and drop the TRectangle onto the toolbar1style1 line in the Structure window. It should add a TRectangle to your style. Set the Align to Contents. Set the Fill color to what you want. Set the Stroke.Kind to None. Apply and Close. Done.
It will create a custom TStyleBook on your form and your Toolbar should be the Fill color. This may be a less cluttered way than the first method. But could conflict with loading Premium styles into the TStyleBook. Therefor I think the first method is more forward compatible and more maintainable.
TintColor is the property that you are looking for
If your target is the Android platform, I think you can use the TintColor property.
I have tested the behaviour in Delphi 10.1 Berlin, and it does work correctly.
Please note that the TintColor property is currently only available for mobile platforms (iOS and Android).