How to make square (or round) floating activty? There's a variant with system alert window, but I don't think it's a good idea. Is there any ways to do this customizing dialog theme?
You should use a dialog fragment. It is highly customizable.
Use DialogActivity & make your layout as per your round or square.
ref : URL
Android custom dialog example
Custom Dialog
Set customized style would change the default corner of activity.
Related
I want to use the default Alert dialog with a message an 2 buttons.
However, I want to style it differently. So the buttons text color and size, the title text color, size and background.
Do I need to create a custom dialog or is there a way I can change the default one without having to create a custom dialog?
Thank you
The easiest way to do this is to create a new layout xml file, for example dialog_layout.xml. Design your dialog just like you design any activity. Then, before you create the dialog with the builder, and after builder.create(getActivity()), callbuilder.setView(R.layout.dialog_layout) and it should look exactly the way you want it.
Here is a similar question that you can read through
EDIT: small correction
I need to develop a dialog similar to the one in the image, and I don't know what is the best approach (I'm a newbie):
Which approach do you consider to be the best?
Define one custom dialog and define the custom layout (up arrow) in some way?
Define one image with 9-patch and use it as an imageView with text inside?
Thanks a lot in advance :)
Well, You need tooltips views not dialogs. Dialogs will not serve your purpose.
please refere below library
https://github.com/nhaarman/supertooltips
I need to edit default AlertDialog theme so that it will look like part of the design of my app. I don't want to create a whole new theme for it. I will just play with its own properties and make small changes. But the problem is I can't manage to reach the source code and I don't know what kind of attributes it has.
What I need to do is basically to give background a little transparency and roundness.
Does anyone know where can I get the AlertDialog style code? And which attributes do I need to edit for transparency and roundness of background?
Thanks.
Here's the style code for AlertDialog: https://github.com/android/platform_frameworks_base/blob/master/core/res/res/values/styles.xml
I don't know how to change it the way you want though.
Is that possible to have a custom ProgressBar in Android like this:
I mean:
Not spinning (static)
Progress with one color and remaining area with another color
With text in center
If that's not possible, what's the nearest result that I can have? Maybe using XML Shapes? Thanks!
There is not a standard Android component for reaching this result.
However, there is a library that you can use to achieve that effect.
Check this library.
You can customize this component as you like and use it on your xml layouts like a Custom View.
Check this library: https://github.com/wasabeef/awesome-android-ui/blob/master/pages/Progress.md. It does what you want.
I want my activity to take smaller area of the screen e.g. toast doesn't cover all of the screen, it is just shown over other things and rest of the contents can be seen behind the toast. But it's a dialog, and I want my screen to be shown above other things e.g. above Home Screen. Below is the idea that is in my mind.
Kindly, guide me if it is even possible. If possible then show me the right path.
Thanks.
make your activity theme as translucent.
add the following line in your manifest against that activity:
android:theme="#android:style/Theme.Translucent"
so that you can see the background things add the view to a LinearLayout with android:alignParentBottom=true.
Latest versions force a style based on Theme.AppCompat. Use this to create a quick dialog style based activity.
android:theme="#style/Theme.AppCompat.Dialog"
you can use custom dialog box.
Check this and also this
you can design you layout transparent so view main activity also.