From 317ebf6c805a30bb20ef232257b414484914d787 Mon Sep 17 00:00:00 2001 From: bowyer-app Date: Thu, 6 Aug 2015 21:25:19 +0900 Subject: [PATCH 01/11] add bottom sheet --- .../demo/MainActivity.java | 32 +- demo/src/main/res/layout/activity_main.xml | 29 ++ .../BottomSheetLayout.java | 441 ++++++++++++++++++ .../main/res/layout/bottom_sheet_layout.xml | 27 ++ .../src/main/res/layout/sheet_layout.xml | 28 +- 5 files changed, 550 insertions(+), 7 deletions(-) create mode 100644 fabtransitionlayout/src/main/java/com/bowyer/app/fabtransitionlayout/BottomSheetLayout.java create mode 100644 fabtransitionlayout/src/main/res/layout/bottom_sheet_layout.xml diff --git a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java index 6ba947b..c225fd2 100644 --- a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java +++ b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java @@ -1,5 +1,6 @@ package com.bowyer.fabtransitionlayout.demo; +import com.bowyer.app.fabtransitionlayout.BottomSheetLayout; import com.bowyer.app.fabtransitionlayout.FooterLayout; import com.github.ksoichiro.android.observablescrollview.ObservableListView; import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; @@ -8,14 +9,13 @@ import android.animation.Animator; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; +import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.ActionBarActivity; -import android.os.Bundle; -import android.view.Menu; -import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.ImageView; +import android.widget.ListView; import java.util.ArrayList; import java.util.List; @@ -31,8 +31,15 @@ public class MainActivity extends ActionBarActivity implements ObservableScrollV ObservableListView mObservableListView; @InjectView(R.id.fabtoolbar) FooterLayout mFabToolbar; + @InjectView(R.id.fablist) + BottomSheetLayout mFooterLayout; + @InjectView(R.id.list_menu) + ListView mListView; + @InjectView(R.id.fab) FloatingActionButton mFab; + @InjectView(R.id.fab_left) + FloatingActionButton mFabLeft; @InjectView(R.id.ic_call) ImageView mIcCall; @@ -47,9 +54,21 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_main); ButterKnife.inject(this); initListView(); + initListMenu(); mFabToolbar.setFab(mFab); + mFooterLayout.setFab(mFabLeft); } + private void initListMenu(){ + List menu = new ArrayList<>(); + menu.add("Share"); + menu.add("Upload"); + menu.add("Fav"); + ArrayAdapter adapter = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, menu); + mListView.setAdapter(adapter); + + } private void initListView() { List list = new ArrayList(100); for (int i = 0; i < 100; i++) { @@ -76,8 +95,10 @@ public void onDownMotionEvent() { public void onUpOrCancelMotionEvent(ScrollState scrollState) { if (scrollState == ScrollState.UP) { mFabToolbar.slideOutFab(); + mFooterLayout.slideOutFab(); } else if (scrollState == ScrollState.DOWN) { mFabToolbar.slideInFab(); + mFooterLayout.slideInFab(); } } @@ -86,6 +107,11 @@ void onFabClick() { mFabToolbar.expandFab(); } + @OnClick(R.id.fab_left) + void onFabLeftClick(){ + mFooterLayout.expandFab(); + } + @OnClick(R.id.call) void onClickCall() { iconAnim(mIcCall); diff --git a/demo/src/main/res/layout/activity_main.xml b/demo/src/main/res/layout/activity_main.xml index 44c271d..4665db1 100644 --- a/demo/src/main/res/layout/activity_main.xml +++ b/demo/src/main/res/layout/activity_main.xml @@ -18,11 +18,40 @@ android:layout_gravity="bottom|end" android:layout_marginBottom="32dp" android:layout_marginRight="32dp" + android:visibility="invisible" android:src="@drawable/ic_add_white_24dp" app:borderWidth="0dp" app:fabSize="normal" app:rippleColor="@color/primary" /> + + + + + + + + + + + + + diff --git a/fabtransitionlayout/src/main/res/layout/sheet_layout.xml b/fabtransitionlayout/src/main/res/layout/sheet_layout.xml index ab8ed1a..35a6d8e 100644 --- a/fabtransitionlayout/src/main/res/layout/sheet_layout.xml +++ b/fabtransitionlayout/src/main/res/layout/sheet_layout.xml @@ -1,7 +1,27 @@ - + + + + + From 00f3a63a8575f393ac689ba4912d7dd1da372dde Mon Sep 17 00:00:00 2001 From: bowyer-app Date: Fri, 7 Aug 2015 00:25:21 +0900 Subject: [PATCH 02/11] add bottom sheet layout --- demo/build.gradle | 12 +-- demo/src/main/AndroidManifest.xml | 19 ++-- .../demo/BottomSheetDemoActivity.java | 77 ++++++++++++++++ .../demo/MainActivity.java | 36 ++++++-- .../demo/adapter/BottomSheetAdapter.java | 82 ++++++++++++++++++ .../demo/model/BottomSheet.java | 50 +++++++++++ .../res/drawable-hdpi/ic_add_white_24dp.png | Bin 223 -> 0 bytes .../res/drawable-hdpi/ic_call_white_36dp.png | Bin 491 -> 0 bytes .../res/drawable-hdpi/ic_email_white_36dp.png | Bin 385 -> 0 bytes .../res/drawable-hdpi/ic_forum_white_36dp.png | Bin 263 -> 0 bytes .../res/drawable-mdpi/ic_add_white_24dp.png | Bin 174 -> 0 bytes .../res/drawable-mdpi/ic_call_white_36dp.png | Bin 340 -> 0 bytes .../res/drawable-mdpi/ic_email_white_36dp.png | Bin 277 -> 0 bytes .../res/drawable-mdpi/ic_forum_white_36dp.png | Bin 192 -> 0 bytes .../ic_account_circle_white_24dp.png | Bin 0 -> 632 bytes .../drawable-xhdpi/ic_build_white_24dp.png | Bin 0 -> 344 bytes .../drawable-xhdpi/ic_drafts_white_24dp.png | Bin 0 -> 509 bytes .../ic_account_circle_white_24dp.png | Bin 0 -> 909 bytes .../drawable-xxhdpi/ic_build_white_24dp.png | Bin 0 -> 547 bytes .../drawable-xxhdpi/ic_drafts_white_24dp.png | Bin 0 -> 717 bytes .../ic_account_circle_white_24dp.png | Bin 0 -> 1206 bytes .../drawable-xxxhdpi/ic_build_white_24dp.png | Bin 0 -> 655 bytes .../drawable-xxxhdpi/ic_drafts_white_24dp.png | Bin 0 -> 953 bytes .../main/res/layout/activity_bottom_sheet.xml | 43 +++++++++ .../main/res/layout/row_item_bottom_sheet.xml | 23 +++++ demo/src/main/res/values/dimens.xml | 2 + fabtransitionlayout/build.gradle | 12 +-- gradle.properties | 6 ++ 28 files changed, 332 insertions(+), 30 deletions(-) create mode 100644 demo/src/main/java/com/bowyer/fabtransitionlayout/demo/BottomSheetDemoActivity.java create mode 100644 demo/src/main/java/com/bowyer/fabtransitionlayout/demo/adapter/BottomSheetAdapter.java create mode 100644 demo/src/main/java/com/bowyer/fabtransitionlayout/demo/model/BottomSheet.java delete mode 100644 demo/src/main/res/drawable-hdpi/ic_add_white_24dp.png delete mode 100644 demo/src/main/res/drawable-hdpi/ic_call_white_36dp.png delete mode 100644 demo/src/main/res/drawable-hdpi/ic_email_white_36dp.png delete mode 100644 demo/src/main/res/drawable-hdpi/ic_forum_white_36dp.png delete mode 100644 demo/src/main/res/drawable-mdpi/ic_add_white_24dp.png delete mode 100644 demo/src/main/res/drawable-mdpi/ic_call_white_36dp.png delete mode 100644 demo/src/main/res/drawable-mdpi/ic_email_white_36dp.png delete mode 100644 demo/src/main/res/drawable-mdpi/ic_forum_white_36dp.png create mode 100644 demo/src/main/res/drawable-xhdpi/ic_account_circle_white_24dp.png create mode 100644 demo/src/main/res/drawable-xhdpi/ic_build_white_24dp.png create mode 100644 demo/src/main/res/drawable-xhdpi/ic_drafts_white_24dp.png create mode 100644 demo/src/main/res/drawable-xxhdpi/ic_account_circle_white_24dp.png create mode 100644 demo/src/main/res/drawable-xxhdpi/ic_build_white_24dp.png create mode 100644 demo/src/main/res/drawable-xxhdpi/ic_drafts_white_24dp.png create mode 100644 demo/src/main/res/drawable-xxxhdpi/ic_account_circle_white_24dp.png create mode 100644 demo/src/main/res/drawable-xxxhdpi/ic_build_white_24dp.png create mode 100644 demo/src/main/res/drawable-xxxhdpi/ic_drafts_white_24dp.png create mode 100644 demo/src/main/res/layout/activity_bottom_sheet.xml create mode 100644 demo/src/main/res/layout/row_item_bottom_sheet.xml diff --git a/demo/build.gradle b/demo/build.gradle index c23b1c7..15a0dda 100644 --- a/demo/build.gradle +++ b/demo/build.gradle @@ -1,15 +1,15 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" + compileSdkVersion COMPILE_SDK_VERSION as int + buildToolsVersion BUILD_TOOLS_VERSION defaultConfig { applicationId "com.bowyer.fabtransitionlayout.demo" - minSdkVersion 15 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" + minSdkVersion MIN_SDK_VERSION + targetSdkVersion TARGET_SDK_VERSION as int + versionCode VERSION_CODE as int + versionName VERSION_NAME } buildTypes { release { diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index e67cf83..695ffc2 100644 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -1,21 +1,22 @@ + package="com.bowyer.fabtransitionlayout.demo"> + android:allowBackup="true" + android:icon="@mipmap/ic_launcher" + android:label="@string/app_name" + android:theme="@style/AppTheme"> + android:name=".MainActivity" + android:label="@string/app_name"> - + - + + diff --git a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/BottomSheetDemoActivity.java b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/BottomSheetDemoActivity.java new file mode 100644 index 0000000..f894270 --- /dev/null +++ b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/BottomSheetDemoActivity.java @@ -0,0 +1,77 @@ +package com.bowyer.fabtransitionlayout.demo; + +import com.bowyer.app.fabtransitionlayout.BottomSheetLayout; +import com.bowyer.fabtransitionlayout.demo.adapter.BottomSheetAdapter; +import com.bowyer.fabtransitionlayout.demo.model.BottomSheet; +import com.github.ksoichiro.android.observablescrollview.ObservableListView; + +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.v7.app.ActionBarActivity; +import android.widget.ArrayAdapter; +import android.widget.ListView; + +import java.util.ArrayList; +import java.util.List; + +import butterknife.ButterKnife; +import butterknife.InjectView; +import butterknife.OnClick; + +/** + * Created by Bowyer on 15/08/07. + */ +public class BottomSheetDemoActivity extends ActionBarActivity { + + @InjectView(R.id.list_view) + ObservableListView mObservableListView; + + @InjectView(R.id.bottom_sheet) + BottomSheetLayout mBottomSheetLayout; + + @InjectView(R.id.list_menu) + ListView mMenuList; + + @InjectView(R.id.fab) + FloatingActionButton mFab; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_bottom_sheet); + ButterKnife.inject(this); + initListView(); + initListMenu(); + mBottomSheetLayout.setFab(mFab); + } + + private void initListView() { + List list = new ArrayList(100); + for (int i = 0; i < 100; i++) { + list.add("Item " + i); + } + + ArrayAdapter adapter = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, list); + mObservableListView.setAdapter(adapter); + } + + private void initListMenu() { + ArrayList bottomSheets = new ArrayList<>(); + bottomSheets.add( + BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.EMAIL)); + bottomSheets.add( + BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.ACCOUNT)); + bottomSheets.add( + BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.SETTING)); + BottomSheetAdapter adapter = new BottomSheetAdapter(this, bottomSheets); + mMenuList.setAdapter(adapter); + + } + + @OnClick(R.id.fab) + void onFabClick() { + mBottomSheetLayout.expandFab(); + } + +} diff --git a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java index c225fd2..b4cec31 100644 --- a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java +++ b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java @@ -2,6 +2,8 @@ import com.bowyer.app.fabtransitionlayout.BottomSheetLayout; import com.bowyer.app.fabtransitionlayout.FooterLayout; +import com.bowyer.fabtransitionlayout.demo.adapter.BottomSheetAdapter; +import com.bowyer.fabtransitionlayout.demo.model.BottomSheet; import com.github.ksoichiro.android.observablescrollview.ObservableListView; import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; import com.github.ksoichiro.android.observablescrollview.ScrollState; @@ -9,6 +11,7 @@ import android.animation.Animator; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; +import android.content.Intent; import android.os.Bundle; import android.support.design.widget.FloatingActionButton; import android.support.v7.app.ActionBarActivity; @@ -29,22 +32,28 @@ public class MainActivity extends ActionBarActivity implements ObservableScrollV @InjectView(R.id.list_view) ObservableListView mObservableListView; + @InjectView(R.id.fabtoolbar) FooterLayout mFabToolbar; + @InjectView(R.id.fablist) BottomSheetLayout mFooterLayout; + @InjectView(R.id.list_menu) ListView mListView; @InjectView(R.id.fab) FloatingActionButton mFab; + @InjectView(R.id.fab_left) FloatingActionButton mFabLeft; @InjectView(R.id.ic_call) ImageView mIcCall; + @InjectView(R.id.ic_email) ImageView mIcEmail; + @InjectView(R.id.ic_forum) ImageView mIcForum; @@ -59,16 +68,24 @@ protected void onCreate(Bundle savedInstanceState) { mFooterLayout.setFab(mFabLeft); } - private void initListMenu(){ - List menu = new ArrayList<>(); - menu.add("Share"); - menu.add("Upload"); - menu.add("Fav"); - ArrayAdapter adapter = new ArrayAdapter(this, - android.R.layout.simple_list_item_1, menu); + private void callBottomSheetActivity() { + Intent intet = new Intent(this, BottomSheetDemoActivity.class); + startActivity(intet); + } + + private void initListMenu() { + ArrayList bottomSheets = new ArrayList<>(); + bottomSheets.add( + BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.EMAIL)); + bottomSheets.add( + BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.ACCOUNT)); + bottomSheets.add( + BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.SETTING)); + BottomSheetAdapter adapter = new BottomSheetAdapter(this, bottomSheets); mListView.setAdapter(adapter); } + private void initListView() { List list = new ArrayList(100); for (int i = 0; i < 100; i++) { @@ -108,8 +125,9 @@ void onFabClick() { } @OnClick(R.id.fab_left) - void onFabLeftClick(){ - mFooterLayout.expandFab(); + void onFabLeftClick() { + callBottomSheetActivity(); +// mFooterLayout.expandFab(); } @OnClick(R.id.call) diff --git a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/adapter/BottomSheetAdapter.java b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/adapter/BottomSheetAdapter.java new file mode 100644 index 0000000..b999720 --- /dev/null +++ b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/adapter/BottomSheetAdapter.java @@ -0,0 +1,82 @@ +package com.bowyer.fabtransitionlayout.demo.adapter; + +import com.bowyer.fabtransitionlayout.demo.R; +import com.bowyer.fabtransitionlayout.demo.model.BottomSheet; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.BaseAdapter; +import android.widget.ImageView; +import android.widget.TextView; + +import java.util.ArrayList; + +import butterknife.ButterKnife; +import butterknife.InjectView; + +/** + * Created by Bowyer on 15/08/06. + */ +public class BottomSheetAdapter extends BaseAdapter { + + Context mContext; + + LayoutInflater mLayoutInflater = null; + + ArrayList mBottomSheets; + + public BottomSheetAdapter(Context context, ArrayList bottomSheets) { + mContext = context; + mBottomSheets = bottomSheets; + mLayoutInflater = (LayoutInflater) context + .getSystemService(Context.LAYOUT_INFLATER_SERVICE); + } + + @Override + public int getCount() { + return mBottomSheets.size(); + } + + @Override + public Object getItem(int position) { + return mBottomSheets.get(position); + } + + @Override + public long getItemId(int position) { + return 0; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + ViewHolder viewHolder; + if (convertView == null) { + convertView = mLayoutInflater.inflate(R.layout.row_item_bottom_sheet, parent, false); + viewHolder = new ViewHolder(convertView); + convertView.setTag(viewHolder); + } else { + viewHolder = (ViewHolder) convertView.getTag(); + } + + BottomSheet sheet = (BottomSheet) getItem(position); + viewHolder.mMenuIcon + .setBackground(mContext.getDrawable(sheet.getBottomSheetMenuType().getResId())); + viewHolder.mMenuTitle.setText(sheet.getBottomSheetMenuType().getName()); + return convertView; + } + + static class ViewHolder { + + @InjectView(R.id.menu_icon) + ImageView mMenuIcon; + + @InjectView(R.id.menu_title) + TextView mMenuTitle; + + public ViewHolder(View view) { + ButterKnife.inject(this, view); + } + } +} diff --git a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/model/BottomSheet.java b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/model/BottomSheet.java new file mode 100644 index 0000000..012361b --- /dev/null +++ b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/model/BottomSheet.java @@ -0,0 +1,50 @@ +package com.bowyer.fabtransitionlayout.demo.model; + +import com.bowyer.fabtransitionlayout.demo.R; + +/** + * Created by Bowyer on 15/08/06. + */ +public class BottomSheet { + + + public enum BottomSheetMenuType { + EMAIL(R.drawable.ic_drafts_white_24dp, "Mail"), ACCOUNT( + R.drawable.ic_account_circle_white_24dp, "Acount"), SETTING(R.drawable.ic_build_white_24dp, + "Setitng"); + + int resId; + + String name; + + BottomSheetMenuType(int resId, String name) { + this.resId = resId; + this.name = name; + } + + + public int getResId() { + return resId; + } + + public String getName() { + return name; + } + } + + BottomSheetMenuType bottomSheetMenuType; + + public static BottomSheet to() { + return new BottomSheet(); + } + + public BottomSheetMenuType getBottomSheetMenuType() { + return bottomSheetMenuType; + } + + public BottomSheet setBottomSheetMenuType(BottomSheetMenuType bottomSheetMenuType) { + this.bottomSheetMenuType = bottomSheetMenuType; + return this; + } + +} diff --git a/demo/src/main/res/drawable-hdpi/ic_add_white_24dp.png b/demo/src/main/res/drawable-hdpi/ic_add_white_24dp.png deleted file mode 100644 index 481643ecd5e5c361bdf5440f80b6ead58c015a87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K;Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=Ijcz0ZK3>dAqwX{BQ3+vmeOgEbxddW?|m)`b<0N2FLh>sBaz zbNHm-*5u;7=mneO8+En?J13^G1)j}b{4(Q;!Yv7xt%vHjER#LP#>jBmH-z#3;kA!} PRxo(F`njxgN@xNAMifE{ diff --git a/demo/src/main/res/drawable-hdpi/ic_call_white_36dp.png b/demo/src/main/res/drawable-hdpi/ic_call_white_36dp.png deleted file mode 100644 index 6f4dcea1f3cdf34726c7e881e97a8b40d985ce69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 491 zcmV$7cnH?xJT@P zd}EMr)YT};H*OPKB`3e=<1?`t`Nkx%8kgi7&xw6uSbkBUN^FgO`9+x>Vk`8?FQ!SX z&@U?jrntj6htwS^B-R+#9^?tB`_5bLGsQR;I7LD2BEw@68(h{u$P;20F|T%!}I@sJ@xS~2PjWvVoaXw9fo4DgKh7kmf&R#KidTr2Fc*l~V72fpWJoa|%dE2l zBJ;j-7ar`s=C^-LCX?ZeS1P*Vi#N`({fzx4)O1bFRLKTxNWmwEzU-1zT>G+n9Pf0& z3P<6~9&q%SMP{<)mL86Ilgu!Nl>C+@LktU-8OE43ZTa8=!`jP?J`3s=nLp9T+Q~|W z7;dA$U{;)9xE)i5$)I9J&pi>r=pgp*-%&w`%&}sGxito}R9~W5R)~MFppS`QbP&b? z&(shiQ>+<_U}O-w-f&q%Fgl1xnGQw<5iirhs378HIv5>9yi5n9g9w*BqS3*)Ad<_V zqJlVCDzYqDWk+mD!G?h^Gp0$7!3m~hKWFZauGsOyDW+w~ fmt|R&W$E_~0CNgBWJ}gq00000NkvXXu0mjfujP)6#L~N zV?;G~!wKnqJTqo&+Y^UYY{d4RTd|7mE4#x23#>z3n~>F50XL)9W8CP8)xBYX1r}If zgCF*fWW^R-Q9fuuvSJG^NQMj;DK$n)kCEz7jNO|sQsgabz(~n4QhMxq-Cs N002ovPDHLkV1kwIXlMWc diff --git a/demo/src/main/res/drawable-mdpi/ic_add_white_24dp.png b/demo/src/main/res/drawable-mdpi/ic_add_white_24dp.png deleted file mode 100644 index 977dd3427ade9fa5002997d3e3df916aa8861983..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1g=CK)Uj~LMH3o);76yi2K%s^g z3=E|P3=FRl7#OT(FffQ0%-I!a1C(G&@^*J&_}|`tWO=~G=WkLM z=IP=XVsSe8&v^%_1es$}4u^UcOKr$FAbzMP2;3l0LOD$N=(0Aydxv3a1NO%A-5V49kkQ!=X zV`%)ixtjF0)a^NIzfT&=3_}@<#bU8k$;l06(wcI^K4~{{!wzW=azjYkD}h|FPQL}Y zV3vL*xgg+~w1(VpOxmv85YnrTksES+&{fCC9j7Gf82Mn8*e6T!#Wk@r`JzB#L%wJb zYcnT5Y#b>z}pQJM8S^7ND{`u&`u bTZ_H{BrdMhJjfeF00000NkvXXu0mjfT99_e diff --git a/demo/src/main/res/drawable-mdpi/ic_forum_white_36dp.png b/demo/src/main/res/drawable-mdpi/ic_forum_white_36dp.png deleted file mode 100644 index 247b7f11d2cdc53a988ec51e63d7678627dd750a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 192 zcmeAS@N?(olHy`uVBq!ia0vp^Dj>|k0wldT1B8K8yQhm|NCo5DGlpD;0%V#$KKGqt z6Q=)Y(#{Hv{-E<0?U#sfa`4Mf)LC?Pd&;k^^X2n(s;WO6y0$#{OS!D$d>-}`rw98U z&2c`z)^dsLg?Puw?7BxbbgHvQRiqV5IV2T%@T__FUcs>UUzLXsU+2x$ELFMBW;y4b kP;8Y6f)cEbmGNA;-wkgV*Yg-p20Dqs)78&qol`;+05tPPR{#J2 diff --git a/demo/src/main/res/drawable-xhdpi/ic_account_circle_white_24dp.png b/demo/src/main/res/drawable-xhdpi/ic_account_circle_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..246e0c87249b36ef3da7cda5e0fd1498e61909fe GIT binary patch literal 632 zcmV-;0*C#HP)QMY9~Yn{n1&()7PuFTlp&#;5V44M znr_so=xgQ->aR^OXI|fT&Kz~&!sn6B==38(2g59|Mv5$1QmnDS5bZ>CT+}hf7A~7S zr&dQrHM3+1;*p?A;nB-Cij|^AVNk{!!b%WTaVTe*qexP&V3e_pO`36*ghW3xfMe7MdgHVG9*FE(lFWuOrcn{K&L&3A0ZWx*siyHv`BS?ro+K?`;>vZIbH zb}?BH$Ij!bY#75OCJW-YjOs8VY~j)@3tDm6phPA*aC<2WUg6dz6T`S=Xpn&>JlqCl zVu3=w(jXt2*rbqonOLK+3=^~vCr&GqcoeoO6Ddy8j!a}ZNuEq(IZ2*OqzJOdIxDQO z!5%?&WMU1MKfI-%8=TXB#JI_0-jT*-RVEg&`Ai?@<-i3V@&%iDnHa+KmnW1e08yTi z#xx)k?d1E#Z54@5ev_|NCL(O&*RK$Gir+dVI*b?iT~-KO!EZ!1)RHCVzCxgnoD4Ox zBSB7@P8EqeWXPG43st1Z`9Y_Oz+HZlvrUEE=)o_|0|np_9)4Xaj0E|XX^;brd?4Sn zf)FK1z5|lnHBG6)pod+G zwN018qmmgsf@GMYLPy0lM%ln+oe^quTtsMNkal@guN>Guy}2dHIL S=i|`;0000^O5`%Y-g1_ECudS}%!`D2Y!bYTm@k%$K;B`4U4jPvXboRe*>Y qA0T4KX9$mYGc#(exI|m+$J8&SUCOM6gL_W^0000}enP&kYR#uZgDBC79Y0zB|Z#g|c)miaJ?=q%F9soSE z`tLPt2J!<~an(ja&}UK|G~e&+0L&USY8J8s`EI2HB(1*Yfkp>N++P4{@?13rrscV* z7$}*S*S;ynKu}Uv)$XdM6onYbwKWBFfDZ5nG8{1tt;0L#00000NkvXXu0mjf^$ypa literal 0 HcmV?d00001 diff --git a/demo/src/main/res/drawable-xxhdpi/ic_account_circle_white_24dp.png b/demo/src/main/res/drawable-xxhdpi/ic_account_circle_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..bfd4632b574321ada20673ee3e2f2fbb9941bbc1 GIT binary patch literal 909 zcmV;819JR{P)%PkVB3=QOn(?imVjtozU+X5LyLjzB-DKpAhnyDp0 z3+H%%-2(Lrk0d#4p3$Z)ILsn86C@NC-(oXCNH@#&dP%G*mcSUPq1s21+Cak$&O>VsFejtTy)5W z5nLo>K@u1D6^tyKxM-0D`*2Yrqaa+z%{f_c0XN+W!VGR6$bxa)Ov;QDMO+-%bfQtc{&_}Q`cR8pKXyYf!1nZFr zCkZmo0Y$(eej&(5GGP}*O!|3E5%D@VG1;I_W=!Mn3ss0O@t0E&uHk2j8dZoI9^>b# zf{>+z*T;$hpWs!bQNb9-t3ff~O}y^OhEBXbR}8p_*9Wp=hOPePeN~8qtg}^4E;x$U z3VT%nn)sWo%CyT3ckud?y^4q?mhieQSL|jDuN4j`0uJ#HUU@QdM;Ct9xu{U6;SwA8 zIjwN`27lwcD@W|-XZ+nzSR{CezY+uNmj&-J$R_^As8x8>vw+z&muQj?nz_tl%;rfc z8Zs;p>@P;RK@V5BLN8x4$_l~eX;gI7GeMljNU1U;xJ6w0sZ|{4VvS1WIj#7R+8Dy3vRw+ACK9E}?NfM?8@(B!d%0QuzOq4L7m@sfiDIdY5Oq5W>L`q3Xh6X4~CNdzB zfjYUJ^EZ)P_PMUNwHNmD0iN}1?|1LDcS|WRe=ii##3*yDvB4@c4B;ckEy@UoIOT<1 zddM;j@)J4tOc+KnPPAOnXd4NpNVAQ!MW$_}9WrbqE!sCreYTMTl-ovHms_lzS`ku> z6zG@$bpoUX8BR3-kJM|E9?6yfjlI`B(V$Igl>lvj)IHOz37VAv-G2GBXw{mc1AR{B zx5`&KG@i2ueNgF-(jc7)zpv5WXsK{04bhz-2MTmS#g4V1uX|I>9LUoJr4tNOJ(vI| zNUHu6U4*S4j*|nI5|90Qgat<9;=rZ^XaKqRB|sH|AesH1eId>*Niv`|u`4tyLL!9| z+ekjaIT9kxTSg*F@U{t&D!I0eRAnEjQuM~n$js8bWhABW30@~5QZg;N5XE1dEC@gsQ35zDYcUTg+6q5b9)@70-^VgH6J(5TANdKEO<&iv+M>0s7 zG;vrH59!9t`BChob5loJv66btowCJ3@+*^xN;1odN;1!hNOFf0mgFACk>oDt2g!Yo lQc97}G662=QeOT>-T-0k?`Rh*v)cdw002ovPDHLkV1h_J@T&j- literal 0 HcmV?d00001 diff --git a/demo/src/main/res/drawable-xxhdpi/ic_drafts_white_24dp.png b/demo/src/main/res/drawable-xxhdpi/ic_drafts_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..841a356e3aee0c410835bdc851291a9b5babc463 GIT binary patch literal 717 zcmV;;0y6!HP)7R@(yqMo+ zl>QXDi_%UKfF$iig9Vk)$Qap;(MU;9pnBetuQ$~B4_eDT=CCTmUDo&qDx-}F3N=A1 zWqyG6GlJ|h2RO(VWFOh*EvT9|tdAY2Jljb>vQdt^2dbeP**GUDMOmzrQ;Z{f&31iI1-HqNTZ#@=pbBgy zoutSu%}rK02ZdO>voW zl!Gnd3e(6Q6SD^@&-?j*RG~Dsk^hlRafwJF&?ZKZ4YC`B{`NAAY*@aNeB4ju_LDQ> z1a(%%S$>n-5D{z8dGXJ_MFq;`t>z9HvTL#i4X{`@H7Ji(OAm|nSc8%*bRXsEN_fOV z6V{;Yo)PnmQ^j)@o3#gmNm?j%9TTFB1lR@1`lxl4Q_p(<=O9RPo#n1zqTC<@x*&j2 z4rz0a@}2x8ZG*IrTpY2xAV|RfOjBB(_!<-qjZv{aDVhb z0HYi($Y~%B;2lWTMGWgB?gH=^B#&GiaS$MRvSk6awF?;u&6BlC*`1P{_L zZ9oR3S;l}2NV7QuG9cZYgA8bvAey!Y^%F$B)}U5`sM#76VFH-;meoWwl_;Zy6n-Sx zMX9C&QTFi=gQV&fV`@{8}WaY!!s3L7Wn4_mR(Ay?#a1{+)C9rGB* zT#~2^P)a}Mo>3#OxQvYrGQ?(VbjcfjhNZ{_aOwfj#-YP)5*9O#vtf#5hO;>PS|Q>n&N^g@)i_(O5U~d-*L8H-q3}!>r^NpRB{7n=j9c1d5W_HZz}*S zC55vm%#n9Alg@LtktZL>V+Z4;(2D34goFQoUK{Gy0!r1vjJm?cZh<{SPa zy{i<+KPrgh<~i*wks+3HigDcZF+;&%J_DHen@?FvL=MPj8K2REiTl(jI4oiSQ_tw; z2p`hODps(9RW!1lBXl#2se3F`u$WJROzERW!DA-Z$b_rRP&g>!Bw;&7fx^TVo)MNO zG%0-4&_x)|Ge?<16a54!$$DiLC49_7f-po2#hMDl*hvCE;_M)*sYHZ2IvK&%FdfvA zr|dupYdOXpO!RV;H54lwQ9(VsY2y+-3^K|D6O1xQ4;ML33w4w$CnqN-Cnqrf0}0;2 UH1!LDTL1t607*qoM6N<$g2ML^3IG5A literal 0 HcmV?d00001 diff --git a/demo/src/main/res/drawable-xxxhdpi/ic_build_white_24dp.png b/demo/src/main/res/drawable-xxxhdpi/ic_build_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..874a0eb603514cc1b7e7a2b7c03de4d293232a7e GIT binary patch literal 655 zcmV;A0&x9_P)x6k))(Ok@2@4rVrV+xV{jc*V-|RmZX1Ov>5MhzBae@fb>~WuYZI#(%H(`Q^2;;1C zz!^6@(x5?&3MZ6UdOa4|PMi>cbb=F{-~=Z)!3j=qf)kwJ1SdElSwhJ^Vbwa}TEsS? zC1RWKAYz-aC1RQIoev^*3F*y`BBVJ#n2_%LAVS*na|!9s&m`EG-yL3e7?3M_DTQ%002ovPDHLkV1k?(CszOf literal 0 HcmV?d00001 diff --git a/demo/src/main/res/drawable-xxxhdpi/ic_drafts_white_24dp.png b/demo/src/main/res/drawable-xxxhdpi/ic_drafts_white_24dp.png new file mode 100644 index 0000000000000000000000000000000000000000..c9bef5ba4cf50b7b7f475215f5e6b107cfebbd5d GIT binary patch literal 953 zcmV;q14jIbP)ztRgWD)R)qbluZ4`&N7*G{ADGjp>6nCdP4;vMto zJX89`HPK3^#5?18xkdn%IwIaB?`RjwtldUK;vKf6zJOUiR;n-DCRDgP>{Y5AX4D5T z*&F)A`_*H@DA(aP@%pUST5G^^zl+!Fb*;h}Hre{ppF~IP0C)OQsXlU(P{n50p;UX_ zUOnJyn+%C}(1St^w!~rahHTV6cECi>IxXI5t4tJXw4CRh5$}|hCX5B}fNt@IY<7)M z<4w24uy{XMJUYM>+m&jcyM#Jzp0C9#=+as#V2W?W`@?df&U@0I;_cH~8Q?v!F8ZG- zLIXC{oBGAtTnXSF1ta4VvxEk2j!%t@yj#lywi($GONA!vAwL<}+vNer6?fKZIiX2w z@uGhf*IgcPNpY)$CU3Rk&Xxy^Y`57$lQzfailcY*0D7&}(uCjVHGR|q0EgTwG;oXk z2(<%{*J+y2fVJzAr`7;C(U6z;q|)_O2Y}sX)$wTeKz#x9dPS}dN4riRjR3$wi-a2P zK8ID(#VP=iqiz#wuxYl+(`W#kuuQ0OPxu>}1Atv-3S-=CyN#~?+5@;?%@~e4XRThc z0DyxQ3ZvK}hafuu@-|m^)NMND$r=E9JT8>kGAE3^f%*bqr_x6~(=Nz1fD2xhiyZA5 z7Z?u!=(a#8+5+8b(O{zh413pAf}qVN!;Cio^ytu`2eJuhe3!0pKmsJdPy!@Cbqyy# z0#sN23I`-W0u&M;0jezffCLzn&RI%LBS(xz6%{`3kaH!MyT-V4JMAMW_TY z*?w8LrlAqEO00000NkvXXu0mjf+AG1h literal 0 HcmV?d00001 diff --git a/demo/src/main/res/layout/activity_bottom_sheet.xml b/demo/src/main/res/layout/activity_bottom_sheet.xml new file mode 100644 index 0000000..46ddb23 --- /dev/null +++ b/demo/src/main/res/layout/activity_bottom_sheet.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + diff --git a/demo/src/main/res/layout/row_item_bottom_sheet.xml b/demo/src/main/res/layout/row_item_bottom_sheet.xml new file mode 100644 index 0000000..0e2770d --- /dev/null +++ b/demo/src/main/res/layout/row_item_bottom_sheet.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/demo/src/main/res/values/dimens.xml b/demo/src/main/res/values/dimens.xml index 130cb73..958ac2c 100644 --- a/demo/src/main/res/values/dimens.xml +++ b/demo/src/main/res/values/dimens.xml @@ -3,4 +3,6 @@ 16dp 16dp 72dp + 48dp + 16sp diff --git a/fabtransitionlayout/build.gradle b/fabtransitionlayout/build.gradle index d87673c..8865655 100644 --- a/fabtransitionlayout/build.gradle +++ b/fabtransitionlayout/build.gradle @@ -1,14 +1,14 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" + compileSdkVersion COMPILE_SDK_VERSION as int + buildToolsVersion BUILD_TOOLS_VERSION defaultConfig { - minSdkVersion 15 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" + minSdkVersion MIN_SDK_VERSION + targetSdkVersion TARGET_SDK_VERSION as int + versionCode VERSION_CODE as int + versionName VERSION_NAME } buildTypes { release { diff --git a/gradle.properties b/gradle.properties index 89e0d99..82a39d2 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,3 +16,9 @@ # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true +VERSION_NAME=1.0.0 +VERSION_CODE=1 +COMPILE_SDK_VERSION=22 +BUILD_TOOLS_VERSION=22.0.1 +TARGET_SDK_VERSION=22 +MIN_SDK_VERSION=15 \ No newline at end of file From 87cb552683e32bdd0aaf95e416f90ce0807dff2c Mon Sep 17 00:00:00 2001 From: bowyer-app Date: Fri, 7 Aug 2015 00:37:39 +0900 Subject: [PATCH 03/11] divide demo --- demo/src/main/AndroidManifest.xml | 1 + .../demo/FabToolBarDemoActivity.java | 115 +++++++++++++++ .../demo/MainActivity.java | 138 +----------------- .../main/res/layout/activity_fab_toolbar.xml | 93 ++++++++++++ demo/src/main/res/layout/activity_main.xml | 137 +++-------------- demo/src/main/res/values/strings.xml | 2 + 6 files changed, 236 insertions(+), 250 deletions(-) create mode 100644 demo/src/main/java/com/bowyer/fabtransitionlayout/demo/FabToolBarDemoActivity.java create mode 100644 demo/src/main/res/layout/activity_fab_toolbar.xml diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index 695ffc2..f9f9c66 100644 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -17,6 +17,7 @@ + diff --git a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/FabToolBarDemoActivity.java b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/FabToolBarDemoActivity.java new file mode 100644 index 0000000..7e60a66 --- /dev/null +++ b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/FabToolBarDemoActivity.java @@ -0,0 +1,115 @@ +package com.bowyer.fabtransitionlayout.demo; + +import com.bowyer.app.fabtransitionlayout.FooterLayout; +import com.github.ksoichiro.android.observablescrollview.ObservableListView; +import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; +import com.github.ksoichiro.android.observablescrollview.ScrollState; + +import android.animation.Animator; +import android.animation.ObjectAnimator; +import android.animation.PropertyValuesHolder; +import android.os.Bundle; +import android.support.design.widget.FloatingActionButton; +import android.support.v7.app.ActionBarActivity; +import android.view.View; +import android.widget.ArrayAdapter; +import android.widget.ImageView; + +import java.util.ArrayList; +import java.util.List; + +import butterknife.ButterKnife; +import butterknife.InjectView; +import butterknife.OnClick; + +/** + * Created by Bowyer on 15/08/07. + */ +public class FabToolBarDemoActivity extends ActionBarActivity implements ObservableScrollViewCallbacks { + + @InjectView(R.id.list_view) + ObservableListView mObservableListView; + + @InjectView(R.id.fabtoolbar) + FooterLayout mFabToolbar; + + @InjectView(R.id.fab) + FloatingActionButton mFab; + + @InjectView(R.id.ic_call) + ImageView mIcCall; + + @InjectView(R.id.ic_email) + ImageView mIcEmail; + + @InjectView(R.id.ic_forum) + ImageView mIcForum; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_fab_toolbar); + ButterKnife.inject(this); + initListView(); + mFabToolbar.setFab(mFab); + } + + private void initListView() { + List list = new ArrayList(100); + for (int i = 0; i < 100; i++) { + list.add("Item " + i); + } + + ArrayAdapter adapter = new ArrayAdapter(this, + android.R.layout.simple_list_item_1, list); + mObservableListView.setAdapter(adapter); + mObservableListView.setScrollViewCallbacks(this); + } + + @Override + public void onScrollChanged(int i, boolean b, boolean b1) { + + } + + @Override + public void onDownMotionEvent() { + + } + + @Override + public void onUpOrCancelMotionEvent(ScrollState scrollState) { + if (scrollState == ScrollState.UP) { + mFabToolbar.slideOutFab(); + } else if (scrollState == ScrollState.DOWN) { + mFabToolbar.slideInFab(); + } + } + + @OnClick(R.id.fab) + void onFabClick() { + mFabToolbar.expandFab(); + } + + @OnClick(R.id.call) + void onClickCall() { + iconAnim(mIcCall); + } + + @OnClick(R.id.ic_email) + void onClickEmail() { + iconAnim(mIcEmail); + } + + @OnClick(R.id.ic_forum) + void onClickForum() { + iconAnim(mIcForum); + } + + private void iconAnim(View icon) { + Animator iconAnim = ObjectAnimator.ofPropertyValuesHolder( + icon, + PropertyValuesHolder.ofFloat("scaleX", 1f, 1.5f, 1f), + PropertyValuesHolder.ofFloat("scaleY", 1f, 1.5f, 1f)); + iconAnim.start(); + } +} diff --git a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java index b4cec31..5cfd55c 100644 --- a/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java +++ b/demo/src/main/java/com/bowyer/fabtransitionlayout/demo/MainActivity.java @@ -1,155 +1,31 @@ package com.bowyer.fabtransitionlayout.demo; -import com.bowyer.app.fabtransitionlayout.BottomSheetLayout; -import com.bowyer.app.fabtransitionlayout.FooterLayout; -import com.bowyer.fabtransitionlayout.demo.adapter.BottomSheetAdapter; -import com.bowyer.fabtransitionlayout.demo.model.BottomSheet; -import com.github.ksoichiro.android.observablescrollview.ObservableListView; -import com.github.ksoichiro.android.observablescrollview.ObservableScrollViewCallbacks; -import com.github.ksoichiro.android.observablescrollview.ScrollState; - -import android.animation.Animator; -import android.animation.ObjectAnimator; -import android.animation.PropertyValuesHolder; import android.content.Intent; import android.os.Bundle; -import android.support.design.widget.FloatingActionButton; import android.support.v7.app.ActionBarActivity; -import android.view.View; -import android.widget.ArrayAdapter; -import android.widget.ImageView; -import android.widget.ListView; - -import java.util.ArrayList; -import java.util.List; import butterknife.ButterKnife; -import butterknife.InjectView; import butterknife.OnClick; -public class MainActivity extends ActionBarActivity implements ObservableScrollViewCallbacks { - - @InjectView(R.id.list_view) - ObservableListView mObservableListView; - - @InjectView(R.id.fabtoolbar) - FooterLayout mFabToolbar; - - @InjectView(R.id.fablist) - BottomSheetLayout mFooterLayout; - - @InjectView(R.id.list_menu) - ListView mListView; - - @InjectView(R.id.fab) - FloatingActionButton mFab; - - @InjectView(R.id.fab_left) - FloatingActionButton mFabLeft; - - @InjectView(R.id.ic_call) - ImageView mIcCall; - - @InjectView(R.id.ic_email) - ImageView mIcEmail; - - @InjectView(R.id.ic_forum) - ImageView mIcForum; +public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.inject(this); - initListView(); - initListMenu(); - mFabToolbar.setFab(mFab); - mFooterLayout.setFab(mFabLeft); } - private void callBottomSheetActivity() { + @OnClick(R.id.start_bottom_sheet_demo) + void startBottomSheetDemo() { Intent intet = new Intent(this, BottomSheetDemoActivity.class); startActivity(intet); } - private void initListMenu() { - ArrayList bottomSheets = new ArrayList<>(); - bottomSheets.add( - BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.EMAIL)); - bottomSheets.add( - BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.ACCOUNT)); - bottomSheets.add( - BottomSheet.to().setBottomSheetMenuType(BottomSheet.BottomSheetMenuType.SETTING)); - BottomSheetAdapter adapter = new BottomSheetAdapter(this, bottomSheets); - mListView.setAdapter(adapter); - - } - - private void initListView() { - List list = new ArrayList(100); - for (int i = 0; i < 100; i++) { - list.add("Item " + i); - } - - ArrayAdapter adapter = new ArrayAdapter(this, - android.R.layout.simple_list_item_1, list); - mObservableListView.setAdapter(adapter); - mObservableListView.setScrollViewCallbacks(this); - } - - @Override - public void onScrollChanged(int i, boolean b, boolean b1) { - - } - - @Override - public void onDownMotionEvent() { - - } - - @Override - public void onUpOrCancelMotionEvent(ScrollState scrollState) { - if (scrollState == ScrollState.UP) { - mFabToolbar.slideOutFab(); - mFooterLayout.slideOutFab(); - } else if (scrollState == ScrollState.DOWN) { - mFabToolbar.slideInFab(); - mFooterLayout.slideInFab(); - } - } - - @OnClick(R.id.fab) - void onFabClick() { - mFabToolbar.expandFab(); - } - - @OnClick(R.id.fab_left) - void onFabLeftClick() { - callBottomSheetActivity(); -// mFooterLayout.expandFab(); - } - - @OnClick(R.id.call) - void onClickCall() { - iconAnim(mIcCall); - } - - @OnClick(R.id.ic_email) - void onClickEmail() { - iconAnim(mIcEmail); - } - - @OnClick(R.id.ic_forum) - void onClickForum() { - iconAnim(mIcForum); - } - - private void iconAnim(View icon) { - Animator iconAnim = ObjectAnimator.ofPropertyValuesHolder( - icon, - PropertyValuesHolder.ofFloat("scaleX", 1f, 1.5f, 1f), - PropertyValuesHolder.ofFloat("scaleY", 1f, 1.5f, 1f)); - iconAnim.start(); + @OnClick(R.id.start_fab_toolbar_demo) + void startFabToolbarDemo() { + Intent intet = new Intent(this, FabToolBarDemoActivity.class); + startActivity(intet); } } diff --git a/demo/src/main/res/layout/activity_fab_toolbar.xml b/demo/src/main/res/layout/activity_fab_toolbar.xml new file mode 100644 index 0000000..44c271d --- /dev/null +++ b/demo/src/main/res/layout/activity_fab_toolbar.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/src/main/res/layout/activity_main.xml b/demo/src/main/res/layout/activity_main.xml index 4665db1..b09219f 100644 --- a/demo/src/main/res/layout/activity_main.xml +++ b/demo/src/main/res/layout/activity_main.xml @@ -1,122 +1,21 @@ - - - - - - - - - - + +