Allow content to display outside of LogicalDisplay Rect AOSP/LineageOS - android-source

I'm working on adding second screen functionality to AOSP for the LG V20.
So far, I've managed to set up the offsets so normal content doesn't overflow into the second screen area, and I've added the second screen window type (SIGNBOARD). The offsets are managed in LogicalDisplay.
For a lot of this, I've been following how LG originally did it (in Android 7.0, so things are slightly different on 7.1). The problem I have now is that nothing displays in the second screen area: I see some stuff LG did involving SurfaceControl, but that doesn't seem to be the actual solution, and I'm worried it might be in the native code.
I've tried Googling, but this doesn't seem to be documented anywhere, at least nowhere I could find.
So the question becomes: How can I force content to display outside of the bounds of the LogicalDisplay area?
These are the changes I've made so far: https://github.com/zacharee/android_frameworks_base/commit/cec4839c8cb1396810ce65d7ad9cae094f363ac4

Related

Canvas not scaling properly regardless to the set scalability

I'm trying to make my Canvas scalable regardless of screen size. I made it to be scalable across the screen but when it is hidden and called it is not scaled for some reason. I actually call it in code and it shows up when needed but it is not scalable but when I display it right away it is scalable.
Expected position (is displayed normally when I do not hide the display):
Actual position (when my display is hidden and is displayed at the button pressing):
How to make it scalable? I've searched for all possible solutions but I could not find an answer.
These are the settings and hierarchy:
These are parent settings (main canvas):
I am not sure why CanvasScaller is not enough for you. I've never faced a case where I had to implement my own scalling, you should probably check CanvasScaller and use that, but anyway if your layout is not getting recalculated instantly you can force that by using
LayoutRebuilder.ForceRebuildLayoutImmediate(rectTransform);

Why is the play button on my title screen not starting the game?

I managed to open the demo game that I need to see/play, however, it looks like the title screen isn't loading correctly. Clicking on the "Play" button should allow the user to start the game, but when I try clicking on it, nothing happens.
I'm not sure why this is happening because I downloaded the exact same files as the ones that were used in the demo and I also tried deleting/redownloading the files a couple of times. I also double checked the console messages and there aren't any errors/warnings for any scripts. I'll attach a screenshot of what I see and the link to the game files themselves if anyone wants to try it on their end.
Also, if this helps, I'm using Unity version 2018.3.2f1.
Here is a link to the project if you want to try it out yourself (I'd post the code, but I don't want to put a giant block of code up without a clear direction; however, I believe the main menu content is in the "Manager.cs" file): https://drive.google.com/file/d/1ekXt948b612dmyT1AZReUOuzh2XbnSDG/view?usp=sharing
This is what the game looks like if it helps:
After reading through the code in the other scripts, I realized that the error was coming from the specific region that was being used as a "hitbox" on the screen for the play button. And because I was setting my aspect ratio differently than what the developer used, the positioning of the "hitbox" did not line up correctly on my screen. So instead, I had to change the aspect ratio to fixed resolution and specific canvas sizes (width and length).

google glass camera parameter settings

I'm working on an app that includes a custom camera application on Glass. I want to be able to hard-set different camera parameters, but I'm having difficulty figuring out which ones I actually have access to.
I tried calling parameters.flatten() and got a whole bunch of options that I thought I would be able to use, but when I tried testing them, nothing happened. (For example, when I tried setting the color effect to sepia, the result was still in normal color). Is there any documentation or code I can look at that will tell me which parameter options I actually have?
There are a few open issues on our issue tracker about camera parameters that do not behave as expected:
Issue 302: GDK: Camera effects not registered or take affect
Issue 303: GDK: Request: Additional camera focus modes (with auto focus)
Issue 304: GDK: Camera scene mode does not register or take affect
You may want to follow those so that you can be updated as the GDK evolves.

Using CSS with background image/login

Currently I'm trying to edit a login screen for a web based application. As of now, I have the login prompt (user & password) at a particular place on page so that it corresponds with the background image. Right now this image is set to 1024x768.
What I was wondering, is there a way to have the background automatically scale depending on users own resolution while have the login appear at the correct location? I'm not sure if this is possible but thought someone might have some advice.
I've made a jsFiddle solution that can come in handy:
Click here to see background-resizing at work
It works with jQuery, and I've commented most code so you can understand how it works. You compare the aspect ratio of the image and the browserwindow, look at the difference and then resize the width or height, based on how the aspect ratio's are comparing. The css is also worth a look.
I tested it in Firefox and IE(7/8), but jsFiddle resizing is a bit buggy in IE.
Good luck!
Update:
I've made an updated jsFiddle here.
In this scenario, the message box (in your case the loginbox) is positioned absolute with percentual offset to the top and right. I also gave it percentual width/height, although that might not be neccesary/wanted. But you can tweak this to see how the box behaves with different window sizes.

When resizing a UIView to height or width zero, springs and struts stop working permanently

I'm trying to workaround a long-running bug in Apple's SDK here, but I can't see how to achieve it without huge amounts of code.
Here's the bug:
Create a view.
Put another view inside it, with an origin ANYTHING except (0,0).
Configure the subview to resize to fill
...then, at runtime:
4. Set the superview size to zero
5. Set the superview back to ANY non-zero size
BANG! Apple's SDK goes haywire, resets the origin of the subviews, loses all ability to tell up from down, etc. (seems like the programmer "Forgot" to include a variable to record what the spring/strut-size was before it went to 0).
I've heard this bug has existed in OS X for 5 years or so, and Apple still hasn't fixed it. What I would like is some way (any way!) of working around it, without re-writing Apple's entire springs/struts system and implementing it properly, without the bug. Unfortunately, I can't even find the original references to the OS X bug that someone showed me previously.
EDIT:
...I have a resizing "drawer" at the bottom of the screen that has to shrink to small height. The problem is subviews "collapsing" all down to origin 0 (amongst other things) at the drop of a hat (technically: they're reducing their origin.height, but not re-increasing it).
The best solution I have found is to limit your minimum window size so that none of your views can ever hit zero size.
EDIT: an hour later, the collapsing behaviour has returned, without me touching the source files. I'll use source-control to double-check, but I believe all that happened is I added other files to a different part of the view-hierarchy and re-built. Argh!
(what follows SEEMED to work, but is now failing again, in the same way)
Hmm. So, I had two UIVC's on one screen. Refactoring so that I only had one made the resizing bug vanish. It seems to be a bug in the UIVC layout code.
NB: I had the idea this might be a problem because I know Apple currently advises you to only have one UIVC on screen at once with iPhone, even though this means you have to ignore their MVC architecture for complex apps. So, technically, they warn you away from this. But, at the same time, I'm now unable to use the MVC stuff for this code.
The following worked (for my current example - may not be universal!).
HOW:
If you're adding any UITableViewController instances ... give up. You'll have to re-implement that class yourself
Find my subviews that were in UIVC instances, and change the extended class in the UIVC header from "UIViewController" to "NSObject"
Move all code from viewDidLoad to init (remembering that "init" has special rules about first few lines etc)
Replace the instantiation of that UIVC from "[[vc alloc] initWithNibName:nil bundle:nil]" with a plain "[[vc alloc] init]"
Another potential workaround (that works in my current situation):
The only View I have right now that MUST have a non-zero origin and MUST resize-to-fit is a UITableView.
Apple has a special feature of letting you put any view as a "table-header".
So ... I've taken all my other components, stuck them in a large view, and made that the table-header view.
The downside is that they now scroll off the top when you scroll the table, but it allows me to give the table a zero-origin, working around the SDK bug.