Commit 7d56b61b authored by cfabio's avatar cfabio

Code refactor

parent f5882a48
......@@ -58,7 +58,7 @@ public class AddCustomCoinActivity extends AppCompatActivity {
if (coin.coinsLabelGraph.get(altcoinSymbol) != null) {
Toast.makeText(getApplicationContext(), R.string.coinAlreadyPresent, Toast.LENGTH_SHORT).show();
} else if ((!altcoinSymbol.equals("")) && (altcoinSymbol != null)) {
} else if (!altcoinSymbol.equals("")) {
new GetCoinDataTask().execute();
} else {
Toast.makeText(getApplicationContext(), R.string.error, Toast.LENGTH_SHORT).show();
......@@ -138,7 +138,7 @@ public class AddCustomCoinActivity extends AppCompatActivity {
while (data != -1) {
char current = (char) data;
data = isw.read();
dataSTR.append(Character.toString(current));
dataSTR.append(current);
}
} catch (SocketTimeoutException e) {
dataSTR = new StringBuilder("0");
......@@ -179,7 +179,7 @@ public class AddCustomCoinActivity extends AppCompatActivity {
}
// Set empty fields to "na"
if ((tradingviewExchangeName.equals("")) || (tradingviewExchangeName == null)) {
if (tradingviewExchangeName.equals("")) {
tradingviewExchangeName = "na";
tradingviewTradingPair = "na";
}
......
......@@ -5,7 +5,6 @@ import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.InputFilter;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
......@@ -57,7 +56,7 @@ public class EditCustomCoinActivity extends AppCompatActivity {
altcoinSymbol_text = findViewById(R.id.altcoinSymbol_text);
altcoinSymbol_text.setFilters(new InputFilter[] {new InputFilter.AllCaps()});
altcoinSymbol_text.setText(altcoinSymbol);
altcoinSymbol_text.setTextColor(R.color.colorTextSeconday);
altcoinSymbol_text.setTextColor(getResources().getColor(R.color.colorTextSeconday));
altcoinSymbol_text.setEnabled(false);
tradingviewExchangeName_text = findViewById(R.id.tradingviewExchangeName_text);
tradingviewExchangeName_text.setText(tradingviewExchangeName);
......@@ -76,7 +75,7 @@ public class EditCustomCoinActivity extends AppCompatActivity {
if ((coin.coinsLabelGraph.get(altcoinSymbol) != null) && (!altcoinSymbol.equals(altcoinSymbolInitial))) {
Toast.makeText(getApplicationContext(), R.string.coinAlreadyPresent, Toast.LENGTH_SHORT).show();
} else if ((!altcoinSymbol.equals("")) && (altcoinSymbol != null)) {
} else if (!altcoinSymbol.equals("")) {
Thread getCoinDataTh = new Thread() {
public void run() {
getCoinData();
......@@ -142,7 +141,7 @@ public class EditCustomCoinActivity extends AppCompatActivity {
while (data != -1) {
char current = (char) data;
data = isw.read();
dataSTR.append(Character.toString(current));
dataSTR.append(current);
}
} catch (SocketTimeoutException e) {
dataSTR = new StringBuilder("0");
......
......@@ -7,7 +7,6 @@ import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
......
......@@ -4,7 +4,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
......
......@@ -16,7 +16,6 @@ import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.text.Html;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
......@@ -262,7 +261,6 @@ public class MainActivity extends AppCompatActivity
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
//noinspection SimplifiableIfStatement
if (id == R.id.action_manageCustomCoins) {
startActivity(new Intent(this, ManageCustomCoinsActivity.class));
return true;
......@@ -671,7 +669,7 @@ public class MainActivity extends AppCompatActivity
TextView portfolioAltcoinGain = convertView.findViewById(R.id.portfolioAltcoinGain);
if (portfolioAltcoinGain != null) {
String sign = "";
String sign;
if (gainFiat >= 0f) {
sign ="\u25B2"; //symbol: ▲
......
......@@ -5,7 +5,6 @@ import android.content.Intent;
import android.content.SharedPreferences;
import android.support.annotation.NonNull;
import android.support.design.widget.FloatingActionButton;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
......@@ -79,6 +78,7 @@ public class ManageCustomCoinsActivity extends AppCompatActivity {
String jsonData = prefs.getString("customCoins", "");
assert jsonData != null;
if (jsonData.length() != 0) {
try {
JSONObject json = new JSONObject(jsonData);
......
......@@ -145,7 +145,7 @@ public class CoinLogo {
while (data != -1) {
char current = (char) data;
data = isw.read();
dataSTR.append(Character.toString(current));
dataSTR.append(current);
}
} catch (SocketTimeoutException e) {
dataSTR = new StringBuilder("0");
......
......@@ -10,8 +10,12 @@
android:id="@+id/webView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="0dp"
android:layout_marginBottom="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent" />
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
......@@ -11,11 +11,14 @@
android:id="@+id/customCoins"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="0dp"
android:layout_marginRight="0dp"
android:divider="@null"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" >
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
</ListView>
......
......@@ -10,10 +10,15 @@
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginEnd="0dp"
android:layout_marginRight="0dp"
android:background="@color/colorPrimary"
android:hapticFeedbackEnabled="false"
android:showDividers="none"
android:theme="@style/AppTheme.AppBarOverlay">
android:theme="@style/AppTheme.AppBarOverlay"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment