This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Color { | |
static var forExampleMyDarkRed: Color { | |
return Color(hue: 1.0, saturation: 1.0, brightness: 0.6, opacity: 0.8) | |
} | |
init(hex: String) { | |
let scanner = Scanner(string: hex) | |
_ = scanner.scanString("#") // Skip the '#' prefix if present | |
var rgb: UInt64 = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Conditional compile for macOs and iOS code. | |
ScrollViewReader { scrollView in | |
ScrollView { | |
List { | |
ForEach(items, id: \.self) { item in | |
Text(item) | |
} | |
} | |
.onChange(of: selectedItem) { newValue in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SwiftUI | |
class OrientationObserver: NSObject { | |
let action: (UIDeviceOrientation) -> Void | |
init(action: @escaping (UIDeviceOrientation) -> Void) { | |
self.action = action | |
super.init() | |
registerForOrientationChanges() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import SwiftUI | |
struct Calculator: View { | |
func fmtDouble(dbl: Double) -> String? { | |
let formatter = NumberFormatter() | |
formatter.numberStyle = .currencyAccounting | |
formatter.minimumFractionDigits = 3 | |
formatter.formatWidth = 70 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mobidawg.android.beta.studylocaldatetime | |
import android.os.Bundle | |
import androidx.activity.ComponentActivity | |
import androidx.activity.compose.setContent | |
import androidx.compose.foundation.background | |
import androidx.compose.foundation.border | |
import androidx.compose.foundation.layout.* | |
import androidx.compose.material3.MaterialTheme | |
import androidx.compose.material3.Surface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'dart:async'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(new MaterialApp( | |
home: new MyApp())); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// NOTE: Need some yamspec.yml to complete from a default configuration. | |
import 'dart:convert'; | |
import 'package:flutter/material.dart'; | |
import 'package:http/http.dart' as http; | |
import 'dart:async'; | |
import 'dart:io'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DashboardFragment : Fragment() { | |
private lateinit var dashboardViewModel: DashboardViewModel | |
private var btnPodcast: Button? = null | |
override fun onCreateView( | |
inflater: LayoutInflater, | |
container: ViewGroup?, | |
savedInstanceState: Bundle? | |
): View? { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private val msec = 1000L | |
private val hsec = 100L | |
private val delaySplash: Long = 2 * msec + 8 * hsec | |
Timer("splash_delay").schedule( delaySplash) { | |
intent = Intent(applicationContext, SignonActivity::class.java) | |
startActivity(intent) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<img src='data:image/tiff;base64, <manually paste tiff encoded as base64 here>' /> | |
</body> | |
</html> |
NewerOlder