This file contains 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 'dart:math'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
This file contains 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
<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> |
This file contains 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
<?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 |
This file contains 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 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") |
This file contains 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
<?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 |
This file contains 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
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" | |
} |
This file contains 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
<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" |
This file contains 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
<?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" |
NewerOlder