aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Renard1911 2016-04-13 17:04:14 -0300
committerLibravatar Renard1911 2016-04-13 17:04:14 -0300
commit06439b54a5be5efba32bd086ce881da389267d58 (patch)
tree1c50574cb4fdc16e12bfae0e20b35a15063f0e41
parentc94f0e1d27f0a92a17b2e65363bdce6461249d95 (diff)
parentdede99eacafdc0365719e7e77114b83a57956b6f (diff)
downloadBaiApp-06439b54a5be5efba32bd086ce881da389267d58.tar.gz
BaiApp-06439b54a5be5efba32bd086ce881da389267d58.tar.xz
BaiApp-06439b54a5be5efba32bd086ce881da389267d58.zip
Merge pull request #2 from Renard1911/devv1.6.1
Dev
-rw-r--r--app/src/main/java/layout/FragmentBoardItemList.java24
-rw-r--r--app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java5
-rw-r--r--app/src/main/java/utils/ContentProviderUtils.java2
-rw-r--r--app/src/main/res/values/strings.xml4
4 files changed, 23 insertions, 12 deletions
diff --git a/app/src/main/java/layout/FragmentBoardItemList.java b/app/src/main/java/layout/FragmentBoardItemList.java
index 149def3..6095a86 100644
--- a/app/src/main/java/layout/FragmentBoardItemList.java
+++ b/app/src/main/java/layout/FragmentBoardItemList.java
@@ -49,6 +49,7 @@ import org.json.JSONObject;
import java.io.File;
import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
@@ -688,11 +689,15 @@ public class FragmentBoardItemList extends Fragment {
ContextWrapper cw = new ContextWrapper(getActivity().getApplicationContext());
File directory = cw.getDir("thumbs", Context.MODE_PRIVATE);
- File mypath = new File(directory, currentBoard.getBoardDir() + "_" + bi.getThumb());
+ if (!directory.exists()){
+ directory.mkdir();
+ }
+ final File mypath = new File(directory, currentBoard.getBoardDir() + "_" + bi.getThumb());
if (mypath.exists()){
try {
Bitmap b = BitmapFactory.decodeStream(new FileInputStream(mypath));
- bi.setThumbBitmap(b);
+ bi.setThumbBitmap(Bitmap.createScaledBitmap(b, 128, 128, false));
+ listViewAdapter.notifyDataSetChanged();
Log.i("getThumb", bi.getThumb() + " from cache");
return;
}catch (Exception e){
@@ -714,9 +719,20 @@ public class FragmentBoardItemList extends Fragment {
if (e != null) {
displayError(e.getMessage());
e.printStackTrace();
- } else {
- bi.setThumbBitmap(result);
+ }else{
+ bi.setThumbBitmap(Bitmap.createScaledBitmap(result, 128, 128, false));
listViewAdapter.notifyDataSetChanged();
+ FileOutputStream out;
+ try{
+ out = new FileOutputStream(mypath);
+ result.compress(Bitmap.CompressFormat.PNG, 100, out);
+ if(out != null){
+ out.close();
+ }
+ Log.v("getThumb", bi.getThumb() + " saved.");
+ }catch (Exception e1){
+ e1.printStackTrace();
+ }
}
}
});
diff --git a/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java b/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java
index 18d2e08..d42f9d7 100644
--- a/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java
+++ b/app/src/main/java/org/bienvenidoainternet/baiparser/MainActivity.java
@@ -189,8 +189,9 @@ public class MainActivity extends AppCompatActivity
refreshNavigator();
}
- //TODO: Aplicar tema al navigator
- //navigationView.setBackgroundColor(themeManager.getPrimaryDarkColor());
+ if (tm.isDarkTheme()){
+ navigationView.setBackgroundColor(0xFF888888);
+ }
}
@Override
diff --git a/app/src/main/java/utils/ContentProviderUtils.java b/app/src/main/java/utils/ContentProviderUtils.java
index fca8477..e3cb6e8 100644
--- a/app/src/main/java/utils/ContentProviderUtils.java
+++ b/app/src/main/java/utils/ContentProviderUtils.java
@@ -41,8 +41,6 @@ public class ContentProviderUtils {
if ("primary".equalsIgnoreCase(type)) {
return Environment.getExternalStorageDirectory() + "/" + split[1];
}
-
- // TODO handle non-primary volumes
}
// DownloadsProvider
else if (isDownloadsDocument(uri)) {
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index f5be573..7754034 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -72,8 +72,4 @@
</string-array>
<string name="title_activity_settings">Opciones</string>
-
- <!-- TODO: Remove or change this placeholder text -->
- <string name="hello_blank_fragment">Hello blank fragment</string>
-
</resources>