Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ android {
}
}

lint {
// targetSdk is intentionally kept at 32 for Termux RUN_COMMAND compatibility.
disable 'ExpiredTargetSdkVersion'
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

337 changes: 337 additions & 0 deletions app/src/main/java/dev/itszain/termuxfilemanager/Icons.java

Large diffs are not rendered by default.

541 changes: 331 additions & 210 deletions app/src/main/java/dev/itszain/termuxfilemanager/MainActivity.java

Large diffs are not rendered by default.

133 changes: 62 additions & 71 deletions app/src/main/java/dev/itszain/termuxfilemanager/ToolsActivity.java

Large diffs are not rendered by default.

889 changes: 889 additions & 0 deletions app/src/main/java/dev/itszain/termuxfilemanager/Ui.java

Large diffs are not rendered by default.

76 changes: 64 additions & 12 deletions app/src/main/java/dev/itszain/termuxfilemanager/UiTheme.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,78 @@
import android.graphics.Color;
import android.view.View;

/** Shared palette persisted by SettingsActivity. */
/** Design tokens for every TFM screen. The theme name is persisted by the settings screen. */
public final class UiTheme {
public final int bg, panel, panel2, text, muted, accent, danger, divider;
private UiTheme(int bg, int panel, int panel2, int text, int muted, int accent, int danger, int divider) {
this.bg=bg; this.panel=panel; this.panel2=panel2; this.text=text; this.muted=muted; this.accent=accent; this.danger=danger; this.divider=divider;
public final String name;
public final boolean light;
public final int bg, panel, panel2, text, muted, accent, accent2, onAccent, danger, divider;
public final int glass, glass2, glassStroke;
public final int aurora1, aurora2, aurora3, auroraAlpha;

private UiTheme(String name, boolean light, int bg, int panel, int panel2, int text, int muted,
int accent, int accent2, int onAccent, int danger, int divider,
int glass, int glass2, int glassStroke,
int aurora1, int aurora2, int aurora3, int auroraAlpha) {
this.name = name; this.light = light;
this.bg = bg; this.panel = panel; this.panel2 = panel2; this.text = text; this.muted = muted;
this.accent = accent; this.accent2 = accent2; this.onAccent = onAccent; this.danger = danger; this.divider = divider;
this.glass = glass; this.glass2 = glass2; this.glassStroke = glassStroke;
this.aurora1 = aurora1; this.aurora2 = aurora2; this.aurora3 = aurora3; this.auroraAlpha = auroraAlpha;
}

public static String getName(Context c) { return prefs(c).getString("theme", "midnight"); }
public static void setName(Context c, String value) { prefs(c).edit().putString("theme", value).apply(); }
private static SharedPreferences prefs(Context c) { return c.getSharedPreferences("tfm_settings", Context.MODE_PRIVATE); }

public static boolean isLight(Context c) { return "light".equals(getName(c)); }

public static UiTheme get(Context c) {
String t=getName(c);
if ("light".equals(t)) return new UiTheme(Color.rgb(246,248,252),Color.WHITE,Color.rgb(230,236,245),Color.rgb(27,36,54),Color.rgb(91,105,128),Color.rgb(0,126,112),Color.rgb(190,45,65),Color.rgb(213,221,232));
if ("amoled".equals(t)) return new UiTheme(Color.BLACK,Color.rgb(10,10,12),Color.rgb(24,24,27),Color.rgb(245,247,255),Color.rgb(143,151,170),Color.rgb(105,231,196),Color.rgb(255,105,125),Color.rgb(41,43,50));
return new UiTheme(Color.rgb(11,16,32),Color.rgb(20,28,48),Color.rgb(28,38,62),Color.rgb(239,244,255),Color.rgb(153,168,195),Color.rgb(116,224,196),Color.rgb(255,112,129),Color.rgb(42,53,77));
String t = getName(c);
if ("light".equals(t)) {
return new UiTheme("light", true,
Color.rgb(243, 246, 252), Color.WHITE, Color.rgb(231, 237, 247),
Color.rgb(22, 31, 50), Color.rgb(94, 107, 130),
Color.rgb(0, 150, 128), Color.rgb(79, 107, 255), Color.WHITE,
Color.rgb(200, 40, 70), Color.rgb(214, 222, 234),
Color.argb(200, 255, 255, 255), Color.argb(240, 255, 255, 255), Color.argb(38, 30, 50, 110),
Color.rgb(80, 220, 190), Color.rgb(150, 130, 255), Color.rgb(110, 170, 255), 96);
}
if ("amoled".equals(t)) {
return new UiTheme("amoled", false,
Color.BLACK, Color.rgb(11, 11, 14), Color.rgb(24, 24, 30),
Color.rgb(245, 247, 255), Color.rgb(140, 148, 168),
Color.rgb(105, 240, 200), Color.rgb(170, 140, 255), Color.rgb(0, 14, 11),
Color.rgb(255, 105, 125), Color.rgb(36, 38, 46),
Color.argb(20, 255, 255, 255), Color.argb(34, 255, 255, 255), Color.argb(40, 255, 255, 255),
Color.rgb(36, 214, 181), Color.rgb(112, 92, 255), Color.rgb(33, 129, 255), 58);
}
if ("nebula".equals(t)) {
return new UiTheme("nebula", false,
Color.rgb(14, 8, 30), Color.rgb(30, 19, 56), Color.rgb(44, 29, 80),
Color.rgb(246, 238, 255), Color.rgb(173, 152, 206),
Color.rgb(255, 124, 200), Color.rgb(120, 200, 255), Color.rgb(34, 6, 32),
Color.rgb(255, 110, 110), Color.rgb(60, 42, 98),
Color.argb(28, 255, 255, 255), Color.argb(44, 255, 255, 255), Color.argb(52, 255, 255, 255),
Color.rgb(255, 84, 190), Color.rgb(110, 80, 255), Color.rgb(40, 170, 255), 110);
}
return new UiTheme("midnight", false,
Color.rgb(7, 11, 24), Color.rgb(17, 25, 46), Color.rgb(27, 38, 68),
Color.rgb(236, 242, 255), Color.rgb(142, 157, 188),
Color.rgb(98, 230, 200), Color.rgb(129, 140, 255), Color.rgb(5, 16, 30),
Color.rgb(255, 107, 129), Color.rgb(38, 50, 80),
Color.argb(26, 255, 255, 255), Color.argb(42, 255, 255, 255), Color.argb(48, 255, 255, 255),
Color.rgb(36, 214, 181), Color.rgb(112, 92, 255), Color.rgb(33, 129, 255), 100);
}

public static void applyWindow(Activity a) {
UiTheme t=get(a); a.getWindow().setStatusBarColor(t.bg); a.getWindow().setNavigationBarColor(t.bg);
View decor=a.getWindow().getDecorView(); int flags=decor.getSystemUiVisibility();
int lightFlags=View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR|View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
if("light".equals(getName(a))) flags|=lightFlags; else flags&=~lightFlags;
UiTheme t = get(a);
a.getWindow().setStatusBarColor(t.bg);
a.getWindow().setNavigationBarColor(t.bg);
View decor = a.getWindow().getDecorView();
int flags = decor.getSystemUiVisibility();
int lightFlags = View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
if (t.light) flags |= lightFlags; else flags &= ~lightFlags;
decor.setSystemUiVisibility(flags);
a.getWindow().setBackgroundDrawable(new android.graphics.drawable.ColorDrawable(t.bg));
}
}
6 changes: 6 additions & 0 deletions app/src/main/res/anim/tfm_dialog_in.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<alpha android:fromAlpha="0" android:toAlpha="1" android:duration="200" android:interpolator="@android:anim/decelerate_interpolator" />
<scale android:fromXScale="0.88" android:toXScale="1" android:fromYScale="0.88" android:toYScale="1"
android:pivotX="50%" android:pivotY="55%" android:duration="320" android:interpolator="@android:anim/overshoot_interpolator" />
<translate android:fromYDelta="4%" android:toYDelta="0" android:duration="300" android:interpolator="@android:anim/decelerate_interpolator" />
</set>
5 changes: 5 additions & 0 deletions app/src/main/res/anim/tfm_dialog_out.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<alpha android:fromAlpha="1" android:toAlpha="0" android:duration="140" android:interpolator="@android:anim/accelerate_interpolator" />
<scale android:fromXScale="1" android:toXScale="0.94" android:fromYScale="1" android:toYScale="0.94"
android:pivotX="50%" android:pivotY="50%" android:duration="160" android:interpolator="@android:anim/accelerate_interpolator" />
</set>
6 changes: 6 additions & 0 deletions app/src/main/res/anim/tfm_enter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<alpha android:fromAlpha="0" android:toAlpha="1" android:duration="300" android:interpolator="@android:interpolator/decelerate_quad" />
<scale android:fromXScale="0.94" android:toXScale="1" android:fromYScale="0.94" android:toYScale="1"
android:pivotX="50%" android:pivotY="50%" android:duration="360" android:interpolator="@android:interpolator/fast_out_slow_in" />
<translate android:fromYDelta="3%" android:toYDelta="0" android:duration="360" android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
5 changes: 5 additions & 0 deletions app/src/main/res/anim/tfm_exit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<alpha android:fromAlpha="1" android:toAlpha="0" android:duration="220" android:interpolator="@android:interpolator/accelerate_quad" />
<scale android:fromXScale="1" android:toXScale="1.04" android:fromYScale="1" android:toYScale="1.04"
android:pivotX="50%" android:pivotY="50%" android:duration="260" android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
5 changes: 5 additions & 0 deletions app/src/main/res/anim/tfm_pop_enter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<alpha android:fromAlpha="0" android:toAlpha="1" android:duration="280" android:interpolator="@android:interpolator/decelerate_quad" />
<scale android:fromXScale="1.05" android:toXScale="1" android:fromYScale="1.05" android:toYScale="1"
android:pivotX="50%" android:pivotY="50%" android:duration="320" android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
6 changes: 6 additions & 0 deletions app/src/main/res/anim/tfm_pop_exit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<alpha android:fromAlpha="1" android:toAlpha="0" android:duration="220" android:interpolator="@android:interpolator/accelerate_quad" />
<scale android:fromXScale="1" android:toXScale="0.94" android:fromYScale="1" android:toYScale="0.94"
android:pivotX="50%" android:pivotY="50%" android:duration="260" android:interpolator="@android:interpolator/fast_out_slow_in" />
<translate android:fromYDelta="0" android:toYDelta="3%" android:duration="260" android:interpolator="@android:interpolator/fast_out_slow_in" />
</set>
4 changes: 4 additions & 0 deletions app/src/main/res/anim/tfm_sheet_in.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<translate android:fromYDelta="40%" android:toYDelta="0" android:duration="340" android:interpolator="@android:interpolator/fast_out_slow_in" />
<alpha android:fromAlpha="0" android:toAlpha="1" android:duration="220" android:interpolator="@android:anim/decelerate_interpolator" />
</set>
4 changes: 4 additions & 0 deletions app/src/main/res/anim/tfm_sheet_out.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false">
<translate android:fromYDelta="0" android:toYDelta="30%" android:duration="220" android:interpolator="@android:anim/accelerate_interpolator" />
<alpha android:fromAlpha="1" android:toAlpha="0" android:duration="200" android:interpolator="@android:anim/accelerate_interpolator" />
</set>
4 changes: 4 additions & 0 deletions app/src/main/res/values/ids.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<resources>
<item name="tfm_anim" type="id" />
<item name="tfm_pos" type="id" />
</resources>
46 changes: 41 additions & 5 deletions app/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,47 @@
<resources>
<style name="AppTheme" parent="android:style/Theme.Material.NoActionBar">
<item name="android:fontFamily">sans</item>
<item name="android:colorAccent">#74E0C4</item>
<item name="android:fontFamily">sans-serif</item>
<item name="android:colorAccent">#62E6C8</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:statusBarColor">#0B1020</item>
<item name="android:navigationBarColor">#0B1020</item>
<item name="android:windowBackground">#0B1020</item>
<item name="android:statusBarColor">#070B18</item>
<item name="android:navigationBarColor">#070B18</item>
<item name="android:windowBackground">#070B18</item>
<item name="android:windowActionModeOverlay">true</item>
<item name="android:windowAnimationStyle">@style/TfmActivityAnim</item>
</style>

<!-- Activity transitions: soft fade + depth, replaces the default slide. -->
<style name="TfmActivityAnim" parent="@android:style/Animation.Activity">
<item name="android:activityOpenEnterAnimation">@anim/tfm_enter</item>
<item name="android:activityOpenExitAnimation">@anim/tfm_exit</item>
<item name="android:activityCloseEnterAnimation">@anim/tfm_pop_enter</item>
<item name="android:activityCloseExitAnimation">@anim/tfm_pop_exit</item>
<item name="android:taskOpenEnterAnimation">@anim/tfm_enter</item>
<item name="android:taskOpenExitAnimation">@anim/tfm_exit</item>
<item name="android:taskCloseEnterAnimation">@anim/tfm_pop_enter</item>
<item name="android:taskCloseExitAnimation">@anim/tfm_pop_exit</item>
</style>

<!-- Dialog entrance: scale + fade with a tiny overshoot. -->
<style name="TfmDialogAnim" parent="@android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">@anim/tfm_dialog_in</item>
<item name="android:windowExitAnimation">@anim/tfm_dialog_out</item>
</style>

<style name="TfmSheetAnim" parent="@android:style/Animation.Dialog">
<item name="android:windowEnterAnimation">@anim/tfm_sheet_in</item>
<item name="android:windowExitAnimation">@anim/tfm_sheet_out</item>
</style>

<style name="TfmDialogDark" parent="android:style/Theme.Material.Dialog.Alert">
<item name="android:windowAnimationStyle">@style/TfmDialogAnim</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorAccent">#62E6C8</item>
</style>

<style name="TfmDialogLight" parent="android:style/Theme.Material.Light.Dialog.Alert">
<item name="android:windowAnimationStyle">@style/TfmDialogAnim</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorAccent">#00967F</item>
</style>
</resources>
Loading