mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
No need to call getResources() for getString().
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
<string name="startup_failed_notification_text">You may need to reinstall Briar.</string>
|
||||
<string name="expiry_warning">This software has expired.\nPlease install a newer version.</string>
|
||||
<string name="contact_list_button">Contacts</string>
|
||||
<string name="delete_contact">Delete contact</string>
|
||||
<string name="contact_deleted_toast">Contact deleted</string>
|
||||
<string name="forums_button">Forums</string>
|
||||
<string name="settings_button">Settings</string>
|
||||
<string name="sign_out_button">Sign Out</string>
|
||||
|
||||
@@ -39,7 +39,6 @@ import org.briarproject.api.messaging.MessageId;
|
||||
import org.briarproject.util.StringUtils;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Bundle;
|
||||
import android.text.InputType;
|
||||
import android.view.View;
|
||||
@@ -168,8 +167,7 @@ implements OnClickListener {
|
||||
private void displayLocalAuthor() {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
Resources res = getResources();
|
||||
String format = res.getString(R.string.format_from);
|
||||
String format = getString(R.string.format_from);
|
||||
String name = localAuthor.getName();
|
||||
from.setText(String.format(format, name));
|
||||
sendButton.setEnabled(true);
|
||||
|
||||
@@ -139,7 +139,7 @@ implements InvitationListener {
|
||||
}
|
||||
|
||||
private void showToastAndFinish() {
|
||||
String format = getResources().getString(R.string.contact_added_toast);
|
||||
String format = getString(R.string.contact_added_toast);
|
||||
String text = String.format(format, contactName);
|
||||
Toast.makeText(this, text, LENGTH_LONG).show();
|
||||
finish();
|
||||
|
||||
@@ -6,7 +6,6 @@ import static android.view.Gravity.CENTER_HORIZONTAL;
|
||||
import org.briarproject.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
@@ -50,8 +49,8 @@ class ConfirmationCodeView extends AddContactView implements CodeEntryListener {
|
||||
addView(code);
|
||||
|
||||
CodeEntryView codeEntry = new CodeEntryView(ctx);
|
||||
Resources res = getResources();
|
||||
codeEntry.init(this, res.getString(R.string.enter_confirmation_code));
|
||||
String enter = container.getString(R.string.enter_confirmation_code);
|
||||
codeEntry.init(this, enter);
|
||||
addView(codeEntry);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ class ConnectionView extends AddContactView {
|
||||
|
||||
TextView connecting = new TextView(ctx);
|
||||
int remoteCode = container.getRemoteInvitationCode();
|
||||
String format = ctx.getResources().getString(R.string.searching_format);
|
||||
String format = container.getString(R.string.searching_format);
|
||||
connecting.setText(String.format(format, remoteCode));
|
||||
innerLayout.addView(connecting);
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import static android.view.Gravity.CENTER_HORIZONTAL;
|
||||
import org.briarproject.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.widget.TextView;
|
||||
|
||||
class InvitationCodeView extends AddContactView implements CodeEntryListener {
|
||||
@@ -32,8 +31,8 @@ class InvitationCodeView extends AddContactView implements CodeEntryListener {
|
||||
addView(code);
|
||||
|
||||
CodeEntryView codeEntry = new CodeEntryView(ctx);
|
||||
Resources res = getResources();
|
||||
codeEntry.init(this, res.getString(R.string.enter_invitation_code));
|
||||
String enter = container.getString(R.string.enter_invitation_code);
|
||||
codeEntry.init(this, enter);
|
||||
addView(codeEntry);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user