Adjusted visibility of fields and methods. (#102)

* Adjusted visibility of fields and methods.

* Adjusted visibility of fields and methods after rebase
This commit is contained in:
Stephan Hagios 2017-11-01 19:47:24 +01:00 committed by m2049r
parent 44f241f4ee
commit 4cfd166ed7
15 changed files with 90 additions and 92 deletions

View File

@ -21,7 +21,6 @@ You may lose all your Moneroj if you use this App. Be cautious when spending on
- Monerujo means "Monero Wallet" according to https://www.reddit.com/r/Monero/comments/3exy7t/esperanto_corner/ - Monerujo means "Monero Wallet" according to https://www.reddit.com/r/Monero/comments/3exy7t/esperanto_corner/
### TODO ### TODO
- review visibility of methods/classes
- more sensible error dialogs - more sensible error dialogs
### Issues / Pitfalls ### Issues / Pitfalls

View File

@ -48,16 +48,16 @@ public class GenerateFragment extends Fragment {
static final String TYPE_SEED = "seed"; static final String TYPE_SEED = "seed";
static final String TYPE_VIEWONLY = "view"; static final String TYPE_VIEWONLY = "view";
TextInputLayout etWalletName; private TextInputLayout etWalletName;
TextInputLayout etWalletPassword; private TextInputLayout etWalletPassword;
TextInputLayout etWalletAddress; private TextInputLayout etWalletAddress;
TextInputLayout etWalletMnemonic; private TextInputLayout etWalletMnemonic;
TextInputLayout etWalletViewKey; private TextInputLayout etWalletViewKey;
TextInputLayout etWalletSpendKey; private TextInputLayout etWalletSpendKey;
TextInputLayout etWalletRestoreHeight; private TextInputLayout etWalletRestoreHeight;
Button bGenerate; private Button bGenerate;
String type = null; private String type = null;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,

View File

@ -74,7 +74,7 @@ public class LoginActivity extends AppCompatActivity
static final int DAEMON_TIMEOUT = 500; // deamon must respond in 500ms static final int DAEMON_TIMEOUT = 500; // deamon must respond in 500ms
Toolbar toolbar; private Toolbar toolbar;
@Override @Override
public void setToolbarButton(int type) { public void setToolbarButton(int type) {

View File

@ -59,15 +59,15 @@ import java.util.Map;
public class ReceiveFragment extends Fragment { public class ReceiveFragment extends Fragment {
static final String TAG = "ReceiveFragment"; static final String TAG = "ReceiveFragment";
ProgressBar pbProgress; private ProgressBar pbProgress;
TextView tvAddress; private TextView tvAddress;
TextInputLayout etPaymentId; private TextInputLayout etPaymentId;
ExchangeView evAmount; private ExchangeView evAmount;
Button bPaymentId; private Button bPaymentId;
Button bGenerate; private Button bGenerate;
ImageView qrCode; private ImageView qrCode;
EditText etDummy; private EditText etDummy;
ImageButton bCopyAddress; private ImageButton bCopyAddress;
//String name; //String name;

View File

@ -34,7 +34,7 @@ import me.dm7.barcodescanner.zxing.ZXingScannerView;
public class ScannerFragment extends Fragment implements ZXingScannerView.ResultHandler { public class ScannerFragment extends Fragment implements ZXingScannerView.ResultHandler {
static final String TAG = "ScannerFragment"; static final String TAG = "ScannerFragment";
Listener activityCallback; private Listener activityCallback;
public interface Listener { public interface Listener {
boolean onAddressScanned(String uri); boolean onAddressScanned(String uri);

View File

@ -51,33 +51,33 @@ import com.m2049r.xmrwallet.util.TxData;
public class SendFragment extends Fragment { public class SendFragment extends Fragment {
static final String TAG = "SendFragment"; static final String TAG = "SendFragment";
EditText etDummy; private EditText etDummy;
ScrollView scrollview; private ScrollView scrollview;
TextInputLayout etAddress; private TextInputLayout etAddress;
TextInputLayout etPaymentId; private TextInputLayout etPaymentId;
//TextInputLayout etAmount; //TextInputLayout etAmount;
ExchangeView evAmount; private ExchangeView evAmount;
TextView tvAmountB; private TextView tvAmountB;
Spinner sCurrencyA; private Spinner sCurrencyA;
Spinner sCurrencyB; private Spinner sCurrencyB;
Button bScan; private Button bScan;
Spinner sMixin; private Spinner sMixin;
Spinner sPriority; private Spinner sPriority;
Button bPrepareSend; private Button bPrepareSend;
Button bDispose; private Button bDispose;
Button bPaymentId; private Button bPaymentId;
LinearLayout llConfirmSend; private LinearLayout llConfirmSend;
TextView tvTxAmount; private TextView tvTxAmount;
TextView tvTxFee; private TextView tvTxFee;
//TextView tvTxDust; //TextView tvTxDust;
TextView tvTxTotal; private TextView tvTxTotal;
EditText etNotes; private EditText etNotes;
Button bSend; private Button bSend;
Button bReallySend; private Button bReallySend;
ProgressBar pbProgress; private ProgressBar pbProgress;
final static int Mixins[] = {4, 7, 12, 25}; // must match the layout XML final static int Mixins[] = {4, 7, 12, 25}; // must match the layout XML
final static PendingTransaction.Priority Priorities[] = final static PendingTransaction.Priority Priorities[] =

View File

@ -57,17 +57,17 @@ public class TxFragment extends Fragment {
TS_FORMATTER.setTimeZone(tz); TS_FORMATTER.setTimeZone(tz);
} }
TextView tvTxTimestamp; private TextView tvTxTimestamp;
TextView tvTxId; private TextView tvTxId;
TextView tvTxKey; private TextView tvTxKey;
TextView tvDestination; private TextView tvDestination;
TextView tvTxPaymentId; private TextView tvTxPaymentId;
TextView tvTxBlockheight; private TextView tvTxBlockheight;
TextView tvTxAmount; private TextView tvTxAmount;
TextView tvTxFee; private TextView tvTxFee;
TextView tvTxTransfers; private TextView tvTxTransfers;
TextView etTxNotes; private TextView etTxNotes;
Button bTxNotes; private Button bTxNotes;
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,

View File

@ -60,7 +60,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment.
public static final String REQUEST_ID = "id"; public static final String REQUEST_ID = "id";
public static final String REQUEST_PW = "pw"; public static final String REQUEST_PW = "pw";
Toolbar toolbar; private Toolbar toolbar;
@Override @Override
public void setToolbarButton(int type) { public void setToolbarButton(int type) {

View File

@ -53,16 +53,16 @@ public class WalletFragment extends Fragment
private TransactionInfoAdapter adapter; private TransactionInfoAdapter adapter;
private NumberFormat formatter = NumberFormat.getInstance(); private NumberFormat formatter = NumberFormat.getInstance();
FrameLayout flExchange; private FrameLayout flExchange;
TextView tvBalance; private TextView tvBalance;
TextView tvUnconfirmedAmount; private TextView tvUnconfirmedAmount;
TextView tvProgress; private TextView tvProgress;
ImageView ivSynced; private ImageView ivSynced;
ProgressBar pbProgress; private ProgressBar pbProgress;
Button bReceive; private Button bReceive;
Button bSend; private Button bSend;
Spinner sCurrency; private Spinner sCurrency;
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {

View File

@ -47,10 +47,10 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
//static final int TX_PENDING = Color.rgb(72, 53, 176); //static final int TX_PENDING = Color.rgb(72, 53, 176);
//static final int TX_FAILED = Color.rgb(208, 0, 255); //static final int TX_FAILED = Color.rgb(208, 0, 255);
int outboundColour; private int outboundColour;
int inboundColour; private int inboundColour;
int pendingColour; private int pendingColour;
int failedColour; private int failedColour;
public interface OnInteractionListener { public interface OnInteractionListener {
void onInteraction(View view, TransactionInfo item); void onInteraction(View view, TransactionInfo item);
@ -59,7 +59,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapter<TransactionInfo
private final List<TransactionInfo> infoItems; private final List<TransactionInfo> infoItems;
private final OnInteractionListener listener; private final OnInteractionListener listener;
Context context; private Context context;
public TransactionInfoAdapter(Context context, OnInteractionListener listener) { public TransactionInfoAdapter(Context context, OnInteractionListener listener) {
this.context = context; this.context = context;

View File

@ -31,9 +31,9 @@ import android.os.Process;
public class MoneroHandlerThread extends Thread { public class MoneroHandlerThread extends Thread {
// from src/cryptonote_config.h // from src/cryptonote_config.h
static public final long THREAD_STACK_SIZE = 5 * 1024 * 1024; static public final long THREAD_STACK_SIZE = 5 * 1024 * 1024;
int mPriority; private int mPriority;
int mTid = -1; private int mTid = -1;
Looper mLooper; private Looper mLooper;
public MoneroHandlerThread(String name) { public MoneroHandlerThread(String name) {
super(null, null, name, THREAD_STACK_SIZE); super(null, null, name, THREAD_STACK_SIZE);
@ -47,7 +47,7 @@ public class MoneroHandlerThread extends Thread {
* @param priority The priority to run the thread at. The value supplied must be from * @param priority The priority to run the thread at. The value supplied must be from
* {@link android.os.Process} and not from java.lang.Thread. * {@link android.os.Process} and not from java.lang.Thread.
*/ */
public MoneroHandlerThread(String name, int priority) { MoneroHandlerThread(String name, int priority) {
super(null, null, name, THREAD_STACK_SIZE); super(null, null, name, THREAD_STACK_SIZE);
mPriority = priority; mPriority = priority;
} }
@ -57,7 +57,7 @@ public class MoneroHandlerThread extends Thread {
* setup before Looper loops. * setup before Looper loops.
*/ */
protected void onLooperPrepared() { private void onLooperPrepared() {
} }
@Override @Override
@ -81,7 +81,7 @@ public class MoneroHandlerThread extends Thread {
* *
* @return The looper. * @return The looper.
*/ */
public Looper getLooper() { Looper getLooper() {
if (!isAlive()) { if (!isAlive()) {
return null; return null;
} }

View File

@ -254,7 +254,6 @@ public class WalletService extends Service {
///////////////////////////////////////////// /////////////////////////////////////////////
///////////////////////////////////////////// /////////////////////////////////////////////
private Looper mServiceLooper;
private WalletService.ServiceHandler mServiceHandler; private WalletService.ServiceHandler mServiceHandler;
private boolean errorState = false; private boolean errorState = false;
@ -398,8 +397,8 @@ public class WalletService extends Service {
thread.start(); thread.start();
// Get the HandlerThread's Looper and use it for our Handler // Get the HandlerThread's Looper and use it for our Handler
mServiceLooper = thread.getLooper(); final Looper serviceLooper = thread.getLooper();
mServiceHandler = new WalletService.ServiceHandler(mServiceLooper); mServiceHandler = new WalletService.ServiceHandler(serviceLooper);
Log.d(TAG, "Service created"); Log.d(TAG, "Service created");
} }

View File

@ -24,19 +24,19 @@ import org.json.JSONException;
import org.json.JSONObject; import org.json.JSONObject;
public class AsyncExchangeRate extends AsyncTask<String, Void, Boolean> { public class AsyncExchangeRate extends AsyncTask<String, Void, Boolean> {
static final String TAG = "AsyncGetExchangeRate"; private static final String TAG = "AsyncGetExchangeRate";
static final long TIME_REFRESH_INTERVAL = 60000; // refresh exchange rate max every minute private static final long TIME_REFRESH_INTERVAL = 60000; // refresh exchange rate max every minute
static protected long RateTime = 0; private static long RateTime = 0;
static protected double Rate = 0; private static double Rate = 0;
static protected String Fiat = null; private static String Fiat = null;
public interface Listener { public interface Listener {
void exchange(String currencyA, String currencyB, double rate); void exchange(String currencyA, String currencyB, double rate);
} }
Listener listener; private Listener listener;
public AsyncExchangeRate(Listener listener) { public AsyncExchangeRate(Listener listener) {
super(); super();
@ -49,9 +49,9 @@ public class AsyncExchangeRate extends AsyncTask<String, Void, Boolean> {
super.onPreExecute(); super.onPreExecute();
} }
boolean inverse = false; private boolean inverse = false;
String currencyA = null; private String currencyA = null;
String currencyB = null; private String currencyB = null;
@Override @Override
protected Boolean doInBackground(String... params) { protected Boolean doInBackground(String... params) {
@ -125,7 +125,7 @@ public class AsyncExchangeRate extends AsyncTask<String, Void, Boolean> {
} }
} }
String getExchangeRate(String fiat) { private String getExchangeRate(String fiat) {
String jsonResponse = String jsonResponse =
Helper.getUrl("https://api.kraken.com/0/public/Ticker?pair=XMR" + fiat); Helper.getUrl("https://api.kraken.com/0/public/Ticker?pair=XMR" + fiat);
if (jsonResponse == null) return null; if (jsonResponse == null) return null;

View File

@ -118,7 +118,7 @@ public class Helper {
} }
/* Checks if external storage is available for read and write */ /* Checks if external storage is available for read and write */
static public boolean isExternalStorageWritable() { private static boolean isExternalStorageWritable() {
String state = Environment.getExternalStorageState(); String state = Environment.getExternalStorageState();
return Environment.MEDIA_MOUNTED.equals(state); return Environment.MEDIA_MOUNTED.equals(state);
} }
@ -156,7 +156,7 @@ public class Helper {
} }
// amountString must have '.' as decimal point // amountString must have '.' as decimal point
static public String getDisplayAmount(String amountString, int maxDecimals) { private static String getDisplayAmount(String amountString, int maxDecimals) {
int lastZero = 0; int lastZero = 0;
int decimal = 0; int decimal = 0;
for (int i = amountString.length() - 1; i >= 0; i--) { for (int i = amountString.length() - 1; i >= 0; i--) {

View File

@ -22,9 +22,9 @@ import java.util.List;
public class NodeList { public class NodeList {
static private final String TAG = "NodeList"; static private final String TAG = "NodeList";
static public final int MAX_SIZE = 5; private static final int MAX_SIZE = 5;
List<String> nodes = new ArrayList<>(); private List<String> nodes = new ArrayList<>();
public List<String> getNodes() { public List<String> getNodes() {
return nodes; return nodes;