diff --git a/libs/NOTICE.android-support-v4.txt b/libs/android-support-v4.jar.LICENSE similarity index 100% rename from libs/NOTICE.android-support-v4.txt rename to libs/android-support-v4.jar.LICENSE diff --git a/libs/README.android-support-v4.txt b/libs/android-support-v4.jar.README similarity index 100% rename from libs/README.android-support-v4.txt rename to libs/android-support-v4.jar.README diff --git a/libs/android-support-v4.jar.properties b/libs/android-support-v4.jar.properties new file mode 100644 index 000000000..bc9c2009a --- /dev/null +++ b/libs/android-support-v4.jar.properties @@ -0,0 +1,8 @@ +src=android-support-v4.jar +doc=/opt/android-sdk/docs/reference +# The String value of 'doc' is handed straight to `new java.io.File()` so it +# is not possible to use variables. Therefore, change "/opt/android-sdk" to +# the path to your Android SDK, i.e. the value of $ANDROID_HOME or ${sdk.dir} +# +# Here's the relevant source: +# https://android-review.googlesource.com/#/c/35702/3/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/project/LibraryClasspathContainerInitializer.java diff --git a/res/layout/select_local_apps_list_item.xml b/res/layout/select_local_apps_list_item.xml index eb77c8fd7..895d3a3a1 100644 --- a/res/layout/select_local_apps_list_item.xml +++ b/res/layout/select_local_apps_list_item.xml @@ -27,8 +27,8 @@ @@ -41,8 +41,8 @@ android:id="@+id/application_label" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginLeft="?android:attr/listPreferredItemPaddingStart" - android:layout_marginStart="?android:attr/listPreferredItemPaddingStart" + android:layout_marginLeft="?android:attr/listPreferredItemPaddingLeft" + android:layout_marginStart="?android:attr/listPreferredItemPaddingLeft" android:layout_marginTop="6dip" android:textAppearance="?android:attr/textAppearanceListItem" /> diff --git a/src/org/fdroid/fdroid/FDroidApp.java b/src/org/fdroid/fdroid/FDroidApp.java index 1e120dd97..c344db3c5 100644 --- a/src/org/fdroid/fdroid/FDroidApp.java +++ b/src/org/fdroid/fdroid/FDroidApp.java @@ -327,4 +327,8 @@ public class FDroidApp extends Application { } } } + + public static boolean isLocalRepoServiceRunnig() { + return localRepoServiceIsBound; + } } diff --git a/src/org/fdroid/fdroid/views/LocalRepoActivity.java b/src/org/fdroid/fdroid/views/LocalRepoActivity.java index 5e1ffc23a..b7d4e3f21 100644 --- a/src/org/fdroid/fdroid/views/LocalRepoActivity.java +++ b/src/org/fdroid/fdroid/views/LocalRepoActivity.java @@ -58,6 +58,7 @@ public class LocalRepoActivity extends Activity { public void onResume() { super.onResume(); resetNetworkInfo(); + setRepoSwitchChecked(FDroidApp.isLocalRepoServiceRunnig()); LocalBroadcastManager.getInstance(this).registerReceiver(onWifiChange, new IntentFilter(WifiStateChangeService.BROADCAST)); @@ -71,6 +72,9 @@ public class LocalRepoActivity extends Activity { // start repo by default FDroidApp.startLocalRepoService(LocalRepoActivity.this); + // reset the timer if viewing this Activity again + if (stopTimer != null) + stopTimer.cancel(); // automatically turn off after 15 minutes stopTimer = new Timer(); stopTimer.schedule(new TimerTask() { @@ -139,7 +143,7 @@ public class LocalRepoActivity extends Activity { public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.local_repo_activity, menu); - if (Build.VERSION.SDK_INT < 11) // TODO remove after including appcompat-v7 + if (Build.VERSION.SDK_INT < 14) // TODO remove after including appcompat-v7 menu.findItem(R.id.menu_setup_repo).setVisible(false); return true; } diff --git a/src/org/fdroid/fdroid/views/fragments/RepoListFragment.java b/src/org/fdroid/fdroid/views/fragments/RepoListFragment.java index 07ae9a41f..0fc2b8fa1 100644 --- a/src/org/fdroid/fdroid/views/fragments/RepoListFragment.java +++ b/src/org/fdroid/fdroid/views/fragments/RepoListFragment.java @@ -58,6 +58,7 @@ import java.util.Locale; public class RepoListFragment extends ListFragment implements LoaderManager.LoaderCallbacks, RepoAdapter.EnabledListener { + private AlertDialog addRepoDialog; private static final String DEFAULT_NEW_REPO_TEXT = "https://"; private final int ADD_REPO = 1; private final int UPDATE_REPOS = 2; @@ -309,7 +310,7 @@ public class RepoListFragment extends ListFragment private void showAddRepo(String newAddress, String newFingerprint) { View view = getLayoutInflater(null).inflate(R.layout.addrepo, null); - final AlertDialog alrt = new AlertDialog.Builder(getActivity()).setView(view).create(); + addRepoDialog = new AlertDialog.Builder(getActivity()).setView(view).create(); final EditText uriEditText = (EditText) view.findViewById(R.id.edit_uri); final EditText fingerprintEditText = (EditText) view.findViewById(R.id.edit_fingerprint); @@ -322,9 +323,9 @@ public class RepoListFragment extends ListFragment ? RepoProvider.Helper.findByAddress(getActivity(), newAddress) : null; - alrt.setIcon(android.R.drawable.ic_menu_add); - alrt.setTitle(getString(R.string.repo_add_title)); - alrt.setButton(DialogInterface.BUTTON_POSITIVE, + addRepoDialog.setIcon(android.R.drawable.ic_menu_add); + addRepoDialog.setTitle(getString(R.string.repo_add_title)); + addRepoDialog.setButton(DialogInterface.BUTTON_POSITIVE, getString(R.string.repo_add_add), new DialogInterface.OnClickListener() { @Override @@ -344,7 +345,7 @@ public class RepoListFragment extends ListFragment } }); - alrt.setButton(DialogInterface.BUTTON_NEGATIVE, + addRepoDialog.setButton(DialogInterface.BUTTON_NEGATIVE, getString(R.string.cancel), new DialogInterface.OnClickListener() { @Override @@ -352,7 +353,7 @@ public class RepoListFragment extends ListFragment dialog.dismiss(); } }); - alrt.show(); + addRepoDialog.show(); final TextView overwriteMessage = (TextView) view.findViewById(R.id.overwrite_message); overwriteMessage.setVisibility(View.GONE); @@ -361,8 +362,8 @@ public class RepoListFragment extends ListFragment positiveAction = PositiveAction.ADD_NEW; } else { // found the address in the DB of existing repos - final Button addButton = alrt.getButton(DialogInterface.BUTTON_POSITIVE); - alrt.setTitle(R.string.repo_exists); + final Button addButton = addRepoDialog.getButton(DialogInterface.BUTTON_POSITIVE); + addRepoDialog.setTitle(R.string.repo_exists); overwriteMessage.setVisibility(View.VISIBLE); if (newFingerprint != null) newFingerprint = newFingerprint.toUpperCase(Locale.ENGLISH); @@ -375,7 +376,7 @@ public class RepoListFragment extends ListFragment // this entry already exists and is not enabled, offer to enable // it if (repo.inuse) { - alrt.dismiss(); + addRepoDialog.dismiss(); Toast.makeText(getActivity(), R.string.repo_exists_and_enabled, Toast.LENGTH_LONG).show(); return; @@ -439,6 +440,7 @@ public class RepoListFragment extends ListFragment */ private void finishedAddingRepo() { changed = true; + addRepoDialog = null; if (isImportingRepo) { getActivity().setResult(Activity.RESULT_OK); getActivity().finish(); diff --git a/src/org/fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java b/src/org/fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java index 87d692f9d..24b254cc6 100644 --- a/src/org/fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java +++ b/src/org/fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java @@ -86,7 +86,6 @@ public class SelectLocalAppsFragment extends ListFragment @Override public boolean setViewValue(View view, Cursor cursor, int columnIndex) { - Log.i("SelectLocalAppsFragment", "ViewBinder " + columnIndex); if (columnIndex == cursor.getColumnIndex(InstalledAppProvider.DataColumns.APP_ID)) { String packageName = cursor.getString(columnIndex); TextView textView = (TextView) view.findViewById(R.id.package_name);