Remove backgroud color picker from create card menu.

This commit is contained in:
kenkeiras 2018-01-23 21:49:42 +01:00
parent aad92328cd
commit 847bbe2d5f
2 changed files with 6 additions and 16 deletions

View File

@ -60,7 +60,6 @@ public class DeckPreviewActivity extends AppCompatActivity {
.inflate(R.layout.create_new_card_view, null));
final EditText cardNameEditText = (EditText) openCardOptions.findViewById(R.id.card_name_edit_text);
final ColorPicker backgroundColorPicker = (ColorPicker) openCardOptions.findViewById(R.id.card_background_color_picker);
builder.setTitle("Create a new card")
.setView(openCardOptions)
@ -74,15 +73,15 @@ public class DeckPreviewActivity extends AppCompatActivity {
public void onClick(DialogInterface dialog, int which) {
CardFile cardfile = new CardFile(CardFile.getDefaultCardStorage(DeckPreviewActivity.this));
cardfile.setName(cardNameEditText.getText().toString());
cardfile.setBackgroundColor(backgroundColorPicker.getColor());
cardfile.setBackgroundColor(CardFile.DEFAULT_BACKGROUND_COLOR);
try {
cardfile.save(DeckPreviewActivity.this);
} catch (IOException e) {
Log.e("Minicards DeckPreview", "Error creating card "+ e, e);
Toast
.makeText(DeckPreviewActivity.this, "Error creating card " + e, Toast.LENGTH_LONG)
.show();
Toast.makeText(DeckPreviewActivity.this,
"Error creating card " + e,
Toast.LENGTH_LONG).show();
return;
}

View File

@ -7,6 +7,8 @@
android:layout_centerHorizontal="true">
<RelativeLayout
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
@ -27,15 +29,4 @@
android:layout_toRightOf="@id/card_name_text_view"
android:text="My new card" />
</RelativeLayout>
<RelativeLayout
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<com.larswerkman.holocolorpicker.ColorPicker
android:id="@+id/card_background_color_picker"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
</LinearLayout>