Skip to content

Commit

Permalink
migrate from kapt to ksp
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve-Mr committed May 28, 2024
1 parent 1b15cfd commit e76473a
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 99 deletions.
20 changes: 10 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
id 'kotlin-kapt'
id 'com.google.devtools.ksp'
}

def keystorePropertiesFile = rootProject.file("key.properties")
Expand All @@ -25,7 +25,7 @@ android {

buildFeatures {
viewBinding true
dataBinding true
dataBinding false
}
splits {
// Configures multiple APKs based on ABI.
Expand Down Expand Up @@ -85,16 +85,16 @@ android {

dependencies {

implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.core:core-ktx:1.13.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

implementation "androidx.activity:activity-ktx:1.7.2"
implementation 'androidx.databinding:databinding-runtime:8.0.2'
implementation 'androidx.activity:activity-ktx:1.9.0'
implementation 'androidx.databinding:databinding-runtime:8.4.1'


def lifecycle_version = "2.6.1"
def lifecycle_version = '2.8.0'

// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
Expand All @@ -103,12 +103,12 @@ dependencies {
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"


def room_version = "2.6.0-alpha01"
def room_version = '2.6.1'

implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:2.5.1"
kapt "androidx.room:room-compiler:$room_version"
implementation 'androidx.room:room-ktx:2.6.1'
ksp "androidx.room:room-compiler:$room_version"

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/com/maary/liveinpeace/HistoryActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import android.view.View
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.WindowCompat
import androidx.databinding.DataBindingUtil
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.android.material.datepicker.CalendarConstraints
import com.google.android.material.datepicker.DateValidatorPointBackward
Expand Down Expand Up @@ -61,7 +60,7 @@ class HistoryActivity : AppCompatActivity(), DeviceMapChangeListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WindowCompat.setDecorFitsSystemWindows(window, false)
binding = DataBindingUtil.setContentView(this, R.layout.activity_history)
binding = ActivityHistoryBinding.inflate(layoutInflater)
setContentView(binding.root)

var pickedDate : String = LocalDate.now().toString()
Expand Down
166 changes: 80 additions & 86 deletions app/src/main/res/layout/activity_history.xml
Original file line number Diff line number Diff line change
@@ -1,105 +1,105 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">

<androidx.coordinatorlayout.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:fitsSystemWindows="true">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?attr/colorSurface"
android:fitsSystemWindows="true">
android:layout_height="wrap_content"
android:background="?attr/colorSurfaceContainerHighest"
android:fitsSystemWindows="true"
app:liftOnScroll="true">

<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutLargeStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorSurfaceContainerHighest"
app:liftOnScroll="true"
android:fitsSystemWindows="true">
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
app:contentScrim="?attr/colorSurfaceContainerHighest"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">

<com.google.android.material.appbar.CollapsingToolbarLayout
style="?attr/collapsingToolbarLayoutLargeStyle"
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
app:contentScrim="?attr/colorSurfaceContainerHighest"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/activity_history_toolbar"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
app:layout_collapseMode="pin"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:navigationIcon="@drawable/ic_close_24"
app:title="@string/history"
app:titleTextAppearance="@style/title_style" />

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/activity_history_toolbar"
android:layout_width="wrap_content"
android:layout_height="?attr/actionBarSize"
android:elevation="0dp"
app:layout_collapseMode="pin"
app:navigationIcon="@drawable/ic_close_24"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:title="@string/history"
app:titleTextAppearance="@style/title_style"/>
</com.google.android.material.appbar.CollapsingToolbarLayout>

</com.google.android.material.appbar.CollapsingToolbarLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp">

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/toggle_history"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp">
android:background="@android:color/transparent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:selectionRequired="true"
app:singleSelection="true">

<com.google.android.material.button.MaterialButtonToggleGroup
android:id="@+id/toggle_history"
<Button
android:id="@+id/button_timeline"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
app:selectionRequired="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:singleSelection="true">
<Button
android:id="@+id/button_timeline"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/timeline" />

<Button
android:id="@+id/button_summary"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/summary" />
</com.google.android.material.button.MaterialButtonToggleGroup>

android:text="@string/timeline" />

<Button
android:id="@+id/button_calendar"
style="@style/Widget.Material3.Button.Icon"
android:id="@+id/button_summary"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:icon = "@drawable/ic_calendar"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="06/13"/>
android:text="@string/summary" />
</com.google.android.material.button.MaterialButtonToggleGroup>


<Button
android:id="@+id/button_calendar"
style="@style/Widget.Material3.Button.Icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:icon="@drawable/ic_calendar"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="06/13" />

</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

</com.google.android.material.appbar.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>

<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" >
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@android:color/transparent">
android:background="@android:color/transparent"
android:orientation="vertical">

<TextView
android:id="@+id/title_current"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/current_connections"
android:layout_margin="16dp"
android:textStyle="bold"
android:textSize="16sp"/>
android:text="@string/current_connections"
android:textSize="16sp"
android:textStyle="bold" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/current_list"
Expand All @@ -108,17 +108,17 @@
android:clipChildren="false"
android:clipToPadding="false"
android:padding="8dp"
tools:listitem="@layout/item_current_connections"
tools:itemCount="2"/>
tools:itemCount="2"
tools:listitem="@layout/item_current_connections" />

<TextView
android:id="@+id/title_history"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/connections_history"
android:layout_margin="16dp"
android:textStyle="bold"
android:textSize="16sp"/>
android:text="@string/connections_history"
android:textSize="16sp"
android:textStyle="bold" />

<androidx.recyclerview.widget.RecyclerView
android:id="@+id/history_list"
Expand All @@ -127,15 +127,9 @@
android:clipChildren="false"
android:clipToPadding="false"
android:padding="8dp"
tools:listitem="@layout/item_connection"/>
tools:listitem="@layout/item_connection" />

</LinearLayout>
</androidx.core.widget.NestedScrollView>

</androidx.coordinatorlayout.widget.CoordinatorLayout>




</androidx.core.widget.NestedScrollView>

</layout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
plugins {
id 'com.android.application' version '8.4.0' apply false
id 'com.android.library' version '8.4.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0-Beta' apply false
id 'org.jetbrains.kotlin.android' version '2.0.0' apply false
id 'com.google.devtools.ksp' version "2.0.0-1.0.21" apply false
}

0 comments on commit e76473a

Please sign in to comment.