Merge branch 'md3' into 'master'
feat: migrate to material design 3 Closes #2246 and #2511 See merge request fdroid/fdroidclient!1350
This commit is contained in:
commit
3d2b5ce962
|
@ -207,12 +207,11 @@ dependencies {
|
|||
|
||||
// newer compose-bom versions have an issue with app details repo dropdown
|
||||
implementation platform('androidx.compose:compose-bom:2023.10.01')
|
||||
implementation 'androidx.compose.material:material'
|
||||
implementation 'androidx.compose.material3:material3'
|
||||
implementation 'androidx.compose.material:material-icons-extended'
|
||||
implementation "androidx.lifecycle:lifecycle-viewmodel-compose"
|
||||
implementation 'androidx.compose.ui:ui-tooling-preview'
|
||||
implementation 'androidx.activity:activity-compose:1.8.2'
|
||||
implementation "com.google.accompanist:accompanist-themeadapter-material:0.30.1"
|
||||
debugImplementation 'androidx.compose.ui:ui-tooling'
|
||||
|
||||
testImplementation 'androidx.test:core:1.5.0'
|
||||
|
|
|
@ -24,7 +24,7 @@ import androidx.core.content.ContextCompat;
|
|||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import com.google.android.material.materialswitch.MaterialSwitch;
|
||||
|
||||
import org.fdroid.fdroid.FDroidApp;
|
||||
import org.fdroid.fdroid.R;
|
||||
|
@ -34,7 +34,6 @@ import org.fdroid.fdroid.nearby.peers.Peer;
|
|||
import java.util.ArrayList;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
|
||||
|
@ -87,7 +86,7 @@ public class StartSwapView extends SwapView {
|
|||
@Nullable /* Emulators typically don't have bluetooth adapters */
|
||||
private final BluetoothAdapter bluetooth = BluetoothAdapter.getDefaultAdapter();
|
||||
|
||||
private SwitchMaterial bluetoothSwitch;
|
||||
private MaterialSwitch bluetoothSwitch;
|
||||
private TextView viewBluetoothId;
|
||||
private TextView textBluetoothVisible;
|
||||
private TextView viewWifiId;
|
||||
|
@ -176,7 +175,7 @@ public class StartSwapView extends SwapView {
|
|||
|
||||
textBluetoothVisible = findViewById(R.id.bluetooth_visible);
|
||||
|
||||
bluetoothSwitch = (SwitchMaterial) findViewById(R.id.switch_bluetooth);
|
||||
bluetoothSwitch = (MaterialSwitch) findViewById(R.id.switch_bluetooth);
|
||||
bluetoothSwitch.setOnCheckedChangeListener(onBluetoothSwitchToggled);
|
||||
bluetoothSwitch.setChecked(SwapService.getBluetoothVisibleUserPreference());
|
||||
bluetoothSwitch.setEnabled(true);
|
||||
|
|
|
@ -40,7 +40,6 @@ import androidx.annotation.LayoutRes;
|
|||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.StringRes;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.SearchView;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
@ -48,7 +47,8 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
|||
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import com.google.android.material.button.MaterialButton;
|
||||
import com.google.android.material.switchmaterial.SwitchMaterial;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.materialswitch.MaterialSwitch;
|
||||
import com.google.android.material.progressindicator.CircularProgressIndicator;
|
||||
import com.google.zxing.integration.android.IntentIntegrator;
|
||||
import com.google.zxing.integration.android.IntentResult;
|
||||
|
@ -455,7 +455,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private void promptToSelectWifiNetwork() {
|
||||
new AlertDialog.Builder(this)
|
||||
new MaterialAlertDialogBuilder(this)
|
||||
.setTitle(R.string.swap_join_same_wifi)
|
||||
.setMessage(R.string.swap_join_same_wifi_desc)
|
||||
.setNeutralButton(R.string.cancel, (dialog, which) -> {
|
||||
|
@ -865,7 +865,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||
private final BroadcastReceiver bluetoothScanModeChanged = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
SwitchMaterial bluetoothSwitch = container.findViewById(R.id.switch_bluetooth);
|
||||
MaterialSwitch bluetoothSwitch = container.findViewById(R.id.switch_bluetooth);
|
||||
TextView textBluetoothVisible = container.findViewById(R.id.bluetooth_visible);
|
||||
if (bluetoothSwitch == null || textBluetoothVisible == null
|
||||
|| !BluetoothManager.ACTION_STATUS.equals(intent.getAction())) {
|
||||
|
@ -1075,7 +1075,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||
bonjourStatusReceiver.onReceive(this, new Intent(BonjourManager.ACTION_STATUS));
|
||||
|
||||
TextView viewWifiNetwork = findViewById(R.id.wifi_network);
|
||||
SwitchMaterial wifiSwitch = findViewById(R.id.switch_wifi);
|
||||
MaterialSwitch wifiSwitch = findViewById(R.id.switch_wifi);
|
||||
MaterialButton scanQrButton = findViewById(R.id.btn_scan_qr);
|
||||
MaterialButton appsButton = findViewById(R.id.btn_apps);
|
||||
if (viewWifiNetwork == null || wifiSwitch == null || scanQrButton == null || appsButton == null) {
|
||||
|
@ -1233,7 +1233,7 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||
return;
|
||||
}
|
||||
bluetoothStatus = intent.getIntExtra(BluetoothManager.EXTRA_STATUS, bluetoothStatus);
|
||||
SwitchMaterial bluetoothSwitch = container.findViewById(R.id.switch_bluetooth);
|
||||
MaterialSwitch bluetoothSwitch = container.findViewById(R.id.switch_bluetooth);
|
||||
TextView textBluetoothVisible = container.findViewById(R.id.bluetooth_visible);
|
||||
TextView textDeviceIdBluetooth = container.findViewById(R.id.device_id_bluetooth);
|
||||
TextView peopleNearbyText = container.findViewById(R.id.text_people_nearby);
|
||||
|
|
|
@ -7,9 +7,10 @@ import android.content.pm.PackageInfo;
|
|||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ServiceInfo;
|
||||
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.app.NotificationManagerCompat;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.fdroid.fdroid.BuildConfig;
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.views.main.MainActivity;
|
||||
|
@ -41,7 +42,7 @@ public class HidingManager {
|
|||
|
||||
public static void showHideDialog(final Context context) {
|
||||
String appName = context.getString(R.string.app_name);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(context);
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(context);
|
||||
builder.setTitle(context.getString(R.string.hiding_dialog_title, appName));
|
||||
builder.setMessage(context.getString(R.string.hiding_dialog_message, appName,
|
||||
HidingManager.getUnhidePin(context), context.getString(R.string.hiding_calculator)));
|
||||
|
|
|
@ -17,7 +17,6 @@ import android.util.TypedValue;
|
|||
|
||||
import androidx.annotation.ColorInt;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.preference.ListPreference;
|
||||
|
@ -26,6 +25,8 @@ import androidx.preference.PreferenceCategory;
|
|||
import androidx.preference.PreferenceFragmentCompat;
|
||||
import androidx.preference.SwitchPreferenceCompat;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.fdroid.fdroid.Preferences;
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.installer.PrivilegedInstaller;
|
||||
|
@ -234,7 +235,7 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
|
|||
requireActivity().finish();
|
||||
};
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
|
||||
builder.setTitle(getString(R.string.panic_app_dialog_title));
|
||||
|
||||
CharSequence app = getString(R.string.panic_app_unknown_app);
|
||||
|
@ -266,7 +267,7 @@ public class PanicPreferencesFragment extends PreferenceFragmentCompat
|
|||
|
||||
private void showHideConfirmationDialog() {
|
||||
String appName = getString(R.string.app_name);
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(requireActivity());
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
|
||||
builder.setTitle(R.string.panic_hide_warning_title);
|
||||
builder.setMessage(getString(R.string.panic_hide_warning_message, appName,
|
||||
HidingManager.getUnhidePin(requireActivity()), getString(R.string.hiding_calculator)));
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface" />
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
|
@ -16,8 +16,7 @@
|
|||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:title="@string/panic_settings"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface" />
|
||||
app:title="@string/panic_settings" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface" />
|
||||
android:layout_height="?attr/actionBarSize" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<org.fdroid.fdroid.nearby.StartSwapView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:swap="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:swap="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
@ -10,7 +10,7 @@
|
|||
swap:toolbarTitle="@string/swap_nearby"
|
||||
tools:context=".nearby.SwapWorkflowActivity">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:id="@+id/wifi_banner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -45,7 +45,7 @@
|
|||
|
||||
<androidx.appcompat.widget.AppCompatButton
|
||||
android:id="@+id/turn_on_wifi"
|
||||
style="@style/Widget.MaterialComponents.Button.TextButton"
|
||||
style="@style/Widget.Material3.Button.TextButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right"
|
||||
|
@ -56,7 +56,7 @@
|
|||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- Misc header -->
|
||||
<include
|
||||
|
@ -105,7 +105,7 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_bluetooth"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -162,7 +162,7 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_wifi"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
@ -189,14 +189,14 @@
|
|||
android:textColor="@color/swap_light_text" />
|
||||
|
||||
<com.google.android.material.progressindicator.CircularProgressIndicator
|
||||
android:id="@+id/searching_people_nearby"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:indeterminate="true"
|
||||
app:showAnimationBehavior="inward"
|
||||
app:hideAnimationBehavior="outward"
|
||||
app:indicatorSize="24dp"
|
||||
app:trackCornerRadius="@dimen/mtrl_progress_indicator_full_rounded_corner_radius"/>
|
||||
android:id="@+id/searching_people_nearby"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:indeterminate="true"
|
||||
app:showAnimationBehavior="inward"
|
||||
app:hideAnimationBehavior="outward"
|
||||
app:indicatorSize="24dp"
|
||||
app:trackCornerRadius="@dimen/mtrl_progress_indicator_full_rounded_corner_radius" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
@ -283,10 +283,10 @@
|
|||
|
||||
<activity
|
||||
android:name=".installer.DefaultInstallerActivity"
|
||||
android:theme="@style/AppThemeTransparent" />
|
||||
android:theme="@style/Theme.App.Transparent" />
|
||||
<activity
|
||||
android:name=".installer.ErrorDialogActivity"
|
||||
android:theme="@style/AppThemeTransparent" />
|
||||
android:theme="@style/Theme.App.Transparent" />
|
||||
|
||||
<activity
|
||||
android:name=".views.main.MainActivity"
|
||||
|
@ -453,7 +453,7 @@
|
|||
|
||||
<activity
|
||||
android:name=".installer.FileInstallerActivity"
|
||||
android:theme="@style/AppThemeTransparent" />
|
||||
android:theme="@style/Theme.App.Transparent" />
|
||||
|
||||
<provider
|
||||
android:name="org.fdroid.fdroid.installer.ApkFileProvider"
|
||||
|
|
|
@ -200,8 +200,7 @@ public class FDroidApp extends Application implements androidx.work.Configuratio
|
|||
* The built-in BouncyCastle was stripped down in {@link Build.VERSION_CODES#S}
|
||||
* so that {@code SHA1withRSA} and {@code SHA256withRSA} are no longer included.
|
||||
*
|
||||
* @see
|
||||
* <a href="https://gitlab.com/fdroid/fdroidclient/-/issues/2338">Nearby Swap Crash on Android 12: no such algorithm: SHA1WITHRSA for provider BC</a>
|
||||
* @see <a href="https://gitlab.com/fdroid/fdroidclient/-/issues/2338">Nearby Swap Crash on Android 12: no such algorithm: SHA1WITHRSA for provider BC</a>
|
||||
*/
|
||||
private static void enableBouncyCastle() {
|
||||
if (Build.VERSION.SDK_INT >= 31) {
|
||||
|
|
|
@ -5,70 +5,31 @@ import androidx.compose.foundation.layout.heightIn
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.Button
|
||||
import androidx.compose.material.ButtonDefaults
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.OutlinedButton
|
||||
import androidx.compose.material.Surface
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedButton
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.DisposableEffect
|
||||
import androidx.compose.runtime.rememberUpdatedState
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalInspectionMode
|
||||
import androidx.compose.ui.platform.LocalLayoutDirection
|
||||
import androidx.compose.ui.platform.LocalLifecycleOwner
|
||||
import androidx.compose.ui.res.colorResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.em
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.lifecycle.Lifecycle
|
||||
import androidx.lifecycle.LifecycleEventObserver
|
||||
import androidx.lifecycle.LifecycleOwner
|
||||
import com.google.accompanist.themeadapter.material.createMdcTheme
|
||||
import org.fdroid.fdroid.Preferences
|
||||
import org.fdroid.fdroid.R
|
||||
import java.util.Locale
|
||||
|
||||
object ComposeUtils {
|
||||
|
||||
|
||||
@Composable
|
||||
fun FDroidContent(content: @Composable () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
val layoutDirection = LocalLayoutDirection.current
|
||||
val (colors, typography, shapes) = createMdcTheme(
|
||||
context = context,
|
||||
layoutDirection = layoutDirection,
|
||||
)
|
||||
val newColors = (colors ?: MaterialTheme.colors).let { c ->
|
||||
if (!LocalInspectionMode.current && !c.isLight && Preferences.get().isPureBlack) {
|
||||
c.copy(background = Color.Black, surface = Color(0xff1e1e1e))
|
||||
} else if (!c.isLight) {
|
||||
c.copy(surface = Color(0xff1e1e1e))
|
||||
} else {
|
||||
c
|
||||
}
|
||||
}
|
||||
MaterialTheme(
|
||||
colors = newColors,
|
||||
typography = typography?.let {
|
||||
it.copy(
|
||||
// adapt letter-spacing to non-compose UI
|
||||
body1 = it.body1.copy(letterSpacing = 0.em),
|
||||
body2 = it.body2.copy(letterSpacing = 0.em),
|
||||
// set caption style to match MDC
|
||||
caption = it.caption.copy(
|
||||
color = colorResource(id = R.color.fdroid_caption),
|
||||
fontSize = 12.sp)
|
||||
)
|
||||
} ?: MaterialTheme.typography,
|
||||
shapes = shapes ?: MaterialTheme.shapes
|
||||
) {
|
||||
Surface(content = content)
|
||||
}
|
||||
Surface(content = content)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
@ -153,7 +114,7 @@ object ComposeUtils {
|
|||
fun CaptionText(text: String) {
|
||||
Text(
|
||||
text = text,
|
||||
style = MaterialTheme.typography.caption,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
modifier = Modifier.padding(0.dp, 16.dp, 0.dp, 4.dp)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -26,10 +26,11 @@ import android.util.TypedValue;
|
|||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.fdroid.fdroid.R;
|
||||
|
||||
public class ErrorDialogActivity extends FragmentActivity {
|
||||
|
@ -46,7 +47,7 @@ public class ErrorDialogActivity extends FragmentActivity {
|
|||
final String message = intent.getStringExtra(EXTRA_MESSAGE);
|
||||
|
||||
// pass the theme, it is not automatically applied due to activity's Theme.NoDisplay
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.AppThemeDialog);
|
||||
final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setTitle(title);
|
||||
builder.setNeutralButton(R.string.ok, (dialog, which) -> {
|
||||
setResult(AppCompatActivity.RESULT_OK);
|
||||
|
|
|
@ -8,11 +8,12 @@ import android.os.Bundle;
|
|||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.Utils;
|
||||
|
@ -102,7 +103,7 @@ public class FileInstallerActivity extends FragmentActivity {
|
|||
private void showDialog() {
|
||||
|
||||
// pass the theme, it is not automatically applied due to activity's Theme.NoDisplay
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.Theme_App);
|
||||
final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this, R.style.Theme_App);
|
||||
builder.setMessage(R.string.app_permission_storage)
|
||||
.setPositiveButton(R.string.ok, (dialog, id) -> ActivityCompat.requestPermissions(activity,
|
||||
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
|
|
|
@ -44,6 +44,8 @@ import androidx.appcompat.app.AlertDialog;
|
|||
import androidx.core.content.ContextCompat;
|
||||
import androidx.core.graphics.drawable.DrawableCompat;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.fdroid.fdroid.Preferences;
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.Utils;
|
||||
|
@ -206,7 +208,7 @@ public class AppSecurityPermissions {
|
|||
dialog.dismiss();
|
||||
}
|
||||
PackageManager pm = getContext().getPackageManager();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getContext());
|
||||
builder.setTitle(group.label);
|
||||
if (perm.descriptionRes != 0) {
|
||||
builder.setMessage(perm.loadDescription(pm));
|
||||
|
|
|
@ -26,10 +26,11 @@ import android.os.Bundle;
|
|||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.fdroid.fdroid.R;
|
||||
import org.fdroid.fdroid.data.Apk;
|
||||
import org.fdroid.fdroid.data.App;
|
||||
|
@ -82,7 +83,7 @@ public class UninstallDialogActivity extends FragmentActivity {
|
|||
}
|
||||
|
||||
// pass the theme, it is not automatically applied due to activity's Theme.NoDisplay
|
||||
final AlertDialog.Builder builder = new AlertDialog.Builder(this, R.style.Theme_App);
|
||||
final MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this, R.style.Theme_App);
|
||||
builder.setTitle(appInfo.loadLabel(pm));
|
||||
builder.setIcon(appInfo.loadIcon(pm));
|
||||
builder.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||
|
|
|
@ -0,0 +1,64 @@
|
|||
package org.fdroid.fdroid.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
// Generated by the Material Theme Builder from fdroid_blue and fdroid_green
|
||||
// https://www.figma.com/community/plugin/1034969338659738588
|
||||
|
||||
val primaryLight = Color(0xFF005197)
|
||||
val onPrimaryLight = Color(0xFFFFFFFF)
|
||||
val primaryContainerLight = Color(0xFF1976D2)
|
||||
val onPrimaryContainerLight = Color(0xFFFFFFFF)
|
||||
val secondaryLight = Color(0xFF4F6600)
|
||||
val onSecondaryLight = Color(0xFFFFFFFF)
|
||||
val secondaryContainerLight = Color(0xFF95BC18)
|
||||
val onSecondaryContainerLight = Color(0xFF1C2700)
|
||||
val tertiaryLight = Color(0xFF763192)
|
||||
val onTertiaryLight = Color(0xFFFFFFFF)
|
||||
val tertiaryContainerLight = Color(0xFF9F58BA)
|
||||
val onTertiaryContainerLight = Color(0xFFFFFFFF)
|
||||
val errorLight = Color(0xFFBA1A1A)
|
||||
val onErrorLight = Color(0xFFFFFFFF)
|
||||
val errorContainerLight = Color(0xFFFFDAD6)
|
||||
val onErrorContainerLight = Color(0xFF410002)
|
||||
val backgroundLight = Color(0xFFF9F9FF)
|
||||
val onBackgroundLight = Color(0xFF181C21)
|
||||
val surfaceLight = Color(0xFFF9F9FF)
|
||||
val onSurfaceLight = Color(0xFF181C21)
|
||||
val surfaceVariantLight = Color(0xFFDDE2F0)
|
||||
val onSurfaceVariantLight = Color(0xFF414752)
|
||||
val outlineLight = Color(0xFF717783)
|
||||
val outlineVariantLight = Color(0xFFC1C6D4)
|
||||
val scrimLight = Color(0xFF000000)
|
||||
val inverseSurfaceLight = Color(0xFF2D3037)
|
||||
val inverseOnSurfaceLight = Color(0xFFEFF0F9)
|
||||
val inversePrimaryLight = Color(0xFFA5C8FF)
|
||||
|
||||
val primaryDark = Color(0xFFA5C8FF)
|
||||
val onPrimaryDark = Color(0xFF00315F)
|
||||
val primaryContainerDark = Color(0xFF006DC7)
|
||||
val onPrimaryContainerDark = Color(0xFFFFFFFF)
|
||||
val secondaryDark = Color(0xFFADD535)
|
||||
val onSecondaryDark = Color(0xFF283500)
|
||||
val secondaryContainerDark = Color(0xFF83A800)
|
||||
val onSecondaryContainerDark = Color(0xFF080D00)
|
||||
val tertiaryDark = Color(0xFFEDB1FF)
|
||||
val onTertiaryDark = Color(0xFF52046E)
|
||||
val tertiaryContainerDark = Color(0xFF954FB0)
|
||||
val onTertiaryContainerDark = Color(0xFFFFFFFF)
|
||||
val errorDark = Color(0xFFFFB4AB)
|
||||
val onErrorDark = Color(0xFF690005)
|
||||
val errorContainerDark = Color(0xFF93000A)
|
||||
val onErrorContainerDark = Color(0xFFFFDAD6)
|
||||
val backgroundDark = Color(0xFF101319)
|
||||
val onBackgroundDark = Color(0xFFE0E2EA)
|
||||
val surfaceDark = Color(0xFF101319)
|
||||
val onSurfaceDark = Color(0xFFE0E2EA)
|
||||
val surfaceVariantDark = Color(0xFF414752)
|
||||
val onSurfaceVariantDark = Color(0xFFC1C6D4)
|
||||
val outlineDark = Color(0xFF8B919E)
|
||||
val outlineVariantDark = Color(0xFF414752)
|
||||
val scrimDark = Color(0xFF000000)
|
||||
val inverseSurfaceDark = Color(0xFFE0E2EA)
|
||||
val inverseOnSurfaceDark = Color(0xFF2D3037)
|
||||
val inversePrimaryDark = Color(0xFF005FAF)
|
|
@ -0,0 +1,120 @@
|
|||
package org.fdroid.fdroid.ui.theme
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.Immutable
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
// The followings are generated by the Material Theme Builder with modifications
|
||||
// https://www.figma.com/community/plugin/1034969338659738588
|
||||
// Unused code are and themes with contrast are removed
|
||||
|
||||
private val lightScheme = lightColorScheme(
|
||||
primary = primaryLight,
|
||||
onPrimary = onPrimaryLight,
|
||||
primaryContainer = primaryContainerLight,
|
||||
onPrimaryContainer = onPrimaryContainerLight,
|
||||
secondary = secondaryLight,
|
||||
onSecondary = onSecondaryLight,
|
||||
secondaryContainer = secondaryContainerLight,
|
||||
onSecondaryContainer = onSecondaryContainerLight,
|
||||
tertiary = tertiaryLight,
|
||||
onTertiary = onTertiaryLight,
|
||||
tertiaryContainer = tertiaryContainerLight,
|
||||
onTertiaryContainer = onTertiaryContainerLight,
|
||||
error = errorLight,
|
||||
onError = onErrorLight,
|
||||
errorContainer = errorContainerLight,
|
||||
onErrorContainer = onErrorContainerLight,
|
||||
background = backgroundLight,
|
||||
onBackground = onBackgroundLight,
|
||||
surface = surfaceLight,
|
||||
onSurface = onSurfaceLight,
|
||||
surfaceVariant = surfaceVariantLight,
|
||||
onSurfaceVariant = onSurfaceVariantLight,
|
||||
outline = outlineLight,
|
||||
outlineVariant = outlineVariantLight,
|
||||
scrim = scrimLight,
|
||||
inverseSurface = inverseSurfaceLight,
|
||||
inverseOnSurface = inverseOnSurfaceLight,
|
||||
inversePrimary = inversePrimaryLight,
|
||||
)
|
||||
|
||||
private val darkScheme = darkColorScheme(
|
||||
primary = primaryDark,
|
||||
onPrimary = onPrimaryDark,
|
||||
primaryContainer = primaryContainerDark,
|
||||
onPrimaryContainer = onPrimaryContainerDark,
|
||||
secondary = secondaryDark,
|
||||
onSecondary = onSecondaryDark,
|
||||
secondaryContainer = secondaryContainerDark,
|
||||
onSecondaryContainer = onSecondaryContainerDark,
|
||||
tertiary = tertiaryDark,
|
||||
onTertiary = onTertiaryDark,
|
||||
tertiaryContainer = tertiaryContainerDark,
|
||||
onTertiaryContainer = onTertiaryContainerDark,
|
||||
error = errorDark,
|
||||
onError = onErrorDark,
|
||||
errorContainer = errorContainerDark,
|
||||
onErrorContainer = onErrorContainerDark,
|
||||
background = backgroundDark,
|
||||
onBackground = onBackgroundDark,
|
||||
surface = surfaceDark,
|
||||
onSurface = onSurfaceDark,
|
||||
surfaceVariant = surfaceVariantDark,
|
||||
onSurfaceVariant = onSurfaceVariantDark,
|
||||
outline = outlineDark,
|
||||
outlineVariant = outlineVariantDark,
|
||||
scrim = scrimDark,
|
||||
inverseSurface = inverseSurfaceDark,
|
||||
inverseOnSurface = inverseOnSurfaceDark,
|
||||
inversePrimary = inversePrimaryDark,
|
||||
)
|
||||
|
||||
private val pureBlackScheme = darkScheme.copy(background = Color.Black, surface = Color(0xff1e1e1e))
|
||||
|
||||
@Immutable
|
||||
data class ColorFamily(
|
||||
val color: Color,
|
||||
val onColor: Color,
|
||||
val colorContainer: Color,
|
||||
val onColorContainer: Color
|
||||
)
|
||||
|
||||
val unspecified_scheme = ColorFamily(
|
||||
Color.Unspecified, Color.Unspecified, Color.Unspecified, Color.Unspecified
|
||||
)
|
||||
|
||||
// Pure black theme logic is added on top of the generated code
|
||||
@Composable
|
||||
fun AppTheme(
|
||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||
pureBlack: Boolean = false,
|
||||
// Dynamic color is available on Android 12+
|
||||
dynamicColor: Boolean = false,
|
||||
content: @Composable() () -> Unit
|
||||
) {
|
||||
val colorScheme = when {
|
||||
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
||||
val context = LocalContext.current
|
||||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||
}
|
||||
|
||||
darkTheme && pureBlack -> pureBlackScheme
|
||||
darkTheme -> darkScheme
|
||||
else -> lightScheme
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
colorScheme = colorScheme,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
|
|
@ -51,6 +51,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
|
||||
import org.fdroid.database.AppPrefs;
|
||||
import org.fdroid.database.AppVersion;
|
||||
|
@ -363,7 +364,7 @@ public class AppDetailsActivity extends AppCompatActivity
|
|||
}
|
||||
|
||||
if (!apk.compatible) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setMessage(R.string.installIncompatible);
|
||||
builder.setPositiveButton(R.string.yes, (dialog, whichButton) -> initiateInstall(apk));
|
||||
builder.setNegativeButton(R.string.no, (dialog, whichButton) -> {
|
||||
|
@ -374,7 +375,7 @@ public class AppDetailsActivity extends AppCompatActivity
|
|||
}
|
||||
if (app.installedSigner != null && apk.signer != null
|
||||
&& !apk.signer.equals(app.installedSigner)) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setMessage(R.string.SignatureMismatch).setPositiveButton(
|
||||
R.string.ok, (dialog, id) -> dialog.cancel());
|
||||
AlertDialog alert = builder.create();
|
||||
|
@ -615,7 +616,9 @@ public class AppDetailsActivity extends AppCompatActivity
|
|||
if (!TextUtils.isEmpty(errorMessage) && !isFinishing()) {
|
||||
Log.e(TAG, "uninstall aborted with errorMessage: " + errorMessage);
|
||||
|
||||
AlertDialog.Builder alertBuilder = new AlertDialog.Builder(AppDetailsActivity.this);
|
||||
MaterialAlertDialogBuilder alertBuilder = new MaterialAlertDialogBuilder(
|
||||
AppDetailsActivity.this
|
||||
);
|
||||
Uri uri = intent.getData();
|
||||
if (uri == null) {
|
||||
alertBuilder.setTitle(getString(R.string.uninstall_error_notify_title, ""));
|
||||
|
|
|
@ -33,7 +33,6 @@ import androidx.annotation.DrawableRes;
|
|||
import androidx.annotation.LayoutRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.compose.ui.platform.ComposeView;
|
||||
import androidx.compose.ui.platform.ViewCompositionStrategy;
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
@ -51,6 +50,7 @@ import androidx.recyclerview.widget.LinearSmoothScroller;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.transition.TransitionManager;
|
||||
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.progressindicator.LinearProgressIndicator;
|
||||
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
|
@ -963,7 +963,7 @@ public class AppDetailsRecyclerViewAdapter
|
|||
message = showIncompatible;
|
||||
}
|
||||
|
||||
new AlertDialog.Builder(context)
|
||||
new MaterialAlertDialogBuilder(context)
|
||||
.setTitle(title)
|
||||
.setMessage(message)
|
||||
.setPositiveButton(R.string.menu_settings, (dialog, which) -> {
|
||||
|
|
|
@ -10,18 +10,17 @@ import androidx.compose.foundation.layout.Row
|
|||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.IconButton
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TextField
|
||||
import androidx.compose.material.TopAppBar
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.ContentPaste
|
||||
import androidx.compose.material.primarySurface
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
|
@ -29,7 +28,6 @@ import androidx.compose.runtime.remember
|
|||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
|
@ -43,14 +41,17 @@ import org.fdroid.fdroid.Preferences
|
|||
import org.fdroid.fdroid.R
|
||||
import org.fdroid.fdroid.compose.ComposeUtils
|
||||
import org.fdroid.fdroid.compose.ComposeUtils.FDroidContent
|
||||
import org.fdroid.fdroid.ui.theme.AppTheme
|
||||
|
||||
class IpfsGatewayAddActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val pureBlack = Preferences.get().isPureBlack
|
||||
|
||||
setContent {
|
||||
FDroidContent {
|
||||
AppTheme(pureBlack = pureBlack) {
|
||||
IpfsGatewayAddScreen(onBackClicked = { onBackPressedDispatcher.onBackPressed() },
|
||||
onAddUserGateway = { url ->
|
||||
// don't allow adding default gateways to the user gateways list
|
||||
|
@ -69,6 +70,7 @@ class IpfsGatewayAddActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun IpfsGatewayAddScreen(
|
||||
onBackClicked: () -> Unit,
|
||||
|
@ -80,8 +82,6 @@ fun IpfsGatewayAddScreen(
|
|||
|
||||
Scaffold(topBar = {
|
||||
TopAppBar(
|
||||
elevation = 4.dp,
|
||||
backgroundColor = MaterialTheme.colors.primarySurface,
|
||||
navigationIcon = {
|
||||
IconButton(onClick = onBackClicked) {
|
||||
Icon(Icons.Filled.ArrowBack, stringResource(R.string.back))
|
||||
|
@ -90,7 +90,6 @@ fun IpfsGatewayAddScreen(
|
|||
title = {
|
||||
Text(
|
||||
text = stringResource(R.string.ipfsgw_add_title),
|
||||
modifier = Modifier.alpha(ContentAlpha.high),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
@ -105,7 +104,7 @@ fun IpfsGatewayAddScreen(
|
|||
) {
|
||||
Text(
|
||||
text = "Enter IPFS gateway URL",
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
)
|
||||
Column {
|
||||
TextField(
|
||||
|
@ -123,7 +122,7 @@ fun IpfsGatewayAddScreen(
|
|||
if (errorMsg.isNotEmpty()) {
|
||||
Text(
|
||||
text = errorMsg,
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = colorResource(
|
||||
id = R.color.fdroid_error
|
||||
)
|
||||
|
|
|
@ -14,20 +14,19 @@ import androidx.compose.foundation.layout.height
|
|||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.rememberScrollState
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.FloatingActionButton
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.IconButton
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.Switch
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TopAppBar
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Add
|
||||
import androidx.compose.material.icons.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.DeleteForever
|
||||
import androidx.compose.material.primarySurface
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.FloatingActionButton
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Switch
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
|
@ -47,6 +46,7 @@ import org.fdroid.fdroid.R
|
|||
import org.fdroid.fdroid.compose.ComposeUtils
|
||||
import org.fdroid.fdroid.compose.ComposeUtils.FDroidContent
|
||||
import org.fdroid.fdroid.compose.ComposeUtils.LifecycleEventListener
|
||||
import org.fdroid.fdroid.ui.theme.AppTheme
|
||||
|
||||
class IpfsGatewaySettingsActivity : AppCompatActivity() {
|
||||
|
||||
|
@ -56,16 +56,20 @@ class IpfsGatewaySettingsActivity : AppCompatActivity() {
|
|||
super.onCreate(savedInstanceState)
|
||||
|
||||
prefs = Preferences.get()
|
||||
val pureBlack = prefs.isPureBlack
|
||||
|
||||
setContent {
|
||||
FDroidContent {
|
||||
IpfsGatewaySettingsScreen(prefs = prefs,
|
||||
onBackClicked = { onBackPressedDispatcher.onBackPressed() })
|
||||
AppTheme(pureBlack = pureBlack) {
|
||||
FDroidContent {
|
||||
IpfsGatewaySettingsScreen(prefs = prefs,
|
||||
onBackClicked = { onBackPressedDispatcher.onBackPressed() })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun IpfsGatewaySettingsScreen(
|
||||
onBackClicked: () -> Unit,
|
||||
|
@ -76,8 +80,6 @@ fun IpfsGatewaySettingsScreen(
|
|||
|
||||
Scaffold(topBar = {
|
||||
TopAppBar(
|
||||
elevation = 4.dp,
|
||||
backgroundColor = MaterialTheme.colors.primarySurface,
|
||||
navigationIcon = {
|
||||
IconButton(onClick = onBackClicked) {
|
||||
Icon(Icons.Filled.ArrowBack, stringResource(R.string.back))
|
||||
|
@ -86,7 +88,6 @@ fun IpfsGatewaySettingsScreen(
|
|||
title = {
|
||||
Text(
|
||||
text = stringResource(R.string.ipfsgw_title),
|
||||
modifier = Modifier.alpha(ContentAlpha.high),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
@ -113,7 +114,7 @@ fun IpfsGatewaySettingsScreen(
|
|||
) {
|
||||
Text(
|
||||
text = stringResource(id = R.string.ipfsgw_explainer),
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
modifier = Modifier.weight(1f)
|
||||
)
|
||||
Switch(checked = ipfsEnabled, onCheckedChange = { checked ->
|
||||
|
@ -148,7 +149,7 @@ fun DefaultGatewaysSettings(
|
|||
) {
|
||||
Text(
|
||||
text = gatewayUrl,
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.align(Alignment.CenterVertically)
|
||||
|
@ -202,7 +203,7 @@ fun UserGatewaysSettings(
|
|||
) {
|
||||
Text(
|
||||
text = gatewayUrl,
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.align(Alignment.CenterVertically)
|
||||
|
|
|
@ -1,32 +1,27 @@
|
|||
package org.fdroid.fdroid.views.appdetails
|
||||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement.spacedBy
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material.DropdownMenu
|
||||
import androidx.compose.material.DropdownMenuItem
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.LocalContentAlpha
|
||||
import androidx.compose.material.LocalContentColor
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.OutlinedTextField
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TextFieldDefaults
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ArrowDropDown
|
||||
import androidx.compose.material3.DropdownMenu
|
||||
import androidx.compose.material3.DropdownMenuItem
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.OutlinedTextField
|
||||
import androidx.compose.material3.OutlinedTextFieldDefaults
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
||||
import androidx.compose.ui.Alignment.Companion.End
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.platform.ComposeView
|
||||
|
@ -41,9 +36,11 @@ import androidx.compose.ui.unit.dp
|
|||
import androidx.core.os.LocaleListCompat
|
||||
import androidx.core.util.Consumer
|
||||
import org.fdroid.database.Repository
|
||||
import org.fdroid.fdroid.Preferences
|
||||
import org.fdroid.fdroid.R
|
||||
import org.fdroid.fdroid.compose.ComposeUtils.FDroidContent
|
||||
import org.fdroid.fdroid.compose.ComposeUtils.FDroidOutlineButton
|
||||
import org.fdroid.fdroid.ui.theme.AppTheme
|
||||
import org.fdroid.fdroid.views.repos.RepoIcon
|
||||
import org.fdroid.index.IndexFormatVersion.TWO
|
||||
|
||||
|
@ -58,20 +55,24 @@ fun setContentRepoChooser(
|
|||
onRepoChanged: Consumer<Repository>,
|
||||
onPreferredRepoChanged: Consumer<Long>,
|
||||
) {
|
||||
val pureBlack = Preferences.get().isPureBlack
|
||||
|
||||
composeView.setContent {
|
||||
FDroidContent {
|
||||
RepoChooser(
|
||||
repos = repos,
|
||||
currentRepoId = currentRepoId,
|
||||
preferredRepoId = preferredRepoId,
|
||||
onRepoChanged = onRepoChanged::accept,
|
||||
onPreferredRepoChanged = onPreferredRepoChanged::accept,
|
||||
modifier = Modifier.background(MaterialTheme.colors.surface),
|
||||
)
|
||||
AppTheme(pureBlack = pureBlack) {
|
||||
FDroidContent {
|
||||
RepoChooser(
|
||||
repos = repos,
|
||||
currentRepoId = currentRepoId,
|
||||
preferredRepoId = preferredRepoId,
|
||||
onRepoChanged = onRepoChanged::accept,
|
||||
onPreferredRepoChanged = onPreferredRepoChanged::accept,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun RepoChooser(
|
||||
repos: List<Repository>,
|
||||
|
@ -93,7 +94,7 @@ fun RepoChooser(
|
|||
val borderColor = if (isPreferred) {
|
||||
colorResource(id = R.color.fdroid_blue)
|
||||
} else {
|
||||
LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
|
||||
MaterialTheme.colorScheme.outline
|
||||
}
|
||||
OutlinedTextField(
|
||||
value = TextFieldValue(
|
||||
|
@ -102,7 +103,7 @@ fun RepoChooser(
|
|||
isPreferred = repos.size > 1 && isPreferred,
|
||||
),
|
||||
),
|
||||
textStyle = MaterialTheme.typography.body2,
|
||||
textStyle = MaterialTheme.typography.bodyMedium,
|
||||
onValueChange = {},
|
||||
label = {
|
||||
if (repos.size == 1) {
|
||||
|
@ -121,18 +122,18 @@ fun RepoChooser(
|
|||
tint = if (isPreferred) {
|
||||
colorResource(id = R.color.fdroid_blue)
|
||||
} else {
|
||||
LocalContentColor.current.copy(alpha = LocalContentAlpha.current)
|
||||
MaterialTheme.colorScheme.onSurface
|
||||
},
|
||||
)
|
||||
},
|
||||
singleLine = false,
|
||||
enabled = false,
|
||||
colors = TextFieldDefaults.outlinedTextFieldColors(
|
||||
// hack to enable clickable
|
||||
disabledTextColor = LocalContentColor.current.copy(LocalContentAlpha.current),
|
||||
colors = OutlinedTextFieldDefaults.colors(
|
||||
// hack to enable clickable and look like enabled
|
||||
disabledTextColor = MaterialTheme.colorScheme.onSurface,
|
||||
disabledBorderColor = borderColor,
|
||||
disabledLeadingIconColor = MaterialTheme.colorScheme.onSurface,
|
||||
disabledLabelColor = borderColor,
|
||||
disabledLeadingIconColor = MaterialTheme.colors.onSurface,
|
||||
),
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
@ -145,12 +146,10 @@ fun RepoChooser(
|
|||
onDismissRequest = { expanded = false },
|
||||
) {
|
||||
repos.iterator().forEach { repo ->
|
||||
DropdownMenuItem(onClick = {
|
||||
RepoMenuItem(repo = repo, isPreferred = isPreferred, onClick = {
|
||||
onRepoChanged(repo)
|
||||
expanded = false
|
||||
}) {
|
||||
RepoItem(repo, repo.repoId == preferredRepoId)
|
||||
}
|
||||
}, modifier = modifier)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -158,25 +157,32 @@ fun RepoChooser(
|
|||
FDroidOutlineButton(
|
||||
text = stringResource(R.string.app_details_repository_button_prefer),
|
||||
onClick = { onPreferredRepoChanged(currentRepo.repoId) },
|
||||
modifier = Modifier.align(End).padding(top = 8.dp),
|
||||
modifier = Modifier
|
||||
.align(End)
|
||||
.padding(top = 8.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun RepoItem(repo: Repository, isPreferred: Boolean, modifier: Modifier = Modifier) {
|
||||
Row(
|
||||
horizontalArrangement = spacedBy(8.dp),
|
||||
verticalAlignment = CenterVertically,
|
||||
private fun RepoMenuItem(
|
||||
repo: Repository,
|
||||
isPreferred: Boolean,
|
||||
modifier: Modifier = Modifier,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
DropdownMenuItem(
|
||||
text = {
|
||||
Text(
|
||||
text = getRepoString(repo, isPreferred),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
},
|
||||
modifier = modifier,
|
||||
) {
|
||||
RepoIcon(repo, Modifier.size(24.dp))
|
||||
Text(
|
||||
text = getRepoString(repo, isPreferred),
|
||||
style = MaterialTheme.typography.body2,
|
||||
)
|
||||
}
|
||||
onClick = onClick,
|
||||
leadingIcon = { RepoIcon(repo, Modifier.size(24.dp)) }
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.fdroid.fdroid.R
|
|||
import org.fdroid.fdroid.UpdateService
|
||||
import org.fdroid.fdroid.compose.ComposeUtils.FDroidContent
|
||||
import org.fdroid.fdroid.nearby.SwapService
|
||||
import org.fdroid.fdroid.ui.theme.AppTheme
|
||||
import org.fdroid.fdroid.views.apps.AppListActivity
|
||||
import org.fdroid.fdroid.views.apps.AppListActivity.EXTRA_REPO_ID
|
||||
import org.fdroid.index.RepoManager
|
||||
|
@ -53,19 +54,24 @@ class AddRepoActivity : AppCompatActivity() {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
val pureBlack = Preferences.get().isPureBlack
|
||||
|
||||
setContent {
|
||||
FDroidContent {
|
||||
val state = repoManager.addRepoState.collectAsState().value
|
||||
BackHandler(state is AddRepoError) {
|
||||
// reset state when going back on error screen
|
||||
repoManager.abortAddingRepository()
|
||||
AppTheme(pureBlack = pureBlack) {
|
||||
FDroidContent {
|
||||
val state = repoManager.addRepoState.collectAsState().value
|
||||
BackHandler(state is AddRepoError) {
|
||||
// reset state when going back on error screen
|
||||
repoManager.abortAddingRepository()
|
||||
}
|
||||
AddRepoIntroScreen(
|
||||
state = state,
|
||||
onFetchRepo = this::onFetchRepo,
|
||||
onAddRepo = { repoManager.addFetchedRepository() },
|
||||
onBackClicked = { onBackPressedDispatcher.onBackPressed() },
|
||||
)
|
||||
}
|
||||
AddRepoIntroScreen(
|
||||
state = state,
|
||||
onFetchRepo = this::onFetchRepo,
|
||||
onAddRepo = { repoManager.addFetchedRepository() },
|
||||
onBackClicked = { onBackPressedDispatcher.onBackPressed() },
|
||||
)
|
||||
}
|
||||
}
|
||||
addOnNewIntentListener { intent ->
|
||||
|
|
|
@ -7,16 +7,14 @@ import androidx.compose.foundation.layout.PaddingValues
|
|||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Error
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
|
||||
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.ColorFilter
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalInspectionMode
|
||||
|
@ -48,7 +46,7 @@ fun AddRepoErrorScreen(paddingValues: PaddingValues, state: AddRepoError) {
|
|||
Image(
|
||||
imageVector = Icons.Default.Error,
|
||||
contentDescription = null,
|
||||
colorFilter = ColorFilter.tint(MaterialTheme.colors.error),
|
||||
colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.error),
|
||||
modifier = Modifier.size(48.dp),
|
||||
)
|
||||
val title = when (state.errorType) {
|
||||
|
@ -67,13 +65,13 @@ fun AddRepoErrorScreen(paddingValues: PaddingValues, state: AddRepoError) {
|
|||
}
|
||||
Text(
|
||||
text = title,
|
||||
style = MaterialTheme.typography.h5,
|
||||
style = MaterialTheme.typography.headlineSmall,
|
||||
textAlign = TextAlign.Center,
|
||||
)
|
||||
if (state.exception != null) Text(
|
||||
text = state.exception.toString(),
|
||||
style = MaterialTheme.typography.body1,
|
||||
modifier = Modifier.alpha(ContentAlpha.medium),
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.content.res.Configuration.UI_MODE_NIGHT_YES
|
|||
import androidx.activity.compose.rememberLauncherForActivityResult
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement.SpaceBetween
|
||||
import androidx.compose.foundation.layout.Arrangement.spacedBy
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
|
@ -18,22 +19,21 @@ import androidx.compose.foundation.rememberScrollState
|
|||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.foundation.verticalScroll
|
||||
import androidx.compose.material.ButtonDefaults
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.IconButton
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Scaffold
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TextField
|
||||
import androidx.compose.material.TopAppBar
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.ArrowBack
|
||||
import androidx.compose.material.icons.filled.ArrowDropDown
|
||||
import androidx.compose.material.icons.filled.ArrowDropUp
|
||||
import androidx.compose.material.icons.filled.ContentPaste
|
||||
import androidx.compose.material.icons.filled.QrCode
|
||||
import androidx.compose.material.primarySurface
|
||||
import androidx.compose.material3.ButtonDefaults
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextField
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
|
@ -44,7 +44,6 @@ import androidx.compose.ui.Alignment
|
|||
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
|
||||
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.focus.FocusRequester
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.layout.onGloballyPositioned
|
||||
|
@ -71,6 +70,7 @@ import org.fdroid.repo.Adding
|
|||
import org.fdroid.repo.Fetching
|
||||
import org.fdroid.repo.None
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun AddRepoIntroScreen(
|
||||
state: AddRepoState,
|
||||
|
@ -80,8 +80,6 @@ fun AddRepoIntroScreen(
|
|||
) {
|
||||
Scaffold(topBar = {
|
||||
TopAppBar(
|
||||
elevation = 4.dp,
|
||||
backgroundColor = MaterialTheme.colors.primarySurface,
|
||||
navigationIcon = {
|
||||
IconButton(onClick = onBackClicked) {
|
||||
Icon(Icons.Filled.ArrowBack, stringResource(R.string.back))
|
||||
|
@ -90,7 +88,6 @@ fun AddRepoIntroScreen(
|
|||
title = {
|
||||
Text(
|
||||
text = stringResource(R.string.repo_add_title),
|
||||
modifier = Modifier.alpha(ContentAlpha.high),
|
||||
)
|
||||
},
|
||||
)
|
||||
|
@ -125,7 +122,7 @@ fun AddRepoIntroContent(paddingValues: PaddingValues, onFetchRepo: (String) -> U
|
|||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.repo_intro),
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
)
|
||||
val startForResult = rememberLauncherForActivityResult(ScanContract()) { result ->
|
||||
if (result.contents != null) {
|
||||
|
@ -148,7 +145,7 @@ fun AddRepoIntroContent(paddingValues: PaddingValues, onFetchRepo: (String) -> U
|
|||
val isPreview = LocalInspectionMode.current
|
||||
var manualExpanded by rememberSaveable { mutableStateOf(isPreview) }
|
||||
Row(
|
||||
horizontalArrangement = spacedBy(16.dp),
|
||||
horizontalArrangement = SpaceBetween,
|
||||
verticalAlignment = CenterVertically,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
@ -156,9 +153,11 @@ fun AddRepoIntroContent(paddingValues: PaddingValues, onFetchRepo: (String) -> U
|
|||
.clickable { manualExpanded = !manualExpanded },
|
||||
) {
|
||||
Text(
|
||||
text = stringResource(R.string.repo_enter_url)
|
||||
text = stringResource(R.string.repo_enter_url),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
// avoid occupying the whole row
|
||||
modifier = Modifier.weight(1f),
|
||||
)
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
Icon(
|
||||
imageVector = if (manualExpanded) {
|
||||
Icons.Default.ArrowDropUp
|
||||
|
|
|
@ -32,7 +32,6 @@ import android.view.MenuItem;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.core.app.NavUtils;
|
||||
import androidx.core.app.TaskStackBuilder;
|
||||
|
@ -193,7 +192,7 @@ public class ManageReposActivity extends AppCompatActivity implements RepoAdapte
|
|||
@Override
|
||||
public void onToggleEnabled(Repository repo) {
|
||||
if (repo.getEnabled()) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(this);
|
||||
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(this);
|
||||
builder.setMessage(R.string.repo_disable_warning);
|
||||
builder.setPositiveButton(R.string.repo_disable_warning_button, (dialog, id) -> {
|
||||
disableRepo(repo);
|
||||
|
|
|
@ -29,7 +29,6 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.appcompat.widget.SwitchCompat;
|
||||
import androidx.core.app.NavUtils;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.lifecycle.ViewModelProvider;
|
||||
|
@ -38,6 +37,8 @@ import androidx.recyclerview.widget.LinearLayoutManager;
|
|||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.android.material.appbar.MaterialToolbar;
|
||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||
import com.google.android.material.materialswitch.MaterialSwitch;
|
||||
import com.google.android.material.textfield.TextInputLayout;
|
||||
|
||||
import org.fdroid.database.AppDao;
|
||||
|
@ -185,17 +186,17 @@ public class RepoDetailsActivity extends AppCompatActivity {
|
|||
}
|
||||
});
|
||||
|
||||
SwitchCompat switchCompat = findViewById(R.id.archiveRepo);
|
||||
MaterialSwitch archiveRepoSwitch = findViewById(R.id.archiveRepo);
|
||||
model.getLiveData().observe(this, s -> {
|
||||
Boolean enabled = s.getArchiveEnabled();
|
||||
if (enabled == null) {
|
||||
switchCompat.setEnabled(false);
|
||||
archiveRepoSwitch.setEnabled(false);
|
||||
} else {
|
||||
switchCompat.setEnabled(true);
|
||||
switchCompat.setChecked(enabled);
|
||||
archiveRepoSwitch.setEnabled(true);
|
||||
archiveRepoSwitch.setChecked(enabled);
|
||||
}
|
||||
});
|
||||
switchCompat.setOnClickListener(v -> model.setArchiveRepoEnabled(repo, switchCompat.isChecked()));
|
||||
archiveRepoSwitch.setOnClickListener(v -> model.setArchiveRepoEnabled(repo, archiveRepoSwitch.isChecked()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -453,7 +454,7 @@ public class RepoDetailsActivity extends AppCompatActivity {
|
|||
}
|
||||
|
||||
private void promptForDelete() {
|
||||
new AlertDialog.Builder(this)
|
||||
new MaterialAlertDialogBuilder(this)
|
||||
.setTitle(R.string.repo_confirm_delete_title)
|
||||
.setMessage(R.string.repo_confirm_delete_body)
|
||||
.setPositiveButton(R.string.delete, (dialog, which) -> {
|
||||
|
@ -470,7 +471,7 @@ public class RepoDetailsActivity extends AppCompatActivity {
|
|||
|
||||
private void showChangePasswordDialog(final View parentView) {
|
||||
final View view = getLayoutInflater().inflate(R.layout.login, (ViewGroup) parentView, false);
|
||||
final AlertDialog credentialsDialog = new AlertDialog.Builder(this).setView(view).create();
|
||||
final AlertDialog credentialsDialog = new MaterialAlertDialogBuilder(this).setView(view).create();
|
||||
final TextInputLayout nameInputLayout = view.findViewById(R.id.edit_name);
|
||||
final TextInputLayout passwordInputLayout = view.findViewById(R.id.edit_password);
|
||||
final EditText nameInput = nameInputLayout.getEditText();
|
||||
|
|
|
@ -13,17 +13,15 @@ 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.material.Card
|
||||
import androidx.compose.material.ContentAlpha
|
||||
import androidx.compose.material.LinearProgressIndicator
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material3.Card
|
||||
import androidx.compose.material3.LinearProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
||||
import androidx.compose.ui.Alignment.Companion.End
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
import androidx.compose.ui.platform.LocalInspectionMode
|
||||
import androidx.compose.ui.res.stringResource
|
||||
|
@ -72,11 +70,11 @@ fun RepoPreviewScreen(paddingValues: PaddingValues, state: Fetching, onAddRepo:
|
|||
) {
|
||||
Text(
|
||||
text = "Included apps:",
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
)
|
||||
Text(
|
||||
text = state.apps.size.toString(),
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
)
|
||||
if (!state.done) LinearProgressIndicator(modifier = Modifier.weight(1f))
|
||||
}
|
||||
|
@ -110,16 +108,16 @@ fun RepoPreviewHeader(
|
|||
text = repo.getName(localeList) ?: "Unknown Repository",
|
||||
maxLines = 1,
|
||||
fontWeight = FontWeight.Bold,
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
)
|
||||
Text(
|
||||
text = repo.address.replaceFirst("https://", ""),
|
||||
style = MaterialTheme.typography.body2,
|
||||
modifier = Modifier.alpha(ContentAlpha.medium),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
Text(
|
||||
text = Utils.formatLastUpdated(LocalContext.current.resources, repo.timestamp),
|
||||
style = MaterialTheme.typography.body2,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -134,8 +132,8 @@ fun RepoPreviewHeader(
|
|||
) else if (state.fetchResult is IsExistingRepository) {
|
||||
Text(
|
||||
text = stringResource(R.string.repo_exists),
|
||||
style = MaterialTheme.typography.body1,
|
||||
color = MaterialTheme.colors.error,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
color = MaterialTheme.colorScheme.error,
|
||||
)
|
||||
}
|
||||
val description = if (isPreview) {
|
||||
|
@ -145,7 +143,7 @@ fun RepoPreviewHeader(
|
|||
}
|
||||
if (description != null) Text(
|
||||
text = description,
|
||||
style = MaterialTheme.typography.body2,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -183,11 +181,11 @@ fun LazyItemScope.RepoPreviewApp(
|
|||
Column {
|
||||
Text(
|
||||
app.name ?: "Unknown app",
|
||||
style = MaterialTheme.typography.body1,
|
||||
style = MaterialTheme.typography.bodyLarge,
|
||||
)
|
||||
Text(
|
||||
app.summary ?: "",
|
||||
style = MaterialTheme.typography.body2,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@ import androidx.compose.foundation.layout.PaddingValues
|
|||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material.CircularProgressIndicator
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Alignment.Companion.CenterHorizontally
|
||||
import androidx.compose.ui.Alignment.Companion.CenterVertically
|
||||
|
@ -31,7 +31,7 @@ fun RepoProgressScreen(paddingValues: PaddingValues, text: String) {
|
|||
) {
|
||||
Text(
|
||||
text = text,
|
||||
style = MaterialTheme.typography.h5,
|
||||
style = MaterialTheme.typography.headlineSmall,
|
||||
)
|
||||
CircularProgressIndicator(modifier = Modifier.size(64.dp))
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="oval" >
|
||||
<solid android:color="?attr/iconBackgroundColor" />
|
||||
<solid android:color="?attr/colorSurfaceContainer" />
|
||||
</shape>
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#3c3c3e" />
|
||||
</shape>
|
|
@ -1,5 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#eff4f9" />
|
||||
</shape>
|
|
@ -5,7 +5,7 @@
|
|||
<size
|
||||
android:width="20dp"
|
||||
android:height="20dp" />
|
||||
<solid android:color="@color/fdroid_green" />
|
||||
<solid android:color="?attr/colorPrimary" />
|
||||
</shape>
|
||||
</item>
|
||||
</layer-list>
|
|
@ -18,8 +18,7 @@
|
|||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:title="@string/install_history"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface" />
|
||||
app:title="@string/install_history" />
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:title="@string/repo_details" />
|
||||
|
@ -166,7 +165,7 @@
|
|||
style="@style/CaptionText"
|
||||
android:text="@string/repo_archive_toggle" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/archiveRepo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
android:id="@+id/card"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="144dp"
|
||||
android:layout_margin="4dp">
|
||||
android:layout_margin="4dp"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -5,25 +5,22 @@
|
|||
android:id="@+id/rootCoordinator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="?attr/appDetailsBackground"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context="org.fdroid.fdroid.views.AppDetailsActivity">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:id="@+id/app_bar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/app_bar_height"
|
||||
android:layout_height="wrap_content"
|
||||
android:fitsSystemWindows="true"
|
||||
app:layout_behavior="org.fdroid.fdroid.views.FixAppBarLayoutBehavior">
|
||||
|
||||
<com.google.android.material.appbar.CollapsingToolbarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
|
||||
style="?attr/collapsingToolbarLayoutLargeStyle"
|
||||
android:fitsSystemWindows="true"
|
||||
app:collapsedTitleTextAppearance="@style/TextAppearance.App.CollapsingToolbar.Collapsed"
|
||||
app:contentScrim="?colorPrimarySurface"
|
||||
app:expandedTitleMarginTop="24dp"
|
||||
app:expandedTitleTextAppearance="@style/TextAppearance.App.CollapsingToolbar.Expanded"
|
||||
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
|
||||
|
||||
<org.fdroid.fdroid.views.apps.FeatureImage
|
||||
|
@ -36,7 +33,6 @@
|
|||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="@android:color/transparent"
|
||||
|
|
|
@ -20,8 +20,7 @@
|
|||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
app:title="@string/installed_apps__activity_title"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface" />
|
||||
app:title="@string/installed_apps__activity_title" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/edit_name"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
|
@ -33,7 +33,7 @@
|
|||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:id="@+id/edit_password"
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
|
||||
style="@style/Widget.Material3.TextInputLayout.OutlinedBox"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="4dp"
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Copyright (C) 2015 The Android Open Source Project
|
||||
~
|
||||
~ Licensed under the Apache License, Version 2.0 (the "License");
|
||||
~ you may not use this file except in compliance with the License.
|
||||
~ You may obtain a copy of the License at
|
||||
~
|
||||
~ http://www.apache.org/licenses/LICENSE-2.0
|
||||
~
|
||||
~ Unless required by applicable law or agreed to in writing, software
|
||||
~ distributed under the License is distributed on an "AS IS" BASIS,
|
||||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License
|
||||
-->
|
||||
|
||||
<!-- Derived from https://github.com/androidx/androidx/blob/824114c787e8be1b5a81e589f81827c9121c36e6/preference/preference/res/layout/preference_dialog_edittext.xml -->
|
||||
|
||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_marginBottom="48dp"
|
||||
android:overScrollMode="ifContentScrolls">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/message"
|
||||
style="?android:attr/textAppearanceSmall"
|
||||
android:layout_marginLeft="24dp"
|
||||
android:layout_marginRight="24dp"
|
||||
android:layout_marginStart="24dp"
|
||||
android:layout_marginEnd="24dp"
|
||||
android:layout_marginBottom="48dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="?android:attr/textColorSecondary" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@android:id/edit"
|
||||
android:layout_marginLeft="20dp"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="48dp" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Derived from https://github.com/androidx/androidx/blob/005e9694795cee9a42375d80b0d813af9e700ac1/preference/preference/res/layout/preference_widget_switch_compat.xml -->
|
||||
<!-- Thanks to https://stackoverflow.com/a/73782598/9077356 -->
|
||||
<com.google.android.material.materialswitch.MaterialSwitch xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/switchWidget"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="false"
|
||||
android:clickable="false"
|
||||
android:background="@null" />
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
@ -84,11 +84,11 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/repo_switch"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
<com.google.android.material.appbar.MaterialToolbar
|
||||
android:id="@+id/toolbar"
|
||||
style="@style/Widget.MaterialComponents.Toolbar.PrimarySurface"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
|
|
|
@ -2,4 +2,55 @@
|
|||
<resources>
|
||||
<color name="fdroid_error">#ffcf6679</color>
|
||||
<color name="fdroid_caption">#ffb8b8b8</color>
|
||||
|
||||
|
||||
<!-- Generated by Material Theme Builder from fdroid_blue and fdroid_green with modifications -->
|
||||
<!-- https://www.figma.com/community/plugin/1034969338659738588 -->
|
||||
<!-- Unused code are and themes with contrast are removed -->
|
||||
<color name="md_theme_primary">#A5C8FF</color>
|
||||
<color name="md_theme_onPrimary">#00315F</color>
|
||||
<color name="md_theme_primaryContainer">#006DC7</color>
|
||||
<color name="md_theme_onPrimaryContainer">#FFFFFF</color>
|
||||
<color name="md_theme_secondary">#ADD535</color>
|
||||
<color name="md_theme_onSecondary">#283500</color>
|
||||
<color name="md_theme_secondaryContainer">#83A800</color>
|
||||
<color name="md_theme_onSecondaryContainer">#080D00</color>
|
||||
<color name="md_theme_tertiary">#EDB1FF</color>
|
||||
<color name="md_theme_onTertiary">#52046E</color>
|
||||
<color name="md_theme_tertiaryContainer">#954FB0</color>
|
||||
<color name="md_theme_onTertiaryContainer">#FFFFFF</color>
|
||||
<color name="md_theme_error">#FFB4AB</color>
|
||||
<color name="md_theme_onError">#690005</color>
|
||||
<color name="md_theme_errorContainer">#93000A</color>
|
||||
<color name="md_theme_onErrorContainer">#FFDAD6</color>
|
||||
<color name="md_theme_background">#101319</color>
|
||||
<color name="md_theme_onBackground">#E0E2EA</color>
|
||||
<color name="md_theme_surface">#101319</color>
|
||||
<color name="md_theme_onSurface">#E0E2EA</color>
|
||||
<color name="md_theme_surfaceVariant">#414752</color>
|
||||
<color name="md_theme_onSurfaceVariant">#C1C6D4</color>
|
||||
<color name="md_theme_outline">#8B919E</color>
|
||||
<color name="md_theme_outlineVariant">#414752</color>
|
||||
<color name="md_theme_inverseSurface">#E0E2EA</color>
|
||||
<color name="md_theme_inverseOnSurface">#2D3037</color>
|
||||
<color name="md_theme_inversePrimary">#005FAF</color>
|
||||
<color name="md_theme_primaryFixed">#D4E3FF</color>
|
||||
<color name="md_theme_onPrimaryFixed">#001C3A</color>
|
||||
<color name="md_theme_primaryFixedDim">#A5C8FF</color>
|
||||
<color name="md_theme_onPrimaryFixedVariant">#004786</color>
|
||||
<color name="md_theme_secondaryFixed">#C8F250</color>
|
||||
<color name="md_theme_onSecondaryFixed">#161F00</color>
|
||||
<color name="md_theme_secondaryFixedDim">#ADD535</color>
|
||||
<color name="md_theme_onSecondaryFixedVariant">#3B4D00</color>
|
||||
<color name="md_theme_tertiaryFixed">#F9D8FF</color>
|
||||
<color name="md_theme_onTertiaryFixed">#320046</color>
|
||||
<color name="md_theme_tertiaryFixedDim">#EDB1FF</color>
|
||||
<color name="md_theme_onTertiaryFixedVariant">#6B2687</color>
|
||||
<color name="md_theme_surfaceDim">#101319</color>
|
||||
<color name="md_theme_surfaceBright">#363940</color>
|
||||
<color name="md_theme_surfaceContainerLowest">#0B0E14</color>
|
||||
<color name="md_theme_surfaceContainerLow">#181C21</color>
|
||||
<color name="md_theme_surfaceContainer">#1C2026</color>
|
||||
<color name="md_theme_surfaceContainerHigh">#272A30</color>
|
||||
<color name="md_theme_surfaceContainerHighest">#32353B</color>
|
||||
</resources>
|
||||
|
|
|
@ -15,25 +15,9 @@
|
|||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<resources>
|
||||
<!--Top level DayNight theme to be used in AndroidManifest.xml-->
|
||||
<style name="Theme.App" parent="Base.Theme.App">
|
||||
<!--Material color attributes (dark theme) -->
|
||||
|
||||
<!--Platform attributes-->
|
||||
<item name="android:windowLightStatusBar" tools:targetApi="m">false</item>
|
||||
<item name="android:windowLightNavigationBar" tools:targetApi="27">false</item>
|
||||
<item name="android:statusBarColor">@android:color/black</item>
|
||||
<item name="android:navigationBarColor">@android:color/black</item>
|
||||
|
||||
<!-- backward-compatibility theme options go here -->
|
||||
<item name="colorPrimary">@color/fdroid_blue_light</item>
|
||||
<item name="colorPrimaryVariant">@color/fdroid_blue</item>
|
||||
<item name="colorPrimaryDark">?colorPrimaryVariant</item>
|
||||
<item name="colorOnPrimary">#000000</item>
|
||||
<item name="colorSecondary">@color/fdroid_green_light</item>
|
||||
<item name="colorOnSecondary">#ffffff</item>
|
||||
<item name="android:textColorLink">@color/fdroid_green</item>
|
||||
<item name="appDetailsBackground">?android:windowBackground</item>
|
||||
<item name="appDetailsCardBackground">#424242</item>
|
||||
<item name="categoryPreviewAppCardBackground">
|
||||
|
@ -44,7 +28,6 @@
|
|||
<item name="mainTabSwapSplashTint">#2c2c2c</item>
|
||||
<item name="categoryName">#ffffff</item>
|
||||
<item name="installedApps">#ffffff</item>
|
||||
<item name="detailPanel">@drawable/details_panel_donate_background_dark</item>
|
||||
<item name="appListItem">#ffffff</item>
|
||||
<item name="lightGrayTextColor">#a6a6a6</item>
|
||||
<item name="antiFeaturesWarning">@drawable/ic_warning</item>
|
||||
|
@ -55,6 +38,55 @@
|
|||
<item name="screenshotPlaceholderIconColor">#424242</item>
|
||||
|
||||
<item name="iconBackgroundColor">#80121212</item>
|
||||
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
|
||||
<item name="colorPrimary">@color/md_theme_primary</item>
|
||||
<item name="colorOnPrimary">@color/md_theme_onPrimary</item>
|
||||
<item name="colorPrimaryContainer">@color/md_theme_primaryContainer</item>
|
||||
<item name="colorOnPrimaryContainer">@color/md_theme_onPrimaryContainer</item>
|
||||
<item name="colorSecondary">@color/md_theme_secondary</item>
|
||||
<item name="colorOnSecondary">@color/md_theme_onSecondary</item>
|
||||
<item name="colorSecondaryContainer">@color/md_theme_secondaryContainer</item>
|
||||
<item name="colorOnSecondaryContainer">@color/md_theme_onSecondaryContainer</item>
|
||||
<item name="colorTertiary">@color/md_theme_tertiary</item>
|
||||
<item name="colorOnTertiary">@color/md_theme_onTertiary</item>
|
||||
<item name="colorTertiaryContainer">@color/md_theme_tertiaryContainer</item>
|
||||
<item name="colorOnTertiaryContainer">@color/md_theme_onTertiaryContainer</item>
|
||||
<item name="colorError">@color/md_theme_error</item>
|
||||
<item name="colorOnError">@color/md_theme_onError</item>
|
||||
<item name="colorErrorContainer">@color/md_theme_errorContainer</item>
|
||||
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer</item>
|
||||
<item name="android:colorBackground">@color/md_theme_background</item>
|
||||
<item name="colorOnBackground">@color/md_theme_onBackground</item>
|
||||
<item name="colorSurface">@color/md_theme_surface</item>
|
||||
<item name="colorOnSurface">@color/md_theme_onSurface</item>
|
||||
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant</item>
|
||||
<item name="colorOnSurfaceVariant">@color/md_theme_onSurfaceVariant</item>
|
||||
<item name="colorOutline">@color/md_theme_outline</item>
|
||||
<item name="colorOutlineVariant">@color/md_theme_outlineVariant</item>
|
||||
<item name="colorSurfaceInverse">@color/md_theme_inverseSurface</item>
|
||||
<item name="colorOnSurfaceInverse">@color/md_theme_inverseOnSurface</item>
|
||||
<item name="colorPrimaryInverse">@color/md_theme_inversePrimary</item>
|
||||
<item name="colorPrimaryFixed">@color/md_theme_primaryFixed</item>
|
||||
<item name="colorOnPrimaryFixed">@color/md_theme_onPrimaryFixed</item>
|
||||
<item name="colorPrimaryFixedDim">@color/md_theme_primaryFixedDim</item>
|
||||
<item name="colorOnPrimaryFixedVariant">@color/md_theme_onPrimaryFixedVariant</item>
|
||||
<item name="colorSecondaryFixed">@color/md_theme_secondaryFixed</item>
|
||||
<item name="colorOnSecondaryFixed">@color/md_theme_onSecondaryFixed</item>
|
||||
<item name="colorSecondaryFixedDim">@color/md_theme_secondaryFixedDim</item>
|
||||
<item name="colorOnSecondaryFixedVariant">@color/md_theme_onSecondaryFixedVariant</item>
|
||||
<item name="colorTertiaryFixed">@color/md_theme_tertiaryFixed</item>
|
||||
<item name="colorOnTertiaryFixed">@color/md_theme_onTertiaryFixed</item>
|
||||
<item name="colorTertiaryFixedDim">@color/md_theme_tertiaryFixedDim</item>
|
||||
<item name="colorOnTertiaryFixedVariant">@color/md_theme_onTertiaryFixedVariant</item>
|
||||
<item name="colorSurfaceDim">@color/md_theme_surfaceDim</item>
|
||||
<item name="colorSurfaceBright">@color/md_theme_surfaceBright</item>
|
||||
<item name="colorSurfaceContainerLowest">@color/md_theme_surfaceContainerLowest</item>
|
||||
<item name="colorSurfaceContainerLow">@color/md_theme_surfaceContainerLow</item>
|
||||
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer</item>
|
||||
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
|
||||
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.App.Black" parent="Theme.App">
|
||||
|
|
|
@ -24,17 +24,62 @@
|
|||
<color tools:ignore="UnusedResources" name="category_time">#FF7043</color>
|
||||
<color tools:ignore="UnusedResources" name="category_writing">#F2E9CE</color>
|
||||
|
||||
<color name="fdroid_blue_light">#ff63a4ff</color>
|
||||
<color name="fdroid_blue">#ff1976d2</color>
|
||||
<color name="fdroid_blue_dark">#ff004ba0</color>
|
||||
<color name="fdroid_green_light">#ffbee247</color>
|
||||
<color name="fdroid_green">#ff8ab000</color>
|
||||
<color tools:ignore="UnusedResources" name="fdroid_blue">#ff1976d2</color>
|
||||
<color tools:ignore="UnusedResources" name="fdroid_green">#ff8ab000</color>
|
||||
<color name="fdroid_error">#ffb00020</color>
|
||||
<color name="fdroid_caption">#ff757575</color>
|
||||
<color tools:ignore="UnusedResources" name="fdroid_caption">#ff757575</color>
|
||||
|
||||
<color name="shadow">#cc222222</color>
|
||||
<color name="warning">#827717</color>
|
||||
|
||||
<color name="perms_costs_money">#fff4511e</color>
|
||||
|
||||
<!-- Generated by Material Theme Builder from fdroid_blue and fdroid_green -->
|
||||
<!-- https://www.figma.com/community/plugin/1034969338659738588-->
|
||||
<color name="md_theme_primary">#005197</color>
|
||||
<color name="md_theme_onPrimary">#FFFFFF</color>
|
||||
<color name="md_theme_primaryContainer">#1976D2</color>
|
||||
<color name="md_theme_onPrimaryContainer">#FFFFFF</color>
|
||||
<color name="md_theme_secondary">#4F6600</color>
|
||||
<color name="md_theme_onSecondary">#FFFFFF</color>
|
||||
<color name="md_theme_secondaryContainer">#95BC18</color>
|
||||
<color name="md_theme_onSecondaryContainer">#1C2700</color>
|
||||
<color name="md_theme_tertiary">#763192</color>
|
||||
<color name="md_theme_onTertiary">#FFFFFF</color>
|
||||
<color name="md_theme_tertiaryContainer">#9F58BA</color>
|
||||
<color name="md_theme_onTertiaryContainer">#FFFFFF</color>
|
||||
<color name="md_theme_error">#BA1A1A</color>
|
||||
<color name="md_theme_onError">#FFFFFF</color>
|
||||
<color name="md_theme_errorContainer">#FFDAD6</color>
|
||||
<color name="md_theme_onErrorContainer">#410002</color>
|
||||
<color name="md_theme_background">#F9F9FF</color>
|
||||
<color name="md_theme_onBackground">#181C21</color>
|
||||
<color name="md_theme_surface">#F9F9FF</color>
|
||||
<color name="md_theme_onSurface">#181C21</color>
|
||||
<color name="md_theme_surfaceVariant">#DDE2F0</color>
|
||||
<color name="md_theme_onSurfaceVariant">#414752</color>
|
||||
<color name="md_theme_outline">#717783</color>
|
||||
<color name="md_theme_outlineVariant">#C1C6D4</color>
|
||||
<color name="md_theme_inverseSurface">#2D3037</color>
|
||||
<color name="md_theme_inverseOnSurface">#EFF0F9</color>
|
||||
<color name="md_theme_inversePrimary">#A5C8FF</color>
|
||||
<color name="md_theme_primaryFixed">#D4E3FF</color>
|
||||
<color name="md_theme_onPrimaryFixed">#001C3A</color>
|
||||
<color name="md_theme_primaryFixedDim">#A5C8FF</color>
|
||||
<color name="md_theme_onPrimaryFixedVariant">#004786</color>
|
||||
<color name="md_theme_secondaryFixed">#C8F250</color>
|
||||
<color name="md_theme_onSecondaryFixed">#161F00</color>
|
||||
<color name="md_theme_secondaryFixedDim">#ADD535</color>
|
||||
<color name="md_theme_onSecondaryFixedVariant">#3B4D00</color>
|
||||
<color name="md_theme_tertiaryFixed">#F9D8FF</color>
|
||||
<color name="md_theme_onTertiaryFixed">#320046</color>
|
||||
<color name="md_theme_tertiaryFixedDim">#EDB1FF</color>
|
||||
<color name="md_theme_onTertiaryFixedVariant">#6B2687</color>
|
||||
<color name="md_theme_surfaceDim">#D8DAE2</color>
|
||||
<color name="md_theme_surfaceBright">#F9F9FF</color>
|
||||
<color name="md_theme_surfaceContainerLowest">#FFFFFF</color>
|
||||
<color name="md_theme_surfaceContainerLow">#F2F3FC</color>
|
||||
<color name="md_theme_surfaceContainer">#ECEDF6</color>
|
||||
<color name="md_theme_surfaceContainerHigh">#E6E8F0</color>
|
||||
<color name="md_theme_surfaceContainerHighest">#E0E2EA</color>
|
||||
</resources>
|
||||
|
|
|
@ -34,19 +34,19 @@
|
|||
<!--and cornerSizeBottomRight.-->
|
||||
|
||||
<!--Shape Appearance for small components like chips, buttons, text fields and FABs-->
|
||||
<style name="ShapeAppearance.App.SmallComponent" parent="ShapeAppearance.MaterialComponents.SmallComponent">
|
||||
<style name="ShapeAppearance.App.SmallComponent" parent="ShapeAppearance.Material3.SmallComponent">
|
||||
<item name="cornerSize">4dp</item>
|
||||
<item name="cornerFamily">rounded</item>
|
||||
</style>
|
||||
|
||||
<!--Shape Appearance for medium components like cards, alert dialogs-->
|
||||
<style name="ShapeAppearance.App.MediumComponent" parent="ShapeAppearance.MaterialComponents.MediumComponent">
|
||||
<style name="ShapeAppearance.App.MediumComponent" parent="ShapeAppearance.Material3.MediumComponent">
|
||||
<item name="cornerSize">16dp</item>
|
||||
<item name="cornerFamily">rounded</item>
|
||||
</style>
|
||||
|
||||
<!--Shape Appearance for large components like side and bottom navigation drawers-->
|
||||
<style name="ShapeAppearance.App.LargeComponent" parent="ShapeAppearance.MaterialComponents.LargeComponent">
|
||||
<style name="ShapeAppearance.App.LargeComponent" parent="ShapeAppearance.Material3.LargeComponent">
|
||||
<item name="cornerSizeTopLeft">20dp</item>
|
||||
<item name="cornerSizeTopRight">20dp</item>
|
||||
<item name="cornerSizeBottomRight">0dp</item>
|
||||
|
@ -54,12 +54,12 @@
|
|||
<item name="cornerFamily">rounded</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearance.App.Button" parent="ShapeAppearance.MaterialComponents.SmallComponent">
|
||||
<style name="ShapeAppearance.App.Button" parent="ShapeAppearance.Material3.SmallComponent">
|
||||
<item name="cornerSize">50%</item>
|
||||
<item name="cornerFamily">rounded</item>
|
||||
</style>
|
||||
|
||||
<style name="ShapeAppearance.App.Card" parent="ShapeAppearance.MaterialComponents.MediumComponent">
|
||||
<style name="ShapeAppearance.App.Card" parent="ShapeAppearance.Material3.MediumComponent">
|
||||
<item name="cornerSize">4dp</item>
|
||||
<item name="cornerFamily">rounded</item>
|
||||
</style>
|
||||
|
|
|
@ -11,56 +11,47 @@
|
|||
</style>
|
||||
|
||||
<!--Dialog-->
|
||||
<style name="MaterialAlertDialog.App.Title.Text" parent="MaterialAlertDialog.MaterialComponents.Title.Text">
|
||||
<style name="MaterialAlertDialog.App.Title.Text" parent="MaterialAlertDialog.Material3.Title.Text">
|
||||
<item name="android:textColor">@color/fdroid_green</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="Widget.App.CardView" parent="Widget.MaterialComponents.CardView">
|
||||
<!-- To preserve the UX before MD3 migration -->
|
||||
<style name="Widget.App.CardView" parent="Widget.Material3.CardView.Elevated">
|
||||
<item name="shapeAppearance">@style/ShapeAppearance.App.Card</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.App.Button.Dialog" parent="Widget.MaterialComponents.Button.TextButton.Dialog">
|
||||
<style name="Widget.App.Button.Dialog" parent="Widget.Material3.Button.TextButton.Dialog">
|
||||
<item name="materialThemeOverlay">@style/ThemeOverlay.App.Button.TextButton</item>
|
||||
<item name="colorPrimary">@color/fdroid_green</item>
|
||||
<item name="android:textColor">@color/fdroid_green</item>
|
||||
<item name="shapeAppearance">@style/ShapeAppearance.App.Button</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.App.Button.TextButton" parent="Widget.MaterialComponents.Button.TextButton">
|
||||
<style name="Widget.App.Button.TextButton" parent="Widget.Material3.Button.TextButton">
|
||||
<item name="shapeAppearance">@style/ShapeAppearance.App.Button</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.App.Button.OutlinedButton" parent="Widget.MaterialComponents.Button.OutlinedButton">
|
||||
<style name="Widget.App.Button.OutlinedButton" parent="Widget.Material3.Button.OutlinedButton">
|
||||
<item name="shapeAppearance">@style/ShapeAppearance.App.Button</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.App.Button" parent="Widget.MaterialComponents.Button">
|
||||
<style name="Widget.App.Button" parent="Widget.Material3.Button">
|
||||
<item name="shapeAppearance">@style/ShapeAppearance.App.Button</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertDialogBaseThemeDark" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog" />
|
||||
|
||||
<style name="ThemeOverlay.App.MaterialAlertDialog.Dark" parent="AlertDialogBaseThemeDark">
|
||||
<item name="android:windowBackground">@color/cardview_dark_background</item>
|
||||
<style name="Widget.App.Button.ElevatedButton" parent="Widget.Material3.Button.ElevatedButton">
|
||||
<item name="shapeAppearance">@style/ShapeAppearance.App.Button</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertDialogBaseThemeLight" parent="ThemeOverlay.MaterialComponents.MaterialAlertDialog" />
|
||||
|
||||
<style name="ThemeOverlay.App.MaterialAlertDialog.Light" parent="AlertDialogBaseThemeLight">
|
||||
<item name="colorSecondary">@color/fdroid_green</item>
|
||||
</style>
|
||||
|
||||
<style name="AlertDialogBaseThemeNight" parent="AlertDialogBaseThemeDark" />
|
||||
|
||||
<style name="MinWithDialogBaseThemeDark" parent="Theme.MaterialComponents.Dialog.MinWidth">
|
||||
<style name="MinWithDialogBaseThemeDark" parent="Theme.Material3.DayNight.Dialog.MinWidth">
|
||||
<item name="colorSecondary">@color/fdroid_green</item>
|
||||
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
</style>
|
||||
|
||||
<style name="MinWithDialogBaseThemeLight" parent="Theme.MaterialComponents.Light.Dialog.MinWidth">
|
||||
<style name="MinWithDialogBaseThemeLight" parent="Theme.Material3.Light.Dialog.MinWidth">
|
||||
<item name="colorSecondary">@color/fdroid_green</item>
|
||||
|
||||
<item name="windowActionBar">false</item>
|
||||
|
@ -100,7 +91,6 @@
|
|||
<style name="AppListItemStatusText">
|
||||
<item name="android:textStyle">italic</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textColor">?attr/lightGrayTextColor</item>
|
||||
<item name="android:maxLines">1</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
<item name="fontFamily">sans-serif-light</item>
|
||||
|
@ -144,4 +134,13 @@
|
|||
<!-- Disable default tickMarks. We draw our own in SeekBarForegroundThumb -->
|
||||
<item name="tickMark">@null</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="Widget.App.Preference.SwitchPreferenceCompat" parent="Preference.SwitchPreferenceCompat.Material">
|
||||
<item name="android:widgetLayout">@layout/preference_switch</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.App.Preference.DialogPreference.EditTextPreference" parent="Preference.DialogPreference.EditTextPreference.Material">
|
||||
<item name="android:dialogLayout">@layout/preference_edit_text</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -11,16 +11,11 @@
|
|||
<item name="android:paddingLeft">18dp</item>
|
||||
<item name="android:paddingRight">18dp</item>
|
||||
<item name="textAllCaps">true</item>
|
||||
<item name="materialThemeOverlay">@style/ThemeOverlay.App.DetailsButton</item>
|
||||
<item name="android:stateListAnimator">@null</item> <!-- no elevation change on hover -->
|
||||
<item name="android:letterSpacing">0.05</item>
|
||||
</style>
|
||||
|
||||
<style name="DetailsPrimaryButtonStyle" parent="Widget.App.Button">
|
||||
<item name="materialThemeOverlay">@style/ThemeOverlay.App.DetailsButton</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.App.DetailsButton" parent="" />
|
||||
<style name="DetailsPrimaryButtonStyle" parent="Widget.App.Button"></style>
|
||||
|
||||
<style name="DetailsPrimaryButtonStyleSmall" parent="DetailsPrimaryButtonStyle">
|
||||
<item name="android:textSize">12sp</item>
|
||||
|
@ -30,9 +25,7 @@
|
|||
<item name="android:paddingRight">12dp</item>
|
||||
</style>
|
||||
|
||||
<style name="DetailsSecondaryButtonStyle" parent="DetailsButtonStyle">
|
||||
<item name="materialThemeOverlay">@style/ThemeOverlay.App.DetailsButton</item>
|
||||
</style>
|
||||
<style name="DetailsSecondaryButtonStyle" parent="DetailsButtonStyle"></style>
|
||||
|
||||
<style name="DetailsSecondaryButtonStyleSmall" parent="DetailsSecondaryButtonStyle">
|
||||
<item name="android:textSize">12sp</item>
|
||||
|
@ -46,17 +39,16 @@
|
|||
<item name="android:padding">8dp</item>
|
||||
<item name="android:textSize">14sp</item>
|
||||
<item name="android:textStyle">normal</item>
|
||||
<item name="materialThemeOverlay">@style/ThemeOverlay.App.DetailsButton</item>
|
||||
</style>
|
||||
|
||||
<style name="DetailsAppTitleStyle" parent="TextAppearance.MaterialComponents.Headline6">
|
||||
<style name="DetailsAppTitleStyle" parent="TextAppearance.Material3.TitleLarge">
|
||||
<item name="android:textSize">18sp</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="DetailsLastUpdatedStyle" parent="TextAppearance.MaterialComponents.Caption" />
|
||||
<style name="DetailsLastUpdatedStyle" parent="TextAppearance.Material3.BodySmall" />
|
||||
|
||||
<style name="DetailsAntiFeaturesWarningStyle" parent="TextAppearance.MaterialComponents.Body1">
|
||||
<style name="DetailsAntiFeaturesWarningStyle" parent="TextAppearance.Material3.BodyLarge">
|
||||
<item name="android:textStyle">bold</item>
|
||||
</style>
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<resources>
|
||||
<!-- https://github.com/material-components/material-components-android/blob/22de817c30a493fb7dda46a8bea784d5bdc1dbdb/catalog/java/io/material/catalog/application/theme/res/values/themes.xml#L32-L38 -->
|
||||
<style name="ThemeOverlay.App.Preference" parent="PreferenceThemeOverlay">
|
||||
<item name="switchPreferenceCompatStyle">
|
||||
@style/Widget.App.Preference.SwitchPreferenceCompat
|
||||
</item>
|
||||
<item name="editTextPreferenceStyle">
|
||||
@style/Widget.App.Preference.DialogPreference.EditTextPreference
|
||||
</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.App.MaterialAlertDialog" parent="ThemeOverlay.Material3.MaterialAlertDialog">
|
||||
<item name="dialogCornerRadius">28dp</item>
|
||||
<item name="android:colorBackground">?attr/colorSurfaceContainerHigh</item>
|
||||
<item name="android:layout">@layout/m3_alert_dialog</item>
|
||||
</style>
|
||||
</resources>
|
|
@ -15,9 +15,12 @@
|
|||
~ See the License for the specific language governing permissions and
|
||||
~ limitations under the License.
|
||||
-->
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="Base.Theme.App" parent="Theme.MaterialComponents.DayNight.NoActionBar">
|
||||
<!-- Generated by the Material Theme Builder with modifications-->
|
||||
<!-- https://www.figma.com/community/plugin/1034969338659738588–>-->
|
||||
<resources>
|
||||
|
||||
<style name="Base.Theme.App" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<!--Material shape attributes-->
|
||||
<item name="shapeAppearanceSmallComponent">@style/ShapeAppearance.App.SmallComponent</item>
|
||||
<item name="shapeAppearanceMediumComponent">@style/ShapeAppearance.App.MediumComponent
|
||||
|
@ -29,15 +32,6 @@
|
|||
<item name="materialButtonStyle">@style/Widget.App.Button</item>
|
||||
<item name="materialCardViewStyle">@style/Widget.App.CardView</item>
|
||||
|
||||
<!-- backward-compatibility theme options go here -->
|
||||
<!--Material color attributes (light theme) -->
|
||||
<!--colorPrimary colors map to components and elements, such as app bars and buttons. -->
|
||||
<!--colorSecondary colors are most often used as accents on components, such as FABs and -->
|
||||
<!--selection controls.-->
|
||||
<item name="colorPrimary">@color/fdroid_blue</item>
|
||||
<item name="colorPrimaryVariant">@color/fdroid_blue_dark</item>
|
||||
<item name="colorPrimaryDark">?colorPrimaryVariant</item>
|
||||
<item name="colorSecondary">@color/fdroid_green</item>
|
||||
<!--colorBackground appears behind scrollable content and is used for the default window-->
|
||||
<!--background. colorSurface is mapped to the surface of components such as cards, sheets-->
|
||||
<!--and menus. colorError is used to indicate an error state for components such as-->
|
||||
|
@ -48,35 +42,77 @@
|
|||
@drawable/category_preview_app_card_background_light
|
||||
</item>
|
||||
<item name="mainTabSwapBackground">#fafafa</item>
|
||||
<item name="detailPanel">@drawable/details_panel_donate_background_light</item>
|
||||
<item name="detailPanel">?attr/colorSurfaceContainerHighest</item>
|
||||
<item name="antiFeaturesWarning">@drawable/ic_warning</item>
|
||||
<item name="backButtonDrawable">@drawable/abc_ic_ab_back_material</item>
|
||||
<item name="clearButtonDrawable">@drawable/ic_close</item>
|
||||
|
||||
<!--"On" colors define how text, icons and strokes are colored in relation to the surface-->
|
||||
<!--on which they appear.-->
|
||||
<item name="colorOnPrimary">#ffffff</item>
|
||||
<item name="colorOnSecondary">#ffffff</item>
|
||||
|
||||
<item name="android:textColorLink">@color/fdroid_green</item>
|
||||
<item name="mainTabSwapSplashTint">#f5f5f5</item>
|
||||
<item name="categoryName">#4a4a4a</item>
|
||||
<item name="installedApps">#424242</item>
|
||||
<item name="appListItem">#424242</item>
|
||||
<item name="lightGrayTextColor">#4a4a4a</item>
|
||||
<item name="preferenceTheme">@style/PreferenceThemeOverlay.v14.Material</item>
|
||||
<item name="preferenceTheme">@style/ThemeOverlay.App.Preference</item>
|
||||
<item name="appDetailsAntiFeatureIconColor">#000000</item>
|
||||
|
||||
<item name="iconBackgroundColor">#801976D2</item>
|
||||
|
||||
<item name="bottomNavigationStyle">
|
||||
@style/Widget.MaterialComponents.BottomNavigationView.PrimarySurface
|
||||
</item>
|
||||
|
||||
<item name="screenshotPlaceholderIconColor">#e8e8e8</item>
|
||||
|
||||
<!--Platform attributes-->
|
||||
<item name="android:windowLightStatusBar">false</item>
|
||||
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||
<item name="android:windowLightStatusBar">true</item>
|
||||
|
||||
<!-- Adjust androidx.preference dialogs to follow Material You -->
|
||||
<!-- https://github.com/material-components/material-components-android/issues/2732#issuecomment-1146086018 -->
|
||||
<item name="alertDialogTheme">@style/ThemeOverlay.App.MaterialAlertDialog</item>
|
||||
|
||||
<item name="colorPrimary">@color/md_theme_primary</item>
|
||||
<item name="colorOnPrimary">@color/md_theme_onPrimary</item>
|
||||
<item name="colorPrimaryContainer">@color/md_theme_primaryContainer</item>
|
||||
<item name="colorOnPrimaryContainer">@color/md_theme_onPrimaryContainer</item>
|
||||
<item name="colorSecondary">@color/md_theme_secondary</item>
|
||||
<item name="colorOnSecondary">@color/md_theme_onSecondary</item>
|
||||
<item name="colorSecondaryContainer">@color/md_theme_secondaryContainer</item>
|
||||
<item name="colorOnSecondaryContainer">@color/md_theme_onSecondaryContainer</item>
|
||||
<item name="colorTertiary">@color/md_theme_tertiary</item>
|
||||
<item name="colorOnTertiary">@color/md_theme_onTertiary</item>
|
||||
<item name="colorTertiaryContainer">@color/md_theme_tertiaryContainer</item>
|
||||
<item name="colorOnTertiaryContainer">@color/md_theme_onTertiaryContainer</item>
|
||||
<item name="colorError">@color/md_theme_error</item>
|
||||
<item name="colorOnError">@color/md_theme_onError</item>
|
||||
<item name="colorErrorContainer">@color/md_theme_errorContainer</item>
|
||||
<item name="colorOnErrorContainer">@color/md_theme_onErrorContainer</item>
|
||||
<item name="android:colorBackground">@color/md_theme_background</item>
|
||||
<item name="colorOnBackground">@color/md_theme_onBackground</item>
|
||||
<item name="colorSurface">@color/md_theme_surface</item>
|
||||
<item name="colorOnSurface">@color/md_theme_onSurface</item>
|
||||
<item name="colorSurfaceVariant">@color/md_theme_surfaceVariant</item>
|
||||
<item name="colorOnSurfaceVariant">@color/md_theme_onSurfaceVariant</item>
|
||||
<item name="colorOutline">@color/md_theme_outline</item>
|
||||
<item name="colorOutlineVariant">@color/md_theme_outlineVariant</item>
|
||||
<item name="colorSurfaceInverse">@color/md_theme_inverseSurface</item>
|
||||
<item name="colorOnSurfaceInverse">@color/md_theme_inverseOnSurface</item>
|
||||
<item name="colorPrimaryInverse">@color/md_theme_inversePrimary</item>
|
||||
<item name="colorPrimaryFixed">@color/md_theme_primaryFixed</item>
|
||||
<item name="colorOnPrimaryFixed">@color/md_theme_onPrimaryFixed</item>
|
||||
<item name="colorPrimaryFixedDim">@color/md_theme_primaryFixedDim</item>
|
||||
<item name="colorOnPrimaryFixedVariant">@color/md_theme_onPrimaryFixedVariant</item>
|
||||
<item name="colorSecondaryFixed">@color/md_theme_secondaryFixed</item>
|
||||
<item name="colorOnSecondaryFixed">@color/md_theme_onSecondaryFixed</item>
|
||||
<item name="colorSecondaryFixedDim">@color/md_theme_secondaryFixedDim</item>
|
||||
<item name="colorOnSecondaryFixedVariant">@color/md_theme_onSecondaryFixedVariant</item>
|
||||
<item name="colorTertiaryFixed">@color/md_theme_tertiaryFixed</item>
|
||||
<item name="colorOnTertiaryFixed">@color/md_theme_onTertiaryFixed</item>
|
||||
<item name="colorTertiaryFixedDim">@color/md_theme_tertiaryFixedDim</item>
|
||||
<item name="colorOnTertiaryFixedVariant">@color/md_theme_onTertiaryFixedVariant</item>
|
||||
<item name="colorSurfaceDim">@color/md_theme_surfaceDim</item>
|
||||
<item name="colorSurfaceBright">@color/md_theme_surfaceBright</item>
|
||||
<item name="colorSurfaceContainerLowest">@color/md_theme_surfaceContainerLowest</item>
|
||||
<item name="colorSurfaceContainerLow">@color/md_theme_surfaceContainerLow</item>
|
||||
<item name="colorSurfaceContainer">@color/md_theme_surfaceContainer</item>
|
||||
<item name="colorSurfaceContainerHigh">@color/md_theme_surfaceContainerHigh</item>
|
||||
<item name="colorSurfaceContainerHighest">@color/md_theme_surfaceContainerHighest</item>
|
||||
</style>
|
||||
|
||||
<!-- light app theme with accent colors following roughly android design guidelines -->
|
||||
|
@ -87,7 +123,7 @@
|
|||
<!-- Same as Theme.App except a black background in Dark mode -->
|
||||
<style name="Theme.App.Black" parent="Theme.App" />
|
||||
|
||||
<style name="AppThemeTransparent" parent="@android:style/Theme.Translucent.NoTitleBar">
|
||||
<style name="Theme.App.Transparent" parent="Base.Theme.App">
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
|
@ -95,8 +131,4 @@
|
|||
<item name="android:windowNoTitle">true</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="AppThemeDialog" parent="Theme.MaterialComponents.DayNight.Dialog.Alert">
|
||||
<item name="colorPrimary">@color/fdroid_green</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
|
|
@ -14,14 +14,4 @@
|
|||
~ limitations under the License.
|
||||
-->
|
||||
|
||||
<resources>
|
||||
|
||||
<style name="TextAppearance.App.CollapsingToolbar.Expanded" parent="TextAppearance.MaterialComponents.Headline5">
|
||||
<item name="android:textColor">?attr/colorOnPrimarySurface</item>
|
||||
</style>
|
||||
|
||||
<style name="TextAppearance.App.CollapsingToolbar.Collapsed" parent="TextAppearance.MaterialComponents.Headline6">
|
||||
<item name="android:textColor">?attr/colorOnPrimarySurface</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
<resources></resources>
|
||||
|
|
|
@ -706,6 +706,11 @@
|
|||
<sha256 value="394ba9369f3cbdee4345b429e38d01623dd56cd98b712b40edbe14359b83bce8" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="androidx.compose.material3" name="material3" version="1.1.2">
|
||||
<artifact name="material3-1.1.2.aar">
|
||||
<sha256 value="fd9f8fe91d6661afcaf0e9c9cef30b5a196b4def5b28a370f13f2c259c26e482" origin="Generated by Gradle"/>
|
||||
</artifact>
|
||||
</component>
|
||||
<component group="androidx.compose.runtime" name="runtime" version="1.4.3">
|
||||
<artifact name="runtime-1.4.3.aar">
|
||||
<sha256 value="f975185e13d3e5b0c142e220e924bfe643d4421b0fdae3f2036f1e0160a390f4" origin="Generated by Gradle"/>
|
||||
|
|
Loading…
Reference in New Issue