Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
quangctkm9207 committed Mar 30, 2017
0 parents commit add8712
Show file tree
Hide file tree
Showing 51 changed files with 1,296 additions and 0 deletions.
90 changes: 90 additions & 0 deletions .gitignore
@@ -0,0 +1,90 @@
# Created by https://www.gitignore.io

### Android ###

# Files for the Dalvik VM
*.dex

# Java class files
*.class

# Generated files
bin/
gen/

# Gradle files
.gradle/
build/

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

# Proguard folder generated by Eclipse
proguard/

# Log Files
*.log


### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml

# Ignore Gradle GUI config
gradle-app.setting

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

*.DS_Store

*.jks
Empty file added CHANGELOG.md
Empty file.
15 changes: 15 additions & 0 deletions LICENSE.txt
@@ -0,0 +1,15 @@
Copyright (c) 2017 Aromajoin

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

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
71 changes: 71 additions & 0 deletions README.md
@@ -0,0 +1,71 @@
# ActionSheet for Android

[![Download](https://api.bintray.com/packages/quangnguyen/maven/actionsheet-android/images/download.svg) ](https://bintray.com/quangnguyen/maven/actionsheet-android/_latestVersion)
[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg?style=flat-square)](https://www.apache.org/licenses/LICENSE-2.0.html)

**A small library which creates iPad-style ActionSheet for Android apps**

![Screenshots](https://raw.githubusercontent.com/aromajoin/actionsheet-android/master/screenshots/screenshot.png)

# Table of Contents
1. [Download](#download)
2. [Usage](#usage)


## Download

The Gradle dependency is available via jCenter.
```gradle
compile 'com.aromajoin.library:actionsheet:0.0.1'
```
## Usage


```java

// Sets it up
ActionSheet actionSheet = new ActionSheet(context);
actionSheet.setTitle(title);
actionSheet.setSourceView(anchorView);

// Adds as many actions as you need...
actionSheet.addAction(actionTitle, actionStyle, actionListener);

// Shows it. Done.
actionSheet.show();
```

If you don't like default colors, add these following to your styles.xml, under *your app's theme*.
```xml
<style name="YourAppTheme">
<!-- Other properties .... -->

<!-- Customize Action Sheet view-->
<item name="asTitleColor">color</item>
<item name="asDefaultColor">color</item>
<item name="asDestructiveColor">color</item>
</style>
```

Please check out sample project if you need more details.

-----
## License

The Apache License (Apache)

Copyright (c) 2017 Aromajoin Corporation

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

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions actionsheet/.gitignore
@@ -0,0 +1 @@
/build
76 changes: 76 additions & 0 deletions actionsheet/build.gradle
@@ -0,0 +1,76 @@
apply plugin: 'com.android.library'

// Manifest version information
def versionMajor = 0
def versionMinor = 0
def versionPatch = 1

// Maven and Bintray plugins
buildscript {
repositories{
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}

/**
* bintray configuration
*/
ext {

bintrayRepo = 'maven'
bintrayName = 'actionsheet-android'

publishedGroupId = 'com.aromajoin.library'
libraryName = 'ActionSheet Android'
artifact = 'actionsheet' //This artifact name should be the same with library module name

libraryDescription = 'ActionSheet view for Android apps'

siteUrl = 'https://github.com/aromajoin/actionsheet-android/'
gitUrl = 'https://github.com/aromajoin/actionsheet-android.git'

libraryVersion = "${versionMajor}.${versionMinor}.${versionPatch}"

developerId = 'quangctkm9207'
developerName = 'Quang Nguyen'
developerEmail = 'quangnguyen@aromajoin.com'

licenseName = 'The Apache Software License, Version 2.0'
licenseUrl = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
allLicenses = ["Apache-2.0"]
}

/**
* Project configuration
*/
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
}
buildTypes {

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

}

dependencies {
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
}

//use gradle distribution configuration files on a remote Github repository
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/install.gradle'
apply from: 'https://raw.githubusercontent.com/quangctkm9207/template-files/master/android/gradle/bintray.gradle'
25 changes: 25 additions & 0 deletions actionsheet/proguard-rules.pro
@@ -0,0 +1,25 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/user/Library/Android/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 *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -0,0 +1,26 @@
package com.aromajoin.actionsheet;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.aromajoin.actionsheet.test", appContext.getPackageName());
}
}
10 changes: 10 additions & 0 deletions actionsheet/src/main/AndroidManifest.xml
@@ -0,0 +1,10 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.aromajoin.actionsheet">

<application android:allowBackup="true" android:label="@string/app_name"
android:supportsRtl="true">

</application>

</manifest>

0 comments on commit add8712

Please sign in to comment.