Skip to content

Commit 874b540

Browse files
committed
Development commit
Upgraded Gradle. Updated all internal dependencies. Fixed deprecated code. Set target SDK to 30. Made the benchmark to use internal files directory and removed the need for external storage access permission. Replaced Kotlin synthetics with Jetpack Viewbinding.
1 parent 82a7bce commit 874b540

File tree

7 files changed

+149
-206
lines changed

7 files changed

+149
-206
lines changed

app/build.gradle

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33

44
android {
5-
compileSdkVersion 29
5+
compileSdkVersion 30
66

7-
buildToolsVersion "29.0.3"
7+
buildToolsVersion "30.0.3"
88
defaultConfig {
99
applicationId "com.bharathvishal.textfilegeneratorbenchmark"
1010
minSdkVersion 21
11-
targetSdkVersion 29
11+
targetSdkVersion 30
1212
multiDexEnabled true
13-
versionCode 10
13+
versionCode 12
1414
vectorDrawables.useSupportLibrary = true
15-
versionName "1.2.3"
15+
versionName "1.2.4"
1616
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1717
}
1818

@@ -41,16 +41,16 @@ android {
4141

4242
dependencies {
4343
implementation fileTree(dir: 'libs', include: ['*.jar'])
44-
implementation 'com.google.android.material:material:1.3.0'
44+
implementation 'com.google.android.material:material:1.4.0'
4545
implementation 'com.github.bumptech.glide:glide:4.12.0'
4646
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
4747
implementation 'androidx.cardview:cardview:1.0.0'
4848
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
4949
implementation 'androidx.appcompat:appcompat:1.3.0'
50-
implementation 'androidx.core:core-ktx:1.5.0'
50+
implementation 'androidx.core:core-ktx:1.6.0'
5151
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
5252
testImplementation 'junit:junit:4.13.2'
53-
androidTestImplementation 'androidx.test:runner:1.3.0'
53+
androidTestImplementation 'androidx.test:runner:1.4.0'
5454
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3"
55-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
55+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
5656
}

app/src/main/AndroidManifest.xml

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,40 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
xmlns:tools="http://schemas.android.com/tools" package="com.bharathvishal.textfilegeneratorbenchmark">
4-
5-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
6-
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.bharathvishal.textfilegeneratorbenchmark">
75

86

97
<application
10-
android:allowBackup="true"
11-
android:icon="@mipmap/ic_launcher"
12-
android:requestLegacyExternalStorage="true"
13-
android:label="@string/app_name"
14-
android:roundIcon="@mipmap/ic_launcher_round"
15-
android:supportsRtl="true"
16-
android:theme="@style/AppTheme" tools:ignore="GoogleAppIndexingWarning"
8+
android:allowBackup="true"
9+
android:icon="@mipmap/ic_launcher"
10+
android:label="@string/app_name"
11+
android:requestLegacyExternalStorage="true"
12+
android:roundIcon="@mipmap/ic_launcher_round"
13+
android:supportsRtl="true"
14+
android:theme="@style/AppTheme"
15+
tools:ignore="GoogleAppIndexingWarning"
1716
tools:targetApi="q">
18-
<activity android:name=".MainActivity"
19-
android:screenOrientation="portrait">
17+
<activity
18+
android:name=".MainActivity"
19+
android:exported="true"
20+
android:screenOrientation="portrait"
21+
tools:ignore="LockedOrientationActivity">
2022
<intent-filter>
21-
<action android:name="android.intent.action.MAIN"/>
23+
<action android:name="android.intent.action.MAIN" />
2224

23-
<category android:name="android.intent.category.LAUNCHER"/>
25+
<category android:name="android.intent.category.LAUNCHER" />
2426
</intent-filter>
2527
</activity>
2628

2729

2830
<provider
29-
android:name="androidx.core.content.FileProvider"
30-
android:authorities="${applicationId}.provider"
31-
android:exported="false"
32-
android:grantUriPermissions="true">
31+
android:name="androidx.core.content.FileProvider"
32+
android:authorities="${applicationId}.provider"
33+
android:exported="false"
34+
android:grantUriPermissions="true">
3335
<meta-data
34-
android:name="android.support.FILE_PROVIDER_PATHS"
35-
android:resource="@xml/provider_paths_app" />
36+
android:name="android.support.FILE_PROVIDER_PATHS"
37+
android:resource="@xml/provider_paths_app" />
3638
</provider>
3739
</application>
3840

app/src/main/java/com/bharathvishal/textfilegeneratorbenchmark/MainActivity.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ package com.bharathvishal.textfilegeneratorbenchmark
44
import android.content.Context
55
import android.os.Bundle
66
import android.os.Handler
7+
import android.os.Looper
8+
import android.os.Looper.*
79
import android.widget.LinearLayout
810
import android.widget.Toast
911
import androidx.appcompat.app.AppCompatActivity
@@ -15,7 +17,6 @@ class MainActivity : AppCompatActivity() {
1517
private var fragmentLayout: LinearLayout? = null
1618

1719
//Fragment back button handling
18-
private var handlerOb: Handler? = null
1920
private var doubleBackToExitPressedOnce: Boolean = false
2021
private val mRunnableBackButton = Runnable { doubleBackToExitPressedOnce = false }
2122

@@ -33,7 +34,6 @@ class MainActivity : AppCompatActivity() {
3334

3435
activityContextMain = this@MainActivity
3536

36-
3737
try {
3838
val mgr = supportFragmentManager
3939
val trans = mgr.beginTransaction()
@@ -53,8 +53,10 @@ class MainActivity : AppCompatActivity() {
5353
override fun onBackPressed() {
5454
//part to handle back press
5555
//executed when stack_top=-1 and activity recreated value is No
56-
handlerOb = Handler()
57-
handlerOb?.postDelayed(mRunnableBackButton, 1500) // 1.50 seconds in ms
56+
Handler(Looper.getMainLooper()).postDelayed({
57+
mRunnableBackButton
58+
}, 1500)
59+
// 1.50 seconds in ms
5860

5961

6062
if (doubleBackToExitPressedOnce) {

0 commit comments

Comments
 (0)