Skip to content

Instantly share code, notes, and snippets.

View borisdamato's full-sized avatar

Boris D'Amato borisdamato

  • Warner Bros. Discovery
  • London, UK
View GitHub Profile
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:context="com.example.android.justjava.MainActivity">
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
/**
/**
* Create a new message that specifies the city name and temperature
*/
private String createWeatherMessage() {
return "Welcome to San Francisco where the temperature is 77°F";
}
@borisdamato
borisdamato / Option A
Created April 18, 2016 15:39 — forked from udacityandroid/Option A
Android Development for Beginners : Calculate the Price Method
/**
* Calculates the price of the order based on the current quantity.
*
* @return the price
*/
private int calculate price(int quantity {
int price = quantity * 5;
return price;
}
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
import java.text.NumberFormat;
/**
@borisdamato
borisdamato / MainActivity.java
Last active April 13, 2016 21:16 — forked from anonymous/MainActivity.java
Android Study Jam - Lezione 2 - GDG Bari
package com.example.android.justjava;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;
/**
* This app displays an order form to order coffee.
*/
@borisdamato
borisdamato / Option A
Created April 13, 2016 19:01 — forked from anonymous/Option A
3 options for the layout of an activity for a quiz question
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity">