Skip to content

Commit 64557b2

Browse files
committed
adding display placeholder
1 parent 03aea08 commit 64557b2

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

app/src/main/java/com/rama/mako/activities/SettingsActivity.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class SettingsActivity : CsActivity() {
8989
bindWdCheckbox(R.id.show_date, "show_date", true, dependentViewId = R.id.show_year_day)
9090
bindWdCheckbox(R.id.show_year_day, "show_year_day", true)
9191
bindWdCheckbox(R.id.show_battery, "show_battery", true)
92+
bindWdCheckbox(R.id.screen_time_display, "show_screen_time", true)
9293
bindWdCheckbox(R.id.use_pixel_font, "use_pixel_font", false) { refreshFont() }
9394
}
9495

app/src/main/java/com/rama/mako/managers/AppListManager.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,15 @@ class AppListManager(
226226
val pkg = app.activityInfo.packageName
227227

228228
val label = view.findViewById<TextView>(R.id.open_app_button)
229+
val timeDisplay = view.findViewById<TextView>(R.id.screen_time_display)
229230
val emptySpace = view.findViewById<View>(R.id.empty_space)
230231
label.text = getDisplayName(app)
231232

233+
timeDisplay.setOnClickListener { launchApp(pkg) }
232234
label.setOnClickListener { launchApp(pkg) }
233235
emptySpace.setOnClickListener { launchApp(pkg) }
234236

237+
timeDisplay.setOnLongClickListener { showContextMenu(it, app); true }
235238
label.setOnLongClickListener { showContextMenu(it, app); true }
236239
emptySpace.setOnLongClickListener {
237240
context.startActivity(Intent(context, SettingsActivity::class.java))

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,21 @@
1111
android:layout_height="wrap_content"
1212
android:paddingTop="12sp"
1313
android:paddingBottom="12sp"
14-
android:paddingEnd="12sp"
1514
android:textSize="32sp"
15+
android:text="App Label"
1616
android:textColor="@color/foreground_color" />
17-
17+
18+
<TextView
19+
android:id="@+id/screen_time_display"
20+
android:layout_width="wrap_content"
21+
android:layout_height="wrap_content"
22+
android:paddingTop="12sp"
23+
android:paddingBottom="12sp"
24+
android:paddingStart="12sp"
25+
android:textSize="16sp"
26+
android:text="45m"
27+
android:textColor="@color/accent_tertiary" />
28+
1829
<FrameLayout
1930
android:id="@+id/empty_space"
2031
android:layout_width="0dp"

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,21 @@
147147
android:layout_height="wrap_content"
148148
android:text="@string/show_battery" />
149149

150+
<TextView
151+
android:layout_width="wrap_content"
152+
android:layout_height="wrap_content"
153+
android:layout_marginBottom="8sp"
154+
android:textSize="16sp"
155+
android:textColor="@color/foreground_color"
156+
android:text="Apps"
157+
android:textStyle="bold" />
158+
159+
<com.rama.mako.widgets.WdCheckbox
160+
android:id="@+id/enable_screen_time"
161+
android:layout_width="match_parent"
162+
android:layout_height="wrap_content"
163+
android:text="Show screen time" />
164+
150165
<TextView
151166
android:layout_width="wrap_content"
152167
android:layout_height="wrap_content"

0 commit comments

Comments
 (0)