Can we user butterknife and databinding together in a fragment? - android-databinding

I am beginner to Android and I am working on a project, where the butterknife is used, I have to set the dark theme and light theme based on a user preference. I added databinding inorder to apply to the background and the test views based on the theme change. Is it okay to have butterknife and databinding in the same class.
Could you please help clarify.

Is it okay to have butterknife and databinding in the same class.
You can use both alongside in your project.
The downside is that both butterknife and databinding will be generating boilerplate code required for you.
But databinding gives has more benefits than butterknife and much more cleaner code also. databinding is much more advanced than butterknife. For more about databinding and also some blogs making head-to-head comparison here and here.
As officially announced for Butterknife,
Attention: This tool is now deprecated. Please switch to view binding. Existing versions will continue to work, obviously, but only critical bug fixes for integration with AGP will be considered. Feature development and general bug fixes have stopped.
The better way is to slowly start to get rid of butterknife and start using databinding

Related

How to set up the css less in react native app

I am looking for ways to integrate the custom less file with React Native project so that I can use all the pre-build custom classes from any specific design system.
I came across few projects but didn't want to use them due to the maintainability and reliability issues.
Kindly share with me any guidelines or documentation which have the required explanation.
There aren't any. The problem is that there isn't always a react native style equivalent to css properties and additionally there can be major differences in how they applied. For instance,
default flex direction is column, not row
there is no grid layout
text styles are not inherited from parents
there is no display none
lineHeight behaves differently
just from the top of my head. Even if you find a library that can convert your classes to native, you will have to rewrite a lot of the styling.

Avalonia UI Carousel Example

I'm rather new to Avalonia UI / XAML / .NET MVVM in general. While I really like Avalonia so far, it's still in beta and lacks extensive documentation. Hence I sometimes struggle to get specific things working or finding out how I should use them correctly.
Could somebody point me to an example using the Carousel control? Which properties should I set in the xaml, what kind of item list should be behind it etc?
Cheers.
You can find usage example in ControlCatalog project from the main repository:
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml
https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/CarouselPage.xaml.cs

OpacityMask missing in UWP

Any easy way to apply OpacityMask to a UI object in UWP XAML?
I used to do that in WPF but appears to be missing in UWP.
You can partially replicate this functionality, but not in an especially easy way. Windows Composition API offers a similar functionality where you can define a CompositionMaskBrush with which you will "paint over" the UI object to achieve a opacity mask effect.
There is an example as the solution of a GitHub issue that demonstrates such process. The same user also asked on StackOverflow.
You can also check out the CompositionProToolkit that might simplify implementing this.

How to TILE a background image in WinRT?

With the absence of VisualBrush in WinRT, I am not sure the approach. Anyone?
At the moment I don't believe there is a way, while ImageBrush inherits from TileBrush it's missing the important property TileMode. It's unclear whether this will be included in later versions.
Indeed there hasn't been much information given in regards to XAML styling WinRT besides
changing Dark and Light themes...
so I guess we have to fiddle and experiment...
While doing some googling on the web I came with the following link... might as well give it a shot...
Creating tiled backgrounds in Metro style XAML apps
http://www.robfe.com/2012/07/creating-tiled-backgrounds-in-metro-style-xaml-apps/
Note that it might work in full screen though I ain't sure on how well it responds to snap and rotation.
http://www.mindscapehq.com/ now have a TiledBackground control.
http://www.philliphaydon.com/2013/01/windows-store-app-tiled-background/
<ms:TileBackground ImageSource="/Assets/debut_dark.png" />
Requires a license to access the nightly build.

How build a custom control in Xcode for the iPhone SDK?

I want to build a custom control to reuse in my project which consists of two UITextFields that are linked together + a label.
It is starting to become repetitive across my App and smells of code duplication ;)
However, I wonder what is the best aproach here.
Is it best do everything by code in a controller or is posible do a visual thing like the ones built-in in Xcode?
You can build an Interface Builder plug-in for this. It's fairly straight-forward. To get started, read the Interface Builder Plug-In Programming Guide. It even has a quick, step-by-step tutorial to get you started. Apple recommends creating a plug-in to IB for just your case...
I don't think this is possible. I briefly looked at the IB Plug-In Programming Guide and apparently Interface builder plugins are implemented through Custom Cocoa Frameworks. That is, your plugin is defined in a framework which is loaded in Interface Builder. IB looks in the current projects frameworks to find any custom components defined and will load plugins accordingly. It is not possible to use custom or third party frameworks on the iPhone so I don't see how IB would make a connection here. If somebody has more info I'd love to see this discussion continued.
This is fine except it is for the iPhone. The iPhone presents a more difficult environment to create the plug-in for interface builder. It should be possible but I have yet to see a Xcode project that does this. They are all limited to creation of desktop "AppKit" versions, not iPhone "UIKit" versions of the plugins for IB.