Skip to content

Commit

Permalink
submission changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Znith committed Oct 7, 2016
1 parent 0e76b70 commit 9b04956
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 12 deletions.
29 changes: 28 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 41 additions & 2 deletions app/src/main/java/udacity/firstproject/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,51 @@

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

public class MainActivity extends AppCompatActivity implements View.OnClickListener{
private Button btn1,btn2,btn3,btn4,btn5,btn6;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btn1=(Button)findViewById(R.id.btn_1);
btn2=(Button)findViewById(R.id.btn_2);
btn3=(Button)findViewById(R.id.btn_3);
btn4=(Button)findViewById(R.id.btn_4);
btn5=(Button)findViewById(R.id.btn_5);
btn6=(Button)findViewById(R.id.btn_6);
btn1.setOnClickListener(this);
btn2.setOnClickListener(this);
btn3.setOnClickListener(this);
btn4.setOnClickListener(this);
btn5.setOnClickListener(this);
btn6.setOnClickListener(this);
}

@Override
public void onClick(View v) {
switch(v.getId()){
case R.id.btn_1:
Toast.makeText(this,"This button will launch my popular movies app!",Toast.LENGTH_SHORT).show();
break;
case R.id.btn_2:
Toast.makeText(this,"This button will launch my stock hawk app!",Toast.LENGTH_SHORT).show();
break;
case R.id.btn_3:
Toast.makeText(this,"This button will launch my build it bigger app!",Toast.LENGTH_SHORT).show();
break;
case R.id.btn_4:
Toast.makeText(this,"This button will launch my make your app material app!",Toast.LENGTH_SHORT).show();
break;
case R.id.btn_5:
Toast.makeText(this,"This button will launch my go ubiquitous app!",Toast.LENGTH_SHORT).show();
break;
case R.id.btn_6:
Toast.makeText(this,"This button will launch my capstone app!",Toast.LENGTH_SHORT).show();
break;
}
}
}
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/button_style.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
android:thickness="0dp">
<!--<stroke-->
<!--android:width="1dp"-->
<!--android:color="#FFFFFF" />-->
<solid android:color="@color/colorPrimary" />
<corners android:radius="0dp" />
</shape>
95 changes: 89 additions & 6 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,100 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
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="udacity.firstproject.MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</RelativeLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"></LinearLayout>

<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginTop="20dp"
android:layout_weight="6"
android:orientation="vertical">

<TextView
android:layout_width="match_parent"
android:layout_height="30dp"
android:text="My Nanodegree Apps!"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="@dimen/title_text_size" />

<Button
android:id="@+id/btn_1"
android:layout_width="match_parent"
android:layout_height="@dimen/button_height"
android:layout_marginTop="10dp"
android:background="@drawable/button_style"
android:text="@string/btn_1"
android:textColor="@color/white"
android:textSize="@dimen/button_text_size" />

<Button
android:id="@+id/btn_2"
android:layout_width="match_parent"
android:layout_height="@dimen/button_height"
android:layout_marginTop="10dp"
android:background="@drawable/button_style"
android:text="@string/btn_2"
android:textColor="@color/white"
android:textSize="@dimen/button_text_size" />

<Button
android:id="@+id/btn_3"
android:layout_width="match_parent"
android:layout_height="@dimen/button_height"
android:layout_marginTop="10dp"
android:background="@drawable/button_style"
android:text="@string/btn_3"
android:textColor="@color/white"
android:textSize="@dimen/button_text_size" />

<Button
android:id="@+id/btn_4"
android:layout_width="match_parent"
android:layout_height="@dimen/button_height"
android:layout_marginTop="10dp"
android:background="@drawable/button_style"
android:text="@string/btn_4"
android:textColor="@color/white"
android:textSize="@dimen/button_text_size" />

<Button
android:id="@+id/btn_5"
android:layout_width="match_parent"
android:layout_height="@dimen/button_height"
android:layout_marginTop="10dp"
android:background="@drawable/button_style"
android:text="@string/btn_5"
android:textColor="@color/white"
android:textSize="@dimen/button_text_size" />

<Button
android:id="@+id/btn_6"
android:layout_width="match_parent"
android:layout_height="@dimen/button_height"
android:layout_marginTop="10dp"
android:background="@drawable/button_style"
android:text="@string/btn_6"
android:textColor="@color/white"
android:textSize="@dimen/button_text_size" />
</LinearLayout>

<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2"></LinearLayout>

</LinearLayout>
10 changes: 7 additions & 3 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
<color name="colorPrimary">#2E3D49</color>
<color name="colorPrimaryDark">#2E3D49</color>
<color name="colorAccent">#00B2E6</color>

<color name="white">#FFFFFF</color>
<color name="black">#000000</color>

</resources>
3 changes: 3 additions & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="button_height">50dp</dimen>
<dimen name="button_text_size">15sp</dimen>
<dimen name="title_text_size">20sp</dimen>
</resources>
8 changes: 8 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<resources>
<string name="app_name">FirstProject</string>


<string name="btn_1">POPULAR MOVIES</string>
<string name="btn_2">STOCK HAWK</string>
<string name="btn_3">BUILD IT BIGGER</string>
<string name="btn_4">MAKE YOUR APP MATERIAL</string>
<string name="btn_5">GO UBIQUITOUS</string>
<string name="btn_6">CAPSTONE</string>
</resources>

0 comments on commit 9b04956

Please sign in to comment.