mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-02-19 15:48:19 -05:00
Another round of addressing MD3 feedback
This commit is contained in:
@@ -156,7 +156,7 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="150dp"
|
||||
android:textColor="@color/swap_bright_blue"
|
||||
android:textColor="?attr/colorPrimary"
|
||||
android:textSize="16sp"
|
||||
tools:text="wifi network name" />
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment.Companion.End
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.ComposeView
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.text.SpanStyle
|
||||
import androidx.compose.ui.text.buildAnnotatedString
|
||||
@@ -88,7 +87,7 @@ fun RepoChooser(
|
||||
) {
|
||||
Box {
|
||||
val borderColor = if (isPreferred) {
|
||||
colorResource(id = R.color.fdroid_blue)
|
||||
MaterialTheme.colorScheme.primary
|
||||
} else {
|
||||
MaterialTheme.colorScheme.outline
|
||||
}
|
||||
@@ -116,7 +115,7 @@ fun RepoChooser(
|
||||
imageVector = Icons.Default.ArrowDropDown,
|
||||
contentDescription = stringResource(R.string.app_details_repository_expand),
|
||||
tint = if (isPreferred) {
|
||||
colorResource(id = R.color.fdroid_blue)
|
||||
MaterialTheme.colorScheme.primary
|
||||
} else {
|
||||
MaterialTheme.colorScheme.onSurface
|
||||
},
|
||||
|
||||
@@ -12,6 +12,8 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.google.android.material.color.MaterialColors;
|
||||
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.views.categories.CategoryController;
|
||||
|
||||
@@ -119,13 +121,18 @@ public class CategorySpan extends ReplacementSpan {
|
||||
|
||||
// The background behind the category icon.
|
||||
Paint iconBackgroundPaint = new Paint();
|
||||
iconBackgroundPaint.setColor(0xffd8d8d8);
|
||||
int backgroundColor =
|
||||
MaterialColors.getColor(context, com.google.android.material.R.attr.colorSurfaceContainerHigh, 0);
|
||||
iconBackgroundPaint.setColor(backgroundColor);
|
||||
iconBackgroundPaint.setAntiAlias(true);
|
||||
RectF iconBackgroundRect = new RectF(0, 0, iconBackgroundSize, height);
|
||||
canvas.drawRoundRect(iconBackgroundRect, cornerRadius, cornerRadius, iconBackgroundPaint);
|
||||
|
||||
// Category icon on top of the circular background which was just drawn.
|
||||
Drawable icon = ContextCompat.getDrawable(context, R.drawable.ic_categories);
|
||||
int iconColor =
|
||||
MaterialColors.getColor(context, com.google.android.material.R.attr.colorOnSurface, 0);
|
||||
icon.setTint(iconColor);
|
||||
icon.setBounds(iconPadding, iconPadding, iconPadding + iconSize, iconPadding + iconSize);
|
||||
icon.draw(canvas);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.fdroid.fdroid.views.repos
|
||||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.ExperimentalFoundationApi
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Arrangement.spacedBy
|
||||
@@ -15,7 +14,7 @@ import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.lazy.LazyColumn
|
||||
import androidx.compose.foundation.lazy.LazyItemScope
|
||||
import androidx.compose.foundation.lazy.items
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.ElevatedCard
|
||||
import androidx.compose.material3.LinearProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
@@ -213,14 +212,14 @@ fun RepoPreviewHeader(
|
||||
}
|
||||
|
||||
@Composable
|
||||
@OptIn(ExperimentalGlideComposeApi::class, ExperimentalFoundationApi::class)
|
||||
@OptIn(ExperimentalGlideComposeApi::class)
|
||||
fun LazyItemScope.RepoPreviewApp(
|
||||
repo: Repository,
|
||||
app: MinimalApp,
|
||||
localeList: LocaleListCompat,
|
||||
) {
|
||||
val isDevPreview = LocalInspectionMode.current
|
||||
Card(
|
||||
ElevatedCard(
|
||||
modifier = Modifier
|
||||
.animateItem()
|
||||
.fillMaxWidth(),
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#19c878" />
|
||||
android:color="?attr/colorSecondaryContainer" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#429fff" />
|
||||
android:color="?attr/colorPrimaryContainer" />
|
||||
<corners android:radius="2dp" />
|
||||
<solid android:color="?colorSurface" />
|
||||
</shape>
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#777777" />
|
||||
android:color="?attr/colorPrimaryContainer" />
|
||||
<corners android:radius="2dp" />
|
||||
</shape>
|
||||
|
||||
@@ -68,4 +68,4 @@
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
@@ -277,7 +277,6 @@
|
||||
android:paddingRight="8dp"
|
||||
android:scrollbars="none"
|
||||
android:text="@string/antifeatures"
|
||||
android:textAllCaps="true"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
||||
android:textStyle="bold" />
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
android:id="@+id/status_installed"
|
||||
style="@style/AppVersionStatus"
|
||||
android:background="@drawable/app_version_item_status_installed"
|
||||
android:textColor="#19c878"
|
||||
android:textColor="?attr/colorSecondaryContainer"
|
||||
android:textStyle="bold"
|
||||
android:text="@string/app_installed" />
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@drawable/app_version_item_status_new"
|
||||
android:text="@string/app_new"
|
||||
android:textColor="#429fff"
|
||||
style="@style/AppVersionStatus" />
|
||||
android:textColor="?attr/colorPrimaryContainer"
|
||||
style="@style/AppVersionStatus" />
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:background="@drawable/app_version_item_status_suggested"
|
||||
android:text="@string/app_suggested"
|
||||
android:textColor="#777777"
|
||||
style="@style/AppVersionStatus" />
|
||||
android:textColor="?attr/colorPrimaryContainer"
|
||||
style="@style/AppVersionStatus" />
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
</item>
|
||||
</style>
|
||||
|
||||
<!-- Workaround to get Material 3 for dialogs in preferences -->
|
||||
<style name="ThemeOverlay.App.MaterialAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
|
||||
<item name="dialogCornerRadius">28dp</item>
|
||||
<item name="android:colorBackground">?attr/colorSurfaceContainerHigh</item>
|
||||
|
||||
Reference in New Issue
Block a user