-
Notifications
You must be signed in to change notification settings - Fork 44
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||||||||||||||||||
|
||||||||||||||||||
|
||||||||||||||||||
class MainActivity : AppCompatActivity() { | ||||||||||||||||||
private val binding: ActivityMainBinding by lazy { | ||||||||||||||||||
ActivityMainBinding.inflate(layoutInflater) | ||||||||||||||||||
} | ||||||||||||||||||
Comment on lines
+20
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Suggested change
|
||||||||||||||||||
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) | ||||||||||||||||||
} | ||||||||||||||||||
}) | ||||||||||||||||||
} | ||||||||||||||||||
} |
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"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify 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
|
||
|
||
<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> |
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainSignificant 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:
|
||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix package naming inconsistency and remove unused imports
The file path suggests the package should be
nl.joery.demo.timerangepicker
, but it's declared ascom.example.myapplication
. Also, there's an unused import forDoubleBounce
.📝 Committable suggestion