Refactor About dialog UI

This commit is contained in:
M M Arif 2023-04-11 20:48:07 +05:00
parent f05f9229f5
commit 0db3bed589
8 changed files with 331 additions and 96 deletions

View File

@ -63,6 +63,9 @@ public class SettingsFragment extends Fragment {
fragmentSettingsBinding.appearanceFrame.setOnClickListener(
v1 -> startActivity(new Intent(ctx, SettingsAppearanceActivity.class)));
fragmentSettingsBinding.codeEditorFrame.setOnClickListener(
v1 -> startActivity(new Intent(ctx, SettingsReportsActivity.class)));
fragmentSettingsBinding.draftsFrame.setOnClickListener(
v1 -> startActivity(new Intent(ctx, SettingsDraftsActivity.class)));
@ -135,10 +138,14 @@ public class SettingsFragment extends Fragment {
requireContext(), getResources().getString(R.string.appWebsiteLink));
});
aboutAppDialogBinding.feedback.setOnClickListener(
v14 -> {
AppUtil.openUrlInBrowser(
requireContext(), getResources().getString(R.string.feedbackLink));
});
if (AppUtil.isPro(requireContext())) {
aboutAppDialogBinding.supportHeader.setVisibility(View.GONE);
aboutAppDialogBinding.donationLinkPatreon.setVisibility(View.GONE);
aboutAppDialogBinding.donationLinkBuyMeaCoffee.setVisibility(View.GONE);
aboutAppDialogBinding.layoutFrame1.setVisibility(View.GONE);
}
materialAlertDialogBuilder.show();

View File

@ -0,0 +1,41 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,14c0.83,0.642 2.077,1.017 3.5,1c1.423,0.017 2.67,-0.358 3.5,-1c0.83,-0.642 2.077,-1.017 3.5,-1c1.423,-0.017 2.67,0.358 3.5,1"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M8,3a2.4,2.4 0,0 0,-1 2a2.4,2.4 0,0 0,1 2"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M12,3a2.4,2.4 0,0 0,-1 2a2.4,2.4 0,0 0,1 2"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M3,10h14v5a6,6 0,0 1,-6 6h-2a6,6 0,0 1,-6 -6v-5z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M16.746,16.726a3,3 0,1 0,0.252 -5.555"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,27 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M7,8l-4,4l4,4"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M17,8l4,4l-4,4"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M14,4l-4,16"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,48 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M9,5h-2a2,2 0,0 0,-2 2v12a2,2 0,0 0,2 2h10a2,2 0,0 0,2 -2v-12a2,2 0,0 0,-2 -2h-2"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M9,3m0,2a2,2 0,0 1,2 -2h2a2,2 0,0 1,2 2v0a2,2 0,0 1,-2 2h-2a2,2 0,0 1,-2 -2z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M9,12l0.01,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M13,12l2,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M9,16l0.01,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M13,16l2,0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
</vector>

View File

@ -0,0 +1,20 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M3,3h3v18h-3z"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
<path
android:pathData="M15,9.5m-6.5,0a6.5,6.5 0,1 0,13 0a6.5,6.5 0,1 0,-13 0"
android:strokeLineJoin="round"
android:strokeWidth="2"
android:fillColor="#00000000"
android:strokeColor="?attr/iconsColor"
android:strokeLineCap="round"/>
</vector>

View File

@ -9,7 +9,8 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen16dp">
<LinearLayout
android:layout_width="match_parent"
@ -17,7 +18,6 @@
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dimen12dp"
android:orientation="vertical"
tools:ignore="UselessParent">
@ -70,7 +70,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="@string/appVersionBuild"
android:textColor="@color/retroThemeColorSecondary"
android:textColor="@color/retroThemeInputTextColor"
android:textIsSelectable="true"
android:paddingTop="@dimen/dimen8dp"
android:paddingBottom="@dimen/dimen8dp"
@ -85,112 +85,147 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen16dp"
android:layout_marginTop="@dimen/dimen24dp"
android:orientation="vertical">
<!-- user server version -->
<TextView
android:id="@+id/userServerVersionHeader"
<com.google.android.material.card.MaterialCardView
style="?attr/materialCardViewFilledStyle"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen72dp"
android:layout_gravity="center_horizontal"
app:cardBackgroundColor="?attr/materialCardBackgroundColor"
app:cardCornerRadius="@dimen/dimen16dp">
<TextView
android:id="@+id/userServerVersionHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dimen12dp"
android:text="@string/commitPage"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/userServerVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen28dp"
android:padding="@dimen/dimen12dp"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:textSize="@dimen/dimen14sp" />
</com.google.android.material.card.MaterialCardView>
<!-- donate text -->
<LinearLayout
android:id="@+id/layout_frame_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen24dp"
android:paddingStart="@dimen/dimen28dp"
android:paddingEnd="@dimen/dimen28dp"
android:text="@string/commitPage"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold" />
android:layout_marginTop="@dimen/dimen12dp"
android:orientation="horizontal">
<TextView
android:id="@+id/userServerVersion"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="@dimen/dimen28dp"
android:paddingEnd="@dimen/dimen28dp"
android:textColor="?attr/primaryTextColor"
android:textIsSelectable="true"
android:textSize="@dimen/dimen14sp" />
<!-- user server version -->
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/donationLinkPatreon"
android:layout_width="@dimen/dimen150dp"
android:layout_height="@dimen/dimen60dp"
android:layout_marginEnd="@dimen/dimen4dp"
android:layout_marginStart="@dimen/dimen0dp"
android:stateListAnimator="@null"
android:text="@string/supportTextPatreon"
android:textStyle="bold"
android:contentDescription="@string/supportTextPatreon"
android:textColor="?attr/materialCardBackgroundColor"
app:iconTint="?attr/materialCardBackgroundColor"
android:backgroundTint="?attr/fabColor"
app:icon="@drawable/ic_patreon" />
<!-- support -->
<TextView
android:id="@+id/supportHeader"
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/donationLinkBuyMeaCoffee"
android:layout_width="@dimen/dimen150dp"
android:layout_height="@dimen/dimen60dp"
android:layout_marginEnd="@dimen/dimen0dp"
android:layout_marginStart="@dimen/dimen6dp"
android:stateListAnimator="@null"
android:text="@string/supportTextBuyMeaCoffee"
android:textStyle="bold"
android:contentDescription="@string/supportTextBuyMeaCoffee"
android:textColor="?attr/materialCardBackgroundColor"
app:iconTint="?attr/materialCardBackgroundColor"
android:backgroundTint="?attr/fabColor"
app:icon="@drawable/ic_bmc" />
</LinearLayout>
<!-- translate/website text -->
<LinearLayout
android:id="@+id/layout_frame_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen24dp"
android:paddingStart="@dimen/dimen28dp"
android:paddingEnd="@dimen/dimen28dp"
android:text="@string/supportText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold" />
android:layout_marginTop="@dimen/dimen12dp"
android:orientation="horizontal">
<TextView
android:id="@+id/donationLinkPatreon"
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/translateLink"
android:layout_width="@dimen/dimen150dp"
android:layout_height="@dimen/dimen60dp"
android:layout_marginEnd="@dimen/dimen4dp"
android:layout_marginStart="@dimen/dimen0dp"
android:stateListAnimator="@null"
android:text="@string/translateWithCrowdin"
android:textStyle="bold"
android:contentDescription="@string/translateWithCrowdin"
android:textColor="?attr/materialCardBackgroundColor"
app:iconTint="?attr/materialCardBackgroundColor"
android:backgroundTint="?attr/fabColor"
app:icon="@drawable/ic_language" />
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/appWebsite"
android:layout_width="@dimen/dimen150dp"
android:layout_height="@dimen/dimen60dp"
android:layout_marginEnd="@dimen/dimen0dp"
android:layout_marginStart="@dimen/dimen6dp"
android:stateListAnimator="@null"
android:text="@string/websiteText"
android:textStyle="bold"
android:contentDescription="@string/websiteText"
android:textColor="?attr/materialCardBackgroundColor"
app:iconTint="?attr/materialCardBackgroundColor"
android:backgroundTint="?attr/fabColor"
app:icon="@drawable/ic_browser" />
</LinearLayout>
<!-- feedback text -->
<LinearLayout
android:id="@+id/layout_frame_3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:paddingStart="@dimen/dimen28dp"
android:paddingEnd="@dimen/dimen28dp"
android:text="@string/supportTextPatreon"
android:textColor="@color/lightBlue"
android:textColorLink="@color/lightBlue"
android:textSize="@dimen/dimen14sp" />
android:layout_marginTop="@dimen/dimen12dp"
android:orientation="horizontal">
<TextView
android:id="@+id/donationLinkBuyMeaCoffee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:paddingStart="@dimen/dimen28dp"
android:paddingEnd="@dimen/dimen28dp"
android:text="@string/supportTextBuyMeaCoffee"
android:textColor="@color/lightBlue"
android:textColorLink="@color/lightBlue"
android:textSize="@dimen/dimen14sp" />
<!-- support -->
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/feedback"
android:layout_width="@dimen/dimen150dp"
android:layout_height="@dimen/dimen60dp"
android:layout_marginEnd="@dimen/dimen4dp"
android:layout_marginStart="@dimen/dimen0dp"
android:stateListAnimator="@null"
android:text="@string/feedbackText"
android:textStyle="bold"
android:contentDescription="@string/feedbackText"
android:textColor="?attr/materialCardBackgroundColor"
app:iconTint="?attr/materialCardBackgroundColor"
android:backgroundTint="?attr/fabColor"
app:icon="@drawable/ic_feedback" />
<!-- translate -->
<TextView
android:id="@+id/translateHeader"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dimen24dp"
android:paddingStart="@dimen/dimen28dp"
android:paddingEnd="@dimen/dimen28dp"
android:text="@string/translateText"
android:textColor="?attr/primaryTextColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold" />
<TextView
android:id="@+id/translateLink"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:autoLink="web"
android:gravity="start"
android:paddingStart="@dimen/dimen28dp"
android:paddingEnd="@dimen/dimen28dp"
android:text="@string/translateWithCrowdin"
android:textColor="@color/lightBlue"
android:textColorLink="@color/lightBlue"
android:textSize="@dimen/dimen14sp"
android:visibility="visible" />
<!-- translate -->
</LinearLayout>
</LinearLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/appWebsite"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen54dp"
android:layout_gravity="center_horizontal"
android:layout_margin="@dimen/dimen24dp"
android:text="@string/websiteText"
android:textColor="?attr/materialCardBackgroundColor"
android:textSize="@dimen/dimen16sp"
android:textStyle="bold" />
</LinearLayout>
</RelativeLayout>

View File

@ -128,6 +128,61 @@
</LinearLayout>
<LinearLayout
android:id="@+id/codeEditorFrame"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="15dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
app:srcCompat="@drawable/ic_code_v2"/>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/codeEditor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:text="@string/codeEditor"
android:textColor="?attr/primaryTextColor"
android:textSize="18sp"/>
<TextView
android:id="@+id/codeEditorHintText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:text="@string/appearanceHintText"
android:textColor="?attr/primaryTextColor"
android:textSize="12sp"/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@string/generalImgContentText"
app:srcCompat="@drawable/ic_chevron_right"/>
</LinearLayout>
<LinearLayout
android:id="@+id/draftsFrame"
android:layout_width="match_parent"

View File

@ -8,6 +8,7 @@
<string name="commitPage" translatable="false">Your Instance Version</string>
<string name="supportLinkPatreon" translatable="false">https://www.patreon.com/mmarif</string>
<string name="supportLinkBuyMeaCoffee" translatable="false">https://www.buymeacoffee.com/mmarif</string>
<string name="feedbackLink" translatable="false">https://www.buymeacoffee.com/mmarif</string>
<string name="appVersionBuild" translatable="false">%s / %d</string>
<string name="appDesc" translatable="false">GitNex is a free, open-source Android client for Git repository management tools Forgejo and Gitea. GitNex is Licensed under GPLv3.\n\nThanks to all the contributors and donators for your generous work and donations.</string>
<string name="crowdInLink" translatable="false">https://crowdin.com/project/gitnex</string>
@ -17,7 +18,8 @@
<string name="supportText" translatable="false">Support</string>
<string name="supportTextPatreon" translatable="false">Patreon</string>
<string name="supportTextBuyMeaCoffee" translatable="false">Buy Me a Coffee</string>
<string name="supportTextBuyMeaCoffee" translatable="false">BMC</string>
<string name="feedbackText" translatable="false">Feedback</string>
<!-- menu items -->
<string name="navMyRepos">My Repositories</string>