From 5e2784401a1a433352b0c3941f0ae4ca4f4aaf1f Mon Sep 17 00:00:00 2001 From: Ankan Pal Date: Mon, 14 Oct 2024 20:07:19 +0530 Subject: [PATCH] Organise UI structure --- app/src/main/AndroidManifest.xml | 4 +-- .../numplex/{ => ui/activity}/MainActivity.kt | 6 +++- .../{ => ui/activity}/SignInActivity.kt | 3 +- .../fragment}/ClassificationsFragment.kt | 3 +- .../{ => ui/fragment}/FeedbackFragment.kt | 3 +- .../{ => ui/fragment}/NumplexFragment.kt | 35 ++++++++++++++++++- app/src/main/res/layout/activity_main.xml | 2 +- app/src/main/res/layout/activity_signin.xml | 2 +- .../res/layout/fragment_classifications.xml | 2 +- app/src/main/res/layout/fragment_feedback.xml | 2 +- app/src/main/res/layout/fragment_numplex.xml | 2 +- 11 files changed, 52 insertions(+), 12 deletions(-) rename app/src/main/java/sayan/apps/numplex/{ => ui/activity}/MainActivity.kt (96%) rename app/src/main/java/sayan/apps/numplex/{ => ui/activity}/SignInActivity.kt (98%) rename app/src/main/java/sayan/apps/numplex/{ => ui/fragment}/ClassificationsFragment.kt (99%) rename app/src/main/java/sayan/apps/numplex/{ => ui/fragment}/FeedbackFragment.kt (97%) rename app/src/main/java/sayan/apps/numplex/{ => ui/fragment}/NumplexFragment.kt (84%) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 4ef668b..80e1dee 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,13 +12,13 @@ android:supportsRtl="true" android:theme="@style/Theme.Numplex"> diff --git a/app/src/main/java/sayan/apps/numplex/MainActivity.kt b/app/src/main/java/sayan/apps/numplex/ui/activity/MainActivity.kt similarity index 96% rename from app/src/main/java/sayan/apps/numplex/MainActivity.kt rename to app/src/main/java/sayan/apps/numplex/ui/activity/MainActivity.kt index e9cf48e..811eabc 100644 --- a/app/src/main/java/sayan/apps/numplex/MainActivity.kt +++ b/app/src/main/java/sayan/apps/numplex/ui/activity/MainActivity.kt @@ -1,4 +1,4 @@ -package sayan.apps.numplex +package sayan.apps.numplex.ui.activity import android.content.Intent import android.os.Bundle @@ -24,6 +24,10 @@ import androidx.fragment.app.Fragment import com.google.android.material.navigation.NavigationView import com.google.firebase.auth.FirebaseAuth import com.squareup.picasso.Picasso +import sayan.apps.numplex.R +import sayan.apps.numplex.ui.fragment.ClassificationsFragment +import sayan.apps.numplex.ui.fragment.FeedbackFragment +import sayan.apps.numplex.ui.fragment.NumplexFragment import java.util.concurrent.Executors class MainActivity : AppCompatActivity() { diff --git a/app/src/main/java/sayan/apps/numplex/SignInActivity.kt b/app/src/main/java/sayan/apps/numplex/ui/activity/SignInActivity.kt similarity index 98% rename from app/src/main/java/sayan/apps/numplex/SignInActivity.kt rename to app/src/main/java/sayan/apps/numplex/ui/activity/SignInActivity.kt index e9bbc16..37d52eb 100644 --- a/app/src/main/java/sayan/apps/numplex/SignInActivity.kt +++ b/app/src/main/java/sayan/apps/numplex/ui/activity/SignInActivity.kt @@ -1,4 +1,4 @@ -package sayan.apps.numplex +package sayan.apps.numplex.ui.activity import android.content.Intent import android.os.Bundle @@ -18,6 +18,7 @@ import com.google.android.libraries.identity.googleid.GoogleIdTokenCredential import com.google.android.libraries.identity.googleid.GoogleIdTokenParsingException import com.google.firebase.auth.FirebaseAuth import com.google.firebase.auth.GoogleAuthProvider +import sayan.apps.numplex.R import java.util.concurrent.Executors diff --git a/app/src/main/java/sayan/apps/numplex/ClassificationsFragment.kt b/app/src/main/java/sayan/apps/numplex/ui/fragment/ClassificationsFragment.kt similarity index 99% rename from app/src/main/java/sayan/apps/numplex/ClassificationsFragment.kt rename to app/src/main/java/sayan/apps/numplex/ui/fragment/ClassificationsFragment.kt index 38cfe4a..3d70948 100644 --- a/app/src/main/java/sayan/apps/numplex/ClassificationsFragment.kt +++ b/app/src/main/java/sayan/apps/numplex/ui/fragment/ClassificationsFragment.kt @@ -1,4 +1,4 @@ -package sayan.apps.numplex +package sayan.apps.numplex.ui.fragment import android.content.Intent import android.net.Uri @@ -9,6 +9,7 @@ import android.view.ViewGroup import android.widget.Button import androidx.appcompat.app.AlertDialog import androidx.fragment.app.Fragment +import sayan.apps.numplex.R class ClassificationsFragment : Fragment(), View.OnClickListener { diff --git a/app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt b/app/src/main/java/sayan/apps/numplex/ui/fragment/FeedbackFragment.kt similarity index 97% rename from app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt rename to app/src/main/java/sayan/apps/numplex/ui/fragment/FeedbackFragment.kt index 9fa133e..81c398c 100644 --- a/app/src/main/java/sayan/apps/numplex/FeedbackFragment.kt +++ b/app/src/main/java/sayan/apps/numplex/ui/fragment/FeedbackFragment.kt @@ -1,4 +1,4 @@ -package sayan.apps.numplex +package sayan.apps.numplex.ui.fragment import android.content.Context import android.os.Bundle @@ -14,6 +14,7 @@ import androidx.fragment.app.Fragment import com.google.firebase.auth.FirebaseAuth import com.google.firebase.database.DatabaseReference import com.google.firebase.database.FirebaseDatabase +import sayan.apps.numplex.R class FeedbackFragment : Fragment(), View.OnClickListener { diff --git a/app/src/main/java/sayan/apps/numplex/NumplexFragment.kt b/app/src/main/java/sayan/apps/numplex/ui/fragment/NumplexFragment.kt similarity index 84% rename from app/src/main/java/sayan/apps/numplex/NumplexFragment.kt rename to app/src/main/java/sayan/apps/numplex/ui/fragment/NumplexFragment.kt index 495bdc5..8737626 100644 --- a/app/src/main/java/sayan/apps/numplex/NumplexFragment.kt +++ b/app/src/main/java/sayan/apps/numplex/ui/fragment/NumplexFragment.kt @@ -1,4 +1,4 @@ -package sayan.apps.numplex +package sayan.apps.numplex.ui.fragment import android.content.Context import android.os.Bundle @@ -10,6 +10,39 @@ import android.widget.Button import android.widget.EditText import android.widget.TextView import androidx.fragment.app.Fragment +import sayan.apps.numplex.R +import sayan.apps.numplex.decimalToBin +import sayan.apps.numplex.decimalToHex +import sayan.apps.numplex.decimalToOct +import sayan.apps.numplex.digitCount +import sayan.apps.numplex.digitSum +import sayan.apps.numplex.factors +import sayan.apps.numplex.isAbundantNumber +import sayan.apps.numplex.isArmstrongNumber +import sayan.apps.numplex.isAutomorphicNumber +import sayan.apps.numplex.isCircularPrimeNumber +import sayan.apps.numplex.isDisariumNumber +import sayan.apps.numplex.isDuckNumber +import sayan.apps.numplex.isEmirpNumber +import sayan.apps.numplex.isEven +import sayan.apps.numplex.isFermatNumber +import sayan.apps.numplex.isFibonacciNumber +import sayan.apps.numplex.isHappyNumber +import sayan.apps.numplex.isKaprekarNumber +import sayan.apps.numplex.isLucasNumber +import sayan.apps.numplex.isNeonNumber +import sayan.apps.numplex.isNivenNumber +import sayan.apps.numplex.isPalindrome +import sayan.apps.numplex.isPrimeNumber +import sayan.apps.numplex.isPronicNumber +import sayan.apps.numplex.isSmithNumber +import sayan.apps.numplex.isSpecialNumber +import sayan.apps.numplex.isSpyNumber +import sayan.apps.numplex.isTechNumber +import sayan.apps.numplex.isUglyNumber +import sayan.apps.numplex.primeFactorization +import sayan.apps.numplex.primeFactors +import sayan.apps.numplex.reverse import kotlin.math.pow import kotlin.random.Random diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 79dc4bc..a831baa 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -7,7 +7,7 @@ android:layout_height="match_parent" android:layout_gravity="center" android:orientation="vertical" - tools:context=".MainActivity"> + tools:context=".ui.activity.MainActivity"> + tools:context=".ui.activity.MainActivity"> + tools:context=".ui.fragment.ClassificationsFragment"> + tools:context=".ui.fragment.FeedbackFragment"> + tools:context=".ui.fragment.NumplexFragment">