Is there any way to set NoActionBar theme in Application - android

I am making android app using Visual Studio with the Xamarin platform.
As i read the document the thing I found.
.
As we can see there is only three Theme we can create. So my Question is can we set NoActionBar theme to Application as we can set in Android Studio.
Any Help be Appreciated.

You can use Theme with no Action bar in your app. For ex, you can specify Application Attribute in Properties\AssemblyInfo.cs:
[assembly: Application(Icon = "#drawable/Icon" Theme = "#android:Theme.Holo.Light.NoActionBar")]
Or set it in AndroidManifaset.xml
<application android:theme="#android:style/Theme.Holo.Light.NoActionBar" />
If that does not work, create a style with no action bar, like it's mentioned in here: https://stackoverflow.com/a/14061826/85606

No actionbar with styles
<style name="NoActionBar" parent="#android:style/Theme.Holo.Light.NoActionBar">
</style>

Related

Android Studio: Theme Change - Empty Activity

I started a new empty activity. I am in the start of the project. By default my theme is set to AppTheme. I dont want the title bar on my theme. I changed the theme to NoTitleBar and lot of other themes. I am getting this error.
Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find '?attr/textEditSuggestionItemLayout' in current theme. (9 similar errors not shown) Tip: Try to refresh the layout.
I tried lot of other themes and I am getting errors like this. Is there a way I could select a theme where I dont want to have a title bar on my app?
If not, how can I change the color of my title bar and add a logo?
chose holo light them from them box above the layout
You mean, project name?
You can use NoActionBar if you dont want this code in your styles
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
</style>

How to change the icon of the Auth0 LockActivity for android?

I'm using Auth0 to manage the security of an android app and I need to customize my login activity.
I use the default LockActivity of the Lock.Android library. How I can change the icon of the LockActivity?
You can customize the LockActivity by implementing a style that inherits from Lock.Theme and overrides the Auth0.Title.Icon style attribute with your own app logo.
Here is an code example:
<style name="AppTheme.Lock.Theme" parent="Lock.Theme">
<item name="Auth0.Title.Icon">#style/eXigo.Lock.Theme.Title.Icon</item>
</style>
<style name="AppTheme.Lock.Theme.Title.Icon" parent="Lock.Theme.Title.Icon">
<item name="android:src">#drawable/ic_login_main</item>
</style>
Then in your Android Manifest file you need to change style of the LockActivity with your customized style.
<activity
android:name="com.auth0.lock.LockActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="#style/AppTheme.Lock.Theme" >
You can see the other fields you can customize here.

Android - how to display the Action Bar using the default Theme.Light

I would like to use the default Android Theme.Light in one my activities.
However, when this particular theme is applied in my application Manifest file for the selected activity:
android:theme="#android:style/Theme.Light">
it hides the activity Action Bar.
What needs to be done in java or xml code to preserve the Action Bar, using this particular Light scheme ?
As an alternative, I have used the following default scheme:
android:theme="#android:style/Theme.DeviceDefault.Light">
That scheme does show the activity Action Bar correctly, however some of its objects are not displayed as preferred. In particular, my preference would be to display buttons and spinners as per Theme.Light, but preserve the other style formatting offered by the Theme.DeviceDefault.Light
I would greatly appreciate some tips on how to achieve the above scheme formatting preferences. (I am using SDK = 16).
Why not use "android:style/Theme.Holo.Light" ? is the same but has actionbar it was added in the newer apis
I think you should use Holo.Ligt theme. The old android Theme.Light is not even aware of action bar.
I have the same problem, I like Theme.light's controls, I resolved it like this:
1) define "Theme.Light.ActionBar" in project's styles :
<style name="Theme.Light.ActionBar" parent="#android:style/Theme.Light">
<item name="android:windowNoTitle">false</item>
<item name="android:windowActionBar">true</item>
</style>
2) in the manifest use it :
<activity
android:name="com.your.Activity"
android:theme="#style/Theme.Light.ActionBar" >
I hope that may help

Android app theme - difference when using theme from style xml file

Why is there a difference between theme defined in AndroidManifest.xml and theme taken from styles.xml?
1) AndroidManifest.xml:
<application ... android:theme="#android:style/Theme.Black">
2) AndroidManifest.xml
<application ... android:theme="#style/AppTheme">
styles.xml
<resources>
<style name="AppTheme" parent="#android:style/Theme.Black" />
</resources>
1st setting gives black theme and no action bar. 2nd has dark action bar and light menu.
EDIT : options 1) and 2) - notice Menu and ActionBar
EDIT 2:
Why doesn't the 2nd option actually use the AppTheme (Theme.Black) ? (tested on SGS3)
You probably have another styles.xml file, perhaps under a directory like "values-v11", that is defining the #style/AppTheme differently than #android:style/Theme.Black and taking precedence over the file you're viewing/modifying.
#android:style/Theme.Black implements the exact theme implemented by Android (or device manufacturer). However, #style/AppTheme allows you to perform custom modification in your theme which actually extends the original Theme.Black from android, and in order to perform custom modifications, you use style resources.
In simple words, its just like using Activity class or YourOwnActivity class which extends Activity with extra features inside.
Styles.xml enables you to create your own themes. In AndroidManifest, you set the theme you want for an app or activity. You may want to use a system theme or your own. You can also extend other themes as you're doing setting "parent" attribute. For further information, check this out:
http://developer.android.com/guide/topics/ui/themes.html
You should try to put:
<resources>
<style name="AppTheme" parent="#android:style/Theme.Black" />
</resources>
in a xml file called res/themes.xml

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

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 you are getting the resource not found error.
So just set it to:
<style name="AppTheme" parent="android:Theme.Holo" />
According the android.com, you only need to set it in the AndroidManifest.xml file:
http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme
Adding the theme attribute to your application element worked for me:
--AndroidManifest.xml--
...
<application ...
android:theme="#android:style/Theme.Holo"/>
...
</application>
In your application android manifest file, under the application tag you can try several of these themes.
Replace
<application
android:theme="#style/AppTheme" >
with different themes defined by the android system. They can be like:-
android:theme="#android:style/Theme.Black"
android:theme="#android:style/Theme.DeviceDefault"
android:theme="#android:style/Theme.DeviceDefault.Dialog"
android:theme="#android:style/Theme.Holo"
android:theme="#android:style/Theme.Translucent"
Each of these themes will have a different effect on your application like the DeviceDefault.Dialog will make your application look like a dialog box. You should try more of these. You can have a look from the android sdk or simply use auto complete in Eclipse IDE to explore the various available options.
A correct way to define your own theme would be to edit the styles.xml file present in the resources folder of your application.

Categories

Resources