From c6a0529bcaec44301591eb8d1c550966f6082435 Mon Sep 17 00:00:00 2001
From: jack921 <355596943@qq.com>
Date: Fri, 23 Jun 2017 16:21:25 +0800
Subject: [PATCH] init
---
.idea/gradle.xml | 1 +
.idea/modules.xml | 1 +
.idea/vcs.xml | 6 ++++
app/build.gradle | 3 +-
.../bottompopupwindowdemo/MainActivity.java | 6 ++--
app/src/main/res/layout/activity_main.xml | 4 +--
bottompopupwindowview/.gitignore | 1 +
bottompopupwindowview/build.gradle | 31 +++++++++++++++++++
bottompopupwindowview/proguard-rules.pro | 25 +++++++++++++++
.../ExampleInstrumentedTest.java | 26 ++++++++++++++++
.../src/main/AndroidManifest.xml | 10 ++++++
.../AnimatorListener.java | 10 ++++++
.../BottomPopupWindowView.java | 9 ++----
.../src/main/res/anim/bp_bottom_bg_in.xml | 0
.../src/main/res/anim/bp_bottom_bg_out.xml | 0
.../src/main/res/anim/bp_bottom_view_in.xml | 0
.../src/main/res/anim/bp_bottom_view_out.xml | 0
.../main/res/layout/layout_bottom_popup.xml | 0
.../src/main/res/values/strings.xml | 3 ++
.../ExampleUnitTest.java | 17 ++++++++++
settings.gradle | 2 +-
21 files changed, 142 insertions(+), 13 deletions(-)
create mode 100644 .idea/vcs.xml
create mode 100644 bottompopupwindowview/.gitignore
create mode 100644 bottompopupwindowview/build.gradle
create mode 100644 bottompopupwindowview/proguard-rules.pro
create mode 100644 bottompopupwindowview/src/androidTest/java/com/jack/bottompopupwindowview/ExampleInstrumentedTest.java
create mode 100644 bottompopupwindowview/src/main/AndroidManifest.xml
create mode 100644 bottompopupwindowview/src/main/java/com/jack/bottompopupwindowview/AnimatorListener.java
rename {app/src/main/java/com/example/jack/bottompopupwindowdemo => bottompopupwindowview/src/main/java/com/jack/bottompopupwindowview}/BottomPopupWindowView.java (97%)
rename {app => bottompopupwindowview}/src/main/res/anim/bp_bottom_bg_in.xml (100%)
rename {app => bottompopupwindowview}/src/main/res/anim/bp_bottom_bg_out.xml (100%)
rename {app => bottompopupwindowview}/src/main/res/anim/bp_bottom_view_in.xml (100%)
rename {app => bottompopupwindowview}/src/main/res/anim/bp_bottom_view_out.xml (100%)
rename {app => bottompopupwindowview}/src/main/res/layout/layout_bottom_popup.xml (100%)
create mode 100644 bottompopupwindowview/src/main/res/values/strings.xml
create mode 100644 bottompopupwindowview/src/test/java/com/jack/bottompopupwindowview/ExampleUnitTest.java
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 7ac24c7..c207e9d 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -9,6 +9,7 @@
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index 75aeb63..b054177 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -4,6 +4,7 @@
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index f2f8c16..ad5eed3 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -20,11 +20,12 @@ android {
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
+ compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
+ compile project(':bottompopupwindowview')
}
diff --git a/app/src/main/java/com/example/jack/bottompopupwindowdemo/MainActivity.java b/app/src/main/java/com/example/jack/bottompopupwindowdemo/MainActivity.java
index 2a71340..1b3cae6 100644
--- a/app/src/main/java/com/example/jack/bottompopupwindowdemo/MainActivity.java
+++ b/app/src/main/java/com/example/jack/bottompopupwindowdemo/MainActivity.java
@@ -6,9 +6,11 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
-import android.widget.TextView;
-public class MainActivity extends AppCompatActivity implements View.OnClickListener, BottomPopupWindowView.AnimatorListener {
+import com.jack.bottompopupwindowview.AnimatorListener;
+import com.jack.bottompopupwindowview.BottomPopupWindowView;
+
+public class MainActivity extends AppCompatActivity implements View.OnClickListener, AnimatorListener {
private BottomPopupWindowView bottomPopupWindowView;
private View contentView;
private View bottomView;
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index a6e9c75..ee39ad2 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -54,12 +54,12 @@
-
-
+
diff --git a/bottompopupwindowview/.gitignore b/bottompopupwindowview/.gitignore
new file mode 100644
index 0000000..796b96d
--- /dev/null
+++ b/bottompopupwindowview/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/bottompopupwindowview/build.gradle b/bottompopupwindowview/build.gradle
new file mode 100644
index 0000000..dccf509
--- /dev/null
+++ b/bottompopupwindowview/build.gradle
@@ -0,0 +1,31 @@
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 25
+ buildToolsVersion "25.0.2"
+
+ defaultConfig {
+ minSdkVersion 15
+ targetSdkVersion 25
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+dependencies {
+ compile fileTree(dir: 'libs', include: ['*.jar'])
+ androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
+ exclude group: 'com.android.support', module: 'support-annotations'
+ })
+ compile 'com.android.support:appcompat-v7:25.3.1'
+ testCompile 'junit:junit:4.12'
+}
diff --git a/bottompopupwindowview/proguard-rules.pro b/bottompopupwindowview/proguard-rules.pro
new file mode 100644
index 0000000..3d50630
--- /dev/null
+++ b/bottompopupwindowview/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 F:\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
diff --git a/bottompopupwindowview/src/androidTest/java/com/jack/bottompopupwindowview/ExampleInstrumentedTest.java b/bottompopupwindowview/src/androidTest/java/com/jack/bottompopupwindowview/ExampleInstrumentedTest.java
new file mode 100644
index 0000000..25036e3
--- /dev/null
+++ b/bottompopupwindowview/src/androidTest/java/com/jack/bottompopupwindowview/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.jack.bottompopupwindowview;
+
+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 Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.jack.bottompopupwindowview.test", appContext.getPackageName());
+ }
+}
diff --git a/bottompopupwindowview/src/main/AndroidManifest.xml b/bottompopupwindowview/src/main/AndroidManifest.xml
new file mode 100644
index 0000000..fa9a52f
--- /dev/null
+++ b/bottompopupwindowview/src/main/AndroidManifest.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
diff --git a/bottompopupwindowview/src/main/java/com/jack/bottompopupwindowview/AnimatorListener.java b/bottompopupwindowview/src/main/java/com/jack/bottompopupwindowview/AnimatorListener.java
new file mode 100644
index 0000000..813be9e
--- /dev/null
+++ b/bottompopupwindowview/src/main/java/com/jack/bottompopupwindowview/AnimatorListener.java
@@ -0,0 +1,10 @@
+package com.jack.bottompopupwindowview;
+
+/**
+ * Created by Administrator on 2017/6/23.
+ */
+
+public interface AnimatorListener {
+ void startValue(int value);
+ void endValue(int value);
+}
diff --git a/app/src/main/java/com/example/jack/bottompopupwindowdemo/BottomPopupWindowView.java b/bottompopupwindowview/src/main/java/com/jack/bottompopupwindowview/BottomPopupWindowView.java
similarity index 97%
rename from app/src/main/java/com/example/jack/bottompopupwindowdemo/BottomPopupWindowView.java
rename to bottompopupwindowview/src/main/java/com/jack/bottompopupwindowview/BottomPopupWindowView.java
index fb6843b..6cf4d22 100644
--- a/app/src/main/java/com/example/jack/bottompopupwindowdemo/BottomPopupWindowView.java
+++ b/bottompopupwindowview/src/main/java/com/jack/bottompopupwindowview/BottomPopupWindowView.java
@@ -1,4 +1,4 @@
-package com.example.jack.bottompopupwindowdemo;
+package com.jack.bottompopupwindowview;
import android.animation.ValueAnimator;
import android.content.Context;
@@ -16,7 +16,7 @@
import android.widget.RelativeLayout;
/**
- * Created by Administrator on 2017/6/16.
+ * Created by Jack on 2017/6/16.
*/
public class BottomPopupWindowView extends LinearLayout{
@@ -182,9 +182,4 @@ public void onAnimationUpdate(ValueAnimator valueAnimator) {
valueAnimator.start();
}
- interface AnimatorListener{
- void startValue(int value);
- void endValue(int value);
- }
-
}
diff --git a/app/src/main/res/anim/bp_bottom_bg_in.xml b/bottompopupwindowview/src/main/res/anim/bp_bottom_bg_in.xml
similarity index 100%
rename from app/src/main/res/anim/bp_bottom_bg_in.xml
rename to bottompopupwindowview/src/main/res/anim/bp_bottom_bg_in.xml
diff --git a/app/src/main/res/anim/bp_bottom_bg_out.xml b/bottompopupwindowview/src/main/res/anim/bp_bottom_bg_out.xml
similarity index 100%
rename from app/src/main/res/anim/bp_bottom_bg_out.xml
rename to bottompopupwindowview/src/main/res/anim/bp_bottom_bg_out.xml
diff --git a/app/src/main/res/anim/bp_bottom_view_in.xml b/bottompopupwindowview/src/main/res/anim/bp_bottom_view_in.xml
similarity index 100%
rename from app/src/main/res/anim/bp_bottom_view_in.xml
rename to bottompopupwindowview/src/main/res/anim/bp_bottom_view_in.xml
diff --git a/app/src/main/res/anim/bp_bottom_view_out.xml b/bottompopupwindowview/src/main/res/anim/bp_bottom_view_out.xml
similarity index 100%
rename from app/src/main/res/anim/bp_bottom_view_out.xml
rename to bottompopupwindowview/src/main/res/anim/bp_bottom_view_out.xml
diff --git a/app/src/main/res/layout/layout_bottom_popup.xml b/bottompopupwindowview/src/main/res/layout/layout_bottom_popup.xml
similarity index 100%
rename from app/src/main/res/layout/layout_bottom_popup.xml
rename to bottompopupwindowview/src/main/res/layout/layout_bottom_popup.xml
diff --git a/bottompopupwindowview/src/main/res/values/strings.xml b/bottompopupwindowview/src/main/res/values/strings.xml
new file mode 100644
index 0000000..5148486
--- /dev/null
+++ b/bottompopupwindowview/src/main/res/values/strings.xml
@@ -0,0 +1,3 @@
+
+ BottomPopupWindowView
+
diff --git a/bottompopupwindowview/src/test/java/com/jack/bottompopupwindowview/ExampleUnitTest.java b/bottompopupwindowview/src/test/java/com/jack/bottompopupwindowview/ExampleUnitTest.java
new file mode 100644
index 0000000..ba2a80c
--- /dev/null
+++ b/bottompopupwindowview/src/test/java/com/jack/bottompopupwindowview/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.jack.bottompopupwindowview;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/settings.gradle b/settings.gradle
index e7b4def..12f5e57 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1 @@
-include ':app'
+include ':app', ':bottompopupwindowview'