Skip to content

Commit

Permalink
made necessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
debojitdas598 committed Aug 26, 2023
1 parent 1942273 commit a056f6e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 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.

2 changes: 1 addition & 1 deletion .idea/gradle.xml

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

2 changes: 1 addition & 1 deletion .idea/misc.xml

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

Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ class DashboardActivity:AppCompatActivity() {
}

override fun onBackPressed() {
if(mCount==0)
if(mCount==0) {
goHomeFragment()
else
super.onBackPressed()
}
else {
super.onBackPressed()
}
mCount++
}
private fun setCurrentFragment(fragment: Fragment) =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package com.example.cyclofit.ui.activities
import android.content.Intent
import android.content.SharedPreferences
import android.content.SharedPreferences.Editor
import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.WindowManager
import android.widget.Button
Expand All @@ -20,7 +18,7 @@ import kotlinx.android.synthetic.main.activity_settings.*

class SettingsActivity :AppCompatActivity(){

private lateinit var selectThemeBtn:Button
private lateinit var selectThemeButton:Button
private var nightMode:Boolean = false
private lateinit var sharedPreferences:SharedPreferences
private lateinit var editor:Editor
Expand All @@ -37,7 +35,7 @@ class SettingsActivity :AppCompatActivity(){
dialogFragment = DialogFragment()


selectThemeBtn = findViewById(R.id.changeThemeButton)
selectThemeButton = findViewById(R.id.changeThemeButton)
changeAppTheme()

val btn = findViewById<Button>(R.id.logoutButton)
Expand Down Expand Up @@ -66,7 +64,7 @@ class SettingsActivity :AppCompatActivity(){


private fun changeAppTheme(){
selectThemeBtn.setOnClickListener {
selectThemeButton.setOnClickListener {
dialogFragment.show(supportFragmentManager,"customDialog")
// editor = sharedPreferences.edit()
// editor.putBoolean("isNewUser",false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
package com.example.cyclofit.ui.activities

import android.annotation.SuppressLint
import android.app.Dialog
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.content.SharedPreferences
import android.content.res.Configuration
import android.graphics.drawable.AnimationDrawable
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.util.Log
import android.view.WindowManager
import android.widget.LinearLayout
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatDelegate
import com.example.cyclofit.R
import com.google.firebase.auth.FirebaseAuth
Expand All @@ -36,10 +30,10 @@ class SplashScreen : AppCompatActivity() {
//checkDarkMode
checkDarkMode()
val linear = findViewById<LinearLayout>(R.id.background_splash_screen)
val animationDrawable = linear.background as AnimationDrawable
animationDrawable.setEnterFadeDuration(2000)
animationDrawable.setExitFadeDuration(2000)
animationDrawable.start()
val animDrawable = linear.background as AnimationDrawable
animDrawable.setEnterFadeDuration(2000)
animDrawable.setExitFadeDuration(2000)
animDrawable.start()

if(FirebaseAuth.getInstance().currentUser == null){
Handler(Looper.getMainLooper()).postDelayed({
Expand Down

0 comments on commit a056f6e

Please sign in to comment.