Skip to content

Testing time range picker + spinkit on new files #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package com.example.myapplication


import android.app.Activity
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.ProgressBar
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.myapplication.databinding.ActivityMainBinding
import com.github.ybq.android.spinkit.sprite.Sprite
import com.github.ybq.android.spinkit.style.DoubleBounce
import com.github.ybq.android.spinkit.style.Wave
import nl.joery.timerangepicker.TimeRangePicker
Comment on lines +1 to +17
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix package naming inconsistency and remove unused imports

The file path suggests the package should be nl.joery.demo.timerangepicker, but it's declared as com.example.myapplication. Also, there's an unused import for DoubleBounce.

- package com.example.myapplication
+ package nl.joery.demo.timerangepicker


import android.app.Activity
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.ProgressBar
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
- import com.example.myapplication.databinding.ActivityMainBinding
+ import nl.joery.demo.timerangepicker.databinding.ActivityExample1Binding
import com.github.ybq.android.spinkit.sprite.Sprite
- import com.github.ybq.android.spinkit.style.DoubleBounce
import com.github.ybq.android.spinkit.style.Wave
import nl.joery.timerangepicker.TimeRangePicker
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
package com.example.myapplication
import android.app.Activity
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.ProgressBar
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.myapplication.databinding.ActivityMainBinding
import com.github.ybq.android.spinkit.sprite.Sprite
import com.github.ybq.android.spinkit.style.DoubleBounce
import com.github.ybq.android.spinkit.style.Wave
import nl.joery.timerangepicker.TimeRangePicker
package nl.joery.demo.timerangepicker
import android.app.Activity
import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.ProgressBar
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import nl.joery.demo.timerangepicker.databinding.ActivityExample1Binding
import com.github.ybq.android.spinkit.sprite.Sprite
import com.github.ybq.android.spinkit.style.Wave
import nl.joery.timerangepicker.TimeRangePicker



class MainActivity : AppCompatActivity() {
private val binding: ActivityMainBinding by lazy {
ActivityMainBinding.inflate(layoutInflater)
}
Comment on lines +20 to +23
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix class name and binding reference inconsistency

The file name is ExampleActivity1.kt but the class is named MainActivity. Also, the binding reference should match the layout file name.

- class MainActivity : AppCompatActivity() {
+ class ExampleActivity1 : AppCompatActivity() {
-     private val binding: ActivityMainBinding by lazy {
-         ActivityMainBinding.inflate(layoutInflater)
+     private val binding: ActivityExample1Binding by lazy {
+         ActivityExample1Binding.inflate(layoutInflater)
      }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
class MainActivity : AppCompatActivity() {
private val binding: ActivityMainBinding by lazy {
ActivityMainBinding.inflate(layoutInflater)
}
class ExampleActivity1 : AppCompatActivity() {
private val binding: ActivityExample1Binding by lazy {
ActivityExample1Binding.inflate(layoutInflater)
}

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContentView(binding.root)
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
insets
}
val progressBar = findViewById<View>(R.id.spin_kit) as ProgressBar
val wave: Sprite = Wave()
progressBar.indeterminateDrawable = wave
binding.picker.setOnTimeChangeListener(object : TimeRangePicker.OnTimeChangeListener {
override fun onStartTimeChange(startTime: TimeRangePicker.Time) {
Log.d("TimeRangePicker", "Start time: " + startTime)
}

override fun onEndTimeChange(endTime: TimeRangePicker.Time) {
Log.d("TimeRangePicker", "End time: " + endTime.hour)
}

override fun onDurationChange(duration: TimeRangePicker.TimeDuration) {
Log.d("TimeRangePicker", "Duration: " + duration.hour)
}
})
}
}
51 changes: 51 additions & 0 deletions demo/src/main/res/layout/activity_example_1.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify context reference in tools:context attribute

The tools:context attribute references ".MainActivity", but based on the file path of the Kotlin file (ExampleActivity1.kt), there might be a naming inconsistency between the file and class name or an incorrect package reference.


🏁 Script executed:

#!/bin/bash
# Check if there's a mismatch between file name and class name
echo "Checking for MainActivity class in ExampleActivity1.kt:"
grep -r "class MainActivity" demo/src/main/java/

# Check the actual package of the MainActivity class
echo "Checking package declaration in ExampleActivity1.kt:"
grep -r "package" demo/src/main/java/nl/joery/demo/timerangepicker/ExampleActivity1.kt

Length of output: 519


tools:context references the correct class – address file/class naming and package mismatch

  • The tools:context=".MainActivity" attribute is valid: ExampleActivity1.kt indeed declares
    package com.example.myapplication
    class MainActivity : AppCompatActivity() { … }
  • However, the Kotlin file’s name and directory don’t align with its class and package:
    • Filename ExampleActivity1.kt vs. class MainActivity
      • Rename the file to MainActivity.kt (or rename the class to ExampleActivity1 and update the layout tools:context accordingly)
    • Declared package com.example.myapplication vs. directory nl/joery/demo/timerangepicker
      • Update the package to nl.joery.demo.timerangepicker (or relocate the file under com/example/myapplication)


<com.github.ybq.android.spinkit.SpinKitView
android:id="@+id/spin_kit"
style="@style/SpinKitView.Wave"
android:layout_width="88dp"
android:layout_height="81dp"
android:layout_gravity="center"
app:SpinKit_Color="#E6477B"
app:layout_constraintBottom_toTopOf="@+id/textView"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.887" />

<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.514"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.476" />

<nl.joery.timerangepicker.TimeRangePicker
android:id="@+id/picker"
app:trp_sliderColor="#CE5454"
android:layout_width="327dp"
app:trp_clockFace="SAMSUNG"
android:layout_height="230dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
app:trp_endTime="6:30"
app:trp_startTime="22:00"
app:trp_thumbIconEnd="@drawable/baseline_adjust_24"
app:trp_thumbIconStart="@drawable/baseline_assignment_ind_24" />

</androidx.constraintlayout.widget.ConstraintLayout>
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Mar 03 23:02:02 CET 2020
#Tue Apr 29 21:46:25 IST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
Comment on lines +1 to +4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Significant Gradle version upgrade with future timestamp

The Gradle wrapper has been updated from version 6.7.1 to 8.9, which is a major version jump. This could introduce breaking changes or compatibility issues with existing project dependencies.

Also, the timestamp is set to April 29, 2025, which is unusually in the future.


🏁 Script executed:

#!/bin/bash
# Verify if there are any compatibility issues with this Gradle version
# Check the project's build files for potential compatibility issues

# List the Android Gradle plugin version used in the project
echo "Checking Android Gradle Plugin version:"
grep -r "com.android.tools.build:gradle:" --include="*.gradle" .

# Check other key dependencies that might have Gradle version requirements
echo "Checking other key dependencies:"
grep -r "dependencies" --include="*.gradle" . | grep -A 10 "dependencies" | grep -v "//"

Length of output: 500


Upgrade Android Gradle Plugin for Gradle 8.9 & Fix Future Timestamp

The Gradle wrapper has jumped from 6.7.1 to 8.9, but your project is still using Android Gradle Plugin 4.2.2, which only supports up to Gradle 6.x. Gradle 8.9 requires AGP 7.4.0+ (see https://developer.android.com/studio/releases/gradle-plugin#updating-gradle). Additionally, the timestamp in gradle-wrapper.properties is set to a future date.

Please address the following:

  • Update com.android.tools.build:gradle in build.gradle from 4.2.2 to at least 7.4.0 (or the latest compatible AGP).
  • Verify and bump other dependencies/plugins that may have Gradle 8.x requirements.
  • Correct or remove the future timestamp line in gradle/wrapper/gradle-wrapper.properties.

zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip