Skip to content
This repository was archived by the owner on Apr 14, 2025. It is now read-only.

Commit 9d749af

Browse files
Add custom theme, unhardcode a string
1 parent e11404f commit 9d749af

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

app/src/main/java/com/spse/javamodsoptimiser/MainActivity.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import android.content.Context;
55
import android.content.DialogInterface;
66
import android.content.pm.PackageManager;
7+
import android.content.res.Resources;
78
import android.graphics.Color;
89
import android.graphics.drawable.ColorDrawable;
910
import android.os.Bundle;
@@ -115,6 +116,8 @@ public void onClick(View view) {
115116
public void ShowFilePicker(){
116117
//Prep: Create custom filter
117118
List<String> filters = Arrays.asList("zip","jar");
119+
StorageChooser.Theme theme = new StorageChooser.Theme(this);
120+
theme.setScheme(getResources().getIntArray(R.array.paranoid_theme));
118121

119122
// 1. Initialize dialog
120123
final StorageChooser chooser = new StorageChooser.Builder()
@@ -124,7 +127,9 @@ public void ShowFilePicker(){
124127
.allowCustomPath(true)
125128
.setType(StorageChooser.FILE_PICKER)
126129
.customFilter(filters)
127-
.setDialogTitle("Choose some mods (.zip/.jar)")
130+
.setDialogTitle(getResources().getString(R.string.file_picker_choice))
131+
.setTheme(theme)
132+
128133

129134

130135

app/src/main/res/values/array.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<array name="paranoid_theme">
4+
<!-- Overview -->
5+
<item>#151515</item> <!-- Top Header bg -->
6+
<item>@color/Primary</item> <!-- header text -->
7+
<item>#252525</item> <!-- list bg -->
8+
<item>@android:color/white</item> <!-- storage list name text -->
9+
<item>#e1e1e1</item> <!-- free space text -->
10+
<item>@color/Accent</item> <!-- memory bar -->
11+
12+
<!-- secondary dialog colors -->
13+
<item>#E1E1E1</item> <!-- folder tint -->
14+
<item>#252525</item> <!-- list bg -->
15+
<item>@android:color/white</item> <!-- list text -->
16+
<item>#151515</item> <!-- address bar tint -->
17+
<item>@color/chevronBgColor</item> <!-- new folder hint tint -->
18+
<item>#2c9633</item> <!-- select button color -->
19+
<item>#da6c6c</item> <!-- new folder layour bg -->
20+
<item>#2c9633</item> <!-- fab multiselect color -->
21+
<item>#151515</item> <!-- address bar bg -->
22+
</array>
23+
</resources>

0 commit comments

Comments
 (0)