Skip to content

Commit 41c405e

Browse files
font file now included in library project, removes need for copy and paste to project
1 parent e6c69d5 commit 41c405e

13 files changed

+43
-106
lines changed
Binary file not shown.

AndroidBootstrap/res/layout/row_title.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

AndroidBootstrap/res/layout/row_title_and_subtitle.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

AndroidBootstrap/res/layout/row_two_columns.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

AndroidBootstrap/src/com/beardedhen/androidbootstrap/BootstrapButton.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public class BootstrapButton extends FrameLayout {
1818
private TextView lblLeft;
1919
private ViewGroup layout;
2020
private boolean roundedCorners = false;
21-
private boolean fillparent = false;
2221

2322
private enum BootstrapType {
2423
DEFAULT("default", R.drawable.bbuton_default, R.drawable.bbuton_default_rounded, R.color.black),
@@ -29,10 +28,10 @@ private enum BootstrapType {
2928
DANGER("danger", R.drawable.bbuton_danger, R.drawable.bbuton_danger_rounded, R.color.white),
3029
INVERSE("inverse", R.drawable.bbuton_inverse, R.drawable.bbuton_inverse_rounded, R.color.white);
3130

32-
private String type;
33-
private int normalBg;
34-
private int roundedBg;
35-
private int textColour;
31+
private final String type;
32+
private final int normalBg;
33+
private final int roundedBg;
34+
private final int textColour;
3635

3736
BootstrapType(String type, int normalBg, int roundedBg, int textColour) {
3837
this.type = type;
@@ -70,10 +69,10 @@ private enum BootstrapSize {
7069
SMALL("small", 12.0f, 5, 10),
7170
XSMALL("xsmall", 10.0f, 2, 5);
7271

73-
private float fontSize;
74-
private String type;
75-
private int paddingA;
76-
private int paddingB;
72+
private final float fontSize;
73+
private final String type;
74+
private final int paddingA;
75+
private final int paddingB;
7776

7877
private BootstrapSize(String type, float fontSize, int paddingA, int paddingB) {
7978
this.type = type;
@@ -153,7 +152,7 @@ private void initialise(AttributeSet attrs) {
153152
size = (size == null) ? "default" : size;
154153

155154
int layoutWidth = a.getLayoutDimension(R.styleable.BootstrapButton_android_layout_width, 0);
156-
fillparent = (layoutWidth == LayoutParams.MATCH_PARENT);
155+
boolean fillparent = (layoutWidth == LayoutParams.MATCH_PARENT);
157156

158157
Float layoutWeight = a.getFloat(R.styleable.BootstrapButton_android_layout_weight, -1);
159158
fillparent = (layoutWeight != -1) || fillparent;
@@ -335,14 +334,16 @@ public void setBootstrapButtonEnabled(boolean enabled) {
335334
public void setTextGravity(String gravity) {
336335
int gravityId = -1;
337336

338-
if (gravity.equals("left")) {
339-
gravityId = Gravity.LEFT;
340-
}
341-
else if (gravity.equals("center")) {
342-
gravityId = Gravity.CENTER_HORIZONTAL;
343-
}
344-
else if (gravity.equals("right")) {
345-
gravityId = Gravity.RIGHT;
337+
switch (gravity) {
338+
case "left":
339+
gravityId = Gravity.LEFT;
340+
break;
341+
case "center":
342+
gravityId = Gravity.CENTER_HORIZONTAL;
343+
break;
344+
case "right":
345+
gravityId = Gravity.RIGHT;
346+
break;
346347
}
347348

348349
if (gravityId != -1) {

AndroidBootstrap/src/com/beardedhen/androidbootstrap/BootstrapCircleThumbnail.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ private enum BootstrapCircleType {
2222
LARGE("large", 6, 112),
2323
XLARGE("xlarge", 8, 176);
2424

25-
private String type;
26-
private int padding;
27-
private int diameter;
25+
private final String type;
26+
private final int padding;
27+
private final int diameter;
2828

2929
private BootstrapCircleType(String type, int padding, int diameter) {
3030
this.type = type;
@@ -128,8 +128,8 @@ private void initialise(AttributeSet attrs) {
128128
//make inner image smaller to compensate for the padding so that entire circle including padding equals the size
129129
//ex. small image = 48dp, small padding = 4dp, inner image = 48 - (4 * 2) = 40
130130
if (!this.minimal) {
131-
imageSizeWidthPX = imageSizeWidthPX - (paddingPX * 2);
132-
imageSizeHeightPX = imageSizeHeightPX - (paddingPX * 2);
131+
imageSizeWidthPX -= (paddingPX * 2);
132+
imageSizeHeightPX -= (paddingPX * 2);
133133

134134
container.setPadding(paddingPX, paddingPX, paddingPX, paddingPX);
135135
container.setBackgroundResource(R.drawable.thumbnail_circle_container);
@@ -180,8 +180,8 @@ public void setImage(Bitmap bitmap) {
180180
int paddingPX = (int) ((this.padding * scale) + 0.5);
181181

182182
if (!this.minimal) {
183-
widthPX = widthPX - (paddingPX * 2);
184-
heightPX = heightPX - (paddingPX * 2);
183+
widthPX -= (paddingPX * 2);
184+
heightPX -= (paddingPX * 2);
185185
}
186186

187187
Bitmap roundBitmap = ImageUtils.getCircleBitmap(bitmap, widthPX, heightPX);

AndroidBootstrap/src/com/beardedhen/androidbootstrap/BootstrapEditText.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ private enum TextState {
1515
WARNING("warning", R.drawable.edittext_background_rounded_warning, R.drawable.edittext_background_warning),
1616
DANGER("danger", R.drawable.edittext_background_rounded_danger, R.drawable.edittext_background_danger);
1717

18-
private String state;
19-
private int roundedBg;
20-
private int normalBg;
18+
private final String state;
19+
private final int roundedBg;
20+
private final int normalBg;
2121

2222
private TextState(String state, int roundedBg, int normalBg) {
2323
this.state = state;
@@ -166,11 +166,14 @@ public void setDefault() {
166166
}
167167

168168
/**
169+
* THIS METHOD IS DEPRECATED AND WILL BE REMOVED IN A FUTURE RELEASE.
170+
* Use setEnabled() instead.
171+
*
169172
* Specifies whether the BootstrapEditText is enabled or disabled
170173
*
171174
* @param enabled - boolean state for either enabled or disabled
172175
*/
173-
public void setBootstrapEditTextEnabled(boolean enabled) {
176+
@Deprecated public void setBootstrapEditTextEnabled(boolean enabled) {
174177
this.setEnabled(enabled);
175178
}
176179

AndroidBootstrap/src/com/beardedhen/androidbootstrap/BootstrapThumbnail.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ private enum ThumbnailTypes {
2323
ROUNDED(R.drawable.bthumbnail_container_rounded, R.drawable.bthumbnail_placeholder_default),
2424
SQUARE(R.drawable.bthumbnail_container_square, R.drawable.bthumbnail_placeholder_default);
2525

26-
private int containerDrawable;
27-
private int placeholderDrawable;
26+
private final int containerDrawable;
27+
private final int placeholderDrawable;
2828

2929
ThumbnailTypes(int containerDrawable, int placeholderDrawable) {
3030
this.containerDrawable = containerDrawable;

AndroidBootstrap/src/com/beardedhen/androidbootstrap/FontAwesome.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
public class FontAwesome {
1111

12-
private static Map<String, String> faMap = new HashMap<String, String>();
12+
private static final Map<String, String> faMap = new HashMap<>();
1313

1414
private static Typeface font;
1515

AndroidBootstrap/src/com/beardedhen/androidbootstrap/FontAwesomeText.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ public enum AnimationSpeed {
2222
MEDIUM(1000, 500),
2323
SLOW(2000, 1000);
2424

25-
private long rotateDuration;
26-
private long flashDuration;
25+
private final long rotateDuration;
26+
private final long flashDuration;
2727

2828
private AnimationSpeed(long rotateDuration, long flashDuration) {
2929
this.rotateDuration = rotateDuration;

AndroidBootstrap/src/com/beardedhen/androidbootstrap/utils/AutoResizeTextView.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private interface SizeTester {
3030
public int onTestSize(int suggestedSize, RectF availableSpace);
3131
}
3232

33-
private RectF mTextRect = new RectF();
33+
private final RectF mTextRect = new RectF();
3434

3535
private RectF mAvailableSpaceRect;
3636

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ Alternatively you can use Android Bootstrap as a library project by downloading
2727

2828
### Usage
2929

30-
1. Copy [__fontawesome-webfont.ttf__](https://github.com/Bearded-Hen/Android-Bootstrap/raw/master/fontawesome-webfont.ttf) into the __assets folder__ of your project, as otherwise __FontAwesome won't work__. In a default Android Studio project this should be located at __app/src/main/assets__
31-
32-
2. Paste the following XML into a layout file to create a BootstrapButton:
30+
1. Paste the following XML into a layout file to create a BootstrapButton:
3331

3432
```xml
3533
<!-- basic button -->
@@ -43,13 +41,13 @@ Alternatively you can use Android Bootstrap as a library project by downloading
4341
/>
4442
```
4543

46-
3. Add the bootstrap namespace to the root view of your layout:
44+
2. Add the bootstrap namespace to the root view of your layout:
4745

4846
```xml
4947
xmlns:bootstrap="http://schemas.android.com/apk/res-auto"
5048
```
5149

52-
4. Build and run the app.
50+
3. Build and run the app.
5351

5452
## More Information
5553

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ buildscript {
44
mavenCentral()
55
}
66
dependencies {
7-
classpath 'com.android.tools.build:gradle:1.0.0'
7+
classpath 'com.android.tools.build:gradle:1.1.0'
88
}
99
}
1010

0 commit comments

Comments
 (0)