Skip to content

Commit

Permalink
212
Browse files Browse the repository at this point in the history
  • Loading branch information
jordyamc committed Jun 9, 2017
1 parent 241101f commit e35a80c
Show file tree
Hide file tree
Showing 58 changed files with 1,133 additions and 1,283 deletions.
Binary file modified app/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ android {
applicationId "knf.animeflv"
minSdkVersion 17
targetSdkVersion 25
versionCode 211
versionName "5.0"
versionCode 212
versionName "5.0.1"
multiDexEnabled = true
}
buildTypes {
Expand Down
6 changes: 6 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
-dontwarn io.codetail.animation.**
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keepattributes JavascriptInterface
-keep public class * extends java.lang.Exception
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**
Expand All @@ -44,4 +45,9 @@ public *;
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
-keep public class knf.animeflv.JsonFactory$UrlGetter
-keep public class * implements knf.animeflv.JsonFactory$UrlGetter
-keepclassmembers class knf.animeflv.JsonFactory$UrlGetter {
<methods>;
}

3 changes: 0 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,6 @@
<activity android:name="com.smaato.soma.ExpandedBannerActivity"/>
<activity android:name="com.smaato.soma.interstitial.InterstitialActivity"/>
<activity android:name="com.smaato.soma.video.VASTAdActivity"/>
<activity
android:name=".Favoritos"
android:label="@string/app_name"/>
<activity
android:name=".Favorites.FavoriteMain"
android:configChanges="orientation|screenSize|keyboard"
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/assets/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@
</head>

<body>
<h2>5.0.1</h2>
<ul type="circle">
<li><span class="corregido"/>Errores generales</li>
<li><span class="corregido"/>Error al añadir animes al historial</li>
<li><span class="new"/>Progreso de descarga en Recientes</li>
<li><span class="new"/>Nuevo servidor: Hyperion</li>
<li><span class="new"/>Nuevo diseño sin espacios (Se puede revertir en Configuracion > Diseño)
</li>
<li><span class="importante"/>Menu flotante de busqueda mejorado</li>
<li><span class="importante"/>Miniaturas de animes con mas resolucion</li>
</ul>
<h2>5.0</h2>
<ul type="circle">
<li><span class="corregido"/>Error en Yotta</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package knf.animeflv.AutoEmision;

import android.app.Activity;
import android.content.Context;
import android.graphics.Color;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import android.support.v7.widget.CardView;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -49,7 +51,7 @@ public AutoEmisionAdapter(Activity context, List<EmObj> list, int daycode, OnLis
public AutoEmisionAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(context).
inflate(R.layout.item_anime_em, parent, false);
return new AutoEmisionAdapter.ViewHolder(itemView);
return new AutoEmisionAdapter.ViewHolder(itemView, context);
}

@Override
Expand Down Expand Up @@ -240,9 +242,11 @@ public static class ViewHolder extends AbstractDraggableItemViewHolder {
@BindView(R.id.state)
ImageView state;

public ViewHolder(View itemView) {
public ViewHolder(View itemView, Context context) {
super(itemView);
ButterKnife.bind(this, itemView);
if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("use_space", false))
imageView.setPadding(0, 0, 0, 0);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,14 @@ public void onSuccess(int statusCode, Header[] headers, String responseString) {
}
}

private static boolean checkList(List<MainObject> old, List<MainObject> actual) {
for (MainObject object : actual) {
if (object.eid.equals(old.get(0).eid))
return true;
}
return false;
}

private static void startCompare(Context context, @Nullable JSONObject s) {
try {
if (new Parser().checkStatus(s) == 0) {
Expand Down Expand Up @@ -145,25 +153,26 @@ private static void startCompare(Context context, @Nullable JSONObject s) {
Set<String> sts = context.getSharedPreferences("data", Context.MODE_PRIVATE).getStringSet("eidsNot", new HashSet<String>());
loop:
{
for (MainObject st : mainobjects) {
if (!st.eid.equals(oldobjects.get(0).eid)) {
Boolean isInFavs = FavoriteHelper.isFav(context, st.aid);
if (isInFavs && desc && isnot) {
Descargar(context, st.titulo, st.eid, st.sid);
}
if (onlyNotFavs) {
if (isInFavs) {
if (checkList(oldobjects, mainobjects))
for (MainObject st : mainobjects) {
if (!st.eid.equals(oldobjects.get(0).eid)) {
Boolean isInFavs = FavoriteHelper.isFav(context, st.aid);
if (isInFavs && desc && isnot) {
Descargar(context, st.titulo, st.eid, st.sid);
}
if (onlyNotFavs) {
if (isInFavs) {
num += 1;
sts.add(st.eid);
}
} else {
num += 1;
sts.add(st.eid);
}
} else {
num += 1;
sts.add(st.eid);
break loop;
}
} else {
break loop;
}
}
}
int nCaps = context.getSharedPreferences("data", Context.MODE_PRIVATE).getInt("nCaps", 0) + num;
if (isnot && !UtilNotBlocker.isBlocked() && nCaps > 0) {
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/knf/animeflv/Directorio/Directorio.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public class Directorio extends AppCompatActivity {
List<Integer> lastSearch = Arrays.asList(new Integer[]{0});
boolean loaded = false;
private boolean prestarted = false;
private boolean menuOpen = false;

public static String convertStreamToString(InputStream is) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
Expand Down Expand Up @@ -506,6 +507,7 @@ public void run() {
actionMenu.setOnMenuToggleListener(new FloatingActionMenu.OnMenuToggleListener() {
@Override
public void onMenuToggle(boolean opened) {
menuOpen = opened;
if (opened) {
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
Expand Down Expand Up @@ -938,9 +940,10 @@ public void onWindowFocusChanged(boolean hasFocus) {

@Override
public void onBackPressed() {
super.onBackPressed();
if (loaded)
finish();
if (menuOpen) {
actionMenu.close(true);
} else if (loaded)
super.onBackPressed();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void cancelDownload(String eid) {
String epID = sharedPreferences.getString("epIDS_descarga", "");
sharedPreferences.edit().putString("titulos_descarga", tits.replace(titulo + ":::", "")).apply();
sharedPreferences.edit().putString("epIDS_descarga", epID.replace(aid + "_" + numero + ":::", "")).apply();
new SQLiteHelperDownloads(context).updateState(eid, DownloaderService.CANCELED).delete(eid);
new SQLiteHelperDownloads(context).updateState(eid, DownloaderService.CANCELED).delete(eid).close();
DownloadListManager.delete(context, eid + "_" + sharedPreferences.getLong(eid + "_downloadID", -1));
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package knf.animeflv.DownloadManager;

import android.app.Activity;
import android.app.DownloadManager;
import android.content.Context;
import android.preference.PreferenceManager;

Expand Down Expand Up @@ -111,7 +110,7 @@ public static int getDownloadSate(Activity activity, String eid) {
case EXTERNAL:
return ExternalManager.getDownloadState(activity, eid);
default:
return DownloadManager.STATUS_FAILED;
return -1;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import com.crashlytics.android.core.CrashlyticsCore;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
Expand Down Expand Up @@ -51,6 +52,7 @@ public class DownloaderService extends IntentService {
private static final String CAUSE_UNKNOWN = "ERROR DESCONOCIDO";
private static final String CAUSE_DISCONNECTION = "CONEXION INTERRUMPIDA";
private static final String CAUSE_SSL = "ERROR EN CERTIFICADO SSL";
private static final String CAUSE_NOT_FOUND = "ARCHIVO NO ENCONTRADO EN SERVIDOR";
public static String RECEIVER_ACTION_ERROR = "knf.animeflv.DownloadService.DownloadService.RECIEVER_ERROR";
private NotificationManager manager;
private NotificationCompat.Builder downloading;
Expand Down Expand Up @@ -126,6 +128,9 @@ protected void onHandleIntent(Intent intent) {
output.close();
input.close();
onSuccess(eid);
} catch (FileNotFoundException fnfe) {
Log.e("DownloadService", fnfe.getMessage());
onDownloadFailed(eid, intent, CAUSE_NOT_FOUND);
} catch (DownloadCanceledException canceled) {
Log.e("DownloadService", "Canceled - Eid: " + eid + " ID: " + canceled.getMessage());
FileUtil.init(this).DeleteAnime(eid);
Expand Down Expand Up @@ -281,7 +286,7 @@ private void onDownloadFailed(String eid, Intent intent, String cause) {
.setGroup("animeflv_failed_download")
.setStyle(bigTextStyle)
.setOngoing(false);
if (cause.equals(CAUSE_INTERNET) || cause.equals(CAUSE_NO_SPACE) || cause.equals(CAUSE_DISCONNECTION))
if (cause.equals(CAUSE_INTERNET) || cause.equals(CAUSE_NO_SPACE) || cause.equals(CAUSE_DISCONNECTION) || cause.equals(CAUSE_NOT_FOUND))
builder.addAction(R.drawable.redo, "REINTENTAR", PendingIntent.getBroadcast(this, new Random().nextInt(), n_intent, PendingIntent.FLAG_UPDATE_CURRENT));
getManager().notify(getDownloadID(eid), builder.build());
new SQLiteHelperDownloads(this).updateState(eid, DownloadManager.STATUS_FAILED).delete(eid);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package knf.animeflv.Explorer.Adapters;

import android.app.Activity;
import android.content.Context;
import android.os.AsyncTask;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -51,7 +53,7 @@ public DirectoryAdapter(Activity context, List<Directory> list) {
public DirectoryAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View itemView = LayoutInflater.from(context).
inflate(R.layout.explorer_item, parent, false);
return new DirectoryAdapter.ViewHolder(itemView);
return new DirectoryAdapter.ViewHolder(itemView, context);
}

@Override
Expand Down Expand Up @@ -244,6 +246,7 @@ public interface OnFinishListListener {
}

public static class ViewHolder extends RecyclerView.ViewHolder {

@BindView(R.id.root)
public RelativeLayout root;
@BindView(R.id.img)
Expand All @@ -259,9 +262,13 @@ public static class ViewHolder extends RecyclerView.ViewHolder {
@BindView(R.id.seen)
public ImageView iV_visto;

public ViewHolder(View itemView) {
public ViewHolder(View itemView, Context context) {
super(itemView);
ButterKnife.bind(this, itemView);
img.setScaleType(ImageView.ScaleType.CENTER_CROP);
img.setCropToPadding(true);
if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("use_space", false))
img.setPadding(0, 0, 0, 0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ public void run() {
}

private Handler getProgressHandler() {
if (handler != null) return handler;
handler = new Handler();
if (handler == null) handler = new Handler();
return handler;
}

Expand Down Expand Up @@ -337,6 +336,7 @@ public static class ViewHolder extends RecyclerView.ViewHolder {
public ImageView iV_visto;
@BindView(R.id.progress)
ProgressBar progress;

public ViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
Expand Down
26 changes: 15 additions & 11 deletions app/src/main/java/knf/animeflv/Explorer/ExplorerRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,18 +128,22 @@ public void onClick(View v) {
}

private void showDirectory() {
isDirectory = true;
textView.setText(ModelFactory.getDirectoryFile(this).getAbsolutePath());
directoryFragment.recharge(this);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
if (directoryFragment.isAdded()) {
transaction.show(directoryFragment);
} else {
transaction.add(R.id.root, directoryFragment, TAG_DIRECTORY);
try {
isDirectory = true;
textView.setText(ModelFactory.getDirectoryFile(this).getAbsolutePath());
directoryFragment.recharge(this);
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
if (directoryFragment.isAdded()) {
transaction.show(directoryFragment);
} else {
transaction.add(R.id.root, directoryFragment, TAG_DIRECTORY);
}
if (videoFilesFragment.isAdded()) transaction.remove(videoFilesFragment);
transaction.commit();
} catch (Exception e) {
e.printStackTrace();
}
if (videoFilesFragment.isAdded()) transaction.remove(videoFilesFragment);
transaction.commit();
}

private void showVideoFile(File file) {
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/java/knf/animeflv/Favorites/FavoriteAdapter.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package knf.animeflv.Favorites;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
Expand Down Expand Up @@ -64,7 +65,7 @@ public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType
case FavotiteDB.TYPE_SECTION:
return new SectionViewHolder(inflater.inflate(R.layout.item_anime_fav_header, parent, false));
case FavotiteDB.TYPE_FAV:
return new FavViewHolder(inflater.inflate(R.layout.item_anime_fav, parent, false));
return new FavViewHolder(inflater.inflate(R.layout.item_anime_fav, parent, false), context);
}
}

Expand Down Expand Up @@ -331,9 +332,11 @@ public static class FavViewHolder extends AbstractDraggableItemViewHolder {
@BindView(R.id.title)
TextView name;

public FavViewHolder(View itemView) {
public FavViewHolder(View itemView, Context context) {
super(itemView);
ButterKnife.bind(this, itemView);
if (!PreferenceManager.getDefaultSharedPreferences(context).getBoolean("use_space", false))
imageView.setPadding(0, 0, 0, 0);
}
}

Expand Down
Loading

0 comments on commit e35a80c

Please sign in to comment.