Skip to content

Commit

Permalink
Merge pull request #11 from bowyer-app/bw/update_code_format
Browse files Browse the repository at this point in the history
Bw/update code format
  • Loading branch information
bowyer-app authored Aug 4, 2016
2 parents ac88373 + 74ac093 commit 586c062
Show file tree
Hide file tree
Showing 40 changed files with 1,819 additions and 1,903 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies {

### Layout XML
#### BottomSheetLayout
```
```xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
Expand Down Expand Up @@ -71,7 +71,7 @@ dependencies {

```
#### FooterLayout
```
```xml
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
Expand Down Expand Up @@ -143,6 +143,10 @@ mBottomSheetLayout.slideInFab();
This library use following libraries.
* [CircularReveal](https://github.com/ozodrukh/CircularReveal)

# Code Style

Follow [SquareAndroid](https://github.com/square/java-code-styles/blob/master/configs/codestyles/SquareAndroid.xml).

Feature
====
- [ ] A floating action button transforming into a single sheet of material
Expand Down
28 changes: 14 additions & 14 deletions build.gradle
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'
}
50 changes: 25 additions & 25 deletions demo/build.gradle
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')
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
public class ApplicationTest extends ApplicationTestCase<Application> {

public ApplicationTest() {
super(Application.class);
}
public ApplicationTest() {
super(Application.class);
}
}
52 changes: 26 additions & 26 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bowyer.fabtransitionlayout.demo">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".BottomSheetDemoActivity" />
<activity android:name=".FabToolBarDemoActivity" />
<activity
android:name=".CoordinatorLayoutActivity"
android:label="@string/title_activity_coordinator_layout"
android:parentActivityName=".MainActivity"
android:theme="@style/AppTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.bowyer.fabtransitionlayout.demo.MainActivity" />
</activity>
</application>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".BottomSheetDemoActivity"/>
<activity android:name=".FabToolBarDemoActivity"/>
<activity
android:name=".CoordinatorLayoutActivity"
android:label="@string/title_activity_coordinator_layout"
android:parentActivityName=".MainActivity"
android:theme="@style/AppTheme">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.bowyer.fabtransitionlayout.demo.MainActivity"/>
</activity>
</application>

</manifest>
</manifest>
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();
}
}
Loading

0 comments on commit 586c062

Please sign in to comment.