Skip to content

Commit eda172e

Browse files
Sirpixelalotclaude
andcommitted
Update to version 1.3 with Material 3 redesign
Migrated app to Material 3 (Material Design 3) for a more modern and polished user interface with improved dialogs, typography, and visual components. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ee91f66 commit eda172e

File tree

7 files changed

+45
-59
lines changed

7 files changed

+45
-59
lines changed

app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ android {
1818
applicationId "com.renpytool"
1919
minSdk 33
2020
targetSdk 34
21-
versionCode 2
22-
versionName "1.2"
21+
versionCode 3
22+
versionName "1.3"
2323

2424
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2525

@@ -65,7 +65,6 @@ dependencies {
6565
implementation libs.material
6666
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
6767
implementation 'androidx.documentfile:documentfile:1.0.1'
68-
implementation 'com.google.android.material:material:1.11.0'
6968

7069
// JSON parsing for update checker
7170
implementation 'com.google.code.gson:gson:2.10.1'

app/src/main/java/com/renpytool/MainActivity.java

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import androidx.activity.result.ActivityResultLauncher;
1818
import androidx.activity.result.contract.ActivityResultContracts;
1919
import androidx.annotation.NonNull;
20-
import androidx.appcompat.app.AlertDialog;
2120
import androidx.appcompat.app.AppCompatActivity;
2221
import androidx.core.app.ActivityCompat;
2322
import androidx.core.content.ContextCompat;
@@ -26,6 +25,8 @@
2625
import com.chaquo.python.Python;
2726
import com.chaquo.python.android.AndroidPlatform;
2827
import com.google.android.material.card.MaterialCardView;
28+
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
29+
import com.google.android.material.textfield.TextInputEditText;
2930

3031
import java.util.ArrayList;
3132
import java.util.List;
@@ -37,8 +38,7 @@ public class MainActivity extends AppCompatActivity {
3738
private static final int PERMISSION_REQUEST_CODE = 100;
3839

3940
private MaterialCardView cardExtract, cardCreate, cardDecompile;
40-
private TextView tvStatus, tvExtractStatus, tvCreateStatus, tvDecompileStatus;
41-
private ProgressBar progressBar;
41+
private TextView tvExtractStatus, tvCreateStatus, tvDecompileStatus;
4242

4343
private Python python;
4444
private PyObject rpaModule;
@@ -92,11 +92,9 @@ private void initViews() {
9292
cardExtract = findViewById(R.id.card_extract);
9393
cardCreate = findViewById(R.id.card_create);
9494
cardDecompile = findViewById(R.id.card_decompile);
95-
tvStatus = findViewById(R.id.tv_status);
9695
tvExtractStatus = findViewById(R.id.tv_extract_status);
9796
tvCreateStatus = findViewById(R.id.tv_create_status);
9897
tvDecompileStatus = findViewById(R.id.tv_decompile_status);
99-
progressBar = findViewById(R.id.progress_bar);
10098

10199
// Set up click listeners
102100
cardExtract.setOnClickListener(v -> startExtractFlow());
@@ -109,7 +107,7 @@ private void checkPermissions() {
109107
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
110108
// Android 11 and above - use MANAGE_EXTERNAL_STORAGE
111109
if (!Environment.isExternalStorageManager()) {
112-
new AlertDialog.Builder(this)
110+
new MaterialAlertDialogBuilder(this)
113111
.setTitle("Storage Permission Required")
114112
.setMessage("This app needs access to manage files for RPA operations.")
115113
.setPositiveButton("Grant", (dialog, which) -> {
@@ -287,8 +285,9 @@ private void startCreateFlow() {
287285
}
288286

289287
private void showOutputFileNameDialog() {
290-
android.widget.EditText etFileName = new android.widget.EditText(this);
291-
etFileName.setHint("archive.rpa");
288+
// Inflate custom dialog layout
289+
View dialogView = getLayoutInflater().inflate(R.layout.dialog_input, null);
290+
TextInputEditText etFileName = dialogView.findViewById(R.id.editText);
292291
etFileName.setText("archive.rpa");
293292

294293
// Determine the default output directory
@@ -300,10 +299,10 @@ private void showOutputFileNameDialog() {
300299
defaultOutputDir = selectedSourcePath;
301300
}
302301

303-
new AlertDialog.Builder(this)
302+
new MaterialAlertDialogBuilder(this)
304303
.setTitle("Output File Name")
305304
.setMessage("Enter the name for the output RPA file:")
306-
.setView(etFileName)
305+
.setView(dialogView)
307306
.setPositiveButton("Create", (dialog, which) -> {
308307
String fileName = etFileName.getText().toString().trim();
309308
if (!fileName.isEmpty()) {
@@ -831,16 +830,12 @@ private void performDecompile(String sourceDirPath) {
831830
}
832831

833832
private void showProgress(String message) {
834-
progressBar.setVisibility(View.VISIBLE);
835-
tvStatus.setText(message);
836833
cardExtract.setEnabled(false);
837834
cardCreate.setEnabled(false);
838835
cardDecompile.setEnabled(false);
839836
}
840837

841838
private void hideProgress() {
842-
progressBar.setVisibility(View.GONE);
843-
tvStatus.setText("Ready");
844839
cardExtract.setEnabled(true);
845840
cardCreate.setEnabled(true);
846841
cardDecompile.setEnabled(true);
@@ -851,7 +846,7 @@ private void showSuccess(String message) {
851846
}
852847

853848
private void showError(String message) {
854-
new AlertDialog.Builder(this)
849+
new MaterialAlertDialogBuilder(this)
855850
.setTitle("Error")
856851
.setMessage(message)
857852
.setPositiveButton("OK", null)
@@ -925,7 +920,7 @@ private void showUpdateDialog(VersionInfo versionInfo) {
925920
currentVersion
926921
);
927922

928-
new AlertDialog.Builder(this)
923+
new MaterialAlertDialogBuilder(this)
929924
.setTitle("Update Available")
930925
.setMessage(message)
931926
.setPositiveButton("Update", (dialog, which) -> {

app/src/main/java/com/renpytool/ProgressActivity.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
import android.widget.ProgressBar;
1010
import android.widget.TextView;
1111

12-
import androidx.appcompat.app.AlertDialog;
1312
import androidx.appcompat.app.AppCompatActivity;
1413

14+
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
15+
1516
import java.util.Locale;
1617

1718
/**
@@ -156,7 +157,7 @@ private void updateUI(ProgressData data) {
156157
private void handleCompletion(ProgressData data) {
157158
if (data.isCompleted()) {
158159
// Show success dialog
159-
new AlertDialog.Builder(this)
160+
new MaterialAlertDialogBuilder(this)
160161
.setTitle("Success")
161162
.setMessage(String.format(Locale.US,
162163
"Operation completed successfully!\n\nProcessed %d files in %s",
@@ -174,7 +175,7 @@ private void handleCompletion(ProgressData data) {
174175
? data.errorMessage
175176
: "Operation failed";
176177

177-
new AlertDialog.Builder(this)
178+
new MaterialAlertDialogBuilder(this)
178179
.setTitle("Error")
179180
.setMessage(errorMessage)
180181
.setPositiveButton("OK", (dialog, which) -> {

app/src/main/res/layout/activity_main.xml

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -33,41 +33,6 @@
3333
android:orientation="vertical"
3434
android:padding="16dp">
3535

36-
<!-- Status Section -->
37-
<com.google.android.material.card.MaterialCardView
38-
android:layout_width="match_parent"
39-
android:layout_height="wrap_content"
40-
android:layout_marginBottom="16dp"
41-
app:cardElevation="2dp"
42-
app:cardCornerRadius="12dp">
43-
44-
<LinearLayout
45-
android:layout_width="match_parent"
46-
android:layout_height="wrap_content"
47-
android:orientation="vertical"
48-
android:padding="16dp">
49-
50-
<TextView
51-
android:id="@+id/tv_status"
52-
android:layout_width="match_parent"
53-
android:layout_height="wrap_content"
54-
android:text="Ready"
55-
android:textSize="24sp"
56-
android:textStyle="bold" />
57-
58-
<ProgressBar
59-
android:id="@+id/progress_bar"
60-
style="?android:attr/progressBarStyleHorizontal"
61-
android:layout_width="match_parent"
62-
android:layout_height="wrap_content"
63-
android:layout_marginTop="8dp"
64-
android:indeterminate="true"
65-
android:visibility="gone" />
66-
67-
</LinearLayout>
68-
69-
</com.google.android.material.card.MaterialCardView>
70-
7136
<!-- Extract Card -->
7237
<com.google.android.material.card.MaterialCardView
7338
android:id="@+id/card_extract"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
android:layout_width="match_parent"
5+
android:layout_height="wrap_content"
6+
android:orientation="vertical"
7+
android:padding="16dp">
8+
9+
<com.google.android.material.textfield.TextInputLayout
10+
android:id="@+id/textInputLayout"
11+
android:layout_width="match_parent"
12+
android:layout_height="wrap_content"
13+
android:hint="File name"
14+
app:boxBackgroundMode="outline"
15+
app:endIconMode="clear_text">
16+
17+
<com.google.android.material.textfield.TextInputEditText
18+
android:id="@+id/editText"
19+
android:layout_width="match_parent"
20+
android:layout_height="wrap_content"
21+
android:inputType="text"
22+
android:singleLine="true" />
23+
24+
</com.google.android.material.textfield.TextInputLayout>
25+
26+
</LinearLayout>

app/src/main/res/values-night/themes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22
<!-- Base application theme. -->
3-
<style name="Theme.Rentool" parent="Theme.MaterialComponents.DayNight.NoActionBar">
3+
<style name="Theme.Rentool" parent="Theme.Material3.DayNight.NoActionBar">
44
<!-- Primary brand color. -->
55
<item name="colorPrimary">@color/purple_200</item>
66
<item name="colorPrimaryVariant">@color/purple_700</item>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<resources xmlns:tools="http://schemas.android.com/tools">
22
<!-- Base application theme. -->
3-
<style name="Theme.Rentool" parent="Theme.MaterialComponents.DayNight.NoActionBar">
3+
<style name="Theme.Rentool" parent="Theme.Material3.DayNight.NoActionBar">
44
<!-- Primary brand color. -->
55
<item name="colorPrimary">@color/purple_500</item>
66
<item name="colorPrimaryVariant">@color/purple_700</item>

0 commit comments

Comments
 (0)