From 0e94b42458d441f3baa5e28b4e8214338fda7360 Mon Sep 17 00:00:00 2001 From: zhangqing8 Date: Mon, 5 Dec 2022 19:40:43 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E5=8D=87=E7=BA=A7sdk=20taget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../androidtest/activity/ButtonsActivity.kt | 38 ------------------- build.gradle | 4 +- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/app/src/main/java/com/guiguzi/androidtest/activity/ButtonsActivity.kt b/app/src/main/java/com/guiguzi/androidtest/activity/ButtonsActivity.kt index 94bd417..1467ab3 100644 --- a/app/src/main/java/com/guiguzi/androidtest/activity/ButtonsActivity.kt +++ b/app/src/main/java/com/guiguzi/androidtest/activity/ButtonsActivity.kt @@ -70,45 +70,7 @@ class ButtonsActivity : Activity() { button2.text = "双击检测" button2.setOnTouchListener(object : View.OnTouchListener { override fun onTouch(v: View?, event: MotionEvent?): Boolean { - GestureDetector(baseContext, object : GestureDetector.OnGestureListener { - override fun onDown(e: MotionEvent?): Boolean { - Log.d(TAG, "onDown()") - return false - } - override fun onShowPress(e: MotionEvent?) { - Log.d(TAG, "onShowPress()") - } - - override fun onSingleTapUp(e: MotionEvent?): Boolean { - Log.d(TAG, "onSingleTapUp()") - return false - } - - override fun onScroll( - e1: MotionEvent?, - e2: MotionEvent?, - distanceX: Float, - distanceY: Float - ): Boolean { - Log.d(TAG, "onScroll()") - return false - } - - override fun onLongPress(e: MotionEvent?) { - Log.d(TAG, "onLongPress()") - } - - override fun onFling( - e1: MotionEvent?, - e2: MotionEvent?, - velocityX: Float, - velocityY: Float - ): Boolean { - Log.d(TAG, "onFling()") - return false - } - }).onTouchEvent(event) return true } }) diff --git a/build.gradle b/build.gradle index 4702ee6..69821c3 100644 --- a/build.gradle +++ b/build.gradle @@ -5,9 +5,9 @@ buildscript { ext { /*android中基础配置*/ android = [ - compileSdk : 32, + compileSdk : 33, minSdkVersion : 26, - targetSdkVersion: 32, + targetSdkVersion: 33, versionCode : 1, versionName : "1.0.0" ] -- Gitee From f9f385408430961e7a6aa0d2e647004896b8c112 Mon Sep 17 00:00:00 2001 From: zhangqing8 Date: Tue, 6 Dec 2022 11:57:00 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E6=B7=BB=E5=8A=A0aidl=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoViewPager/build.gradle | 4 +- H264/build.gradle | 2 +- JsonViewer/build.gradle | 2 +- LongImage/build.gradle | 2 +- aidl/.gitignore | 16 ++++ aidl/build.gradle | 44 +++++++++++ aidl/proguard-rules.pro | 21 +++++ .../com/ggz/aidl/ExampleInstrumentedTest.kt | 24 ++++++ aidl/src/main/AndroidManifest.xml | 28 +++++++ .../main/java/com/ggz/aidl/FirstFragment.kt | 44 +++++++++++ .../main/java/com/ggz/aidl/MainActivity.kt | 58 ++++++++++++++ .../main/java/com/ggz/aidl/SecondFragment.kt | 44 +++++++++++ .../drawable-v24/ic_launcher_foreground.xml | 31 ++++++++ .../res/drawable/ic_launcher_background.xml | 74 ++++++++++++++++++ aidl/src/main/res/layout/activity_main.xml | 35 +++++++++ aidl/src/main/res/layout/content_main.xml | 20 +++++ aidl/src/main/res/layout/fragment_first.xml | 31 ++++++++ aidl/src/main/res/layout/fragment_second.xml | 30 +++++++ aidl/src/main/res/menu/menu_main.xml | 9 +++ .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 ++ .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 ++ .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes aidl/src/main/res/navigation/nav_graph.xml | 28 +++++++ aidl/src/main/res/values-land/dimens.xml | 3 + aidl/src/main/res/values-night/themes.xml | 16 ++++ aidl/src/main/res/values-w1240dp/dimens.xml | 3 + aidl/src/main/res/values-w600dp/dimens.xml | 3 + aidl/src/main/res/values/colors.xml | 10 +++ aidl/src/main/res/values/dimens.xml | 3 + aidl/src/main/res/values/strings.xml | 12 +++ aidl/src/main/res/values/themes.xml | 22 ++++++ .../test/java/com/ggz/aidl/ExampleUnitTest.kt | 17 ++++ app/build.gradle | 2 +- build.gradle | 11 ++- code_h264/build.gradle | 2 +- player/build.gradle | 4 +- pushbase/jiguangpush/build.gradle | 2 +- pushbase/mipush/build.gradle | 2 +- router/build.gradle | 2 +- settings.gradle | 1 + util/build.gradle | 2 +- 50 files changed, 657 insertions(+), 17 deletions(-) create mode 100644 aidl/.gitignore create mode 100644 aidl/build.gradle create mode 100644 aidl/proguard-rules.pro create mode 100644 aidl/src/androidTest/java/com/ggz/aidl/ExampleInstrumentedTest.kt create mode 100644 aidl/src/main/AndroidManifest.xml create mode 100644 aidl/src/main/java/com/ggz/aidl/FirstFragment.kt create mode 100644 aidl/src/main/java/com/ggz/aidl/MainActivity.kt create mode 100644 aidl/src/main/java/com/ggz/aidl/SecondFragment.kt create mode 100644 aidl/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 aidl/src/main/res/drawable/ic_launcher_background.xml create mode 100644 aidl/src/main/res/layout/activity_main.xml create mode 100644 aidl/src/main/res/layout/content_main.xml create mode 100644 aidl/src/main/res/layout/fragment_first.xml create mode 100644 aidl/src/main/res/layout/fragment_second.xml create mode 100644 aidl/src/main/res/menu/menu_main.xml create mode 100644 aidl/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 aidl/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 aidl/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 aidl/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 aidl/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 aidl/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 aidl/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 aidl/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 aidl/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 aidl/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 aidl/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 aidl/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 aidl/src/main/res/navigation/nav_graph.xml create mode 100644 aidl/src/main/res/values-land/dimens.xml create mode 100644 aidl/src/main/res/values-night/themes.xml create mode 100644 aidl/src/main/res/values-w1240dp/dimens.xml create mode 100644 aidl/src/main/res/values-w600dp/dimens.xml create mode 100644 aidl/src/main/res/values/colors.xml create mode 100644 aidl/src/main/res/values/dimens.xml create mode 100644 aidl/src/main/res/values/strings.xml create mode 100644 aidl/src/main/res/values/themes.xml create mode 100644 aidl/src/test/java/com/ggz/aidl/ExampleUnitTest.kt diff --git a/AutoViewPager/build.gradle b/AutoViewPager/build.gradle index e84648c..2666886 100644 --- a/AutoViewPager/build.gradle +++ b/AutoViewPager/build.gradle @@ -26,8 +26,8 @@ android { dependencies { - implementation 'androidx.appcompat:appcompat:1.3.0' - implementation 'com.google.android.material:material:1.4.0' + implementation "androidx.appcompat:appcompat:$appcompat" + implementation "com.google.android.material:material:$material" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' diff --git a/H264/build.gradle b/H264/build.gradle index cee5eeb..cedd8dc 100644 --- a/H264/build.gradle +++ b/H264/build.gradle @@ -35,7 +35,7 @@ dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" implementation "androidx.core:core-ktx:$core_ktx" implementation "androidx.appcompat:appcompat:$appcompat" - implementation 'com.google.android.material:material:1.4.0' + implementation "com.google.android.material:material:$material" implementation project(path: ':code_h264') implementation 'net.butterflytv.utils:rtmp-client:3.0.1' diff --git a/JsonViewer/build.gradle b/JsonViewer/build.gradle index ade2f69..7e8fe92 100644 --- a/JsonViewer/build.gradle +++ b/JsonViewer/build.gradle @@ -31,7 +31,7 @@ dependencies { implementation "androidx.core:core-ktx:$core_ktx" implementation "androidx.appcompat:appcompat:$appcompat" - implementation 'com.google.android.material:material:1.4.0' + implementation "com.google.android.material:material:$material" } tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { diff --git a/LongImage/build.gradle b/LongImage/build.gradle index d10c895..56dbfd6 100644 --- a/LongImage/build.gradle +++ b/LongImage/build.gradle @@ -31,6 +31,6 @@ dependencies { implementation "androidx.core:core-ktx:$core_ktx" implementation "androidx.appcompat:appcompat:$appcompat" - implementation 'com.google.android.material:material:1.5.0' + implementation "com.google.android.material:material:$material" testImplementation 'org.testng:testng:7.1.0' } \ No newline at end of file diff --git a/aidl/.gitignore b/aidl/.gitignore new file mode 100644 index 0000000..3bd8ae1 --- /dev/null +++ b/aidl/.gitignore @@ -0,0 +1,16 @@ +*.iml +.gradle +.gradle/ +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +/.idea +.idea/ +.DS_Store +/build +/captures +.externalNativeBuild diff --git a/aidl/build.gradle b/aidl/build.gradle new file mode 100644 index 0000000..e7f7da1 --- /dev/null +++ b/aidl/build.gradle @@ -0,0 +1,44 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + namespace 'com.ggz.aidl' + compileSdk rootProject.ext.android.compileSdk + defaultConfig { + applicationId "com.ggz.aidl" + minSdkVersion rootProject.ext.android.minSdkVersion + targetSdkVersion rootProject.ext.android.targetSdkVersion + versionCode rootProject.ext.android.versionCode + versionName rootProject.ext.android.versionName + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_11 + targetCompatibility JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = '11' + } + buildFeatures { + viewBinding true + } +} + +dependencies { + + implementation "androidx.core:core-ktx:$core_ktx" + implementation "androidx.appcompat:appcompat:$appcompat" + implementation "com.google.android.material:material:$material" + implementation "androidx.constraintlayout:constraintlayout:$constraintlayout" + implementation "androidx.navigation:navigation-fragment-ktx:$navagition_version" + implementation "androidx.navigation:navigation-ui-ktx:$navagition_version" +} \ No newline at end of file diff --git a/aidl/proguard-rules.pro b/aidl/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/aidl/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# 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 \ No newline at end of file diff --git a/aidl/src/androidTest/java/com/ggz/aidl/ExampleInstrumentedTest.kt b/aidl/src/androidTest/java/com/ggz/aidl/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..35346a4 --- /dev/null +++ b/aidl/src/androidTest/java/com/ggz/aidl/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.ggz.aidl + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.ggz.aidl", appContext.packageName) + } +} \ No newline at end of file diff --git a/aidl/src/main/AndroidManifest.xml b/aidl/src/main/AndroidManifest.xml new file mode 100644 index 0000000..105416a --- /dev/null +++ b/aidl/src/main/AndroidManifest.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aidl/src/main/java/com/ggz/aidl/FirstFragment.kt b/aidl/src/main/java/com/ggz/aidl/FirstFragment.kt new file mode 100644 index 0000000..d81563a --- /dev/null +++ b/aidl/src/main/java/com/ggz/aidl/FirstFragment.kt @@ -0,0 +1,44 @@ +package com.ggz.aidl + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.navigation.fragment.findNavController +import com.ggz.aidl.databinding.FragmentFirstBinding + +/** + * A simple [Fragment] subclass as the default destination in the navigation. + */ +class FirstFragment : Fragment() { + + private var _binding: FragmentFirstBinding? = null + + // This property is only valid between onCreateView and + // onDestroyView. + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + + _binding = FragmentFirstBinding.inflate(inflater, container, false) + return binding.root + + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + binding.buttonFirst.setOnClickListener { + findNavController().navigate(R.id.action_FirstFragment_to_SecondFragment) + } + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/aidl/src/main/java/com/ggz/aidl/MainActivity.kt b/aidl/src/main/java/com/ggz/aidl/MainActivity.kt new file mode 100644 index 0000000..83ccfb6 --- /dev/null +++ b/aidl/src/main/java/com/ggz/aidl/MainActivity.kt @@ -0,0 +1,58 @@ +package com.ggz.aidl + +import android.os.Bundle +import com.google.android.material.snackbar.Snackbar +import androidx.appcompat.app.AppCompatActivity +import androidx.navigation.findNavController +import androidx.navigation.ui.AppBarConfiguration +import androidx.navigation.ui.navigateUp +import androidx.navigation.ui.setupActionBarWithNavController +import android.view.Menu +import android.view.MenuItem +import com.ggz.aidl.databinding.ActivityMainBinding + +class MainActivity : AppCompatActivity() { + + private lateinit var appBarConfiguration: AppBarConfiguration + private lateinit var binding: ActivityMainBinding + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + binding = ActivityMainBinding.inflate(layoutInflater) + setContentView(binding.root) + + setSupportActionBar(binding.toolbar) + + val navController = findNavController(R.id.nav_host_fragment_content_main) + appBarConfiguration = AppBarConfiguration(navController.graph) + setupActionBarWithNavController(navController, appBarConfiguration) + + binding.fab.setOnClickListener { view -> + Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG) + .setAction("Action", null).show() + } + } + + override fun onCreateOptionsMenu(menu: Menu): Boolean { + // Inflate the menu; this adds items to the action bar if it is present. + menuInflater.inflate(R.menu.menu_main, menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + // Handle action bar item clicks here. The action bar will + // automatically handle clicks on the Home/Up button, so long + // as you specify a parent activity in AndroidManifest.xml. + return when (item.itemId) { + R.id.action_settings -> true + else -> super.onOptionsItemSelected(item) + } + } + + override fun onSupportNavigateUp(): Boolean { + val navController = findNavController(R.id.nav_host_fragment_content_main) + return navController.navigateUp(appBarConfiguration) + || super.onSupportNavigateUp() + } +} \ No newline at end of file diff --git a/aidl/src/main/java/com/ggz/aidl/SecondFragment.kt b/aidl/src/main/java/com/ggz/aidl/SecondFragment.kt new file mode 100644 index 0000000..d7fb1f0 --- /dev/null +++ b/aidl/src/main/java/com/ggz/aidl/SecondFragment.kt @@ -0,0 +1,44 @@ +package com.ggz.aidl + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.navigation.fragment.findNavController +import com.ggz.aidl.databinding.FragmentSecondBinding + +/** + * A simple [Fragment] subclass as the second destination in the navigation. + */ +class SecondFragment : Fragment() { + + private var _binding: FragmentSecondBinding? = null + + // This property is only valid between onCreateView and + // onDestroyView. + private val binding get() = _binding!! + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + + _binding = FragmentSecondBinding.inflate(inflater, container, false) + return binding.root + + } + + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + + binding.buttonSecond.setOnClickListener { + findNavController().navigate(R.id.action_SecondFragment_to_FirstFragment) + } + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/aidl/src/main/res/drawable-v24/ic_launcher_foreground.xml b/aidl/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..37caeb3 --- /dev/null +++ b/aidl/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/aidl/src/main/res/drawable/ic_launcher_background.xml b/aidl/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..94b99f0 --- /dev/null +++ b/aidl/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/aidl/src/main/res/layout/activity_main.xml b/aidl/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..fe9ff5d --- /dev/null +++ b/aidl/src/main/res/layout/activity_main.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aidl/src/main/res/layout/content_main.xml b/aidl/src/main/res/layout/content_main.xml new file mode 100644 index 0000000..30c8627 --- /dev/null +++ b/aidl/src/main/res/layout/content_main.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/aidl/src/main/res/layout/fragment_first.xml b/aidl/src/main/res/layout/fragment_first.xml new file mode 100644 index 0000000..0b93b30 --- /dev/null +++ b/aidl/src/main/res/layout/fragment_first.xml @@ -0,0 +1,31 @@ + + + + + +