Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
paoValle committed Apr 4, 2015
2 parents c1fc1d4 + 115a6c3 commit 84ff3d2
Show file tree
Hide file tree
Showing 18 changed files with 795 additions and 119 deletions.
Binary file added app/src/main/assets/fonts/FunnyKid.ttf
Binary file not shown.
19 changes: 15 additions & 4 deletions app/src/main/java/com/example/raffaele/testapp/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,24 +1,35 @@
package com.example.raffaele.testapp;

import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Typeface;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;

public class MainActivity extends ActionBarActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);



try {
((TextView)findViewById(R.id.usernameLabel)).setTypeface(Typeface.createFromAsset(getAssets(), "fonts/FunnyKid.ttf"));
((TextView)findViewById(R.id.passwordLabel)).setTypeface(Typeface.createFromAsset(getAssets(), "fonts/FunnyKid.ttf"));
} catch (Exception e) {
e.printStackTrace();
}
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
// TODO Auto-generated method stub
super.onConfigurationChanged(newConfig);
setContentView(R.layout.activity_main); //al cambiamento della configurazione dello schermo refresha il layout
}


@Override
public boolean onCreateOptionsMenu(Menu menu) {
Expand Down
16 changes: 9 additions & 7 deletions app/src/main/java/com/example/raffaele/testapp/Score_page.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_score_page);
Intent i = getIntent();
Bundle extras=i.getExtras();
this.correct = extras.getParcelable("Correct");
this.wrong=extras.getParcelable("Wrong");
//imposto valori di nome,cognome e scuola in view
((TextView)findViewById(R.id.CorrectC)).setText(correct.StringValue());
((TextView)findViewById(R.id.WrongC)).setText(wrong.StringValue());
((TextView) findViewById(R.id.AnsweredC)).setText(correct.StringValue());

if(this.correct!=null || this.correct!=null) {
//TODO: Qui si dovrebbe inserire il getscore totale se il campo passato non è null (ciru ce pienz tu :) )
this.correct = extras.getParcelable("Correct");
this.wrong = extras.getParcelable("Wrong");
//imposto valori di nome,cognome e scuola in view
((TextView) findViewById(R.id.CorrectC)).setText(correct.StringValue());
((TextView) findViewById(R.id.WrongC)).setText(wrong.StringValue());
((TextView) findViewById(R.id.AnsweredC)).setText(correct.StringValue());
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
Expand Down Expand Up @@ -29,7 +30,12 @@ protected void onCreate(Bundle savedInstanceState) {
((TextView)findViewById(R.id.school)).setText(utente.getSchool());
argumentList=null;
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
// TODO Auto-generated method stub
super.onConfigurationChanged(newConfig);
setContentView(R.layout.activity_welcome_student); //al cambiamento della configurazione dello schermo refresha il layout
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
Expand Down Expand Up @@ -102,6 +108,9 @@ public void toArgument(View v) {
startActivityForResult(i, 0);

}

public void onScore(View v ) {
Intent i = new Intent(this, Score_page.class);
startActivity(i);
}

}
Binary file added app/src/main/res/drawable/ic_login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_questions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_score.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_signup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/res/drawable/ic_topic.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
111 changes: 111 additions & 0 deletions app/src/main/res/layout-land/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
<RelativeLayout 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:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin" tools:context=".MainActivity"
android:id="@+id/MainActivity">

<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:id="@+id/tableLayout2">

<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Username"
android:id="@+id/usernameLabel"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textSize="40dp"
android:layout_column="0"
android:textColor="#ff1e00ff" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/username"
android:layout_alignParentTop="true"
android:layout_alignLeft="@+id/password"
android:layout_alignStart="@+id/password"
android:layout_above="@+id/password"
android:layout_alignRight="@+id/password"
android:layout_alignEnd="@+id/password"
android:textSize="40dp"
android:text="root"
android:layout_column="1"
android:layout_marginLeft="73dip" />
</TableRow>

<TableRow
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Password"
android:id="@+id/passwordLabel"
android:textSize="40dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/RegisterButton"
android:layout_toStartOf="@+id/RegisterButton"
android:layout_column="0"
android:textColor="#ff1e00ff" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/password"
android:textSize="40dp"
android:layout_below="@+id/usernameLabel"
android:layout_toRightOf="@+id/usernameLabel"
android:layout_marginLeft="73dp"
android:layout_marginStart="73dp"
android:text="rootroot"
android:layout_column="1" />

</TableRow>

</TableLayout>

<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/tableLayout2">

<ImageButton
android:layout_width="180dip"
android:layout_height="60dip"
android:id="@+id/RegisterButton"
android:layout_alignTop="@+id/loginButton"
android:layout_toLeftOf="@+id/loginButton"
android:layout_toStartOf="@+id/loginButton"
android:onClick="Register"
android:background="@drawable/ic_signup" />

<ImageButton
android:layout_width="180dip"
android:layout_height="60dip"
android:id="@+id/loginButton"
android:onClick="onStartClick"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:background="@drawable/ic_login"
android:layout_alignParentStart="false" />
</RelativeLayout>

</RelativeLayout>
114 changes: 114 additions & 0 deletions app/src/main/res/layout-land/activity_welcome_student.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:minHeight="350dp"
android:minWidth="350dp"
tools:context=".welcome_student">

<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/imageView"
android:layout_toRightOf="@+id/imageView"
android:layout_toEndOf="@+id/imageView"
android:id="@+id/tableLayout">

<TextView
android:layout_width="wrap_content"
android:layout_height="37dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="first_name"
android:id="@+id/first_name"
android:layout_alignTop="@+id/imageView"
android:layout_toRightOf="@+id/imageView"
android:layout_toEndOf="@+id/imageView"
android:textSize="20dp"
android:minHeight="80dp"
android:layout_row="2"
android:layout_column="1" />

<TextView
android:layout_width="wrap_content"
android:layout_height="33dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="last_name"
android:id="@+id/last_name"
android:layout_below="@+id/first_name"
android:layout_alignLeft="@+id/first_name"
android:layout_alignStart="@+id/first_name"
android:textSize="20dp"
android:minHeight="80dp"
android:layout_row="3"
android:layout_column="1" />

<TextView
android:layout_width="wrap_content"
android:layout_height="31dp"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="school"
android:id="@+id/school"
android:layout_below="@+id/last_name"
android:layout_alignLeft="@+id/last_name"
android:layout_alignStart="@+id/last_name"
android:minHeight="80dp"
android:textSize="20dp"
android:layout_row="4"
android:layout_column="1" />
</TableLayout>

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/imageView"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="42dp"
android:layout_marginStart="42dp"
android:layout_marginTop="44dp"
android:src="@mipmap/ic_contact"
android:minHeight="100dp"
android:minWidth="100dp"
android:layout_row="1"
android:layout_column="0"
android:maxHeight="100dp"
android:maxWidth="100dp" />

<ImageButton
android:layout_width="200dip"
android:layout_height="60dip"
android:id="@+id/QuestionButton"
android:background="@drawable/ic_questions"
android:nestedScrollingEnabled="false"
android:onClick="toQuestion"
android:layout_marginRight="20dp"
android:layout_marginEnd="57dp"
android:layout_marginBottom="30dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />

<ImageButton
android:layout_width="150dip"
android:layout_height="60dip"
android:id="@+id/ScoreButton"
android:background="@drawable/ic_score"
android:onClick="onScore"
android:layout_alignTop="@+id/tableLayout"
android:layout_alignRight="@+id/QuestionButton"
android:layout_alignEnd="@+id/QuestionButton" />

<ImageButton
android:layout_width="200dip"
android:layout_height="60dip"
android:id="@+id/button2"
android:onClick="toArgument"
android:background="@drawable/ic_topic"
android:layout_alignBottom="@+id/QuestionButton"
android:layout_alignLeft="@+id/imageView"
android:layout_alignStart="@+id/imageView" />


</RelativeLayout>
Loading

0 comments on commit 84ff3d2

Please sign in to comment.