diff --git a/app/src/main/java/com/hisham/design/CoordinatorLayoutActivity.java b/app/src/main/java/com/hisham/design/CoordinatorLayoutActivity.java index 7e9597a..4a06e59 100644 --- a/app/src/main/java/com/hisham/design/CoordinatorLayoutActivity.java +++ b/app/src/main/java/com/hisham/design/CoordinatorLayoutActivity.java @@ -119,18 +119,12 @@ public void onClick(View v) { parentLayoutCo = findViewById(R.id.parentLayout); - - - floatingButtonCo.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Snackbar.make(coordinatorLayout, "You clicked on floating button.", Snackbar.LENGTH_LONG).show(); } }); - - - } @Override diff --git a/app/src/main/java/com/hisham/design/FloatingActionButtonActivity.java b/app/src/main/java/com/hisham/design/FloatingActionButtonActivity.java index 3f4ca37..9ff32e0 100644 --- a/app/src/main/java/com/hisham/design/FloatingActionButtonActivity.java +++ b/app/src/main/java/com/hisham/design/FloatingActionButtonActivity.java @@ -92,11 +92,11 @@ protected void onCreate(Bundle savedInstanceState) { floatingButon.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { - final Snackbar snackbar = Snackbar.make(parentLayout, "You just clicked",Snackbar.LENGTH_LONG); + final Snackbar snackbar = Snackbar.make(parentLayout, "You just clicked", Snackbar.LENGTH_LONG); // snackbar.setDuration(10); snackbar.setAction("Dismiss", new View.OnClickListener() { @Override - public void onClick(View v) { + public void onClick(View v1) { snackbar.dismiss(); } }); diff --git a/app/src/main/res/layout/floating_center_button.xml b/app/src/main/res/layout/floating_center_button.xml new file mode 100644 index 0000000..64979dc --- /dev/null +++ b/app/src/main/res/layout/floating_center_button.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + +