diff --git a/app/src/main/assets/fonts/FunnyKid.ttf b/app/src/main/assets/fonts/FunnyKid.ttf new file mode 100644 index 0000000..754ee19 Binary files /dev/null and b/app/src/main/assets/fonts/FunnyKid.ttf differ diff --git a/app/src/main/java/com/example/raffaele/testapp/MainActivity.java b/app/src/main/java/com/example/raffaele/testapp/MainActivity.java index 0d0d6eb..2301d91 100644 --- a/app/src/main/java/com/example/raffaele/testapp/MainActivity.java +++ b/app/src/main/java/com/example/raffaele/testapp/MainActivity.java @@ -1,12 +1,15 @@ 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 { @@ -14,11 +17,19 @@ public class MainActivity extends ActionBarActivity { 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) { diff --git a/app/src/main/java/com/example/raffaele/testapp/Score_page.java b/app/src/main/java/com/example/raffaele/testapp/Score_page.java index 7f22591..aa4d91a 100644 --- a/app/src/main/java/com/example/raffaele/testapp/Score_page.java +++ b/app/src/main/java/com/example/raffaele/testapp/Score_page.java @@ -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()); + } } diff --git a/app/src/main/java/com/example/raffaele/testapp/Welcome_student.java b/app/src/main/java/com/example/raffaele/testapp/Welcome_student.java index 1478ee7..d6fac40 100644 --- a/app/src/main/java/com/example/raffaele/testapp/Welcome_student.java +++ b/app/src/main/java/com/example/raffaele/testapp/Welcome_student.java @@ -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; @@ -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. @@ -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); + } } diff --git a/app/src/main/res/drawable/ic_login.png b/app/src/main/res/drawable/ic_login.png new file mode 100644 index 0000000..4c50163 Binary files /dev/null and b/app/src/main/res/drawable/ic_login.png differ diff --git a/app/src/main/res/drawable/ic_questions.png b/app/src/main/res/drawable/ic_questions.png new file mode 100644 index 0000000..e4f47c7 Binary files /dev/null and b/app/src/main/res/drawable/ic_questions.png differ diff --git a/app/src/main/res/drawable/ic_score.png b/app/src/main/res/drawable/ic_score.png new file mode 100644 index 0000000..ab9fcd0 Binary files /dev/null and b/app/src/main/res/drawable/ic_score.png differ diff --git a/app/src/main/res/drawable/ic_signup.png b/app/src/main/res/drawable/ic_signup.png new file mode 100644 index 0000000..bc9208e Binary files /dev/null and b/app/src/main/res/drawable/ic_signup.png differ diff --git a/app/src/main/res/drawable/ic_topic.png b/app/src/main/res/drawable/ic_topic.png new file mode 100644 index 0000000..8302f24 Binary files /dev/null and b/app/src/main/res/drawable/ic_topic.png differ diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml new file mode 100644 index 0000000..2126df8 --- /dev/null +++ b/app/src/main/res/layout-land/activity_main.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout-land/activity_welcome_student.xml b/app/src/main/res/layout-land/activity_welcome_student.xml new file mode 100644 index 0000000..fafed4e --- /dev/null +++ b/app/src/main/res/layout-land/activity_welcome_student.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout-port/activity_main.xml b/app/src/main/res/layout-port/activity_main.xml new file mode 100644 index 0000000..03f64dd --- /dev/null +++ b/app/src/main/res/layout-port/activity_main.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/layout/activity_welcome_student.xml b/app/src/main/res/layout-port/activity_welcome_student.xml similarity index 76% rename from app/src/main/res/layout/activity_welcome_student.xml rename to app/src/main/res/layout-port/activity_welcome_student.xml index 822f679..3100b1b 100644 --- a/app/src/main/res/layout/activity_welcome_student.xml +++ b/app/src/main/res/layout-port/activity_welcome_student.xml @@ -12,7 +12,8 @@ android:layout_height="wrap_content" android:layout_alignTop="@+id/imageView" android:layout_toRightOf="@+id/imageView" - android:layout_toEndOf="@+id/imageView"> + android:layout_toEndOf="@+id/imageView" + android:id="@+id/tableLayout"> -