Remove backgroud color picker from create card menu.
This commit is contained in:
parent
aad92328cd
commit
847bbe2d5f
@ -60,7 +60,6 @@ public class DeckPreviewActivity extends AppCompatActivity {
|
|||||||
.inflate(R.layout.create_new_card_view, null));
|
.inflate(R.layout.create_new_card_view, null));
|
||||||
|
|
||||||
final EditText cardNameEditText = (EditText) openCardOptions.findViewById(R.id.card_name_edit_text);
|
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")
|
builder.setTitle("Create a new card")
|
||||||
.setView(openCardOptions)
|
.setView(openCardOptions)
|
||||||
@ -74,15 +73,15 @@ public class DeckPreviewActivity extends AppCompatActivity {
|
|||||||
public void onClick(DialogInterface dialog, int which) {
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
CardFile cardfile = new CardFile(CardFile.getDefaultCardStorage(DeckPreviewActivity.this));
|
CardFile cardfile = new CardFile(CardFile.getDefaultCardStorage(DeckPreviewActivity.this));
|
||||||
cardfile.setName(cardNameEditText.getText().toString());
|
cardfile.setName(cardNameEditText.getText().toString());
|
||||||
cardfile.setBackgroundColor(backgroundColorPicker.getColor());
|
cardfile.setBackgroundColor(CardFile.DEFAULT_BACKGROUND_COLOR);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cardfile.save(DeckPreviewActivity.this);
|
cardfile.save(DeckPreviewActivity.this);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e("Minicards DeckPreview", "Error creating card "+ e, e);
|
Log.e("Minicards DeckPreview", "Error creating card "+ e, e);
|
||||||
Toast
|
Toast.makeText(DeckPreviewActivity.this,
|
||||||
.makeText(DeckPreviewActivity.this, "Error creating card " + e, Toast.LENGTH_LONG)
|
"Error creating card " + e,
|
||||||
.show();
|
Toast.LENGTH_LONG).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
android:layout_centerHorizontal="true">
|
android:layout_centerHorizontal="true">
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
@ -27,15 +29,4 @@
|
|||||||
android:layout_toRightOf="@id/card_name_text_view"
|
android:layout_toRightOf="@id/card_name_text_view"
|
||||||
android:text="My new card" />
|
android:text="My new card" />
|
||||||
</RelativeLayout>
|
</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>
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user