Skip to content

Commit

Permalink
Update Android SDK, Kotlin, Gradle and Dependencies version
Browse files Browse the repository at this point in the history
  • Loading branch information
johncodeos committed Feb 1, 2022
1 parent 05f48c9 commit 26f556e
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 0 additions & 13 deletions .idea/runConfigurations.xml

This file was deleted.

36 changes: 23 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,36 +1,46 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
compileSdk 32

defaultConfig {
applicationId "com.example.searchrecyclerviewexample"
minSdkVersion 15
targetSdkVersion 30
minSdk 19
targetSdk 32
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.core:core-ktx:1.7.0'

implementation 'androidx.recyclerview:recyclerview:1.2.1'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
2 changes: 1 addition & 1 deletion app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
8 changes: 6 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".DetailsActivity"></activity>
<activity android:name=".MainActivity">
<activity
android:name=".DetailsActivity"
android:exported="true" />
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,24 @@ import kotlin.collections.ArrayList

class MainActivity : AppCompatActivity() {

lateinit var adapter: RecyclerView_Adapter
lateinit var adapter: RecyclerViewAdapter
lateinit var countryrv: RecyclerView

private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityMainBinding.inflate(layoutInflater)
val view = binding.root
setContentView(view)
setContentView(binding.root)

val searchIcon = binding.countrySearch.findViewById<ImageView>(R.id.search_mag_icon)
val searchIcon = binding.countrySearch.findViewById<ImageView>(androidx.appcompat.R.id.search_mag_icon)
searchIcon.setColorFilter(Color.WHITE)


val cancelIcon = binding.countrySearch.findViewById<ImageView>(R.id.search_close_btn)
val cancelIcon = binding.countrySearch.findViewById<ImageView>(androidx.appcompat.R.id.search_close_btn)
cancelIcon.setColorFilter(Color.WHITE)

val textView = binding.countrySearch.findViewById<TextView>(R.id.search_src_text)
val textView = binding.countrySearch.findViewById<TextView>(androidx.appcompat.R.id.search_src_text)
textView.setTextColor(Color.WHITE)
// If you want to change the color of the cursor, change the 'colorAccent' in colors.xml

Expand Down Expand Up @@ -71,7 +70,7 @@ class MainActivity : AppCompatActivity() {
(String(Character.toChars(firstChar)) + String(Character.toChars(secondChar)))
countryListWithEmojis.add("$countryName $flag")
}
adapter = RecyclerView_Adapter(countryListWithEmojis)
adapter = RecyclerViewAdapter(countryListWithEmojis)
countryrv.adapter = adapter
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import java.util.*
import kotlin.collections.ArrayList


class RecyclerView_Adapter(private var countryList: ArrayList<String>) :
class RecyclerViewAdapter(private var countryList: ArrayList<String>) :
RecyclerView.Adapter<RecyclerView.ViewHolder>(), Filterable {

var countryFilterList = ArrayList<String>()
Expand Down
26 changes: 5 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.5.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
mavenCentral()
}
plugins {
id 'com.android.application' version '7.1.0' apply false
id 'com.android.library' version '7.1.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.10' apply false
}

task clean(type: Delete) {
delete rootProject.buildDir
}
}
10 changes: 6 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# 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
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
6 changes: 3 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Feb 15 13:30:06 EET 2021
#Tue Feb 01 16:38:26 EET 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
zipStoreBase=GRADLE_USER_HOME
16 changes: 15 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
include ':app'
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name='SearchRecyclerViewExample'
include ':app'

0 comments on commit 26f556e

Please sign in to comment.