diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index ef20db3..a006d3b 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -38,10 +38,6 @@
android:theme="@style/Theme.SimpliTend"
android:usesCleartextTraffic="true"
tools:targetApi="31">
-
{
+ AppUtil.setSkippedUpdateVersion(requireContext(), latest_version);
+ checkIfAhyUser();
+ });
}
private void checkNewUpdates() {
+ binding.newUpdateView.getRoot().setVisibility(View.GONE);
binding.retry.setVisibility(View.GONE);
binding.loadAnim.setVisibility(View.VISIBLE);
@@ -94,32 +101,38 @@ public class SplashFragment extends Fragment
return;
}
+ latest_version = response.body().result.new_version;
+
if (BuildConfig.VERSION_CODE < response.body().result.new_version){
// current version is less than latest version
// update is required
- Intent intent = new Intent(requireActivity(), NewUpdateActivity.class);
+ try {
+ // checking if this update is already skipped by user
+ if (AppUtil.getSkippedVersion(requireContext()) == response.body().result.new_version){
+ // already skipped version
+ checkIfAhyUser();
+ return;
+ }
+ } catch (Exception e) {
+ // do nothing
+ }
+
+ binding.newUpdateView.getRoot().setVisibility(View.VISIBLE);
if (BuildConfig.VERSION_CODE < response.body().result.force_update_version) {
// current version is less than forced latest version
// update is mandatory
- intent.putExtra(IS_MANDATORY_UPDATE, true);
+ binding.newUpdateView.skipBtn.setVisibility(View.GONE);
}else{
// current version is greater than or equal to force update version
// thus, this update can be skipped
- intent.putExtra(IS_MANDATORY_UPDATE, false);
- }
-
- try {
- startActivity(intent);
- requireActivity().finish();
- } catch (Exception e) {
- // do nothing
- onFailure(call, e);
+ binding.newUpdateView.skipBtn.setVisibility(View.VISIBLE);
}
}else{
// current version is equal to latest version
// no update is required
+ binding.newUpdateView.getRoot().setVisibility(View.GONE);
checkIfAhyUser();
}
@@ -139,6 +152,7 @@ public class SplashFragment extends Fragment
}
private void checkIfAhyUser() {
+ binding.newUpdateView.getRoot().setVisibility(View.GONE);
binding.retry.setVisibility(View.GONE);
binding.loadAnim.setVisibility(View.VISIBLE);
diff --git a/app/src/main/res/layout/activity_new_update.xml b/app/src/main/res/layout/layout_new_update.xml
similarity index 97%
rename from app/src/main/res/layout/activity_new_update.xml
rename to app/src/main/res/layout/layout_new_update.xml
index c709293..49d8824 100644
--- a/app/src/main/res/layout/activity_new_update.xml
+++ b/app/src/main/res/layout/layout_new_update.xml
@@ -1,7 +1,7 @@
+
+
\ No newline at end of file