Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #379 from rey5137/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
rey5137 committed Jun 2, 2016
2 parents afed851 + acdf569 commit 308d755
Show file tree
Hide file tree
Showing 47 changed files with 774 additions and 419 deletions.
7 changes: 7 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -66,22 +66,16 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/cardview-v7/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.1.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.squareup.leakcanary/leakcanary-android/1.3.1/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
Expand Down
27 changes: 15 additions & 12 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
buildToolsVersion "23.0.3"

defaultConfig {
applicationId "com.rey.material.demo"
Expand All @@ -12,26 +12,29 @@ android {
versionName "0.0.5"
}

signingConfigs {
release {
storeFile file(MATERIAL_KEYSTORE_FILE)
storePassword MATERIAL_KEYSTORE_PASSWORD
keyAlias MATERIAL_KEYSTORE_ALIAS
keyPassword MATERIAL_KEYSTORE_PASSWORD
}
}

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

if(hasProperty('MATERIAL_KEYSTORE_FILE')) {
android.signingConfigs {
release {
storeFile file(MATERIAL_KEYSTORE_FILE)
storePassword MATERIAL_KEYSTORE_PASSWORD
keyAlias MATERIAL_KEYSTORE_ALIAS
keyPassword MATERIAL_KEYSTORE_PASSWORD
}
}

android.buildTypes.release.signingConfig signingConfigs.release
}
}

ext{
libSupportVersion = '23.1.1'
libSupportVersion = '23.4.0'
}

dependencies {
Expand Down
4 changes: 0 additions & 4 deletions app/src/main/java/com/rey/material/app/ContactEditText.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ public ContactEditText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}

public ContactEditText(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}

@Override
protected void init(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes){
mRecipientMap = new HashMap<>();
Expand Down
23 changes: 14 additions & 9 deletions app/src/main/java/com/rey/material/demo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.GravityCompat;
import android.support.v4.view.ViewPager;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
Expand All @@ -19,7 +18,6 @@
import android.widget.FrameLayout;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

import com.rey.material.app.ThemeManager;
import com.rey.material.app.ToolbarManager;
Expand Down Expand Up @@ -67,10 +65,12 @@ protected void onCreate(Bundle savedInstanceState) {
mToolbarManager.setNavigationManager(new ToolbarManager.ThemableNavigationManager(R.array.navigation_drawer, getSupportFragmentManager(), mToolbar, dl_navigator) {
@Override
public void onNavigationClick() {
if (mToolbarManager.getCurrentGroup() != R.id.tb_group_main)
mToolbarManager.setCurrentGroup(R.id.tb_group_main);
else
dl_navigator.openDrawer(GravityCompat.START);
// if (mToolbarManager.getCurrentGroup() != R.id.tb_group_main)
// mToolbarManager.setCurrentGroup(R.id.tb_group_main);
// else
// dl_navigator.openDrawer(GravityCompat.START);

mToolbarManager.setNavigationVisisble(false, true);
}

@Override
Expand Down Expand Up @@ -140,9 +140,14 @@ public boolean onOptionsItemSelected(MenuItem item) {
mToolbarManager.setCurrentGroup(R.id.tb_group_main);
break;
case R.id.tb_theme:
int theme = (ThemeManager.getInstance().getCurrentTheme() + 1) % ThemeManager.getInstance().getThemeCount();
ThemeManager.getInstance().setCurrentTheme(theme);
Toast.makeText(this, "Current theme: " + theme, Toast.LENGTH_SHORT).show();
if(mToolbarManager.isNavigationVisisble())
mToolbarManager.setNavigationVisisble(false, true);
else
mToolbarManager.setNavigationVisisble(true, true);

// int theme = (ThemeManager.getInstance().getCurrentTheme() + 1) % ThemeManager.getInstance().getThemeCount();
// ThemeManager.getInstance().setCurrentTheme(theme);
// Toast.makeText(this, "Current theme: " + theme, Toast.LENGTH_SHORT).show();
break;
}
return true;
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/res/menu/menu_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,6 @@
android:icon="@drawable/ic_autorenew_white_24dp"
android:title="Switch group"/>

<item
android:id="@+id/tb_theme"
app:showAsAction="always"
android:icon="@drawable/ic_visibility_white_24dp"
android:title="Change Theme"/>

</group>

<group
Expand All @@ -36,5 +30,11 @@
android:title="Done all"/>

</group>

<item
android:id="@+id/tb_theme"
app:showAsAction="always"
android:icon="@drawable/ic_visibility_white_24dp"
android:title="Change Theme"/>

</menu>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
// NOTE: Do not place your application dependencies here; they belong
Expand Down
29 changes: 1 addition & 28 deletions dist/bintray.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,6 @@
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

ext {
bintrayUser = BINTRAY_USERNAME
bintrayApiKey = BINTRAY_APIKEY
bintrayGpgPassword = GPG_PASSWORD

bintrayRepo = 'maven'
bintrayName = 'material'

publishedGroupId = 'com.github.rey5137'
libraryName = 'Material Library'
artifact = 'material'

libraryDescription = 'An Android library to bring Material Design UI to pre-Lolipop Android.'

siteUrl = 'https://github.com/rey5137/material'
gitUrl = 'https://github.com/rey5137/material.git'

libraryVersion = '1.2.2'

developerId = 'rey5137'
developerName = 'Rey Pham'
developerEmail = 'pea5137@gmail.com'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}
apply from: "$rootProject.projectDir/dist/distInfo.gradle"

group = publishedGroupId // Maven Group ID for the artifact

Expand Down
34 changes: 34 additions & 0 deletions dist/distInfo.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ext {
bintrayUser = project.hasProperty('BINTRAY_USERNAME') ? BINTRAY_USERNAME : ""
bintrayApiKey = project.hasProperty('BINTRAY_APIKEY') ? BINTRAY_APIKEY : ""
bintrayGpgPassword = project.hasProperty('GPG_PASSWORD') ? GPG_PASSWORD : ""

mavenUser = project.hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : ""
mavenPassword = project.hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : ""
mavenReleaseRepo = project.hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL : "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
mavenSnapshotRepo = project.hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL : "https://oss.sonatype.org/content/repositories/snapshots/"

bintrayRepo = 'maven'
bintrayName = 'material'

publishedGroupId = 'com.github.rey5137'
libraryName = 'Material Library'
artifact = 'material'
libraryPackaging = 'aar'

libraryDescription = 'An Android library to bring Material Design UI to pre-Lolipop Android.'

siteUrl = 'https://github.com/rey5137/material'
gitUrl = 'https://github.com/rey5137/material.git'

libraryVersion = '1.2.3'

developerId = 'rey5137'
developerName = 'Rey Pham'
developerEmail = 'pea5137@gmail.com'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
licenseDist = 'repo'
allLicenses = ["Apache-2.0"]
}
97 changes: 97 additions & 0 deletions dist/maven.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
* Copyright 2013 Chris Banes
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'maven'
apply plugin: 'signing'
apply from: "$rootProject.projectDir/dist/distInfo.gradle"

def isReleaseBuild() {
return libraryVersion.contains("SNAPSHOT") == false
}

afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

pom.groupId = publishedGroupId
pom.artifactId = artifact
pom.version = libraryVersion

repository(url: mavenReleaseRepo) {
authentication(userName: mavenUser, password: mavenPassword)
}
snapshotRepository(url: mavenSnapshotRepo) {
authentication(userName: mavenUser, password: mavenPassword)
}

pom.project {
name libraryName
packaging libraryPackaging
description libraryDescription
url siteUrl

scm {
url siteUrl
connection gitUrl
developerConnection gitUrl
}

licenses {
license {
name licenseName
url licenseUrl
distribution licenseDist
}
}

developers {
developer {
id developerId
name developerName
}
}
}
}
}
}

signing {
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
}

task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}

task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}

artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
}
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 Nov 30 10:42:23 ICT 2015
#Mon May 30 22:30:34 ICT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.9-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
Loading

0 comments on commit 308d755

Please sign in to comment.