diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml
new file mode 100644
index 0000000..4a53bee
--- /dev/null
+++ b/.idea/AndroidProjectSystem.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/appInsightsSettings.xml b/.idea/appInsightsSettings.xml
new file mode 100644
index 0000000..371f2e2
--- /dev/null
+++ b/.idea/appInsightsSettings.xml
@@ -0,0 +1,26 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/caches/deviceStreaming.xml b/.idea/caches/deviceStreaming.xml
new file mode 100644
index 0000000..b7cdb30
--- /dev/null
+++ b/.idea/caches/deviceStreaming.xml
@@ -0,0 +1,1834 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
index 96cc43e..b86273d 100644
--- a/.idea/compiler.xml
+++ b/.idea/compiler.xml
@@ -1,22 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
\ No newline at end of file
diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml
new file mode 100644
index 0000000..b268ef3
--- /dev/null
+++ b/.idea/deploymentTargetSelector.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index 8ed3387..c915648 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -1,10 +1,12 @@
+
-
+
+
@@ -12,13 +14,6 @@
-
-
-
-
-
-
-
diff --git a/.idea/markdown.xml b/.idea/markdown.xml
new file mode 100644
index 0000000..c61ea33
--- /dev/null
+++ b/.idea/markdown.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/migrations.xml b/.idea/migrations.xml
new file mode 100644
index 0000000..f8051a6
--- /dev/null
+++ b/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index b2ba2b1..dc506f8 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,43 +1,52 @@
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index 7f5a838..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
index 7f68460..72f00ed 100644
--- a/.idea/runConfigurations.xml
+++ b/.idea/runConfigurations.xml
@@ -3,6 +3,14 @@
+
+
+
+
+
+
+
+
diff --git a/app/build.gradle b/app/build.gradle
index bb1e551..c65db7c 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,16 +1,21 @@
-apply plugin: 'com.android.application'
+plugins {
+ id 'com.android.application'
+}
android {
- compileSdkVersion 24
- buildToolsVersion "24.0.2"
+ namespace 'me.kareluo.popupmenuview'
+ compileSdk 34
defaultConfig {
applicationId "me.kareluo.popupmenuview"
- minSdkVersion 14
- targetSdkVersion 24
+ minSdk 21
+ targetSdk 34
versionCode 1
versionName "1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
+
buildTypes {
release {
minifyEnabled false
@@ -20,8 +25,9 @@ android {
}
dependencies {
- compile 'com.android.support:appcompat-v7:24.2.1'
- compile fileTree(dir: 'libs', include: ['*.jar'])
- testCompile 'junit:junit:4.12'
- compile project(path: ':popmenu')
+ implementation 'androidx.appcompat:appcompat:1.6.1'
+ implementation project(':popmenu')
+ testImplementation 'junit:junit:4.13.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.5'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 66b5ddf..3817dc8 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -1,6 +1,5 @@
-
+
-
+
@@ -17,4 +18,4 @@
-
\ No newline at end of file
+
diff --git a/app/src/main/java/me/kareluo/popupmenuview/MainActivity.java b/app/src/main/java/me/kareluo/popupmenuview/MainActivity.java
index 29a20db..7fa9398 100644
--- a/app/src/main/java/me/kareluo/popupmenuview/MainActivity.java
+++ b/app/src/main/java/me/kareluo/popupmenuview/MainActivity.java
@@ -3,8 +3,8 @@
import android.graphics.Path;
import android.graphics.RectF;
import android.os.Bundle;
-import android.support.v7.app.AppCompatActivity;
-import android.support.v7.view.menu.MenuBuilder;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.appcompat.view.menu.MenuBuilder;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
@@ -131,57 +131,46 @@ public void onStopTrackingTouch(SeekBar seekBar) {
@Override
public void onClick(View v) {
- switch (v.getId()) {
- case R.id.btn_orientation:
- if (mMenuView.getOrientation() == LinearLayout.HORIZONTAL) {
- mMenuView.setOrientation(LinearLayout.VERTICAL);
- mPopupMenuView.setOrientation(LinearLayout.VERTICAL);
- mCustomMenuView.setOrientation(LinearLayout.VERTICAL);
- } else {
- mMenuView.setOrientation(LinearLayout.HORIZONTAL);
- mPopupMenuView.setOrientation(LinearLayout.HORIZONTAL);
- mCustomMenuView.setOrientation(LinearLayout.HORIZONTAL);
- }
- break;
- case R.id.btn_show:
- case R.id.btn_show1:
- case R.id.btn_show2:
- case R.id.btn_show3:
- mPopupMenuView.show(v);
- break;
- case R.id.btn_custom:
- mCustomMenuView.show(v);
- break;
+ int id = v.getId();
+ if (id == R.id.btn_orientation) {
+ if (mMenuView.getOrientation() == LinearLayout.HORIZONTAL) {
+ mMenuView.setOrientation(LinearLayout.VERTICAL);
+ mPopupMenuView.setOrientation(LinearLayout.VERTICAL);
+ mCustomMenuView.setOrientation(LinearLayout.VERTICAL);
+ } else {
+ mMenuView.setOrientation(LinearLayout.HORIZONTAL);
+ mPopupMenuView.setOrientation(LinearLayout.HORIZONTAL);
+ mCustomMenuView.setOrientation(LinearLayout.HORIZONTAL);
+ }
+ } else if (id == R.id.btn_show || id == R.id.btn_show1 || id == R.id.btn_show2 || id == R.id.btn_show3) {
+ mPopupMenuView.show(v);
+ } else if (id == R.id.btn_custom) {
+ mCustomMenuView.show(v);
}
}
@Override
public void onCheckedChanged(RadioGroup group, int checkedId) {
- switch (checkedId) {
- case R.id.radio1:
- mPopLayout.setSiteMode(PopLayout.SITE_LEFT);
- mImgPopLayout.setSiteMode(PopLayout.SITE_LEFT);
- mPopupMenuView.setSites(PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM);
- mCustomMenuView.setSites(PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM);
- break;
- case R.id.radio2:
- mPopLayout.setSiteMode(PopLayout.SITE_TOP);
- mImgPopLayout.setSiteMode(PopLayout.SITE_TOP);
- mPopupMenuView.setSites(PopupView.SITE_TOP, PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM, PopupView.SITE_LEFT);
- mCustomMenuView.setSites(PopupView.SITE_TOP, PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM, PopupView.SITE_LEFT);
- break;
- case R.id.radio3:
- mPopLayout.setSiteMode(PopLayout.SITE_RIGHT);
- mImgPopLayout.setSiteMode(PopLayout.SITE_RIGHT);
- mPopupMenuView.setSites(PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP);
- mCustomMenuView.setSites(PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP);
- break;
- case R.id.radio4:
- mPopLayout.setSiteMode(PopLayout.SITE_BOTTOM);
- mImgPopLayout.setSiteMode(PopLayout.SITE_BOTTOM);
- mPopupMenuView.setSites(PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT);
- mCustomMenuView.setSites(PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT);
- break;
+ if (checkedId == R.id.radio1) {
+ mPopLayout.setSiteMode(PopLayout.SITE_LEFT);
+ mImgPopLayout.setSiteMode(PopLayout.SITE_LEFT);
+ mPopupMenuView.setSites(PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM);
+ mCustomMenuView.setSites(PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM);
+ } else if (checkedId == R.id.radio2) {
+ mPopLayout.setSiteMode(PopLayout.SITE_TOP);
+ mImgPopLayout.setSiteMode(PopLayout.SITE_TOP);
+ mPopupMenuView.setSites(PopupView.SITE_TOP, PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM, PopupView.SITE_LEFT);
+ mCustomMenuView.setSites(PopupView.SITE_TOP, PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM, PopupView.SITE_LEFT);
+ } else if (checkedId == R.id.radio3) {
+ mPopLayout.setSiteMode(PopLayout.SITE_RIGHT);
+ mImgPopLayout.setSiteMode(PopLayout.SITE_RIGHT);
+ mPopupMenuView.setSites(PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP);
+ mCustomMenuView.setSites(PopupView.SITE_RIGHT, PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP);
+ } else if (checkedId == R.id.radio4) {
+ mPopLayout.setSiteMode(PopLayout.SITE_BOTTOM);
+ mImgPopLayout.setSiteMode(PopLayout.SITE_BOTTOM);
+ mPopupMenuView.setSites(PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT);
+ mCustomMenuView.setSites(PopupView.SITE_BOTTOM, PopupView.SITE_LEFT, PopupView.SITE_TOP, PopupView.SITE_RIGHT);
}
}
diff --git a/build.gradle b/build.gradle
index 04c6292..3fd30b7 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,12 +2,14 @@
buildscript {
repositories {
- jcenter()
+ google()
+ mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.1.3'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
- classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
+ classpath 'com.android.tools.build:gradle:8.1.0'
+ // These plugins are likely incompatible with modern Gradle and may need to be removed or replaced
+ // classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
+ // classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -16,7 +18,8 @@ buildscript {
allprojects {
repositories {
- jcenter()
+ google()
+ mavenCentral()
}
}
diff --git a/gradle.properties b/gradle.properties
index 1d3591c..027ef9d 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -15,4 +15,7 @@
# 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
\ No newline at end of file
+# org.gradle.parallel=true
+
+android.useAndroidX=true
+android.enableJetifier=true
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index a9ced3e..80b3893 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
diff --git a/popmenu/build.gradle b/popmenu/build.gradle
index 1da3380..65e7131 100644
--- a/popmenu/build.gradle
+++ b/popmenu/build.gradle
@@ -1,21 +1,20 @@
-apply plugin: 'com.android.library'
-apply plugin: 'com.jfrog.bintray'
-apply plugin: 'com.github.dcendents.android-maven'
-
-version = "1.1.0"
+plugins {
+ id 'com.android.library'
+}
android {
- compileSdkVersion 24
- buildToolsVersion "24.0.2"
-
- resourcePrefix "kareluo_ui_"
+ namespace 'me.kareluo.ui'
+ compileSdk 34
defaultConfig {
- minSdkVersion 14
- targetSdkVersion 24
+ minSdk 21
+ targetSdk 34
versionCode 110
- versionName version
+ versionName "1.1.0"
+
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
+
buildTypes {
release {
minifyEnabled false
@@ -25,84 +24,8 @@ android {
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- testCompile 'junit:junit:4.12'
+ implementation 'androidx.appcompat:appcompat:1.6.1'
+ testImplementation 'junit:junit:4.13.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.5'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
-
-
-def siteUrl = 'https://github.com/kareluo/PopupMenuView'
-def gitUrl = 'https://github.com/kareluo/PopupMenuView.git'
-
-group = "me.kareluo.ui"
-
-install {
-
- repositories.mavenInstaller {
- // This generates POM.xml with proper parameters
- pom {
- project {
- packaging 'aar'
-
- name 'me.kareluo.ui:popmenu'
- url siteUrl
-
- licenses {
- license {
- name 'The Apache Software License, Version 2.0'
- url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
- }
- }
-
- developers {
- developer {
- id 'kareluo'
- name 'Felix'
- email 'kareluo76@gmail.com'
- }
- }
-
- 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 = "me.kareluo.ui:popmenu"
- websiteUrl = siteUrl
- vcsUrl = gitUrl
- licenses = ["Apache-2.0"]
- publish = true
- }
-}
\ No newline at end of file