Skip to content

Commit

Permalink
仿iOS弹窗 version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
saiwu-bigkoo committed Aug 10, 2015
0 parents commit b1f2678
Show file tree
Hide file tree
Showing 57 changed files with 1,601 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# built application files
*.apk
*.ap_

# files for the dex VM
*.dex

# Java class files
*.class

# generated files
bin/
gen/

# Local configuration file (sdk path, etc)
local.properties

# Eclipse project files
.classpath
.project

# Android Studio
.idea/
.gradle
/*/local.properties
/*/out
build
/*/*/production
*.iml
*.iws
*.ipr
*~
*.swp
1 change: 1 addition & 0 deletions alertview/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
100 changes: 100 additions & 0 deletions alertview/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'

version = "1.0.0"

android {
compileSdkVersion 21
buildToolsVersion "20.0.0"

defaultConfig {
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}

def siteUrl = 'https://github.com/saiwu-bigkoo/Android-AlertView' // #CONFIG# // project homepage
def gitUrl = 'https://github.com/saiwu-bigkoo/Android-AlertView.git' // #CONFIG# // project git
group = "com.bigkoo"

install {
repositories.mavenInstaller {
// This generates POM.xml with proper parameters
pom {
project {
packaging 'aar'
name 'AlertView For Android' // #CONFIG# // project title
url siteUrl
// Set your license
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id 'sai' // #CONFIG# // your user id (you can write your nickname)
name 'sai.wu' // #CONFIG# // your user name
email 'sai.wu@bigkoo.com' // #CONFIG# // your email
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}

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

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

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

artifacts {
archives javadocJar
archives sourcesJar
}

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
bintray {
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven"
name = "AlertView" // #CONFIG# project name in jcenter
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["Apache-2.0"]
publish = true
}
}
17 changes: 17 additions & 0 deletions alertview/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/Sai/Documents/software/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
3 changes: 3 additions & 0 deletions alertview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.bigkoo.alertview">

</manifest>
26 changes: 26 additions & 0 deletions alertview/src/main/java/com/bigkoo/alertview/AlertAnimateUtil.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.bigkoo.alertview;

import android.view.Gravity;

/**
* Created by Sai on 15/8/9.
*/
public class AlertAnimateUtil {
private static final int INVALID = -1;
/**
* Get default animation resource when not defined by the user
*
* @param gravity the gravity of the dialog
* @param isInAnimation determine if is in or out animation. true when is is
* @return the id of the animation resource
*/
static int getAnimationResource(int gravity, boolean isInAnimation) {
switch (gravity) {
case Gravity.BOTTOM:
return isInAnimation ? R.anim.slide_in_bottom : R.anim.slide_out_bottom;
case Gravity.CENTER:
return isInAnimation ? R.anim.fade_in_center : R.anim.fade_out_center;
}
return INVALID;
}
}
Loading

0 comments on commit b1f2678

Please sign in to comment.