diff --git a/AndroidBootstrap/build.gradle b/AndroidBootstrap/build.gradle index c7d23d2..5350800 100644 --- a/AndroidBootstrap/build.gradle +++ b/AndroidBootstrap/build.gradle @@ -2,18 +2,18 @@ apply plugin: 'com.android.library' apply from: 'push.gradle' android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion Integer.parseInt(TARGET_SDK_INT) + buildToolsVersion "25.0.1" defaultConfig { - minSdkVersion 14 - targetSdkVersion 23 + minSdkVersion Integer.parseInt(MIN_SDK_INT) + targetSdkVersion Integer.parseInt(TARGET_SDK_INT) versionCode = Integer.parseInt(VERSION_CODE) versionName = VERSION_NAME } } dependencies { - compile 'com.android.support:support-annotations:23.3.0' - compile 'com.android.support:support-v4:23.3.0' + compile 'com.android.support:support-annotations:25.0.1' + compile 'com.android.support:support-v4:25.0.1' } diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java index 7302aff..8471d4f 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/AwesomeTextView.java @@ -113,11 +113,13 @@ private void initialise(AttributeSet attrs) { markdownText = a.getString(R.styleable.AwesomeTextView_bootstrapText); setClickable(clickable); // allows view to reach android:state_pressed + + int gravity = a.getInt(R.styleable.AwesomeTextView_android_gravity, Gravity.CENTER); + setGravity(gravity); } finally { a.recycle(); } - setGravity(Gravity.CENTER); if (markdownText != null) { setMarkdownText(markdownText); diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapButton.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapButton.java index eb8f8bd..5dc1af1 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapButton.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapButton.java @@ -1,7 +1,6 @@ package com.beardedhen.androidbootstrap; import android.content.Context; -import android.content.DialogInterface; import android.content.res.TypedArray; import android.graphics.drawable.Drawable; import android.os.Bundle; @@ -10,7 +9,6 @@ import android.support.annotation.Nullable; import android.util.AttributeSet; import android.view.MotionEvent; -import android.view.View; import android.view.ViewParent; import com.beardedhen.androidbootstrap.api.attributes.BootstrapBrand; @@ -221,17 +219,12 @@ public void setSelected(boolean selected) { private boolean handleRadioEvent(@NonNull MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { - if (isSelected()) { - setSelected(false); - } - else { // notify parent to deselect any peers - setSelected(true); + setSelected(true); // notify parent to deselect any peers - ViewParent parent = getParent(); + ViewParent parent = getParent(); - if (parent instanceof BootstrapButtonGroup) { - ((BootstrapButtonGroup) parent).onRadioToggle(parentIndex); - } + if (parent instanceof BootstrapButtonGroup) { + ((BootstrapButtonGroup) parent).onRadioToggle(parentIndex); } return true; } diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDropDown.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDropDown.java index 303167d..33ce2c6 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDropDown.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapDropDown.java @@ -51,6 +51,7 @@ public class BootstrapDropDown extends AwesomeTextView implements View.OnClickLi private static final String REPLACE_REGEX_HEADER = "\\{dropdown_header\\}"; private static final String REPLACE_REGEX_SEPARATOR = "\\{dropdown_separator\\}"; private static final String REPLACE_REGEX_DISABLED = "\\{dropdown_disabled\\}"; + private static final int SCREEN_WIDTH_GUESS = 1000; private ExpandDirection expandDirection; private PopupWindow dropdownWindow; @@ -103,9 +104,16 @@ private void initialise(AttributeSet attrs) { int sizeOrdinal = a.getInt(R.styleable.BootstrapDropDown_bootstrapSize, -1); expandDirection = ExpandDirection.fromAttributeValue(directionOrdinal); - dropdownData = getContext().getResources().getStringArray(dataOrdinal); + bootstrapSize = DefaultBootstrapSize.fromAttributeValue(sizeOrdinal).scaleFactor(); itemHeight = a.getDimensionPixelSize(R.styleable.BootstrapDropDown_itemHeight, (int) DimenUtils.pixelsFromDpResource(getContext(), R.dimen.bootstrap_dropdown_default_item_height)); + + if (isInEditMode()) { + dropdownData = new String[] {"Android Studio", "Layout Preview", "Is Always", "Breaking"}; + } + else { + dropdownData = getContext().getResources().getStringArray(dataOrdinal); + } } finally { a.recycle(); @@ -120,9 +128,14 @@ private void initialise(AttributeSet attrs) { baselineVertPadding = DimenUtils.pixelsFromDpResource(getContext(), R.dimen.bootstrap_button_default_vert_padding); baselineHoriPadding = DimenUtils.pixelsFromDpResource(getContext(), R.dimen.bootstrap_button_default_hori_padding); - DisplayMetrics metrics = new DisplayMetrics(); - ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(metrics); - screenWidth = metrics.widthPixels; + if (isInEditMode()) { + screenWidth = SCREEN_WIDTH_GUESS; // take a sensible guess + } + else { + DisplayMetrics metrics = new DisplayMetrics(); + ((WindowManager) getContext().getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay().getMetrics(metrics); + screenWidth = metrics.widthPixels; + } createDropDown(); updateDropDownState(); @@ -133,8 +146,12 @@ private void createDropDown() { dropdownWindow = new PopupWindow(); dropdownWindow.setFocusable(true); dropdownWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT); - dropdownWindow.setBackgroundDrawable(DrawableUtils.resolveDrawable(android.R.drawable - .dialog_holo_light_frame, getContext())); + + if (!isInEditMode()) { + dropdownWindow.setBackgroundDrawable(DrawableUtils.resolveDrawable(android.R.drawable + .dialog_holo_light_frame, getContext())); + } + dropdownWindow.setContentView(dropdownView); dropdownWindow.setOnDismissListener(this); dropdownWindow.setAnimationStyle(android.R.style.Animation_Activity); @@ -155,14 +172,16 @@ private ScrollView createDropDownView() { int clickableChildCounter = 0; dropdownView.setOrientation(LinearLayout.VERTICAL); - LayoutParams childParams = new LayoutParams(LayoutParams.MATCH_PARENT, DimenUtils.pixelsToDp(itemHeight * bootstrapSize)); + int height = (int) (itemHeight * bootstrapSize); + LayoutParams childParams = new LayoutParams(LayoutParams.MATCH_PARENT, height); for (String text : dropdownData) { TextView childView = new TextView(getContext()); childView.setGravity(Gravity.CENTER_VERTICAL); childView.setLayoutParams(childParams); - childView.setPadding(DimenUtils.dpToPixels(baselineItemLeftPadding * bootstrapSize), 0, - DimenUtils.dpToPixels(baselineItemRightPadding * bootstrapSize), 0); + + int padding = (int) (baselineItemLeftPadding * bootstrapSize); + childView.setPadding(padding, 0, padding, 0); childView.setTextSize(baselineDropDownViewFontSize * bootstrapSize); childView.setTextColor(ColorUtils.resolveColor(android.R.color.black, getContext())); diff --git a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapLabel.java b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapLabel.java index e672490..7f41674 100644 --- a/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapLabel.java +++ b/AndroidBootstrap/src/main/java/com/beardedhen/androidbootstrap/BootstrapLabel.java @@ -49,7 +49,7 @@ private void initialise(AttributeSet attrs) { try { int attrValue = a.getInt(R.styleable.BootstrapLabel_bootstrapHeading, 5); - this.roundable = a.getBoolean(R.styleable.BootstrapButton_roundedCorners, false); + this.roundable = a.getBoolean(R.styleable.BootstrapLabel_roundedCorners, false); this.bootstrapHeading = DefaultBootstrapHeading.fromAttributeValue(attrValue); } diff --git a/AndroidBootstrap/src/main/res/values/attrs.xml b/AndroidBootstrap/src/main/res/values/attrs.xml index 962b1bc..3416594 100644 --- a/AndroidBootstrap/src/main/res/values/attrs.xml +++ b/AndroidBootstrap/src/main/res/values/attrs.xml @@ -63,6 +63,7 @@ + diff --git a/LICENSE.txt b/LICENSE.txt index bad8e4d..bf0bc33 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2015 Bearded Hen +Copyright (c) 2013-2016 Bearded Hen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/build.gradle b/build.gradle index 235868d..530152b 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:2.1.2' + classpath 'com.android.tools.build:gradle:2.2.3' } } diff --git a/gradle.properties b/gradle.properties index 3d0e407..fc56b86 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,10 @@ -VERSION_NAME=2.3.0 -VERSION_CODE=230 +VERSION_NAME=2.3.1 +VERSION_CODE=231 GROUP=com.beardedhen +MIN_SDK_INT=14 +TARGET_SDK_INT=25 + POM_DESCRIPTION=Bootstrap style widgets for Android, with Glyph Icons POM_URL=https://github.com/Bearded-Hen/Android-Bootstrap POM_SCM_URL=https://github.com/Bearded-Hen/Android-Bootstrap diff --git a/sample/build.gradle b/sample/build.gradle index 74b53bf..e8d5688 100644 --- a/sample/build.gradle +++ b/sample/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 23 - buildToolsVersion "23.0.3" + compileSdkVersion Integer.parseInt(TARGET_SDK_INT) + buildToolsVersion "25.0.1" defaultConfig { applicationId "com.fractalwrench.androidbootstrap.sample" - minSdkVersion 14 - targetSdkVersion 23 + minSdkVersion Integer.parseInt(MIN_SDK_INT) + targetSdkVersion Integer.parseInt(TARGET_SDK_INT) versionCode = Integer.parseInt(VERSION_CODE) versionName = VERSION_NAME } @@ -28,7 +28,9 @@ android { dependencies { compile project (':AndroidBootstrap') // replace with Maven dependency in your app - compile 'com.jakewharton:butterknife:7.0.1' - compile 'com.android.support:appcompat-v7:23.4.0' - compile 'com.android.support:support-annotations:23.4.0' + compile 'com.jakewharton:butterknife:8.4.0' + annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' + + compile 'com.android.support:appcompat-v7:25.0.1' + compile 'com.android.support:support-annotations:25.0.1' } diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/AwesomeTextViewExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/AwesomeTextViewExample.java index 691128b..04c32a7 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/AwesomeTextViewExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/AwesomeTextViewExample.java @@ -6,7 +6,7 @@ import com.beardedhen.androidbootstrap.BootstrapText; import com.beardedhen.androidbootstrap.font.MaterialIcons; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; import static com.beardedhen.androidbootstrap.font.FontAwesome.FA_ANCHOR; @@ -22,12 +22,12 @@ public class AwesomeTextViewExample extends BaseActivity { return R.layout.example_awesome_text_view; } - @Bind(R.id.example_fa_text_change) AwesomeTextView exampleChange; - @Bind(R.id.example_fa_text_flash) AwesomeTextView exampleFlash; - @Bind(R.id.example_fa_text_rotate) AwesomeTextView exampleRotate; - @Bind(R.id.example_fa_text_multi_change) AwesomeTextView exampleMultiChange; - @Bind(R.id.example_fa_text_builder) AwesomeTextView exampleBuilder; - @Bind(R.id.example_mix_and_match) AwesomeTextView mixAndMatch; + @BindView(R.id.example_fa_text_change) AwesomeTextView exampleChange; + @BindView(R.id.example_fa_text_flash) AwesomeTextView exampleFlash; + @BindView(R.id.example_fa_text_rotate) AwesomeTextView exampleRotate; + @BindView(R.id.example_fa_text_multi_change) AwesomeTextView exampleMultiChange; + @BindView(R.id.example_fa_text_builder) AwesomeTextView exampleBuilder; + @BindView(R.id.example_mix_and_match) AwesomeTextView mixAndMatch; private boolean android = true; private boolean wikipedia = true; diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapAlertExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapAlertExample.java index 539c27d..4ac1d86 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapAlertExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapAlertExample.java @@ -6,14 +6,14 @@ import com.beardedhen.androidbootstrap.BootstrapAlert; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; public class BootstrapAlertExample extends BaseActivity { public static final String TAG = "BootstrapAlertExample"; - @Bind(R.id.dynamic_alert) BootstrapAlert alert; + @BindView(R.id.dynamic_alert) BootstrapAlert alert; @Override protected int getContentLayoutId() { diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapBadgeExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapBadgeExample.java index a59d694..4ec014c 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapBadgeExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapBadgeExample.java @@ -7,14 +7,14 @@ import java.util.Random; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; public class BootstrapBadgeExample extends BaseActivity { - @Bind(R.id.xml_badge_button) BootstrapButton xmlBadgeButton; - @Bind(R.id.java_badge_button) BootstrapButton javaBadgeButton; - @Bind(R.id.lonely_badge) BootstrapBadge lonelyBadge; + @BindView(R.id.xml_badge_button) BootstrapButton xmlBadgeButton; + @BindView(R.id.java_badge_button) BootstrapButton javaBadgeButton; + @BindView(R.id.lonely_badge) BootstrapBadge lonelyBadge; @Override protected int getContentLayoutId() { diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapButtonExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapButtonExample.java index 26cdd50..5bdd4ef 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapButtonExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapButtonExample.java @@ -7,7 +7,7 @@ import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapBrand; import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapSize; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; public class BootstrapButtonExample extends BaseActivity { @@ -18,11 +18,11 @@ public class BootstrapButtonExample extends BaseActivity { private DefaultBootstrapSize size = DefaultBootstrapSize.LG; - @Bind(R.id.bbutton_example_corners) BootstrapButton exampleCorners; - @Bind(R.id.bbutton_example_outline) BootstrapButton exampleOutline; - @Bind(R.id.bbutton_example_size) BootstrapButton exampleSize; - @Bind(R.id.bbutton_example_theme) BootstrapButton exampleTheme; - @Bind(R.id.example_bbutton_custom_style) BootstrapButton exampleCustomStyle; + @BindView(R.id.bbutton_example_corners) BootstrapButton exampleCorners; + @BindView(R.id.bbutton_example_outline) BootstrapButton exampleOutline; + @BindView(R.id.bbutton_example_size) BootstrapButton exampleSize; + @BindView(R.id.bbutton_example_theme) BootstrapButton exampleTheme; + @BindView(R.id.example_bbutton_custom_style) BootstrapButton exampleCustomStyle; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapButtonGroupExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapButtonGroupExample.java index 8b74109..ddcbcca 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapButtonGroupExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapButtonGroupExample.java @@ -9,7 +9,7 @@ import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapBrand; import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapSize; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; public class BootstrapButtonGroupExample extends BaseActivity { @@ -20,18 +20,18 @@ public class BootstrapButtonGroupExample extends BaseActivity { private DefaultBootstrapSize size = DefaultBootstrapSize.MD; - @Bind(R.id.bbutton_group_orientation_change) BootstrapButtonGroup orientationChange; - @Bind(R.id.bbutton_group_size_change) BootstrapButtonGroup sizeChange; - @Bind(R.id.bbutton_group_outline_change) BootstrapButtonGroup outlineChange; - @Bind(R.id.bbutton_group_rounded_change) BootstrapButtonGroup roundedChange; - @Bind(R.id.bbutton_group_brand_change) BootstrapButtonGroup brandChange; - @Bind(R.id.bbutton_group_child_change) BootstrapButtonGroup childChange; + @BindView(R.id.bbutton_group_orientation_change) BootstrapButtonGroup orientationChange; + @BindView(R.id.bbutton_group_size_change) BootstrapButtonGroup sizeChange; + @BindView(R.id.bbutton_group_outline_change) BootstrapButtonGroup outlineChange; + @BindView(R.id.bbutton_group_rounded_change) BootstrapButtonGroup roundedChange; + @BindView(R.id.bbutton_group_brand_change) BootstrapButtonGroup brandChange; + @BindView(R.id.bbutton_group_child_change) BootstrapButtonGroup childChange; - @Bind(R.id.bbutton_group_checked_text) TextView checkedText; + @BindView(R.id.bbutton_group_checked_text) TextView checkedText; - @Bind(R.id.bbutton_group_checked1) BootstrapButton radioButton1; - @Bind(R.id.bbutton_group_checked2) BootstrapButton radioButton2; - @Bind(R.id.bbutton_group_checked3) BootstrapButton radioButton3; + @BindView(R.id.bbutton_group_checked1) BootstrapButton radioButton1; + @BindView(R.id.bbutton_group_checked2) BootstrapButton radioButton2; + @BindView(R.id.bbutton_group_checked3) BootstrapButton radioButton3; @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapCircleThumbnailExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapCircleThumbnailExample.java index cb96660..c4ab3bc 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapCircleThumbnailExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapCircleThumbnailExample.java @@ -10,7 +10,7 @@ import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapSize; import com.beardedhen.androidbootstrap.utils.DrawableUtils; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; import static com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapBrand.DANGER; @@ -32,13 +32,13 @@ public class BootstrapCircleThumbnailExample extends BaseActivity { return R.layout.example_bootstrap_circle_thumbnail; } - @Bind(R.id.bcircle_image_change_example) BootstrapCircleThumbnail imageChange; - @Bind(R.id.bcircle_theme_change_example) BootstrapCircleThumbnail themeChange; - @Bind(R.id.bcircle_border_change_example) BootstrapCircleThumbnail borderChange; - @Bind(R.id.bcircle_size_change_example) BootstrapCircleThumbnail sizeChange; - @Bind(R.id.bcircle_set_image_bitmap_example) BootstrapCircleThumbnail setBitmapExample; - @Bind(R.id.bcircle_set_image_drawable_example) BootstrapCircleThumbnail setDrawableExample; - @Bind(R.id.bcircle_set_image_resource_example) BootstrapCircleThumbnail setResourceExample; + @BindView(R.id.bcircle_image_change_example) BootstrapCircleThumbnail imageChange; + @BindView(R.id.bcircle_theme_change_example) BootstrapCircleThumbnail themeChange; + @BindView(R.id.bcircle_border_change_example) BootstrapCircleThumbnail borderChange; + @BindView(R.id.bcircle_size_change_example) BootstrapCircleThumbnail sizeChange; + @BindView(R.id.bcircle_set_image_bitmap_example) BootstrapCircleThumbnail setBitmapExample; + @BindView(R.id.bcircle_set_image_drawable_example) BootstrapCircleThumbnail setDrawableExample; + @BindView(R.id.bcircle_set_image_resource_example) BootstrapCircleThumbnail setResourceExample; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapEditTextExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapEditTextExample.java index 6b7fac8..ef0802c 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapEditTextExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapEditTextExample.java @@ -4,7 +4,7 @@ import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapBrand; import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapSize; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; import static com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapBrand.DANGER; @@ -23,10 +23,10 @@ public class BootstrapEditTextExample extends BaseActivity { private DefaultBootstrapSize size = DefaultBootstrapSize.MD; - @Bind(R.id.bedit_text_change_enabled) BootstrapEditText changeEnabled; - @Bind(R.id.bedit_text_change_round) BootstrapEditText changeRound; - @Bind(R.id.bedit_text_change_theme) BootstrapEditText changeTheme; - @Bind(R.id.bedit_text_change_size) BootstrapEditText sizeExample; + @BindView(R.id.bedit_text_change_enabled) BootstrapEditText changeEnabled; + @BindView(R.id.bedit_text_change_round) BootstrapEditText changeRound; + @BindView(R.id.bedit_text_change_theme) BootstrapEditText changeTheme; + @BindView(R.id.bedit_text_change_size) BootstrapEditText sizeExample; @OnClick(R.id.bedit_text_change_enabled_btn) void onChangeEnabledExampleClicked() { changeEnabled.setEnabled(!changeEnabled.isEnabled()); diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapLabelExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapLabelExample.java index d45b022..453a420 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapLabelExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapLabelExample.java @@ -4,7 +4,7 @@ import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapBrand; import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapHeading; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; import static com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapHeading.H1; @@ -20,9 +20,9 @@ public class BootstrapLabelExample extends BaseActivity { return R.layout.example_bootstrap_label; } - @Bind(R.id.example_blabel_change_color) BootstrapLabel lblChangeColor; - @Bind(R.id.example_blabel_change_heading) BootstrapLabel lblChangeHeading; - @Bind(R.id.example_blabel_change_rounded) BootstrapLabel lblChangeRounded; + @BindView(R.id.example_blabel_change_color) BootstrapLabel lblChangeColor; + @BindView(R.id.example_blabel_change_heading) BootstrapLabel lblChangeHeading; + @BindView(R.id.example_blabel_change_rounded) BootstrapLabel lblChangeRounded; @OnClick(R.id.example_blabel_change_heading) void onHeadingChangeClicked() { switch ((DefaultBootstrapHeading) lblChangeHeading.getBootstrapHeading()) { diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapProgressBarExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapProgressBarExample.java index a23e475..a02466f 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapProgressBarExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapProgressBarExample.java @@ -6,7 +6,7 @@ import java.util.Random; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; public class BootstrapProgressBarExample extends BaseActivity { @@ -49,12 +49,12 @@ public ChangeState next() { return R.layout.example_bootstrap_progress_bar; } - @Bind(R.id.example_progress_default) BootstrapProgressBar defaultExample; - @Bind(R.id.example_progress_animated) BootstrapProgressBar animatedExample; - @Bind(R.id.example_progress_striped) BootstrapProgressBar stripedExample; - @Bind(R.id.example_progress_striped_animated) BootstrapProgressBar stripedAnimExample; - @Bind(R.id.example_progress_change) BootstrapProgressBar changeExample; - @Bind(R.id.example_size_change) BootstrapProgressBar sizeExample; + @BindView(R.id.example_progress_default) BootstrapProgressBar defaultExample; + @BindView(R.id.example_progress_animated) BootstrapProgressBar animatedExample; + @BindView(R.id.example_progress_striped) BootstrapProgressBar stripedExample; + @BindView(R.id.example_progress_striped_animated) BootstrapProgressBar stripedAnimExample; + @BindView(R.id.example_progress_change) BootstrapProgressBar changeExample; + @BindView(R.id.example_size_change) BootstrapProgressBar sizeExample; @OnClick(R.id.example_progress_default_btn) void onDefaultClicked() { defaultExample.setProgress(randomProgress(defaultExample.getProgress(), 100)); diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapProgressBarGroupExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapProgressBarGroupExample.java index 352f3aa..c545b58 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapProgressBarGroupExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapProgressBarGroupExample.java @@ -8,21 +8,21 @@ import java.util.Random; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; public class BootstrapProgressBarGroupExample extends BaseActivity { - @Bind(R.id.example_progress_bar_group_add_group) + @BindView(R.id.example_progress_bar_group_add_group) BootstrapProgressBarGroup groupAdd; - @Bind(R.id.example_progress_bar_group_round_group) + @BindView(R.id.example_progress_bar_group_round_group) BootstrapProgressBarGroup groupRound; - @Bind(R.id.example_progress_bar_group_progress_1) + @BindView(R.id.example_progress_bar_group_progress_1) BootstrapProgressBar bootstrapProgressBar1; - @Bind(R.id.example_progress_bar_group_progress_2) + @BindView(R.id.example_progress_bar_group_progress_2) BootstrapProgressBar bootstrapProgressBar2; boolean rounded = false; diff --git a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapThumbnailExample.java b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapThumbnailExample.java index 9b2a3e9..216a520 100644 --- a/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapThumbnailExample.java +++ b/sample/src/main/java/com/fractalwrench/androidbootstrap/sample/BootstrapThumbnailExample.java @@ -10,7 +10,7 @@ import com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapSize; import com.beardedhen.androidbootstrap.utils.DrawableUtils; -import butterknife.Bind; +import butterknife.BindView; import butterknife.OnClick; import static com.beardedhen.androidbootstrap.api.defaults.DefaultBootstrapBrand.DANGER; @@ -30,14 +30,14 @@ public class BootstrapThumbnailExample extends BaseActivity { return R.layout.example_bootstrap_thumbnail; } - @Bind(R.id.bthumb_image_change_example) BootstrapThumbnail imageChange; - @Bind(R.id.bthumb_theme_change_example) BootstrapThumbnail themeChange; - @Bind(R.id.bthumb_border_change_example) BootstrapThumbnail borderChange; - @Bind(R.id.bthumb_rounded_change_example) BootstrapThumbnail roundedChange; - @Bind(R.id.bthumb_size_change_example) BootstrapThumbnail sizeChange; - @Bind(R.id.bthumb_set_image_bitmap_example) BootstrapThumbnail setBitmapExample; - @Bind(R.id.bthumb_set_image_drawable_example) BootstrapThumbnail setDrawableExample; - @Bind(R.id.bthumb_set_image_resource_example) BootstrapThumbnail setResourceExample; + @BindView(R.id.bthumb_image_change_example) BootstrapThumbnail imageChange; + @BindView(R.id.bthumb_theme_change_example) BootstrapThumbnail themeChange; + @BindView(R.id.bthumb_border_change_example) BootstrapThumbnail borderChange; + @BindView(R.id.bthumb_rounded_change_example) BootstrapThumbnail roundedChange; + @BindView(R.id.bthumb_size_change_example) BootstrapThumbnail sizeChange; + @BindView(R.id.bthumb_set_image_bitmap_example) BootstrapThumbnail setBitmapExample; + @BindView(R.id.bthumb_set_image_drawable_example) BootstrapThumbnail setDrawableExample; + @BindView(R.id.bthumb_set_image_resource_example) BootstrapThumbnail setResourceExample; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); diff --git a/sample/src/main/res/layout/example_awesome_text_view.xml b/sample/src/main/res/layout/example_awesome_text_view.xml index 6028965..0e3148f 100644 --- a/sample/src/main/res/layout/example_awesome_text_view.xml +++ b/sample/src/main/res/layout/example_awesome_text_view.xml @@ -140,7 +140,8 @@ style="@style/wrapping_fa_text" android:textSize="30dp" app:bootstrapBrand="primary" - app:bootstrapText="Escaped \{fa_facebook\} icon" + app:bootstrapText="Escaped \{fa_facebook\} icon (gravity=start)" + android:gravity="start" tools:ignore="SpUsage" /> diff --git a/sample/src/main/res/layout/example_bootstrap_button.xml b/sample/src/main/res/layout/example_bootstrap_button.xml index 8001331..eed987c 100644 --- a/sample/src/main/res/layout/example_bootstrap_button.xml +++ b/sample/src/main/res/layout/example_bootstrap_button.xml @@ -466,8 +466,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/micro_padding" - android:gravity="center" - android:text="Matching" + android:gravity="right" + android:text="Matching (gravity right)" app:bootstrapBrand="info" /> diff --git a/sample/src/main/res/layout/example_bootstrap_dropdown.xml b/sample/src/main/res/layout/example_bootstrap_dropdown.xml index a8ffaac..39535c8 100644 --- a/sample/src/main/res/layout/example_bootstrap_dropdown.xml +++ b/sample/src/main/res/layout/example_bootstrap_dropdown.xml @@ -1,161 +1,194 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + android:padding="8dp" + > + + android:scrollbars="none" + > + + android:orientation="horizontal" + > + + app:roundedCorners="true" + /> + app:roundedCorners="true" + /> + app:roundedCorners="true" + /> + + app:roundedCorners="true" + /> + + app:roundedCorners="true" + /> + + /> + + /> + + app:roundedCorners="true" + /> + + android:scrollbars="none" + > + + android:orientation="horizontal" + > + + /> + app:roundedCorners="true" + app:showOutline="true" + /> + app:roundedCorners="true" + app:showOutline="true" + /> + + app:roundedCorners="true" + app:showOutline="true" + /> + + app:roundedCorners="true" + app:showOutline="true" + /> \ No newline at end of file diff --git a/sample/src/main/res/layout/example_bootstrap_label.xml b/sample/src/main/res/layout/example_bootstrap_label.xml index 5bae3f4..cb50e31 100644 --- a/sample/src/main/res/layout/example_bootstrap_label.xml +++ b/sample/src/main/res/layout/example_bootstrap_label.xml @@ -244,8 +244,8 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/micro_padding" - android:gravity="center" - android:text="Match Parent" + android:gravity="end" + android:text="Match Parent (gravity end)" app:bootstrapBrand="primary" /> diff --git a/sample/src/main/res/values/strings.xml b/sample/src/main/res/values/strings.xml index c74be9c..966dd42 100644 --- a/sample/src/main/res/values/strings.xml +++ b/sample/src/main/res/values/strings.xml @@ -9,5 +9,17 @@ Fifth item {dropdown_separator} Separated item + Item 9 + Item 10 + Item 11 + Item 12 + Item 13 + Item 14 + Item 15 + Item 16 + Item 17 + Item 18 + Item 19 + Item 20