Merge branch 'master' into 'master'

UI bug fixes

This fixes a couple of crasher issues with the UI. And also a small change to allow Eclipse to find the reference files for Android Support.
This commit is contained in:
Daniel Martí 2014-05-15 21:11:19 +00:00
commit a8f9483684
8 changed files with 32 additions and 15 deletions

View File

@ -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

View File

@ -27,8 +27,8 @@
<ImageView
android:layout_width="48dip"
android:layout_height="48dip"
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"
tools:ignore="ContentDescription" />
@ -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" />

View File

@ -327,4 +327,8 @@ public class FDroidApp extends Application {
}
}
}
public static boolean isLocalRepoServiceRunnig() {
return localRepoServiceIsBound;
}
}

View File

@ -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;
}

View File

@ -58,6 +58,7 @@ import java.util.Locale;
public class RepoListFragment extends ListFragment
implements LoaderManager.LoaderCallbacks<Cursor>, 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();

View File

@ -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);