I'm building app with one main activity which UI looks like TV remote. I need to show interactive response to the user when he interacts with UI through taps.
UI is created with Illustrator. I was searching for some SVG solutions but only found animation and morph libraries. Turns out I need to reload part of the UI, because reloading everything on every tap seems heavy on performance.
What good solutions there are for this problem? Load SVG in parts and put it together with css? I'm even considering moving to native Android if there's no way, because my app depends on some phone hardware control. By the way, I'll also be moving design to Adobe XD for prototype creation, so maybe there's something to go in line to make life easier.
So here's a way I solved this:
Give names to illustrator layers to be exported (even hidden layers should be shown to be exported)
Export selected artboard as SVG with internal CSS and select 'layer names' for Object IDs
Open SVG in editor and adjust initial styling as needed (gradient, stroke, hide layers to be switched etc).
Use SVGR to convert SVG into React component
Set component position
Pass props to React component to change styling at runtime and interact with user
Related
How can I set up a popup window in an Android Cordova application to have a blurred background? The content behind it will not be known in advance, and may contain both images and other components from multiple sources. It will not necessarily only appear over a single image. The effect I'm looking for will look something like this:
Things I've investigated so far:
The approaches described in the answers to Background blur with CSS, which tend to rely on having the background already available as an image (e.g. here's a modification of the accepted answer that shows that only the background image gets blurred, and that any text placed on top of the background is lost by the effect), or use the CSS property backdrop-filter which isn't currently implemented on Android's web view component.
Using html2canvas and similar approaches to generate an image then blurring the image. This sort-of works, but is too slow to use on complex layouts on low end phones, resulting in an unacceptably long delay before the popup appears.
Is there another approach that can make this work?
If you use crosswalk-plugin for android, add --enable-experimental-web-platform-features to XWALK_COMMANDLINE, then you can use backdrop-filter, but It still have some bug. you can test this feature in you chrome, open chrome://flags and open enable-experimental-web-platform-features.
Did you try svg filter?
Maybe this can help you https://www.w3schools.com/graphics/svg_fegaussianblur.asp :)
I have a UWP application and I want it to be able to run into Android and also IOS using Xamarin.forms. Is there anyway to port it and run it on both of them?
Short answer: no.
Long answer: Xamarin Forms is "Xaml" too, but works on top of a completly different framework.
If you have used a good architecture, you can use all your viewmodels (or whatever your ui logic is called) and just put a Xamarin.Forms UI on top of that. With a little luck, you can reuse a lot of the structure from your existing xaml, but as most names are different, it is almost a complete rewrite. Or you could put a native UI with Xamarin.Plattform UI on top of your code.
So if you want to go cross platt form, you have to add at least one completely new UI.
I trying to write a new game using Libgdx.
Before I jump into creating the main screen (menu) , I wold like to ask a quick question from the experienced developers
What are the pros and cons in writing a menu splash screen in android native code(using activity etc.) vs writing a AbstractScreen using Libgdx scene2d?
I'd generally suggest you to use the Screens completely instead of having a separate activity just for the loading purposes.
Afaik there already is a SplashScreen class you can extend and use. But even besides that, it's fairly easy to create a class for your LoadScreen that implements the Screen interface.
In this class you can have an AssetManager to asynchronously load your assets while displaying e.g. a load bar or just a splash image or animation. Doing this as Screen in libgdx vs. a separate Activity will also give you the full control over the look. You can use your shaders, assets and whatever completely within your libgdx structure, no need to tinker around with connecting the load activity with the rest of the game.
After loading your assets, the menu can also be easily created with libgdx and scene2D. Your menu buttons can use the same skin and look as buttons in the rest of the game, using tables and other layouting options allow you to easily create good-looking menus.
And even though it might not be important to you yet, doing all this completely in libgdx will result in it to work on desktop and iOS as well. You can almost completely test the gameplay and look of your game on the desktop, which is faster than deploying to Android all the time.
I'm developing quite a few homescreen widgets and currently I have to install them on my emulator or my phone in order to preview the layout.
Is it possible to preview the layout in Eclipse? When I open the XML of my layout in the preview mode, it displays it as it it were an activity and therefore the scaling is entirely wrong.
You can use jimu as a plugin into Eclipse to achieve it. Jimu is a drag & drop style App creation tool for Android. That's the most suitable tool to allow you achieve what you have in mind to get WYSIWYG, as it will enable you to have live previews of Android layouts. You have also the option to use it with Eclipse, or with Android Studio or any other editor of your choice.
To avoid the need to compile-install-run, jimu Mirror gives you live previews of your app that update as you code.
As you can image, the most positive fact about Jimu is that it speeds up Apps development times.
Alternatively, you can use IntelliJ IDEA. IntelliJ IDEA also allows you UI layouts preview.
Thus allowing you achieve WYSIWYG. And equally IntelliJ IDEA gives you the option to integrate it with Eclipse. Of course, alternatively you may decide to simply completely to move to Intellij IDEA. It is available in a commercial edition as well as in a free open source community edition.
IntelliJ IDEA UI designer allows you to build application UI by dragging widgets from its side palette. In version 13 you can simultaneously preview the UI you’re creating on multiple devices, by just selecting Preview All Screen Sizes from the device drop-down. Preview displays all changes made through the UI designer or XML editor in real time.
Such tools for GUI implementation from Jimu and IntelliJ IDEA remembers a little bit Qt Designer, which is available also for Android. In fact, any approach that properly works, allowing interactive Android UI quick development, is a greatly welcome valuable tool for developers that should be well used to improve productivity.
At the top of the view in Eclipse switch to the Holo Panel theme. If you need your own theme attributes then create tour own theme override that parent's to this. Then you could choose that in the editor.
it displays it as it it were an activity and therefore the scaling is entirely wrong.
If it displays as an Activity, then create a dummy Activity that mimics the home screen. Then use a theme, or use an include tag to include the layout from your widget into the cell(s) of that larger dummy home screen.
This solution isn't ideal, but it should be able to give you a better approximation (if what you're looking for is just to tweak the layout of your widget).
What I mean to say while you're just getting started with the development and say you add a slider theres a predefined skin for that and you can place it somewhere on the screen, but in some apps there are things like a knob in a place of slider which you can rotate to do the same stuff what the slider does . How do they do that, does it require openGL or something I am not asking for a complete tutorial or something just curious on what stuff goes into building such thing
Mostly, if something is not provided out of the box, you will have to build your own control.
For example, you mention a Knob. That isn't available in the Android SDK. Such a control could prove to be useful.
Here is a tutorial to build such a custom Control: http://go-lambda.blogspot.in/2012/02/rotary-knob-widget-on-android.html
This is an image of the final result from the tutorial linked above:
Here is an example of a custom slider / seek bar: http://permadi.com/blog/2011/11/android-sdk-custom-slider-bar-seekbar/
This should give you a rough idea on how to go about creating your own custom views.
And finally, what I personally find the best possible resource for keeping track of almost all good Custom Views is here: http://www.androidviews.net/
The androidviews.net website has shut down. Android Arsenal is a new website that lists several third party Android libraries.