Skip to content

Commit

Permalink
example for ui customization
Browse files Browse the repository at this point in the history
  • Loading branch information
soarcn committed Sep 22, 2015
1 parent 7744e13 commit c3b126c
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
ChangeLog
============

1.2.0
--------

- Defects fixing
- Developers can fully customize the whole ui

1.1.1
-------
- Defect fixing #35
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
classpath 'com.android.tools.build:gradle:1.3.0'
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apply from: 'https://raw.githubusercontent.com/soarcn/gradle/master/android.grad
dependencies {
compile project(':library')
compile 'com.cocosw:query:0.2.2'
compile 'com.android.support:appcompat-v7:22.1.1'
compile 'com.android.support:appcompat-v7:23.0.1'

// androidTestCompile ('com.android.support.test.espresso:espresso-core:+') {
// exclude module: 'support-annotations'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public boolean onMenuItemClick(MenuItem item) {
menu.setGroupVisible(android.R.id.empty,false);
break;
case 9:
sheet = new BottomSheet.Builder(this, R.style.BottomSheet_StyleDialog).title("To " + adapter.getItem(position)).sheet(R.menu.list).listener(new DialogInterface.OnClickListener() {
sheet = new BottomSheet.Builder(this, R.style.BottomSheet_CustomizedDialog).grid().title("To " + adapter.getItem(position)).sheet(R.menu.list).listener(new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
ListAcitivty.this.onClick(adapter.getItem(position), which);
Expand Down
32 changes: 32 additions & 0 deletions example/src/main/res/layout/new_grid_entry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
style="@style/BottomSheet.GridItem"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="UseCompoundDrawables">

<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<ImageView
android:id="@+id/bs_list_image"
style="@style/BottomSheet.GridItemImage"
tools:ignore="ContentDescription" />

<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|top"
android:src="@android:drawable/ic_dialog_info" />
</FrameLayout>

<TextView
android:id="@+id/bs_list_title"
style="@style/BottomSheet.GridItemTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
31 changes: 31 additions & 0 deletions example/src/main/res/layout/new_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@android:color/darker_gray"
android:orientation="vertical">

<View style="@style/BottomSheet.TopDivider" />

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
tools:ignore="UseCompoundDrawables">

<ImageView
android:id="@id/bottom_sheet_title_image"
style="@style/BottomSheet.Icon"
android:visibility="gone"
tools:ignore="ContentDescription" />


<TextView
android:id="@id/bottom_sheet_title"
style="@style/BottomSheet.Title"
android:visibility="gone" />

</LinearLayout>
</LinearLayout>
5 changes: 5 additions & 0 deletions example/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@
<item name="bs_headerLayout">@layout/bs_header</item>
</style>

<style name="BottomSheet.CustomizedDialog" parent="BottomSheet.StyleDialog">
<item name="bs_gridItemLayout">@layout/new_grid_entry</item>
<item name="bs_headerLayout">@layout/new_header</item>
</style>

</resources>
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ VERSION_NAME=0.0.1
VERSION_CODE=1
MIN_SDK_VERSION=8
TARGET_SDK_VERSION=22
COMPILE_SDK_VERSION=22
BUILD_TOOLS_VERSION=22.0.1
COMPILE_SDK_VERSION=23
BUILD_TOOLS_VERSION=23.0.1

POM_GROUP_ID=com.cocosw
POM_ARTIFACT_ID=bottomsheet
POM_VERSION=1.1.1
POM_VERSION=1.2.0
POM_NAME=bottomsheet
POM_PACKAGING=pom
POM_DESCRIPTION=One way to present a set of actions to a user is with bottom sheets, a sheet of paper that slides up from the bottom edge of the screen. Bottom sheets offer flexibility in the display of clear and simple actions that do not need explanation.
Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ apply from: 'https://raw.githubusercontent.com/soarcn/gradle/master/android-libr
apply from: 'https://raw.githubusercontent.com/soarcn/gradle/master/maven_push.gradle'

dependencies {
compile 'com.android.support:support-v4:22.2.0'
compile 'com.android.support:support-v4:23.0.1'
}

0 comments on commit c3b126c

Please sign in to comment.