-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from bowyer-app/bw/update_code_format
Bw/update code format
- Loading branch information
Showing
40 changed files
with
1,819 additions
and
1,903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
|
||
buildscript { | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.1.2' | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' | ||
classpath 'com.github.dcendents:android-maven-plugin:1.2' | ||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
repositories { | ||
jcenter() | ||
} | ||
dependencies { | ||
classpath 'com.android.tools.build:gradle:2.1.2' | ||
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' | ||
classpath 'com.github.dcendents:android-maven-plugin:1.2' | ||
// NOTE: Do not place your application dependencies here; they belong | ||
// in the individual module build.gradle files | ||
} | ||
} | ||
|
||
allprojects { | ||
repositories { | ||
jcenter() | ||
} | ||
repositories { | ||
jcenter() | ||
} | ||
} | ||
|
||
ext { | ||
androidSupportAppCompatV7Lib = 'com.android.support:appcompat-v7:23.4.0' | ||
androidSupportAppCompatV7Lib = 'com.android.support:appcompat-v7:23.4.0' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenCentral() | ||
|
||
maven { | ||
url "https://jitpack.io" | ||
} | ||
maven { | ||
url "https://jitpack.io" | ||
} | ||
} | ||
|
||
android { | ||
compileSdkVersion COMPILE_SDK_VERSION as int | ||
buildToolsVersion BUILD_TOOLS_VERSION | ||
compileSdkVersion COMPILE_SDK_VERSION as int | ||
buildToolsVersion BUILD_TOOLS_VERSION | ||
|
||
defaultConfig { | ||
applicationId "com.bowyer.fabtransitionlayout.demo" | ||
minSdkVersion MIN_SDK_VERSION | ||
targetSdkVersion TARGET_SDK_VERSION as int | ||
versionCode VERSION_CODE as int | ||
versionName VERSION_NAME | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
defaultConfig { | ||
applicationId "com.bowyer.fabtransitionlayout.demo" | ||
minSdkVersion MIN_SDK_VERSION | ||
targetSdkVersion TARGET_SDK_VERSION as int | ||
versionCode VERSION_CODE as int | ||
versionName VERSION_NAME | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile rootProject.ext.androidSupportAppCompatV7Lib | ||
compile 'com.android.support:design:23.4.0' | ||
compile 'com.squareup.picasso:picasso:2.5.2' | ||
compile 'com.jakewharton:butterknife:7.0.1' | ||
compile 'com.github.ksoichiro:android-observablescrollview:1.5.1' | ||
compile project(':fabtransitionlayout') | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
compile rootProject.ext.androidSupportAppCompatV7Lib | ||
compile 'com.android.support:design:23.4.0' | ||
compile 'com.squareup.picasso:picasso:2.5.2' | ||
compile 'com.jakewharton:butterknife:7.0.1' | ||
compile 'com.github.ksoichiro:android-observablescrollview:1.5.1' | ||
compile project(':fabtransitionlayout') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 42 additions & 53 deletions
95
demo/src/main/java/com/bowyer/fabtransitionlayout/demo/BottomSheetDemoActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,66 @@ | ||
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.Bind; | ||
import butterknife.ButterKnife; | ||
import butterknife.OnClick; | ||
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 java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by Bowyer on 15/08/07. | ||
*/ | ||
public class BottomSheetDemoActivity extends ActionBarActivity { | ||
|
||
@Bind(R.id.list_view) | ||
ObservableListView mObservableListView; | ||
|
||
@Bind(R.id.bottom_sheet) | ||
BottomSheetLayout mBottomSheetLayout; | ||
@Bind(R.id.list_view) ObservableListView mObservableListView; | ||
|
||
@Bind(R.id.list_menu) | ||
ListView mMenuList; | ||
@Bind(R.id.bottom_sheet) BottomSheetLayout mBottomSheetLayout; | ||
|
||
@Bind(R.id.fab) | ||
FloatingActionButton mFab; | ||
@Bind(R.id.list_menu) ListView mMenuList; | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_bottom_sheet); | ||
ButterKnife.bind(this); | ||
initListView(); | ||
initListMenu(); | ||
mBottomSheetLayout.setFab(mFab); | ||
} | ||
@Bind(R.id.fab) FloatingActionButton mFab; | ||
|
||
private void initListView() { | ||
List<String> list = new ArrayList<String>(100); | ||
for (int i = 0; i < 100; i++) { | ||
list.add("Item " + i); | ||
} | ||
|
||
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, | ||
android.R.layout.simple_list_item_1, list); | ||
mObservableListView.setAdapter(adapter); | ||
} | ||
|
||
private void initListMenu() { | ||
ArrayList<BottomSheet> 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); | ||
|
||
} | ||
@Override protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_bottom_sheet); | ||
ButterKnife.bind(this); | ||
initListView(); | ||
initListMenu(); | ||
mBottomSheetLayout.setFab(mFab); | ||
} | ||
|
||
@OnClick(R.id.fab) | ||
void onFabClick() { | ||
mBottomSheetLayout.expandFab(); | ||
private void initListView() { | ||
List<String> list = new ArrayList<String>(100); | ||
for (int i = 0; i < 100; i++) { | ||
list.add("Item " + i); | ||
} | ||
|
||
ArrayAdapter<String> adapter = | ||
new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, list); | ||
mObservableListView.setAdapter(adapter); | ||
} | ||
|
||
private void initListMenu() { | ||
ArrayList<BottomSheet> 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(); | ||
} | ||
} |
Oops, something went wrong.