Repository: beeware/toga

Issue:
Scroll container not expanding to width of container
```
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW

class AFV(toga.App):

    def startup(self):
        self.main_window = toga.MainWindow(title=self.formal_name)

        box_test = toga.Box(style=Pack(direction=COLUMN, padding=5))
        self.label_1 = toga.Label('TESTE 1')
        self.lineEdit_1 = toga.TextInput()
        self.label_2 = toga.Label('TESTE 2')
        self.lineEdit_2 = toga.TextInput()
        self.label_3 = toga.Label('TESTE 3')
        self.lineEdit_3 = toga.TextInput()
        self.label_4 = toga.Label('TESTE 4')
        self.lineEdit_4 = toga.TextInput()
        self.label_5 = toga.Label('TESTE 5')
        self.lineEdit_5 = toga.TextInput()

        box_test.add(self.label_1, self.lineEdit_1, 
                     self.label_2, self.lineEdit_2, 
                     self.label_3, self.lineEdit_3, 
                     self.label_4, self.lineEdit_4, 
                     self.label_5, self.lineEdit_5)
        self.container = toga.ScrollContainer(horizontal=True, vertical=True)
        self.container.content = box_test


        self.main_window.content = self.container
        self.main_window.show()


def main():
    return AFV()
```


When using the widget it leaves the widgets in the wrong shape and size on the screen.
The ScrollContainer doesn't make the TextInput widget fill to the bottom of the screen, it measures according to the size of the Label text.

![qqqq](https://user-images.githubusercontent.com/75274707/194348453-3328a915-087a-4621-a86d-8a20a754c3a9.PNG)

Worked on Briefcase 0.3.9; new screenshot is from Briefcase 0.3.10.


Discussion:
Thanks for the report. My initial guess is that either the Gradle template is setting up the window in a slightly different way, or one of the style rules isn't being applied correctly as a result of the move to Chaquopy.

As with your report beeware/toga#1603; the bug template is *not optional*. I've updated the ticket to include the details that I know based on Discord discussions.
Confirmed: it looks like the container is shrinking to fit its widest widget:

<img src="https://user-images.githubusercontent.com/166954/194721899-eec5b122-352f-4953-b889-0fc312c34f37.png" width="400">

However, I get the same result after recreating the project with Briefcase 0.3.9, so this isn't caused by the Chaquopy or template change. I also get the same result when going back to toga-core and toga-android version 0.3.0.dev36, which was released on the same day as Briefcase 0.3.9.

So if this was working for you before, @kakos-k9, it might be because you created the project with an even older version of Toga, and then never updated it again until this week. Can you tell us when you created the project? You can probably find out by looking at file or directory timestamps.
Answering mhsmith, my project that I made using briefcase 0.3.9, I was using toga-android 0.3.0dev35 (if memory serves me right)

So this bug that happens is due to toga-android versions?

I recently updated my project made with briefcase 0.3.9 to toga-android0.3.0 dev38 and the interfaces remained the same.
But taking into account the briefcase 0.3.10. I created a new project, and I used the default versions that are created automatically, then I did the same test and it still remains with the wrong interface

![aaa](https://user-images.githubusercontent.com/75274707/194783523-84d63bd6-2d4c-47ef-aea8-5864f4b7ccec.PNG)
![qq](https://user-images.githubusercontent.com/75274707/194783524-c0cdf7f7-d022-44de-ba61-4e12af1daf6f.PNG)

That is, I created a new project and wrote the code inside app.py and the interface is still wrong
![re](https://user-images.githubusercontent.com/75274707/194783591-8c6edfe7-a564-42b7-a725-6f758b8e9602.PNG)

@kakos-k9 We know how to make the *wrong* behavior appear - that's the current behaviour. We don't need more examples of how to make the *wrong* behavior occur. What we're looking for are reproduction instructions for how to make the *correct* behavior appear. 

You're claiming that the behavior has changed - but nothing in our testing is supporting that claim. It's still a bug, but there's a *very* big difference between "This used to work and now it doesn't" and "This never worked". 
Confirmed that when using Briefcase 0.3.9 and its corresponding template, the issue was introduced between dev35 and dev36.

@kakos-k9: If you don't need any of the features in the newer Toga versions, you can work around the problem as follows:
* `pip install briefcase==0.3.9` (since you're affected by [#1603](https://github.com/beeware/toga/issues/1603))
* Edit pyproject.toml to set the versions of toga-core and toga-android to `==0.3.0.dev35` -- note `==`, not `>=`.
* If you've made any manual edits to your "android" directory, rename it or save a copy elsewhere.
* Run `briefcase create`.
I was able to run the application with ScrollContainer correctly using briefcase 0.3.10

I used it this way you said, using the "==" in the toga-android version code.

I used toga-android dev34 and it worked.

The scroll container is now normal with toga-android dev34

Resolving patch:
diff --git a/src/android/toga_android/widgets/scrollcontainer.py b/src/android/toga_android/widgets/scrollcontainer.py
--- a/src/android/toga_android/widgets/scrollcontainer.py
+++ b/src/android/toga_android/widgets/scrollcontainer.py
@@ -59,7 +59,7 @@ def create(self):
             self.set_content(self.interface.content)
 
     def set_content(self, widget):
-        widget.viewport = AndroidViewport(widget.native)
+        widget.viewport = AndroidViewport(self.native)
         content_view_params = LinearLayout__LayoutParams(
             LinearLayout__LayoutParams.MATCH_PARENT,
             LinearLayout__LayoutParams.MATCH_PARENT


Test patch: