Skip to content

Commit

Permalink
v4.1.2 (#137)
Browse files Browse the repository at this point in the history
v4.1.2 Done
Fixes #38
  • Loading branch information
aiyu-ayaan authored Jun 7, 2023
1 parent 2d20218 commit 63586ba
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ import com.atech.core.utils.APP_LOGO_LINK
import com.atech.core.utils.ERROR_LOG
import com.atech.core.utils.KEY_ANN_VERSION
import com.atech.core.utils.KEY_CURRENT_SHOW_TIME
import com.atech.core.utils.KEY_DO_NOT_SHOW_AGAIN
import com.atech.core.utils.KEY_REACH_TO_HOME
import com.atech.core.utils.KEY_SHOW_TIMES
import com.atech.core.utils.KEY_USER_DONE_SET_UP
Expand Down Expand Up @@ -183,8 +182,8 @@ class MainActivity : AppCompatActivity(), DrawerLocker, SearchViewVisible {
openAboutUs()
onDestinationChange()
checkForUpdate()
val u = pref.getBoolean(KEY_DO_NOT_SHOW_AGAIN, false)
if (u) getWarning()

getWarning()
shareReview()
getShowTimes()
onBackPressDispatcher()
Expand Down Expand Up @@ -492,8 +491,11 @@ class MainActivity : AppCompatActivity(), DrawerLocker, SearchViewVisible {
TAG_REMOTE,
"getWarning: $isEnable $title $link $minVersion $buttonText $isMinEdition"
)
Log.d(TAG_REMOTE, "$u , $isEnable , $isMinEdition")
if (isEnable && u && !isMinEdition) {
Log.d(TAG_REMOTE, "getWarning $u , $isEnable , $isMinEdition")
if (!isMinEdition) {
return@fetchData
}
if (isEnable && u) {
openWarningDialog(title, link, buttonText)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -907,10 +907,12 @@ class HomeFragment :
DataState.Empty -> {}
is DataState.Error -> {
if (dataState.exception is HttpException) {
layoutChanges(false).also {
binding.fragmentHomeExt.switchOldNew.isVisible = false
}
binding.root.showSnackBar(
"${dataState.exception.message}", Snackbar.LENGTH_SHORT, "Report"
) {
// setViewOfOnlineSyllabusExt(false)
requireActivity().openBugLink(
com.atech.core.R.string.bug_repost,
"${this.javaClass.simpleName}.class",
Expand All @@ -923,6 +925,7 @@ class HomeFragment :

DataState.Loading -> {
binding.fragmentHomeExt.semChoseOnlineExt.apply {
binding.fragmentHomeExt.switchOldNew.isVisible = true
progressBarLoading.isVisible = true
noData.isVisible = false
noDataText.isVisible = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,27 @@ package com.atech.bit.utils
import androidx.activity.OnBackPressedCallback
import androidx.activity.addCallback
import androidx.fragment.app.Fragment
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import androidx.lifecycle.LifecycleOwner

fun Fragment.handleCustomBackPressed(
onBackPressed: OnBackPressedCallback.() -> Unit
) {
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner) {
onBackPressed()
viewLifecycleOwnerLiveData.observe(viewLifecycleOwner) { viewLifecycleOwner ->
viewLifecycleOwner.lifecycle.addObserver(object : LifecycleEventObserver {
override fun onStateChanged(source: LifecycleOwner, event: Lifecycle.Event) {
if (event == Lifecycle.Event.ON_DESTROY) {
viewLifecycleOwner.lifecycle.removeObserver(this)
return
}
if (event == Lifecycle.Event.ON_CREATE)
requireActivity().onBackPressedDispatcher.addCallback(viewLifecycleOwner) {
onBackPressed()
}

}
})
}

}
4 changes: 2 additions & 2 deletions buildSrc/src/main/java/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ object AndroidSdk {

object App {
const val id = "com.atech.bit"
const val versionCode = 58
const val versionName = "4.1.1 Patch 31"
const val versionCode = 59
const val versionName = "4.1.2"
}

object JavaVersionCompatibility {
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/atech/core/api/BITApiClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import retrofit2.http.Path
interface BITApiClient {

companion object {
const val BASE_URL = "https://aiyu-ayaan.github.io/BIT-App-Data/data/"
const val BASE_URL = "https://bit-lalpur-app.github.io/BIT-App-Data/data/"
}


Expand Down

0 comments on commit 63586ba

Please sign in to comment.