Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Miguel de Icaza
authored and
Miguel de Icaza
committed
May 17, 2010
0 parents
commit 2ba11af
Showing
46 changed files
with
5,782 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
TweetStation | ||
|
||
TweetStation was originally a sample program that I created | ||
for my own use. I was a fan of the older UI in Echofon and | ||
liked many of the elements of Tweetie2, but like every | ||
programmer, I wanted to make some changes. | ||
|
||
It was also a test bed for testing APIs and answering | ||
MonoTouch users's questions. It is the original application | ||
that lead to the creation of MonoTouch.Dialog, as I figured | ||
that there should be a better way of constructing dialog boxes | ||
than creating models and delegates left and right. | ||
|
||
TweetStation is an open source, MIT X11 licensed twitter | ||
client written for MonoTouch. | ||
|
||
Design Goals | ||
============ | ||
|
||
Exceptions | ||
|
||
The code uses try/catch extensively in the code in areas that | ||
have to process data from twitter, I assume that the data | ||
might be broken or that my original assumptions or their | ||
documentation might be wrong. You will notice in the code | ||
that all exceptions are printed out, I want to keep that this | ||
way for that reason. | ||
|
||
MonoTouch.Dialog | ||
|
||
Most of the UI was created with MonoTouch.Dialog and various | ||
custom views and Elements designed for twitter. There is not | ||
a single UITableView coded in the traditional style. | ||
|
||
Memory Usage | ||
|
||
In some parts of the code I tried to minimize memory usage by | ||
not creating thousands of objects that would be thrown out | ||
(Tweet parsing for example), so I just recycle some instances | ||
sometimes. | ||
|
||
Singletons | ||
|
||
There are a handful of singleton classes as well, I tend to | ||
reset those instead of creating new instances as they would | ||
avoid creating expensive objects or objects that are known to | ||
leak in CocoaTouch anyways. | ||
|
||
Pending Task Queue | ||
|
||
I never know if a tweet has been starred or not when there is | ||
no network connectivity. With TweetStation all the pending | ||
requests are kept in a queue and flushed at periodic intervals. | ||
|
||
This is used both to post tweets and favorite posts, allowing | ||
the settings to take place right away, even if there is no | ||
network connectivity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
* Missing Stuff | ||
Refresh user pictures when they change. | ||
Currently, once we download a pic, we never update it | ||
|
||
Protocol: | ||
When posting a tweet, the POST data result should | ||
be added to the main view. | ||
|
||
When favoriting/unfavoriting, we need to add those | ||
tweets to Favorites tab, or recompute that tab | ||
on demand. | ||
|
||
TweetCell: Use only Draw calls? | ||
|
||
On Load: | ||
Hook up "Load more" and add better artwork | ||
Custom control to show "Load more" with some better artwork | ||
Support removal of the control on load, instead than on tap, | ||
to give a visual cue of what is happening. | ||
|
||
Search text | ||
With history of previous searches | ||
Nearby tweets | ||
Goto user | ||
composer: | ||
Sending Direct Messages | ||
Uploading pictures | ||
Looking up the list of friends | ||
TweetCell - Main Display | ||
Show star info, geo info, and pic info? | ||
|
||
Remove old tweets from the database, 2 week old tweets? | ||
Showing User Pictures | ||
Loading medium sized picture | ||
Add picture shadow | ||
Chicken noises for reload | ||
Music for composing | ||
Turning a search into a saved search | ||
Lists: | ||
Instead of managing lists, be able to "add user to list" in the UI in the profile view. | ||
Delete from list. | ||
Edit, Delete, Info | ||
Special List timeline controller that lets edit | ||
User profile: | ||
Red Color for Blocking users | ||
Showing first joined twitter | ||
Listing friends | ||
Listing followers | ||
Merge friends + followers in a single cell to save space? | ||
Showing a map for the user profile | ||
Show if the tweet is protected/user protected | ||
Account editor | ||
New accont | ||
Hooking up OAuth | ||
Show timeline separator (like tweetie, after X hours shows a gap) | ||
Reloads on gap | ||
Remember last tab | ||
FullProfileView | ||
Needs an animating element while loading data from the network, | ||
|
||
* Post 1.0: | ||
|
||
Direct Messages special view | ||
Grouped per user, blend conversation together | ||
|
||
* Http Stack | ||
|
||
Since all calls to the twitter API are to the same server, | ||
we should have an API that serializes all calls, maybe even | ||
reuses the WebClient instance. | ||
|
||
WebClient does not use the ThreadPool, instead it uses a | ||
new thread, perhaps move to HttpWebRequest? | ||
|
||
Need HttpWebRequest for POST anyways (needed for inserting | ||
the result of a post). | ||
|
||
Should support high-priority vs low-priority requests. Some | ||
operations like trend fetching do not have to be a top | ||
priority. | ||
|
||
* Idea: Memory management | ||
|
||
Modify the TImelineController to reload data on demand, | ||
since CocoaTouch does not really kill leaf instances | ||
of view controllers so we can end up carrying a lot of | ||
data around. | ||
|
||
Problem: we can only do this if a child is not currently | ||
visible. | ||
|
||
* ImageStore: | ||
|
||
Support downloading different kinds of image sizes | ||
The 73x73 image for large views | ||
The full version for full display | ||
|
||
* TweetDetail | ||
|
||
Put a border around the image loaded. | ||
Add support for loading twitpic images. | ||
|
||
|
||
* Application | ||
|
||
Remember where we are (drilled down on a tweet? or search) | ||
|
||
* Accounts | ||
|
||
Link to create account | ||
|
||
Support OAuth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 10.00 | ||
# Visual Studio 2008 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TweetStation", "TweetStation\TweetStation.csproj", "{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoTouch.Dialog", "..\MonoTouch.Dialog\MonoTouch.Dialog\MonoTouch.Dialog.csproj", "{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|iPhoneSimulator = Debug|iPhoneSimulator | ||
Release|iPhoneSimulator = Release|iPhoneSimulator | ||
Debug|iPhone = Debug|iPhone | ||
Release|iPhone = Release|iPhone | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}.Debug|iPhone.ActiveCfg = Debug|iPhone | ||
{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}.Debug|iPhone.Build.0 = Debug|iPhone | ||
{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator | ||
{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator | ||
{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}.Release|iPhone.ActiveCfg = Release|iPhone | ||
{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}.Release|iPhone.Build.0 = Release|iPhone | ||
{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator | ||
{3FFBFFF8-5560-4EDE-82E5-3FFDFBBA8A50}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator | ||
{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}.Debug|iPhone.ActiveCfg = Debug|iPhone | ||
{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}.Debug|iPhone.Build.0 = Debug|iPhone | ||
{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator | ||
{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator | ||
{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}.Release|iPhone.ActiveCfg = Release|iPhone | ||
{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}.Release|iPhone.Build.0 = Release|iPhone | ||
{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator | ||
{7C7D3161-2DFB-4201-B70E-88ACD3976AA9}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator | ||
EndGlobalSection | ||
GlobalSection(MonoDevelopProperties) = preSolution | ||
StartupItem = TweetStation\TweetStation.csproj | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System; | ||
using SQLite; | ||
|
||
namespace TweetStation | ||
{ | ||
public class Database : SQLiteConnection { | ||
internal Database (string file) : base (file) | ||
{ | ||
CreateTable<TwitterAccount> (); | ||
CreateTable<TwitterAccount.QueuedTask> (); | ||
CreateTable<Tweet> (); | ||
CreateTable<User> (); | ||
} | ||
|
||
static Database () | ||
{ | ||
System.IO.File.Delete ("tweets.db"); | ||
Main = new Database ("tweets.db"); | ||
} | ||
|
||
static public Database Main { get; private set; } | ||
} | ||
} | ||
|
Oops, something went wrong.