commit dd3e66e87cdf1b03def93d7bb76b59fd81ea32b5 Author: Hemant Khadase Date: Thu Dec 1 11:24:34 2022 +0530 lib push diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..fb7f4a8 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml new file mode 100644 index 0000000..113759e --- /dev/null +++ b/.idea/dbnavigator.xml @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a2d7c21 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..4b90385 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..f3ba3bb --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,85 @@ +plugins { + id 'com.android.application' + id 'org.jetbrains.kotlin.android' +} + +android { + namespace 'com.nivesh.production.bajajfd' + compileSdk 32 + + defaultConfig { + applicationId "com.nivesh.production.bajajfd" + minSdk 21 + targetSdk 32 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + + buildFeatures { + viewBinding true + } +} + +ext{ + roomVersion="2.4.3" + glideVersion="4.11.0" +} + +dependencies { + + implementation 'androidx.core:core-ktx:1.9.0' + implementation 'androidx.appcompat:appcompat:1.5.1' + implementation 'com.google.android.material:material:1.7.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.1' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.4' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.0' + + // Architectural Components + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" + +// // Room +// implementation "androidx.room:room-runtime:2.4.3" +// annotationProcessor("androidx.room:room-compiler:$roomVersion") +// implementation "androidx.room:room-ktx:2.4.3" + + // Coroutines + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1' + implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1' + + // Coroutine Lifecycle Scopes + implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" + implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.5.1" + + // Retrofit + implementation 'com.squareup.retrofit2:retrofit:2.9.0' + implementation 'com.squareup.retrofit2:converter-gson:2.9.0' + implementation "com.squareup.okhttp3:logging-interceptor:4.7.2" + + // Navigation Components + implementation "androidx.navigation:navigation-fragment-ktx:2.5.3" + implementation "androidx.navigation:navigation-ui-ktx:2.5.3" + + // Glide +// implementation 'com.github.bumptech.glide:glide:4.11.0' + // kapt 'com.github.bumptech.glide:compiler:4.11.0' +// annotationProcessor("androidx.room:room-compiler:$glideVersion") +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/nivesh/production/bajajfd/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/nivesh/production/bajajfd/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..5307e6e --- /dev/null +++ b/app/src/androidTest/java/com/nivesh/production/bajajfd/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.nivesh.production.bajajfd + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.nivesh.production.bajajfd", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..9a65401 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/BajajApplication.kt b/app/src/main/java/com/nivesh/production/bajajfd/BajajApplication.kt new file mode 100644 index 0000000..4245071 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/BajajApplication.kt @@ -0,0 +1,6 @@ +package com.nivesh.production.bajajfd + +import android.app.Application + +class BajajApplication : Application() { +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/adapter/SectionsPagerAdapter.kt b/app/src/main/java/com/nivesh/production/bajajfd/adapter/SectionsPagerAdapter.kt new file mode 100644 index 0000000..d024110 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/adapter/SectionsPagerAdapter.kt @@ -0,0 +1,30 @@ +package com.nivesh.production.bajajfd.adapter + +import android.content.Context +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentPagerAdapter + +class SectionsPagerAdapter(private val context: Context, fm: FragmentManager) : + FragmentPagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { + + private var fragmentList: MutableList = ArrayList() + + override fun getItem(position: Int): Fragment { + return fragmentList[position] + } + + override fun getCount(): Int { + return fragmentList.size + } + + fun addFragment(fragment: Fragment) { + try { + if (!fragment.isAdded) { + fragmentList.add(fragment) + } + } catch (e: Exception) { + e.printStackTrace() + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/api/RetrofitInstance.kt b/app/src/main/java/com/nivesh/production/bajajfd/api/RetrofitInstance.kt new file mode 100644 index 0000000..8b467b0 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/api/RetrofitInstance.kt @@ -0,0 +1,29 @@ +package com.nivesh.production.bajajfd.api + +import com.nivesh.production.bajajfd.util.Constants.Companion.BASE_URL +import okhttp3.OkHttpClient +import okhttp3.logging.HttpLoggingInterceptor +import retrofit2.Retrofit +import retrofit2.converter.gson.GsonConverterFactory + +class RetrofitInstance { + companion object{ + private val retrofit by lazy { + //lazy means we only initialize this here once + val logging=HttpLoggingInterceptor() + //loggingInterceptor use for see making request and for see what responses are + logging.setLevel(HttpLoggingInterceptor.Level.BODY) + //see the body of response + //create client for retrofit + val client=OkHttpClient.Builder() + .addInterceptor(logging) + .retryOnConnectionFailure(true) + .build() + Retrofit.Builder() + .baseUrl(BASE_URL) + .addConverterFactory(GsonConverterFactory.create()) + .client(client) + .build() + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/interface/BajajFDInterface.kt b/app/src/main/java/com/nivesh/production/bajajfd/interface/BajajFDInterface.kt new file mode 100644 index 0000000..17ee9fa --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/interface/BajajFDInterface.kt @@ -0,0 +1,8 @@ +package com.nivesh.production.bajajfd.`interface` + +interface BajajFDInterface { + fun stepOneApi(data: String?) + fun stepTwoApi(data: String?) + fun stepThreeApi(data: String?) + fun stepFourApi(data: String?) +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/activity/BajajFdMainActivity.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/activity/BajajFdMainActivity.kt new file mode 100644 index 0000000..74b2e94 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/activity/BajajFdMainActivity.kt @@ -0,0 +1,156 @@ +package com.nivesh.production.bajajfd.ui.activity + +import android.graphics.Color +import android.graphics.drawable.Drawable +import android.graphics.drawable.GradientDrawable +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.util.Log +import androidx.viewpager.widget.ViewPager +import com.nivesh.production.bajajfd.`interface`.BajajFDInterface +import com.nivesh.production.bajajfd.adapter.SectionsPagerAdapter +import com.nivesh.production.bajajfd.databinding.BajajFdMainActivityBinding +import com.nivesh.production.bajajfd.ui.fragment.* +import com.nivesh.production.bajajfd.util.Colors + +class BajajFdMainActivity : AppCompatActivity(),BajajFDInterface { + private lateinit var binding: BajajFdMainActivityBinding + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + init() + } + + private fun init(){ + binding = BajajFdMainActivityBinding.inflate(layoutInflater) + setContentView(binding.root) + + binding.imgBack.setOnClickListener { + finish() + } + + // steps setting + setBackground(selectedShape(), defaultShape(), defaultShape(), defaultShape()) + + // set viewPager + val sectionsPagerAdapter = SectionsPagerAdapter(this@BajajFdMainActivity, supportFragmentManager) + val viewPager: ViewPager = binding.viewPager + sectionsPagerAdapter.addFragment(StepStartFragment.getInstance(this@BajajFdMainActivity)) + sectionsPagerAdapter.addFragment(StepOneFragment.getInstance(this@BajajFdMainActivity)) + sectionsPagerAdapter.addFragment(StepTwoFragment.getInstance(this@BajajFdMainActivity)) + sectionsPagerAdapter.addFragment(StepThreeFragment.getInstance(this@BajajFdMainActivity)) + sectionsPagerAdapter.addFragment(StepFourFragment.getInstance(this@BajajFdMainActivity)) + viewPager.adapter = sectionsPagerAdapter + + viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { + override fun onPageScrolled( + position: Int, + positionOffset: Float, + positionOffsetPixels: Int + ) { + Log.e("onPageScrolled", "-->".plus(position)) + } + + override fun onPageSelected(position: Int) { + Log.e("onPageSelected", "-->".plus(position)) + when (position) { + 0 -> { + setBackground( + defaultShape(), + defaultShape(), + defaultShape(), + defaultShape() + ) + } + 1 -> { + setBackground( + selectedShape(), + defaultShape(), + defaultShape(), + defaultShape() + ) + } + 2 -> { + setBackground( + selectedShape(), + selectedShape(), + defaultShape(), + defaultShape() + ) + } + 3 -> { + setBackground( + selectedShape(), + selectedShape(), + selectedShape(), + defaultShape() + ) + } + 4 ->{ + setBackground( + selectedShape(), + selectedShape(), + selectedShape(), + selectedShape() + ) + } + } + } + + override fun onPageScrollStateChanged(state: Int) { + + } + }) + } + + // set Default Step + private fun defaultShape(): GradientDrawable { + val shape = GradientDrawable() + shape.shape = GradientDrawable.OVAL + shape.setColor(Color.WHITE) + shape.setStroke(6, Color.parseColor(Colors.colorDefault)) + return shape + } + + // set Selected Step + private fun selectedShape(): GradientDrawable { + val shape = GradientDrawable() + shape.shape = GradientDrawable.OVAL + shape.setColor(Color.parseColor(Colors.colorDefault)) + shape.setStroke(6, Color.parseColor(Colors.colorDefault)) + return shape + } + + // set background for selected/ default step + private fun setBackground( + drawable: Drawable?, + drawable1: Drawable?, + drawable2: Drawable?, + drawable3: Drawable? + ) { + binding.step1.background = drawable + binding.step2.background = drawable1 + binding.step3.background = drawable2 + binding.step4.background = drawable3 + } + + // step 1 response + override fun stepOneApi(data: String?) { + Log.e("stepOneApi", " response ---> $data") + } + + // step 2 response + override fun stepTwoApi(data: String?) { + Log.e("stepTwoApi", " response ---> $data") + } + + // step 3 response + override fun stepThreeApi(data: String?) { + Log.e("stepThreeApi", " response ---> $data") + } + + // step 4 response + override fun stepFourApi(data: String?) { + Log.e("stepFourApi", " response ---> $data") + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFourFragment.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFourFragment.kt new file mode 100644 index 0000000..ff338e8 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepFourFragment.kt @@ -0,0 +1,63 @@ +package com.nivesh.production.bajajfd.ui.fragment + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.nivesh.production.bajajfd.`interface`.BajajFDInterface +import com.nivesh.production.bajajfd.databinding.FragmentStepFourBinding +import com.nivesh.production.bajajfd.viewModel.StepFourViewModel + +class StepFourFragment : Fragment() { + + private lateinit var stepFourViewModel: StepFourViewModel + private var _binding: FragmentStepFourBinding? = null + private val binding get() = _binding!! + + private lateinit var bajajFDInterface: BajajFDInterface + companion object { + fun getInstance(fdInterface: BajajFDInterface): StepFourFragment { + val stepFourFragment = StepFourFragment() + stepFourFragment.setApi(fdInterface) + return stepFourFragment + } + } + private fun setApi(bajajFDInterfaces: BajajFDInterface) { + bajajFDInterface = bajajFDInterfaces + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + stepFourViewModel = ViewModelProvider(this)[StepFourViewModel::class.java].apply { + + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + + _binding = FragmentStepFourBinding.inflate(inflater, container, false) + val root = binding.root + +// val textView: TextView = binding.sectionLabel +// stepFourViewModel.text.observe(viewLifecycleOwner) { +// textView.text = it +// } +// +// binding.btnClick.setOnClickListener { +// bajajFDInterface.stepFourApi("stepFourResponse") +// } + + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepOneFragment.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepOneFragment.kt new file mode 100644 index 0000000..06efbd9 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepOneFragment.kt @@ -0,0 +1,73 @@ +package com.nivesh.production.bajajfd.ui.fragment + +import android.content.Intent +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.LinearLayout +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.nivesh.production.bajajfd.`interface`.BajajFDInterface +import com.nivesh.production.bajajfd.databinding.FragmentStepOneBinding +import com.nivesh.production.bajajfd.viewModel.StepOneViewModel + +class StepOneFragment : Fragment() { + private lateinit var stepOneViewModel: StepOneViewModel + private var _binding: FragmentStepOneBinding? = null + private val binding get() = _binding!! + + private lateinit var bajajFDInterface: BajajFDInterface + + companion object { + fun getInstance(fdInterface: BajajFDInterface): StepOneFragment { + val stepOneFragment = StepOneFragment() + stepOneFragment.setApi(fdInterface) + return stepOneFragment + } + } + + private fun setApi(bajajFDInterfaces: BajajFDInterface) { + bajajFDInterface = bajajFDInterfaces + } + + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + stepOneViewModel = ViewModelProvider(this)[StepOneViewModel::class.java].apply { + + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + + _binding = FragmentStepOneBinding.inflate(inflater,container,false) + val root = binding.root + + stepOneViewModel.text.observe(viewLifecycleOwner) { + } + + binding.tvPersonalDetails.setOnClickListener { + stepOneViewModel.setUpVisibility(binding.llPersonalDetail) + } + + binding.tvNomineeDetails.setOnClickListener { + stepOneViewModel.setUpVisibility(binding.llNomineeDetail) + } + + binding.tvBankDetails.setOnClickListener { + stepOneViewModel.setUpVisibility(binding.llBankDetails) + } + + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepStartFragment.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepStartFragment.kt new file mode 100644 index 0000000..45271bb --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepStartFragment.kt @@ -0,0 +1,64 @@ +package com.nivesh.production.bajajfd.ui.fragment + +import androidx.lifecycle.ViewModelProvider +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import com.nivesh.production.bajajfd.R +import com.nivesh.production.bajajfd.`interface`.BajajFDInterface +import com.nivesh.production.bajajfd.databinding.FragmentStepStartBinding +import com.nivesh.production.bajajfd.viewModel.StepStartViewModel + +class StepStartFragment : Fragment() { + + private lateinit var viewModel: StepStartViewModel + private lateinit var stepStartViewModel: StepStartViewModel + private var _binding: FragmentStepStartBinding? = null + private val binding get() = _binding!! + + private lateinit var bajajFDInterface: BajajFDInterface + + companion object { + fun getInstance(fdInterface: BajajFDInterface): StepStartFragment{ + val stepStartFragment = StepStartFragment() + stepStartFragment.setApi(fdInterface) + return stepStartFragment + } + } + + private fun setApi(bajajFDInterfaces: BajajFDInterface) { + bajajFDInterface = bajajFDInterfaces + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + stepStartViewModel = ViewModelProvider(this)[StepStartViewModel::class.java].apply { + + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + _binding = FragmentStepStartBinding.inflate(inflater,container,false) + val root = binding.root + + binding.txtInterestTenure.setOnClickListener { + + } + + binding.btnNext.setOnClickListener { + bajajFDInterface.stepOneApi("stepOneResponse") + } + + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeFragment.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeFragment.kt new file mode 100644 index 0000000..fa045ea --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepThreeFragment.kt @@ -0,0 +1,63 @@ +package com.nivesh.production.bajajfd.ui.fragment + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.nivesh.production.bajajfd.`interface`.BajajFDInterface +import com.nivesh.production.bajajfd.databinding.FragmentStepThreeBinding +import com.nivesh.production.bajajfd.viewModel.StepThreeViewModel + +class StepThreeFragment : Fragment() { + + private lateinit var stepThreeViewModel: StepThreeViewModel + private var _binding: FragmentStepThreeBinding? = null + private val binding get() = _binding!! + + private lateinit var bajajFDInterface: BajajFDInterface + companion object { + fun getInstance(fdInterface: BajajFDInterface): StepThreeFragment { + val stepThreeFragment = StepThreeFragment() + stepThreeFragment.setApi(fdInterface) + return stepThreeFragment + } + } + private fun setApi(bajajFDInterfaces: BajajFDInterface) { + bajajFDInterface = bajajFDInterfaces + } + + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + stepThreeViewModel = ViewModelProvider(this)[StepThreeViewModel::class.java].apply { + + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + + _binding = FragmentStepThreeBinding.inflate(inflater, container, false) + val root = binding.root + +// val textView: TextView = binding.sectionLabel +// stepThreeViewModel.text.observe(viewLifecycleOwner) { +// textView.text = it +// } + +// binding.btnClick.setOnClickListener { +// bajajFDInterface.stepThreeApi("stepThreeResponse") +// } + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoFragment.kt b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoFragment.kt new file mode 100644 index 0000000..eaccc46 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/ui/fragment/StepTwoFragment.kt @@ -0,0 +1,63 @@ +package com.nivesh.production.bajajfd.ui.fragment + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import android.widget.TextView +import androidx.fragment.app.Fragment +import androidx.lifecycle.ViewModelProvider +import com.nivesh.production.bajajfd.`interface`.BajajFDInterface +import com.nivesh.production.bajajfd.databinding.FragmentStepTwoBinding +import com.nivesh.production.bajajfd.viewModel.StepTwoViewModel + +class StepTwoFragment : Fragment() { + + private lateinit var stepTwoFragment: StepTwoViewModel + private var _binding: FragmentStepTwoBinding? = null + private val binding get() = _binding!! + + private lateinit var bajajFDInterface: BajajFDInterface + companion object { + fun getInstance(fdInterface: BajajFDInterface): StepTwoFragment { + val stepTwoFragment = StepTwoFragment() + stepTwoFragment.setApi(fdInterface) + return stepTwoFragment + } + } + private fun setApi(bajajFDInterfaces: BajajFDInterface) { + bajajFDInterface = bajajFDInterfaces + } + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + stepTwoFragment = ViewModelProvider(this)[StepTwoViewModel::class.java].apply { + + } + } + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View { + + _binding = FragmentStepTwoBinding.inflate(inflater, container, false) + val root = binding.root + +// val textView: TextView = binding.sectionLabel +// stepTwoFragment.text.observe(viewLifecycleOwner) { +// textView.text = it +// } +// +// binding.btnClick.setOnClickListener { +// bajajFDInterface.stepTwoApi("stepTwoResponse") +// } + + return root + } + + override fun onDestroyView() { + super.onDestroyView() + _binding = null + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/util/Colors.kt b/app/src/main/java/com/nivesh/production/bajajfd/util/Colors.kt new file mode 100644 index 0000000..168a28a --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/util/Colors.kt @@ -0,0 +1,5 @@ +package com.nivesh.production.bajajfd.util + +object Colors { + const val colorDefault: String = "#17A31D" +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/util/Constants.kt b/app/src/main/java/com/nivesh/production/bajajfd/util/Constants.kt new file mode 100644 index 0000000..1ba9162 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/util/Constants.kt @@ -0,0 +1,121 @@ +package com.nivesh.production.bajajfd.util + +import android.content.Context +import android.net.ConnectivityManager +import android.net.ConnectivityManager.TYPE_ETHERNET +import android.net.ConnectivityManager.TYPE_WIFI +import android.net.NetworkCapabilities.* +import android.os.Build +import android.provider.ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE +import android.util.Patterns +import com.nivesh.production.bajajfd.BajajApplication +import java.util.regex.Matcher +import java.util.regex.Pattern + +class Constants() { + + companion object { + const val BASE_URL ="put your base url here" + /** + *Before use this method write following code in model class + app:Application(in activity and model) + changes in hasInternetConnection + val connectivityManager = getApplication().getSystemService(.... + + **/ + + //internet check + private fun isNetworkAvailable(): Boolean { + val connectivityManager = BajajApplication().getSystemService( + Context.CONNECTIVITY_SERVICE + ) as ConnectivityManager + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + + val activeNetwork = connectivityManager.activeNetwork ?: return false + val capabilities = + connectivityManager.getNetworkCapabilities(activeNetwork) ?: return false + return when { + capabilities.hasTransport(TRANSPORT_WIFI) -> true + capabilities.hasTransport(TRANSPORT_CELLULAR) -> true + capabilities.hasTransport(TRANSPORT_ETHERNET) -> true + else -> false + } + } else { + connectivityManager.activeNetworkInfo?.run { + return when (type) { + TYPE_WIFI -> true + TYPE_MOBILE -> true + TYPE_ETHERNET -> true + else -> false + } + } + } + return false + } + //phone number + private fun checkValidPhoneNumber(phoneText: String?): String? { + + if (phoneText != null) { + if(!phoneText.matches(".*[0-9].*".toRegex())){ + return "Must be all Digits" + } + } + if (phoneText != null) { + if(phoneText.length != 10){ + return "Must be 10 Digits" + } + } + return null + } + + //valid email check + private fun isValidEmail(emailText:String?): String? { + + if(!emailText?.let { Patterns.EMAIL_ADDRESS.matcher(it).matches() }!!) + { + return "Invalid Email Address" + } + return null + } + //valid Name Check + private fun isValidName(nameText: String?): String { + val pattern = Pattern.compile(("^[a-zA-Z\\s]{2,70}$")) + val matcher = pattern.matcher(nameText) + if (!matcher.matches()) { + return "Enter Valid Name" + } + return "" + + } + //validPanCard + private fun isValidPanCardNo(panCardNo: String?): Boolean { + // Regex to check valid PAN Card number. + val regex = "[A-Z]{5}[0-9]{4}[A-Z]{1}" + // Compile the ReGex + val p = Pattern.compile(regex) + // If the PAN Card number + // is empty return false + if (panCardNo == null) { + return false + } + // Pattern class contains matcher() method + // to find matching between given + // PAN Card number using regular expression. + val m = p.matcher(panCardNo) + // Return if the PAN Card number + // matched the ReGex + return m.matches() + } + //is Indian mobile Number + private fun isIndianMobileNo(mobileNumber: String?): Boolean { + //(0/91): number starts with (0/91) + //[7-9]: starting of the number may contain a digit between 0 to 9 + //[0-9]: then contains digits 0 to 9 + val pattern: Pattern = Pattern.compile("^[6-9]\\d{9}$") + //the matcher() method creates a matcher that will match the given input against this pattern + val match: Matcher = pattern.matcher(mobileNumber) + //returns a boolean value + return match.matches() + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/util/Resource.kt b/app/src/main/java/com/nivesh/production/bajajfd/util/Resource.kt new file mode 100644 index 0000000..ef9662e --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/util/Resource.kt @@ -0,0 +1,10 @@ +package com.nivesh.production.bajajfd.util + +sealed class Resource( + val data:T?=null, + val message:String?=null) +{ + class Success(data: T):Resource(data) + class Error(message: String,data: T?= null):Resource(data,message) + class Loading:Resource() +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepFourViewModel.kt b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepFourViewModel.kt new file mode 100644 index 0000000..39691a4 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepFourViewModel.kt @@ -0,0 +1,18 @@ +package com.nivesh.production.bajajfd.viewModel + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.Transformations +import androidx.lifecycle.ViewModel + +class StepFourViewModel : ViewModel() { + + private val _index = MutableLiveData() + val text: LiveData = Transformations.map(_index) { + "Step : $it" + } + + fun setIndex(index: Int) { + _index.value = index + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepOneViewModel.kt b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepOneViewModel.kt new file mode 100644 index 0000000..5ea6043 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepOneViewModel.kt @@ -0,0 +1,26 @@ +package com.nivesh.production.bajajfd.viewModel + +import android.view.View +import android.widget.LinearLayout +import android.widget.TextView +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.Transformations +import androidx.lifecycle.ViewModel + +class StepOneViewModel : ViewModel() { + + private val _index = MutableLiveData() + val text: LiveData = Transformations.map(_index) { + "Step : $it" + } + + fun setIndex(index: Int) { + _index.value = index + } + + fun setUpVisibility(ll: LinearLayout) { + if(ll.visibility== View.VISIBLE) ll.visibility = View.GONE + else ll.visibility = View.VISIBLE + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepStartViewModel.kt b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepStartViewModel.kt new file mode 100644 index 0000000..03fd0ed --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepStartViewModel.kt @@ -0,0 +1,7 @@ +package com.nivesh.production.bajajfd.viewModel + +import androidx.lifecycle.ViewModel + +class StepStartViewModel : ViewModel() { + // TODO: Implement the ViewModel +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepThreeViewModel.kt b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepThreeViewModel.kt new file mode 100644 index 0000000..c1e27c2 --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepThreeViewModel.kt @@ -0,0 +1,18 @@ +package com.nivesh.production.bajajfd.viewModel + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.Transformations +import androidx.lifecycle.ViewModel + +class StepThreeViewModel : ViewModel() { + + private val _index = MutableLiveData() + val text: LiveData = Transformations.map(_index) { + "Step : $it" + } + + fun setIndex(index: Int) { + _index.value = index + } +} \ No newline at end of file diff --git a/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepTwoViewModel.kt b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepTwoViewModel.kt new file mode 100644 index 0000000..aada84f --- /dev/null +++ b/app/src/main/java/com/nivesh/production/bajajfd/viewModel/StepTwoViewModel.kt @@ -0,0 +1,18 @@ +package com.nivesh.production.bajajfd.viewModel + +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.Transformations +import androidx.lifecycle.ViewModel + +class StepTwoViewModel : ViewModel() { + + private val _index = MutableLiveData() + val text: LiveData = Transformations.map(_index) { + "Step : $it" + } + + fun setIndex(index: Int) { + _index.value = index + } +} \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/card_bg.xml b/app/src/main/res/drawable/card_bg.xml new file mode 100644 index 0000000..3e643f0 --- /dev/null +++ b/app/src/main/res/drawable/card_bg.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cursor_color.xml b/app/src/main/res/drawable/cursor_color.xml new file mode 100644 index 0000000..b076468 --- /dev/null +++ b/app/src/main/res/drawable/cursor_color.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_arrow_down.xml b/app/src/main/res/drawable/ic_arrow_down.xml new file mode 100644 index 0000000..e2b4e90 --- /dev/null +++ b/app/src/main/res/drawable/ic_arrow_down.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/rounded_corner_with_line.xml b/app/src/main/res/drawable/rounded_corner_with_line.xml new file mode 100644 index 0000000..66ce4ff --- /dev/null +++ b/app/src/main/res/drawable/rounded_corner_with_line.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/rounded_corner_with_line_blue.xml b/app/src/main/res/drawable/rounded_corner_with_line_blue.xml new file mode 100644 index 0000000..7b54a02 --- /dev/null +++ b/app/src/main/res/drawable/rounded_corner_with_line_blue.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/sp_bg.xml b/app/src/main/res/drawable/sp_bg.xml new file mode 100644 index 0000000..1a4b686 --- /dev/null +++ b/app/src/main/res/drawable/sp_bg.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/svg_back.xml b/app/src/main/res/drawable/svg_back.xml new file mode 100644 index 0000000..13ba1de --- /dev/null +++ b/app/src/main/res/drawable/svg_back.xml @@ -0,0 +1,11 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/svg_cal.xml b/app/src/main/res/drawable/svg_cal.xml new file mode 100644 index 0000000..3773633 --- /dev/null +++ b/app/src/main/res/drawable/svg_cal.xml @@ -0,0 +1,36 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/svg_down_arrow.xml b/app/src/main/res/drawable/svg_down_arrow.xml new file mode 100644 index 0000000..9e345b8 --- /dev/null +++ b/app/src/main/res/drawable/svg_down_arrow.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/svg_grey_bullet.xml b/app/src/main/res/drawable/svg_grey_bullet.xml new file mode 100644 index 0000000..214aae6 --- /dev/null +++ b/app/src/main/res/drawable/svg_grey_bullet.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/svg_rs.xml b/app/src/main/res/drawable/svg_rs.xml new file mode 100644 index 0000000..887ca0c --- /dev/null +++ b/app/src/main/res/drawable/svg_rs.xml @@ -0,0 +1,17 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/svg_star.xml b/app/src/main/res/drawable/svg_star.xml new file mode 100644 index 0000000..8218c21 --- /dev/null +++ b/app/src/main/res/drawable/svg_star.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/drawable/svg_step_process.xml b/app/src/main/res/drawable/svg_step_process.xml new file mode 100644 index 0000000..53c595f --- /dev/null +++ b/app/src/main/res/drawable/svg_step_process.xml @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/font/font.xml b/app/src/main/res/font/font.xml new file mode 100644 index 0000000..acc2c0f --- /dev/null +++ b/app/src/main/res/font/font.xml @@ -0,0 +1,23 @@ + + + + + + + + diff --git a/app/src/main/res/font/robotoblack.ttf b/app/src/main/res/font/robotoblack.ttf new file mode 100644 index 0000000..fbde625 Binary files /dev/null and b/app/src/main/res/font/robotoblack.ttf differ diff --git a/app/src/main/res/font/robotobold.ttf b/app/src/main/res/font/robotobold.ttf new file mode 100644 index 0000000..a355c27 Binary files /dev/null and b/app/src/main/res/font/robotobold.ttf differ diff --git a/app/src/main/res/font/robotolight.ttf b/app/src/main/res/font/robotolight.ttf new file mode 100644 index 0000000..94c6bcc Binary files /dev/null and b/app/src/main/res/font/robotolight.ttf differ diff --git a/app/src/main/res/font/robotomedium.ttf b/app/src/main/res/font/robotomedium.ttf new file mode 100644 index 0000000..39c63d7 Binary files /dev/null and b/app/src/main/res/font/robotomedium.ttf differ diff --git a/app/src/main/res/font/robotoregular.ttf b/app/src/main/res/font/robotoregular.ttf new file mode 100644 index 0000000..8c082c8 Binary files /dev/null and b/app/src/main/res/font/robotoregular.ttf differ diff --git a/app/src/main/res/font/robotothin.ttf b/app/src/main/res/font/robotothin.ttf new file mode 100644 index 0000000..d695550 Binary files /dev/null and b/app/src/main/res/font/robotothin.ttf differ diff --git a/app/src/main/res/layout/bajaj_fd_main_activity.xml b/app/src/main/res/layout/bajaj_fd_main_activity.xml new file mode 100644 index 0000000..aa86de5 --- /dev/null +++ b/app/src/main/res/layout/bajaj_fd_main_activity.xml @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/bank_detail_select.xml b/app/src/main/res/layout/bank_detail_select.xml new file mode 100644 index 0000000..6d1c883 --- /dev/null +++ b/app/src/main/res/layout/bank_detail_select.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_bajaj_f_d_step_one.xml b/app/src/main/res/layout/fragment_bajaj_f_d_step_one.xml new file mode 100644 index 0000000..58da278 --- /dev/null +++ b/app/src/main/res/layout/fragment_bajaj_f_d_step_one.xml @@ -0,0 +1,330 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_step_four.xml b/app/src/main/res/layout/fragment_step_four.xml new file mode 100644 index 0000000..20bf056 --- /dev/null +++ b/app/src/main/res/layout/fragment_step_four.xml @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_step_one.xml b/app/src/main/res/layout/fragment_step_one.xml new file mode 100644 index 0000000..12c48a6 --- /dev/null +++ b/app/src/main/res/layout/fragment_step_one.xml @@ -0,0 +1,779 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_step_start.xml b/app/src/main/res/layout/fragment_step_start.xml new file mode 100644 index 0000000..837d362 --- /dev/null +++ b/app/src/main/res/layout/fragment_step_start.xml @@ -0,0 +1,408 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +