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