Skip to content

Commit

Permalink
Merge pull request #292 from BlythMeister/MyBetaVersion
Browse files Browse the repository at this point in the history
Fixes for Beta 4
  • Loading branch information
jamesduffy committed Sep 13, 2013
2 parents 598d72f + 6e531f5 commit 1ca9dca
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
4 changes: 2 additions & 2 deletions android/clientbeta/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.tweetlanes.android.beta"
android:versionCode="8"
android:versionName="1.2.1_b2">
android:versionCode="51"
android:versionName="1.2.1_b4">



Expand Down
2 changes: 2 additions & 0 deletions android/libraries/TweetLanesCore/res/xml/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
<change>Fix - Profile URL is now expanded from a t.co</change>
<change>Fix - Close several leaks dealing with the image loader</change>
<change>Fix - Significantly reduce overdraw in lists containing tweets</change>
<change>Fix - Force close when switching accounts</change>
<change>Fix - New tweet count on close and re-open</change>
<change>Other - Large codebase tidy-up - hopefully small improvement to performance, size and reliability</change>
</release>
<release version="1.2.0" versioncode="49">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ private void showAccount(AccountDescriptor selectedAccount, Constant.LaneType la
clearFragmentsCache();

app.setCurrentAccount(selectedAccount.getId());
mHomeLaneAdapter.notifyDataSetChanged();

// From http://stackoverflow.com/a/3419987/328679
Intent intent = getIntent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,9 @@ void fetchNewestTweets(final long sinceStatusId, Long maxStatusId) {
if (mTweetDataRefreshCallback == null) {

if (maxStatusId == null) {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
if (getActivity() != null) {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
}
mTimesFetchCalled = 0;
TwitterStatus visibleStatus = getVisibleStatus();
if (visibleStatus != null && mLastTwitterStatusIdSeen < visibleStatus.mId) {
Expand Down Expand Up @@ -360,6 +362,9 @@ public void onJumpToTop() {
}

private static final String KEY_VISIBLE_STATUS_ID = "visibleStatusId";
private static final String KEY_LAST_SEEN_STATUS_ID = "lastSeenStatusId";
private static final String KEY_HIDE_LIST_HEADING = "hideListHeading";
private static final String KEY_REFRESH_STATUS_ID = "refreshStatusId";
private static final String KEY_STATUSES = "statuses";

/*
Expand Down Expand Up @@ -428,6 +433,9 @@ public String getDataToCache() {
JSONObject object = new JSONObject();
try {
object.put(KEY_VISIBLE_STATUS_ID, visibleStatusId);
object.put(KEY_LAST_SEEN_STATUS_ID, mLastTwitterStatusIdSeen);
object.put(KEY_REFRESH_STATUS_ID, mTwitterStatusIdWhenRefreshed);
object.put(KEY_HIDE_LIST_HEADING, mHidingListHeading);
JSONArray statusArray = new JSONArray();
int statusCount = statuses.getStatusCount();
for (int i = 0; i < statusCount; ++i) {
Expand Down Expand Up @@ -458,6 +466,16 @@ boolean configureCachedStatuses() {
object = new JSONObject(cachedData);
if (object.has(KEY_VISIBLE_STATUS_ID)) {
mResumeStatusId = object.getLong(KEY_VISIBLE_STATUS_ID);
if (object.has(KEY_LAST_SEEN_STATUS_ID)) {
mLastTwitterStatusIdSeen = object.getLong(KEY_LAST_SEEN_STATUS_ID);
}
if (object.has(KEY_HIDE_LIST_HEADING)) {
mHidingListHeading = object.getBoolean(KEY_HIDE_LIST_HEADING);
}
if (object.has(KEY_REFRESH_STATUS_ID)) {
mTwitterStatusIdWhenRefreshed = object.getLong(KEY_REFRESH_STATUS_ID);
}

if (object.has(KEY_STATUSES)) {
String statusesAsString = object.getString(KEY_STATUSES);
if (statusesAsString != null) {
Expand All @@ -472,6 +490,10 @@ boolean configureCachedStatuses() {
TwitterManager.get().getFetchStatusesInstance().cacheHashtags(_mCachedStatusFeed);

setStatusFeed(_mCachedStatusFeed, false);
if (getStatusFeed() != null) {
updateListHeading(getStatusFeed().getStatusIndex(mLastTwitterStatusIdSeen));
}

return true;
}
}
Expand Down Expand Up @@ -747,7 +769,7 @@ void beginListHeadingCount() {
}

/*
*
*
*/ private final OnClickListener mListHeadingHideImageOnClickListener = new OnClickListener() {

@Override
Expand Down Expand Up @@ -775,8 +797,7 @@ void updateListHeading(int firstVisibleItem) {
TwitterStatuses twitterStatuses = getStatusFeed();
TwitterStatus status = null;

if(twitterStatuses!=null)
{
if (twitterStatuses != null) {
status = twitterStatuses.getStatus(firstVisibleItem);
}

Expand All @@ -796,7 +817,7 @@ void updateListHeading(int firstVisibleItem) {
R.string.new_posts));
} else {

if (status != null && status.mId >= mLastTwitterStatusIdSeen) {
if (status != null && status.mId >= mLastTwitterStatusIdSeen) {
mLastTwitterStatusIdSeen = status.mId;
}

Expand All @@ -806,7 +827,7 @@ void updateListHeading(int firstVisibleItem) {
}
} else {

if (status != null && status.mId >= mLastTwitterStatusIdSeen) {
if (status != null && status.mId >= mLastTwitterStatusIdSeen) {
mLastTwitterStatusIdSeen = status.mId;
}

Expand Down Expand Up @@ -919,7 +940,9 @@ private void onRefreshFinished(TwitterStatuses feed) {
}

mTweetDataRefreshCallback = null;
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
if (getActivity() != null) {
getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
}
}

/*
Expand Down Expand Up @@ -1315,17 +1338,17 @@ public void finished(TwitterFetchResult result, TwitterStatus status) {
showToast(getString(R.string.retweeted_marking_un_successful));
}
} else {
if (result.getErrorMessage() == null){
if (result.getErrorMessage() == null) {
showUnsuccessful = true;
} else if(!result.getErrorMessage().equals("CancelPressed") && !result.getErrorMessage().equals("QutotePressed")){
} else if (!result.getErrorMessage().equals("CancelPressed") && !result.getErrorMessage().equals("QutotePressed")) {
showUnsuccessful = true;
}
}
} else {
showUnsuccessful = true;
}

if(showUnsuccessful){
if (showUnsuccessful) {
showToast(getString(R.string.retweeted_un_successful));
}
}
Expand Down

0 comments on commit 1ca9dca

Please sign in to comment.