Merge branch 'merge-requests/38'
This commit is contained in:
commit
433a3b02d6
@ -5,6 +5,7 @@
|
|||||||
<string name="searchres_noapps">No applications were found matching \'%s\'</string>
|
<string name="searchres_noapps">No applications were found matching \'%s\'</string>
|
||||||
<string name="SignatureMismatch">The new version is signed with a different key to the old one. To install the new version, the old one must be uninstalled first. Please do this and try again. (Note that uninstalling will erase any internal data stored by the application)</string>
|
<string name="SignatureMismatch">The new version is signed with a different key to the old one. To install the new version, the old one must be uninstalled first. Please do this and try again. (Note that uninstalling will erase any internal data stored by the application)</string>
|
||||||
<string name="installIncompatible">Android says this package is not compatible with your device. Do you want to try and install it anyway?</string>
|
<string name="installIncompatible">Android says this package is not compatible with your device. Do you want to try and install it anyway?</string>
|
||||||
|
<string name="installDowngrade">You are trying to downgrade this application. Doing so might get it to malfunction and even lose your data. Do you want to try and downgrade it anyway?</string>
|
||||||
<string name="version">Version</string>
|
<string name="version">Version</string>
|
||||||
<string name="n_versions_available">%d versions available</string>
|
<string name="n_versions_available">%d versions available</string>
|
||||||
<string name="n_version_available">%d version available</string>
|
<string name="n_version_available">%d version available</string>
|
||||||
@ -65,6 +66,9 @@
|
|||||||
<string name="tab_noninstalled">Available</string>
|
<string name="tab_noninstalled">Available</string>
|
||||||
<string name="tab_updates">Updates</string>
|
<string name="tab_updates">Updates</string>
|
||||||
<string name="update_available">Updates available</string>
|
<string name="update_available">Updates available</string>
|
||||||
|
<string name="one_update_available">1 update is available.</string>
|
||||||
|
<string name="many_updates_available">%d updates are available.</string>
|
||||||
|
<string name="fdroid_updates_available">F-Droid Updates Available</string>
|
||||||
<string name="process_wait_title">Please Wait</string>
|
<string name="process_wait_title">Please Wait</string>
|
||||||
<string name="process_update_msg">Updating application list...</string>
|
<string name="process_update_msg">Updating application list...</string>
|
||||||
<string name="connection_error">Could not connect to the network.</string>
|
<string name="connection_error">Could not connect to the network.</string>
|
||||||
|
@ -473,12 +473,29 @@ public class AppDetails extends ListActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onListItemClick(ListView l, View v, int position, long id) {
|
protected void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
curapk = app.apks.get(position - l.getHeaderViewsCount());
|
curapk = app.apks.get(position - l.getHeaderViewsCount());
|
||||||
if (app.installedVersion != null
|
if (app.installedVerCode == curapk.vercode)
|
||||||
&& app.installedVersion.equals(curapk.version)) {
|
|
||||||
removeApk(app.id);
|
removeApk(app.id);
|
||||||
} else {
|
else if (app.installedVerCode > curapk.vercode) {
|
||||||
|
AlertDialog.Builder ask_alrt = new AlertDialog.Builder(this);
|
||||||
|
ask_alrt.setMessage(getString(R.string.installDowngrade));
|
||||||
|
ask_alrt.setPositiveButton(getString(R.string.yes),
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog,
|
||||||
|
int whichButton) {
|
||||||
|
install();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
ask_alrt.setNegativeButton(getString(R.string.no),
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
public void onClick(DialogInterface dialog,
|
||||||
|
int whichButton) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
AlertDialog alert = ask_alrt.create();
|
||||||
|
alert.show();
|
||||||
|
} else
|
||||||
install();
|
install();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -539,7 +556,7 @@ public class AppDetails extends ListActivity {
|
|||||||
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(s)));
|
startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(s)));
|
||||||
} catch (android.content.ActivityNotFoundException e) {
|
} catch (android.content.ActivityNotFoundException e) {
|
||||||
Toast toast = Toast.makeText(this,
|
Toast toast = Toast.makeText(this,
|
||||||
getString(R.string.no_handler_app, s), 4);
|
getString(R.string.no_handler_app, s), Toast.LENGTH_LONG);
|
||||||
toast.show();
|
toast.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -254,20 +254,27 @@ public class UpdateService extends IntentService implements ProgressListener {
|
|||||||
Log.d("FDroid", "Notifying updates. Apps before:" + prevUpdates
|
Log.d("FDroid", "Notifying updates. Apps before:" + prevUpdates
|
||||||
+ ", apps after: " + newUpdates);
|
+ ", apps after: " + newUpdates);
|
||||||
if (newUpdates > prevUpdates) {
|
if (newUpdates > prevUpdates) {
|
||||||
NotificationManager n = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
NotificationManager n = (NotificationManager) getSystemService(
|
||||||
Notification notification = new Notification(
|
Context.NOTIFICATION_SERVICE);
|
||||||
R.drawable.icon, "F-Droid Updates Available",
|
Notification notification = new Notification(R.drawable.icon,
|
||||||
|
getString(R.string.fdroid_updates_available),
|
||||||
System.currentTimeMillis());
|
System.currentTimeMillis());
|
||||||
Context context = getApplicationContext();
|
Context context = getApplicationContext();
|
||||||
CharSequence contentTitle = "F-Droid";
|
|
||||||
CharSequence contentText = "Updates are available.";
|
|
||||||
Intent notificationIntent = new Intent(UpdateService.this,
|
Intent notificationIntent = new Intent(UpdateService.this,
|
||||||
FDroid.class);
|
FDroid.class);
|
||||||
notificationIntent.putExtra(FDroid.EXTRA_TAB_UPDATE, true);
|
notificationIntent.putExtra(FDroid.EXTRA_TAB_UPDATE, true);
|
||||||
PendingIntent contentIntent = PendingIntent.getActivity(
|
PendingIntent contentIntent = PendingIntent.getActivity(
|
||||||
UpdateService.this, 0, notificationIntent, 0);
|
UpdateService.this, 0, notificationIntent, 0);
|
||||||
notification.setLatestEventInfo(context, contentTitle,
|
CharSequence notification_text;
|
||||||
contentText, contentIntent);
|
if (newUpdates > 1)
|
||||||
|
notification_text = getString(
|
||||||
|
R.string.many_updates_available, newUpdates);
|
||||||
|
else
|
||||||
|
notification_text = getString(
|
||||||
|
R.string.one_update_available);
|
||||||
|
notification.setLatestEventInfo(context,
|
||||||
|
getString(R.string.app_name),
|
||||||
|
notification_text, contentIntent);
|
||||||
notification.flags |= Notification.FLAG_AUTO_CANCEL;
|
notification.flags |= Notification.FLAG_AUTO_CANCEL;
|
||||||
n.notify(1, notification);
|
n.notify(1, notification);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user