Skip to content
This repository has been archived by the owner on Aug 17, 2018. It is now read-only.

Commit

Permalink
Merged release/v0.10.7 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Malik Mann committed Mar 1, 2017
2 parents ad17243 + 896d327 commit c634b59
Show file tree
Hide file tree
Showing 32 changed files with 484 additions and 146 deletions.
110 changes: 51 additions & 59 deletions app/app.iml

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,23 @@ buildscript {
}

dependencies {
classpath "me.tatarka:gradle-retrolambda:3.5.0"
classpath "com.android.tools.build:gradle:2.2.3"
classpath "com.neenbedankt.gradle.plugins:android-apt:1.6"
}
}

// Required because retrolambda is on maven central
repositories {
mavenCentral();
jcenter();
}

apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'com.android.application' //or apply plugin: 'java'
apply plugin: 'me.tatarka.retrolambda'
apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
buildToolsVersion "25.0.2"

def versionPropsFile = file('version.properties')
def versionBuild
Expand Down Expand Up @@ -53,9 +50,9 @@ android {
defaultConfig {
applicationId "de.m4lik.burningseries"
minSdkVersion 19
targetSdkVersion 24
targetSdkVersion 25
versionCode versionBuild
versionName "0.10.6"
versionName "0.10.7"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}
Expand All @@ -81,7 +78,7 @@ android {
apply from: "dependencies.gradle"

dependencies {
compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.google.android.gms:play-services-gcm:10.2.0'
compile 'com.android.support:support-v4:25.2.0'
}
apply plugin: 'com.google.gms.google-services'
9 changes: 5 additions & 4 deletions app/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ext {
versionSupportLibrary = "25.1.0"
versionSupportLibrary = "25.2.0"
versionImmutables = "2.4.1"
}

Expand All @@ -9,18 +9,20 @@ dependencies {
compile 'com.android.support:multidex:1.0.1'

compile "com.android.support:appcompat-v7:$versionSupportLibrary"
compile "com.android.support:cardview-v7:$versionSupportLibrary"
compile "com.android.support:customtabs:$versionSupportLibrary"
compile "com.android.support:design:$versionSupportLibrary"
compile "com.android.support:percent:$versionSupportLibrary"
compile "com.android.support:recyclerview-v7:$versionSupportLibrary"
compile "com.android.support:support-v4:$versionSupportLibrary"
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'

compile 'com.devbrackets.android:exomedia:3.1.0'

compile 'com.google.android.gms:play-services-gcm:10.0.1'
compile 'com.google.android.gms:play-services-gcm:10.2.0'
compile 'com.google.code.gson:gson:2.7'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.google.firebase:firebase-core:10.0.1'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-messaging:10.0.1'

compile 'com.github.bumptech.glide:glide:3.7.0'
Expand Down Expand Up @@ -65,7 +67,6 @@ dependencies {
compile "com.google.dagger:dagger:2.8"
apt "com.google.dagger:dagger-compiler:2.8"

compile 'com.google.firebase:firebase-crash:10.0.1'
testCompile 'junit:junit:4.12'
testCompile 'com.squareup.leakcanary:leakcanary-android-no-op:1.5'
debugCompile 'com.squareup.leakcanary:leakcanary-android:1.5'
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@
</intent-filter>
</receiver>

<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/updatefileprovider"/>
</provider>

<!-- Activities -->

<activity
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/de/m4lik/burningseries/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import de.m4lik.burningseries.ui.base.ActivityBase;
import de.m4lik.burningseries.ui.mainFragments.FavsFragment;
import de.m4lik.burningseries.ui.mainFragments.GenresFragment;
import de.m4lik.burningseries.ui.mainFragments.NewsFragment;
import de.m4lik.burningseries.ui.mainFragments.SeriesFragment;
import de.m4lik.burningseries.util.Logger;
import de.m4lik.burningseries.util.Settings;
Expand Down Expand Up @@ -276,6 +277,10 @@ public boolean onNavigationItemSelected(@NonNull MenuItem item) {
logout();
break;

/*case R.id.nav_news:
setFragment("news");
break;*/

case R.id.nav_stats:
intent = new Intent(this, StatisticsActivity.class);
startActivity(intent);
Expand Down Expand Up @@ -363,6 +368,12 @@ private void setFragment(String fragment) {
transaction.commit();
visibleFragment = "favorites";
break;
case "news":
searchItem.setVisible(false);
transaction.replace(R.id.fragmentContainerMain, new NewsFragment(), "newsFragment");
transaction.commit();
visibleFragment = "news";
break;
default:
searchItem.setVisible(true);
transaction.replace(R.id.fragmentContainerMain, new SeriesFragment(), "seriesFragment");
Expand Down
66 changes: 26 additions & 40 deletions app/src/main/java/de/m4lik/burningseries/ShowActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
import android.preference.PreferenceManager;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.Toolbar;
import android.util.Log;
Expand Down Expand Up @@ -161,15 +158,11 @@ public void onClick(View view) {

public void setDefaultFragment() {

Fragment fragment = new SeasonsFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.fragmentContainerShow, fragment);
transaction.commit();
getFragmentManager().beginTransaction()
.replace(R.id.fragmentContainerShow, new SeasonsFragment())
.commit();

fragmentView = fragment.getView();

setVisibleFragment("seasons");
visibleFragment = "seasons";
}

@Override
Expand Down Expand Up @@ -254,55 +247,48 @@ public Integer getSeasonCount() {
return seasonCount;
}

public void setVisibleFragment(String visibleFragment) {
this.visibleFragment = visibleFragment;
}

public void setFragmentView(View fragmentView) {
this.fragmentView = fragmentView;
}

/*
* Fragment transactions
*/

public void switchSeasonsToEpisodes() {

FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.fragmentContainerShow, new EpisodesFragment(), "EPISODES");
transaction.commit();
getFragmentManager().beginTransaction()
.setCustomAnimations(R.animator.slide_in_right, R.animator.slide_out_left, 0, 0)
.replace(R.id.fragmentContainerShow, new EpisodesFragment())
.commit();

setVisibleFragment("episodes");
visibleFragment = "episodes";
}

public void switchEpisodesToSeasons() {

FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.fragmentContainerShow, new SeasonsFragment(), "SEASONS");
transaction.commit();
getFragmentManager().beginTransaction()
.setCustomAnimations(R.animator.slide_in_left, R.animator.slide_out_right, 0, 0)
.replace(R.id.fragmentContainerShow, new SeasonsFragment())
.commit();

setVisibleFragment("seasons");
visibleFragment = "seasons";
}

public void switchEpisodesToHosters() {
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.fragmentContainerShow, new HosterFragment(), "HOSTERS");
transaction.commit();

setVisibleFragment("hoster");
getFragmentManager().beginTransaction()
.setCustomAnimations(R.animator.slide_in_right, R.animator.slide_out_left, 0, 0)
.replace(R.id.fragmentContainerShow, new HosterFragment())
.commit();

visibleFragment = "hoster";
}

public void switchHosterToEpisodes() {
Fragment fragment = new EpisodesFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
transaction.replace(R.id.fragmentContainerShow, fragment, "EPISODES");
transaction.commit();

setVisibleFragment("episodes");
getFragmentManager().beginTransaction()
.setCustomAnimations(R.animator.slide_in_left, R.animator.slide_out_right, 0, 0)
.replace(R.id.fragmentContainerShow, new EpisodesFragment())
.commit();

visibleFragment = "episodes";
}

private void addToFavorites() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ public static abstract class genresTable implements BaseColumns {
public static final String COLUMN_NAME_GENRE = "genreName";
}

public static abstract class newsTable implements BaseColumns {
public static final String TABLE_NAME = "newsTable";
public static final String COLUMN_NAME_ID = "newsID";
public static final String COLUMN_NAME_TITLE = "newsTitle";
public static final String COLUMN_NAME_DATE = "newsDate";
public static final String COLUMN_NAME_CONTENT = "newsContent";
}

static final String SQL_CREATE_SERIES_TABLE =
"CREATE TABLE " + seriesTable.TABLE_NAME + " (" +
seriesTable._ID + " INTEGER PRIMARY KEY" + "," +
Expand All @@ -36,23 +44,35 @@ public static abstract class genresTable implements BaseColumns {
seriesTable.COLUMN_NAME_DESCR + " TEXT" + "," +
seriesTable.COLUMN_NAME_ISFAV + " INTEGER" + ")";



static final String SQL_CREATE_GENRES_TABLE =
"CREATE TABLE " + genresTable.TABLE_NAME + " (" +
genresTable._ID + " INTEGER PRIMARY KEY" + "," +
genresTable.COLUMN_NAME_ID + " INTEGER" + "," +
genresTable.COLUMN_NAME_GENRE + " TEXT" + ")";

static final String SQL_CREATE_NEWS_TABLE =
"CREATE TABLE " + newsTable.TABLE_NAME + " (" +
newsTable._ID + " INTEGER PRIMARY KEY" + "," +
newsTable.COLUMN_NAME_ID + " INTEGER" + "," +
newsTable.COLUMN_NAME_TITLE + " TEXT" + "," +
newsTable.COLUMN_NAME_DATE + " TEXT" + "," +
newsTable.COLUMN_NAME_CONTENT + " TEXT" + ")";

static final String SQL_DELETE_SERIES_TABLE =
"DROP TABLE IF EXISTS " + seriesTable.TABLE_NAME;

static final String SQL_DELETE_GENRES_TABLE =
"DROP TABLE IF EXISTS " + genresTable.TABLE_NAME;

static final String SQL_DELETE_NEWS_TABLE =
"DROP TABLE IF EXISTS " + newsTable.TABLE_NAME;

public static final String SQL_TRUNCATE_SERIES_TABLE =
"DELETE FROM " + seriesTable.TABLE_NAME;

public static final String SQL_TRUNCATE_GENRES_TABLE =
"DELETE FROM " + genresTable.TABLE_NAME;

public static final String SQL_TRUNCATE_NEWS_TABLE =
"DELETE FROM " + newsTable.TABLE_NAME;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package de.m4lik.burningseries.ui.listitems;

/**
* Created by Malik on 20.02.2017
*
* @author Malik Mann
*/

public class NewsCardItem {

private String title;
private String date;
private String content;
private Integer id;

public NewsCardItem(Integer id, String title, String date, String content) {
this.id = id;
this.title = title;
this.date = date;
this.content = content;
}

public Integer getId() {
return id;
}

public String getTitle() {
return title;
}

public String getDate() {
return date;
}

public String getContent() {
return content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class seriesListAdapter extends ArrayAdapter<ShowListItem> {
private List<ShowListItem> list;

seriesListAdapter(List<ShowListItem> list) {
super(getActivity(), R.layout.list_item_favorites, favs);
super(getActivity().getApplicationContext(), R.layout.list_item_favorites, favs);
this.list = list;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
class genresListAdapter extends ArrayAdapter<GenreListItem> {

public genresListAdapter() {
super(getActivity(), R.layout.list_item_genres, genresList);
super(getActivity().getApplicationContext(), R.layout.list_item_genres, genresList);
}

@Override
Expand Down Expand Up @@ -204,7 +204,7 @@ class seriesListAdapter extends ArrayAdapter<ShowListItem> {
private List<ShowListItem> list;

seriesListAdapter(List<ShowListItem> list) {
super(getActivity(), R.layout.list_item_series, seriesList);
super(getActivity().getApplicationContext(), R.layout.list_item_series, seriesList);
this.list = list;
}

Expand Down
Loading

0 comments on commit c634b59

Please sign in to comment.