-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from tvbarthel/vb/palette-creation
[Palette creation] Adapt the palette creation to the kid flavor.
- Loading branch information
Showing
14 changed files
with
335 additions
and
169 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...rc/adult/java/fr/tvbarthel/apps/cameracolorpicker/activities/PaletteCreationActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package fr.tvbarthel.apps.cameracolorpicker.activities; | ||
|
||
import fr.tvbarthel.apps.cameracolorpicker.R; | ||
import fr.tvbarthel.apps.cameracolorpicker.data.Palette; | ||
import fr.tvbarthel.apps.cameracolorpicker.data.Palettes; | ||
import fr.tvbarthel.apps.cameracolorpicker.fragments.EditTextDialogFragment; | ||
import fr.tvbarthel.apps.cameracolorpicker.views.PaletteMakerView; | ||
|
||
/** | ||
* The flavor implementation of {@link PaletteCreationBaseActivity}. | ||
* <p/> | ||
* In the adult version, a name is asked to the user. | ||
*/ | ||
public class PaletteCreationActivity extends PaletteCreationBaseActivity implements EditTextDialogFragment.Callback { | ||
|
||
|
||
@Override | ||
protected void createPalette(PaletteMakerView paletteMakerView) { | ||
final EditTextDialogFragment editTextDialogFragment = EditTextDialogFragment.newInstance(0, | ||
R.string.activity_palette_creation_edit_text_dialog_fragment_title, | ||
R.string.activity_palette_creation_edit_text_dialog_fragment_positive_button, | ||
android.R.string.cancel, | ||
getString(R.string.activity_palette_creation_edit_text_dialog_fragment_hint), | ||
null); | ||
editTextDialogFragment.show(getSupportFragmentManager(), null); | ||
} | ||
|
||
@Override | ||
public void onEditTextDialogFragmentPositiveButtonClick(int requestCode, String text) { | ||
final Palette newPalette = mPaletteMakerView.make(text); | ||
if (Palettes.saveColorPalette(this, newPalette)) { | ||
finish(); | ||
} | ||
} | ||
|
||
|
||
@Override | ||
public void onEditTextDialogFragmentNegativeButtonClick(int requestCode) { | ||
// Do nothing when the user cancels. | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...src/kids/java/fr/tvbarthel/apps/cameracolorpicker/activities/PaletteCreationActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package fr.tvbarthel.apps.cameracolorpicker.activities; | ||
|
||
import fr.tvbarthel.apps.cameracolorpicker.R; | ||
import fr.tvbarthel.apps.cameracolorpicker.data.Palette; | ||
import fr.tvbarthel.apps.cameracolorpicker.data.Palettes; | ||
import fr.tvbarthel.apps.cameracolorpicker.views.PaletteMakerView; | ||
|
||
/** | ||
* The flavor implementation of {@link PaletteCreationBaseActivity}. | ||
* | ||
* In the kids version, a default name is used. | ||
*/ | ||
public class PaletteCreationActivity extends PaletteCreationBaseActivity { | ||
|
||
@Override | ||
protected void createPalette(PaletteMakerView paletteMakerView) { | ||
final Palette newPalette = paletteMakerView.make(getString(R.string.activity_palette_creation_default_palette_name, System.currentTimeMillis())); | ||
if (Palettes.saveColorPalette(this, newPalette)) { | ||
finish(); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
CameraColorPicker/app/src/kids/res/layout/activity_palette_creation.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<merge xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
|
||
<ImageView | ||
android:id="@+id/activity_palette_creation_instruction" | ||
android:layout_width="match_parent" | ||
android:layout_height="150dp" | ||
android:alpha="0.3" | ||
android:padding="@dimen/default_padding" | ||
android:scaleType="centerInside" | ||
android:src="@drawable/drop_sad" /> | ||
|
||
<fr.tvbarthel.apps.cameracolorpicker.views.PaletteMakerView | ||
android:id="@+id/activity_palette_creation_color_palette_builder" | ||
android:layout_width="match_parent" | ||
android:layout_height="150dp" /> | ||
|
||
<FrameLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="150dp" | ||
android:background="@android:color/transparent"> | ||
|
||
<ImageButton | ||
android:id="@+id/activity_palette_creation_remove_button" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="end|top" | ||
android:background="?attr/selectableItemBackgroundBorderless" | ||
android:padding="8dp" | ||
android:src="@drawable/ic_action_delete" /> | ||
|
||
</FrameLayout> | ||
|
||
<View | ||
android:layout_width="match_parent" | ||
android:layout_height="8dp" | ||
android:layout_marginTop="150dp" | ||
android:background="@drawable/linear_gradient_bottom" /> | ||
|
||
<android.support.v7.widget.RecyclerView | ||
android:id="@+id/activity_palette_creation_list_view" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_marginTop="150dp" | ||
tools:listitem="@layout/row_color_item" /> | ||
|
||
<com.melnykov.fab.FloatingActionButton | ||
android:id="@+id/activity_palette_creation_fab" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_gravity="bottom|end" | ||
android:layout_margin="16dp" | ||
android:src="@drawable/ic_check_white" | ||
app:fab_colorNormal="@color/color_accent" | ||
app:fab_colorPressed="@color/color_accent" | ||
app:fab_colorRipple="?attr/colorControlHighlight" /> | ||
|
||
</merge> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 0 additions & 144 deletions
144
...src/main/java/fr/tvbarthel/apps/cameracolorpicker/activities/PaletteCreationActivity.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.