Skip to content

Commit

Permalink
Code update, apk installation improved
Browse files Browse the repository at this point in the history
  • Loading branch information
rodion-gudz committed Jun 10, 2021
1 parent e8d3d1c commit 4fff519
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions src/AndroidTool.kt
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ open class AndroidTool : Command() {
AdbDevicesOutput.substring(AdbDevicesOutput.indexOf("192.168")).substringBefore(':')
} catch (e: Exception) {
}
if (tabbedpane.selectedIndex == 0 || tabbedpane.selectedIndex == 1 || tabbedpane.selectedIndex == 2) {
if (tabbedpane.selectedIndex == 0 || tabbedpane.selectedIndex == 1) {
contents.setBounds(5, 5, 310, 375)
deviceControlPanel.setBounds(5, 385, 310, 85)
deviceConnection.setBounds(5, 475, 310, 100)
Expand All @@ -356,7 +356,7 @@ open class AndroidTool : Command() {
textFieldIP.isVisible = true
labelConnect.isVisible = true
labelIP.isVisible = true
} else if (tabbedpane.selectedIndex == 3) {
} else if (tabbedpane.selectedIndex == 2) {
contents.setBounds(5, 5, 310, 425)
deviceControlPanel.setBounds(5, 435, 310, 85)
deviceConnection.setBounds(5, 525, 310, 50)
Expand All @@ -366,7 +366,7 @@ open class AndroidTool : Command() {
textFieldIP.isVisible = false
labelConnect.isVisible = false
labelIP.isVisible = false
} else if (tabbedpane.selectedIndex == 4) {
} else if (tabbedpane.selectedIndex == 3) {
contents.setBounds(5, 5, 310, 425)
deviceControlPanel.setBounds(5, 435, 310, 85)
deviceConnection.setBounds(5, 525, 310, 50)
Expand All @@ -376,7 +376,7 @@ open class AndroidTool : Command() {
textFieldIP.isVisible = false
labelConnect.isVisible = false
labelIP.isVisible = false
} else if (tabbedpane.selectedIndex == 6) {
} else if (tabbedpane.selectedIndex == 4) {
contents.setBounds(5, 5, 310, 375)
deviceControlPanel.setBounds(5, 385, 310, 85)
deviceConnection.setBounds(5, 475, 310, 100)
Expand Down Expand Up @@ -411,6 +411,7 @@ open class AndroidTool : Command() {
exec("adb", "install \'$path\'")
}
buttonInstallAll.isEnabled = true
labelSelectedAll.text = "Selected: -"
}
getListOfPackages()
}
Expand All @@ -422,6 +423,7 @@ open class AndroidTool : Command() {
else
exec("adb", "install \'$selectedFileAbsolutePath\'")
buttonInstallOne.isEnabled = true
labelSelectedOne.text = "Selected: -"
}
getListOfPackages()
}
Expand Down Expand Up @@ -487,6 +489,7 @@ open class AndroidTool : Command() {
selectedFileAbsolutePath = choseFile.selectedFile.absolutePath
selectedFilePath = choseFile.selectedFile.path
labelSelectedOne.text = "Selected: ${choseFile.selectedFile.name}"
buttonInstallOne.isEnabled = true
}
buttonChooseOne.isEnabled = true
}
Expand All @@ -500,6 +503,7 @@ open class AndroidTool : Command() {
if (chooseDialog == JFileChooser.APPROVE_OPTION) {
selectedDirectoryPath = choseDirectory.selectedFile.path
labelSelectedAll.text = "Selected: ${choseDirectory.selectedFile.path}"
buttonInstallAll.isEnabled = true
}
buttonChoseAll.isEnabled = true
}
Expand Down
3 changes: 1 addition & 2 deletions src/Command.kt
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ open class Command : AndroidToolUI() {
val enableComponents: Array<Component> =
adbPanel.components + consolePanel.components + logsPanel.components
for (component in enableComponents)
if (component != buttonStop && component != buttonSave)
if (component != buttonStop && component != buttonSave && component != buttonInstallOne && component != buttonInstallAll)
component.isEnabled = true
}
textAreaCommandOutput.isFocusable = true
Expand Down Expand Up @@ -570,7 +570,6 @@ open class Command : AndroidToolUI() {
for (component in components)
if (component != buttonStop && component != buttonSave && component != openConsole)
component.isEnabled = false

textAreaCommandOutput.isFocusable = false
textAreaCommandInput.isFocusable = false
listLogs.isFocusable = false
Expand Down
3 changes: 2 additions & 1 deletion src/UI.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,8 @@ open class AndroidToolUI {
val components: Array<Component> =
fastbootPanel.components + adbPanel.components + logsPanel.components + recoveryPanel.components + consolePanel.components
for (component in components)
component.isEnabled = false
if (component != openConsole)
component.isEnabled = false

frame.add(tabbedpane)
}
Expand Down

0 comments on commit 4fff519

Please sign in to comment.