Remove unnecessary uses of getString(int)
This commit is contained in:
parent
eab27d402b
commit
14cd500121
@ -586,7 +586,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
private void setApp(App newApp) {
|
private void setApp(App newApp) {
|
||||||
|
|
||||||
if (newApp == null) {
|
if (newApp == null) {
|
||||||
Toast.makeText(this, getString(R.string.no_such_app), Toast.LENGTH_LONG).show();
|
Toast.makeText(this, R.string.no_such_app, Toast.LENGTH_LONG).show();
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -820,8 +820,8 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
|
|
||||||
if (!apk.compatible) {
|
if (!apk.compatible) {
|
||||||
AlertDialog.Builder ask_alrt = new AlertDialog.Builder(this);
|
AlertDialog.Builder ask_alrt = new AlertDialog.Builder(this);
|
||||||
ask_alrt.setMessage(getString(R.string.installIncompatible));
|
ask_alrt.setMessage(R.string.installIncompatible);
|
||||||
ask_alrt.setPositiveButton(getString(R.string.yes),
|
ask_alrt.setPositiveButton(R.string.yes,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
@ -829,7 +829,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
startDownload(apk, repoaddress);
|
startDownload(apk, repoaddress);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ask_alrt.setNegativeButton(getString(R.string.no),
|
ask_alrt.setNegativeButton(R.string.no,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
@ -844,7 +844,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
&& !apk.sig.equals(mInstalledSigID)) {
|
&& !apk.sig.equals(mInstalledSigID)) {
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||||
builder.setMessage(R.string.SignatureMismatch).setPositiveButton(
|
builder.setMessage(R.string.SignatureMismatch).setPositiveButton(
|
||||||
getString(R.string.ok),
|
R.string.ok,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
@ -975,13 +975,13 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
boolean finished = false;
|
boolean finished = false;
|
||||||
switch (event.type) {
|
switch (event.type) {
|
||||||
case ApkDownloader.EVENT_ERROR:
|
case ApkDownloader.EVENT_ERROR:
|
||||||
final String text;
|
final int res;
|
||||||
if (event.getData().getInt(ApkDownloader.EVENT_DATA_ERROR_TYPE) == ApkDownloader.ERROR_HASH_MISMATCH)
|
if (event.getData().getInt(ApkDownloader.EVENT_DATA_ERROR_TYPE) == ApkDownloader.ERROR_HASH_MISMATCH)
|
||||||
text = getString(R.string.corrupt_download);
|
res = R.string.corrupt_download;
|
||||||
else
|
else
|
||||||
text = getString(R.string.details_notinstalled);
|
res = R.string.details_notinstalled;
|
||||||
// this must be on the main UI thread
|
// this must be on the main UI thread
|
||||||
Toast.makeText(this, text, Toast.LENGTH_LONG).show();
|
Toast.makeText(this, res, Toast.LENGTH_LONG).show();
|
||||||
cleanUpFinishedDownload();
|
cleanUpFinishedDownload();
|
||||||
finished = true;
|
finished = true;
|
||||||
break;
|
break;
|
||||||
@ -1324,7 +1324,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
view_all_permissions = false;
|
view_all_permissions = false;
|
||||||
CommaSeparatedList permsList = getApks().getItem(0).permissions;
|
CommaSeparatedList permsList = getApks().getItem(0).permissions;
|
||||||
if (permsList == null) {
|
if (permsList == null) {
|
||||||
permissionListView.setText(getString(R.string.no_permissions));
|
permissionListView.setText(R.string.no_permissions);
|
||||||
} else {
|
} else {
|
||||||
Iterator<String> permissions = permsList.iterator();
|
Iterator<String> permissions = permsList.iterator();
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
@ -1541,7 +1541,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
} else if (!getApp().isInstalled() && getApp().suggestedVercode > 0 &&
|
} else if (!getApp().isInstalled() && getApp().suggestedVercode > 0 &&
|
||||||
((AppDetails)getActivity()).adapter.getCount() > 0) {
|
((AppDetails)getActivity()).adapter.getCount() > 0) {
|
||||||
installed = false;
|
installed = false;
|
||||||
statusView.setText(getString(R.string.details_notinstalled));
|
statusView.setText(R.string.details_notinstalled);
|
||||||
NfcHelper.disableAndroidBeam(getActivity());
|
NfcHelper.disableAndroidBeam(getActivity());
|
||||||
// Set Install button and hide second button
|
// Set Install button and hide second button
|
||||||
btMain.setText(R.string.menu_install);
|
btMain.setText(R.string.menu_install);
|
||||||
@ -1665,8 +1665,8 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
remove();
|
remove();
|
||||||
} else if (getApp().installedVersionCode > apk.vercode) {
|
} else if (getApp().installedVersionCode > apk.vercode) {
|
||||||
AlertDialog.Builder ask_alrt = new AlertDialog.Builder(getActivity());
|
AlertDialog.Builder ask_alrt = new AlertDialog.Builder(getActivity());
|
||||||
ask_alrt.setMessage(getString(R.string.installDowngrade));
|
ask_alrt.setMessage(R.string.installDowngrade);
|
||||||
ask_alrt.setPositiveButton(getString(R.string.yes),
|
ask_alrt.setPositiveButton(R.string.yes,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
@ -1674,7 +1674,7 @@ public class AppDetails extends AppCompatActivity implements ProgressListener, A
|
|||||||
install(apk);
|
install(apk);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
ask_alrt.setNegativeButton(getString(R.string.no),
|
ask_alrt.setNegativeButton(R.string.no,
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog,
|
public void onClick(DialogInterface dialog,
|
||||||
|
@ -288,7 +288,7 @@ public class FDroid extends ActionBarActivity {
|
|||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(this).setView(view);
|
AlertDialog.Builder builder = new AlertDialog.Builder(this).setView(view);
|
||||||
final AlertDialog alrt = builder.create();
|
final AlertDialog alrt = builder.create();
|
||||||
alrt.setTitle(getString(R.string.about_title));
|
alrt.setTitle(R.string.about_title);
|
||||||
alrt.setButton(AlertDialog.BUTTON_NEUTRAL,
|
alrt.setButton(AlertDialog.BUTTON_NEUTRAL,
|
||||||
getString(R.string.about_website),
|
getString(R.string.about_website),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
|
@ -292,7 +292,7 @@ public class ManageReposActivity extends ActionBarActivity {
|
|||||||
final EditText uriEditText = (EditText) view.findViewById(R.id.edit_uri);
|
final EditText uriEditText = (EditText) view.findViewById(R.id.edit_uri);
|
||||||
final EditText fingerprintEditText = (EditText) view.findViewById(R.id.edit_fingerprint);
|
final EditText fingerprintEditText = (EditText) view.findViewById(R.id.edit_fingerprint);
|
||||||
|
|
||||||
addRepoDialog.setTitle(getString(R.string.repo_add_title));
|
addRepoDialog.setTitle(R.string.repo_add_title);
|
||||||
addRepoDialog.setButton(DialogInterface.BUTTON_NEGATIVE,
|
addRepoDialog.setButton(DialogInterface.BUTTON_NEGATIVE,
|
||||||
getString(R.string.cancel),
|
getString(R.string.cancel),
|
||||||
new DialogInterface.OnClickListener() {
|
new DialogInterface.OnClickListener() {
|
||||||
@ -566,7 +566,7 @@ public class ManageReposActivity extends ActionBarActivity {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Button skip = addRepoDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
|
Button skip = addRepoDialog.getButton(AlertDialog.BUTTON_NEGATIVE);
|
||||||
skip.setText(getString(R.string.skip));
|
skip.setText(R.string.skip);
|
||||||
skip.setOnClickListener(new View.OnClickListener() {
|
skip.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user