Browse Source

feat: move color picker account outside of advanced

main
Distopico Vegan 6 years ago
parent
commit
7fb625c71f
3 changed files with 29 additions and 41 deletions
  1. +2
    -4
      app/src/main/java/org/dystopia/email/FragmentAccount.java
  2. +25
    -37
      app/src/main/res/layout/fragment_account.xml
  3. +2
    -0
      app/src/main/res/values/dimens.xml

+ 2
- 4
app/src/main/java/org/dystopia/email/FragmentAccount.java View File

@ -107,7 +107,6 @@ public class FragmentAccount extends FragmentEx {
private TextView tvName; private TextView tvName;
private EditText etName; private EditText etName;
private Button btnColor;
private View vwColor; private View vwColor;
private ImageView ibColorDefault; private ImageView ibColorDefault;
private EditText etSignature; private EditText etSignature;
@ -183,7 +182,6 @@ public class FragmentAccount extends FragmentEx {
etName = view.findViewById(R.id.etName); etName = view.findViewById(R.id.etName);
tvName = view.findViewById(R.id.tvName); tvName = view.findViewById(R.id.tvName);
btnColor = view.findViewById(R.id.btnColor);
vwColor = view.findViewById(R.id.vwColor); vwColor = view.findViewById(R.id.vwColor);
ibColorDefault = view.findViewById(R.id.ibColorDefault); ibColorDefault = view.findViewById(R.id.ibColorDefault);
etSignature = view.findViewById(R.id.etSignature); etSignature = view.findViewById(R.id.etSignature);
@ -372,7 +370,7 @@ public class FragmentAccount extends FragmentEx {
}); });
vwColor.setBackgroundColor(color); vwColor.setBackgroundColor(color);
btnColor.setOnClickListener(
vwColor.setOnClickListener(
new View.OnClickListener() { new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@ -1164,7 +1162,7 @@ public class FragmentAccount extends FragmentEx {
GradientDrawable border = new GradientDrawable(); GradientDrawable border = new GradientDrawable();
border.setColor(color); border.setColor(color);
border.setStroke(1, Helper.resolveColor(getContext(), R.attr.colorSeparator));
border.setStroke(5, Helper.resolveColor(getContext(), R.attr.colorSeparator));
vwColor.setBackground(border); vwColor.setBackground(border);
} }


+ 25
- 37
app/src/main/res/layout/fragment_account.xml View File

@ -220,6 +220,27 @@
android:inputType="textPassword" /> android:inputType="textPassword" />
</com.google.android.material.textfield.TextInputLayout> </com.google.android.material.textfield.TextInputLayout>
<View
android:id="@+id/vwColor"
android:layout_width="@dimen/color_pick"
android:layout_height="@dimen/color_pick"
android:layout_marginTop="@dimen/base_margin"
android:layout_marginStart="@dimen/content_margin"
android:background="@color/colorAccent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
<ImageView
android:id="@+id/ibColorDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:src="@drawable/baseline_delete_24"
app:layout_constraintBottom_toBottomOf="@id/vwColor"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
<Button <Button
android:id="@+id/btnAdvanced" android:id="@+id/btnAdvanced"
style="@style/buttonStyleSmall" style="@style/buttonStyleSmall"
@ -230,9 +251,9 @@
android:minHeight="0dp" android:minHeight="0dp"
android:text="@string/title_setup_advanced" android:text="@string/title_setup_advanced"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tilPassword" />
app:layout_constraintTop_toBottomOf="@id/vwColor" />
<!-- name -->
<!-- advanced -->
<TextView <TextView
android:id="@+id/tvName" android:id="@+id/tvName"
@ -254,39 +275,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvName" /> app:layout_constraintTop_toBottomOf="@id/tvName" />
<Button
android:id="@+id/btnColor"
style="@style/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:minWidth="0dp"
android:minHeight="0dp"
android:text="@string/title_account_color"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etName" />
<View
android:id="@+id/vwColor"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="12dp"
android:background="@color/colorAccent"
app:layout_constraintBottom_toBottomOf="@id/btnColor"
app:layout_constraintStart_toEndOf="@id/btnColor"
app:layout_constraintTop_toTopOf="@id/btnColor" />
<ImageView
android:id="@+id/ibColorDefault"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:src="@drawable/baseline_delete_24"
app:layout_constraintBottom_toBottomOf="@id/btnColor"
app:layout_constraintStart_toEndOf="@id/vwColor"
app:layout_constraintTop_toBottomOf="@id/etName" />
<TextView <TextView
android:id="@+id/tvSignature" android:id="@+id/tvSignature"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -295,7 +283,7 @@
android:text="@string/title_account_signature" android:text="@string/title_account_signature"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btnColor" />
app:layout_constraintTop_toBottomOf="@id/etName" />
<EditText <EditText
android:id="@+id/etSignature" android:id="@+id/etSignature"
@ -541,7 +529,7 @@
android:id="@+id/grpAdvanced" android:id="@+id/grpAdvanced"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:constraint_referenced_ids="tvName,etName,btnColor,vwColor,ibColorDefault,tvSignature,etSignature,cbSynchronize,cbPrimary,tvInterval,etInterval" />
app:constraint_referenced_ids="tvName,etName,tvSignature,etSignature,cbSynchronize,cbPrimary,tvInterval,etInterval" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpFolders" android:id="@+id/grpFolders"


+ 2
- 0
app/src/main/res/values/dimens.xml View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<dimen name="base_margin">12dp</dimen>
<dimen name="layout_margin">12dp</dimen> <dimen name="layout_margin">12dp</dimen>
<dimen name="widget_padding">6dp</dimen> <dimen name="widget_padding">6dp</dimen>
<dimen name="content_margin">6dp</dimen> <dimen name="content_margin">6dp</dimen>
<dimen name="compose_padding">6dp</dimen> <dimen name="compose_padding">6dp</dimen>
<dimen name="input_height">40dp</dimen> <dimen name="input_height">40dp</dimen>
<dimen name="color_pick">24dp</dimen>
</resources> </resources>

Loading…
Cancel
Save