I don't know what I'm doing :D

This commit is contained in:
kdeschuy
2017-07-28 00:07:40 +02:00
parent fed0dbff87
commit 8ca216a4ac
31 changed files with 132 additions and 81 deletions

2
.idea/misc.xml generated
View File

@@ -37,7 +37,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

2
.idea/modules.xml generated
View File

@@ -2,8 +2,8 @@
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/Stoofnogaan.iml" filepath="$PROJECT_DIR$/Stoofnogaan.iml" />
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
<module fileurl="file://$PROJECT_DIR$/stoofnogaan.iml" filepath="$PROJECT_DIR$/stoofnogaan.iml" />
</modules>
</component>
</project>

View File

@@ -1,26 +0,0 @@
package be.mathsaey.stoofnogaan;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("be.mathsaey.stoofnogaan", appContext.getPackageName());
}
}

View File

@@ -4,9 +4,9 @@
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/stoofinbrand_icon"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/stoofinbrand_icon"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">

Binary file not shown.

View File

@@ -2,11 +2,13 @@ package be.mathsaey.stoofnogaan;
import android.app.Activity;
import android.content.Context;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import java.io.BufferedReader;
import java.io.FileInputStream;

View File

@@ -1,11 +1,14 @@
package be.mathsaey.stoofnogaan;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.inputmethod.EditorInfo;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.TextView;
class TaskView extends LinearLayout {
private MainActivity parent;
@@ -50,16 +53,17 @@ class TaskView extends LinearLayout {
private void addTextListeners() {
// When done is clicked...
// Or not because that is when things start to go boom
// textView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
// @Override
// public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
// if (i == EditorInfo.IME_ACTION_DONE && TaskView.this.isEmpty()) {
// parent.deleteTask(TaskView.this);
// return true;
// }
// return false;
// }
// });
textView.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView textView, int i, KeyEvent keyEvent) {
if (i == EditorInfo.IME_ACTION_DONE && TaskView.this.isEmpty()) {
parent.deleteTask(TaskView.this);
return true;
}
return false;
}
});
// Or when we lose focus
textView.setOnFocusChangeListener(new OnFocusChangeListener() {
@Override

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<item>
<shape>
<!-- set the shadow color here -->
<stroke
android:width="2dp"
android:color="#3e1a01" />
<padding
android:bottom="2dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
<corners android:radius="3dp" />
</shape>
</item>
<!-- Background -->
<item>
<shape>
<solid android:color="@color/colorBrown" />
<corners android:radius="3dp" />
</shape>
</item>
</layer-list>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<item>
<shape>
<!-- set the shadow color here -->
<stroke
android:width="2dp"
android:color="@color/colorDropShadow" />
<padding
android:bottom="2dp"
android:left="0dp"
android:right="2dp"
android:top="0dp" />
<corners android:radius="3dp" />
</shape>
</item>
<!-- Background -->
<item>
<shape>
<solid android:color="@color/colorWhite" />
<corners android:radius="3dp" />
</shape>
</item>
</layer-list>

View File

@@ -5,20 +5,40 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorLight"
android:padding="52dp"
android:paddingTop="102dp"
tools:context="be.mathsaey.stoofnogaan.MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/drop_shadow"
android:paddingBottom="16dp"
android:orientation="vertical">
<LinearLayout
android:id="@+id/tasks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp"
android:layout_above="@+id/addButton">
</LinearLayout>
<Button
android:id="@+id/addButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:onClick="onNewTaskButtonClick"
android:text="@string/task_new"
android:onClick="onNewTaskButtonClick"/>
android:background="@drawable/button"
android:layout_alignParentBottom="true"
android:paddingLeft="52dp"
android:paddingRight="52dp"
android:layout_centerHorizontal="true">
</Button>
</RelativeLayout>
</LinearLayout>

View File

@@ -9,12 +9,15 @@
android:id="@+id/checkBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@null"/>
android:text="@null">
</CheckBox>
<EditText
android:id="@+id/textView"
android:inputType="text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/task_hint"/>
android:hint="@string/task_hint">
</EditText>
</LinearLayout>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android"/>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:title="@string/settings_text"
android:icon="@android:drawable/ic_menu_preferences"
android:showAsAction="always"/>
android:icon="@mipmap/stoofinbrand_icon"
android:showAsAction="always">
</item>
</menu>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@@ -1,6 +1,9 @@
<?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="colorWhite">#FFF</color>
<color name="colorLight">#FFF8E1</color>
<color name="colorOrange">#FF7F2A</color>
<color name="colorTeak">#5FD3BC</color>
<color name="colorDropShadow">#E6DDBF</color>
<color name="colorBrown">#552200</color>
</resources>

View File

@@ -1,7 +1,7 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="android:Theme.Material.Light.DarkActionBar">
<style name="AppTheme" parent="android:Theme.Holo.NoActionBar">
<!-- Customize your theme here. -->
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@@ -1,17 +0,0 @@
package be.mathsaey.stoofnogaan;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}