Skip to content

Commit

Permalink
Huawei AppGallery tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
levinli303 committed Jul 12, 2024
1 parent 285723e commit 6fad5d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/src/main/java/space/celestia/mobilecelestia/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class MainActivity : AppCompatActivity(R.layout.activity_main),

private var bottomSheetCommitIds = arrayListOf<Int>()
private var initialURLCheckPerformed = false
private var isAskingForExit = false

override fun onCreate(savedInstanceState: Bundle?) {
val factory = EntryPointAccessors.fromApplication(this, AppStatusInterface::class.java)
Expand Down Expand Up @@ -478,10 +479,19 @@ class MainActivity : AppCompatActivity(R.layout.activity_main),
frag.popLast()
} else if (self.canPopBottomSheetFragment()) {
self.popBottomSheetFragment()
} else {
} else if (frag != null || drawerLayout.isDrawerOpen(GravityCompat.END)) {
self.lifecycleScope.launch {
self.hideOverlay(true)
}
} else if (!self.isAskingForExit) {
self.isAskingForExit = true
self.showAlert(self.getString(R.string.exit_celestia_alert_title), self.getString(R.string.exit_celestia_alert_message), handler = {
self.isAskingForExit = false
self.finishAndRemoveTask()
exitProcess(0)
}, cancelHandler = {
self.isAskingForExit = false
})
}
}
})
Expand Down
2 changes: 2 additions & 0 deletions jobs/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
git checkout origin/$(Build.SourceBranchName)
cd ../CelestiaLocalization
git checkout origin/$(Build.SourceBranchName)
git cherry-pick origin/huawei
displayName: 'Checkout Branch'
condition: ne( variables['Build.Reason'], 'PullRequest' )
Expand All @@ -43,6 +44,7 @@ jobs:
git checkout origin/$(System.PullRequest.TargetBranch)
cd ../CelestiaLocalization
git checkout origin/$(System.PullRequest.TargetBranch)
git cherry-pick origin/huawei
displayName: 'Checkout Branch (PR)'
condition: eq( variables['Build.Reason'], 'PullRequest' )
Expand Down

0 comments on commit 6fad5d5

Please sign in to comment.