how to remove toolbar in custom tabs(plugin of android - android

see custom tab here i want to remove the complete this blue section ,actually i don't want those option and link to displayed in my custom tab. i don't want to show these option in my custom tab. any help ?? . i try to set them to invisible in its layout xml code

The key is in your styles.xml file.
Notice how mine says, NoActionBar
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
</style>

Just set the styles.xml and activity_main.xml properties to any NoActionBar theme. There is second way within MainActivity place this line above setContentView() method:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
Check this link for more info:
http://easyandroidtutorials.com/remove-title-bar-android-hide-action-bar/

Related

Wierd white line in android start activity

When I changed main activity I started getting this wierd line on start activity, how can I show usuall date time, batter and everything you extect to see at top of screen?
You can set statusbar color with theme.
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorSecondary</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:statusBarColor">#color/colorPrimary</item>
</style>
</resources>
Please check your theme in xml file.
I made stupid mistake and added attribute of noactionbar in manifest

Action bar is showing when using NoActionBar theme

I am using a theme with NoActionBar. Manifest file:
android:theme="#style/Theme.MaterialComponents.Light.NoActionBar"
I am using another Action bar, which I include to the layout:
<include layout="#layout/toolbar" />
However, I always get two Toolbars, and the upper one is the one, which would be there if I did not use NoActionBar theme. I found out, that if I delete this part in styles.xml file, it works as it should - there is no second action bar:
<style name="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
</style>
Of course I would like to keep this in the style.xml file as this helps to set up also the colour of the notification panel.
It seems to me this fails because Theme.MaterialComponents.Light.NoActionBar is an existant theme and you are creating it in the styles.xml so it overrides the existant one.
What I do is to create a new theme setting the one I want to edit as the parent theme:
<style name="AppNoActionBar" parent="Theme.MaterialComponents.Light.NoActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
</style>
And then set this new theme on the manifest:
android:theme="#style/AppNoActionBar"
This way you'll have the properties of the base theme (Theme.MaterialComponents.Light.NoActionBar) with the custom updates.

How to change color of the scroll limit in android studio

I don't know if this is the correct name to design this but I will add an image to show what I want to do.
As you can see, when you are in the scroll limit, something like a colored wave appears. How could I change that color?
You just need to customise the AppTheme as I did:
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#android:color/white</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:colorEdgeEffect">#color/colorAccent</item>
</style>
Add your color to the attribute "colorEdgeEffect".
<item name="android:colorEdgeEffect">#color/colorAccent</item>
And your problem will be solved
NOTE: This will only work for API 21 and above

How to customize Alert Dialog button background and title divider from my theme xml file

I stuck for more than 2 full days, doing this.
So far, I can change only the Title text color using style XML file. Other than that no attributes work well. Almost covered all STACK OVERFLOW questions, but not luck, not able to find answers.
Here's what I want to do:
(Delete button is focussed)
As of now, I am able to do this only by programmatically by getting titleDivider, Positive and Negative button and assigning background. But that said I hate to do this by programmatically.
Some one please help me.
Your can use this project AlertDialogPro.
Include this project to yours and define your theme like below:
<style name="YourAppTheme.AlertDialogProTheme" parent="AlertDialogProTheme.Holo.Light">
<!-- Custom the title style -->
<item name="android:windowTitleStyle">#style/YourDialogWindowTitle</item>
<!-- Change the title divider to green -->
<item name="adpTitleDividerBackground">#color/your_green_color</item>
<!-- Change the button style -->
<item name="adpButtonBarButtonStyle">#style/YourButtonStyle</item>
</style>
<style name="YourDialogWindowTitle" parent="DialogWindowTitle.Holo.Light">
<item name="android:textColor">#color/your_green_color</item>
</style>
<style name="YourButtonStyle" parent="Widget.Holo.Button.Light">
<item name="android:background">#drawable/your_button_background_selector</item>
<item name="android:textColor">#color/your_button_text_selector</item>
</style>
And specify this theme to your app's theme with attribute "alertDialogProTheme":
<style name="AppTheme" parent="AppBaseTheme">
...
<item name="alertDialogProTheme">#style/YourAppTheme.AlertDialogProTheme</item>
</style>
Use AlertDialogPro.Builder to build dialog:
AlertDialogPro.Builder builder = new AlertDialogPro.Builder(getContext());
builder.setTitle("Delete").
setMessage("Are you sure?").
setPositiveButton("Delete", null).
setNegativeButton("Cancel", null).
show();

android: How to change ListPreference title colour?

I would like to change the title and line color of my ListPreference from blue to pink, to match the line of my action bar.
Any ideas? Thanks in advance!
I've been looking through Android's themes.xml and styles.xml looking at things like dialogPreferenceStyle, but haven't figured it out yet.
Had the same problem today.
Old thread, but I found this: and it works perfectly.
Simply modify your styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<!-- Add this -->
<item name="android:dialogTheme">#style/DialogStyle</item>
<item name="android:alertDialogTheme">#style/DialogStyle</item>
</style>
<!-- Customize your color here -->
<style name="DialogStyle" parent="android:Theme.Material.Dialog">
<item name="android:colorAccent">#color/colorAccent</item>
</style>
Ended up creating a custom ListPreference widget, following this answer.
I hoped to be able to simply change the style without having to implement a custom widget, but I haven't figured that out yet.

Categories

Resources