Adds the local timeline.

This commit is contained in:
Vavassor 2017-03-30 22:31:17 -04:00
parent eed3f2d899
commit 53376da406
5 changed files with 46 additions and 8 deletions

View file

@ -111,7 +111,8 @@ public class MainActivity extends BaseActivity {
String[] pageTitles = { String[] pageTitles = {
getString(R.string.title_home), getString(R.string.title_home),
getString(R.string.title_notifications), getString(R.string.title_notifications),
getString(R.string.title_public) getString(R.string.title_public_federated),
getString(R.string.title_public_local),
}; };
adapter.setPageTitles(pageTitles); adapter.setPageTitles(pageTitles);
@ -126,7 +127,8 @@ public class MainActivity extends BaseActivity {
tabLayout.getTabAt(0).setIcon(R.drawable.ic_home_24dp); tabLayout.getTabAt(0).setIcon(R.drawable.ic_home_24dp);
tabLayout.getTabAt(1).setIcon(R.drawable.ic_notifications_24dp); tabLayout.getTabAt(1).setIcon(R.drawable.ic_notifications_24dp);
tabLayout.getTabAt(2).setIcon(R.drawable.ic_public_24dp); tabLayout.getTabAt(2).setIcon(R.drawable.ic_local_24dp);
tabLayout.getTabAt(3).setIcon(R.drawable.ic_public_24dp);
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() { tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
@Override @Override
@ -167,7 +169,7 @@ public class MainActivity extends BaseActivity {
} }
} }
} }
for (int i = 0; i < 3; i++) { for (int i = 0; i < 4; i++) {
tintTab(tabLayout.getTabAt(i), i == tabSelected); tintTab(tabLayout.getTabAt(i), i == tabSelected);
} }

View file

@ -43,7 +43,8 @@ public class TimelineFragment extends SFragment implements
enum Kind { enum Kind {
HOME, HOME,
PUBLIC, PUBLIC_LOCAL,
PUBLIC_FEDERATED,
TAG, TAG,
USER, USER,
FAVOURITES FAVOURITES
@ -186,10 +187,14 @@ public class TimelineFragment extends SFragment implements
listCall = api.homeTimeline(fromId, uptoId, null); listCall = api.homeTimeline(fromId, uptoId, null);
break; break;
} }
case PUBLIC: { case PUBLIC_FEDERATED: {
listCall = api.publicTimeline(null, fromId, uptoId, null); listCall = api.publicTimeline(null, fromId, uptoId, null);
break; break;
} }
case PUBLIC_LOCAL: {
listCall = api.publicTimeline(true, fromId, uptoId, null);
break;
}
case TAG: { case TAG: {
listCall = api.hashtagTimeline(hashtagOrId, null, fromId, uptoId, null); listCall = api.hashtagTimeline(hashtagOrId, null, fromId, uptoId, null);
break; break;

View file

@ -40,7 +40,10 @@ class TimelinePagerAdapter extends FragmentPagerAdapter {
return NotificationsFragment.newInstance(); return NotificationsFragment.newInstance();
} }
case 2: { case 2: {
return TimelineFragment.newInstance(TimelineFragment.Kind.PUBLIC); return TimelineFragment.newInstance(TimelineFragment.Kind.PUBLIC_LOCAL);
}
case 3: {
return TimelineFragment.newInstance(TimelineFragment.Kind.PUBLIC_FEDERATED);
} }
default: { default: {
return null; return null;
@ -50,7 +53,7 @@ class TimelinePagerAdapter extends FragmentPagerAdapter {
@Override @Override
public int getCount() { public int getCount() {
return 3; return 4;
} }
@Override @Override

View file

@ -0,0 +1,27 @@
<vector android:height="24dp" android:viewportHeight="42.519684"
android:viewportWidth="42.519684" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="M31.89,5.82m-5.31,0a5.31,5.31 0,1 1,10.63 0a5.31,5.31 0,1 1,-10.63 0"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="square" android:strokeLineJoin="miter" android:strokeWidth="0.30000001"/>
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="M10.63,5.82m-5.31,0a5.31,5.31 0,1 1,10.63 0a5.31,5.31 0,1 1,-10.63 0"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="square" android:strokeLineJoin="miter" android:strokeWidth="0.30000001"/>
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="M21.26,23.03m-5.31,0a5.31,5.31 0,1 1,10.63 0a5.31,5.31 0,1 1,-10.63 0"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="square" android:strokeLineJoin="miter" android:strokeWidth="0.30000001"/>
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="m17.62,29.22c-2.07,1.24 -3.45,3.49 -3.45,6.08l0,3.54c0,3.93 -0.38,3.54 3.54,3.54l7.09,0c3.93,0 3.54,0.38 3.54,-3.54l0,-3.54c0,-2.59 -1.38,-4.84 -3.45,-6.08a7.19,7.19 0,0 1,-3.64 1,7.19 7.19,0 0,1 -3.64,-1z"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="square" android:strokeLineJoin="miter" android:strokeWidth="0.30000001"/>
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="m28.25,12.04c-1.69,1.01 -2.91,2.72 -3.3,4.72a7.28,7.28 0,0 1,3.59 6.27,7.28 7.28,0 0,1 -0.33,2.18c0.06,-0 0.08,0 0.14,0l7.09,0c3.93,0 3.54,0.38 3.54,-3.54l0,-3.54c0,-2.59 -1.38,-4.84 -3.45,-6.08a7.19,7.19 0,0 1,-3.64 1,7.19 7.19,0 0,1 -3.64,-1z"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="square" android:strokeLineJoin="miter" android:strokeWidth="0.30000001"/>
<path android:fillAlpha="1" android:fillColor="#ffffff"
android:pathData="m6.99,12.04c-2.07,1.24 -3.45,3.49 -3.45,6.08l0,3.54c0,3.93 -0.38,3.54 3.54,3.54l7.09,0c0.07,0 0.08,-0 0.15,0a7.28,7.28 0,0 1,-0.34 -2.18,7.28 7.28,0 0,1 3.59,-6.27c-0.39,-2.01 -1.61,-3.71 -3.3,-4.72a7.19,7.19 0,0 1,-3.64 1,7.19 7.19,0 0,1 -3.64,-1z"
android:strokeAlpha="1" android:strokeColor="#00000000"
android:strokeLineCap="square" android:strokeLineJoin="miter" android:strokeWidth="0.30000001"/>
</vector>

View file

@ -23,7 +23,8 @@
<string name="title_home">Home</string> <string name="title_home">Home</string>
<string name="title_notifications">Notifications</string> <string name="title_notifications">Notifications</string>
<string name="title_public">Public</string> <string name="title_public_local">Local</string>
<string name="title_public_federated">Federated</string>
<string name="title_thread">Thread</string> <string name="title_thread">Thread</string>
<string name="title_tag">#%s</string> <string name="title_tag">#%s</string>
<string name="title_statuses">Posts</string> <string name="title_statuses">Posts</string>