11DialogAlchemy
22========
33
4+ [ ![ Release] ( https://jitpack.io/v/NeoLSN/DialogAlchemy.svg?style=flat )] ( https://jitpack.io/#NeoLSN/DialogAlchemy )
5+
6+ <img src =" https://github.com/NeoLSN/DialogAlchemy/raw/master/arts/device_portrait.png " height =" 300 " alt =" Portrait image " />
7+ <img src =" https://github.com/NeoLSN/DialogAlchemy/raw/master/arts/device_landscape.png " width =" 300 " alt =" Landscape image " />
8+
49This is a dialog utility library. It provides a easy way to let developers deal with screen rotation issue.
510
611Installation
@@ -12,28 +17,34 @@ repositories {
1217}
1318dependencies {
1419 ...
15- compile 'com.github.NeoLSN:DialogAlchemy:1.0 .0'
20+ compile 'com.github.NeoLSN:DialogAlchemy:1.1 .0'
1621}
1722```
1823API
1924--------
2025- Alchemist - Dialog fragment
21- - Material - Basic dialog model
22- - PhilosopherStone - A interface for custom view
26+ - Material - Basic dialog model for most of Android Dialog library
27+ - PhilosopherStone - There are two purpose for Philosopher Stone
28+ 1 . A interface for custom view (main purpose)
29+ 2 . Expand the Dialog library ability
30+ - Be a model, not be a controller
2331- TransmutationCircle - A interface for dialog creation factory
32+ 1 . Should satisfy Material model requirement
33+ 2 . At least process PhilosopherStone as a custom view
34+ 3 . Increase
2435- DialogAlchemy - A utility class to show a dialog
2536
2637Usage
2738--------
28- ##### Basic Usage
39+ #### Basic Usage
2940``` Java
3041 Material material = new Material .Builder (getActivity())
3142 .setTitle(" Dialog Title" )
3243 .setMessage(" Dialog message" )
3344 .setPositiveButton(android. R . string. ok, new DialogInterface .OnClickListener () {
3445 @Override
3546 public void onClick (DialogInterface dialog , int which ) {
36- ... do something ...
47+ ... Do something ...
3748 }
3849 })
3950 .setNegativeButton(android. R . string. cancel, null )
4253 Alchemist alchemist = DialogAlchemy . show(getFragmentManager(), material);
4354```
4455
45- ##### Advanced Usage
56+ #### Advanced Usage
4657``` Java
4758 // Create a custom view
4859 PhilosopherStone stone = new EditTextStone .Builder ()
5667 .setPositiveButton(android. R . string. ok, new DialogInterface .OnClickListener () {
5768 @Override
5869 public void onClick (DialogInterface dialog , int which ) {
59- ... do something ...
70+ ... Do something ...
6071 }
6172 })
6273 .setNegativeButton(android. R . string. cancel, null )
@@ -83,7 +94,7 @@ When ```DialogAlchemy.show()``` called, it will set a tag to ```Alchemist``` aut
8394 Material material = alchemist. getMaterial();
8495 Material . Builder builder = material. rebuild(this );
8596
86- // reset listner or callback in here
97+ // reset listener or callback in here
8798
8899 Material newMaterial = builder. build();
89100 alchemist. setMaterial(newMaterial);
@@ -109,7 +120,7 @@ When ```DialogAlchemy.show()``` called, it will set a tag to ```Alchemist``` aut
109120 Material material = alchemist. getMaterial();
110121 Material . Builder builder = material. rebuild(this );
111122
112- // reset listner or callback in here
123+ // reset listener or callback in here
113124
114125 Material newMaterial = builder. build();
115126 alchemist. setMaterial(newMaterial);
@@ -122,4 +133,34 @@ When ```DialogAlchemy.show()``` called, it will set a tag to ```Alchemist``` aut
122133
123134 super . onSaveInstanceState(outState);
124135 }
125- ```
136+ ```
137+ #### Set default TransmutationCircle
138+ ``` Java
139+ public class DemoApplication extends Application {
140+
141+ @Override
142+ public void onCreate () {
143+ super . onCreate();
144+ ...
145+ DialogAlchemy . setDefaultCircle(new MetalTransmutationCircle ());
146+ }
147+ }
148+ ```
149+
150+ License
151+ --------
152+
153+ Copyright (C) 2016 Jason Yang
154+ Copyright (C) 2007 The Android Open Source Project
155+
156+ Licensed under the Apache License, Version 2.0 (the "License");
157+ you may not use this file except in compliance with the License.
158+ You may obtain a copy of the License at
159+
160+ http://www.apache.org/licenses/LICENSE-2.0
161+
162+ Unless required by applicable law or agreed to in writing, software
163+ distributed under the License is distributed on an "AS IS" BASIS,
164+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
165+ See the License for the specific language governing permissions and
166+ limitations under the License.
0 commit comments