diff --git a/app/build.gradle b/app/build.gradle
index 90332bf..90b8fb6 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -28,4 +28,5 @@ dependencies {
testImplementation 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:design:25.4.0'
+ compile 'com.getbase:floatingactionbutton:1.10.1'
}
diff --git a/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java b/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java
index d576b06..0b2510e 100644
--- a/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java
+++ b/app/src/main/java/com/codigoparallevar/minicards/CanvasView.java
@@ -265,4 +265,9 @@ class CanvasView extends View {
}
return null;
}
+
+ public void addPart(Part part) {
+ parts.add(part);
+ invalidate();
+ }
}
diff --git a/app/src/main/java/com/codigoparallevar/minicards/MainActivity.java b/app/src/main/java/com/codigoparallevar/minicards/MainActivity.java
index a25d52d..5635fb9 100644
--- a/app/src/main/java/com/codigoparallevar/minicards/MainActivity.java
+++ b/app/src/main/java/com/codigoparallevar/minicards/MainActivity.java
@@ -1,5 +1,6 @@
package com.codigoparallevar.minicards;
+import android.graphics.Canvas;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.ActionBar;
@@ -8,10 +9,16 @@ import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
+import android.widget.Button;
+
+import com.codigoparallevar.minicards.parts.buttons.RoundButton;
+import com.getbase.floatingactionbutton.AddFloatingActionButton;
public class MainActivity extends AppCompatActivity {
CanvasView canvasView;
+ com.getbase.floatingactionbutton.AddFloatingActionButton AddPartButton;
+ com.getbase.floatingactionbutton.FloatingActionButton SetDevModeButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -23,19 +30,29 @@ public class MainActivity extends AppCompatActivity {
actionBar.hide();
}
- // Use controled canvas
setContentView(R.layout.activity_main);
+ // Use manually controlled canvas
canvasView = (CanvasView) findViewById(R.id.canvasView);
- FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
- fab.setOnClickListener(new View.OnClickListener() {
+
+ // Set callbacks to fab buttons
+ AddPartButton = (com.getbase.floatingactionbutton.AddFloatingActionButton)
+ findViewById(R.id.add_part_button);
+ AddPartButton.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();
+ public void onClick(View v) {
+ Snackbar.make(v, "Add part", Snackbar.LENGTH_SHORT).show();
}
});
+ SetDevModeButton = (com.getbase.floatingactionbutton.FloatingActionButton)
+ findViewById(R.id.set_developer_mode_button);
+ SetDevModeButton.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Snackbar.make(v, "Set dev mode", Snackbar.LENGTH_SHORT).show();
+ }
+ });
}
@Override
diff --git a/app/src/main/res/drawable/fab_label_background.xml b/app/src/main/res/drawable/fab_label_background.xml
new file mode 100644
index 0000000..0d8c05b
--- /dev/null
+++ b/app/src/main/res/drawable/fab_label_background.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 4c4dde7..efa9f15 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -1,7 +1,9 @@
-
@@ -27,14 +29,41 @@
android:layout_width="match_parent"
android:layout_height="match_parent" />
-
-
-
+ fab:fab_addButtonColorNormal="@color/white"
+ fab:fab_addButtonColorPressed="@color/white_pressed"
+ fab:fab_addButtonPlusIconColor="@color/half_black"
+ fab:fab_addButtonSize="mini"
+ fab:fab_labelStyle="@style/menu_labels_style"
+ fab:fab_labelsPosition="left">
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml
index 60b47b3..707f98f 100644
--- a/app/src/main/res/values/colors.xml
+++ b/app/src/main/res/values/colors.xml
@@ -3,4 +3,14 @@
#066996
#044563
#b2ff59
+
+ #B2000000
+ #e5e5e5
+ #808080
+ #fafafa
+ #f1f1f1
+ #e91e63
+ #ec407a
+ #805677fc
+ #80738ffe
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 5885930..1fbb834 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -8,4 +8,9 @@
- @color/colorAccent
+
+