diff --git a/.gitignore b/.gitignore index be3bcf9..b28d810 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,7 @@ /build /captures .idea - +project +*.sbt +*.scala +target diff --git a/app/app.iml b/app/app.iml deleted file mode 100644 index c58955c..0000000 --- a/app/app.iml +++ /dev/null @@ -1,96 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index e42f36c..98b399c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 22 + compileSdkVersion 23 buildToolsVersion "22.0.1" defaultConfig { applicationId "net.headlezz.udacity.appportfolio" minSdkVersion 15 - targetSdkVersion 22 + targetSdkVersion 23 versionCode 1 versionName "1.0" } @@ -21,5 +21,5 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - compile 'com.android.support:appcompat-v7:23.0.0' + compile 'com.android.support:appcompat-v7:23.1.0' } diff --git a/app/src/main/java/net/headlezz/appportfolio/MainActivity.java b/app/src/main/java/net/headlezz/appportfolio/MainActivity.java index 7e6cb32..9b04bd9 100644 --- a/app/src/main/java/net/headlezz/appportfolio/MainActivity.java +++ b/app/src/main/java/net/headlezz/appportfolio/MainActivity.java @@ -1,9 +1,11 @@ package net.headlezz.appportfolio; -import android.support.v7.app.AppCompatActivity; import android.os.Bundle; +import android.support.v7.app.AppCompatActivity; import android.view.Menu; -import android.view.MenuItem; +import android.view.View; +import android.widget.Button; +import android.widget.Toast; public class MainActivity extends AppCompatActivity { @@ -11,27 +13,21 @@ public class MainActivity extends AppCompatActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); + setTitle(getString(net.headlezz.appportfolio.R.string.title)); } @Override public boolean onCreateOptionsMenu(Menu menu) { - // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; } - @Override - public boolean onOptionsItemSelected(MenuItem item) { - // Handle action bar item clicks here. The action bar will - // automatically handle clicks on the Home/Up button, so long - // as you specify a parent activity in AndroidManifest.xml. - int id = item.getItemId(); - - //noinspection SimplifiableIfStatement - if (id == R.id.action_settings) { - return true; - } - - return super.onOptionsItemSelected(item); + /** + * Main menu button click listener method + * @param view Pressed button + */ + public void onClick(View view) { + String buttonName = ((Button) view).getText().toString(); + Toast.makeText(this, String.format(getString(R.string.button_click_message), buttonName), Toast.LENGTH_SHORT).show(); } } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index a1038df..57f3e9e 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -13,38 +13,50 @@ android:layout_marginBottom="48dp" android:textAppearance="?android:attr/textAppearanceLarge" android:textStyle="bold" - android:text="@string/activity_main_button_title" + android:text="@string/header" android:layout_width="wrap_content" android:layout_height="wrap_content" />