Rework RecordTransactionActivity's UI
This commit is contained in:
parent
b919e164e5
commit
10888c4c54
BIN
.idea/caches/build_file_checksums.ser
generated
BIN
.idea/caches/build_file_checksums.ser
generated
Binary file not shown.
@ -21,7 +21,7 @@ import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
|||||||
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyDetailsList;
|
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyDetailsList;
|
||||||
import com.herbron.moodl.DataManagers.DatabaseManager;
|
import com.herbron.moodl.DataManagers.DatabaseManager;
|
||||||
import com.herbron.moodl.DataManagers.PreferencesManager;
|
import com.herbron.moodl.DataManagers.PreferencesManager;
|
||||||
import com.herbron.moodl.LayoutManagers.CurrencyListAdapter;
|
import com.herbron.moodl.LayoutManagers.CoinWatchlistAdapter;
|
||||||
import com.herbron.moodl.R;
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -29,7 +29,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public class CurrencySelectionActivity extends AppCompatActivity implements SearchView.OnQueryTextListener{
|
public class CurrencySelectionActivity extends AppCompatActivity implements SearchView.OnQueryTextListener{
|
||||||
|
|
||||||
private CurrencyListAdapter adapter;
|
private CoinWatchlistAdapter adapter;
|
||||||
private ListView listView;
|
private ListView listView;
|
||||||
private android.widget.Filter filter;
|
private android.widget.Filter filter;
|
||||||
private CurrencyDetailsList currencyDetailsList;
|
private CurrencyDetailsList currencyDetailsList;
|
||||||
@ -77,7 +77,7 @@ public class CurrencySelectionActivity extends AppCompatActivity implements Sear
|
|||||||
currencyArrayList.add(new Currency(currencyNames.get(i), currencySymbols.get(i)));
|
currencyArrayList.add(new Currency(currencyNames.get(i), currencySymbols.get(i)));
|
||||||
}
|
}
|
||||||
|
|
||||||
adapter = new CurrencyListAdapter(this, currencyArrayList);
|
adapter = new CoinWatchlistAdapter(this, currencyArrayList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupList()
|
private void setupList()
|
||||||
|
@ -19,8 +19,6 @@ import android.view.View;
|
|||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.ImageButton;
|
import android.widget.ImageButton;
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.LinearLayout;
|
|
||||||
|
|
||||||
import com.herbron.moodl.Activities.CurrencySelectionActivity;
|
import com.herbron.moodl.Activities.CurrencySelectionActivity;
|
||||||
import com.herbron.moodl.Activities.HomeActivity;
|
import com.herbron.moodl.Activities.HomeActivity;
|
||||||
@ -42,7 +40,6 @@ import org.json.JSONObject;
|
|||||||
import static com.herbron.moodl.MoodlBox.collapseW;
|
import static com.herbron.moodl.MoodlBox.collapseW;
|
||||||
import static com.herbron.moodl.MoodlBox.expandW;
|
import static com.herbron.moodl.MoodlBox.expandW;
|
||||||
import static com.herbron.moodl.MoodlBox.getColor;
|
import static com.herbron.moodl.MoodlBox.getColor;
|
||||||
import static java.lang.Math.abs;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Tiji on 13/04/2018.
|
* Created by Tiji on 13/04/2018.
|
||||||
|
@ -1,34 +1,60 @@
|
|||||||
package com.herbron.moodl.Activities;
|
package com.herbron.moodl.Activities;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.design.widget.TabLayout;
|
||||||
import android.support.design.widget.TextInputLayout;
|
import android.support.design.widget.TextInputLayout;
|
||||||
|
import android.support.v4.view.PagerAdapter;
|
||||||
|
import android.support.v4.view.ViewPager;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.support.v7.graphics.Palette;
|
||||||
import android.support.v7.widget.SearchView;
|
import android.support.v7.widget.SearchView;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
|
import android.text.Editable;
|
||||||
|
import android.text.TextWatcher;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.AutoCompleteTextView;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
import android.widget.DatePicker;
|
import android.widget.DatePicker;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TabWidget;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.TimePicker;
|
import android.widget.TimePicker;
|
||||||
|
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
||||||
|
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyDetailsList;
|
||||||
import com.herbron.moodl.DataManagers.CurrencyData.Transaction;
|
import com.herbron.moodl.DataManagers.CurrencyData.Transaction;
|
||||||
import com.herbron.moodl.DataManagers.DatabaseManager;
|
import com.herbron.moodl.DataManagers.DatabaseManager;
|
||||||
import com.herbron.moodl.DataManagers.PreferencesManager;
|
import com.herbron.moodl.DataManagers.PreferencesManager;
|
||||||
|
import com.herbron.moodl.LayoutManagers.CoinSummaryListAdapter;
|
||||||
|
import com.herbron.moodl.LayoutManagers.CustomTabLayout;
|
||||||
|
import com.herbron.moodl.LayoutManagers.RecordTransactionPageAdapter;
|
||||||
|
import com.herbron.moodl.MoodlBox;
|
||||||
import com.herbron.moodl.PlaceholderManager;
|
import com.herbron.moodl.PlaceholderManager;
|
||||||
import com.herbron.moodl.R;
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import static com.herbron.moodl.MoodlBox.getColor;
|
||||||
|
|
||||||
public class RecordTransactionActivity extends AppCompatActivity {
|
public class RecordTransactionActivity extends AppCompatActivity {
|
||||||
|
|
||||||
private String coin;
|
private String coin;
|
||||||
@ -49,14 +75,12 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
|||||||
private Currency currency;
|
private Currency currency;
|
||||||
private int transactionId;
|
private int transactionId;
|
||||||
|
|
||||||
private SearchView mainSearchView;
|
private Toolbar toolbar;
|
||||||
|
private ImageView currencyIconImageView;
|
||||||
|
|
||||||
@Override
|
private CurrencyDetailsList currencyDetailsList;
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
|
||||||
MenuInflater inflater = getMenuInflater();
|
private SearchView mainSearchView;
|
||||||
inflater.inflate(R.menu.menu_record_action, menu);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*@Override
|
/*@Override
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
@ -171,10 +195,134 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
transactionId = intent.getIntExtra("transactionId", -1);
|
transactionId = intent.getIntExtra("transactionId", -1);
|
||||||
|
|
||||||
Toolbar toolbar = findViewById(R.id.searchCurrencyToolbar);
|
toolbar = findViewById(R.id.toolbar);
|
||||||
|
|
||||||
|
currencyIconImageView = findViewById(R.id.currencyIconImageView);
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
|
setupAutoCompleteTextView();
|
||||||
|
|
||||||
|
setupBackButton();
|
||||||
|
|
||||||
|
CustomTabLayout tabLayout = findViewById(R.id.transactionsTabLayout);
|
||||||
|
tabLayout.addTab(0, "Buy");
|
||||||
|
tabLayout.addTab(1, "Sell");
|
||||||
|
tabLayout.addTab(2, "Transfer");
|
||||||
|
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
|
||||||
|
|
||||||
|
final ViewPager viewPager = findViewById(R.id.transactionsViewPager);
|
||||||
|
final RecordTransactionPageAdapter pageAdapter = new RecordTransactionPageAdapter(getSupportFragmentManager(), tabLayout.getTabCount());
|
||||||
|
viewPager.setAdapter(pageAdapter);
|
||||||
|
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
|
||||||
|
tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
|
viewPager.setCurrentItem(tab.getPosition());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabUnselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabReselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setupAutoCompleteTextView()
|
||||||
|
{
|
||||||
|
currencyDetailsList = CurrencyDetailsList.getInstance(this);
|
||||||
|
|
||||||
|
CoinSummaryListAdapter adapter = new CoinSummaryListAdapter(this, R.layout.custom_summary_coin_row, new ArrayList<>(currencyDetailsList.getCurrenciesDenomination()));
|
||||||
|
|
||||||
|
AutoCompleteTextView coin_autoCompleteTextView = findViewById(R.id.coin_autoCompleteTextView);
|
||||||
|
coin_autoCompleteTextView.setThreshold(0);
|
||||||
|
coin_autoCompleteTextView.setAdapter(adapter);
|
||||||
|
coin_autoCompleteTextView.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
coin_autoCompleteTextView.addTextChangedListener(new TextWatcher() {
|
||||||
|
@Override
|
||||||
|
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||||
|
currencyIconImageView.setImageBitmap(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterTextChanged(Editable s) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
coin_autoCompleteTextView.setOnFocusChangeListener(new View.OnFocusChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onFocusChange(View v, boolean hasFocus) {
|
||||||
|
if(hasFocus)
|
||||||
|
{
|
||||||
|
coin_autoCompleteTextView.showDropDown();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
coin_autoCompleteTextView.dismissDropDown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
coin_autoCompleteTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
||||||
|
Currency currency = (Currency) coin_autoCompleteTextView.getAdapter().getItem(position);
|
||||||
|
|
||||||
|
coin_autoCompleteTextView.setText(PlaceholderManager.getDenomination(currency.getName(), currency.getSymbol(), getBaseContext()));
|
||||||
|
toolbar.requestFocus();
|
||||||
|
hideSoftKeyboard(RecordTransactionActivity.this);
|
||||||
|
|
||||||
|
RecordTransactionActivity.this.currency = currency;
|
||||||
|
|
||||||
|
IconDownloaderTask iconDownloaderTask = new IconDownloaderTask();
|
||||||
|
iconDownloaderTask.execute();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private class IconDownloaderTask extends AsyncTask<Void, Void, Void> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Void doInBackground(Void... voids) {
|
||||||
|
String iconUrl = MoodlBox.getIconUrl(currency.getSymbol(), 500, currencyDetailsList);
|
||||||
|
|
||||||
|
if(iconUrl != null)
|
||||||
|
{
|
||||||
|
MoodlBox.getBitmapFromURL(iconUrl, currency.getSymbol(), getResources(), getBaseContext(), new HomeActivity.IconCallBack() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Bitmap bitmapIcon) {
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
currencyIconImageView.setImageBitmap(bitmapIcon);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
currencyIconImageView.setBackground(getResources().getDrawable(R.mipmap.ic_launcher_moodl));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*if(transactionId != -1)
|
/*if(transactionId != -1)
|
||||||
{
|
{
|
||||||
setTitle(PlaceholderManager.getEditTransactionString(coin, getBaseContext()));
|
setTitle(PlaceholderManager.getEditTransactionString(coin, getBaseContext()));
|
||||||
@ -222,6 +370,13 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
|||||||
purchasedPriceEditText.setText(price);
|
purchasedPriceEditText.setText(price);
|
||||||
}
|
}
|
||||||
}, calendar.getTimeInMillis() / 1000);*/
|
}, calendar.getTimeInMillis() / 1000);*/
|
||||||
|
|
||||||
|
public static void hideSoftKeyboard(Activity activity) {
|
||||||
|
InputMethodManager inputMethodManager =
|
||||||
|
(InputMethodManager) activity.getSystemService(
|
||||||
|
Activity.INPUT_METHOD_SERVICE);
|
||||||
|
inputMethodManager.hideSoftInputFromWindow(
|
||||||
|
activity.getCurrentFocus().getWindowToken(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*private void initializeButtons()
|
/*private void initializeButtons()
|
||||||
@ -272,6 +427,17 @@ public class RecordTransactionActivity extends AppCompatActivity {
|
|||||||
transferButton = findViewById(R.id.transfertButton);
|
transferButton = findViewById(R.id.transfertButton);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
private void setupBackButton()
|
||||||
|
{
|
||||||
|
ImageButton backButton = findViewById(R.id.back_button);
|
||||||
|
backButton.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void createDatePicker()
|
private void createDatePicker()
|
||||||
{
|
{
|
||||||
new android.app.DatePickerDialog(
|
new android.app.DatePickerDialog(
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.herbron.moodl.Activities.RecordTransactionFragments;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
|
public class BuyFragment extends Fragment {
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_buy, container, false);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.herbron.moodl.Activities.RecordTransactionFragments;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
|
public class SellFragment extends Fragment {
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_sell, container, false);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package com.herbron.moodl.Activities.RecordTransactionFragments;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
|
public class TransferFragment extends Fragment {
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
View view = inflater.inflate(R.layout.fragment_transfer, container, false);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
|
}
|
@ -167,6 +167,23 @@ public class CurrencyDetailsList {
|
|||||||
return currenciesName;
|
return currenciesName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Currency> getCurrenciesDenomination()
|
||||||
|
{
|
||||||
|
List<Currency> currencies = new ArrayList<>();
|
||||||
|
|
||||||
|
for(String symbol : coinInfosHashmap.keySet())
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject(coinInfosHashmap.get(symbol));
|
||||||
|
currencies.add(new Currency(jsonObject.getString("CoinName"), symbol));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return currencies;
|
||||||
|
}
|
||||||
|
|
||||||
public Currency getCurrencyDetailsFromSymbol(String symbol)
|
public Currency getCurrencyDetailsFromSymbol(String symbol)
|
||||||
{
|
{
|
||||||
//Currency currency = new Currency();
|
//Currency currency = new Currency();
|
||||||
|
@ -56,7 +56,8 @@ public class BinanceManager extends Exchange {
|
|||||||
{
|
{
|
||||||
if(Double.parseDouble(assets.get(i).getFree()) > 0 || Double.parseDouble(assets.get(i).getLocked()) > 0)
|
if(Double.parseDouble(assets.get(i).getFree()) > 0 || Double.parseDouble(assets.get(i).getLocked()) > 0)
|
||||||
{
|
{
|
||||||
if(!assets.get(i).getAsset().equals("VET"))
|
//balance.add(new Currency(assets.get(i).getAsset(), Double.parseDouble(assets.get(i).getFree()) + Double.parseDouble(assets.get(i).getLocked())));
|
||||||
|
if(!assets.get(i).getAsset().equals("VEN"))
|
||||||
{
|
{
|
||||||
balance.add(new Currency(assets.get(i).getAsset(), Double.parseDouble(assets.get(i).getFree()) + Double.parseDouble(assets.get(i).getLocked())));
|
balance.add(new Currency(assets.get(i).getAsset(), Double.parseDouble(assets.get(i).getFree()) + Double.parseDouble(assets.get(i).getLocked())));
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,120 @@
|
|||||||
|
package com.herbron.moodl.LayoutManagers;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
|
import android.widget.Filter;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.herbron.moodl.DataManagers.CurrencyData.Currency;
|
||||||
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class CoinSummaryListAdapter extends ArrayAdapter<Currency> {
|
||||||
|
|
||||||
|
private CustomFilter filter;
|
||||||
|
private ArrayList<Currency> currencies, suggestions;
|
||||||
|
|
||||||
|
public CoinSummaryListAdapter(@NonNull Context context, int resource, @NonNull ArrayList<Currency> currencies) {
|
||||||
|
super(context, resource, currencies);
|
||||||
|
|
||||||
|
this.currencies = currencies;
|
||||||
|
this.suggestions = currencies;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return currencies.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Currency getItem(int position) {
|
||||||
|
return currencies.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return currencies.indexOf(getItem(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public View getView(int position, @Nullable View convertView, @NonNull ViewGroup parent) {
|
||||||
|
Currency currency = getItem(position);
|
||||||
|
|
||||||
|
if(convertView == null)
|
||||||
|
{
|
||||||
|
convertView = LayoutInflater.from(getContext()).inflate(R.layout.custom_summary_coin_row, parent, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
TextView nameTxtview = convertView.findViewById(R.id.currencyName);
|
||||||
|
TextView symbolTxtView = convertView.findViewById(R.id.currencySymbol);
|
||||||
|
|
||||||
|
nameTxtview.setText(currency.getName());
|
||||||
|
symbolTxtView.setText(currency.getSymbol());
|
||||||
|
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Filter getFilter() {
|
||||||
|
if(filter == null)
|
||||||
|
{
|
||||||
|
filter = new CustomFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
return filter;
|
||||||
|
}
|
||||||
|
|
||||||
|
class CustomFilter extends Filter
|
||||||
|
{
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected FilterResults performFiltering(CharSequence constraint) {
|
||||||
|
FilterResults results = new FilterResults();
|
||||||
|
|
||||||
|
if(constraint != null && constraint.length() > 0)
|
||||||
|
{
|
||||||
|
constraint = constraint.toString().toLowerCase();
|
||||||
|
|
||||||
|
ArrayList<Currency> filters = new ArrayList<>();
|
||||||
|
|
||||||
|
for(int i = 0; i < suggestions.size(); i++)
|
||||||
|
{
|
||||||
|
if(suggestions.get(i).getName().toLowerCase().contains(constraint) || suggestions.get(i).getSymbol().toLowerCase().contains(constraint))
|
||||||
|
{
|
||||||
|
Currency currency = new Currency(suggestions.get(i).getName(), suggestions.get(i).getSymbol());
|
||||||
|
|
||||||
|
filters.add(currency);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
results.count = filters.size();
|
||||||
|
results.values = filters;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
results.count = suggestions.size();
|
||||||
|
results.values = suggestions;
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||||
|
if(results != null)
|
||||||
|
{
|
||||||
|
currencies = (ArrayList<Currency>) results.values;
|
||||||
|
}
|
||||||
|
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -19,13 +19,13 @@ import java.util.ArrayList;
|
|||||||
* Created by Guitoune on 17/01/2018.
|
* Created by Guitoune on 17/01/2018.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class CurrencyListAdapter extends BaseAdapter implements Filterable {
|
public class CoinWatchlistAdapter extends BaseAdapter implements Filterable {
|
||||||
|
|
||||||
private ArrayList<Currency> currencies, suggestions;
|
private ArrayList<Currency> currencies, suggestions;
|
||||||
private Context context;
|
private Context context;
|
||||||
private CustomFilter filter;
|
private CustomFilter filter;
|
||||||
|
|
||||||
public CurrencyListAdapter(Context context, ArrayList<Currency> currencies) {
|
public CoinWatchlistAdapter(Context context, ArrayList<Currency> currencies) {
|
||||||
this.context = context;
|
this.context = context;
|
||||||
this.currencies = currencies;
|
this.currencies = currencies;
|
||||||
this.suggestions = currencies;
|
this.suggestions = currencies;
|
||||||
@ -53,7 +53,7 @@ public class CurrencyListAdapter extends BaseAdapter implements Filterable {
|
|||||||
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
|
||||||
|
|
||||||
if (convertView == null) {
|
if (convertView == null) {
|
||||||
convertView = inflater.inflate(R.layout.custom_currency_row, parent, false);
|
convertView = inflater.inflate(R.layout.custom_watchlist_coin_row, parent, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView currencyName = convertView.findViewById(R.id.currencyName);
|
TextView currencyName = convertView.findViewById(R.id.currencyName);
|
@ -0,0 +1,86 @@
|
|||||||
|
package com.herbron.moodl.LayoutManagers;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.drawable.StateListDrawable;
|
||||||
|
import android.support.design.widget.TabLayout;
|
||||||
|
import android.support.v4.content.ContextCompat;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.herbron.moodl.R;
|
||||||
|
|
||||||
|
public class CustomTabLayout extends TabLayout {
|
||||||
|
|
||||||
|
private LinearLayout linearLayout;
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
public CustomTabLayout(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
linearLayout = (LinearLayout) getChildAt(0);
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
private StateListDrawable getSellStateListDrawable() {
|
||||||
|
StateListDrawable sld = new StateListDrawable();
|
||||||
|
sld.addState(new int[] {android.R.attr.state_pressed},
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.record_transaction_tab_background_sell));
|
||||||
|
sld.addState(new int[] {android.R.attr.state_selected},
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.record_transaction_tab_background_sell));
|
||||||
|
sld.addState(new int[] { },
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.unselected_tab_background));
|
||||||
|
return sld;
|
||||||
|
}
|
||||||
|
|
||||||
|
private StateListDrawable getBuyStateListDrawable() {
|
||||||
|
StateListDrawable sld = new StateListDrawable();
|
||||||
|
sld.addState(new int[] {android.R.attr.state_pressed},
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.record_transaction_tab_background_buy));
|
||||||
|
sld.addState(new int[] {android.R.attr.state_selected},
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.record_transaction_tab_background_buy));
|
||||||
|
sld.addState(new int[] { },
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.unselected_tab_background));
|
||||||
|
return sld;
|
||||||
|
}
|
||||||
|
|
||||||
|
private StateListDrawable getTransferStateListDrawable() {
|
||||||
|
StateListDrawable sld = new StateListDrawable();
|
||||||
|
sld.addState(new int[] {android.R.attr.state_pressed},
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.record_transaction_tab_background_transfer));
|
||||||
|
sld.addState(new int[] {android.R.attr.state_selected},
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.record_transaction_tab_background_transfer));
|
||||||
|
sld.addState(new int[] { },
|
||||||
|
ContextCompat.getDrawable(context, R.drawable.unselected_tab_background));
|
||||||
|
return sld;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addTab(int index, String label) {
|
||||||
|
TextView textView = new TextView(context);
|
||||||
|
textView.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 14);
|
||||||
|
textView.setText(label);
|
||||||
|
textView.setGravity(GRAVITY_CENTER);
|
||||||
|
addTab(newTab().setCustomView(textView));
|
||||||
|
|
||||||
|
View tabView = linearLayout.getChildAt(linearLayout.getChildCount() - 1);
|
||||||
|
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) tabView.getLayoutParams();
|
||||||
|
params.setMargins(2, 0, 2, 0);
|
||||||
|
tabView.setLayoutParams(params);
|
||||||
|
|
||||||
|
switch (index)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
tabView.setBackground(getBuyStateListDrawable());
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
tabView.setBackground(getSellStateListDrawable());
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
tabView.setBackground(getTransferStateListDrawable());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
package com.herbron.moodl.LayoutManagers;
|
||||||
|
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.app.FragmentManager;
|
||||||
|
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||||
|
|
||||||
|
import com.herbron.moodl.Activities.RecordTransactionFragments.BuyFragment;
|
||||||
|
import com.herbron.moodl.Activities.RecordTransactionFragments.SellFragment;
|
||||||
|
import com.herbron.moodl.Activities.RecordTransactionFragments.TransferFragment;
|
||||||
|
|
||||||
|
public class RecordTransactionPageAdapter extends FragmentStatePagerAdapter {
|
||||||
|
|
||||||
|
private int tabsNumber;
|
||||||
|
|
||||||
|
public RecordTransactionPageAdapter(FragmentManager fm, int tabsNumber) {
|
||||||
|
super(fm);
|
||||||
|
|
||||||
|
this.tabsNumber = tabsNumber;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Fragment getItem(int position) {
|
||||||
|
|
||||||
|
switch (position)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
BuyFragment buyFragment = new BuyFragment();
|
||||||
|
return buyFragment;
|
||||||
|
case 1:
|
||||||
|
SellFragment sellFragment = new SellFragment();
|
||||||
|
return sellFragment;
|
||||||
|
case 2:
|
||||||
|
TransferFragment transferFragment = new TransferFragment();
|
||||||
|
return transferFragment;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return tabsNumber;
|
||||||
|
}
|
||||||
|
}
|
@ -34,6 +34,11 @@ public class PlaceholderManager {
|
|||||||
return formattedString;
|
return formattedString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getDenomination(String coinName, String coinSymbol, Context context)
|
||||||
|
{
|
||||||
|
return context.getResources().getString(R.string.denomincationPlaceholder, coinName, coinSymbol);
|
||||||
|
}
|
||||||
|
|
||||||
public static String getEditTransactionString(String coinName, Context context)
|
public static String getEditTransactionString(String coinName, Context context)
|
||||||
{
|
{
|
||||||
return context.getResources().getString(R.string.edit_transaction, coinName);
|
return context.getResources().getString(R.string.edit_transaction, coinName);
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<gradient
|
||||||
|
android:angle="-90"
|
||||||
|
android:centerY="2%"
|
||||||
|
android:startColor="@color/increaseCandle"
|
||||||
|
android:centerColor="@color/white"
|
||||||
|
android:endColor="@color/white"
|
||||||
|
android:type="linear"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</selector>
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<gradient
|
||||||
|
android:angle="-90"
|
||||||
|
android:centerY="2%"
|
||||||
|
android:startColor="@color/decreaseCandle"
|
||||||
|
android:centerColor="@color/white"
|
||||||
|
android:endColor="@color/white"
|
||||||
|
android:type="linear"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</selector>
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<gradient
|
||||||
|
android:angle="-90"
|
||||||
|
android:centerY="2%"
|
||||||
|
android:startColor="@color/blue"
|
||||||
|
android:centerColor="@color/white"
|
||||||
|
android:endColor="@color/white"
|
||||||
|
android:type="linear"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
</selector>
|
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<shape>
|
||||||
|
<corners android:topLeftRadius="5dp"
|
||||||
|
android:topRightRadius="5dp"/>
|
||||||
|
<solid android:color="@color/increaseCandle"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
|
||||||
|
<item android:state_selected="false" android:state_focused="false" android:state_pressed="false">
|
||||||
|
<shape>
|
||||||
|
<corners android:topRightRadius="5dp"
|
||||||
|
android:topLeftRadius="5dp"/>
|
||||||
|
<solid android:color="@color/captionColor"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<shape>
|
||||||
|
<corners android:topLeftRadius="5dp"
|
||||||
|
android:topRightRadius="5dp"/>
|
||||||
|
<solid android:color="@color/decreaseCandle"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_selected="false" android:state_focused="false" android:state_pressed="false">
|
||||||
|
<shape>
|
||||||
|
<corners android:topRightRadius="5dp"
|
||||||
|
android:topLeftRadius="5dp"/>
|
||||||
|
<solid android:color="@color/captionColor"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:state_selected="true">
|
||||||
|
<shape>
|
||||||
|
<corners android:topLeftRadius="5dp"
|
||||||
|
android:topRightRadius="5dp"/>
|
||||||
|
<solid android:color="@color/blue"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<item android:state_selected="false" android:state_focused="false" android:state_pressed="false">
|
||||||
|
<shape>
|
||||||
|
<corners android:topRightRadius="5dp"
|
||||||
|
android:topLeftRadius="5dp"/>
|
||||||
|
<solid android:color="@color/captionColor"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</selector>
|
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
<item>
|
<item>
|
||||||
<shape android:shape="rectangle">
|
<shape android:shape="rectangle">
|
||||||
<solid android:color="@color/softWhite"/>
|
<solid android:color="@color/softWhite"/>
|
||||||
|
17
app/src/main/res/drawable/unselected_tab_background.xml
Normal file
17
app/src/main/res/drawable/unselected_tab_background.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<solid android:color="@color/softWhite"/>
|
||||||
|
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="5dp"
|
||||||
|
android:topRightRadius="5dp"/>
|
||||||
|
<padding
|
||||||
|
android:left="3dp"
|
||||||
|
android:right="3dp"
|
||||||
|
android:top="3dp"
|
||||||
|
android:bottom="3dp"/>
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
@ -1,135 +1,104 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
android:background="@drawable/gradient_background"
|
||||||
tools:context="com.herbron.moodl.Activities.RecordTransactionActivity">
|
style="@style/InputActivityTheme">
|
||||||
|
|
||||||
<android.support.v7.widget.Toolbar
|
<android.support.v7.widget.Toolbar
|
||||||
android:id="@+id/searchCurrencyToolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="125dp"
|
||||||
android:background="@color/colorPrimary"
|
app:layout_collapseMode="pin"
|
||||||
android:minHeight="?attr/actionBarSize"
|
app:elevation="0dp"
|
||||||
app:theme="@style/ThemeOverlay.AppCompat.Dark" />
|
app:contentInsetLeft="0dp"
|
||||||
|
app:contentInsetStart="0dp">
|
||||||
<ListView
|
|
||||||
android:id="@+id/listViewCurrencySelection"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@+id/toolbar"/>
|
|
||||||
|
|
||||||
<!--<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:layout_margin="5dp">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="5dp">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<Button
|
<FrameLayout
|
||||||
android:id="@+id/buyButton"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_margin="10dp"
|
||||||
android:layout_weight="0.3"
|
app:layout_collapseMode="pin"
|
||||||
android:text="@string/buyText"
|
android:focusableInTouchMode="true">
|
||||||
android:background="@drawable/button_buy"
|
|
||||||
android:layout_marginEnd="2.5dp"
|
|
||||||
android:enabled="false"
|
|
||||||
android:textColor="@color/white" />
|
|
||||||
|
|
||||||
<Button
|
<ImageButton
|
||||||
android:id="@+id/sellButton"
|
android:id="@+id/back_button"
|
||||||
android:layout_width="0dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_weight="0.3"
|
android:layout_gravity="start|center_vertical"
|
||||||
android:text="@string/sellText"
|
android:background="@drawable/ic_arrow_back_white_24dp"
|
||||||
android:background="@drawable/button_sell"
|
android:text="@string/action_settings"
|
||||||
android:layout_marginStart="2.5dp"
|
android:visibility="visible" />
|
||||||
android:layout_marginEnd="2.5dp"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:enabled="true" />
|
|
||||||
|
|
||||||
<Button
|
<TextView
|
||||||
android:id="@+id/transfertButton"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="@string/title_choose_coin"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="0.3"
|
android:layout_marginBottom="22dp"
|
||||||
android:text="@string/transferText"
|
android:layout_marginEnd="12dp"
|
||||||
android:background="@drawable/button_transfer"
|
android:layout_marginStart="12dp"
|
||||||
android:layout_marginStart="2.5dp"
|
android:layout_marginTop="12dp">
|
||||||
android:textColor="@color/white"
|
|
||||||
android:enabled="true" />
|
<AutoCompleteTextView
|
||||||
|
android:id="@+id/coin_autoCompleteTextView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/spinner_background"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:hint="@string/select_coin"
|
||||||
|
android:inputType="textNoSuggestions"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:gravity="center"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/currencyIconImageView"
|
||||||
|
android:layout_width="40dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="start|center_vertical"
|
||||||
|
android:layout_margin="5dp"/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
</android.support.v7.widget.Toolbar>
|
||||||
android:id="@+id/currencySymbol"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textSize="25dp"/>
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
<LinearLayout
|
||||||
android:id="@+id/input_currency_amount"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_marginTop="125dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
<EditText
|
<com.herbron.moodl.LayoutManagers.CustomTabLayout
|
||||||
android:id="@+id/currencyAmount"
|
android:id="@+id/transactionsTabLayout"
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:hint="@string/activity_add_amount"
|
|
||||||
android:inputType="numberDecimal"/>
|
|
||||||
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
|
||||||
android:id="@+id/input_purchase_date"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/purchaseDate"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:hint="@string/activity_purchased_date"
|
|
||||||
android:focusable="false"/>
|
|
||||||
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
|
||||||
android:id="@+id/input_purchase_price"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content">
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:id="@+id/purchasePrice"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:hint="@string/activity_purchased_price"
|
|
||||||
android:inputType="numberDecimal" />
|
|
||||||
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
|
||||||
|
|
||||||
<android.support.design.widget.TextInputLayout
|
|
||||||
android:id="@+id/input_fees"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone">
|
app:tabMode="fixed"
|
||||||
|
app:tabBackground="@drawable/record_transaction_tab_background_buy"
|
||||||
|
app:tabIndicatorColor="@color/transparent"/>
|
||||||
|
|
||||||
<EditText
|
<android.support.v4.view.ViewPager
|
||||||
android:id="@+id/feesTextView"
|
android:id="@+id/transactionsViewPager"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content" />
|
||||||
android:hint="@string/activity_fees"
|
|
||||||
android:inputType="numberDecimal" />
|
|
||||||
|
|
||||||
</android.support.design.widget.TextInputLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>-->
|
|
||||||
|
|
||||||
</android.support.constraint.ConstraintLayout>
|
</android.support.constraint.ConstraintLayout>
|
31
app/src/main/res/layout/custom_summary_coin_row.xml
Normal file
31
app/src/main/res/layout/custom_summary_coin_row.xml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/currencyName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:textSize="15sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/currencySymbol"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="10dp"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:text=""
|
||||||
|
android:textColor="@color/captionColor"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -2,7 +2,6 @@
|
|||||||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
|
||||||
android:layout_margin="@dimen/margin">
|
android:layout_margin="@dimen/margin">
|
||||||
|
|
||||||
<com.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
15
app/src/main/res/layout/fragment_buy.xml
Normal file
15
app/src/main/res/layout/fragment_buy.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/record_transaction_layout_background_buy">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:text="buy fragment"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
15
app/src/main/res/layout/fragment_sell.xml
Normal file
15
app/src/main/res/layout/fragment_sell.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/record_transaction_layout_background_sell">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:text="sell fragment"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
15
app/src/main/res/layout/fragment_transfer.xml
Normal file
15
app/src/main/res/layout/fragment_transfer.xml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/record_transaction_layout_background_transfer">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:text="transfer fragment"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_centerHorizontal="true"/>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
@ -178,6 +178,8 @@
|
|||||||
<string name="currencyYenPlaceholder" translatable="false">%1$s¥</string>
|
<string name="currencyYenPlaceholder" translatable="false">%1$s¥</string>
|
||||||
<string name="fluctuationYenPercentagePlaceholder" translatable="false">%1$s¥ (%2$s%%)</string>
|
<string name="fluctuationYenPercentagePlaceholder" translatable="false">%1$s¥ (%2$s%%)</string>
|
||||||
|
|
||||||
|
<string name="denomincationPlaceholder" translatable="false">%1$s (%2$s)</string>
|
||||||
|
|
||||||
<!--DetailsActivity placeholders-->
|
<!--DetailsActivity placeholders-->
|
||||||
<string name="timestampPlaceholder">Date\n%1$s</string>
|
<string name="timestampPlaceholder">Date\n%1$s</string>
|
||||||
<string name="emitedPlaceholder">Percentage of coin emitted : %1$s%%</string>
|
<string name="emitedPlaceholder">Percentage of coin emitted : %1$s%%</string>
|
||||||
@ -256,5 +258,9 @@
|
|||||||
<string name="apiKey">API Key</string>
|
<string name="apiKey">API Key</string>
|
||||||
<string name="secretKey">Secret Key</string>
|
<string name="secretKey">Secret Key</string>
|
||||||
<string name="informations">Informations</string>
|
<string name="informations">Informations</string>
|
||||||
|
<string name="title_choose_coin">Choose a coin</string>
|
||||||
|
|
||||||
|
<!-- TODO: Remove or change this placeholder text -->
|
||||||
|
<string name="hello_blank_fragment">Hello blank fragment</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
Loading…
Reference in New Issue
Block a user