Update to JDK 17, Gradle 7.3.3 & Android Gradle Plugin 7.1.0

Signed-off-by: psavarmattas <puranjaysavarmattas@gmail.com>
This commit is contained in:
2022-01-26 17:29:24 +05:30
parent 63f6cbaabf
commit 93a9a75e94
12 changed files with 46 additions and 24 deletions

2
.idea/compiler.xml generated
View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="CompilerConfiguration"> <component name="CompilerConfiguration">
<bytecodeTargetLevel target="15" /> <bytecodeTargetLevel target="17" />
</component> </component>
</project> </project>

13
.idea/misc.xml generated
View File

@@ -1,10 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="DesignSurface">
<option name="filePathToZoomLevelMap">
<map>
<entry key="..\:/Maneesha/GitHub/Project-Chatcom/app/src/main/res/layout/activity_main.xml" value="0.34010416666666665" />
<entry key="..\:/Maneesha/GitHub/Project-Chatcom/app/src/main/res/layout/activity_splash.xml" value="0.34010416666666665" />
<entry key="..\:/Maneesha/GitHub/Project-Chatcom/app/src/main/res/layout/fragment_chats.xml" value="0.34010416666666665" />
<entry key="..\:/Maneesha/GitHub/Project-Chatcom/app/src/main/res/layout/fragment_contacts.xml" value="0.34010416666666665" />
<entry key="..\:/Maneesha/GitHub/Project-Chatcom/app/src/main/res/layout/fragment_settings.xml" value="0.34010416666666665" />
</map>
</option>
</component>
<component name="ExternalStorageConfigurationManager" enabled="true" /> <component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="GitToolBoxStore"> <component name="GitToolBoxStore">
<option name="projectConfigVersion" value="2" /> <option name="projectConfigVersion" value="2" />
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_15_PREVIEW" project-jdk-name="15" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" /> <output url="file://$PROJECT_DIR$/out" />
</component> </component>
</project> </project>

View File

@@ -7,19 +7,19 @@ android {
compileSdk 32 compileSdk 32
defaultConfig { defaultConfig {
applicationId "com.example.chatcom" applicationId 'com.psmforums.chatcom'
minSdk 21 minSdk 21
targetSdk 32 targetSdk 32
versionCode 1 versionCode 1
versionName '0.0.1' versionName '0.0.1'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.debug
} }
buildTypes { buildTypes {
release { debug {
minifyEnabled false signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
compileOptions { compileOptions {
@@ -29,6 +29,8 @@ android {
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = '1.8'
} }
buildToolsVersion '32.0.0'
ndkVersion '23.1.7779620'
} }
dependencies { dependencies {
@@ -38,7 +40,7 @@ dependencies {
implementation 'com.google.android.material:material:1.5.0' implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3' implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3' androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
} }

View File

@@ -8,34 +8,41 @@ import androidx.fragment.app.FragmentActivity
import androidx.viewpager.widget.PagerAdapter import androidx.viewpager.widget.PagerAdapter
import androidx.viewpager2.adapter.FragmentStateAdapter import androidx.viewpager2.adapter.FragmentStateAdapter
import androidx.viewpager2.widget.ViewPager2 import androidx.viewpager2.widget.ViewPager2
import com.example.chatcom.mainScreens.Chats
import com.example.chatcom.mainScreens.Contacts
import com.example.chatcom.mainScreens.Settings
import com.google.android.material.tabs.TabLayout import com.google.android.material.tabs.TabLayout
import com.google.android.material.tabs.TabLayoutMediator import com.google.android.material.tabs.TabLayoutMediator
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
private lateinit var viewPager2: ViewPager2 private lateinit var viewPager2: ViewPager2
private lateinit var tabLayout : TabLayout private lateinit var tabLayout : TabLayout
private lateinit var toolbar: androidx.appcompat.widget.Toolbar private lateinit var toolbar: androidx.appcompat.widget.Toolbar
private lateinit var appPagerAdapter: AppPagerAdapter private lateinit var appPagerAdapter: AppPagerAdapter
private var titles = arrayListOf("Chats","Contacts","Settings") private var titles = arrayListOf("Chats","Contacts","Settings")
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main) setContentView(R.layout.activity_main)
toolbar = findViewById(R.id.toolbarMain) toolbar = findViewById(R.id.toolbarMain)
tabLayout = findViewById(R.id.tabLayoutMain) tabLayout = findViewById(R.id.tabLayoutMain)
viewPager2 = findViewById(R.id.viewPager2Main) viewPager2 = findViewById(R.id.viewPager2Main)
toolbar.title = "ChatCom" toolbar.title = "ChatCom"
setSupportActionBar(toolbar) setSupportActionBar(toolbar)
appPagerAdapter = AppPagerAdapter( this) appPagerAdapter = AppPagerAdapter( this)
viewPager2.adapter = appPagerAdapter viewPager2.adapter = appPagerAdapter
TabLayoutMediator(tabLayout,viewPager2){ TabLayoutMediator(tabLayout,viewPager2){
tab,position-> tab,position->
tab.text = titles[position] tab.text = titles[position]
}.attach() }.attach()
} }
class AppPagerAdapter(fragmentActivity: FragmentActivity):FragmentStateAdapter(fragmentActivity)
{ class AppPagerAdapter(fragmentActivity: FragmentActivity):FragmentStateAdapter(fragmentActivity) {
override fun getItemCount(): Int { override fun getItemCount(): Int {
return 3 return 3
} }
@@ -43,13 +50,12 @@ class MainActivity : AppCompatActivity() {
override fun createFragment(position: Int): Fragment { override fun createFragment(position: Int): Fragment {
return when(position) return when(position)
{ {
0->Chats() 0-> Chats()
2->Contacts() 2-> Contacts()
3->Settings() 3-> Settings()
else -> Chats() else -> Chats()
} }
} }
} }
} }

View File

@@ -1,10 +1,11 @@
package com.example.chatcom package com.example.chatcom.mainScreens
import android.os.Bundle import android.os.Bundle
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import com.example.chatcom.R
// TODO: Rename parameter arguments, choose names that match // TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER

View File

@@ -1,10 +1,11 @@
package com.example.chatcom package com.example.chatcom.mainScreens
import android.os.Bundle import android.os.Bundle
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import com.example.chatcom.R
// TODO: Rename parameter arguments, choose names that match // TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER

View File

@@ -1,10 +1,11 @@
package com.example.chatcom package com.example.chatcom.mainScreens
import android.os.Bundle import android.os.Bundle
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import com.example.chatcom.R
// TODO: Rename parameter arguments, choose names that match // TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER // the fragment initialization parameters, e.g. ARG_ITEM_NUMBER

View File

@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".Chats"> tools:context=".mainScreens.Chats">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragment layout -->
<TextView <TextView

View File

@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".Contacts"> tools:context=".mainScreens.Contacts">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragment layout -->
<TextView <TextView

View File

@@ -3,7 +3,7 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
tools:context=".Settings"> tools:context=".mainScreens.Settings">
<!-- TODO: Update blank fragment layout --> <!-- TODO: Update blank fragment layout -->
<TextView <TextView

View File

@@ -5,7 +5,7 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath "com.android.tools.build:gradle:7.0.4" classpath 'com.android.tools.build:gradle:7.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong

View File

@@ -1,6 +1,6 @@
#Sat Jan 22 13:06:18 IST 2022 #Wed Jan 26 16:42:57 IST 2022
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME