Skip to content

Commit

Permalink
Move minSdkVersion down to 14
Browse files Browse the repository at this point in the history
  • Loading branch information
ShamylZakariya committed Jul 15, 2016
1 parent 64ff9a5 commit f9d265a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {

defaultConfig {
applicationId "org.zakariya.flyoutmenudemo"
minSdkVersion 16
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
Expand Down
18 changes: 17 additions & 1 deletion app/src/main/java/org/zakariya/flyoutmenudemo/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.zakariya.flyoutmenudemo;

import android.annotation.SuppressLint;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.ColorInt;
import android.support.v4.content.ContextCompat;
Expand Down Expand Up @@ -244,12 +245,27 @@ void configureSmileyFlyoutMenu() {
0x1F4A9, // pile of poo
};

int[] charCodes = {
0x0041,
0x0042,
0x0043,
0x0044,
0x0045,
0x0046,
0x0047,
0x0048,
};

final boolean canUseEmoji = Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN;

@ColorInt int color = ContextCompat.getColor(this, R.color.smileyMenuCharColor);
float fontSizeInMenu = getResources().getDimension(R.dimen.smiley_menu_item_size) * 0.5f;
float fontSizeInButton = getResources().getDimension(R.dimen.flyout_menu_button_size) * 0.5f;

List<EmojiFlyoutMenu.MenuItem> menuItems = new ArrayList<>();
for (int code : emojiCodes) {

for (int i = 0; i < emojiCodes.length; i++) {
int code = canUseEmoji ? emojiCodes[i] : charCodes[i];
menuItems.add(new EmojiFlyoutMenu.MenuItem(menuItems.size(), code, fontSizeInMenu, color));
}

Expand Down
2 changes: 1 addition & 1 deletion flyoutmenu/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {
buildToolsVersion "23.0.2"

defaultConfig {
minSdkVersion 16
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName version
Expand Down

0 comments on commit f9d265a

Please sign in to comment.