Преглед изворни кода

adjust sample UI, update README

callmepeanut пре 10 година
родитељ
комит
e7aa033e56

+ 12 - 2
README.md

@@ -1,9 +1,19 @@
-# FloatingActionMenu
+#NEW README
+---
+This is a fork from https://github.com/TristanWiley/FloatingActionMenu, I modified it to support both  circle and line menu.
+The sample shows how to use it.
+## Example
+![](http://7lrzvb.com1.z0.glb.clouddn.com/test07.gif)
+
+
+#ORIGIN README
+---
+## FloatingActionMenu
 I got the original code from douo here - gist.github.com/douo/dfde289778a9b3b6918f
 
 I modified the code so it looks better, there's spacing between the buttons.  See the example on how to use it.
 
-# How to Use
+## How to Use
 
 1. Like any other library, put this in your Android project and add it as a dependency.
 2. You can also use jitpack.io if you want to use Maven.

+ 1 - 0
example/src/main/java/terranovaproductions/newcomicreader/sample/DemoCircleMenuFragment.java

@@ -25,6 +25,7 @@ public class DemoCircleMenuFragment extends Fragment {
 
     private void initView(View v) {
         FloatingActionMenu menu = (FloatingActionMenu) v.findViewById(R.id.fab_menu_circle);
+        menu.setMultipleOfFB(3.2f);
         menu.setOnMenuItemClickListener(new FloatingActionMenu.OnMenuItemClickListener() {
             @Override
             public void onMenuItemClick(FloatingActionMenu fam, int index, FloatingActionButton item) {

+ 1 - 0
example/src/main/java/terranovaproductions/newcomicreader/sample/DemoLineMenuFragment.java

@@ -19,6 +19,7 @@ public class DemoLineMenuFragment extends Fragment {
         View v = inflater.inflate(R.layout.fragment_line_menu, container, false);
         FloatingActionMenu menu = (FloatingActionMenu) v.findViewById(R.id.fab_menu_line);
         menu.setIsCircle(false);
+        menu.setmItemGap(48);
         return v;
     }
 }

+ 4 - 3
example/src/main/res/layout/fragment_circle_menu.xml

@@ -2,14 +2,15 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:fab="http://schemas.android.com/apk/res-auto"
     android:orientation="vertical" android:layout_width="match_parent"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:background="@android:color/white">
 
     <terranovaproductions.newcomicreader.FloatingActionMenu
         android:id="@+id/fab_menu_circle"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:padding="16dp"
-        android:background="@android:color/holo_green_light">
+        android:layout_marginBottom="16dp"
+        android:layout_marginRight="16dp">
 
         <!--First button as menu button-->
         <android.support.design.widget.FloatingActionButton

+ 4 - 3
example/src/main/res/layout/fragment_line_menu.xml

@@ -2,14 +2,15 @@
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:orientation="vertical" android:layout_width="match_parent"
     xmlns:fab="http://schemas.android.com/apk/res-auto"
-    android:layout_height="match_parent">
+    android:layout_height="match_parent"
+    android:background="@android:color/holo_green_light">
 
     <terranovaproductions.newcomicreader.FloatingActionMenu
         android:id="@+id/fab_menu_line"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
-        android:padding="16dp"
-        android:background="@android:color/holo_green_light">
+        android:layout_marginBottom="16dp"
+        android:layout_marginRight="16dp">
 
         <!--First button as menu button-->
         <android.support.design.widget.FloatingActionButton