Skip to content

Commit

Permalink
Added Lollipop emoji, fixed a crash
Browse files Browse the repository at this point in the history
  • Loading branch information
DSteve595 committed Oct 28, 2014
1 parent 357838a commit b843c9c
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .idea/libraries/support_annotations_20_0_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/libraries/support_v4_20_0_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Emoji Switcher/Emoji Switcher.iml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,16 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content>
<orderEntry type="jdk" jdkName="Android API 19 Platform" jdkType="Android SDK" />
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="support-v4-20.0.0" level="project" />
<orderEntry type="library" exported="" name="commons-io-2.4" level="project" />
<orderEntry type="library" exported="" name="guava-18.0" level="project" />
<orderEntry type="library" exported="" name="play-services-6.1.11" level="project" />
<orderEntry type="library" exported="" name="RootTools-3.5" level="project" />
<orderEntry type="library" exported="" name="support-annotations-20.0.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-20.0.0" level="project" />
<orderEntry type="library" exported="" name="commons-io-2.4" level="project" />
<orderEntry type="library" exported="" name="guava-18.0" level="project" />
</component>
</module>

10 changes: 5 additions & 5 deletions Emoji Switcher/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
compileSdkVersion 21
buildToolsVersion '21.0.2'

defaultConfig {
minSdkVersion 19
targetSdkVersion 19
versionCode 6
versionName "1.4"
targetSdkVersion 21
versionCode 7
versionName "1.5"
}

compileOptions {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public String toString() {

private static Map<String, String> filenamesToFriendlyNames = new HashMap<>();
static {
filenamesToFriendlyNames.put("GoogleLollipop", "Google (Lollipop)");
filenamesToFriendlyNames.put("GoogleKitkat", "Google (KitKat)");
filenamesToFriendlyNames.put("HTCM8", "HTC M8");
filenamesToFriendlyNames.put("LGG3", "LG G3");
filenamesToFriendlyNames.put("SamsungS4", "Samsung S4");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ protected void onCreate(Bundle savedInstanceState) {

verifyRoot();

if (EmojiSwitcherUtils.isRootReady()) {
init();
}
}

private void init() {
textCurrentEmojiSet = (TextView) findViewById(R.id.text_currentemojisetdetected_is);

buttonRefreshEmojiState = (ImageButton) findViewById(R.id.button_refreshemojistate);
Expand All @@ -75,44 +81,44 @@ public void onClick(View v) {
emojiSetsAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerInstallEmojis.setAdapter(emojiSetsAdapter);

final Button buttonReboot = (Button) findViewById(R.id.button_reboot);
buttonReboot.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RootTools.restartAndroid();
}
});
final Button buttonReboot = (Button) findViewById(R.id.button_reboot);
buttonReboot.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
RootTools.restartAndroid();
}
});

Button buttonInstallEmojiSet = (Button) findViewById(R.id.button_installemojiset);
buttonInstallEmojiSet.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
emojiSwitcherUtils.installEmojiSet(SwitcherActivity.this, (EmojiSet) spinnerInstallEmojis.getSelectedItem());
fetchCurrentSystemEmojiSet();
AlertDialog.Builder builder = new AlertDialog.Builder(SwitcherActivity.this);
builder.setTitle("Reboot now?");
builder.setMessage("Most apps require a reboot for new emojis to be recognized.");
builder.setPositiveButton("Reboot", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
RootTools.restartAndroid();
}
});
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
AlertDialog.Builder builder = new AlertDialog.Builder(SwitcherActivity.this);
builder.setTitle("Reboot now?");
builder.setMessage("Most apps require a reboot for new emojis to be recognized.");
builder.setPositiveButton("Reboot", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
RootTools.restartAndroid();
}
});
builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
builder.show();
}
});

copyEmojiSetsToData();

fetchCurrentSystemEmojiSet();

setupBilling();
setupBilling();
}

private void fetchCurrentSystemEmojiSet() {
Expand Down
12 changes: 6 additions & 6 deletions Emoji Switcher/src/main/res/drawable/button_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,32 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:state_focused="false">
<shape android:shape="oval">
<solid android:color="@color/button_disabled"/>
<solid android:color="@color/button_disabled" />
</shape>
</item>
<item android:state_pressed="true">
<shape android:shape="oval">
<solid android:color="@color/button_pressed"/>
<solid android:color="@color/button_pressed" />
</shape>
</item>
<item android:state_enabled="true" android:state_focused="true">
<shape android:shape="oval">
<solid android:color="@color/button_focused"/>
<solid android:color="@color/button_focused" />
</shape>
</item>
<item android:state_enabled="true">
<shape android:shape="oval">
<solid android:color="@color/button_normal"/>
<solid android:color="@color/button_normal" />
</shape>
</item>
<item android:state_focused="true">
<shape android:shape="oval">
<solid android:color="@color/button_disabled_focused"/>
<solid android:color="@color/button_disabled_focused" />
</shape>
</item>
<item>
<shape android:shape="oval">
<solid android:color="@color/button_normal"/>
<solid android:color="@color/button_normal" />
</shape>
</item>

Expand Down
27 changes: 13 additions & 14 deletions Emoji Switcher/src/main/res/layout/activity_emojiswitcher.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand All @@ -10,7 +9,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"/>
android:layout_centerHorizontal="true" />

<RelativeLayout
android:layout_width="match_parent"
Expand All @@ -26,13 +25,13 @@
android:layout_centerHorizontal="true"
android:layout_marginBottom="160dp"
android:scaleType="centerCrop"
android:src="@drawable/emoji_bg"/>
android:src="@drawable/emoji_bg" />

<Space
android:id="@+id/space_actionbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:layout_marginBottom="@dimen/activity_vertical_margin"/>
android:layout_marginBottom="@dimen/activity_vertical_margin" />

<LinearLayout
android:layout_width="match_parent"
Expand All @@ -59,7 +58,7 @@
android:layout_gravity="center_vertical"
android:scaleType="fitCenter"
android:src="@drawable/ic_refresh"
android:text="@string/refresh"/>
android:text="@string/refresh" />

<LinearLayout
android:layout_width="wrap_content"
Expand All @@ -73,14 +72,14 @@
android:layout_height="wrap_content"
android:text="@string/current_emojis_detected"
android:textColor="#808080"
android:textSize="18sp"/>
android:textSize="18sp" />

<de.ankri.views.AutoScaleTextView
android:id="@+id/text_currentemojisetdetected_is"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textSize="24sp"/>
android:textSize="24sp" />
</LinearLayout>
</LinearLayout>

Expand All @@ -99,7 +98,7 @@
android:layout_height="wrap_content"
android:layout_marginEnd="6dp"
android:text="@string/set_emojis_to_"
android:textColor="#808080"/>
android:textColor="#808080" />

<LinearLayout
android:layout_width="wrap_content"
Expand All @@ -113,7 +112,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:spinnerMode="dropdown"/>
android:spinnerMode="dropdown" />

<Button
android:id="@+id/button_installemojiset"
Expand All @@ -123,7 +122,7 @@
android:layout_marginRight="4dp"
android:layout_weight="0"
android:clickable="true"
android:text="@string/set"/>
android:text="@string/set" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
Expand All @@ -143,7 +142,7 @@
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/reboot"
android:visibility="gone"/>
android:visibility="gone" />
</LinearLayout>

<de.ankri.views.AutoScaleTextView
Expand All @@ -158,7 +157,7 @@
android:maxLines="1"
android:text="@string/about"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textSize="16sp"/>
android:textSize="16sp" />
</RelativeLayout>

<ImageButton
Expand All @@ -174,5 +173,5 @@
android:paddingTop="16dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_remove"
android:visibility="gone"/>
android:visibility="gone" />
</RelativeLayout>
16 changes: 16 additions & 0 deletions Emoji Switcher/src/main/res/values-v21/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="EmojiSwitcher" parent="android:Theme.Material.Light">
<item name="android:colorPrimary">@color/emojiswitcher_orange</item>
<item name="android:colorPrimaryDark">@color/emojiswitcher_orange_dark</item>
<item name="android:colorAccent">@color/emojiswitcher_orange</item>
<item name="autoScaleTextViewStyle">@style/EmojiSwitcher.AutoScaleTextView</item>
<item name="android:windowActionBarOverlay">true</item>
<item name="android:actionBarStyle">@style/EmojiSwitcher.ActionBar</item>
</style>

<style name="EmojiSwitcher.ActionBar" parent="android:Widget.Material.Light.ActionBar">
<item name="android:background">@color/emojiswitcher_orange_transparent</item>
</style>
</resources>
1 change: 1 addition & 0 deletions Emoji Switcher/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<color name="emojiswitcher_orange_transparent">#E0FFA42C</color>
<color name="emojiswitcher_orange_faded1">#ffd685</color>
<color name="emojiswitcher_orange_faded2">#ffe8ba</color>
<color name="emojiswitcher_orange_dark">#FA8E00</color>

<color name="current_emojis_good">#20D020</color>
<color name="current_emojis_bad">#D02020</color>
Expand Down

0 comments on commit b843c9c

Please sign in to comment.