Skip to content

Commit

Permalink
Merge pull request #17 from itsyourap/itsyourap-patch-2
Browse files Browse the repository at this point in the history
[fix]: UI Fixes
  • Loading branch information
Sbiswas001 authored Jun 16, 2024
2 parents 8c1f9b5 + ec9a5cc commit 6ad7ed7
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 231 deletions.
26 changes: 22 additions & 4 deletions app/src/main/java/sayan/apps/numplex/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
package sayan.apps.numplex

import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.os.Looper
import android.view.MenuItem
import android.view.inputmethod.InputMethodManager
import android.widget.TextView
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.ActionBarDrawerToggle
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import androidx.drawerlayout.widget.DrawerLayout
import androidx.fragment.app.Fragment
import com.google.android.material.navigation.NavigationView
import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInClient
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
import com.google.android.material.navigation.NavigationView
import com.google.firebase.auth.FirebaseAuth
import android.content.Intent
import android.widget.TextView
import com.squareup.picasso.Picasso

class MainActivity : AppCompatActivity() {
Expand Down Expand Up @@ -62,6 +64,10 @@ class MainActivity : AppCompatActivity() {
mGoogleSignInClient = GoogleSignIn.getClient(this, gso)

drawerLayout = findViewById(R.id.drawerLayout)
drawerLayout.addDrawerListener(object : DrawerLayout.SimpleDrawerListener() {
// Close the keyboard when the drawer starts moving
override fun onDrawerStateChanged(newState: Int) = closeKeyboard()
})
val navView: NavigationView = findViewById(R.id.navView)
toggle = ActionBarDrawerToggle(this, drawerLayout, R.string.open, R.string.close)
drawerLayout.addDrawerListener(toggle)
Expand Down Expand Up @@ -113,7 +119,11 @@ class MainActivity : AppCompatActivity() {
}

R.id.nav_update -> {
Toast.makeText(applicationContext, "Latest Version is already Installed !!", Toast.LENGTH_SHORT).show()
Toast.makeText(
applicationContext,
"Latest Version is already Installed !!",
Toast.LENGTH_SHORT
).show()
}

R.id.nav_feedback -> {
Expand All @@ -128,6 +138,14 @@ class MainActivity : AppCompatActivity() {
}
}

private fun closeKeyboard() {
val view = this.currentFocus
if (view != null) {
val imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(view.windowToken, 0)
}
}

private fun goToSignInActivity() {
val intent = Intent(this, SignInActivity::class.java)
startActivity(intent)
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/sayan/apps/numplex/SignInActivity.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package sayan.apps.numplex

import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.ImageButton
import android.widget.LinearLayout
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import com.google.android.gms.auth.api.signin.GoogleSignIn
import com.google.android.gms.auth.api.signin.GoogleSignInOptions
import com.google.android.gms.common.SignInButton
import com.google.android.gms.common.api.ApiException
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.GoogleAuthProvider
Expand All @@ -25,6 +24,7 @@ class SignInActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)

setContentView(R.layout.activity_signin)
enableEdgeToEdge()

auth = FirebaseAuth.getInstance()

Expand All @@ -37,7 +37,7 @@ class SignInActivity : AppCompatActivity() {
finish() // finish the current activity to prevent the user from coming back to the SignInActivity using the back button
}

val signInButton = findViewById<ImageButton>(R.id.google_sign_in_button)
val signInButton = findViewById<SignInButton>(R.id.google_sign_in_button)
signInButton.setOnClickListener {
signIn()
}
Expand Down
170 changes: 0 additions & 170 deletions app/src/main/res/drawable/ic_launcher_background.xml

This file was deleted.

30 changes: 0 additions & 30 deletions app/src/main/res/drawable/ic_launcher_foreground.xml

This file was deleted.

Binary file removed app/src/main/res/drawable/sign_in_image_google.png
Binary file not shown.
14 changes: 4 additions & 10 deletions app/src/main/res/layout/activity_signin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,16 @@
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/app_icon"
android:layout_gravity="center"
android:layout_marginTop="100dp"/>
android:layout_marginTop="100dp"
android:src="@drawable/app_icon" />

<ImageButton
<com.google.android.gms.common.SignInButton
android:id="@+id/google_sign_in_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/sign_in_image_google"
android:contentDescription="@string/google_sign_in"
android:background="?attr/selectableItemBackgroundBorderless"
android:layout_gravity="center"
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:maxWidth="200dp"
android:maxHeight="100dp"/>
android:contentDescription="@string/google_sign_in" />


</LinearLayout>
6 changes: 0 additions & 6 deletions app/src/main/res/mipmap-anydpi/ic_launcher.xml

This file was deleted.

6 changes: 0 additions & 6 deletions app/src/main/res/mipmap-anydpi/ic_launcher_round.xml

This file was deleted.

Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.
Binary file removed app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Binary file not shown.
Binary file not shown.

0 comments on commit 6ad7ed7

Please sign in to comment.