Skip to content

Commit 582839a

Browse files
committed
Add an Android Application project which was generated by an Android Studio template
1 parent 80d6e54 commit 582839a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1101
-0
lines changed

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.name

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
compileSdk 32
8+
9+
defaultConfig {
10+
applicationId "tech.apter.dependabot.proofofconcept"
11+
minSdk 21
12+
targetSdk 32
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
}
29+
kotlinOptions {
30+
jvmTarget = '1.8'
31+
}
32+
buildFeatures {
33+
viewBinding true
34+
}
35+
}
36+
37+
dependencies {
38+
39+
implementation 'androidx.core:core-ktx:1.7.0'
40+
implementation 'androidx.appcompat:appcompat:1.4.2'
41+
implementation 'com.google.android.material:material:1.6.1'
42+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
43+
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0'
44+
implementation 'androidx.navigation:navigation-ui-ktx:2.5.0'
45+
testImplementation 'junit:junit:4.13.2'
46+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
47+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
48+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package tech.apter.dependabot.proofofconcept
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("tech.apter.dependabot.proofofconcept", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="tech.apter.dependabot.proofofconcept">
5+
6+
<application
7+
android:allowBackup="true"
8+
android:dataExtractionRules="@xml/data_extraction_rules"
9+
android:fullBackupContent="@xml/backup_rules"
10+
android:icon="@mipmap/ic_launcher"
11+
android:label="@string/app_name"
12+
android:roundIcon="@mipmap/ic_launcher_round"
13+
android:supportsRtl="true"
14+
android:theme="@style/Theme.DependabotProofOfConcept"
15+
tools:targetApi="31">
16+
<activity
17+
android:name=".MainActivity"
18+
android:exported="true"
19+
android:label="@string/app_name"
20+
android:theme="@style/Theme.DependabotProofOfConcept.NoActionBar">
21+
<intent-filter>
22+
<action android:name="android.intent.action.MAIN" />
23+
24+
<category android:name="android.intent.category.LAUNCHER" />
25+
</intent-filter>
26+
</activity>
27+
</application>
28+
29+
</manifest>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package tech.apter.dependabot.proofofconcept
2+
3+
import android.os.Bundle
4+
import androidx.fragment.app.Fragment
5+
import android.view.LayoutInflater
6+
import android.view.View
7+
import android.view.ViewGroup
8+
import androidx.navigation.fragment.findNavController
9+
import tech.apter.dependabot.proofofconcept.databinding.FragmentFirstBinding
10+
11+
/**
12+
* A simple [Fragment] subclass as the default destination in the navigation.
13+
*/
14+
class FirstFragment : Fragment() {
15+
16+
private var _binding: FragmentFirstBinding? = null
17+
18+
// This property is only valid between onCreateView and
19+
// onDestroyView.
20+
private val binding get() = _binding!!
21+
22+
override fun onCreateView(
23+
inflater: LayoutInflater, container: ViewGroup?,
24+
savedInstanceState: Bundle?
25+
): View? {
26+
27+
_binding = FragmentFirstBinding.inflate(inflater, container, false)
28+
return binding.root
29+
30+
}
31+
32+
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
33+
super.onViewCreated(view, savedInstanceState)
34+
35+
binding.buttonFirst.setOnClickListener {
36+
findNavController().navigate(R.id.action_FirstFragment_to_SecondFragment)
37+
}
38+
}
39+
40+
override fun onDestroyView() {
41+
super.onDestroyView()
42+
_binding = null
43+
}
44+
}

0 commit comments

Comments
 (0)