Initial release: Claude Pro usage widget for Android

This commit is contained in:
2026-05-22 15:11:56 +00:00
commit 33ac02ead4
639 changed files with 52708 additions and 0 deletions
@@ -0,0 +1,35 @@
#Fri May 22 14:33:39 UTC 2026
me.khodak.claudeusage.app-main-43\:/mipmap-xxxhdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xxxhdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-mergeDebugResources-40\:/layout/activity_login.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/layout_activity_login.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-xxhdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xxhdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-main-43\:/drawable/ic_launcher_fg.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/drawable_ic_launcher_fg.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-mdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-mdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-xxhdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xxhdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-mergeDebugResources-40\:/layout/widget_layout.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/layout_widget_layout.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-xhdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xhdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-hdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-hdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-hdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-hdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-mdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-mdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-xxxhdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xxxhdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-xxxhdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xxxhdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-mergeDebugResources-39\:/layout/activity_login.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/layout_activity_login.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-xxxhdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xxxhdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-mergeDebugResources-39\:/layout/widget_layout.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/layout_widget_layout.xml.flat
me.khodak.claudeusage.app-main-43\:/drawable/widget_background.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/drawable_widget_background.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-mdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-mdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-main-43\:/xml/widget_info.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/xml_widget_info.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-xxhdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xxhdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-xhdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xhdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-mergeDebugResources-40\:/layout/widget_layout_small.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/layout_widget_layout_small.xml.flat
me.khodak.claudeusage.app-main-42\:/drawable/widget_background.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/drawable_widget_background.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-hdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-hdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-xhdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xhdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-mergeDebugResources-40\:/layout/activity_main.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/layout_activity_main.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-mdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-mdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-hdpi/ic_launcher_round.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-hdpi_ic_launcher_round.xml.flat
me.khodak.claudeusage.app-main-42\:/xml/widget_info.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/xml_widget_info.xml.flat
me.khodak.claudeusage.app-main-42\:/mipmap-xxhdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xxhdpi_ic_launcher.xml.flat
me.khodak.claudeusage.app-main-43\:/drawable/badge_background.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/drawable_badge_background.xml.flat
me.khodak.claudeusage.app-mergeDebugResources-39\:/layout/activity_main.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/layout_activity_main.xml.flat
me.khodak.claudeusage.app-main-42\:/drawable/ic_launcher_fg.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/drawable_ic_launcher_fg.xml.flat
me.khodak.claudeusage.app-main-43\:/mipmap-xhdpi/ic_launcher.xml=/home/amir/android-projects/claude-usage-widget/app/build/intermediates/merged_res/debug/mipmap-xhdpi_ic_launcher.xml.flat
File diff suppressed because one or more lines are too long
@@ -0,0 +1,244 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:background="#121212">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="24dp"
android:gravity="center_horizontal">
<!-- Logo / Title -->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:text="⬡"
android:textColor="#CC785C"
android:textSize="48sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Claude Usage"
android:textColor="#FFFFFF"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Home screen widget"
android:textColor="#888888"
android:textSize="14sp" />
<!-- Loading indicator -->
<ProgressBar
android:id="@+id/progressIndicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:visibility="gone" />
<!-- LOGGED OUT state -->
<LinearLayout
android:id="@+id/layoutLoggedOut"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="48dp"
android:gravity="center">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Sign in with your Claude account to track Pro usage on your home screen widget."
android:textColor="#AAAAAA"
android:textSize="14sp"
android:textAlignment="center"
android:lineSpacingExtra="4dp" />
<Button
android:id="@+id/btnLogin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="Sign in to Claude"
android:backgroundTint="#CC785C"
android:textColor="#FFFFFF" />
</LinearLayout>
<!-- LOGGED IN state -->
<LinearLayout
android:id="@+id/layoutLoggedIn"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginTop="32dp"
android:visibility="gone">
<!-- Usage card -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/widget_background"
android:padding="20dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="CURRENT USAGE"
android:textColor="#888888"
android:textSize="11sp"
android:letterSpacing="0.1" />
<TextView
android:id="@+id/tvUsage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="—"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />
<ProgressBar
android:id="@+id/progressBar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="8dp"
android:layout_marginTop="12dp"
android:max="100"
android:progress="0"
android:progressTint="#CC785C"
android:progressBackgroundTint="#3A3A3A" />
<TextView
android:id="@+id/tvReset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="#888888"
android:textSize="13sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="WEEKLY"
android:textColor="#888888"
android:textSize="11sp"
android:letterSpacing="0.1" />
<TextView
android:id="@+id/tvWeeklyUsage"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="—"
android:textColor="#FFFFFF"
android:textSize="16sp"
android:textStyle="bold" />
<ProgressBar
android:id="@+id/progressBarWeekly"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="8dp"
android:layout_marginTop="8dp"
android:max="100"
android:progress="0"
android:progressTint="#7B8FCC"
android:progressBackgroundTint="#3A3A3A" />
<TextView
android:id="@+id/tvWeeklyReset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="#888888"
android:textSize="13sp" />
<TextView
android:id="@+id/tvUpdated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:textColor="#666666"
android:textSize="12sp" />
<TextView
android:id="@+id/tvError"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:textColor="#FF7070"
android:textSize="12sp"
android:visibility="gone" />
</LinearLayout>
<Button
android:id="@+id/btnRefresh"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:text="Refresh Now"
android:backgroundTint="#CC785C"
android:textColor="#FFFFFF" />
<TextView
android:id="@+id/tvWidgetHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="Long-press your home screen → Widgets → Claude Usage to add the widget"
android:textColor="#666666"
android:textSize="13sp"
android:textAlignment="center"
android:lineSpacingExtra="4dp"
android:padding="8dp" />
<Button
android:id="@+id/btnLogout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Sign Out"
android:backgroundTint="#2A2A2A"
android:textColor="#888888" />
<Button
android:id="@+id/btnDebug"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:text="Show API Debug"
android:backgroundTint="#1A1A1A"
android:textColor="#555555"
android:textSize="12sp" />
<TextView
android:id="@+id/tvDebugInfo"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:padding="12dp"
android:background="#1A1A1A"
android:textColor="#888888"
android:textSize="11sp"
android:fontFamily="monospace"
android:visibility="gone" />
</LinearLayout>
</LinearLayout>
</ScrollView>
@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_root"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/widget_background"
android:padding="14dp">
<!-- Header -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Claude Pro"
android:textColor="#FFFFFF"
android:textSize="13sp"
android:textStyle="bold" />
<ImageButton
android:id="@+id/btn_refresh"
android:layout_width="24dp"
android:layout_height="24dp"
android:src="@android:drawable/ic_menu_rotate"
android:background="@android:color/transparent"
android:tint="#999999"
android:contentDescription="Refresh" />
</LinearLayout>
<!-- Divider — View is not in RemoteViews allowlist on Android 12+; use TextView instead -->
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="8dp"
android:layout_marginBottom="10dp"
android:background="#2A2A2A" />
<!-- 5-hour window bar -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="SESSION"
android:textColor="#555555"
android:textSize="9sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_session_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="—"
android:textColor="#FFFFFF"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
<ProgressBar
android:id="@+id/progress_bar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_marginTop="5dp"
android:max="100"
android:progress="0"
android:progressTint="#CC785C"
android:progressBackgroundTint="#252525" />
<TextView
android:id="@+id/tv_session_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text=""
android:textColor="#666666"
android:textSize="9sp" />
<!-- 7-day window bar -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
android:layout_marginTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="WEEKLY"
android:textColor="#555555"
android:textSize="9sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_weekly_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="—"
android:textColor="#FFFFFF"
android:textSize="13sp"
android:textStyle="bold" />
</LinearLayout>
<ProgressBar
android:id="@+id/progress_bar_weekly"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="5dp"
android:layout_marginTop="5dp"
android:max="100"
android:progress="0"
android:progressTint="#7B8FCC"
android:progressBackgroundTint="#252525" />
<TextView
android:id="@+id/tv_weekly_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text=""
android:textColor="#666666"
android:textSize="9sp" />
<!-- Footer -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="8dp"
android:gravity="center_vertical">
<TextView
android:id="@+id/tv_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text=""
android:textColor="#CC785C"
android:textSize="9sp"
android:singleLine="true"
android:ellipsize="end" />
<TextView
android:id="@+id/tv_updated"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text=""
android:textColor="#444444"
android:textSize="9sp" />
</LinearLayout>
</LinearLayout>