-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create HomeTimelineFragment that extends TweetsListFragment
- Loading branch information
Showing
3 changed files
with
55 additions
and
33 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
32 changes: 32 additions & 0 deletions
32
app/src/main/java/org/tejen/codepathandroid/twitter/fragments/HomeTimelineFragment.java
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,32 @@ | ||
package org.tejen.codepathandroid.twitter.fragments; | ||
|
||
import android.util.Log; | ||
|
||
import com.loopj.android.http.JsonHttpResponseHandler; | ||
|
||
import org.json.JSONArray; | ||
|
||
import cz.msebera.android.httpclient.Header; | ||
|
||
/** | ||
* Created by tejen on 7/6/17. | ||
*/ | ||
|
||
public class HomeTimelineFragment extends TweetsListFragment { | ||
|
||
@Override | ||
void finishTimelineFetch(long max_id, final boolean fetchMore) { | ||
client.getHomeTimeline(max_id, new JsonHttpResponseHandler() { | ||
@Override | ||
public void onSuccess(int statusCode, Header[] headers, JSONArray response) { | ||
replaceAdapterWith(response, fetchMore); | ||
} | ||
|
||
public void onFailure(Throwable e) { | ||
Log.d("DEBUG", "Fetch timeline error: " + e.toString()); | ||
} | ||
|
||
}); | ||
} | ||
|
||
} |
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