Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bw/update code format #11

Merged
merged 2 commits into from
Aug 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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