I would like to make an application that uses the same theme as the 'complete action using' app on Android 5. Does it even exist or do I have to write that on my own?
I finally found out, how to achieve this. The theme is: Theme.Material.Light.NoActionBar, then you need to add a fragment. Edit the theme so the activity is transparent:
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">true</item>
And finally set the background of the fragment to white.
android:background="#color/primary"
Related
I want this kind of translucent activity/fragment for android any help would be appreciated
Android activity/fragment overlapping here just like this one:
use this style for your app :
<style name="AppTheme.NoBackGround">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowBackground">#color/transparent</item>
<item name="android:colorBackgroundCacheHint">#color/transparent</item>
</style>
then set the blur and transparent background on the activity
I'm using a theme that inherits from "android:Theme.Material.Light" and am unable to find a way to hide the action bar from the xml style customizations. When using "Theme.AppCompat.Light" I was able to do it with something like this
<style name="MyTheme" parent="Theme.AppCompat.Light">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
</style>
How can I achieve a similar result with the material theme? I know you can hide it programmatically but not only is it inconvenient because you can't actually see the real layout on Android studio without having to run the app every time, but also, the action bar still appears for a second when you run the app, before getActionBar().hide() is run and it looks really unprofessional.
SOLUTION:
<style name="MyTheme" parent="android:Theme.Material.Light">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
</style>
<style name="MyTheme" parent="android:Theme.Material.Light.NoActionBar">
<style name="NoActionBar" parent="_AppTheme">
<item name="android:windowActionBarOverlay">true</item>
<item name="android:windowNoTitle">true</item>
</style>
and then apply the style to the Activity in your manifest as follow :
<activity
android:name=".youractivity"
android:theme="#style/NoActionBar" >
then if your java class extends the ActionBarActvity fix it to extend the Activity and also you had to change all the other Acivity to extend the Activity Class not the ActionBarActivity :)
i hope this will help you :)
Well I'm a bit late, but if someone is interested here is my solution.
I needed to inherit from a theme which has the action bar visible, so not using theme.NoActionBar.
Looking into the system theme here's what I found:
<style name="MainTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
Here is a link to a doubt i have regarding my app.Any kind of help to solve this will be appreciated.
https://gamedev.stackexchange.com/q/103610/68334
Alright, after checking through the files, I believe the following configurations will work for your case.
In styles.xml, declares GdxTheme.
<style name="GdxTheme" parent="android:Theme">
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">#null</item>
<item name="android:windowAnimationStyle">#android:style/Animation</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowFullscreen">false</item>
</style>
In AndroidManifest.xml, set application theme to android:theme="#style/GdxTheme".
This is all you will need to make the status bar visible.
I want my activity to show up on lockscreen(which is working fine). but i want to get that activity transparent..
I tried 2 methods both are not allowing my activity to show on lockscreen.
Method 1
android:theme="#android:style/Theme.Translucent.NoTitleBar"
Method 2
<style name="Theme.Transparent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
Both are not allowing to show the activity on lockscreen.
Is there any method you know?
Try setting following codes in your activity.I have not tried it, it may work.
getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
This is because you defined windowIsFloating to be true. An activity won't show in front of a lockscreen if the width or height are modified, or if it is set to be floating.
You should set windowIsFloating to false, windowBackground to transparent and if you would still like the dialog-effect, create a dialogfragment, and show that in your onCreate of the activity. And of course, remove the ActionBar from the activity:
<item name="android:windowActionBar">false</item>
<item name="android:windowNoTitle">true</item>
Please give me solution to hide the status bar of translucant screen, i have tries by setting Theme.NoTitleBar.Fullscreen but it works for normal activity, but its not working for the screen witch is translucant.Please give me the hint to solve the problem.
Thanks
That's how I usually do this by overriding one of standard themes.
<style name="ExampleTheme" parent="android:Theme.Light">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
You then can apply the theme to your activity. I hope that helps.
Above solution is not work for me.
I used "#android:style/Theme.Holo.NoActionBar.Fullscreen" as parent theme.
<style name="ExampleTheme" parent="#android:style/Theme.Holo.NoActionBar.Fullscreen">
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
</style>
https://developer.android.com/training/system-ui/status