Implement new feed and subscriptions groups

- Introduce Groupie for easier lists implementations
- Use some of the new components of the Android Architecture libraries
- Add a bunch of icons for groups, using vectors, which still is
compatible with older APIs through the compatibility layer
This commit is contained in:
Mauricio Colli 2019-04-28 17:43:54 -03:00
parent e8ab5aacc7
commit 20a4bb0936
No known key found for this signature in database
GPG key ID: F200BFD6F29DDD85
143 changed files with 4099 additions and 1370 deletions

View file

@ -0,0 +1,6 @@
package org.schabi.newpipe.util
/**
* Default duration when using throttle functions across the app, in milliseconds.
*/
const val DEFAULT_THROTTLE_TIMEOUT = 120L

View file

@ -343,9 +343,13 @@ public class NavigationHelper {
.commit();
}
public static void openWhatsNewFragment(FragmentManager fragmentManager) {
public static void openFeedFragment(FragmentManager fragmentManager) {
openFeedFragment(fragmentManager, -1, null);
}
public static void openFeedFragment(FragmentManager fragmentManager, long groupId, @Nullable String groupName) {
defaultTransaction(fragmentManager)
.replace(R.id.fragment_holder, new FeedFragment())
.replace(R.id.fragment_holder, FeedFragment.newInstance(groupId, groupName))
.addToBackStack(null)
.commit();
}

View file

@ -99,6 +99,17 @@ public class ThemeHelper {
return isLightThemeSelected(context) ? R.style.LightDialogTheme : R.style.DarkDialogTheme;
}
/**
* Return a min-width dialog theme styled according to the (default) selected theme.
*
* @param context context to get the selected theme
* @return the dialog style (the default one)
*/
@StyleRes
public static int getMinWidthDialogTheme(Context context) {
return isLightThemeSelected(context) ? R.style.LightDialogMinWidthTheme : R.style.DarkDialogMinWidthTheme;
}
/**
* Return the selected theme styled according to the serviceId.
*