|
@ -8,6 +8,7 @@ import androidx.lifecycle.ViewModelProvider |
|
|
import androidx.viewpager.widget.ViewPager |
|
|
import androidx.viewpager.widget.ViewPager |
|
|
import com.google.gson.Gson |
|
|
import com.google.gson.Gson |
|
|
import com.nivesh.production.bajajfd.adapter.SectionsPagerAdapter |
|
|
import com.nivesh.production.bajajfd.adapter.SectionsPagerAdapter |
|
|
|
|
|
import com.nivesh.production.bajajfd.api.ApiCallback |
|
|
import com.nivesh.production.bajajfd.api.ApiClient |
|
|
import com.nivesh.production.bajajfd.api.ApiClient |
|
|
import com.nivesh.production.bajajfd.databinding.ActivityBajajFdBinding |
|
|
import com.nivesh.production.bajajfd.databinding.ActivityBajajFdBinding |
|
|
import com.nivesh.production.bajajfd.interfaces.BajajFDInterface |
|
|
import com.nivesh.production.bajajfd.interfaces.BajajFDInterface |
|
@ -145,6 +146,9 @@ class BajajFdMainActivity : BaseActivity(), BajajFDInterface { |
|
|
} |
|
|
} |
|
|
is Resource.Loading -> { |
|
|
is Resource.Loading -> { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
is Resource.DataError -> { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -187,7 +191,8 @@ class BajajFdMainActivity : BaseActivity(), BajajFDInterface { |
|
|
viewModel.getClientDetails(getClientDetailsRequest, token) |
|
|
viewModel.getClientDetails(getClientDetailsRequest, token) |
|
|
viewModel.getClientDetailsMutableData.observe(this) { response -> |
|
|
viewModel.getClientDetailsMutableData.observe(this) { response -> |
|
|
when (response) { |
|
|
when (response) { |
|
|
is Resource.Success -> { |
|
|
|
|
|
|
|
|
is Resource.Success |
|
|
|
|
|
-> { |
|
|
Log.e("response", "-->$response") |
|
|
Log.e("response", "-->$response") |
|
|
getClientDetailsResponse = |
|
|
getClientDetailsResponse = |
|
|
Gson().fromJson( |
|
|
Gson().fromJson( |
|
@ -215,6 +220,8 @@ class BajajFdMainActivity : BaseActivity(), BajajFDInterface { |
|
|
} |
|
|
} |
|
|
is Resource.Loading -> { |
|
|
is Resource.Loading -> { |
|
|
|
|
|
|
|
|
|
|
|
}is Resource.DataError -> { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -222,6 +229,9 @@ class BajajFdMainActivity : BaseActivity(), BajajFDInterface { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private fun setViewPager(stepsCount: Int) { |
|
|
private fun setViewPager(stepsCount: Int) { |
|
|
// steps setting |
|
|
// steps setting |
|
|
setBackground(selectedShape(), defaultShape(), defaultShape(), defaultShape()) |
|
|
setBackground(selectedShape(), defaultShape(), defaultShape(), defaultShape()) |
|
@ -358,6 +368,9 @@ class BajajFdMainActivity : BaseActivity(), BajajFDInterface { |
|
|
} |
|
|
} |
|
|
is Resource.Loading -> { |
|
|
is Resource.Loading -> { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
is Resource.DataError -> { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -460,6 +473,10 @@ class BajajFdMainActivity : BaseActivity(), BajajFDInterface { |
|
|
is Resource.Loading -> { |
|
|
is Resource.Loading -> { |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
is Resource.DataError -> { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|