Pixiewood: init Android version - #44
Conversation
| */ | ||
|
|
||
| window * { | ||
| font-weight: 700; |
There was a problem hiding this comment.
default android font is very thin and broken on some phones, making it bold fixes it
| </key> | ||
| <key name="vertical-layout" type="b"> | ||
| <default>false</default> | ||
| <default>true</default> |
There was a problem hiding this comment.
vertical looks better on portrait devices by default, make it conditional on android
|
|
||
| <requires> | ||
| <display_length compare="ge">360</display_length> | ||
| <internet>always</internet> |
There was a problem hiding this comment.
needed for pixiewood to request the network permission on android
| secrets = Secrets.get_default (); | ||
|
|
||
| system_language = DeepLUtils.detect_system (); | ||
| system_language = "EN-GB"; //DeepLUtils.detect_system (); |
There was a problem hiding this comment.
can't detect system lang, assume english, todo conditional on android
|
|
||
| construct { | ||
| schema = new Secret.Schema (APP_ID, Secret.SchemaFlags.NONE, | ||
| schema = new Secret.Schema (APP_ID, Secret.SchemaFlags.DONT_MATCH_NAME, |
| }; | ||
|
|
||
| var instruction = new Granite.HeaderLabel (_("To be able to do translations, paste your API Key in the field below")) { | ||
| var instruction = new Granite.HeaderLabel (_("API Key")) { |
There was a problem hiding this comment.
only reason was that the string was too long. In general that whole dialog just doesn't fit on mobile because the labels dont wrap
| #if ANDROID | ||
| GLib.Environment.set_variable ("SECRET_BACKEND", "file", false); | ||
| if (GLib.Environment.get_variable ("SECRET_BACKEND") == "file") | ||
| GLib.Environment.set_variable ("SECRET_FILE_TEST_PASSWORD", @"$(GLib.Environment.get_user_name ())", false); |
There was a problem hiding this comment.
Okay so, on Linux, libsecret uses the keyring, but on Android (and Windows), this forces it to use the "file backend". Usually this is encrypted with a password, but one of the patches removes the encryption because it's annoying to build on android
| GLib.Environment.set_variable ("SECRET_BACKEND", "file", false); | ||
| if (GLib.Environment.get_variable ("SECRET_BACKEND") == "file") | ||
| GLib.Environment.set_variable ("SECRET_FILE_TEST_PASSWORD", @"$(GLib.Environment.get_user_name ())", false); | ||
| g_io_openssl_load (null); |
There was a problem hiding this comment.
needed to load the statically linked gio module (google doesn't approve of loading them dynamically)
| dependency ('libsoup-3.0'), | ||
| dependency ('libsecret-1') | ||
| dependency ('libsecret-1'), | ||
| dependency('gioopenssl', required: host_machine.system() == 'android') |
Same as elly-code/jorts#144 but with some dep diffs I'll comment on. Parts are from Tuba, the OpenSSL patch is not written by me, I'll have to do proper attribution.