Skip to content

Commit

Permalink
Dashboard Page UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Suswan114 committed Mar 6, 2022
1 parent a1ba9a7 commit 14368ef
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 18 deletions.
13 changes: 12 additions & 1 deletion .idea/misc.xml

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

1 change: 1 addition & 0 deletions .idea/vcs.xml

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

1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ dependencies {
implementation 'com.google.android.material:material:1.4.0'
implementation 'com.google.firebase:firebase-auth-ktx:21.0.1'
implementation 'com.google.firebase:firebase-firestore-ktx:24.0.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
Expand Down
24 changes: 15 additions & 9 deletions app/src/main/java/com/hazard/samarpan/Main2Activity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@ import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase

class Main2Activity : AppCompatActivity() {
private var btnLogout: Button? =null
// private var btnLogout: Button? =null

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setTheme(R.style.Theme_Samarpan)
setContentView(R.layout.activity_main2)
addFragment()

//this is just for testing the logout functionality remove this while adding the dashboard fragment
btnLogout=findViewById(R.id.btnLogout)
// btnLogout=findViewById(R.id.btnLogout)
//
// btnLogout?.setOnClickListener{
// Firebase.auth.signOut()
// val intent=Intent(this,MainActivity::class.java)
// startActivity(intent)
// finish()
// }

btnLogout?.setOnClickListener{
Firebase.auth.signOut()
val intent=Intent(this,MainActivity::class.java)
startActivity(intent)
finish()
}
}

private fun addFragment() {
val dashboard=DashboardFragment()
supportFragmentManager.beginTransaction().add(R.id.fragment_container2,dashboard).commit()
}
}
19 changes: 12 additions & 7 deletions app/src/main/res/layout/activity_main2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
tools:context=".Main2Activity"
android:orientation="vertical">

<Button
android:id="@+id/btnLogout"
<!-- <Button-->
<!-- android:id="@+id/btnLogout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="Logout"-->
<!-- android:layout_marginTop="20dp"-->
<!-- android:textSize="20sp"-->
<!-- android:textAllCaps="false"/>-->

<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Logout"
android:layout_marginTop="20dp"
android:textSize="20sp"
android:textAllCaps="false"/>
android:layout_height="match_parent"
android:id="@+id/fragment_container2"/>

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<color name="theme_text_color_body"> #494F55</color>
<color name="theme_text_color_bold">#333333</color>
<color name="theme_transparent_button">#00000000</color>
<color name="profile_button_color">#EE9A40</color>

<color name="ColorTextIcons">#b6FFFFFF</color>

Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@
<string name="get_started">Get started</string>
<string name="ngosignup1_phone_number">Phone number</string>
<string name="next">Next</string>
<string name="categories">Categories</string>
<string name="clothing">Clothing</string>
<string name="view_more">View more</string>
<string name="book_sharing_text">Now share your books with your friends</string>
<!-- TODO: Remove or change this placeholder text -->
<string name="hello_blank_fragment">Hello blank fragment</string>
</resources>
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.android.tools.build:gradle:7.0.1'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10'
classpath 'com.google.gms:google-services:4.3.10'

Expand Down

0 comments on commit 14368ef

Please sign in to comment.