mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Renamed some classes and methods.
This commit is contained in:
@@ -10,10 +10,10 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class LocalAuthorNameSpinnerAdapter extends ArrayAdapter<LocalAuthor>
|
||||
public class LocalAuthorSpinnerAdapter extends ArrayAdapter<LocalAuthor>
|
||||
implements SpinnerAdapter {
|
||||
|
||||
public LocalAuthorNameSpinnerAdapter(Context context) {
|
||||
public LocalAuthorSpinnerAdapter(Context context) {
|
||||
super(context, android.R.layout.simple_spinner_item,
|
||||
new ArrayList<LocalAuthor>());
|
||||
}
|
||||
@@ -166,11 +166,11 @@ OnClickListener, OnItemClickListener {
|
||||
if(result == ReadGroupMessageActivity.RESULT_PREV) {
|
||||
int position = request - 1;
|
||||
if(position >= 0 && position < adapter.getCount())
|
||||
showMessage(position);
|
||||
displayMessage(position);
|
||||
} else if(result == ReadGroupMessageActivity.RESULT_NEXT) {
|
||||
int position = request + 1;
|
||||
if(position >= 0 && position < adapter.getCount())
|
||||
showMessage(position);
|
||||
displayMessage(position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,10 +217,10 @@ OnClickListener, OnItemClickListener {
|
||||
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position,
|
||||
long id) {
|
||||
showMessage(position);
|
||||
displayMessage(position);
|
||||
}
|
||||
|
||||
private void showMessage(int position) {
|
||||
private void displayMessage(int position) {
|
||||
GroupMessageHeader item = adapter.getItem(position);
|
||||
Intent i = new Intent(this, ReadGroupMessageActivity.class);
|
||||
i.putExtra("net.sf.briar.GROUP_ID", groupId.getBytes());
|
||||
|
||||
@@ -10,10 +10,10 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
class GroupNameSpinnerAdapter extends ArrayAdapter<Group>
|
||||
class GroupSpinnerAdapter extends ArrayAdapter<Group>
|
||||
implements SpinnerAdapter {
|
||||
|
||||
GroupNameSpinnerAdapter(Context context) {
|
||||
GroupSpinnerAdapter(Context context) {
|
||||
super(context, android.R.layout.simple_spinner_item,
|
||||
new ArrayList<Group>());
|
||||
}
|
||||
@@ -21,7 +21,7 @@ import net.sf.briar.android.AuthorNameComparator;
|
||||
import net.sf.briar.android.BriarActivity;
|
||||
import net.sf.briar.android.BriarService;
|
||||
import net.sf.briar.android.BriarService.BriarServiceConnection;
|
||||
import net.sf.briar.android.LocalAuthorNameSpinnerAdapter;
|
||||
import net.sf.briar.android.LocalAuthorSpinnerAdapter;
|
||||
import net.sf.briar.android.widgets.CommonLayoutParams;
|
||||
import net.sf.briar.android.widgets.HorizontalSpace;
|
||||
import net.sf.briar.api.LocalAuthor;
|
||||
@@ -59,8 +59,8 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
new BriarServiceConnection();
|
||||
|
||||
@Inject private BundleEncrypter bundleEncrypter;
|
||||
private LocalAuthorNameSpinnerAdapter fromAdapter = null;
|
||||
private GroupNameSpinnerAdapter toAdapter = null;
|
||||
private LocalAuthorSpinnerAdapter fromAdapter = null;
|
||||
private GroupSpinnerAdapter toAdapter = null;
|
||||
private Spinner fromSpinner = null, toSpinner = null;
|
||||
private ImageButton sendButton = null;
|
||||
private EditText content = null;
|
||||
@@ -101,7 +101,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
from.setText(R.string.from);
|
||||
header.addView(from);
|
||||
|
||||
fromAdapter = new LocalAuthorNameSpinnerAdapter(this);
|
||||
fromAdapter = new LocalAuthorSpinnerAdapter(this);
|
||||
fromSpinner = new Spinner(this);
|
||||
fromSpinner.setOnItemSelectedListener(this);
|
||||
loadLocalAuthorList();
|
||||
@@ -128,7 +128,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
to.setText(R.string.to);
|
||||
header.addView(to);
|
||||
|
||||
toAdapter = new GroupNameSpinnerAdapter(this);
|
||||
toAdapter = new GroupSpinnerAdapter(this);
|
||||
toSpinner = new Spinner(this);
|
||||
toSpinner.setAdapter(toAdapter);
|
||||
toSpinner.setOnItemSelectedListener(this);
|
||||
@@ -156,7 +156,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
public void run() {
|
||||
try {
|
||||
serviceConnection.waitForStartup();
|
||||
updateLocalAuthorList(db.getLocalAuthors());
|
||||
displayLocalAuthorList(db.getLocalAuthors());
|
||||
} catch(DbException e) {
|
||||
if(LOG.isLoggable(WARNING))
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
@@ -168,7 +168,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
});
|
||||
}
|
||||
|
||||
private void updateLocalAuthorList(
|
||||
private void displayLocalAuthorList(
|
||||
final Collection<LocalAuthor> localAuthors) {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -192,7 +192,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
if(!g.isRestricted()) groups.add(g);
|
||||
}
|
||||
groups = Collections.unmodifiableList(groups);
|
||||
updateGroupList(groups);
|
||||
displayGroupList(groups);
|
||||
} catch(DbException e) {
|
||||
if(LOG.isLoggable(WARNING))
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
@@ -204,7 +204,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
});
|
||||
}
|
||||
|
||||
private void updateGroupList(final Collection<Group> groups) {
|
||||
private void displayGroupList(final Collection<Group> groups) {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
int index = -1;
|
||||
|
||||
@@ -2,7 +2,7 @@ package net.sf.briar.android.invitation;
|
||||
|
||||
import static android.view.Gravity.CENTER;
|
||||
import net.sf.briar.R;
|
||||
import net.sf.briar.android.LocalAuthorNameSpinnerAdapter;
|
||||
import net.sf.briar.android.LocalAuthorSpinnerAdapter;
|
||||
import net.sf.briar.android.widgets.CommonLayoutParams;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
@@ -18,7 +18,7 @@ public class NetworkSetupView extends AddContactView
|
||||
implements WifiStateListener, BluetoothStateListener, OnItemSelectedListener,
|
||||
OnClickListener {
|
||||
|
||||
private LocalAuthorNameSpinnerAdapter adapter = null;
|
||||
private LocalAuthorSpinnerAdapter adapter = null;
|
||||
private Spinner spinner = null;
|
||||
private Button continueButton = null;
|
||||
|
||||
@@ -41,7 +41,7 @@ OnClickListener {
|
||||
yourIdentity.setText(R.string.your_identity);
|
||||
innerLayout.addView(yourIdentity);
|
||||
|
||||
adapter = new LocalAuthorNameSpinnerAdapter(ctx);
|
||||
adapter = new LocalAuthorSpinnerAdapter(ctx);
|
||||
spinner = new Spinner(ctx);
|
||||
spinner.setAdapter(adapter);
|
||||
spinner.setOnItemSelectedListener(this);
|
||||
|
||||
@@ -10,10 +10,10 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.SpinnerAdapter;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class ContactNameSpinnerAdapter extends ArrayAdapter<Contact>
|
||||
public class ContactSpinnerAdapter extends ArrayAdapter<Contact>
|
||||
implements SpinnerAdapter {
|
||||
|
||||
ContactNameSpinnerAdapter(Context context) {
|
||||
ContactSpinnerAdapter(Context context) {
|
||||
super(context, android.R.layout.simple_spinner_item,
|
||||
new ArrayList<Contact>());
|
||||
}
|
||||
@@ -163,11 +163,11 @@ implements DatabaseListener, OnClickListener, OnItemClickListener {
|
||||
if(result == ReadPrivateMessageActivity.RESULT_PREV) {
|
||||
int position = request - 1;
|
||||
if(position >= 0 && position < adapter.getCount())
|
||||
showMessage(position);
|
||||
displayMessage(position);
|
||||
} else if(result == ReadPrivateMessageActivity.RESULT_NEXT) {
|
||||
int position = request + 1;
|
||||
if(position >= 0 && position < adapter.getCount())
|
||||
showMessage(position);
|
||||
displayMessage(position);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,10 +210,10 @@ implements DatabaseListener, OnClickListener, OnItemClickListener {
|
||||
|
||||
public void onItemClick(AdapterView<?> parent, View view, int position,
|
||||
long id) {
|
||||
showMessage(position);
|
||||
displayMessage(position);
|
||||
}
|
||||
|
||||
private void showMessage(int position) {
|
||||
private void displayMessage(int position) {
|
||||
PrivateMessageHeader item = adapter.getItem(position);
|
||||
Intent i = new Intent(this, ReadPrivateMessageActivity.class);
|
||||
i.putExtra("net.sf.briar.CONTACT_ID", contactId.getInt());
|
||||
|
||||
@@ -56,7 +56,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
|
||||
@Inject private BundleEncrypter bundleEncrypter;
|
||||
private TextView from = null;
|
||||
private ContactNameSpinnerAdapter adapter = null;
|
||||
private ContactSpinnerAdapter adapter = null;
|
||||
private Spinner spinner = null;
|
||||
private ImageButton sendButton = null;
|
||||
private EditText content = null;
|
||||
@@ -116,7 +116,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
to.setText(R.string.to);
|
||||
header.addView(to);
|
||||
|
||||
adapter = new ContactNameSpinnerAdapter(this);
|
||||
adapter = new ContactSpinnerAdapter(this);
|
||||
spinner = new Spinner(this);
|
||||
spinner.setAdapter(adapter);
|
||||
spinner.setOnItemSelectedListener(this);
|
||||
@@ -144,7 +144,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
public void run() {
|
||||
try {
|
||||
serviceConnection.waitForStartup();
|
||||
updateContactList(db.getContacts());
|
||||
displayContactList(db.getContacts());
|
||||
} catch(DbException e) {
|
||||
if(LOG.isLoggable(WARNING))
|
||||
LOG.log(WARNING, e.toString(), e);
|
||||
@@ -156,7 +156,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
});
|
||||
}
|
||||
|
||||
private void updateContactList(final Collection<Contact> contacts) {
|
||||
private void displayContactList(final Collection<Contact> contacts) {
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
int index = -1;
|
||||
|
||||
Reference in New Issue
Block a user