Skip to content

Commit

Permalink
213
Browse files Browse the repository at this point in the history
  • Loading branch information
jordyamc committed Jun 14, 2017
1 parent e35a80c commit 4ad39dc
Show file tree
Hide file tree
Showing 52 changed files with 664 additions and 189 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified app/app-release.apk
Binary file not shown.
139 changes: 100 additions & 39 deletions app/app.iml

Large diffs are not rendered by default.

34 changes: 26 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ repositories {
apply plugin: 'io.fabric'

android {
compileSdkVersion 25
compileSdkVersion 26
buildToolsVersion '26.0.0-rc2'
defaultConfig {
applicationId "knf.animeflv"
minSdkVersion 17
targetSdkVersion 25
versionCode 212
versionName "5.0.1"
targetSdkVersion 26
versionCode 213
versionName "5.1.0"
multiDexEnabled = true
}
buildTypes {
Expand Down Expand Up @@ -73,22 +73,37 @@ allprojects {
url "https://jitpack.io"
}
maven { url 'https://maven.fabric.io/public' }
maven {
url "https://maven.google.com"
}
}
}

configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.0-beta2'
}
}
}
}

dependencies {
debugCompile 'com.amitshekhar.android:debug-db:1.0.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.6@aar') {
/*compile('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.10.6@aar') {
transitive = true
}
}*/
compile('com.mikepenz:materialdrawer:5.9.0@aar') {
transitive = true
}
compile files('jsoup-1.9.2.jar')
compile files('src/trace.jar')
compile files('src/SOMAAndroidSDK5.0.9.jar')
compile project(':multidisplaycast')
compile project(':library')
compile 'com.mikepenz:iconics-core:2.8.1@aar'
compile 'com.mikepenz:google-material-typeface:2.2.0.3.original@aar'
compile 'com.mikepenz:material-design-iconic-typeface:2.2.0.2@aar'
Expand All @@ -109,6 +124,7 @@ dependencies {
compile 'com.shamanland:xdroid-toaster:0.0.10'
compile 'com.karumi:dexter:2.3.1'
compile "com.android.support:appcompat-v7:$project.g_apps"
compile "com.android.support:support-core-ui:$project.g_apps"
compile "com.android.support:leanback-v17:$project.g_apps"
compile "com.android.support:recyclerview-v7:$project.g_apps"
compile "com.android.support:cardview-v7:$project.g_apps"
Expand Down Expand Up @@ -143,13 +159,15 @@ dependencies {
compile 'agency.tango.android:material-intro-screen:0.0.5'
compile 'org.adw.library:discrete-seekbar:1.0.1'
compile 'com.github.daniel-stoneuk:material-about-library:1.7.1'
compile 'com.google.android.gms:play-services-analytics:10.2.6'
compile 'com.google.android.gms:play-services-ads:10.2.6'
compile 'com.google.android.gms:play-services-analytics:11.0.0'
compile 'com.google.android.gms:play-services-ads:11.0.0'
compile 'com.google.android.gms:play-services-iid:11.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'me.zhanghai.android.materialratingbar:library:1.0.2'
compile 'com.futuremind.recyclerfastscroll:fastscroll:0.2.5'
compile 'com.onesignal:OneSignal:[3.5.3,4.0.0)'
compile 'org.cryse.widget:persistentsearchview:1.0.4@aar'
compile 'com.github.GrenderG:Color-O-Matic:1.1.5'
compile ('com.github.ViksaaSkool:AwesomeSplash:v1.0.0'){
exclude module: 'CircularReveal'
}
Expand Down
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
android:label="@string/app_name"
android:largeHeap="true"
android:manageSpaceActivity=".Utils.CacheControl"
android:roundIcon="@mipmap/ic_launcher_o_round"
android:theme="@style/AppTheme"
tools:replace="icon,label">
<activity
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/assets/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@
</head>

<body>
<h2>5.1.0</h2>
<ul type="circle">
<li><span class="corregido"/>Errores generales</li>
<li><span class="corregido"/>Error al mostrar la lista de servidores</li>
<li><span class="corregido"/>Error al mostrar el diseño sin espacios en Directorio</li>
<li><span class="new"/>Color de resaltado en Recientes personalizable (Configuracion>Diseño)
</li>
<li><span class="importante"/>App lista para Android 8.0</li>
</ul>
<h2>5.0.1</h2>
<ul type="circle">
<li><span class="corregido"/>Errores generales</li>
Expand Down
Binary file added app/src/main/ic_launcher_O-web.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions app/src/main/java/knf/animeflv/Application.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
package knf.animeflv;

import android.annotation.TargetApi;
import android.app.Activity;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.ActivityNotFoundException;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.multidex.MultiDexApplication;
import android.util.Log;
Expand All @@ -31,6 +36,15 @@
import knf.animeflv.Utils.UtilsInit;
import xdroid.toaster.Toaster;

import static knf.animeflv.BackgroundChecker.startBackground.CHANNEL_ANIMES;
import static knf.animeflv.BackgroundChecker.startBackground.CHANNEL_ANIMES_DESC;
import static knf.animeflv.BackgroundChecker.startBackground.CHANNEL_COM_DOWNLOAD;
import static knf.animeflv.BackgroundChecker.startBackground.CHANNEL_COM_DOWNLOAD_DESC;
import static knf.animeflv.BackgroundChecker.startBackground.CHANNEL_CURR_DOWNLOAD;
import static knf.animeflv.BackgroundChecker.startBackground.CHANNEL_CURR_DOWNLOAD_DESC;
import static knf.animeflv.BackgroundChecker.startBackground.CHANNEL_UPDATES;
import static knf.animeflv.BackgroundChecker.startBackground.CHANNEL_UPDATES_DESC;


public class Application extends MultiDexApplication {
private static NotificationResponse handler;
Expand All @@ -46,6 +60,8 @@ public void onCreate() {
super.onCreate();
context = this;
SSLCertificateHandler.nuke();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
initChannels();
UtilsInit.init(this);
Dexter.initialize(getApplicationContext());
android.webkit.CookieSyncManager.createInstance(this);
Expand Down Expand Up @@ -96,6 +112,40 @@ public NotificationResponse getNotificationHandler() {
return handler;
}

@TargetApi(Build.VERSION_CODES.O)
private void initChannels() {
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
createChannel(manager, CHANNEL_ANIMES, CHANNEL_ANIMES_DESC, "Animes", NotificationManager.IMPORTANCE_MAX, Color.argb(0, 255, 128, 0), true, true);
createChannel(manager, CHANNEL_UPDATES, CHANNEL_UPDATES_DESC, "Actualizaciones", NotificationManager.IMPORTANCE_MAX, Color.BLUE, true);
createChannel(manager, CHANNEL_CURR_DOWNLOAD, CHANNEL_CURR_DOWNLOAD_DESC, "Descargas en progreso", NotificationManager.IMPORTANCE_DEFAULT, -1, false);
createChannel(manager, CHANNEL_COM_DOWNLOAD, CHANNEL_COM_DOWNLOAD_DESC, "Descargas terminadas", NotificationManager.IMPORTANCE_DEFAULT, Color.parseColor("#8BC34A"), false);
}

@TargetApi(Build.VERSION_CODES.O)
private void createChannel(NotificationManager manager, String id, String desc, String name, int importance, int ligths, boolean vibration) {
createChannel(manager, id, desc, name, importance, ligths, vibration, false);
}

@TargetApi(Build.VERSION_CODES.O)
private void createChannel(NotificationManager manager, String id, String desc, String name, int importance, int ligths, boolean vibration, boolean badge) {
try {
NotificationChannel channel = new NotificationChannel(id, name, importance);
channel.setDescription(desc);
channel.enableLights(true);
if (ligths != -1)
channel.setLightColor(ligths);
if (vibration) {
channel.enableVibration(true);
channel.setVibrationPattern(new long[]{100, 200, 100, 500});
}
if (badge)
channel.setShowBadge(true);
manager.createNotificationChannel(channel);
} catch (Exception e) {
e.printStackTrace();
}
}

public class NotificationResponse implements OneSignal.NotificationOpenedHandler {
@Override
public void notificationOpened(OSNotificationOpenResult result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import android.widget.ProgressBar;

import com.h6ah4i.android.widget.advrecyclerview.animator.DraggableItemAnimator;
import com.h6ah4i.android.widget.advrecyclerview.animator.GeneralItemAnimator;
import com.h6ah4i.android.widget.advrecyclerview.decoration.ItemShadowDecorator;
import com.h6ah4i.android.widget.advrecyclerview.draggable.RecyclerViewDragDropManager;

Expand Down Expand Up @@ -85,7 +84,7 @@ private void setRecycler(List<EmObj> list, int day) {
(NinePatchDrawable) ContextCompat.getDrawable(getContext(), R.drawable.material_shadow_z3));
adapter = new AutoEmisionAdapter(getActivity(), list, day, AutoEmisionFragment.this);
wraped = dragDropManager.createWrappedAdapter(adapter);
final GeneralItemAnimator animator = new DraggableItemAnimator();
final DraggableItemAnimator animator = new DraggableItemAnimator();
getActivity().runOnUiThread(new Runnable() {
@Override
public void run() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package knf.animeflv.BackgroundChecker;

import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
Expand Down Expand Up @@ -53,11 +52,15 @@

public class startBackground {

private static final String CHANNEL_ANIMES = "animeflv_app_channel_anime";
private static final String CHANNEL_UPDATES = "animeflv_app_channel_updates";
public static final String CHANNEL_ANIMES = "animeflv_app_channel_anime";
public static final String CHANNEL_UPDATES = "animeflv_app_channel_updates";
public static final String CHANNEL_CURR_DOWNLOAD = "animeflv_app_channel_download_current";
public static final String CHANNEL_COM_DOWNLOAD = "animeflv_app_channel_download_complete";

private static final int ACTION_ANIME = 0;
private static final int ACTION_UPDATE = 1;
public static final String CHANNEL_ANIMES_DESC = "Notificaciones de nuevos capitulos";
public static final String CHANNEL_UPDATES_DESC = "Actualizaciones de la app";
public static final String CHANNEL_CURR_DOWNLOAD_DESC = "Descargas en progreso";
public static final String CHANNEL_COM_DOWNLOAD_DESC = "Descargas completadas";

public static void compareNots(final Context context) {
if (NetworkUtils.isNetworkAvailable()) {
Expand Down Expand Up @@ -217,6 +220,7 @@ private static void startCompare(Context context, @Nullable JSONObject s) {
int not = Integer.parseInt(PreferenceManager.getDefaultSharedPreferences(context).getString("sonido", "0"));
mBuilder.setSound(UtilSound.getSoundUri(not));
mBuilder.setColor(ThemeUtils.getAcentColor(context));
mBuilder.setNumber(nCaps);
mBuilder.setAutoCancel(true);
mBuilder.setPriority(Notification.PRIORITY_MAX);
mBuilder.setLights(Color.argb(0, 255, 128, 0), 5000, 2000);
Expand All @@ -227,7 +231,7 @@ private static void startCompare(Context context, @Nullable JSONObject s) {
int mNotificationId = 6991;
NotificationManager mNotifyMgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
mNotifyMgr.cancel(mNotificationId);
showNotification(mNotifyMgr, mBuilder, ACTION_ANIME, mNotificationId);
showNotification(mNotifyMgr, mBuilder, CHANNEL_ANIMES, mNotificationId);
} else {
if (UtilNotBlocker.isBlocked()) {
Log.d("Not Service", "isBlocked");
Expand Down Expand Up @@ -294,7 +298,7 @@ private static void startUpdate(Context context, String s) {
mBuilder.setContentIntent(resultPendingIntent);
int mNotificationId = 1964;
NotificationManager mNotifyMgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
showNotification(mNotifyMgr, mBuilder, ACTION_UPDATE, mNotificationId);
showNotification(mNotifyMgr, mBuilder, CHANNEL_UPDATES, mNotificationId);
}
} else {
Log.d("Auto", "true");
Expand Down Expand Up @@ -364,7 +368,7 @@ public void onDownloadComplete(DownloadRequest downloadRequest) {
mBuilder.setContentIntent(resultPendingIntent);
int mNotificationId = (int) Math.round(Math.random());
NotificationManager mNotifyMgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
showNotification(mNotifyMgr, mBuilder, ACTION_UPDATE, mNotificationId);
showNotification(mNotifyMgr, mBuilder, CHANNEL_UPDATES, mNotificationId);
}

@Override
Expand Down Expand Up @@ -419,25 +423,12 @@ private static void Descargar(Context context, String titulo, String eid, String
mBuilder.setContentIntent(resultPendingIntent);
int mNotificationId = (int) Math.round(Math.random());
NotificationManager mNotifyMgr = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
showNotification(mNotifyMgr, mBuilder, ACTION_ANIME, mNotificationId);
showNotification(mNotifyMgr, mBuilder, CHANNEL_ANIMES, mNotificationId);
}

private static void showNotification(NotificationManager manager, NotificationCompat.Builder builder, int action, int id) {
if (action == ACTION_ANIME) {
createChannel(manager, CHANNEL_ANIMES);
} else {
createChannel(manager, CHANNEL_UPDATES);
}
private static void showNotification(NotificationManager manager, NotificationCompat.Builder builder, String actionid, int id) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
builder.setChannelId(actionid);
manager.notify(id, builder.build());
}

@TargetApi(Build.VERSION_CODES.N_MR1)
private static void createChannel(NotificationManager manager, String id) {
/*NotificationChannel channel=new NotificationChannel(id,id.equals(CHANNEL_ANIMES)?"Animes Recientes":"Actualizaciones",NotificationManager.IMPORTANCE_MAX);
channel.enableLights(true);
channel.setLightColor(Color.BLUE);
channel.enableVibration(true);
channel.setVibrationPattern(new long[]{100, 200, 100, 500});
manager.createNotificationChannel(channel);*/
}
}
12 changes: 12 additions & 0 deletions app/src/main/java/knf/animeflv/ColorsRes.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package knf.animeflv;

import android.content.Context;
import android.graphics.Color;
import android.preference.PreferenceManager;
import android.support.annotation.ColorInt;
import android.support.v4.content.ContextCompat;

Expand Down Expand Up @@ -123,4 +125,14 @@ public static int DropBox(Context context) {
public static int Transparent(Context context) {
return ContextCompat.getColor(context, android.R.color.transparent);
}

@ColorInt
public static int in_favs(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context).getInt("color_favs", Color.argb(100, 26, 206, 246));
}

@ColorInt
public static int in_new(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context).getInt("color_new", Color.argb(100, 253, 250, 93));
}
}

0 comments on commit 4ad39dc

Please sign in to comment.