start the local repo webserver by default when going to LocalRepoActivity
To make it dead simple to swap repos when going to the Local Repos screen.
This commit is contained in:
parent
2256cd00e1
commit
16399b760b
@ -53,6 +53,11 @@ public class LocalRepoActivity extends Activity {
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
resetNetworkInfo();
|
||||
|
||||
// start repo by default
|
||||
setRepoSwitchChecked(true);
|
||||
FDroidApp.startLocalRepoService(LocalRepoActivity.this);
|
||||
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(onWifiChange,
|
||||
new IntentFilter(WifiStateChangeService.BROADCAST));
|
||||
// if no local repo exists, create one with only FDroid in it
|
||||
@ -162,17 +167,25 @@ public class LocalRepoActivity extends Activity {
|
||||
repoSwitch.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
setRepoSwitchChecked(repoSwitch.isChecked());
|
||||
if (repoSwitch.isChecked()) {
|
||||
FDroidApp.startLocalRepoService(LocalRepoActivity.this);
|
||||
repoSwitch.setText(R.string.local_repo_running);
|
||||
} else {
|
||||
FDroidApp.stopLocalRepoService(LocalRepoActivity.this);
|
||||
repoSwitch.setText(R.string.touch_to_turn_on_local_repo);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setRepoSwitchChecked(boolean checked) {
|
||||
repoSwitch.setChecked(checked);
|
||||
if (checked) {
|
||||
repoSwitch.setText(R.string.local_repo_running);
|
||||
} else {
|
||||
repoSwitch.setText(R.string.touch_to_turn_on_local_repo);
|
||||
}
|
||||
}
|
||||
|
||||
@TargetApi(14)
|
||||
private void setUIFromWifi() {
|
||||
if (TextUtils.isEmpty(FDroidApp.repo.address))
|
||||
|
Loading…
x
Reference in New Issue
Block a user