Skip to content

Commit

Permalink
Merge pull request #38 from tvbarthel/tb/fab-size
Browse files Browse the repository at this point in the history
[Fab] increase size on kids/tablette version.
  • Loading branch information
tbarthel-fr authored May 8, 2017
2 parents d676cd2 + d35f63a commit 9a086ab
Show file tree
Hide file tree
Showing 24 changed files with 99 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CameraColorPicker/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ android {
applicationId "fr.tvbarthel.apps.cameracolorpicker"
minSdkVersion 14
targetSdkVersion 25

vectorDrawables.useSupportLibrary = true
}

buildTypes {
Expand Down
4 changes: 2 additions & 2 deletions CameraColorPicker/app/src/adult/res/values/drawables.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="ic_fab_color_picker_action">@drawable/ic_image_colorize</drawable>
<drawable name="ic_fab_palette_creation_action">@drawable/ic_image_palette</drawable>
<drawable name="ic_fab_color_picker_action">@drawable/ic_colorize_white_24dp</drawable>
<drawable name="ic_fab_palette_creation_action">@drawable/ic_palette_white_24dp</drawable>
</resources>
9 changes: 9 additions & 0 deletions CameraColorPicker/app/src/adult/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="CPPTheme.Fab" parent="CCPTheme.Light">
<item name="android:scaleType">center</item>
<item name="android:layout_margin">16dp</item>
</style>

</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:alpha="0.85"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M20.71,5.63l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-3.12,3.12 -1.93,-1.91 -1.41,1.41 1.42,1.42L3,16.25V21h4.75l8.92,-8.92 1.42,1.42 1.41,-1.41 -1.92,-1.92 3.12,-3.12c0.4,-0.4 0.4,-1.03 0.01,-1.42zM6.92,19L5,17.08l8.06,-8.06 1.92,1.92L6.92,19z" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="48dp"
android:height="48dp"
android:alpha="0.85"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z" />
</vector>
4 changes: 3 additions & 1 deletion CameraColorPicker/app/src/kids/res/values-sw600dp/dimens.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">

<!-- Row color item -->
<dimen name="row_color_item_preview_size">60dp</dimen>

<dimen name="row_color_item_size">110dp</dimen>
<dimen name="row_palette_item_size">110dp</dimen>

<dimen name="fab_size_normal" tools:override="true">120dp</dimen>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="ic_fab_color_picker_action">@drawable/ic_colorize_white_48dp</drawable>
<drawable name="ic_fab_palette_creation_action">@drawable/ic_palette_white_48dp</drawable>
</resources>
9 changes: 9 additions & 0 deletions CameraColorPicker/app/src/kids/res/values-sw600dp/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="CPPTheme.Fab" parent="CCPTheme.Light">
<item name="android:scaleType">center</item>
<item name="android:layout_margin">40dp</item>
</style>

</resources>
1 change: 1 addition & 0 deletions CameraColorPicker/app/src/kids/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@

<dimen name="row_color_item_size">88dp</dimen>
<dimen name="row_palette_item_size">88dp</dimen>

</resources>
4 changes: 2 additions & 2 deletions CameraColorPicker/app/src/kids/res/values/drawables.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<drawable name="ic_fab_color_picker_action">@drawable/ic_image_colorize</drawable>
<drawable name="ic_fab_palette_creation_action">@drawable/ic_image_palette</drawable>
<drawable name="ic_fab_color_picker_action">@drawable/ic_colorize_white_24dp</drawable>
<drawable name="ic_fab_palette_creation_action">@drawable/ic_palette_white_24dp</drawable>
</resources>
9 changes: 9 additions & 0 deletions CameraColorPicker/app/src/kids/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="CPPTheme.Fab" parent="CCPTheme.Light">
<item name="android:scaleType">center</item>
<item name="android:layout_margin">16dp</item>
</style>

</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.support.annotation.StringRes;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.app.AppCompatDelegate;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils;
import android.view.Menu;
Expand Down Expand Up @@ -40,6 +41,13 @@
public class MainActivity extends AppCompatActivity implements View.OnClickListener,
ViewPager.OnPageChangeListener, ColorItemListPage.Listener, PaletteListPage.Listener {

/**
* https://medium.com/@chrisbanes/appcompat-v23-2-age-of-the-vectors-91cbafa87c88
*/
static {
AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}

@IntDef({PAGE_ID_COLOR_ITEM_LIST, PAGE_ID_PALETTE_LIST})
@Retention(RetentionPolicy.SOURCE)
public @interface PageId {
Expand Down Expand Up @@ -121,6 +129,7 @@ protected void onCreate(Bundle savedInstanceState) {
mPaletteListPage.setListener(this);

mFab = (FloatingActionButton) findViewById(R.id.activity_main_fab);
mFab.setImageResource(R.drawable.ic_fab_color_picker_action);
mFab.setOnClickListener(this);

final MyPagerAdapter adapter = new MyPagerAdapter();
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<vector android:alpha="0.85" android:height="48dp"
android:viewportHeight="24.0" android:viewportWidth="24.0"
android:width="48dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#FF000000" android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:alpha="0.85"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M20.71,5.63l-2.34,-2.34c-0.39,-0.39 -1.02,-0.39 -1.41,0l-3.12,3.12 -1.93,-1.91 -1.41,1.41 1.42,1.42L3,16.25V21h4.75l8.92,-8.92 1.42,1.42 1.41,-1.41 -1.92,-1.92 3.12,-3.12c0.4,-0.4 0.4,-1.03 0.01,-1.42zM6.92,19L5,17.08l8.06,-8.06 1.92,1.92L6.92,19z" />
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:alpha="0.85"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FFFFFFFF"
android:pathData="M12,3c-4.97,0 -9,4.03 -9,9s4.03,9 9,9c0.83,0 1.5,-0.67 1.5,-1.5 0,-0.39 -0.15,-0.74 -0.39,-1.01 -0.23,-0.26 -0.38,-0.61 -0.38,-0.99 0,-0.83 0.67,-1.5 1.5,-1.5L16,16c2.76,0 5,-2.24 5,-5 0,-4.42 -4.03,-8 -9,-8zM6.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S5.67,9 6.5,9 8,9.67 8,10.5 7.33,12 6.5,12zM9.5,8C8.67,8 8,7.33 8,6.5S8.67,5 9.5,5s1.5,0.67 1.5,1.5S10.33,8 9.5,8zM14.5,8c-0.83,0 -1.5,-0.67 -1.5,-1.5S13.67,5 14.5,5s1.5,0.67 1.5,1.5S15.33,8 14.5,8zM17.5,12c-0.83,0 -1.5,-0.67 -1.5,-1.5S16.67,9 17.5,9s1.5,0.67 1.5,1.5 -0.67,1.5 -1.5,1.5z" />
</vector>
6 changes: 3 additions & 3 deletions CameraColorPicker/app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@
android:id="@+id/activity_main_view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/activity_main_background_color"/>
android:background="@color/activity_main_background_color" />

<com.melnykov.fab.FloatingActionButton
android:id="@+id/activity_main_fab"
style="@style/CPPTheme.Fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:src="@drawable/ic_fab_color_picker_action"
app:srcCompat="@drawable/ic_fab_color_picker_action"
app:fab_colorNormal="@color/color_accent"
app:fab_colorPressed="@color/color_accent"
app:fab_colorRipple="?attr/colorControlHighlight" />
Expand Down

0 comments on commit 9a086ab

Please sign in to comment.