mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-07-23 08:25:51 +00:00
feat: add Mining Simulation card to fill empty space in Pezkuwi Trust Score card
Cosmetic, client-side-only preview of a trust-score-weighted PEZ emission share, meant to incentivize referral usage (higher trust score -> visibly faster mining). Not tied to any real distribution mechanism or backend. - MiningSimulationFormula: pure calc. Rate per minute = (92.5M PEZ / 43200 min era) * (trustScore / 500,000 reference total) - trust score is a direct multiplier so zero trust score always yields zero rate. Diamonds only accrue while a 24h session is active. - MiningSimulationRepository: local-only persistence via the existing Preferences wrapper (same pattern as BannerVisibilityRepository), keyed per accountId. Tapping the square freezes the live total as the new base and starts a fresh 24h session - never resets progress on tap. A full 43200-minute era rolling over resets the total to 0 (that era's pool is considered distributed) independently of session taps. - UI: square button in the dashboard card's previously-empty right column, red when inactive (needs a tap), gold (#FDB813, matching the existing Trust Score color) while actively mining. Small Telegram icon opens https://t.me/DKSKurdistanBot via the existing Browserable mixin.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Mining Simulation square - tinted programmatically (red = inactive, gold = actively mining). -->
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
|
||||
<solid android:color="@android:color/white" />
|
||||
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
@@ -0,0 +1,14 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24"
|
||||
android:viewportHeight="24">
|
||||
|
||||
<path
|
||||
android:fillColor="#29A9EA"
|
||||
android:pathData="M12,2 C6.48,2 2,6.48 2,12 C2,17.52 6.48,22 12,22 C17.52,22 22,17.52 22,12 C22,6.48 17.52,2 12,2 Z" />
|
||||
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M17.3,7.15 L15.4,17.05 C15.25,17.7 14.85,17.85 14.3,17.55 L11.4,15.4 L10,16.75 C9.85,16.9 9.7,17.05 9.4,17.05 L9.6,13.9 L15.05,9 C15.3,8.8 15,8.65 14.7,8.85 L7.95,13.2 L5.1,12.3 C4.45,12.1 4.45,11.65 5.25,11.35 L16.5,7 C17.05,6.8 17.5,7.15 17.3,7.15 Z" />
|
||||
</vector>
|
||||
@@ -130,6 +130,63 @@
|
||||
android:text="@string/pezkuwi_dashboard_kurds_title"
|
||||
android:textColor="#7AFFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<!-- Mining Simulation: cosmetic, client-side-only preview of a trust-score-weighted
|
||||
emission share (see MiningSimulationFormula) - fills the empty space this
|
||||
right-side column otherwise leaves below the citizen-count stat. -->
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="10dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/pezkuwi_dashboard_mining_simulation_title"
|
||||
android:textColor="#7AFFFFFF"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pezkuwiDashboardMiningInfoButton"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:src="@drawable/ic_telegram" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/pezkuwiDashboardMiningSquare"
|
||||
android:layout_width="64dp"
|
||||
android:layout_height="64dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/bg_pezkuwi_mining_square"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pezkuwiDashboardMiningCount"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:paddingHorizontal="4dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
|
||||
Reference in New Issue
Block a user