Skip to content

Commit

Permalink
Aggiunti pulsanti nell'activity Login main e aggiunto supporto a riso…
Browse files Browse the repository at this point in the history
…luzioni tablet/smartphone in landscape/portrait
  • Loading branch information
ilaria170895 committed Apr 3, 2015
1 parent 80bf181 commit 6b0aa9f
Show file tree
Hide file tree
Showing 8 changed files with 393 additions and 78 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example.raffaele.testapp;

import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
Expand All @@ -18,7 +19,12 @@ protected void onCreate(Bundle savedInstanceState) {


}

@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
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_signup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 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,109 @@
<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" />

<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" />

<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>
84 changes: 84 additions & 0 deletions app/src/main/res/layout-port/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<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">

<ImageButton
android:layout_width="160dip"
android:layout_height="60dip"
android:id="@+id/loginButton"
android:onClick="onStartClick"
android:background="@drawable/ic_login"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"
android:layout_marginBottom="20dip" />

<ImageButton
android:layout_width="160dip"
android:layout_height="60dip"
android:id="@+id/RegisterButton"
android:onClick="Register"
android:background="@drawable/ic_signup"
android:layout_below="@+id/linearLayout"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="20dip" />

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_above="@+id/loginButton"
android:id="@+id/linearLayout">

<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="60dp" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/username"
android:textSize="60dp"
android:text="root"
android:layout_below="@+id/usernameLabel"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />

<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="60dp"
android:layout_below="@+id/password"
android:layout_alignRight="@+id/usernameLabel"
android:layout_alignEnd="@+id/usernameLabel" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/password"
android:textSize="60dp"
android:text="rootroot"
android:layout_above="@+id/loginButton"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginBottom="91dp" />

</LinearLayout>

</RelativeLayout>
109 changes: 109 additions & 0 deletions app/src/main/res/layout-sw600dp-land/activity_main.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<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="60dp"
android:layout_column="0" />

<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="60dp"
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="60dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/RegisterButton"
android:layout_toStartOf="@+id/RegisterButton"
android:layout_column="0" />

<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPassword"
android:ems="10"
android:id="@+id/password"
android:textSize="60dp"
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="200dip"
android:layout_height="70dip"
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="200dip"
android:layout_height="70dip"
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>
Loading

0 comments on commit 6b0aa9f

Please sign in to comment.