Skip to content

Commit

Permalink
Merge pull request #3 from rcketscientist/bintray
Browse files Browse the repository at this point in the history
Bintray and fixes
  • Loading branch information
rcketscientist authored Feb 2, 2017
2 parents 8aaa3fd + cb41da4 commit 69353b8
Show file tree
Hide file tree
Showing 6 changed files with 153 additions and 85 deletions.
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,22 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0-beta3'
classpath 'com.novoda:bintray-release:0.4.0'
}
}

allprojects {
repositories {
jcenter()
}
}

ext {
compileSdkVersion = 25
buildToolsVersion = "25.0.2"
supportLibVersion = "25.1.1"
}

task clean(type: Delete) {
delete rootProject.buildDir
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Tue Jan 31 10:30:16 CET 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
25 changes: 25 additions & 0 deletions library/bintray.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apply plugin: 'com.novoda.bintray-release'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.novoda:bintray-release:0.4.0'
}
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())

publish {
groupId = 'com.anthonymandra'
artifactId = 'ToggleButtons'
licences = ['MIT']
publishVersion = libraryVersion
desc = 'Android toggle buttons that adhere to the Material Design documentation.'
website = 'https://github.com/rcketscientist/ToggleButtons'
dryRun = false;
bintrayUser = properties.getProperty('bintray.user')
bintrayKey = properties.getProperty('bintray.apikey')
}
27 changes: 23 additions & 4 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,37 @@
apply plugin: 'com.android.library'

ext {
versionMajor = 1
versionMinor = 1
versionPatch = 0

libraryCode = versionMajor * 1000000 + versionMinor * 1000 + versionPatch
libraryVersion = "${versionMajor}.${versionMinor}.${versionPatch}"
}

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"

versionCode libraryCode
versionName libraryVersion

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
}

dependencies {
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:cardview-v7:25.1.0'
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
compile "com.android.support:cardview-v7:${rootProject.ext.supportLibVersion}"
}

apply from: 'bintray.gradle'
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package android.support.v7.widget;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.TypedArray;
Expand All @@ -20,9 +21,10 @@

import static android.support.annotation.RestrictTo.Scope.LIBRARY_GROUP;

@SuppressWarnings("unused")
public class ToggleButton extends CompoundButton implements TintableCompoundButton {

private AppCompatCompoundButtonHelper mCompoundButtonHelper;
private final AppCompatCompoundButtonHelper mCompoundButtonHelper;
private CharSequence mTextOn;
private CharSequence mTextOff;

Expand All @@ -36,6 +38,7 @@ public ToggleButton(Context context, AttributeSet attrs) {

}

@SuppressLint("RestrictedApi")
public ToggleButton(Context context, AttributeSet attrs, int defStyleAttr) {
super(TintContextWrapper.wrap(context), attrs, defStyleAttr);
mCompoundButtonHelper = new AppCompatCompoundButtonHelper(this);
Expand Down Expand Up @@ -131,6 +134,7 @@ private void syncTextState() {
*
* @return The text.
*/
@SuppressWarnings("WeakerAccess")
public CharSequence getTextOn() {
return mTextOn;
}
Expand All @@ -149,6 +153,7 @@ public void setTextOn(CharSequence textOn) {
*
* @return The text.
*/
@SuppressWarnings("WeakerAccess")
public CharSequence getTextOff() {
return mTextOff;
}
Expand Down
Loading

0 comments on commit 69353b8

Please sign in to comment.