mirror of
https://github.com/mgroves/MonodroidStockPortfolio.git
synced 2025-03-18 17:00:15 -09:00
removed unnecessary views from portfolio.xml which were screwing things up
This commit is contained in:
parent
c07f913502
commit
505a87bd8c
7 changed files with 17 additions and 79 deletions
|
@ -48,7 +48,6 @@
|
||||||
<Compile Include="DictionaryExtensions.cs" />
|
<Compile Include="DictionaryExtensions.cs" />
|
||||||
<Compile Include="EnumExtensions.cs" />
|
<Compile Include="EnumExtensions.cs" />
|
||||||
<Compile Include="PortfolioRepositories\AndroidSqlitePortfolioRepository.cs" />
|
<Compile Include="PortfolioRepositories\AndroidSqlitePortfolioRepository.cs" />
|
||||||
<Compile Include="PortfolioRepositories\FakePortfolioRepository.cs" />
|
|
||||||
<Compile Include="PortfolioRepositories\IPortfolioRepository.cs" />
|
<Compile Include="PortfolioRepositories\IPortfolioRepository.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="Services\IPortfolioService.cs" />
|
<Compile Include="Services\IPortfolioService.cs" />
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using MonoStockPortfolio.Entities;
|
|
||||||
|
|
||||||
namespace MonoStockPortfolio.Core.PortfolioRepositories
|
|
||||||
{
|
|
||||||
public class FakePortfolioRepository : IPortfolioRepository
|
|
||||||
{
|
|
||||||
public IList<Portfolio> GetAllPortfolios()
|
|
||||||
{
|
|
||||||
return new List<Portfolio> {new Portfolio(1) {Name = "test portfolio"}};
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SavePortfolio(Portfolio portfolio)
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeletePortfolioById(int portfolioId)
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IList<Position> GetAllPositions(long portfolioId)
|
|
||||||
{
|
|
||||||
var list = new List<Position>();
|
|
||||||
list.Add(new Position(1) { ContainingPortfolioID = 1, PricePerShare = 5, Shares = 280, Ticker = "XIN"});
|
|
||||||
list.Add(new Position(2) { ContainingPortfolioID = 1, PricePerShare = 3, Shares = 100, Ticker = "DENN"});
|
|
||||||
list.Add(new Position(3) { ContainingPortfolioID = 1, PricePerShare = 25, Shares = 300, Ticker = "MSFT"});
|
|
||||||
list.Add(new Position(4) { ContainingPortfolioID = 1, PricePerShare = 590.18M, Shares = 400, Ticker = "GOOG"});
|
|
||||||
list.Add(new Position(5) { ContainingPortfolioID = 1, PricePerShare = 330.10M, Shares = 500, Ticker = "AAPL"});
|
|
||||||
list.Add(new Position(6) { ContainingPortfolioID = 1, PricePerShare = 15.10M, Shares = 600, Ticker = "YHOO"});
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Portfolio GetPortfolioById(long portfolioId)
|
|
||||||
{
|
|
||||||
return GetAllPortfolios().First();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SavePosition(Position position)
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Portfolio GetPortfolioByName(string portfolioName)
|
|
||||||
{
|
|
||||||
return GetAllPortfolios().First(p => p.Name == portfolioName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -14,7 +14,7 @@ namespace MonoStockPortfolio.Core.Services
|
||||||
private readonly IPortfolioRepository _portRepo;
|
private readonly IPortfolioRepository _portRepo;
|
||||||
private readonly IStockDataProvider _stockRepo;
|
private readonly IStockDataProvider _stockRepo;
|
||||||
|
|
||||||
public PortfolioService(Context context) : this(new FakePortfolioRepository(),
|
public PortfolioService(Context context) : this(new AndroidSqlitePortfolioRepository(context),
|
||||||
new YahooStockDataProvider())
|
new YahooStockDataProvider())
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,7 @@ using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Android.App;
|
using Android.App;
|
||||||
using Android.Content;
|
using Android.Content;
|
||||||
using Android.Content.Res;
|
|
||||||
using Android.OS;
|
using Android.OS;
|
||||||
using Android.Util;
|
|
||||||
using Android.Views;
|
using Android.Views;
|
||||||
using Android.Widget;
|
using Android.Widget;
|
||||||
using MonoStockPortfolio.Core;
|
using MonoStockPortfolio.Core;
|
||||||
|
@ -129,7 +127,7 @@ namespace MonoStockPortfolio.Activites
|
||||||
var cell = new TextView(Context);
|
var cell = new TextView(Context);
|
||||||
cell.Text = item.Items[stockDataItem];
|
cell.Text = item.Items[stockDataItem];
|
||||||
cell.SetWidth(columnWidth);
|
cell.SetWidth(columnWidth);
|
||||||
row.AddView(cell);
|
row.AddView(cell, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent));
|
||||||
}
|
}
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,7 @@ namespace MonoStockPortfolio.Framework
|
||||||
{
|
{
|
||||||
var map = new Dictionary<Type, Func<object>>();
|
var map = new Dictionary<Type, Func<object>>();
|
||||||
map.Add(typeof(IPortfolioService), () => new PortfolioService(_context));
|
map.Add(typeof(IPortfolioService), () => new PortfolioService(_context));
|
||||||
//map.Add(typeof(IPortfolioRepository), () => new AndroidSqlitePortfolioRepository(_context));
|
map.Add(typeof(IPortfolioRepository), () => new AndroidSqlitePortfolioRepository(_context));
|
||||||
map.Add(typeof(IPortfolioRepository), () => new FakePortfolioRepository());
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,10 @@ namespace MonoStockPortfolio
|
||||||
public const int portfolioName = 2131034112;
|
public const int portfolioName = 2131034112;
|
||||||
|
|
||||||
// aapt resource value: 0x7f050009
|
// aapt resource value: 0x7f050009
|
||||||
public const int quoteListview = 2131034121;
|
public const int quoteHeaderLayout = 2131034121;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7f05000a
|
||||||
|
public const int quoteListview = 2131034122;
|
||||||
|
|
||||||
private id()
|
private id()
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,28 +4,18 @@
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="fill_parent">
|
||||||
|
|
||||||
<ScrollView
|
<Button android:id="@+id/btnAddPosition"
|
||||||
android:layout_width="fill_parent"
|
android:text="Add Position"
|
||||||
android:layout_height="fill_parent">
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_width="fill_parent" />
|
||||||
|
|
||||||
<LinearLayout android:layout_width="fill_parent"
|
<LinearLayout android:id="@+id/quoteHeaderLayout"
|
||||||
android:layout_height="fill_parent" android:orientation="vertical">
|
|
||||||
|
|
||||||
<Button android:id="@+id/btnAddPosition"
|
|
||||||
android:text="Add Position"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="fill_parent" />
|
android:layout_width="fill_parent"
|
||||||
|
android:orientation="horizontal" />
|
||||||
|
|
||||||
<LinearLayout android:id="@+id/quoteHeaderLayout"
|
<ListView android:id="@+id/quoteListview"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="fill_parent"
|
||||||
android:layout_width="fill_parent"
|
android:layout_height="wrap_content" />
|
||||||
android:orientation="horizontal" />
|
|
||||||
|
|
||||||
<ListView android:id="@+id/quoteListview"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</ScrollView>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
Loading…
Add table
Reference in a new issue