Skip to content

Instantly share code, notes, and snippets.

View AndrewEQ's full-sized avatar

Andrew Quan AndrewEQ

  • Red Blueprint Tech (@rbtech)
  • Johannesburg, South Africa
View GitHub Profile
@AndrewEQ
AndrewEQ / myapp.unoproj
Created October 4, 2020 14:29
Full example of using round adaptive icon
"Android": {
"Defines": [
"USE_ROUND_ADAPTIVE_ICON"
],
"Icons": {
"MDPI": "Assets/Icons/Android/mipmap-mdpi/icon.png",
"HDPI": "Assets/Icons/Android/mipmap-hdpi/icon.png",
"XHDPI": "Assets/Icons/Android/mipmap-xhdpi/icon.png",
"XXHDPI": "Assets/Icons/Android/mipmap-xxhdpi/icon.png",
"XXXHDPI": "Assets/Icons/Android/mipmap-xxxhdpi/icon.png",
@AndrewEQ
AndrewEQ / my app.unoproj
Last active October 4, 2020 14:26
Example of using defines in the fuse project
"Android": {
"Defines": [
"USE_ADAPTIVE_ICON"
],
"Icons": {
/* ... */
}
}
// or when using the round version...
@AndrewEQ
AndrewEQ / myapp.unoproj
Last active October 4, 2020 14:27
Uno Project Configuration for Android Round Adaptive Icons
"Android": {
"Icons": {
"MDPI": "Assets/Icons/Android/mipmap-mdpi/icon.png",
"HDPI": "Assets/Icons/Android/mipmap-hdpi/icon.png",
"XHDPI": "Assets/Icons/Android/mipmap-xhdpi/icon.png",
"XXHDPI": "Assets/Icons/Android/mipmap-xxhdpi/icon.png",
"XXXHDPI": "Assets/Icons/Android/mipmap-xxxhdpi/icon.png",
"ANYDPI_v26": "Assets/Icons/Android/mipmap-anydpi-v26/icon.xml",
"foreground": "Assets/Icons/Android/drawable/icon_foreground.xml",
"background": "Assets/Icons/Android/drawable/icon_background.xml",
@AndrewEQ
AndrewEQ / myapp.unoproj
Last active October 4, 2020 14:27
Uno Project Configuration for Android Adaptive Icons
"Android": {
"Icons": {
"MDPI": "Assets/Icons/Android/mipmap-mdpi/icon.png",
"HDPI": "Assets/Icons/Android/mipmap-hdpi/icon.png",
"XHDPI": "Assets/Icons/Android/mipmap-xhdpi/icon.png",
"XXHDPI": "Assets/Icons/Android/mipmap-xxhdpi/icon.png",
"XXXHDPI": "Assets/Icons/Android/mipmap-xxxhdpi/icon.png",
"ANYDPI_v26": "Assets/Icons/Android/mipmap-anydpi-v26/icon.xml",
"foreground": "Assets/Icons/Android/drawable/icon_foreground.xml",
"background": "Assets/Icons/Android/drawable/icon_background.xml"
@AndrewEQ
AndrewEQ / MainView.ux
Created February 15, 2019 13:25
UX Example Code
<App>
<!-- I set some default values of the class -->
<Panel ux:Class="rbt.QuoteText" Padding="10" FontSize="32" TextAlignment="Left">
<!-- Some properties of the Class -->
<string ux:Property="TextIn" />
<string ux:Property="TextAlignment" />
<int ux:Property="FontSize" />
<bool ux:Property="IsAuthor" />
@AndrewEQ
AndrewEQ / android_share_paths.xml
Created February 1, 2019 08:56
android_share_paths.xml
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<cache-path name="cache" path="." />
<files-path name="files" path="." />
<external-cache-path name="external_cache_images" path="images" />
<cache-path name="cache_images" path="images" />
</paths>
@AndrewEQ
AndrewEQ / android_share.xml
Last active February 1, 2019 12:37
android_share.uxl
<Extensions Backend="CPlusPlus">
<CopyFile Condition="Android" Name="android_share_paths.xml" TargetName="app/src/main/res/xml/android_share_paths.xml" />
</Extensions>
@AndrewEQ
AndrewEQ / list_of_xml_tags_for_fileprovider_paths.csv
Last active February 1, 2019 07:40
List of XML tags for FileProvider paths
XML tag Corresponding storage call When to use
<files-path> Context.getFilesDir() Data can only be viewed by app. Deleted when uninstalled (/data/data/[packagename]/files).
<external-files-dir> Context.getExternalFilesDir() Data can be read/write by the app. Any apps granted with READ_STORAGE permission can read too. Deleted when uninstalled (/Android/data/[packagename]/files).
<cache-path> Context.getCacheDir() Temporary file storage.
<external-path> Environment.getExternalStoragePublicDirectory() Data can be read/write by the app. Any apps can view. Files not deleted when uninstalled.
<external-cache-path> Context.getExternalCacheDir() Temporary file storage with usually larger space.
<!-- Prevent FOUC (flash of unstyled content) - http://johnpolacek.com/2012/10/03/help-prevent-fouc/ -->
<style type="text/css"> .no-fouc {display: none;} </style>
<noscript><style type="text/css"> .no-fouc { display: inline; } </style></noscript>
<!-- place in head or end of body -->
<script type="text/javascript">
document.documentElement.className = 'no-fouc';
// add to document ready: $('.no-fouc').removeClass('no-fouc');
</script>