Improve installer & related UI

This commit is contained in:
Rahul Kumar Patel
2021-02-25 08:57:30 +05:30
parent b877552634
commit 0e1ae6364d
34 changed files with 1379 additions and 158 deletions

View File

@@ -0,0 +1,28 @@
<!--
~ Aurora Store
~ Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
~
~ Aurora Store is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 2 of the License, or
~ (at your option) any later version.
~
~ Aurora Store is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Aurora Store. If not, see <http://www.gnu.org/licenses/>.
~
-->
<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="#FF000000"
android:pathData="M9,2v2L5,4l-0.001,10h14L19,4h-4L15,2h5a1,1 0,0 1,1 1v18a1,1 0,0 1,-1 1L4,22a1,1 0,0 1,-1 -1L3,3a1,1 0,0 1,1 -1h5zM18.999,16h-14L5,20h14l-0.001,-4zM17,17v2h-2v-2h2zM13,2v5h3l-4,4 -4,-4h3L11,2h2z"/>
</vector>

View File

@@ -137,7 +137,7 @@
android:text="@string/account_login_using"
android:textAlignment="center" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_google"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"
@@ -146,7 +146,7 @@
app:btnStateIcon="@drawable/ic_google"
app:btnStateText="@string/account_google" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_anonymous"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"
@@ -187,7 +187,7 @@
android:text="@string/account_logout"
android:textAlignment="center" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_logout"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"

View File

@@ -96,7 +96,7 @@
android:text="@string/account_login_using"
android:textAlignment="center" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_google"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"
@@ -105,7 +105,7 @@
app:btnStateIcon="@drawable/ic_google"
app:btnStateText="@string/account_google" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_anonymous"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"

View File

@@ -36,9 +36,13 @@
<ViewFlipper
android:id="@+id/view_flipper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:animateFirstView="true"
android:inAnimation="@anim/fade_in"
android:outAnimation="@anim/fade_out"
tools:ignore="UselessParent">
<com.aurora.store.view.custom.ActionButton
<com.aurora.store.view.custom.layouts.button.ActionButton
android:id="@+id/btn_download"
android:layout_width="match_parent"
android:layout_height="@dimen/height_button"
@@ -114,7 +118,6 @@
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img_cancel"
android:layout_width="@dimen/icon_size_small"
@@ -126,7 +129,6 @@
android:padding="@dimen/padding_medium"
app:srcCompat="@drawable/ic_cancel" />
</RelativeLayout>
</ViewFlipper>
<LinearLayout

View File

@@ -131,7 +131,7 @@
android:text="@string/account_login_using"
android:textAlignment="center" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_google"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"
@@ -140,7 +140,7 @@
app:btnStateIcon="@drawable/ic_google"
app:btnStateText="@string/account_google" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_anonymous"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"
@@ -181,7 +181,7 @@
android:text="@string/account_logout"
android:textAlignment="center" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_logout"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"

View File

@@ -89,7 +89,7 @@
android:text="@string/account_login_using"
android:textAlignment="center" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_google"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"
@@ -98,7 +98,7 @@
app:btnStateIcon="@drawable/ic_google"
app:btnStateText="@string/account_google" />
<com.aurora.store.view.custom.StateButton
<com.aurora.store.view.custom.layouts.button.StateButton
android:id="@+id/btn_anonymous"
android:layout_width="@dimen/width_button"
android:layout_height="wrap_content"

View File

@@ -36,9 +36,13 @@
<ViewFlipper
android:id="@+id/view_flipper"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:animateFirstView="true"
android:inAnimation="@anim/fade_in"
android:outAnimation="@anim/fade_out"
tools:ignore="UselessParent">
<com.aurora.store.view.custom.ActionButton
<com.aurora.store.view.custom.layouts.button.ActionButton
android:id="@+id/btn_download"
android:layout_width="match_parent"
android:layout_height="@dimen/height_button"
@@ -113,7 +117,6 @@
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img_cancel"
android:layout_width="@dimen/icon_size_small"
@@ -125,7 +128,6 @@
android:padding="@dimen/padding_medium"
app:srcCompat="@drawable/ic_cancel" />
</RelativeLayout>
</ViewFlipper>
<LinearLayout

View File

@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Aurora Store
~ Copyright (C) 2021, Rahul Kumar Patel <whyorean@gmail.com>
~
~ Aurora Store is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 2 of the License, or
~ (at your option) any later version.
~
~ Aurora Store is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with Aurora Store. If not, see <http://www.gnu.org/licenses/>.
~
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@drawable/divider"
android:orientation="vertical"
android:padding="@dimen/padding_large"
android:showDividers="middle">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img_icon"
android:layout_width="@dimen/icon_size_category"
android:layout_height="@dimen/icon_size_category"
android:layout_centerVertical="true"
tools:src="@drawable/bg_circle" />
<TextView
android:id="@+id/txt_header"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="@dimen/margin_normal"
android:layout_marginBottom="@dimen/margin_normal"
android:layout_toEndOf="@id/img_icon"
android:maxLines="1"
android:text="@string/title_installer"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Aurora.SubTitle" />
</RelativeLayout>
<TextView
android:id="@+id/txt_line1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="3"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Aurora.Line1"
tools:text="Title" />
<TextView
android:id="@+id/txt_line2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="10"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Aurora.Line2"
android:textColor="@color/colorRed"
tools:text="Error" />
<TextView
android:id="@+id/txt_line3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="10"
android:textAlignment="viewStart"
android:textAppearance="@style/TextAppearance.Aurora.Line2"
tools:text="Extra" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="2">
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_secondary"
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush"
android:layout_width="0dp"
android:layout_height="@dimen/height_button"
android:layout_weight="1"
android:text="@string/action_copy" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_primary"
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush"
android:layout_width="0dp"
android:layout_height="@dimen/height_button"
android:layout_weight="1"
android:text="@string/action_ok" />
</LinearLayout>
</LinearLayout>

View File

@@ -21,37 +21,59 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="@dimen/height_button">
<com.google.android.material.button.MaterialButton
android:id="@+id/btn"
style="@style/Widget.MaterialComponents.Button.UnelevatedButton"
<ViewFlipper
android:id="@+id/view_flipper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:paddingVertical="@dimen/padding_normal"
android:paddingStart="24dp"
android:paddingEnd="24dp"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.Aurora.SubTitle"
android:textColor="@color/colorWhite"
app:iconPadding="@dimen/padding_large"
app:iconTint="?colorAccent"
tools:text="Install" />
android:layout_height="match_parent"
android:animateFirstView="true"
android:inAnimation="@anim/fade_in"
android:outAnimation="@anim/fade_out"
tools:ignore="UselessParent">
<androidx.core.widget.ContentLoadingProgressBar
android:id="@+id/progress"
style="?android:attr/progressBarStyle"
android:layout_width="@dimen/icon_size_default"
android:layout_height="@dimen/icon_size_default"
android:layout_alignEnd="@id/btn"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/icon_size_default"
android:elevation="8dp"
android:indeterminateTint="@color/colorWhite"
android:progressTint="@color/colorWhite"
android:visibility="invisible"
tools:visibility="visible" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.button.MaterialButton
android:id="@+id/btn"
style="@style/Widget.MaterialComponents.Button.TextButton.Dialog.Flush"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:textAllCaps="true"
android:textAppearance="@style/TextAppearance.Aurora.SubTitle"
app:iconPadding="@dimen/padding_large"
app:iconTint="@color/colorWhite"
tools:text="Install" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.aurora.store.view.custom.progress.AuroraProgressView
android:id="@+id/progress"
android:layout_width="@dimen/icon_size_small"
android:layout_height="@dimen/icon_size_small"
android:layout_centerInParent="true"
tools:indicatorColor="@color/colorAccent" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
app:srcCompat="@drawable/ic_check"
app:tint="@color/colorWhite" />
</RelativeLayout>
</ViewFlipper>
</RelativeLayout>

View File

@@ -20,7 +20,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/action_copy"
android:title="@string/action_copy" />
android:title="@string/action_copy_link" />
<item
android:id="@+id/action_pause"
android:title="@string/action_pause" />

View File

@@ -38,6 +38,24 @@
<declare-styleable name="ActionButton">
<attr name="btnActionText" format="string" />
<attr name="btnActionTextColor" format="string" />
<attr name="btnActionIcon" format="string" />
<attr name="btnActionBackground" format="enum">
<enum name="outlined" value="0" />
<enum name="roundedOutlined" value="1" />
<enum name="flat" value="2" />
<enum name="roundedFlat" value="3" />
<enum name="none" value="4" />
</attr>
</declare-styleable>
<declare-styleable name="AuroraProgressView">
<attr name="minWidth" format="dimension" />
<attr name="maxWidth" format="dimension" />
<attr name="minHeight" format="dimension" />
<attr name="maxHeight" format="dimension" />
<attr name="indicatorName" format="string" />
<attr name="indicatorColor" format="color" />
</declare-styleable>
<declare-styleable name="DevInfoLayout">

View File

@@ -56,7 +56,9 @@
<string name="action_clear">"Clear"</string>
<string name="action_clear_all">"Clear all"</string>
<string name="action_clear_restart">"Clear data"</string>
<string name="action_copy">"Copy Link"</string>
<string name="action_close">"Close"</string>
<string name="action_copy">"Copy"</string>
<string name="action_copy_link">"Copy Link"</string>
<string name="action_disable">"Disable"</string>
<string name="action_discard">"Discard"</string>
<string name="action_discover">"Discover"</string>
@@ -92,6 +94,7 @@
<string name="action_manual">"Manual download"</string>
<string name="action_more">"More"</string>
<string name="action_next">"Next"</string>
<string name="action_ok">"Okay"</string>
<string name="action_open">"Open"</string>
<string name="action_pause">"Pause"</string>
<string name="action_pending">"Pending"</string>
@@ -201,9 +204,12 @@
<string name="installer_root_available">"Root access available"</string>
<string name="installer_root_unavailable">"No Root, grant root access or change the installer."</string>
<string name="installer_service_available">"Aurora services is available and ready to install."</string>
<string name="installer_service_unavailable">"Aurora services not configured. Make sure service is enabled &amp; all permissions are granted"</string>
<string name="installer_status_failure">"Installation failed"</string>
<string name="installer_status_failure_aborted">"Installation cancelled"</string>
<string name="installer_status_failure_blocked">"Installation was blocked"</string>
<string name="installer_status_failure_session">"Could not create session"</string>
<string name="installer_status_failure_conflict">"Conflicting package exists"</string>
<string name="installer_status_failure_incompatible">"Incompatible app"</string>
<string name="installer_status_failure_invalid">"Invalid or corrupted APK"</string>
@@ -290,6 +296,7 @@
<string name="title_games">"Games"</string>
<string name="title_installation">"Installation"</string>
<string name="title_installed">"Installed"</string>
<string name="title_installer">"App Installer"</string>
<string name="title_language">"Language"</string>
<string name="title_library">"Library"</string>
<string name="title_purchase_history">"Purchase history"</string>

View File

@@ -72,4 +72,28 @@
<style name="Aurora.BottomSheetDialog" parent="Theme.Design.BottomSheetDialog">
<item name="bottomSheetStyle">@style/Aurora.BottomSheetDialogStyle</item>
</style>
<style name="AuroraProgressView">
<item name="minWidth">32dp</item>
<item name="maxWidth">46dp</item>
<item name="minHeight">36dp</item>
<item name="maxHeight">36dp</item>
<item name="indicatorName">BallPulseIndicator</item>
</style>
<style name="AuroraProgressView.Large">
<item name="minWidth">48dp</item>
<item name="maxWidth">48dp</item>
<item name="minHeight">56dp</item>
<item name="maxHeight">56dp</item>
<item name="indicatorName">BallPulseIndicator</item>
</style>
<style name="AuroraProgressView.Small">
<item name="minWidth">24dp</item>
<item name="maxWidth">24dp</item>
<item name="minHeight">24dp</item>
<item name="maxHeight">24dp</item>
<item name="indicatorName">BallPulseIndicator</item>
</style>
</resources>