Permalink
Browse files

init commit

  • Loading branch information...
frogermcs committed Mar 21, 2016
0 parents commit 211bad09b1e34de3adb44721fc4654e97cc99a4c
Showing with 677 additions and 0 deletions.
  1. +8 −0 .gitignore
  2. +1 −0 app/.gitignore
  3. +27 −0 app/build.gradle
  4. +17 −0 app/proguard-rules.pro
  5. +13 −0 app/src/androidTest/java/com/azimolabs/keyboardwatcher/ApplicationTest.java
  6. +19 −0 app/src/main/AndroidManifest.xml
  7. +36 −0 app/src/main/java/com/azimolabs/keyboardwatcher/sample/MainActivity.java
  8. +38 −0 app/src/main/res/layout/activity_main.xml
  9. BIN app/src/main/res/mipmap-hdpi/ic_launcher.png
  10. BIN app/src/main/res/mipmap-mdpi/ic_launcher.png
  11. BIN app/src/main/res/mipmap-xhdpi/ic_launcher.png
  12. BIN app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  13. BIN app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  14. +6 −0 app/src/main/res/values-w820dp/dimens.xml
  15. +6 −0 app/src/main/res/values/colors.xml
  16. +5 −0 app/src/main/res/values/dimens.xml
  17. +3 −0 app/src/main/res/values/strings.xml
  18. +11 −0 app/src/main/res/values/styles.xml
  19. +15 −0 app/src/test/java/com/azimolabs/keyboardwatcher/ExampleUnitTest.java
  20. +23 −0 build.gradle
  21. +18 −0 gradle.properties
  22. BIN gradle/wrapper/gradle-wrapper.jar
  23. +6 −0 gradle/wrapper/gradle-wrapper.properties
  24. +160 −0 gradlew
  25. +90 −0 gradlew.bat
  26. +1 −0 keyboardwatcher/.gitignore
  27. +24 −0 keyboardwatcher/build.gradle
  28. +17 −0 keyboardwatcher/proguard-rules.pro
  29. +13 −0 keyboardwatcher/src/androidTest/java/com/azimolabs/keyboardwatcher/ApplicationTest.java
  30. +11 −0 keyboardwatcher/src/main/AndroidManifest.xml
  31. +93 −0 keyboardwatcher/src/main/java/com/azimolabs/keyboardwatcher/KeyboardWatcher.java
  32. +15 −0 keyboardwatcher/src/test/java/com/azimolabs/keyboardwatcher/ExampleUnitTest.java
  33. +1 −0 settings.gradle
@@ -0,0 +1,8 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
@@ -0,0 +1 @@
/build
@@ -0,0 +1,27 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.azimolabs.keyboardwatcher.sample"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile project(':keyboardwatcher')
}
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/froger_mcs/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 *;
#}
@@ -0,0 +1,13 @@
package com.azimolabs.keyboardwatcher;
import android.app.Application;
import android.test.ApplicationTestCase;
/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.azimolabs.keyboardwatcher.sample"
xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
@@ -0,0 +1,36 @@
package com.azimolabs.keyboardwatcher.sample;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;
import com.azimolabs.keyboardwatcher.KeyboardWatcher;
public class MainActivity extends AppCompatActivity implements KeyboardWatcher.OnKeyboardToggleListener {
private TextView textView;
private KeyboardWatcher keyboardWatcher;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = (TextView) findViewById(R.id.textView);
keyboardWatcher = KeyboardWatcher.initWith(this).bindKeyboardWatcher(this);
}
@Override
protected void onDestroy() {
keyboardWatcher.unbindKeyboardWatcher();
super.onDestroy();
}
@Override
public void onKeyboardShown(int keyboardSize) {
textView.setText("Shown\nkeyboard size: " +keyboardSize + "px");
}
@Override
public void onKeyboardClosed() {
textView.setText("Closed");
}
}
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.azimolabs.keyboardwatcher.sample.MainActivity">
<EditText
android:id="@+id/editText"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<requestFocus/>
</EditText>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:gravity="center"
android:text="Keyboard state"
android:textSize="24sp"/>
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:gravity="center"
android:textStyle="bold"
/>
</LinearLayout>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,6 @@
<resources>
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
(such as screen margins) for screens with more than 820dp of available width. This
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
<dimen name="activity_horizontal_margin">64dp</dimen>
</resources>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>
@@ -0,0 +1,5 @@
<resources>
<!-- Default screen margins, per the Android Design guidelines. -->
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
</resources>
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">KeyboardWatcher</string>
</resources>
@@ -0,0 +1,11 @@
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
@@ -0,0 +1,15 @@
package com.azimolabs.keyboardwatcher;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
@@ -0,0 +1,23 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta6'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
@@ -0,0 +1,18 @@
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Binary file not shown.
@@ -0,0 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
Oops, something went wrong.

0 comments on commit 211bad0

Please sign in to comment.