Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed Jun 10, 2019
1 parent afe6874 commit 76b4e02
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
<activity
android:name=".UdpFallbackProfileActivity"
android:label="@string/udp_fallback"
android:parentActivityName=".ProfileConfigActivity"
android:excludeFromRecents="true"/>

<activity
Expand Down
10 changes: 7 additions & 3 deletions mobile/src/main/java/com/github/shadowsocks/AppManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import android.annotation.SuppressLint
import android.content.BroadcastReceiver
import android.content.ClipData
import android.content.ClipboardManager
import android.content.Intent
import android.content.pm.ApplicationInfo
import android.content.pm.PackageInfo
import android.content.pm.PackageManager
Expand Down Expand Up @@ -250,8 +251,8 @@ class AppManager : AppCompatActivity() {
menuInflater.inflate(R.menu.app_manager_menu, menu)
return true
}
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
when (item?.itemId) {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_apply_all -> {
val profiles = ProfileManager.getAllProfiles()
if (profiles != null) {
Expand Down Expand Up @@ -290,9 +291,12 @@ class AppManager : AppCompatActivity() {
Snackbar.make(list, R.string.action_import_err, Snackbar.LENGTH_LONG).show()
}
}
return false
return super.onOptionsItemSelected(item)
}

override fun supportNavigateUpTo(upIntent: Intent) =
super.supportNavigateUpTo(upIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP))

override fun onKeyUp(keyCode: Int, event: KeyEvent?) = if (keyCode == KeyEvent.KEYCODE_MENU)
if (toolbar.isOverflowMenuShowing) toolbar.hideOverflowMenu() else toolbar.showOverflowMenu()
else super.onKeyUp(keyCode, event)
Expand Down

0 comments on commit 76b4e02

Please sign in to comment.