mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-07-03 21:21:12 +08:00
Unify start button UI
Show both the live capture and PCAP file loading options under the play button
This commit is contained in:
parent
68d3a1dc12
commit
c08ac59f46
@ -631,7 +631,7 @@ public class MainActivity extends BaseActivity implements NavigationView.OnNavig
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
int id = item.getItemId();
|
||||
|
||||
if(id == R.id.action_start) {
|
||||
if(id == R.id.start_live_capture) {
|
||||
startCapture();
|
||||
return true;
|
||||
} else if(id == R.id.action_stop) {
|
||||
|
||||
@ -67,7 +67,6 @@ public class StatusFragment extends Fragment implements AppStateListener, MenuPr
|
||||
private Menu mMenu;
|
||||
private MenuItem mStartBtn;
|
||||
private MenuItem mStopBtn;
|
||||
private MenuItem mOpenPcap;
|
||||
private MenuItem mMenuSettings;
|
||||
private TextView mInterfaceInfo;
|
||||
private TextView mCollectorInfo;
|
||||
@ -183,7 +182,6 @@ public class StatusFragment extends Fragment implements AppStateListener, MenuPr
|
||||
mMenu = menu;
|
||||
mStartBtn = mMenu.findItem(R.id.action_start);
|
||||
mStopBtn = mMenu.findItem(R.id.action_stop);
|
||||
mOpenPcap = mMenu.findItem(R.id.open_pcap);
|
||||
mMenuSettings = mMenu.findItem(R.id.action_settings);
|
||||
refreshStatus();
|
||||
}
|
||||
@ -329,8 +327,6 @@ public class StatusFragment extends Fragment implements AppStateListener, MenuPr
|
||||
mStartBtn.setVisible(!CaptureService.isAlwaysOnVPN());
|
||||
mMenuSettings.setEnabled(true);
|
||||
}
|
||||
|
||||
mOpenPcap.setEnabled((state == AppState.ready));
|
||||
}
|
||||
|
||||
switch(state) {
|
||||
|
||||
@ -7,7 +7,17 @@
|
||||
android:title="@string/start_button"
|
||||
android:orderInCategory="10"
|
||||
android:icon="@drawable/ic_play_arrow"
|
||||
app:showAsAction="always" />
|
||||
app:showAsAction="always">
|
||||
<menu>
|
||||
<item
|
||||
android:id="@+id/start_live_capture"
|
||||
android:title="@string/live_capture" />
|
||||
|
||||
<item
|
||||
android:id="@+id/open_pcap"
|
||||
android:title="@string/open_pcap_file" />
|
||||
</menu>
|
||||
</item>
|
||||
|
||||
<item
|
||||
android:id="@+id/action_stop"
|
||||
@ -23,10 +33,4 @@
|
||||
android:orderInCategory="30"
|
||||
android:icon="@drawable/ic_settings"
|
||||
app:showAsAction="ifRoom" />
|
||||
|
||||
<item
|
||||
android:id="@+id/open_pcap"
|
||||
android:title="@string/open_pcap_file"
|
||||
android:orderInCategory="40"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
||||
|
||||
@ -489,4 +489,5 @@
|
||||
<string name="pcap_file_load_aborted">PCAP file loading aborted</string>
|
||||
<string name="host_resolution_failed">"Could not resolve host %1$s</string>
|
||||
<string name="pcapdroid_trailer_notice">To show the actual apps instead of \"%1$s\", be sure to enable the \"%2$s\" option before exporting the PCAP file</string>
|
||||
<string name="live_capture">Live capture</string>
|
||||
</resources>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user