Front end for tabs - #690
This commit is contained in:
parent
cda2ba5450
commit
f9300c7af6
|
@ -295,6 +295,18 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
tabLayout = findViewById(R.id.tabLayout);
|
||||
|
||||
viewPager = findViewById(R.id.viewpager);
|
||||
|
||||
|
||||
final NavigationView navigationView = findViewById(R.id.nav_view);
|
||||
navigationView.setNavigationItemSelectedListener(this);
|
||||
Helper.hideMenuItem(navigationView.getMenu());
|
||||
|
||||
|
||||
toot = findViewById(R.id.toot);
|
||||
delete_all = findViewById(R.id.delete_all);
|
||||
add_new = findViewById(R.id.add_new);
|
||||
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
||||
TabLayout.Tab tabHome = tabLayout.newTab();
|
||||
TabLayout.Tab tabNotif = tabLayout.newTab();
|
||||
TabLayout.Tab tabDirect = tabLayout.newTab();
|
||||
|
@ -365,34 +377,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
iconArt.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
if (theme == Helper.THEME_DARK) {
|
||||
style = R.style.DialogDark;
|
||||
} else if (theme == Helper.THEME_BLACK){
|
||||
style = R.style.DialogBlack;
|
||||
}else {
|
||||
style = R.style.Dialog;
|
||||
}
|
||||
|
||||
displayFollowInstances();
|
||||
|
||||
if( theme == THEME_LIGHT){
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_home,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_notifications,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_direct_messages,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_people,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_public,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_color_lens,R.color.dark_icon);
|
||||
}else {
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_home,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_notifications,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_direct_messages,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_people,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_public,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_color_lens,R.color.dark_text);
|
||||
}
|
||||
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON)
|
||||
startSreaming();
|
||||
|
||||
|
||||
tabLayout.addTab(tabHome);
|
||||
|
@ -683,15 +667,6 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
}
|
||||
});
|
||||
Helper.refreshSearchTag(BaseMainActivity.this, tabLayout, adapter);
|
||||
int tabCount = tabLayout.getTabCount();
|
||||
for( int j = countPage ; j < tabCount ; j++){
|
||||
attacheDelete(j);
|
||||
}
|
||||
final NavigationView navigationView = findViewById(R.id.nav_view);
|
||||
navigationView.setNavigationItemSelectedListener(this);
|
||||
Helper.hideMenuItem(navigationView.getMenu());
|
||||
|
||||
|
||||
//Scroll to top when top bar is clicked for favourites/blocked/muted
|
||||
toolbarTitle.setOnClickListener(new View.OnClickListener() {
|
||||
|
@ -736,6 +711,250 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
}
|
||||
});
|
||||
}else if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE){
|
||||
TabLayout.Tab pTabsub = tabLayout.newTab();
|
||||
TabLayout.Tab pTabOver = tabLayout.newTab();
|
||||
TabLayout.Tab pTabTrend = tabLayout.newTab();
|
||||
TabLayout.Tab pTabAdded = tabLayout.newTab();
|
||||
TabLayout.Tab pTabLocal = tabLayout.newTab();
|
||||
|
||||
pTabsub.setCustomView(R.layout.tab_badge);
|
||||
pTabOver.setCustomView(R.layout.tab_badge);
|
||||
pTabTrend.setCustomView(R.layout.tab_badge);
|
||||
pTabAdded.setCustomView(R.layout.tab_badge);
|
||||
pTabLocal.setCustomView(R.layout.tab_badge);
|
||||
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconSub = pTabsub.getCustomView().findViewById(R.id.tab_icon);
|
||||
|
||||
iconSub.setImageResource(R.drawable.ic_subscriptions);
|
||||
|
||||
if (theme == THEME_BLACK)
|
||||
iconSub.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
else
|
||||
iconSub.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.mastodonC4), PorterDuff.Mode.SRC_IN);
|
||||
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconOver = pTabOver.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconOver.setImageResource(R.drawable.ic_overview);
|
||||
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconTrend = pTabTrend.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconTrend.setImageResource(R.drawable.ic_trending_up);
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconAdded = pTabAdded.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconAdded.setImageResource(R.drawable.ic_recently_added);
|
||||
|
||||
@SuppressWarnings("ConstantConditions") @SuppressLint("CutPasteId")
|
||||
ImageView iconLocal = pTabLocal.getCustomView().findViewById(R.id.tab_icon);
|
||||
iconLocal.setImageResource(R.drawable.ic_home);
|
||||
|
||||
|
||||
|
||||
iconSub.setContentDescription(getString(R.string.subscriptions));
|
||||
iconOver.setContentDescription(getString(R.string.overview));
|
||||
iconTrend.setContentDescription(getString(R.string.trending));
|
||||
iconAdded.setContentDescription(getString(R.string.recently_added));
|
||||
iconLocal.setContentDescription(getString(R.string.local));
|
||||
|
||||
|
||||
if (theme == THEME_LIGHT) {
|
||||
iconSub.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.action_light_header), PorterDuff.Mode.SRC_IN);
|
||||
iconOver.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.action_light_header), PorterDuff.Mode.SRC_IN);
|
||||
iconTrend.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.action_light_header), PorterDuff.Mode.SRC_IN);
|
||||
iconAdded.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.action_light_header), PorterDuff.Mode.SRC_IN);
|
||||
iconLocal.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.action_light_header), PorterDuff.Mode.SRC_IN);
|
||||
} else {
|
||||
iconSub.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconOver.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconTrend.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconAdded.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
iconLocal.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
|
||||
toot.setImageResource(R.drawable.ic_cloud_upload);
|
||||
|
||||
tabLayout.addTab(pTabsub);
|
||||
tabLayout.addTab(pTabOver);
|
||||
tabLayout.addTab(pTabTrend);
|
||||
tabLayout.addTab(pTabAdded);
|
||||
tabLayout.addTab(pTabLocal);
|
||||
|
||||
|
||||
|
||||
main_app_container = findViewById(R.id.main_app_container);
|
||||
adapter = new PagerAdapter
|
||||
(getSupportFragmentManager(), tabLayout.getTabCount());
|
||||
viewPager.setAdapter(adapter);
|
||||
viewPager.addOnPageChangeListener(new TabLayout.TabLayoutOnPageChangeListener(tabLayout));
|
||||
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||
@Override
|
||||
public void onTabSelected(TabLayout.Tab tab) {
|
||||
viewPager.setCurrentItem(tab.getPosition());
|
||||
if (stackBack.empty())
|
||||
stackBack.push(0);
|
||||
if (stackBack.contains(tab.getPosition())) {
|
||||
stackBack.remove(stackBack.indexOf(tab.getPosition()));
|
||||
stackBack.push(tab.getPosition());
|
||||
} else {
|
||||
stackBack.push(tab.getPosition());
|
||||
}
|
||||
main_app_container.setVisibility(View.GONE);
|
||||
viewPager.setVisibility(View.VISIBLE);
|
||||
delete_instance.setVisibility(View.GONE);
|
||||
Helper.switchLayout(BaseMainActivity.this);
|
||||
if( tab.getPosition() == 1 || (tabPosition.containsKey("art") && tab.getPosition() == tabPosition.get("art"))) {
|
||||
toot.hide();
|
||||
federatedTimelines.hide();
|
||||
}else {
|
||||
toot.show();
|
||||
if( !displayFollowInstance)
|
||||
federatedTimelines.hide();
|
||||
else
|
||||
federatedTimelines.show();
|
||||
}
|
||||
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||
drawer.closeDrawer(GravityCompat.START);
|
||||
if( tab.getCustomView() != null) {
|
||||
ImageView icon = tab.getCustomView().findViewById(R.id.tab_icon);
|
||||
if( icon != null)
|
||||
if( theme == THEME_BLACK)
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
else
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.mastodonC4), PorterDuff.Mode.SRC_IN);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabUnselected(TabLayout.Tab tab) {
|
||||
if( tab.getCustomView() != null) {
|
||||
ImageView icon = tab.getCustomView().findViewById(R.id.tab_icon);
|
||||
if( icon != null)
|
||||
if( theme == THEME_LIGHT)
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
else
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_text), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTabReselected(TabLayout.Tab tab) {
|
||||
if( viewPager.getVisibility() == View.GONE){
|
||||
viewPager.setVisibility(View.VISIBLE);
|
||||
delete_instance.setVisibility(View.GONE);
|
||||
Helper.switchLayout(BaseMainActivity.this);
|
||||
main_app_container.setVisibility(View.GONE);
|
||||
DrawerLayout drawer = findViewById(R.id.drawer_layout);
|
||||
drawer.closeDrawer(GravityCompat.START);
|
||||
}
|
||||
if( tab.getPosition() == 1 || (tabPosition.containsKey("art") && tab.getPosition() == tabPosition.get("art"))) {
|
||||
toot.hide();
|
||||
federatedTimelines.hide();
|
||||
}else {
|
||||
toot.show();
|
||||
if( !displayFollowInstance)
|
||||
federatedTimelines.hide();
|
||||
else
|
||||
federatedTimelines.show();
|
||||
}
|
||||
|
||||
if( viewPager.getAdapter() != null) {
|
||||
Fragment fragment = (Fragment) viewPager.getAdapter().instantiateItem(viewPager, tab.getPosition());
|
||||
|
||||
DisplayStatusFragment displayStatusFragment;
|
||||
if (tab.getPosition() == 0) {
|
||||
displayStatusFragment = ((DisplayStatusFragment) fragment);
|
||||
countNewStatus = 0;
|
||||
updateHomeCounter();
|
||||
displayStatusFragment.scrollToTop();
|
||||
displayStatusFragment.updateLastReadToot();
|
||||
} else if( tab.getPosition() == 1) {
|
||||
DisplayNotificationsFragment notificationsFragment = ((DisplayNotificationsFragment) fragment);
|
||||
countNewNotifications = 0;
|
||||
updateNotifCounter();
|
||||
notificationsFragment.scrollToTop();
|
||||
|
||||
}else if (tab.getPosition() > 1) {
|
||||
if (typePosition.containsKey(tab.getPosition()))
|
||||
updateTimeLine(typePosition.get(tab.getPosition()), 0);
|
||||
displayStatusFragment = ((DisplayStatusFragment) fragment);
|
||||
displayStatusFragment.scrollToTop();
|
||||
}
|
||||
}
|
||||
if( tab.getCustomView() != null) {
|
||||
ImageView icon = tab.getCustomView().findViewById(R.id.tab_icon);
|
||||
if( icon != null)
|
||||
if( theme == THEME_BLACK)
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.dark_icon), PorterDuff.Mode.SRC_IN);
|
||||
else
|
||||
icon.setColorFilter(ContextCompat.getColor(getApplicationContext(), R.color.mastodonC4), PorterDuff.Mode.SRC_IN);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//Scroll to top when top bar is clicked for favourites/blocked/muted
|
||||
toolbarTitle.setOnClickListener(new View.OnClickListener() {
|
||||
public void onClick(View v) {
|
||||
FragmentManager fragmentManager = getSupportFragmentManager();
|
||||
Fragment fragment = (Fragment) viewPager.getAdapter().instantiateItem(viewPager, tabLayout.getSelectedTabPosition());
|
||||
DisplayStatusFragment displayStatusFragment = ((DisplayStatusFragment) fragment);
|
||||
displayStatusFragment.scrollToTop();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (theme == Helper.THEME_DARK) {
|
||||
style = R.style.DialogDark;
|
||||
} else if (theme == Helper.THEME_BLACK){
|
||||
style = R.style.DialogBlack;
|
||||
}else {
|
||||
style = R.style.Dialog;
|
||||
}
|
||||
|
||||
displayFollowInstances();
|
||||
|
||||
if( theme == THEME_LIGHT){
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_home,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_notifications,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_direct_messages,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_people,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_public,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_color_lens,R.color.dark_icon);
|
||||
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_subscriptions,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_overview,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_trending_up,R.color.dark_icon);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_recently_added,R.color.dark_icon);
|
||||
|
||||
}else {
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_home,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_notifications,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_direct_messages,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_people,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_public,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_color_lens,R.color.dark_text);
|
||||
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_subscriptions,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_overview,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_trending_up,R.color.dark_text);
|
||||
changeDrawableColor(getApplicationContext(), R.drawable.ic_recently_added,R.color.dark_text);
|
||||
}
|
||||
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON)
|
||||
startSreaming();
|
||||
|
||||
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON)
|
||||
Helper.refreshSearchTag(BaseMainActivity.this, tabLayout, adapter);
|
||||
int tabCount = tabLayout.getTabCount();
|
||||
for( int j = countPage ; j < tabCount ; j++){
|
||||
attacheDelete(j);
|
||||
}
|
||||
|
||||
|
||||
toolbar_search.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||
|
@ -860,9 +1079,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
//Defines the current locale of the device in a static variable
|
||||
currentLocale = Helper.currentLocale(getApplicationContext());
|
||||
|
||||
toot = findViewById(R.id.toot);
|
||||
delete_all = findViewById(R.id.delete_all);
|
||||
add_new = findViewById(R.id.add_new);
|
||||
|
||||
tabLayout.getTabAt(0).select();
|
||||
toot.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -1114,7 +1331,7 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
|
||||
// Asked once for notification opt-in
|
||||
boolean popupShown = sharedpreferences.getBoolean(Helper.SET_POPUP_PUSH, false);
|
||||
if(!popupShown){
|
||||
if(!popupShown && social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON){
|
||||
AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(BaseMainActivity.this, style);
|
||||
LayoutInflater inflater = getLayoutInflater();
|
||||
@SuppressLint("InflateParams") View dialogView = inflater.inflate(R.layout.popup_quick_settings, null);
|
||||
|
@ -1168,13 +1385,15 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
};
|
||||
mamageNewIntent(getIntent());
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(receive_data, new IntentFilter(Helper.RECEIVE_DATA));
|
||||
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(receive_data, new IntentFilter(Helper.RECEIVE_DATA));
|
||||
// Retrieves instance
|
||||
new RetrieveInstanceAsyncTask(getApplicationContext(), BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
// Retrieves filters
|
||||
new ManageFiltersAsyncTask(getApplicationContext(), GET_ALL_FILTER, null, BaseMainActivity.this).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void removeSearchTab(String tag){
|
||||
|
@ -2035,9 +2254,12 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static HashMap<String, DisplayStatusFragment> tagFragment = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Page Adapter for settings
|
||||
* Page Adapter for Mastodon & Peertube
|
||||
*/
|
||||
public class PagerAdapter extends FragmentStatePagerAdapter {
|
||||
int mNumOfTabs;
|
||||
|
@ -2048,19 +2270,24 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
}
|
||||
|
||||
public void removeTabPage() {
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
||||
this.mNumOfTabs--;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
public void addTabPage(String title) {
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
||||
TabLayout.Tab tab = tabLayout.newTab();
|
||||
tab.setText(title);
|
||||
this.mNumOfTabs++;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
||||
//Remove the search bar
|
||||
if (!toolbar_search.isIconified()) {
|
||||
toolbarTitle.setVisibility(View.VISIBLE);
|
||||
|
@ -2100,11 +2327,38 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
statusFragment.setArguments(bundle);
|
||||
return statusFragment;
|
||||
}
|
||||
}else if (social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE){
|
||||
//Remove the search bar
|
||||
if( !toolbar_search.isIconified() ) {
|
||||
toolbarTitle.setVisibility(View.VISIBLE);
|
||||
tabLayout.setVisibility(View.VISIBLE);
|
||||
toolbar_search.setIconified(true);
|
||||
}
|
||||
//Selection comes from another menu, no action to do
|
||||
Bundle bundle = new Bundle();
|
||||
DisplayStatusFragment fragment = new DisplayStatusFragment();
|
||||
if (position == 0) {
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.PSUBSCRIPTIONS);
|
||||
}else if( position == 1) {
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.POVERVIEW);
|
||||
}else if( position == 2) {
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.PTRENDING);
|
||||
}else if( position == 3) {
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.PRECENTLYADDED);
|
||||
}else if( position == 4) {
|
||||
bundle.putSerializable("type", RetrieveFeedsAsyncTask.Type.PLOCAL);
|
||||
}
|
||||
|
||||
fragment.setArguments(bundle);
|
||||
return fragment;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Object instantiateItem(@NonNull ViewGroup container, int position) {
|
||||
if( social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
|
||||
Fragment createdFragment = (Fragment) super.instantiateItem(container, position);
|
||||
// save the appropriate reference depending on position
|
||||
if (position == 0) {
|
||||
|
@ -2120,8 +2374,11 @@ public abstract class BaseMainActivity extends BaseActivity
|
|||
artFragment = (DisplayStatusFragment) createdFragment;
|
||||
|
||||
}
|
||||
|
||||
return createdFragment;
|
||||
}else if( social == UpdateAccountInfoAsyncTask.SOCIAL.PEERTUBE){
|
||||
return super.instantiateItem(container, position);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -76,7 +76,12 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
|
|||
REMOTE_INSTANCE,
|
||||
ART,
|
||||
NOTIFICATION,
|
||||
PIXELFED
|
||||
PIXELFED,
|
||||
PSUBSCRIPTIONS,
|
||||
POVERVIEW,
|
||||
PTRENDING,
|
||||
PRECENTLYADDED,
|
||||
PLOCAL
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1249,7 +1249,9 @@ public class Helper {
|
|||
itemOpt.setVisible(false);
|
||||
|
||||
}else if( BaseMainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON){
|
||||
|
||||
MenuItem itemCom = menu.findItem(R.id.nav_peertube_comm);
|
||||
if( itemCom != null)
|
||||
itemCom.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM18.92,8h-2.95c-0.32,-1.25 -0.78,-2.45 -1.38,-3.56 1.84,0.63 3.37,1.91 4.33,3.56zM12,4.04c0.83,1.2 1.48,2.53 1.91,3.96h-3.82c0.43,-1.43 1.08,-2.76 1.91,-3.96zM4.26,14C4.1,13.36 4,12.69 4,12s0.1,-1.36 0.26,-2h3.38c-0.08,0.66 -0.14,1.32 -0.14,2 0,0.68 0.06,1.34 0.14,2L4.26,14zM5.08,16h2.95c0.32,1.25 0.78,2.45 1.38,3.56 -1.84,-0.63 -3.37,-1.9 -4.33,-3.56zM8.03,8L5.08,8c0.96,-1.66 2.49,-2.93 4.33,-3.56C8.81,5.55 8.35,6.75 8.03,8zM12,19.96c-0.83,-1.2 -1.48,-2.53 -1.91,-3.96h3.82c-0.43,1.43 -1.08,2.76 -1.91,3.96zM14.34,14L9.66,14c-0.09,-0.66 -0.16,-1.32 -0.16,-2 0,-0.68 0.07,-1.35 0.16,-2h4.68c0.09,0.65 0.16,1.32 0.16,2 0,0.68 -0.07,1.34 -0.16,2zM14.59,19.56c0.6,-1.11 1.06,-2.31 1.38,-3.56h2.95c-0.96,1.65 -2.49,2.93 -4.33,3.56zM16.36,14c0.08,-0.66 0.14,-1.32 0.14,-2 0,-0.68 -0.06,-1.34 -0.14,-2h3.38c0.16,0.64 0.26,1.31 0.26,2s-0.1,1.36 -0.26,2h-3.38z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M13,7h-2v4L7,11v2h4v4h2v-4h4v-2h-4L13,7zM12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zM12,20c-4.41,0 -8,-3.59 -8,-8s3.59,-8 8,-8 8,3.59 8,8 -3.59,8 -8,8z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M20,8L4,8L4,6h16v2zM18,2L6,2v2h12L18,2zM22,12v8c0,1.1 -0.9,2 -2,2L4,22c-1.1,0 -2,-0.9 -2,-2v-8c0,-1.1 0.9,-2 2,-2h16c1.1,0 2,0.9 2,2zM16,16l-6,-3.27v6.53L16,16z"/>
|
||||
</vector>
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M16,6l2.29,2.29 -4.88,4.88 -4,-4L2,16.59 3.41,18l6,-6 4,4 6.3,-6.29L22,12V6z"/>
|
||||
</vector>
|
Binary file not shown.
After Width: | Height: | Size: 331 B |
Binary file not shown.
After Width: | Height: | Size: 343 B |
Binary file not shown.
After Width: | Height: | Size: 220 B |
Binary file not shown.
After Width: | Height: | Size: 367 B |
Binary file not shown.
After Width: | Height: | Size: 510 B |
Binary file not shown.
After Width: | Height: | Size: 639 B |
|
@ -50,6 +50,19 @@
|
|||
</group>
|
||||
</menu>
|
||||
</item>
|
||||
<item
|
||||
android:title="@string/communication_menu_title"
|
||||
android:id="@+id/nav_peertube_comm"
|
||||
>
|
||||
<menu>
|
||||
<group android:checkableBehavior="single">
|
||||
<item
|
||||
android:id="@+id/nav_upload"
|
||||
android:icon="@drawable/ic_cloud_upload"
|
||||
android:title="@string/upload_video" />
|
||||
</group>
|
||||
</menu>
|
||||
</item>
|
||||
<item
|
||||
android:title="@string/neutral_menu_title"
|
||||
android:id="@+id/nav_main_opt">
|
||||
|
|
|
@ -787,6 +787,12 @@
|
|||
<string name="no_misskey_instance">No Misskey instances</string>
|
||||
<string name="misskey_instance">Misskey instance</string>
|
||||
<string name="toast_no_apps">No app supporting this link is installed on your device.</string>
|
||||
<string name="subscriptions">Subscriptions</string>
|
||||
<string name="overview">Overview</string>
|
||||
<string name="trending">Trending</string>
|
||||
<string name="recently_added">Recently added</string>
|
||||
<string name="local">Local</string>
|
||||
<string name="upload_video">Upload</string>
|
||||
<!-- end languages -->
|
||||
|
||||
</resources>
|
Loading…
Reference in New Issue