Skip to content

Commit

Permalink
u20220526
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepchild committed May 27, 2022
1 parent 248a3ad commit 678ff45
Show file tree
Hide file tree
Showing 31 changed files with 291 additions and 582 deletions.
4 changes: 2 additions & 2 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="sleepchild.fimi"
android:versionName="20220420"
android:versionCode="20220420">
android:versionName="20220526"
android:versionCode="20220526">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Expand Down
Binary file added app/res/drawable/ic_audio.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
28 changes: 18 additions & 10 deletions app/res/layout/act_texteditor.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
android:gravity="center_vertical">

<TextView
android:id="@+id/act_texteditor_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Edit Text File"
android:text="..."
android:layout_marginLeft="10dp"
android:textSize="16sp"
android:singleLine="true"
android:ellipsize="start"
android:textColor="#000000"/>

</LinearLayout>
Expand All @@ -37,26 +40,31 @@
android:layout_height="match_parent">

<EditText
android:id="@+id/act_texteditor_ete"
android:layout_width="match_parent"
android:ems="10"
android:layout_height="match_parent"
android:gravity="top|left"
android:background="#FFFFFF"
android:textColor="#000000"
android:visibility="gone"/>

<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="Text"
android:gravity="top|left"
android:background="#FFFFFF"
android:textColor="#000000"/>
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:textSize="14sp"
android:visibility="visible"
android:enabled="false"/>

<ProgressBar
android:id="@+id/act_texteditor_loader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</RelativeLayout>

</LinearLayout>



</RelativeLayout>



27 changes: 19 additions & 8 deletions app/res/layout/adapteritem_fileitem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
android:layout_height="wrap_content">

<LinearLayout
android:id="@+id/aifi_divider"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="1dp"
Expand Down Expand Up @@ -41,20 +42,30 @@
android:layout_width="0dp"
android:layout_weight="1.0"
android:layout_height="match_parent">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:textColor="#000000"
android:id="@+id/adapteritem_fileitem_title"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:textColor="#666666"
android:id="@+id/adapteritem_fileitem_details"/>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:textSize="10sp"
android:textColor="#666666"
android:id="@+id/adapteritem_fileitem_size"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="10sp"
android:textColor="#666666"
android:id="@+id/adapteritem_fileitem_date"/>
</LinearLayout>
</LinearLayout>

<LinearLayout
Expand Down
4 changes: 3 additions & 1 deletion app/res/layout/adapteritem_tabpickeritem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@
android:gravity="center">

<ImageView
android:id="@+id/i1"
android:clickable="false"
android:layout_width="22dp"
android:layout_height="22dp"
android:background="@drawable/ic_close"/>
android:scaleType="fitXY"
android:src="@drawable/ic_close"/>

</LinearLayout>

Expand Down
23 changes: 23 additions & 0 deletions app/res/layout/emptyfolder.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:minHeight="50dp"
android:orientation="vertical"
android:gravity="center">

<TextView
android:id="@+id/emptyfolder_text"
android:textSize="16sp"
android:text="there are no files here..."
android:textColor="#ffffff"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>

</LinearLayout>
</LinearLayout>
1 change: 0 additions & 1 deletion app/res/layout/text_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
android:layout_marginBottom="5dp"
android:textSize="16sp"
android:textColor="#000000"
android:background="#ffffff"
android:text=""
android:padding="10dp"/>

Expand Down
2 changes: 1 addition & 1 deletion app/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
<color name="hline">#dcdcdc</color>

<color name="currentTabBg">#000000</color>
<color name="currentTabText">#ffffff</color>
<color name="currentTabText">#00748E</color>

</resources>
4 changes: 1 addition & 3 deletions app/src/sleepchild/fimi/FIMI.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import android.content.*;
import android.graphics.*;
import android.os.*;
import sleepchild.fimi.io.*;

public class FIMI
{
Expand Down Expand Up @@ -87,7 +86,7 @@ private static Bitmap getResizedBitmap(Bitmap bm, int newWidth, int newHeight) {

public static int getIcon(MFile file){
if(isAudio(file)){
return R.drawable.ic_audiotrack_grey600_24dp;
return R.drawable.ic_audio;
}else if(isImage(file)){
return R.drawable.ic_image_grey600_24dp;
}else if(isVideo(file)){
Expand Down Expand Up @@ -160,7 +159,6 @@ public static void copyFile(String frompath, String topath){
FileInputStream in = null;
FileOutputStream out = null;
new File(topath).getParentFile().mkdirs();
Buffer buffer = new Buffer();

try
{
Expand Down
10 changes: 0 additions & 10 deletions app/src/sleepchild/fimi/FileUtils.java

This file was deleted.

30 changes: 0 additions & 30 deletions app/src/sleepchild/fimi/TabSpooler.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ private TabSpooler(){
private enum K{
ID,
LAST_PATH,
BACKSTACK,
LAST_SHOWN_TAB,
}

Expand Down Expand Up @@ -59,15 +58,6 @@ public synchronized void saveTab(Tab tab){
o.put(k(K.ID), tab.getId());
o.put(k(K.LAST_PATH), tab.getDir().getAbsolutePath());

if(!tab.getBackHistory().isEmpty()){
JSONArray bs = new JSONArray();
for(String s : tab.getBackHistory()){
bs.put(s);
}
o.put(k(K.BACKSTACK),bs);

}

_write(fname, o.toString().getBytes());

}catch (JSONException e){}
Expand Down Expand Up @@ -98,7 +88,6 @@ public List<Tab> getPreviousTabs(TabManager tmgr){
}



/////////////

private Tab fileToTab(TabManager tmgr ,File fl){
Expand All @@ -112,25 +101,6 @@ private Tab fileToTab(TabManager tmgr ,File fl){
String path = o.getString(k(K.LAST_PATH));
long id = o.getLong(k(K.ID));


if(o.has(k(K.BACKSTACK))){
List<String> bs = new ArrayList<>();
JSONArray ar = o.getJSONArray(k(K.BACKSTACK));
if(ar!=null){
int l = ar.length();
for(int i = 0;i<l;i++){
String str = ar.getString(i);
if(str!=null){
bs.add(str);
}
}

if(bs!=null && !bs.isEmpty()){
tab.setBackHistory(bs);
}
}
}

tab.setId(id);
tab.load(path);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import java.util.concurrent.*;
import java.util.*;

public class TaskMang
public class TaskManager
{
ExecutorService worker;

Expand All @@ -14,7 +14,7 @@ public class TaskMang
//List<Task> pendingTasksQueue = new ArrayList<>();
//List<Task> completedTaskQueue = new ArrayList<>();

public TaskMang(){
public TaskManager(){
worker = Executors.newFixedThreadPool(3);
//
}
Expand Down
8 changes: 7 additions & 1 deletion app/src/sleepchild/fimi/ThemeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public class ThemeManager
private static ThemeManager deft;
private static Theme ctheme;

private String tfindex;
private File themeFile;
private String dir;

Expand Down Expand Up @@ -58,16 +59,21 @@ private Theme igetTheme(){
}
return ctheme;
}


private Theme reloadTheme(){

getThemeFile();
if(themeFile.exists()){
ctheme = fromFile(themeFile.getAbsolutePath());
}else{
ctheme = newdefault(themeFile.getAbsolutePath());
}
return ctheme;
}

void getThemeFile(){

}

// note: to keep things in sync, this shud be the only method that performs a read on the themefile
private Theme fromFile(String path){
Expand Down
36 changes: 36 additions & 0 deletions app/src/sleepchild/fimi/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,28 @@ public int compare(File p1, File p2)

//*/

public static String getDirectoryInfo(File fl){
if(fl.isDirectory()){
int d=0;
int f=0;
for(File j : fl.listFiles()){
if(j.isFile()){
f++;
}else{
d++;
}
}
return d+(d==1 ? " folder, ":" folders, ") +f+ (f==1 ? " file":" files");

}
return "";
}

public static String formatDate(File fl){
return new java.util.Date(fl.lastModified()).toLocaleString().toLowerCase();
//
}

public static boolean touch(String path, String text, boolean overwrite){
try{
if(overwrite==false && new File(path).exists()){
Expand Down Expand Up @@ -173,7 +195,20 @@ public static int dp2px(final float dpValue) {
return (int) (dpValue * scale + 0.5f);
}

public static String clean(String str){
String ret = str;
if(str.startsWith("file://")){
ret = str.substring(7);
}
ret = ret.replace("%20"," ").replace("%26","&");

return ret;
}

public static String readTextFile(String path){
if(path.startsWith("file://")){
path = path.substring(7);
}
BufferedReader br = null;
try
{
Expand All @@ -197,6 +232,7 @@ public static String readTextFile(String path){
public static void touch(String path, String data){
touch(path, data.getBytes());
}

public static void touch(String path, byte[] data){
FileOutputStream o = null;
try
Expand Down
2 changes: 1 addition & 1 deletion app/src/sleepchild/fimi/activity/ImageViewerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static String clean(String str){
ret = str.substring(7);
}
ret = ret.replace("%20"," ").replace("%26","&");

return ret;
}

Expand Down

0 comments on commit 678ff45

Please sign in to comment.