Skip to content

Commit c704de3

Browse files
author
LeanBitLab
committed
refactor: optimize settings layout and update to v2.0
1 parent 565ea1f commit c704de3

7 files changed

Lines changed: 98 additions & 98 deletions

File tree

.geminiignore

Lines changed: 0 additions & 19 deletions
This file was deleted.

.gitignore

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# Gradle files
22
.gradle/
33
build/
4+
app/build/
5+
.cxx/
46

57
# Local configuration file (sdk user, etc)
68
local.properties
79

810
# Secrets and Keys
911
*.jks
12+
*.keystore
1013
keystore.properties
1114

1215
# Log files
1316
*.log
1417
build_log.txt
1518
widget_logs.txt
1619

17-
# IntelliJ / Android Studio
20+
# IntelliJ / Android Studio / VS Code
1821
.idea/
1922
*.iml
2023
*.iws
@@ -30,15 +33,15 @@ widget_logs.txt
3033
.DS_Store
3134
Thumbs.db
3235

33-
# Private Docs
36+
# Private Docs / Project Specific
3437
pdocs/
38+
docs/superpowers
39+
.superpowers
40+
refactor_xml.py
3541

3642
# CLI Context
3743
GEMINI.md
3844
.geminiignore
39-
4045
.antigravityignore
4146
.gemini/
42-
43-
docs/superpowers
44-
.superpowers
47+
.cline/

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ android {
1515
applicationId = "com.leanbitlab.lwidget"
1616
minSdk = 26
1717
targetSdk = 35
18-
versionCode = 14
19-
versionName = "1.9"
18+
versionCode = 15
19+
versionName = "2.0"
2020
}
2121

2222
signingConfigs {

app/src/main/java/com/leanbitlab/lwidget/MainActivity.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,13 @@ class MainActivity : AppCompatActivity() {
675675
}
676676
recyclerView.layoutManager = androidx.recyclerview.widget.LinearLayoutManager(this)
677677
recyclerView.adapter = adapter
678+
679+
// Intercept touch events so parent NestedScrollView doesn't steal them
680+
recyclerView.setOnTouchListener { v, event ->
681+
v.parent.requestDisallowInterceptTouchEvent(true)
682+
false
683+
}
684+
678685

679686
val callback = object : androidx.recyclerview.widget.ItemTouchHelper.SimpleCallback(
680687
androidx.recyclerview.widget.ItemTouchHelper.UP or androidx.recyclerview.widget.ItemTouchHelper.DOWN, 0

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

Lines changed: 75 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,73 +1392,6 @@
13921392
</LinearLayout>
13931393
</com.google.android.material.card.MaterialCardView>
13941394

1395-
<!-- Subsection: Reorder -->
1396-
<com.google.android.material.card.MaterialCardView
1397-
android:id="@+id/card_appearance_reorder"
1398-
style="@style/Widget.Material3.CardView.Outlined"
1399-
android:layout_width="match_parent"
1400-
android:layout_height="wrap_content"
1401-
android:layout_marginBottom="6dp"
1402-
app:cardBackgroundColor="?attr/colorSurfaceContainerLow">
1403-
1404-
<LinearLayout
1405-
android:layout_width="match_parent"
1406-
android:layout_height="wrap_content"
1407-
android:orientation="vertical">
1408-
1409-
<LinearLayout
1410-
android:id="@+id/header_appearance_reorder"
1411-
android:layout_width="match_parent"
1412-
android:layout_height="wrap_content"
1413-
android:orientation="horizontal"
1414-
android:gravity="center_vertical"
1415-
android:paddingStart="14dp"
1416-
android:paddingEnd="14dp"
1417-
android:paddingTop="10dp"
1418-
android:paddingBottom="10dp"
1419-
android:background="?attr/selectableItemBackground"
1420-
android:clickable="true"
1421-
android:focusable="true">
1422-
1423-
<TextView
1424-
android:id="@+id/header_title_appearance_reorder"
1425-
android:layout_width="0dp"
1426-
android:layout_height="wrap_content"
1427-
android:layout_weight="1"
1428-
android:text="REORDER"
1429-
android:textColor="?attr/colorOnSurfaceVariant"
1430-
android:textSize="13sp"
1431-
android:textStyle="bold"
1432-
android:letterSpacing="0.05"/>
1433-
1434-
<ImageView
1435-
android:id="@+id/header_chevron_appearance_reorder"
1436-
android:layout_width="20dp"
1437-
android:layout_height="20dp"
1438-
android:src="@drawable/ic_chevron_down"
1439-
android:rotation="0"
1440-
app:tint="?attr/colorOnSurfaceVariant"
1441-
android:contentDescription="Expand/collapse"/>
1442-
</LinearLayout>
1443-
1444-
<LinearLayout
1445-
android:id="@+id/content_appearance_reorder"
1446-
android:layout_width="match_parent"
1447-
android:layout_height="wrap_content"
1448-
android:orientation="vertical"
1449-
android:visibility="gone"
1450-
android:paddingStart="8dp"
1451-
android:paddingEnd="8dp"
1452-
android:paddingBottom="8dp">
1453-
1454-
<include layout="@layout/settings_reorder_section"
1455-
android:id="@+id/row_reorder_section"
1456-
android:layout_width="match_parent"
1457-
android:layout_height="wrap_content"/>
1458-
</LinearLayout>
1459-
</LinearLayout>
1460-
</com.google.android.material.card.MaterialCardView>
1461-
14621395
<!-- Subsection: Transparency -->
14631396
<com.google.android.material.card.MaterialCardView
14641397
android:id="@+id/card_appearance_transparency"
@@ -1530,6 +1463,81 @@
15301463
</LinearLayout>
15311464
</com.google.android.material.card.MaterialCardView>
15321465

1466+
<!-- FEATURE: Reorder -->
1467+
<com.google.android.material.card.MaterialCardView
1468+
android:id="@+id/card_appearance_reorder"
1469+
style="@style/Widget.Material3.CardView.Outlined"
1470+
android:layout_width="match_parent"
1471+
android:layout_height="wrap_content"
1472+
android:layout_marginBottom="8dp"
1473+
app:cardBackgroundColor="?attr/colorSurfaceContainerHigh">
1474+
1475+
<LinearLayout
1476+
android:layout_width="match_parent"
1477+
android:layout_height="wrap_content"
1478+
android:orientation="vertical">
1479+
1480+
<LinearLayout
1481+
android:id="@+id/header_appearance_reorder"
1482+
android:layout_width="match_parent"
1483+
android:layout_height="wrap_content"
1484+
android:orientation="horizontal"
1485+
android:gravity="center_vertical"
1486+
android:paddingStart="16dp"
1487+
android:paddingEnd="16dp"
1488+
android:paddingTop="14dp"
1489+
android:paddingBottom="14dp"
1490+
android:background="?attr/selectableItemBackground"
1491+
android:clickable="true"
1492+
android:focusable="true">
1493+
1494+
<ImageView
1495+
android:id="@+id/header_icon_appearance_reorder"
1496+
android:layout_width="24dp"
1497+
android:layout_height="24dp"
1498+
android:layout_marginEnd="12dp"
1499+
android:src="@android:drawable/ic_menu_sort_by_size"
1500+
android:contentDescription="Icon"
1501+
app:tint="?attr/colorPrimary"/>
1502+
1503+
<TextView
1504+
android:id="@+id/header_title_appearance_reorder"
1505+
android:layout_width="0dp"
1506+
android:layout_height="wrap_content"
1507+
android:layout_weight="1"
1508+
android:text="Reorder"
1509+
android:textColor="?attr/colorOnSurface"
1510+
android:textSize="16sp"
1511+
android:textStyle="bold" />
1512+
1513+
<ImageView
1514+
android:id="@+id/header_chevron_appearance_reorder"
1515+
android:layout_width="24dp"
1516+
android:layout_height="24dp"
1517+
android:src="@drawable/ic_chevron_down"
1518+
android:rotation="0"
1519+
app:tint="?attr/colorOnSurfaceVariant"
1520+
android:contentDescription="Expand/collapse"/>
1521+
</LinearLayout>
1522+
1523+
<LinearLayout
1524+
android:id="@+id/content_appearance_reorder"
1525+
android:layout_width="match_parent"
1526+
android:layout_height="wrap_content"
1527+
android:orientation="vertical"
1528+
android:visibility="gone"
1529+
android:paddingStart="8dp"
1530+
android:paddingEnd="8dp"
1531+
android:paddingBottom="8dp">
1532+
1533+
<include layout="@layout/settings_reorder_section"
1534+
android:id="@+id/row_reorder_section"
1535+
android:layout_width="match_parent"
1536+
android:layout_height="wrap_content"/>
1537+
</LinearLayout>
1538+
</LinearLayout>
1539+
</com.google.android.material.card.MaterialCardView>
1540+
15331541
</LinearLayout>
15341542
</androidx.core.widget.NestedScrollView>
15351543

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<androidx.recyclerview.widget.RecyclerView
1010
android:id="@+id/reorder_recycler"
1111
android:layout_width="match_parent"
12-
android:layout_height="300dp"
13-
android:nestedScrollingEnabled="false" />
12+
android:layout_height="280dp"
13+
android:nestedScrollingEnabled="true" />
14+
1415
</LinearLayout>

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
<string name="section_changelog">Note \u0026 Changelog</string>
3434
<string name="changelog_version">Version %s</string>
3535
<string name="changelog_note">Lwidget works without any background service. However, some devices may kill the app to save battery, which can stop widget updates. To fix this:\n\n• Mark Lwidget as non-battery-optimized in your device settings.\n• Or, enable Keep Alive — a lightweight background service that keeps the widget updating reliably.\n• Or, enable the Step Counter — it uses the same service and also counts your daily steps.</string>
36-
<string name="changelog_content">What\'s New in v1.9:\n• Calendar events now show \"Today\" and \"Tomorrow\" instead of weekday names\n• New \"Keep Alive\" toggle — keeps widget updating reliably without needing Step Counter\n• Improved notification text based on active mode\n• Code cleanup and optimizations</string>
37-
<string name="changelog_testing_notice">Lwidget is now available on Google Play! If you enjoy it, please leave a rating — it helps others discover the app.</string>
36+
<string name="changelog_content">What\'s New in v2.0:\n• Added Reorder — you can now sort widget items exactly how you want\n• Uniform Customization — consistent design language across all settings\n• Settings Page Improvements — cleaner layout and better navigation\n• Performance optimizations and bug fixes</string>
37+
<string name="changelog_testing_notice">If you enjoy Lwidget, please leave a rating on Google Play — it helps others discover the app.</string>
3838
<string name="github_source_code">Source Code (GitHub)</string>
3939
<string name="privacy_policy">Privacy Policy</string>
4040

0 commit comments

Comments
 (0)