Viacheslav Blinov
Viacheslav Blinov
The style can be passed to a view's constructor. There are no other options to use styles programmatically.
You can legally create a `View` with `Application`, or `Service` context. `android.permission.SYSTEM_ALERT_WINDOW` permission is only required for [`WindowManager.addView(View,LayoutParams)`](http://developer.android.com/reference/android/view/ViewManager.html#addView%28android.view.View, android.view.ViewGroup.LayoutParams%29) call. So if you rely on a fact that `Context` is...
> So the user of this class can choose between wrapper.get (which is not very trustworthy, because it will default to Application if the original context died) and wrapper.appContext (which...
> @dant3 That’s a fair point. What about this? Now this is fair & clean. > And it can be made available publicly as a WeakReference for more clarity: But...
> ``` scala > def originalIsActivity = original.get.exists(_.isInstanceOf[Activity]) > def originalIsService = original.get.exists(_.isInstanceOf[Service]) > ``` Maybe there should be a subclasses, with `getOriginal: Option[Activity]` and so on?
After some experiments with macroid, I too feel lp as a pain point (if not using xml layouts :stuck_out_tongue:). `AttributeSet` api is definitely way to go to solve this, and...
Actually themes, is just mixed in attribute sets that is passed to views as constructor parameters. This could be done in the code, the process is not much different from...
Looking at the documentation, this example exists: ``` java XmlPullParser parser = resources.getXml(myResouce); AttributeSet attributes = Xml.asAttributeSet(parser); ``` Given that `XmlPullParser` is used, that you _could_ do (if you really...
Even more from docs: `AttributeSet` is actually just an Interface, so you could implement it as you wish, inspiring by looking at code of `View`s that are actually reading attributes...
It works for me in moonlight on other Android-based TV