Skip to content

Instantly share code, notes, and snippets.

import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
<resources>
<string name="app_name">PrepA9FB</string>
<string name="msg_status">Status</string>
<string name="msg_email">E-mail:</string>
<string name="msg_email_address">E-mail address</string>
<string name="msg_password">Password:</string>
<string name="hint_password">Password</string>
<string name="btn_createAccount">Create account (e-mail)</string>
<string name="btn_signIn">Sign In (e-mail)</string>
<string name="btn_logout">Logout (e-mail)</string>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="UsingOnClickInXml"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollView"
tools:context=".MainActivity">
<LinearLayout
private fun showInfo(content : String) {
val json = JSONObject(content)
val sb = StringBuilder("Weather information:\n")
json.getJSONObject("location").let {
sb.append("City: ${it["name"]},${it["country"]}\n")
}
json.getJSONObject("current").let {
sb.append("Current temp: ${it["temp_c"]}\n")
@Filmaluco
Filmaluco / fragment_second.xml
Created November 25, 2022 11:45
fragment_second
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<ScrollView
companion object {
private const val TAG = "MainActivity"
private const val API_KEY = ""
private const val URL = "https://api.weatherapi.com/v1/forecast.json?" +
"key=$API_KEY&q=Coimbra&days=2&aqi=no&alerts=no"
}
@Filmaluco
Filmaluco / activity_main.xml
Created November 11, 2022 17:07
switch_compat
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swLock"
android:checked="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|top"
android:layout_margin="8dp"
android:background="#80ffffff"
android:fontFamily="monospace"
android:padding="8dp"
@Filmaluco
Filmaluco / teste_constrant_layout.xml
Created November 11, 2022 10:40
teste constraint layout test constraint layout
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView15"
android:layout_width="wrap_content"