HomeActivity placeholders

This commit is contained in:
Tanguy Herbron 2018-04-04 16:14:56 +02:00
parent b211a4f698
commit e7378c278b
3 changed files with 9 additions and 7 deletions

View File

@ -61,11 +61,11 @@ public class CurrencySelectionActivity extends AppCompatActivity implements Sear
private void setupAdapter() private void setupAdapter()
{ {
String[] currencyFullname = new String[currencyNames.length]; String[] currencyFullName = new String[currencyNames.length];
for(int i = 0; i < currencyFullname.length; i++) for(int i = 0; i < currencyFullName.length; i++)
{ {
currencyFullname[i] = currencyNames[i] + " " + currencySymbols[i]; currencyFullName[i] = currencyNames[i] + " " + currencySymbols[i];
} }
ArrayList<Currency> currencyArrayList = new ArrayList<>(); ArrayList<Currency> currencyArrayList = new ArrayList<>();

View File

@ -177,9 +177,9 @@ public class HomeActivity extends AppCompatActivity {
ImageButton settingsButton = findViewById(R.id.settings_button); ImageButton settingsButton = findViewById(R.id.settings_button);
toolbarLayout.setForegroundGravity(Gravity.CENTER); toolbarLayout.setForegroundGravity(Gravity.CENTER);
toolbarLayout.setTitle("US$0.00"); toolbarLayout.setTitle(getResources().getString(R.string.currencyDollarPlaceholder, "0.00"));
toolbarSubtitle.setText("US$0.00"); toolbarSubtitle.setText(getResources().getString(R.string.currencyDollarPlaceholder, "0.00"));
//Events setup //Events setup
detailsButton.setOnClickListener(new View.OnClickListener() { detailsButton.setOnClickListener(new View.OnClickListener() {
@ -551,9 +551,9 @@ public class HomeActivity extends AppCompatActivity {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
toolbarLayout.setTitle("US$0.00"); toolbarLayout.setTitle(getResources().getString(R.string.currencyDollarPlaceholder, "0.00"));
toolbarSubtitle.setText("US$0.00"); toolbarSubtitle.setText(getResources().getString(R.string.currencyDollarPlaceholder, "0.00"));
toolbarSubtitle.setTextColor(-1275068417); toolbarSubtitle.setTextColor(-1275068417);
} }
@ -896,6 +896,7 @@ public class HomeActivity extends AppCompatActivity {
totalFluctuationPercentage = totalFluctuation / (totalValue - totalFluctuation) *100; totalFluctuationPercentage = totalFluctuation / (totalValue - totalFluctuation) *100;
//toolbarSubtitle.setText(String.format(getResources().getString(R.string.fluctuationDollarPercentagePlaceholder), totalFluctuation));
toolbarSubtitle.setText("US$" + String.format("%.2f", totalFluctuation) + " (" + String.format("%.2f", totalFluctuationPercentage) + "%)"); toolbarSubtitle.setText("US$" + String.format("%.2f", totalFluctuation) + " (" + String.format("%.2f", totalFluctuationPercentage) + "%)");
if(loadingDialog.isShowing()) if(loadingDialog.isShowing())

View File

@ -146,6 +146,7 @@
<string name="currencyDollarParenthesisPlaceholder">(US$%1$s)</string> <string name="currencyDollarParenthesisPlaceholder">(US$%1$s)</string>
<string name="currencyDollarPlaceholder">US$%1$s</string> <string name="currencyDollarPlaceholder">US$%1$s</string>
<string name="currencyPercentagePlaceholder">%1$s%%</string> <string name="currencyPercentagePlaceholder">%1$s%%</string>
<string name="fluctuationDollarPercentagePlaceholder">US$%1$s (%2$s%)</string>
<!--DetailsActivity placeholders--> <!--DetailsActivity placeholders-->
<string name="volumePlaceholder">Volume\nUS$%1$s</string> <string name="volumePlaceholder">Volume\nUS$%1$s</string>