Don't show editor button on Built-In styles, advise user to copy instead
This commit is contained in:
+3
@@ -120,6 +120,7 @@ public class StyleDetailsBottomSheet extends BottomSheetDialogFragment {
|
||||
TextView fileNameView = view.findViewById(R.id.fileName);
|
||||
TextView styleTypeView = view.findViewById(R.id.styleType);
|
||||
|
||||
TextView builtInStyleAlert = view.findViewById(R.id.builtInStyleAlert);
|
||||
ConstraintLayout editButtonLayout = view.findViewById(R.id.editButton);
|
||||
ConstraintLayout copyButtonLayout = view.findViewById(R.id.copyButton);
|
||||
ConstraintLayout exportButtonLayout = view.findViewById(R.id.exportButton);
|
||||
@@ -136,6 +137,8 @@ public class StyleDetailsBottomSheet extends BottomSheetDialogFragment {
|
||||
|
||||
if (Objects.equals(pathSplit[0], "bundled") && pathSplit.length > 1) {
|
||||
styleTypeView.setText("Built-In Style");
|
||||
editButtonLayout.setVisibility(View.GONE);
|
||||
builtInStyleAlert.setVisibility(View.VISIBLE);
|
||||
deleteButtonLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
styleTypeView.setText("User Style");
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<solid android:color="#2A2100" />
|
||||
<corners android:radius="10dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="#4D3D00" />
|
||||
</shape>
|
||||
@@ -46,14 +46,34 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/fileName" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/builtInStyleAlert"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:paddingHorizontal="14dp"
|
||||
android:paddingVertical="12dp"
|
||||
android:background="@drawable/bg_alert_warning"
|
||||
android:text="Built-in styles can't be edited directly\nMake a copy to customize it"
|
||||
android:textColor="#FFD54F"
|
||||
android:textSize="14sp"
|
||||
android:lineSpacingExtra="2dp"
|
||||
android:gravity="center"
|
||||
android:drawablePadding="8dp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintTop_toBottomOf="@id/styleType"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:id="@+id/editButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="38dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:background="#1B1A1A"
|
||||
app:layout_constraintTop_toBottomOf="@id/styleType"
|
||||
app:layout_constraintTop_toBottomOf="@id/builtInStyleAlert"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user