-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit de1e113
Showing
43 changed files
with
1,216 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 23 | ||
buildToolsVersion "23.0.3" | ||
|
||
defaultConfig { | ||
applicationId "top.resonlei.popmenu" | ||
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.3.0' | ||
compile project(path: ':popmenuview') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 D:\Users\Administrator\AppData\Local\Android\sdk1/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 *; | ||
#} |
13 changes: 13 additions & 0 deletions
13
app/src/androidTest/java/top/resonlei/popmenu/ApplicationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package top.resonlei.popmenu; | ||
|
||
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="top.resonlei.popmenu"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package top.resonlei.popmenu; | ||
|
||
import android.os.Bundle; | ||
import android.support.v7.app.AppCompatActivity; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.ArrayAdapter; | ||
import android.widget.ListView; | ||
import android.widget.Toast; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import resonlei.top.popmenuview.PopMenu; | ||
|
||
public class MainActivity extends AppCompatActivity { | ||
private PopMenu mPopupMenu; | ||
private ListView mListView; | ||
private List<String> mStringList; | ||
|
||
public MainActivity() { | ||
} | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_main); | ||
mStringList = new ArrayList<>(); | ||
for (int i = 0; i < 300; i++) { | ||
mStringList.add(i+""); | ||
} | ||
|
||
mPopupMenu = (PopMenu) findViewById(R.id.popmenu); | ||
mListView = (ListView) findViewById(R.id.listview); | ||
|
||
mListView.setAdapter(new ArrayAdapter<>(this,android.R.layout.simple_list_item_1,mStringList)); | ||
// ImageView imageView = new ImageView(this); | ||
// imageView.setImageResource(R.mipmap.item_screen); | ||
// imageView.setTag("screen"); | ||
// | ||
// mPopupMenu.addView(imageView); | ||
//动态设置布局 | ||
mPopupMenu.setMenu(R.mipmap.item_del) | ||
.setItem(R.mipmap.ic_launcher,"android1") | ||
.setItem(R.mipmap.ic_launcher,"android2") | ||
.setItem(R.mipmap.ic_launcher,"android3") | ||
.setItem(R.mipmap.ic_launcher,"android4") | ||
.setItem(R.mipmap.ic_launcher,"android5"); | ||
|
||
|
||
mPopupMenu.setOnMenuItemClickListener(new PopMenu.OnMenuItemClickListener() { | ||
@Override | ||
public void onClick(View view, int pos) { | ||
Toast.makeText(MainActivity.this,view.getTag().toString(),Toast.LENGTH_SHORT).show(); | ||
} | ||
}); | ||
|
||
} | ||
|
||
public void a(View v){ | ||
Log.e("button","onClick"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<RelativeLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
xmlns:resonlei="http://schemas.android.com/apk/res-auto" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context="top.resonlei.popmenu.MainActivity"> | ||
|
||
<ListView android:id="@+id/listview" android:layout_width="match_parent" android:layout_height="match_parent"> | ||
|
||
|
||
</ListView> | ||
|
||
<resonlei.top.popmenuview.PopMenu | ||
android:id="@+id/popmenu" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
resonlei:radius="200dp" | ||
resonlei:position="bottom_right"> | ||
|
||
<!--<ImageView--> | ||
<!--android:id="@+id/id_button"--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--android:src="@mipmap/menu" />--> | ||
|
||
|
||
<!--<ImageView--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--android:scaleType="centerCrop"--> | ||
<!--android:src="@mipmap/item_about"--> | ||
<!--android:tag="Camera" />--> | ||
|
||
<!--<ImageView--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--android:src="@mipmap/item_add"--> | ||
<!--android:tag="Sun" />--> | ||
|
||
<!--<ImageView--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--android:src="@mipmap/item_del"--> | ||
<!--android:tag="Place" />--> | ||
|
||
<!--<ImageView--> | ||
<!--android:layout_width="wrap_content"--> | ||
<!--android:layout_height="wrap_content"--> | ||
<!--android:src="@mipmap/item_settime"--> | ||
<!--android:tag="Sleep" />--> | ||
|
||
</resonlei.top.popmenuview.PopMenu> | ||
|
||
|
||
</RelativeLayout> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">PopMenu</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
15 changes: 15 additions & 0 deletions
15
app/src/test/java/top/resonlei/popmenu/ExampleUnitTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package top.resonlei.popmenu; | ||
|
||
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.1.0' | ||
|
||
// 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 | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<items version="2" > | ||
|
||
<item | ||
jar="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\incremental-runtime-classes\debug\instant-run.jar" | ||
jumboMode="true" | ||
revision="23.0.3" | ||
sha1="f4be9d77bbd06017ff9ed6eb1ed421c07bc51b2a"> | ||
<dex dex="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\transforms\dex\debug\folders\1000\10\instant-run_ba7c3d2d69906d6aaf75defa4ea73fa78106b0a9\classes.dex" /> | ||
</item> | ||
<item | ||
jar="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\exploded-aar\com.android.support\support-v4\23.3.0\jars\classes.jar" | ||
jumboMode="true" | ||
revision="23.0.3" | ||
sha1="8a034dd16c0dfd75fe86c52c2cd581592acc684a"> | ||
<dex dex="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\transforms\dex\debug\folders\1000\10\com.android.support-support-v4-23.3.0_a9cd84e29ba265317df04ceabc797c059c6d4ece\classes.dex" /> | ||
</item> | ||
<item | ||
jar="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\exploded-aar\com.android.support\support-v4\23.3.0\jars\libs\internal_impl-23.3.0.jar" | ||
jumboMode="true" | ||
revision="23.0.3" | ||
sha1="4da5a4d697d32497c6f85567a5112e62fdfd0676"> | ||
<dex dex="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\transforms\dex\debug\folders\1000\10\internal_impl-23.3.0_e9ac85eb60b6038e83cf627092ba754bb8fc84eb\classes.dex" /> | ||
</item> | ||
<item | ||
jar="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\exploded-aar\com.android.support\support-vector-drawable\23.3.0\jars\classes.jar" | ||
jumboMode="true" | ||
revision="23.0.3" | ||
sha1="a0b5d60246cd9d4f3f2443611b3b4c25265840b5"> | ||
<dex dex="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\transforms\dex\debug\folders\1000\10\com.android.support-support-vector-drawable-23.3.0_7f36902349f879ab1e4daac1cf2cf32b87f95bcc\classes.dex" /> | ||
</item> | ||
<item | ||
jar="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\exploded-aar\com.android.support\animated-vector-drawable\23.3.0\jars\classes.jar" | ||
jumboMode="true" | ||
revision="23.0.3" | ||
sha1="23be6993826b8fd88bbc8d14928bb3b8960d3d4e"> | ||
<dex dex="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\transforms\dex\debug\folders\1000\10\com.android.support-animated-vector-drawable-23.3.0_4a94bf0c9d47f528cef90d793fd7a10eb06d578e\classes.dex" /> | ||
</item> | ||
<item | ||
jar="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\incremental-classes\debug\instant-run-bootstrap.jar" | ||
jumboMode="true" | ||
revision="23.0.3" | ||
sha1="ead91ce19d7b7ddbbc35482211a35d11be91e74d"> | ||
<dex dex="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\transforms\dex\debug\folders\1000\10\instant-run-bootstrap_08689c3dfc1f63c9746bd034ed6730300695e159\classes.dex" /> | ||
</item> | ||
<item | ||
jar="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.3.0\jars\classes.jar" | ||
jumboMode="true" | ||
revision="23.0.3" | ||
sha1="1b8e03daaa43fb0a4cd57e378167c2fd70454c1e"> | ||
<dex dex="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\transforms\dex\debug\folders\1000\10\com.android.support-appcompat-v7-23.3.0_0285c62037576a8690591a10bdc4a2754637c532\classes.dex" /> | ||
</item> | ||
<item | ||
jar="D:\Users\Administrator\AppData\Local\Android\sdk1\extras\android\m2repository\com\android\support\support-annotations\23.3.0\support-annotations-23.3.0.jar" | ||
jumboMode="true" | ||
revision="23.0.3" | ||
sha1="db7791d75a07fef9844d06236c1c59ba7bf6997c"> | ||
<dex dex="C:\Users\Administrator\AndroidStudioProjects2\PopMenu\app\build\intermediates\transforms\dex\debug\folders\1000\10\support-annotations-23.3.0_b72a09fc1796cf33fc2edf64eb46fb7e47122688\classes.dex" /> | ||
</item> | ||
|
||
</items> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.