-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from orhanobut/oo/bee-settings
v1.4 changes
- Loading branch information
Showing
9 changed files
with
111 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package com.orhanobut.bee; | ||
|
||
import android.content.Context; | ||
import android.view.Gravity; | ||
|
||
/** | ||
* @author Orhan Obut | ||
*/ | ||
public class Settings { | ||
|
||
private static final int DEFAULT_BEE_SIZE = 80; | ||
|
||
private Context context; | ||
private int gravity = Gravity.CENTER_VERTICAL | Gravity.END; | ||
private int beeSize = DEFAULT_BEE_SIZE; | ||
private int[] beeMargin; | ||
|
||
public Settings(Context context) { | ||
this.context = context; | ||
} | ||
|
||
public Settings setBeePosition(int gravity) { | ||
this.gravity = gravity; | ||
return this; | ||
} | ||
|
||
public Settings setBeeMargin(int left, int top, int right, int bottom) { | ||
this.beeMargin = new int[]{left, top, right, bottom}; | ||
return this; | ||
} | ||
|
||
public Settings setBeeSize(int size) { | ||
this.beeSize = size; | ||
return this; | ||
} | ||
|
||
public void inject(Class<?> config) { | ||
new Bee(this).inject(config); | ||
} | ||
|
||
public Context getContext() { | ||
return context; | ||
} | ||
|
||
public int getGravity() { | ||
return gravity; | ||
} | ||
|
||
public int getBeeSize() { | ||
return beeSize; | ||
} | ||
|
||
public int[] getBeeMargin() { | ||
return beeMargin; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters