Skip to content

Commit

Permalink
Update build tool
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFinestArtist committed Oct 25, 2015
1 parent 1437d5a commit 5edecda
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 54 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.novoda:bintray-release:0.2.5'
classpath 'com.android.tools.build:gradle:1.3.0'
classpath 'com.novoda:bintray-release:0.3.4'
}
}

Expand Down
6 changes: 3 additions & 3 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
apply plugin: 'bintray-release'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
minSdkVersion 3
targetSdkVersion 21
targetSdkVersion 23
versionCode 1
versionName "1.0.0"
}
Expand Down
18 changes: 12 additions & 6 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,18 @@ apply plugin: 'crashlytics'

repositories {
maven { url 'http://download.crashlytics.com/maven' }
maven { url "https://jitpack.io" }
}


android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.thefinestartist.movingbutton.sample"
minSdkVersion 8
targetSdkVersion 21
targetSdkVersion 23
versionCode 3
versionName "1.0.0"
}
Expand All @@ -37,8 +38,13 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':library')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.jakewharton:butterknife:5.1.2'
compile 'com.afollestad:material-dialogs:0.6.2.4'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.jakewharton:butterknife:7.0.1'
compile('com.afollestad.material-dialogs:core:0.8.1.0@aar') {
transitive = true
}
compile('com.afollestad.material-dialogs:commons:0.8.1.0@aar') {
transitive = true
}
compile 'com.crashlytics.android:crashlytics:1.+'
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,61 +12,61 @@
import com.thefinestartist.movingbutton.enums.ButtonPosition;
import com.thefinestartist.movingbutton.enums.MoveDirection;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.InjectView;


public class MainActivity extends ActionBarActivity {

@InjectView(R.id.toolbar)
@Bind(R.id.toolbar)
Toolbar toolbar;
@InjectView(R.id.moving_button)
@Bind(R.id.moving_button)
MovingButton movingButton;
@InjectView(R.id.current_position_info)
@Bind(R.id.current_position_info)
TextView currentPositionInfo;
@InjectView(R.id.move_direction_bt)
@Bind(R.id.move_direction_bt)
View moveDirectionBt;
@InjectView(R.id.move_direction_tv)
@Bind(R.id.move_direction_tv)
TextView moveDirectionTv;
@InjectView(R.id.movement_left_bt)
@Bind(R.id.movement_left_bt)
View movementLeftBt;
@InjectView(R.id.movement_left_tv)
@Bind(R.id.movement_left_tv)
TextView movementLeftTv;
@InjectView(R.id.movement_right_bt)
@Bind(R.id.movement_right_bt)
View movementRightBt;
@InjectView(R.id.movement_right_tv)
@Bind(R.id.movement_right_tv)
TextView movementRightTv;
@InjectView(R.id.movement_top_bt)
@Bind(R.id.movement_top_bt)
View movementTopBt;
@InjectView(R.id.movement_top_tv)
@Bind(R.id.movement_top_tv)
TextView movementTopTv;
@InjectView(R.id.movement_bottom_bt)
@Bind(R.id.movement_bottom_bt)
View movementBottomBt;
@InjectView(R.id.movement_bottom_tv)
@Bind(R.id.movement_bottom_tv)
TextView movementBottomTv;
@InjectView(R.id.movement_inner_offset_bt)
@Bind(R.id.movement_inner_offset_bt)
View innerOffsetBt;
@InjectView(R.id.movement_inner_offset_tv)
@Bind(R.id.movement_inner_offset_tv)
TextView innerOffsetTv;
@InjectView(R.id.movement_outer_offset_bt)
@Bind(R.id.movement_outer_offset_bt)
View outerOffsetBt;
@InjectView(R.id.movement_outer_offset_tv)
@Bind(R.id.movement_outer_offset_tv)
TextView outerOffsetTv;
@InjectView(R.id.volume_bt)
@Bind(R.id.volume_bt)
View volumeBt;
@InjectView(R.id.volume_tv)
@Bind(R.id.volume_tv)
TextView volumeTv;
@InjectView(R.id.vibration_duration_bt)
@Bind(R.id.vibration_duration_bt)
View vibrationDurationBt;
@InjectView(R.id.vibration_duration_tv)
@Bind(R.id.vibration_duration_tv)
TextView vibrationDurationTv;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Crashlytics.start(this);
setContentView(R.layout.activity_main);
ButterKnife.inject(this);
ButterKnife.bind(this);
setSupportActionBar(toolbar);

movingButton.setOnPositionChangedListener(new MovingButton.OnPositionChangedListener() {
Expand All @@ -82,12 +82,13 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.move_direction))
.items(getMoveDirectionNames())
.itemsCallbackSingleChoice(movingButton.getMoveDirection().ordinal(), new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(movingButton.getMoveDirection().ordinal(), new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog dialog, View view, int which, CharSequence text) {
MoveDirection moveDirection = MoveDirection.values()[which];
movingButton.setMoveDirection(moveDirection);
moveDirectionTv.setText(moveDirection.name());
return true;
}
})
.positiveText(getString(R.string.choose))
Expand All @@ -101,11 +102,12 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.movement_left))
.items(getDPLists())
.itemsCallbackSingleChoice(dpFromPx(movingButton.getMovementLeft()) + 10, new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(dpFromPx(movingButton.getMovementLeft()) + 10, new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
movingButton.setMovementLeft(pxFromDp(which - 10));
movementLeftTv.setText("" + (which - 10) + "dp");
return true;
}
})
.positiveText(getString(R.string.choose))
Expand All @@ -119,11 +121,12 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.movement_right))
.items(getDPLists())
.itemsCallbackSingleChoice(dpFromPx(movingButton.getMovementRight()) + 10, new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(dpFromPx(movingButton.getMovementRight()) + 10, new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
movingButton.setMovementRight(pxFromDp(which - 10));
movementRightTv.setText("" + (which - 10) + "dp");
return true;
}
})
.positiveText(getString(R.string.choose))
Expand All @@ -137,11 +140,12 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.movement_top))
.items(getDPLists())
.itemsCallbackSingleChoice(dpFromPx(movingButton.getMovementTop()) + 10, new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(dpFromPx(movingButton.getMovementTop()) + 10, new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
movingButton.setMovementTop(pxFromDp(which - 10));
movementTopTv.setText("" + (which - 10) + "dp");
return true;
}
})
.positiveText(getString(R.string.choose))
Expand All @@ -155,11 +159,12 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.movement_bottom))
.items(getDPLists())
.itemsCallbackSingleChoice(dpFromPx(movingButton.getMovementBottom()) + 10, new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(dpFromPx(movingButton.getMovementBottom()) + 10, new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
movingButton.setMovementBottom(pxFromDp(which - 10));
movementBottomTv.setText("" + (which - 10) + "dp");
return true;
}
})
.positiveText(getString(R.string.choose))
Expand All @@ -173,11 +178,12 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.inner_offset))
.items(getDPLists2())
.itemsCallbackSingleChoice(dpFromPx(movingButton.getOffSetInner()), new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(dpFromPx(movingButton.getOffSetInner()), new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
movingButton.setOffSetInner(pxFromDp(which));
innerOffsetTv.setText("" + which + "dp");
return true;
}
})
.positiveText(getString(R.string.choose))
Expand All @@ -191,11 +197,12 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.outer_offset))
.items(getDPLists2())
.itemsCallbackSingleChoice(dpFromPx(movingButton.getOffSetOuter()), new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(dpFromPx(movingButton.getOffSetOuter()), new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
movingButton.setOffSetOuter(pxFromDp(which));
outerOffsetTv.setText("" + which + "dp");
return true;
}
})
.positiveText(getString(R.string.choose))
Expand All @@ -209,11 +216,12 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.volume))
.items(getVolumeLists())
.itemsCallbackSingleChoice(movingButton.getEventVolume(), new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(movingButton.getEventVolume(), new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
movingButton.setEventVolume(which);
volumeTv.setText("" + which);
return true;
}
})
.positiveText(getString(R.string.choose))
Expand All @@ -227,11 +235,12 @@ public void onClick(View v) {
new MaterialDialog.Builder(MainActivity.this)
.title(getString(R.string.vibration_duration))
.items(getVibrationLists())
.itemsCallbackSingleChoice(movingButton.getVibrationDuration(), new MaterialDialog.ListCallback() {
.itemsCallbackSingleChoice(movingButton.getVibrationDuration(), new MaterialDialog.ListCallbackSingleChoice() {
@Override
public void onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
public boolean onSelection(MaterialDialog materialDialog, View view, int which, CharSequence text) {
movingButton.setVibrationDuration(which);
vibrationDurationTv.setText(which + " Milliseconds");
return true;
}
})
.positiveText(getString(R.string.choose))
Expand Down
3 changes: 1 addition & 2 deletions sample/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
<resources>

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@android:color/white</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:textColorPrimary">@color/primary_text</item>
<item name="android:textColorSecondary">@color/secondary_text</item>
<item name="windowActionBar">false</item>

<item name="md_background_color">@android:color/white</item>
<item name="md_title_color">@color/primary_text</item>
Expand Down

0 comments on commit 5edecda

Please sign in to comment.