Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
orhanobut committed Jan 21, 2015
1 parent 163346e commit 77168d3
Showing 1 changed file with 40 additions and 17 deletions.
57 changes: 40 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
dialogplus
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-dialogplus-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1413)

DialogPlus
==========

Simple,easy dialog for android. Instead of using dialog/fragments, normal view will be shown as dialog. It's customizable and have 3 different content holder.
Expand All @@ -13,7 +15,7 @@ repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/"}
}
dependencies {
compile 'com.orhanobut:dialogplus:1.0.0-SNAPSHOT@aar'
compile 'com.orhanobut:dialogplus:1.1-SNAPSHOT@aar'
}
```

Expand All @@ -25,20 +27,20 @@ Basic default usage
ArrayAdapter<String> adapter = new ArrayAdapter<>(
this, R.layout.simple_list_item_1, new String[]{"Item 1", "Item 2","Item 3","Item 4"}
);
final DialogPlus dialog = new DialogPlus.Builder(this)
.setHolder(new ListHolder()) // Optional, default:BasicHolder
.setHeader(R.layout.header) // Optional
.setFooter(R.layout.footer) // Optional
.setCancelable(true) // Optional default:true
.setGravity(Gravity.BOTTOM) // Optional default:true
.setAdapter(adapter) // This must be called, Any adapter can be set.
.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(Object item, View view, int position) {
//todo
}
})
.create();
DialogPlus dialog = new DialogPlus.Builder(this)
.setHolder(new ListHolder()) // Optional, default:BasicHolder
.setHeader(R.layout.header) // Optional
.setFooter(R.layout.footer) // Optional
.setCancelable(true) // Optional default:true
.setGravity(Gravity.BOTTOM) // Optional default:true
.setAdapter(adapter) // This must be called, Any adapter can be set.
.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
//todo
}
})
.create();
dialog.show();
```

Expand All @@ -52,10 +54,31 @@ setHolder(new ListHolder())

- Use BasicHolder as content holder, BasicHolder is basically a listview mockup implementation by using linearlayout, there is no scrollable feature in this view and this should be used if you have only a few items.
```java
setHolder(new ListHolder())
setHolder(new BasicHolder())
```

- Use GridHolder if you want to use GridView for the dialog. You must set column number.
```java
setHolder(new GridHolder(COLUMN_NUMBER))
```


#### TODO
Check wiki

#### License
<pre>
Copyright 2014 Orhan Obut

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>

0 comments on commit 77168d3

Please sign in to comment.