Purrty layouts
This commit is contained in:
@@ -25,5 +25,6 @@ dependencies {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
compile 'com.android.support.constraint:constraint-layout:1.0.2'
|
||||
compile 'com.google.android:flexbox:0.3.0'
|
||||
testCompile 'junit:junit:4.12'
|
||||
}
|
||||
|
||||
@@ -24,9 +24,13 @@ public class MainActivity extends Activity {
|
||||
taskView = findViewById(R.id.tasks);
|
||||
loadTasks();
|
||||
|
||||
Button button = (Button) findViewById(R.id.addButton);
|
||||
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
|
||||
|
||||
31
app/src/main/res/drawable/button_secondary.xml
Normal file
31
app/src/main/res/drawable/button_secondary.xml
Normal 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>
|
||||
@@ -1,60 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
<com.google.android.flexbox.FlexboxLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
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">
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/settings_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:layout_gravity="end"
|
||||
android:src="@android:drawable/ic_menu_manage" />
|
||||
|
||||
<RelativeLayout
|
||||
<!-- Header -->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginBottom="16dp">
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp">
|
||||
|
||||
</RelativeLayout>
|
||||
<ImageButton
|
||||
android:id="@+id/settings_button"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@null"
|
||||
android:src="@android:drawable/ic_menu_manage">
|
||||
</ImageButton>
|
||||
|
||||
<RelativeLayout
|
||||
</LinearLayout>
|
||||
|
||||
<!-- TaskView -->
|
||||
<LinearLayout
|
||||
android:id="@+id/tasks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="475dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/drop_shadow"
|
||||
android:paddingBottom="32dp"
|
||||
android:orientation="vertical">
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
app:layout_flexGrow="1">
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tasks"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:padding="16dp"
|
||||
android:layout_above="@+id/addButton">
|
||||
</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
|
||||
android:id="@+id/addButton"
|
||||
android:layout_width="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:text="@string/task_new"
|
||||
android:background="@drawable/button"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:textColor="#7c7656"
|
||||
android:paddingLeft="52dp"
|
||||
android:paddingRight="52dp"
|
||||
android:layout_centerHorizontal="true">
|
||||
android:textColor="#7c7656">
|
||||
</Button>
|
||||
|
||||
</RelativeLayout>
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<string name="app_name">Stoof nog aan?</string>
|
||||
<string name="task_new">Nieuwe 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="taken_text">Nieuwe Stoof</string>
|
||||
|
||||
Reference in New Issue
Block a user