Skip to content

Commit

Permalink
Merge pull request #33 from tal-sitton/remove-toasts-prints
Browse files Browse the repository at this point in the history
removed prints and now the reset button turns into refresh when pressed
  • Loading branch information
tal-sitton authored Sep 15, 2022
2 parents 81355f2 + 096b840 commit 1ea22ca
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 24 deletions.
19 changes: 1 addition & 18 deletions .idea/misc.xml

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

5 changes: 2 additions & 3 deletions app/src/main/java/com/example/firstkotlinapp/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ class MainActivity : MyTemplateActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
Utils.showToast(this, "onCreate")
val scrl: ScrollView = findViewById(R.id.scrl)
scrl = findViewById(R.id.scrl)
scrl.smoothScrollTo(0, 0)

JSONUtils.jsonToList(this)
Expand Down Expand Up @@ -153,7 +152,7 @@ class MainActivity : MyTemplateActivity() {
if (backPressedTime + 2000 > System.currentTimeMillis()) {
this.finishAffinity()
} else {
Toast.makeText(baseContext, "Press the back button again to exit", Toast.LENGTH_SHORT)
Toast.makeText(baseContext, "לחץ שנית בכדי לסגור את האפליקציה", Toast.LENGTH_SHORT)
.show()
backPressedTime = System.currentTimeMillis()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.example.firstkotlinapp
import android.content.Intent
import android.view.Menu
import android.view.MenuItem
import android.widget.ProgressBar
import androidx.appcompat.app.AppCompatActivity

open class MyTemplateActivity : AppCompatActivity() {
Expand All @@ -20,9 +21,11 @@ open class MyTemplateActivity : AppCompatActivity() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
R.id.action_reset -> {
item.actionView = ProgressBar(this)
MainActivity.resetToDefault()
MainActivity.filter()
recreate()
item.actionView.postDelayed({ item.actionView = null }, 1)
true
}
R.id.action_about -> {
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/java/com/example/firstkotlinapp/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ class Utils {
targetCinemas.forEach { cinema ->
url += "${cinema.location.longitude},${cinema.location.latitude};"
}
url = url.dropLast(1)
println("URL: $url")
return url
return url.dropLast(1)
}

}
Expand Down

0 comments on commit 1ea22ca

Please sign in to comment.