Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added second app flavour for iviewkids #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion iview/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,15 @@ android {
buildConfigField 'String', 'AUTH_URL', getAppProp('IVIEW_AUTH_URL')
buildConfigField 'String', 'API_URL', getAppProp('IVIEW_API_URL')
}
iviewkids {
applicationIdSuffix ".kids"
buildConfigField 'String', 'AUTH_URL', getAppProp('IVIEW_AUTH_URL')
buildConfigField 'String', 'API_URL', getAppProp('IVIEW_API_URL')
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':base')
}
26 changes: 15 additions & 11 deletions iview/iview.iml
Original file line number Diff line number Diff line change
Expand Up @@ -85,35 +85,39 @@
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/appDebug" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/coverage-instrumented-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dependency-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/dex-cache" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jacoco" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaResources" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/lint" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-runtime-classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental-verifier" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant-run-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/iviewkidsDebug" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/ndk" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/pre-dexed" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/proguard" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/reload-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/restart-dex" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/tmp" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="gson-2.3.1" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.5.0" level="project" />
<orderEntry type="library" exported="" name="okio-1.6.0" level="project" />
<orderEntry type="library" exported="" name="picasso-2.5.2" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="library" exported="" name="okhttp-2.5.0" level="project" />
<orderEntry type="library" exported="" name="DBFlow-Core-2.2.1" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.0.0" level="project" />
<orderEntry type="module" module-name="base" exported="" />
</component>
</module>
Binary file added iview/src/iviewkids/res/mipmap-xhdpi/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iview/src/iviewkids/res/mipmap-xhdpi/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions iview/src/iviewkids/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<color name="brand_color">#24BDB8</color>
</resources>
5 changes: 5 additions & 0 deletions iview/src/iviewkids/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<resources>
<string name="app_name">ABC Kids iview </string>
<string name="settings_description">ABC Kids iview Videos</string>

</resources>
4 changes: 2 additions & 2 deletions iview/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@

<provider
android:name="io.github.xwz.base.content.RecommendationBuilder$RecommendationBackgroundContentProvider"
android:authorities="io.github.xwz.iview.recommendation"
android:authorities="${applicationId}.recommendation"
android:exported="true"/>

<provider
android:name="io.github.xwz.iview.content.SearchContentProvider"
android:authorities="io.github.xwz.iview.search"
android:authorities="${applicationId}.search"
android:exported="true"/>

</application>
Expand Down
18 changes: 11 additions & 7 deletions iview/src/main/java/io/github/xwz/iview/api/TvShowListApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import io.github.xwz.base.ImmutableMap;
import io.github.xwz.base.api.EpisodeBaseModel;
import io.github.xwz.iview.BuildConfig;
import io.github.xwz.iview.content.ContentManager;

public class TvShowListApi extends IViewApi {
Expand Down Expand Up @@ -48,8 +49,9 @@ protected Void doInBackground(String... urls) {
}

updateProgress();
fetchTitlesFromCollection();

if(BuildConfig.FLAVOR != "iviewkids") {
fetchTitlesFromCollection();
}
for (String cat : ContentManager.CATEGORIES.keySet()) {
updateProgress();
fetchTitlesInCategory(cat);
Expand Down Expand Up @@ -96,12 +98,14 @@ private void fetchTitlesFromIndex() {
List<EpisodeBaseModel> titles = getEpisodesFromData(data, false);
Log.d(TAG, "Found " + titles.size() + " episode from index query");
for (EpisodeBaseModel title : titles) {
if (episodes.containsKey(title.getHref())) {
title.setCategories(episodes.get(title.getHref()).getCategories());
} else {
episodes.put(title.getHref(), title);
if(title.getChannel() != null && ContentManager.CHANNELS.containsKey(title.getChannel())){
if (episodes.containsKey(title.getHref())) {
title.setCategories(episodes.get(title.getHref()).getCategories());
} else {
episodes.put(title.getHref(), title);
}
shows.add(title);
}
shows.add(title);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
import io.github.xwz.base.ImmutableMap;
import io.github.xwz.base.api.EpisodeBaseModel;
import io.github.xwz.base.content.ContentManagerBase;
import io.github.xwz.iview.BuildConfig;
import io.github.xwz.iview.api.AuthApi;
import io.github.xwz.iview.api.EpisodeDetailsApi;
import io.github.xwz.iview.api.EpisodeModel;
import io.github.xwz.iview.api.TvShowListApi;

public class ContentManager extends ContentManagerBase {

public static final Map<String, String> CATEGORIES = ImmutableMap.of(
public static Map<String, String> CATEGORIES = ImmutableMap.of(
"arts", "Arts & Culture",
"comedy", "Comedy",
"docs", "Documentary",
Expand All @@ -31,7 +32,7 @@ public class ContentManager extends ContentManagerBase {
"sport", "Sport"
);

private static final Map<String, String> CHANNELS = ImmutableMap.of(
public static Map<String, String> CHANNELS = ImmutableMap.of(
"abc1", "ABC1",
"abc2", "ABC2",
"abc3", "ABC3",
Expand All @@ -41,6 +42,15 @@ public class ContentManager extends ContentManagerBase {

public ContentManager(Context context) {
super(context);
if(BuildConfig.FLAVOR == "iviewkids"){
CATEGORIES = ImmutableMap.of(

);
CHANNELS = ImmutableMap.of(
"abc3", "ABC3",
"abc4kids", "ABC4Kids"
);
}
}

private TvShowListApi fetchShows;
Expand Down