Rework RecordTransactionActivity's UI

This commit is contained in:
Tanguy Herbron 2018-08-02 13:12:05 +02:00
parent b919e164e5
commit 10888c4c54
30 changed files with 794 additions and 132 deletions

Binary file not shown.

View File

@ -21,7 +21,7 @@ import com.herbron.moodl.DataManagers.CurrencyData.Currency;
import com.herbron.moodl.DataManagers.CurrencyData.CurrencyDetailsList;
import com.herbron.moodl.DataManagers.DatabaseManager;
import com.herbron.moodl.DataManagers.PreferencesManager;
import com.herbron.moodl.LayoutManagers.CurrencyListAdapter;
import com.herbron.moodl.LayoutManagers.CoinWatchlistAdapter;
import com.herbron.moodl.R;
import java.util.ArrayList;
@ -29,7 +29,7 @@ import java.util.List;
public class CurrencySelectionActivity extends AppCompatActivity implements SearchView.OnQueryTextListener{
private CurrencyListAdapter adapter;
private CoinWatchlistAdapter adapter;
private ListView listView;
private android.widget.Filter filter;
private CurrencyDetailsList currencyDetailsList;
@ -77,7 +77,7 @@ public class CurrencySelectionActivity extends AppCompatActivity implements Sear
currencyArrayList.add(new Currency(currencyNames.get(i), currencySymbols.get(i)));
}
adapter = new CurrencyListAdapter(this, currencyArrayList);
adapter = new CoinWatchlistAdapter(this, currencyArrayList);
}
private void setupList()

View File

@ -19,8 +19,6 @@ import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.herbron.moodl.Activities.CurrencySelectionActivity;
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.expandW;
import static com.herbron.moodl.MoodlBox.getColor;
import static java.lang.Math.abs;
/**
* Created by Tiji on 13/04/2018.

View File

@ -1,34 +1,60 @@
package com.herbron.moodl.Activities;
import android.app.Activity;
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.support.design.widget.TabLayout;
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.graphics.Palette;
import android.support.v7.widget.SearchView;
import android.support.v7.widget.Toolbar;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
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.DatePicker;
import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TabWidget;
import android.widget.TextView;
import android.widget.TimePicker;
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.DatabaseManager;
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.R;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Locale;
import static com.herbron.moodl.MoodlBox.getColor;
public class RecordTransactionActivity extends AppCompatActivity {
private String coin;
@ -49,14 +75,12 @@ public class RecordTransactionActivity extends AppCompatActivity {
private Currency currency;
private int transactionId;
private SearchView mainSearchView;
private Toolbar toolbar;
private ImageView currencyIconImageView;
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_record_action, menu);
return true;
}
private CurrencyDetailsList currencyDetailsList;
private SearchView mainSearchView;
/*@Override
public boolean onOptionsItemSelected(MenuItem item) {
@ -171,10 +195,134 @@ public class RecordTransactionActivity extends AppCompatActivity {
transactionId = intent.getIntExtra("transactionId", -1);
Toolbar toolbar = findViewById(R.id.searchCurrencyToolbar);
toolbar = findViewById(R.id.toolbar);
currencyIconImageView = findViewById(R.id.currencyIconImageView);
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)
{
setTitle(PlaceholderManager.getEditTransactionString(coin, getBaseContext()));
@ -222,6 +370,13 @@ public class RecordTransactionActivity extends AppCompatActivity {
purchasedPriceEditText.setText(price);
}
}, 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()
@ -272,6 +427,17 @@ public class RecordTransactionActivity extends AppCompatActivity {
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()
{
new android.app.DatePickerDialog(

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -167,6 +167,23 @@ public class CurrencyDetailsList {
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)
{
//Currency currency = new Currency();

View File

@ -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(!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())));
}

View File

@ -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();
}
}
}

View File

@ -19,13 +19,13 @@ import java.util.ArrayList;
* 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 Context context;
private CustomFilter filter;
public CurrencyListAdapter(Context context, ArrayList<Currency> currencies) {
public CoinWatchlistAdapter(Context context, ArrayList<Currency> currencies) {
this.context = context;
this.currencies = currencies;
this.suggestions = currencies;
@ -53,7 +53,7 @@ public class CurrencyListAdapter extends BaseAdapter implements Filterable {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
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);

View File

@ -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;
}
}
}

View File

@ -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;
}
}

View File

@ -34,6 +34,11 @@ public class PlaceholderManager {
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)
{
return context.getResources().getString(R.string.edit_transaction, coinName);

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -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>

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@color/softWhite"/>

View 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>

View File

@ -1,135 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<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_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.herbron.moodl.Activities.RecordTransactionActivity">
android:background="@drawable/gradient_background"
style="@style/InputActivityTheme">
<android.support.v7.widget.Toolbar
android:id="@+id/searchCurrencyToolbar"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:theme="@style/ThemeOverlay.AppCompat.Dark" />
<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">
android:layout_height="125dp"
app:layout_collapseMode="pin"
app:elevation="0dp"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/buyButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:text="@string/buyText"
android:background="@drawable/button_buy"
android:layout_marginEnd="2.5dp"
android:enabled="false"
android:textColor="@color/white" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
app:layout_collapseMode="pin"
android:focusableInTouchMode="true">
<Button
android:id="@+id/sellButton"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="0.3"
android:text="@string/sellText"
android:background="@drawable/button_sell"
android:layout_marginStart="2.5dp"
android:layout_marginEnd="2.5dp"
android:textColor="@color/white"
android:enabled="true" />
<ImageButton
android:id="@+id/back_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="start|center_vertical"
android:background="@drawable/ic_arrow_back_white_24dp"
android:text="@string/action_settings"
android:visibility="visible" />
<Button
android:id="@+id/transfertButton"
android:layout_width="0dp"
<TextView
android:layout_width="match_parent"
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_weight="0.3"
android:text="@string/transferText"
android:background="@drawable/button_transfer"
android:layout_marginStart="2.5dp"
android:textColor="@color/white"
android:enabled="true" />
android:layout_marginBottom="22dp"
android:layout_marginEnd="12dp"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp">
<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>
<TextView
android:id="@+id/currencySymbol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="25dp"/>
</android.support.v7.widget.Toolbar>
<android.support.design.widget.TextInputLayout
android:id="@+id/input_currency_amount"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="125dp"
android:paddingTop="5dp"
android:orientation="vertical">
<EditText
android:id="@+id/currencyAmount"
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"
<com.herbron.moodl.LayoutManagers.CustomTabLayout
android:id="@+id/transactionsTabLayout"
android:layout_width="match_parent"
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:id="@+id/feesTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/activity_fees"
android:inputType="numberDecimal" />
<android.support.v4.view.ViewPager
android:id="@+id/transactionsViewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</LinearLayout>-->
</android.support.constraint.ConstraintLayout>
</android.support.constraint.ConstraintLayout>

View 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>

View File

@ -2,7 +2,6 @@
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_margin="@dimen/margin">
<com.daimajia.swipe.SwipeLayout xmlns:android="http://schemas.android.com/apk/res/android"

View 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>

View 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>

View 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>

View File

@ -178,6 +178,8 @@
<string name="currencyYenPlaceholder" translatable="false">%1$s¥</string>
<string name="fluctuationYenPercentagePlaceholder" translatable="false">%1$s¥ (%2$s%%)</string>
<string name="denomincationPlaceholder" translatable="false">%1$s (%2$s)</string>
<!--DetailsActivity placeholders-->
<string name="timestampPlaceholder">Date\n%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="secretKey">Secret Key</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>