Skip to content

Commit

Permalink
added blank achievements activity
Browse files Browse the repository at this point in the history
  • Loading branch information
PratyushSingh07 committed Jan 6, 2023
1 parent 2e8f7bf commit c144064
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 50 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
android:supportsRtl="true"
android:theme="@style/Theme.CycloFit"
tools:targetApi="31">
<activity android:name=".ui.activities.AchievementsActivity"/>
<activity
android:name=".ui.activities.ProfileActivity"
android:exported="false">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.cyclofit.ui.activities

import androidx.appcompat.app.AppCompatActivity

class AchievementsActivity:AppCompatActivity() {

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.os.Bundle
import android.view.WindowManager
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.AppCompatButton
import com.example.cyclofit.R
import com.example.cyclofit.model.User
import com.example.cyclofit.ui.firestore.FirestoreClass
Expand Down Expand Up @@ -38,17 +39,18 @@ class SettingsActivity :AppCompatActivity(){

selectThemeBtn = findViewById(R.id.changeThemeButton)
changeAppTheme()
// //getTheDarkMode
// sharedPreferences = getSharedPreferences("NightMode",0)
// nightMode = sharedPreferences.getBoolean("isNewUser",false)
// getDarkMode(nightMode)

val btn = findViewById<Button>(R.id.logoutButton)
btn.setOnClickListener{
FirebaseAuth.getInstance().signOut()
finish()
startActivity(Intent(this,AuthenticationActivity::class.java))
}

val exploreBtn=findViewById<AppCompatButton>(R.id.exploreBtn)
exploreBtn.setOnClickListener {
startActivity(Intent(this,AchievementsActivity::class.java))
}
}

override fun onResume() {
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/res/layout/activity_achievement.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="This is achievements activity"/>

</androidx.constraintlayout.widget.ConstraintLayout>
144 changes: 98 additions & 46 deletions app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down Expand Up @@ -71,58 +71,110 @@
app:layout_constraintTop_toBottomOf="@+id/tv_email">

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
>

<com.google.android.material.textview.MaterialTextView
android:id="@+id/appthemetext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_gravity="center"
android:layout_marginStart="15dp"
android:layout_marginTop="18dp"
android:text="App Theme"
android:textColor="@color/textColor"
android:textSize="22sp" />

<com.google.android.material.textview.MaterialTextView
android:id="@+id/textthemesubtitle"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/colorTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/appthemetext"
android:layout_alignParentStart="true"
android:layout_marginStart="15dp"
android:textSize="12sp"
android:textColor="@color/colorGrey"
android:layout_marginTop="2dp"
android:text="Choose Your App Theme" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/changeThemeButton"
>

<com.google.android.material.textview.MaterialTextView
android:id="@+id/appthemetext"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_gravity="center"
android:layout_marginStart="15dp"
android:layout_marginTop="18dp"
android:text="App Theme"
android:textColor="@color/textColor"
android:textSize="22sp" />

<com.google.android.material.textview.MaterialTextView
android:id="@+id/textthemesubtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/appthemetext"
android:layout_alignParentStart="true"
android:layout_marginStart="15dp"
android:textSize="12sp"
android:textColor="@color/colorGrey"
android:layout_marginTop="2dp"
android:text="Choose Your App Theme" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/changeThemeButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="15dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="15dp"
android:background="@drawable/roundedbtn"
android:gravity="center"
android:text="Theme"
android:textAllCaps="false"
app:cornerRadius="10dp"
android:layout_alignParentTop="true"
/>

</RelativeLayout>

<RelativeLayout
android:layout_below="@+id/colorTheme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="15dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="15dp"
android:background="@drawable/roundedbtn"
android:gravity="center"
android:text="Theme"
android:textAllCaps="false"
app:cornerRadius="10dp"
android:layout_alignParentTop="true"
/>

>

<com.google.android.material.textview.MaterialTextView
android:id="@+id/achievementsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:layout_gravity="center"
android:layout_marginStart="15dp"
android:layout_marginTop="18dp"
android:text="Achievements"
android:textColor="@color/textColor"
android:textSize="22sp" />

<com.google.android.material.textview.MaterialTextView
android:layout_below="@id/achievementsText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginStart="15dp"
android:textSize="12sp"
android:textColor="@color/colorGrey"
android:layout_marginTop="2dp"
android:text="Unlock New Achievements" />

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/exploreBtn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginStart="15dp"
android:layout_marginTop="15dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="15dp"
android:background="@drawable/roundedbtn"
android:gravity="center"
android:text="Explore"
android:textAllCaps="false"
app:cornerRadius="10dp"
android:layout_alignParentTop="true"
/>

</RelativeLayout>
</RelativeLayout>





<!-- <com.google.android.material.button.MaterialButton-->
<!-- android:id="@+id/lightMode"-->
<!-- android:layout_width="wrap_content"-->
Expand Down Expand Up @@ -196,4 +248,4 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</RelativeLayout>

0 comments on commit c144064

Please sign in to comment.