Purrty layouts

This commit is contained in:
kdeschuy
2017-07-28 18:45:44 +02:00
parent 2e175acb51
commit fc175aa9e8
7 changed files with 95 additions and 38 deletions

2
.idea/modules.xml generated
View File

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

View File

@@ -25,5 +25,6 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android:flexbox:0.3.0'
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
} }

View File

@@ -24,9 +24,13 @@ public class MainActivity extends Activity {
taskView = findViewById(R.id.tasks); taskView = findViewById(R.id.tasks);
loadTasks(); loadTasks();
Button button = (Button) findViewById(R.id.addButton);
Typeface custom_font = Typeface.createFromAsset(getAssets(), "fonts/Oswald-SemiBold.ttf"); Typeface custom_font = Typeface.createFromAsset(getAssets(), "fonts/Oswald-SemiBold.ttf");
button.setTypeface(custom_font);
Button addButton = (Button) findViewById(R.id.addButton);
addButton.setTypeface(custom_font);
Button resetButton = (Button) findViewById(R.id.resetButton);
resetButton.setTypeface(custom_font);
} }
@Override @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="@color/colorDropShadow" />
<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/colorWhite" />
<corners android:radius="3dp" />
</shape>
</item>
</layer-list>

View File

@@ -1,60 +1,81 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <com.google.android.flexbox.FlexboxLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorLight" android:background="@color/colorLight"
android:padding="20dp" android:paddingLeft="16dp"
android:paddingRight="16dp"
app:flexDirection="column"
app:justifyContent="space_around"
app:alignItems="center"
tools:context="ui.MainActivity"> tools:context="ui.MainActivity">
<!-- Header -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="8dp"
android:paddingBottom="8dp">
<ImageButton <ImageButton
android:id="@+id/settings_button" android:id="@+id/settings_button"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@null" android:background="@null"
android:layout_gravity="end" android:src="@android:drawable/ic_menu_manage">
android:src="@android:drawable/ic_menu_manage" /> </ImageButton>
<RelativeLayout </LinearLayout>
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="16dp">
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="475dp"
android:background="@drawable/drop_shadow"
android:paddingBottom="32dp"
android:orientation="vertical">
<!-- TaskView -->
<LinearLayout <LinearLayout
android:id="@+id/tasks" android:id="@+id/tasks"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:background="@drawable/drop_shadow"
android:orientation="vertical" android:orientation="vertical"
android:padding="16dp" android:padding="16dp"
android:layout_above="@+id/addButton"> app:layout_flexGrow="1">
</LinearLayout> </LinearLayout>
<!-- Buttons at bottom -->
<com.google.android.flexbox.FlexboxLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="8dp"
android:paddingBottom="8dp"
app:justifyContent="space_around">
<Button
android:id="@+id/resetButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_flexBasisPercent="45%"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:background="@drawable/button_secondary"
android:onClick="onResetTaskButtonClick"
android:text="@string/task_reset"
android:textColor="#7c7656">
</Button>
<Button <Button
android:id="@+id/addButton" android:id="@+id/addButton"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_flexBasisPercent="45%"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:background="@drawable/button_primary"
android:onClick="onNewTaskButtonClick" android:onClick="onNewTaskButtonClick"
android:text="@string/task_new" android:text="@string/task_new"
android:background="@drawable/button" android:textColor="#7c7656">
android:layout_alignParentBottom="true"
android:textColor="#7c7656"
android:paddingLeft="52dp"
android:paddingRight="52dp"
android:layout_centerHorizontal="true">
</Button> </Button>
</RelativeLayout> </com.google.android.flexbox.FlexboxLayout>
</LinearLayout> </com.google.android.flexbox.FlexboxLayout>

View File

@@ -2,7 +2,7 @@
<string name="app_name">Stoof nog aan?</string> <string name="app_name">Stoof nog aan?</string>
<string name="task_new">Nieuwe Stoof</string> <string name="task_new">Nieuwe Stoof</string>
<string name="task_hint">Lege Stoof</string> <string name="task_hint">Lege Stoof</string>
<string name="task_reset">Weg Stoof</string>
<string name="settings_text">Stoof Instellen</string> <string name="settings_text">Stoof Instellen</string>
<string name="taken_text">Nieuwe Stoof</string> <string name="taken_text">Nieuwe Stoof</string>