diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 8d2df47..c3bf4f7 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -12,6 +12,12 @@ + diff --git a/.idea/misc.xml b/.idea/misc.xml index 3651b66..e980d11 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -37,13 +37,30 @@ - + + \ No newline at end of file diff --git a/app/app.iml b/app/app.iml index 1ffcd0a..e7b7b5f 100644 --- a/app/app.iml +++ b/app/app.iml @@ -64,14 +64,6 @@ - - - - - - - - @@ -80,6 +72,14 @@ + + + + + + + + @@ -89,12 +89,16 @@ + + + + diff --git a/app/build.gradle b/app/build.gradle index 335cda4..bce6bb7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,7 +4,7 @@ compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { - applicationId "nl.smart.connet.dummyand" + applicationId "nl.digital_me.dummyandroidapp" minSdkVersion 10 targetSdkVersion 23 versionCode 1 diff --git a/app/src/androidTest/java/nl/digital_me/dummyandroidapp/ApplicationTest.java b/app/src/androidTest/java/nl/digital_me/dummyandroidapp/ApplicationTest.java new file mode 100644 index 0000000..d434c9d --- /dev/null +++ b/app/src/androidTest/java/nl/digital_me/dummyandroidapp/ApplicationTest.java @@ -0,0 +1,13 @@ +package nl.digital_me.dummyandroidapp; + +import android.app.Application; +import android.test.ApplicationTestCase; + +/** + * Testing Fundamentals + */ +public class ApplicationTest extends ApplicationTestCase { + public ApplicationTest() { + super(Application.class); + } +} \ No newline at end of file diff --git a/app/src/androidTest/java/nl/smart/connect/dummyand/ApplicationTest.java b/app/src/androidTest/java/nl/smart/connect/dummyand/ApplicationTest.java deleted file mode 100644 index a5ab9a1..0000000 --- a/app/src/androidTest/java/nl/smart/connect/dummyand/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package nl.smart.connect.dummyand; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 17b938c..6b7c22b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,6 +1,6 @@ + package="nl.digital_me.dummyandroidapp" > + android:value="nl.digital_me.dummyandroidapp.BrowseCard" /> diff --git a/app/src/main/java/nl/digital_me/dummyandroidapp/BrowseCard.java b/app/src/main/java/nl/digital_me/dummyandroidapp/BrowseCard.java new file mode 100644 index 0000000..99ec62a --- /dev/null +++ b/app/src/main/java/nl/digital_me/dummyandroidapp/BrowseCard.java @@ -0,0 +1,184 @@ +package nl.digital_me.dummyandroidapp; + +import android.content.Intent; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; + +import android.support.v4.app.Fragment; +import android.support.v4.app.FragmentManager; +import android.support.v4.app.FragmentPagerAdapter; +import android.support.v4.view.ViewPager; +import android.os.Bundle; +import android.view.LayoutInflater; +import android.view.Menu; +import android.view.MenuItem; +import android.view.View; +import android.view.ViewGroup; + +import android.widget.EditText; +import android.widget.TextView; + +import java.util.logging.Logger; + +public class BrowseCard extends AppCompatActivity { + + /** + * The {@link android.support.v4.view.PagerAdapter} that will provide + * fragments for each of the sections. We use a + * {@link FragmentPagerAdapter} derivative, which will keep every + * loaded fragment in memory. If this becomes too memory intensive, it + * may be best to switch to a + * {@link android.support.v4.app.FragmentStatePagerAdapter}. + */ + private SectionsPagerAdapter mSectionsPagerAdapter; + + /** + * The {@link ViewPager} that will host the section contents. + */ + private ViewPager mViewPager; + + public final static String EXTRA_MESSAGE = "nl.digital_me.dummyandroidapp.MESSAGE"; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_browse_card); + + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); + setSupportActionBar(toolbar); + // Create the adapter that will return a fragment for each of the three + // primary sections of the activity. + mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); + + // Set up the ViewPager with the sections adapter. + mViewPager = (ViewPager) findViewById(R.id.container); + mViewPager.setAdapter(mSectionsPagerAdapter); + +// FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); +// fab.setOnClickListener(new View.OnClickListener() { +// @Override +// public void onClick(View view) { +// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) +// .setAction("Action", null).show(); +// } +// }); + } + + @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_browse_card, 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); + } + + + /** + * A {@link FragmentPagerAdapter} that returns a fragment corresponding to + * one of the sections/tabs/pages. + */ + public class SectionsPagerAdapter extends FragmentPagerAdapter { + + public SectionsPagerAdapter(FragmentManager fm) { + super(fm); + } + + @Override + public Fragment getItem(int position) { + // getItem is called to instantiate the fragment for the given page. + // Return a PlaceholderFragment (defined as a static inner class below). + return PlaceholderFragment.newInstance(position + 1); + } + + @Override + public int getCount() { + // Show 3 total pages. + return 3; + } + + @Override + public CharSequence getPageTitle(int position) { + switch (position) { + case 0: + return "SECTION 1"; + case 1: + return "SECTION 2"; + case 2: + return "SECTION 3"; + } + return null; + } + } + + /** + * A placeholder fragment containing a simple view. + */ + public static class PlaceholderFragment extends Fragment { + /** + * The fragment argument representing the section number for this + * fragment. + */ + private static final String ARG_SECTION_NUMBER = "section_number"; + + /** + * Returns a new instance of this fragment for the given section + * number. + */ + public static PlaceholderFragment newInstance(int sectionNumber) { + PlaceholderFragment fragment = new PlaceholderFragment(); + Bundle args = new Bundle(); + args.putInt(ARG_SECTION_NUMBER, sectionNumber); + fragment.setArguments(args); + return fragment; + } + + public PlaceholderFragment() { + } + + @Override + public View onCreateView(LayoutInflater inflater, ViewGroup container, + Bundle savedInstanceState) { + View rootView = inflater.inflate(R.layout.fragment_browse_card, container, false); + TextView textView = (TextView) rootView.findViewById(R.id.section_label); + textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER))); + + EditText editText = (EditText) rootView.findViewById(R.id.edit_message); + String message = editText.getText().toString(); + message = message + "blabla"; + + editText.setText(message); + + return rootView; + } + } + + /** + * Called when the user clicks the Send/eMail button + */ + public void sendMessage(View view) { + // Do something in response to button + Intent intent = new Intent(this, DisplayMessageActivity.class); + //EditText editText = (EditText) view.findViewById(R.id.edit_message); + //EditText editText = (EditText) mViewPager.getCurrentItem() ).findViewById(R.id.edit_message); + //String message = editText.getText().toString(); + String message = "Item number = "; + intent.putExtra(EXTRA_MESSAGE, message); + startActivity(intent); + } +} diff --git a/app/src/main/java/nl/digital_me/dummyandroidapp/DisplayMessageActivity.java b/app/src/main/java/nl/digital_me/dummyandroidapp/DisplayMessageActivity.java new file mode 100644 index 0000000..02f952e --- /dev/null +++ b/app/src/main/java/nl/digital_me/dummyandroidapp/DisplayMessageActivity.java @@ -0,0 +1,30 @@ +package nl.digital_me.dummyandroidapp; + +import android.content.Intent; +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.design.widget.Snackbar; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; +import android.view.View; +import android.widget.TextView; + +public class DisplayMessageActivity extends AppCompatActivity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Get the message from the intent + Intent intent = getIntent(); + String message = intent.getStringExtra(BrowseCard.EXTRA_MESSAGE); + + // Create the text view + TextView textView = new TextView(this); + textView.setTextSize(40); + textView.setText(message); + + // Set the text view as the activity layout + setContentView(textView); + } +} diff --git a/app/src/main/java/nl/smart/connect/dummyand/BrowseCard.java b/app/src/main/java/nl/smart/connect/dummyand/BrowseCard.java deleted file mode 100644 index 904a9d8..0000000 --- a/app/src/main/java/nl/smart/connect/dummyand/BrowseCard.java +++ /dev/null @@ -1,184 +0,0 @@ -package nl.smart.connect.dummyand; - -import android.content.Intent; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.Snackbar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; - -import android.support.v4.app.Fragment; -import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentPagerAdapter; -import android.support.v4.view.ViewPager; -import android.os.Bundle; -import android.view.LayoutInflater; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; -import android.view.ViewGroup; - -import android.widget.EditText; -import android.widget.TextView; - -import java.util.logging.Logger; - -public class BrowseCard extends AppCompatActivity { - - /** - * The {@link android.support.v4.view.PagerAdapter} that will provide - * fragments for each of the sections. We use a - * {@link FragmentPagerAdapter} derivative, which will keep every - * loaded fragment in memory. If this becomes too memory intensive, it - * may be best to switch to a - * {@link android.support.v4.app.FragmentStatePagerAdapter}. - */ - private SectionsPagerAdapter mSectionsPagerAdapter; - - /** - * The {@link ViewPager} that will host the section contents. - */ - private ViewPager mViewPager; - - public final static String EXTRA_MESSAGE = "nl.smart.connect.dummyand.MESSAGE"; - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_browse_card); - - Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - // Create the adapter that will return a fragment for each of the three - // primary sections of the activity. - mSectionsPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager()); - - // Set up the ViewPager with the sections adapter. - mViewPager = (ViewPager) findViewById(R.id.container); - mViewPager.setAdapter(mSectionsPagerAdapter); - -// FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab); -// fab.setOnClickListener(new View.OnClickListener() { -// @Override -// public void onClick(View view) { -// Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) -// .setAction("Action", null).show(); -// } -// }); - } - - @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_browse_card, 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); - } - - - /** - * A {@link FragmentPagerAdapter} that returns a fragment corresponding to - * one of the sections/tabs/pages. - */ - public class SectionsPagerAdapter extends FragmentPagerAdapter { - - public SectionsPagerAdapter(FragmentManager fm) { - super(fm); - } - - @Override - public Fragment getItem(int position) { - // getItem is called to instantiate the fragment for the given page. - // Return a PlaceholderFragment (defined as a static inner class below). - return PlaceholderFragment.newInstance(position + 1); - } - - @Override - public int getCount() { - // Show 3 total pages. - return 3; - } - - @Override - public CharSequence getPageTitle(int position) { - switch (position) { - case 0: - return "SECTION 1"; - case 1: - return "SECTION 2"; - case 2: - return "SECTION 3"; - } - return null; - } - } - - /** - * A placeholder fragment containing a simple view. - */ - public static class PlaceholderFragment extends Fragment { - /** - * The fragment argument representing the section number for this - * fragment. - */ - private static final String ARG_SECTION_NUMBER = "section_number"; - - /** - * Returns a new instance of this fragment for the given section - * number. - */ - public static PlaceholderFragment newInstance(int sectionNumber) { - PlaceholderFragment fragment = new PlaceholderFragment(); - Bundle args = new Bundle(); - args.putInt(ARG_SECTION_NUMBER, sectionNumber); - fragment.setArguments(args); - return fragment; - } - - public PlaceholderFragment() { - } - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_browse_card, container, false); - TextView textView = (TextView) rootView.findViewById(R.id.section_label); - textView.setText(getString(R.string.section_format, getArguments().getInt(ARG_SECTION_NUMBER))); - - EditText editText = (EditText) rootView.findViewById(R.id.edit_message); - String message = editText.getText().toString(); - message = message + "blabla"; - - editText.setText(message); - - return rootView; - } - } - - /** - * Called when the user clicks the Send/eMail button - */ - public void sendMessage(View view) { - // Do something in response to button - Intent intent = new Intent(this, DisplayMessageActivity.class); - //EditText editText = (EditText) view.findViewById(R.id.edit_message); - //EditText editText = (EditText) mViewPager.getCurrentItem() ).findViewById(R.id.edit_message); - //String message = editText.getText().toString(); - String message = "Item number = "; - intent.putExtra(EXTRA_MESSAGE, message); - startActivity(intent); - } -} diff --git a/app/src/main/java/nl/smart/connect/dummyand/DisplayMessageActivity.java b/app/src/main/java/nl/smart/connect/dummyand/DisplayMessageActivity.java deleted file mode 100644 index 51aa4cc..0000000 --- a/app/src/main/java/nl/smart/connect/dummyand/DisplayMessageActivity.java +++ /dev/null @@ -1,30 +0,0 @@ -package nl.smart.connect.dummyand; - -import android.content.Intent; -import android.os.Bundle; -import android.support.design.widget.FloatingActionButton; -import android.support.design.widget.Snackbar; -import android.support.v7.app.AppCompatActivity; -import android.support.v7.widget.Toolbar; -import android.view.View; -import android.widget.TextView; - -public class DisplayMessageActivity extends AppCompatActivity { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - // Get the message from the intent - Intent intent = getIntent(); - String message = intent.getStringExtra(BrowseCard.EXTRA_MESSAGE); - - // Create the text view - TextView textView = new TextView(this); - textView.setTextSize(40); - textView.setText(message); - - // Set the text view as the activity layout - setContentView(textView); - } -} diff --git a/app/src/main/res/layout/activity_display_message.xml b/app/src/main/res/layout/activity_display_message.xml index 4aa1439..8f72e13 100644 --- a/app/src/main/res/layout/activity_display_message.xml +++ b/app/src/main/res/layout/activity_display_message.xml @@ -4,7 +4,7 @@ xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" - tools:context="nl.smart.connect.dummyand.DisplayMessageActivity"> + tools:context="nl.digital_me.dummyandroidapp.DisplayMessageActivity"> diff --git a/app/src/main/res/layout/content_display_message.xml b/app/src/main/res/layout/content_display_message.xml index 8df96e8..e810210 100644 --- a/app/src/main/res/layout/content_display_message.xml +++ b/app/src/main/res/layout/content_display_message.xml @@ -8,6 +8,6 @@ android:paddingBottom="@dimen/activity_vertical_margin" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:showIn="@layout/activity_display_message" - tools:context="nl.smart.connect.dummyand.DisplayMessageActivity"> + tools:context="nl.digital_me.dummyandroidapp.DisplayMessageActivity"> diff --git a/app/src/test/java/nl/digital_me/dummyandroidapp/ExampleUnitTest.java b/app/src/test/java/nl/digital_me/dummyandroidapp/ExampleUnitTest.java new file mode 100644 index 0000000..91ce6df --- /dev/null +++ b/app/src/test/java/nl/digital_me/dummyandroidapp/ExampleUnitTest.java @@ -0,0 +1,15 @@ +package nl.digital_me.dummyandroidapp; + +import org.junit.Test; + +import static org.junit.Assert.*; + +/** + * To work on unit tests, switch the Test Artifact in the Build Variants view. + */ +public class ExampleUnitTest { + @Test + public void addition_isCorrect() throws Exception { + assertEquals(4, 2 + 2); + } +} diff --git a/app/src/test/java/nl/smart/connect/dummyand/ExampleUnitTest.java b/app/src/test/java/nl/smart/connect/dummyand/ExampleUnitTest.java deleted file mode 100644 index ee728fd..0000000 --- a/app/src/test/java/nl/smart/connect/dummyand/ExampleUnitTest.java +++ /dev/null @@ -1,15 +0,0 @@ -package nl.smart.connect.dummyand; - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * To work on unit tests, switch the Test Artifact in the Build Variants view. - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} diff --git a/fastlane/Appfile b/fastlane/Appfile index 0d5fef9..098efb1 100644 --- a/fastlane/Appfile +++ b/fastlane/Appfile @@ -1,2 +1,2 @@ json_key_file "~/GoogleAPICredentials.json" -package_name "nl.smart.connect.dummyand" # e.g. com.krausefx.app +package_name "nl.digital_me.dummyandroidapp" # e.g. com.krausefx.app