Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple quality improvements #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import org.openintents.intents.AboutMiniIntents;
import org.openintents.util.IntentUtils;
import org.openintents.util.VersionUtils;
Expand All @@ -46,11 +45,8 @@ public AboutDialog(Context context) {
String appname = VersionUtils.getApplicationName(mContext);
String appnameversion = mContext.getString(R.string.oi_distribution_name_and_version, appname, version);

StringBuilder sb = new StringBuilder();
sb.append(appnameversion);
sb.append("\n\n");
sb.append(mMessageText);
setMessage(sb.toString());
StringBuilder sb = new StringBuilder();sb.append(appnameversion).append("\n\n").append(mMessageText);
setMessage(sb.toString());
}

public static void showDialogOrStartActivity(Activity activity, int dialogId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public class DistributionLibrary {


Activity mActivity;
int mFirstMenuId = 0;
int mFirstDialogId = 0;
int mFirstMenuId;
int mFirstDialogId;

public DistributionLibrary(Activity activity, int firstMenuId, int firstDialogId) {
mActivity = activity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ protected void set(String message, String downloadName,
mHideMarketLink = org.openintents.distribution.MarketUtils.hideMarketLink(mContext);

StringBuilder sb = new StringBuilder();
sb.append(message);
sb.append(" ");
sb.append(message).append(" ");
if (mMarketAvailable && !mHideMarketLink) {
sb.append(mContext.getString(R.string.oi_distribution_download_market_message,
mDownloadAppName));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@

package org.openintents.distribution;

import org.openintents.util.VersionUtils;

import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import org.openintents.util.VersionUtils;

/**
* @version 2009-10-23: support Market and aTrackDog
Expand Down Expand Up @@ -60,10 +59,8 @@ public UpdateDialog(Context context) {
String appnameversion = mContext.getString(R.string.oi_distribution_name_and_version, appname, version);

StringBuilder sb = new StringBuilder();
sb.append(appnameversion);
sb.append("\n\n");
sb.append(mMessageText);
setMessage(sb.toString());
sb.append(appnameversion).append("\n\n").append(mMessageText);
setMessage(sb.toString());

setButton(BUTTON_POSITIVE, mContext.getText(R.string.oi_distribution_update_check_now), this);
}
Expand Down Expand Up @@ -93,7 +90,7 @@ public void onClick(DialogInterface dialog, int which) {
* @return
*/
public static boolean isUpdateMenuNecessary(Context context) {
PackageInfo pi = null;
PackageInfo pi;

// Test for existence of all known update checker applications.
for (int i = 0; i < UPDATE_CHECKER.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
*
*/
public final class AboutMiniIntents {

/**
* Empty, preventing instantiation.
*/
private AboutMiniIntents() {
//Empty, preventing instantiation.
}

/**
* Activity Action: Show an about dialog to display
Expand Down Expand Up @@ -71,5 +64,12 @@ private AboutMiniIntents() {
*/
public static final String EXTRA_PACKAGE_NAME =
"org.openintents.extra.PACKAGE_NAME";


/**
* Empty, preventing instantiation.
*/
private AboutMiniIntents() {
//Empty, preventing instantiation.
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ public static boolean isIntentAvailable(final Context context, final Intent inte
List<ResolveInfo> list =
packageManager.queryIntentActivities(intent,
PackageManager.MATCH_DEFAULT_ONLY);
return list.size() > 0;
return !list.isEmpty();
}
}