Skip to content
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

made necessary changes #28

Closed
wants to merge 1 commit into from
Closed
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
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
Loading