how to create custom UI like evernote help in android - android

I am trying to crate a Custom UI similar to evernote help android app. As I understand, to start with I have to first create a custom Textview But i cant create a black filter.
I want make new help activity(or draw a view) above the original activity like above image.
My layout has an image and text overlay on it. I know it is a basic question, but I am facing this issue, as I am a beginner to android development. Please do help me to understand how to go with this.
sorry for my bad english.

To make the help activity transprent first make a transprent theme in the styles.xml file in valuse folded using
<style name="AppTheme" parent="android:Theme.Light" />
<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">false</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
then make in the manifest file make this as the theme of your help activty
<activity
android:name=".Help"
android:theme="#style/Theme.Transparent"
android:screenOrientation="portrait"></activity>
now in the help activty will be displayed over your prvious activity.

Related

How to make half screen for notification activity in android

I have develop an application that have some function on Call, so i want to make notification screen for it and display Contact Image, Number and Call duration, so i want implement like true Caller screen(Half activity)
so i am confuse about how to develop code for half Activity so suggest me code
Like this image
Try this..
Add the below code into your styles.xml that's inside values folder
<style name="Theme.D1NoTitleDim" parent="android:style/Theme.Translucent">
<item name="android:windowNoTitle">true</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:background">#android:color/transparent</item>
</style>
then design like that kind of layout and for your activity in AndroidManifest.xml
<activity
android:name=".YourNotificationActivity"
android:theme="#style/Theme.D1NoTitleDim" >

Transparent Android activity trouble

I have an application where the theme can be changed between three different ones. I have two activities that are supposed to have a transparent background and look like a dialog above the previous activity.
I've searched alot for transparent activities here on stack and most of them have the same awnsers. A custom theme with a few properties to enable a transparent background for the activity in question.
The issue for me is that i need to set this custom transparent theme on the parent activity as well to achieve any transparency at all. If i only set a transparent theme on the activity i want to be transparent, it will be a solid background. I've tried everything i could think of but it all boils down to this and im not sure what im doing wrong.
This is my two different parent themes (slimmed down to the neccesary parts):
<style name="StyledActionbar" parent="Theme.Sherlock.Light.ForceOverflow">
<item name="android:textViewStyle">#style/Iksu.TextView</item>
<item name="windowContentOverlay">#null</item>
<item name="android:windowContentOverlay">#null</item>
</style>
<style name="Transparent" parent="Theme.Sherlock.Light.ForceOverflow">
<item name="android:textViewStyle">#style/TextView</item>
<item name="windowContentOverlay">#null</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowIsTranslucent">true</item>
</style>
StyledActionBar is the parent for my three different main themes that is used for all activities that are not supposed to have a transparent background (which is all but two).
Transparent is the parent for three themes that can be used on an activity where the background needs to be transparent.
So the parent activity has a theme based on the StyledActionBar theme. The activity i need to have transparent is based on the Transparent theme.
The background is solid in this state.
If i move:
<item name="android:windowIsTranslucent">true</item>
to StyledActionBar, almost everything works as a charm except a nasty bug in Android 4.4.2 causing the main activity to "fall behind" the OS view when using NavUtils for up-navigation to the main activity.
Any ideas?
in your manigest file
<activity
android:theme="#android:style/Theme.Translucent.NoTitleBar">
</activity>
and in your xml set
android:background="#android/transperent"
also you can use
android:alpha="0.50"
try this one more time :
<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>
and in the manifest file
<activity android:name=".AlertActivity"
android:theme="#style/Theme.Transparent"/>
Hope it will work for u.

Why there is a white screen appears for 1sec when starting to run the apps in Android?

When I click the app icons and start to run the apps, it will appear a white screen for 1 sec.
I don't know why.
Is there any idea to clear this white screen and directly go to my activity?
The white/black screen is the window background image.
The window background is shown while e.g. your onCreate() runs and your layouts are being inflated. It can take some time especially if there's a lot of bitmaps that need to be read, decoded and scaled.
Changing the theme works because some themes have a non-default window background. For example, Theme.Wallpaper has a transparent background. There are other definitions there, too. Essentially what you want is:
<style name="YourTheme">
<item name="android:windowBackground">#null</item>
</style>
Programmatically you can achieve the same with
getWindow().setBackgroundDrawable(null);
at the top of activity onCreate().
(Old question but got bumped up by another answer and there wasn't a good answer.)
Settings. File>Settings>Build,Deployment>Instant Run Deselect all options shown there.
and add below line in your style.xml
<item name="android:windowDisablePreview">true</item>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowDisablePreview">true</item>
</style>
apply changes in AndroidMainfest.xml
<application
android:theme="#style/AppTheme">
After I change style.xml:
<resources>
<style name="AppTheme" parent="android:Theme.Wallpaper" />
</resources>
it works!!
Thanks all
Add the following in the manifest file of the corresponding activity
android:launchMode="standard"
and remove android:label="#string/app_name" from the corresponding activity ,this actually helped me
In your manifest.xml file remove the line android:theme="#style/AppTheme" for your app. and check it again
Use this tag in your manifest:
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
In Styles add the following things
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowIsTranslucent">true</item>
Hope this will help you and its working for me

Can I create translucent + dialog theme in android?

I want my activity to look like a dialog.
Well, I achieved that using android:theme="#android:style/Theme.Dialog"
Now, I also want it to be translucent as it appears in android:theme="#android:style/Theme.Translucent"
Is there a a way to mix them both using a custom style??
Please any suggestions, thanks
EDIT: achieved something similar with this:
Now i want to add border like a dialogwindow...how can i do that???
<style name="TransparentDialog" parent="#android:style/Theme.Dialog">
<item name="android:windowBackground">#android:color/transparent</item>
<item name="android:windowFrame">#android:color/transparent</item>
<item name="android:windowContentOverlay">#null</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">true</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:alertDialogStyle">#android:style/Theme.Dialog</item>
<item name="android:windowAnimationStyle">#android:style/Animation.Dialog</item>
</style>
EDIT: Solved this. Check the answer
Finally achieved what i wanted with this:
Used this theme for my activity android:theme="#android:style/Theme.Translucent"
and gave this android:background="#android:drawable/dialog_frame"as background to the root element of my layout
That was so easy!
You'll need to combine the two themes together. One thing that might work is:
<style name="TranslucentDialog" parent="#android:style/Theme.Dialog">
<item name="android:background">"#33000000"</item>
</style>

Transparent Activity does not open with typical animation, just appears?

I have a transparent activity defined using this theme:
<style name="Theme.Transparent.NoDim" parent="android:Theme.Translucent">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
And in the AndroidManifest.xml
<activity android:name=".Activity"
android:theme="#style/Theme.Transparent.NoDim">
</activity>
However since adding this theme to the Activity, when opened the Activity does not open using the normal animation (where the view expands to fill the screen), rather it just suddenly appears.
Any ideas on why, and a fix?
Thank you!

Categories

Resources