Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency updates #188

Merged
merged 4 commits into from
Aug 8, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Screengrabfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
app_package_name 'com.vanniktech.emoji.sample'
use_tests_in_packages ['com.vanniktech.emoji.sample.screenshots']

app_apk_path 'app/build/outputs/apk/app-0.5.0-SNAPSHOT-debug.apk'
tests_apk_path 'app/build/outputs/apk/app-0.5.0-SNAPSHOT-debug-androidTest.apk'
app_apk_path 'app/build/outputs/apk/app-0.6.0-SNAPSHOT-debug.apk'
tests_apk_path 'app/build/outputs/apk/app-0.6.0-SNAPSHOT-debug-androidTest.apk'

locales ['en-US']

clear_previous_screenshots true
clear_previous_screenshots true
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ static class ChatViewHolder extends RecyclerView.ViewHolder {
ChatViewHolder(final View view) {
super(view);

textView = (EmojiTextView) view.findViewById(R.id.adapter_chat_text_view);
textView = view.findViewById(R.id.adapter_chat_text_view);
}
}
}
11 changes: 6 additions & 5 deletions app/src/main/java/com/vanniktech/emoji/sample/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.vanniktech.emoji.one.EmojiOneProvider;
import com.vanniktech.emoji.twitter.TwitterEmojiProvider;

@SuppressWarnings("CPD-START") // We don't care about duplicate code in the sample.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found here: https://stackoverflow.com/a/18625921/4279995
Not optimal, but I think there is no better way...

public class MainActivity extends AppCompatActivity {
static final String TAG = "MainActivity";

Expand All @@ -47,10 +48,10 @@ public class MainActivity extends AppCompatActivity {

chatAdapter = new ChatAdapter();

editText = (EmojiEditText) findViewById(R.id.main_activity_chat_bottom_message_edittext);
rootView = (ViewGroup) findViewById(R.id.main_activity_root_view);
emojiButton = (ImageView) findViewById(R.id.main_activity_emoji);
final ImageView sendButton = (ImageView) findViewById(R.id.main_activity_send);
editText = findViewById(R.id.main_activity_chat_bottom_message_edittext);
rootView = findViewById(R.id.main_activity_root_view);
emojiButton = findViewById(R.id.main_activity_emoji);
final ImageView sendButton = findViewById(R.id.main_activity_send);

emojiButton.setColorFilter(ContextCompat.getColor(this, R.color.emoji_icons), PorterDuff.Mode.SRC_IN);
sendButton.setColorFilter(ContextCompat.getColor(this, R.color.emoji_icons), PorterDuff.Mode.SRC_IN);
Expand All @@ -72,7 +73,7 @@ public class MainActivity extends AppCompatActivity {
}
});

final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.main_activity_recycler_view);
final RecyclerView recyclerView = findViewById(R.id.main_activity_recycler_view);
recyclerView.setAdapter(chatAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));

Expand Down
11 changes: 6 additions & 5 deletions app/src/main/java/com/vanniktech/emoji/sample/MainDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.vanniktech.emoji.listeners.OnSoftKeyboardCloseListener;
import com.vanniktech.emoji.listeners.OnSoftKeyboardOpenListener;

@SuppressWarnings("CPD-START") // We don't care about duplicate code in the sample.
public class MainDialog extends DialogFragment {
static final String FRAGMENT_MANAGER_TAG = "dialog_main";
static final String TAG = "MainDialog";
Expand Down Expand Up @@ -66,10 +67,10 @@ public Dialog onCreateDialog(final Bundle savedInstanceState) {
private View buildView() {
final View result = View.inflate(getContext(), R.layout.dialog_main, null);

editText = (EmojiEditText) result.findViewById(R.id.main_dialog_chat_bottom_message_edittext);
rootView = (ViewGroup) result.findViewById(R.id.main_dialog_root_view);
emojiButton = (ImageView) result.findViewById(R.id.main_dialog_emoji);
final ImageView sendButton = (ImageView) result.findViewById(R.id.main_dialog_send);
editText = result.findViewById(R.id.main_dialog_chat_bottom_message_edittext);
rootView = result.findViewById(R.id.main_dialog_root_view);
emojiButton = result.findViewById(R.id.main_dialog_emoji);
final ImageView sendButton = result.findViewById(R.id.main_dialog_send);

emojiButton.setColorFilter(ContextCompat.getColor(getContext(), R.color.emoji_icons), PorterDuff.Mode.SRC_IN);
sendButton.setColorFilter(ContextCompat.getColor(getContext(), R.color.emoji_icons), PorterDuff.Mode.SRC_IN);
Expand All @@ -91,7 +92,7 @@ private View buildView() {
}
});

final RecyclerView recyclerView = (RecyclerView) result.findViewById(R.id.main_dialog_recycler_view);
final RecyclerView recyclerView = result.findViewById(R.id.main_dialog_recycler_view);
recyclerView.setAdapter(chatAdapter);
recyclerView.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));

Expand Down
24 changes: 11 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ apply plugin: 'com.vanniktech.android.junit.jacoco'

buildscript {
ext.versions = [
testRules: '0.5',
espresso: '3.0.0',
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concerning screengrab: Something set a different version, so I redefinied it here. Why does that happen?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh it was simply missing here in the first place. Now it should be all good.

testRules: '1.0.0',
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i haven't had luck with 1.0.0 and espresso 3.0.0. Did you test locally whether the screenshots are being taken or not. You can do so using gw assembleDebug assembleAndroidTest && fastlane screengrab

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, at first it did not work. Managed to fix with my latest commit though.

]

ext.deps = [
Expand All @@ -17,7 +18,7 @@ buildscript {
'rules': "com.android.support.test:rules:${versions.testRules}",
],
],
'fastLaneScreenGrab': "tools.fastlane:screengrab:1.0.3",
'fastLaneScreenGrab': "tools.fastlane:screengrab:1.1.0",
]

repositories {
Expand All @@ -26,7 +27,7 @@ buildscript {
}
dependencies {
classpath 'com.vanniktech:gradle-code-quality-tools-plugin:0.7.0'
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.6.0'
classpath 'com.vanniktech:gradle-android-junit-jacoco-plugin:0.7.0'

classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.15.0'
Expand All @@ -52,9 +53,6 @@ codeQualityTools {
errorProne {
toolVersion = '2.0.21'
}
cpd {
ignoreFailures = true // Fix in a follow up.
}
}

junitJacoco {
Expand All @@ -74,11 +72,11 @@ subprojects {

ext {
minSdkVersion = 15
compileSdkVersion = 25
targetSdkVersion = 25
buildToolsVersion = '25.0.3'
compileSdkVersion = 26
targetSdkVersion = 26
buildToolsVersion = '26.0.1'

supportLibraryVersion = '25.4.0'
supportLibraryVersion = '26.0.0'
leakCanaryVersion = '1.5.1'

versionCode = VERSION_CODE
Expand All @@ -96,8 +94,8 @@ ext {

testing = [
junit : 'junit:junit:4.12',
robolectric : 'org.robolectric:robolectric:3.3.2',
mockito : 'org.mockito:mockito-core:2.8.9',
robolectric : 'org.robolectric:robolectric:3.4.2',
mockito : 'org.mockito:mockito-core:2.8.47',
privateConstructor: 'com.pushtorefresh.java-private-constructor-checker:checker:1.2.0',
assertJ : 'org.assertj:assertj-core:3.8.0'
]
Expand All @@ -106,6 +104,6 @@ ext {
}

task wrapper(type: Wrapper) {
gradleVersion = '4.0'
gradleVersion = '4.0.2'
distributionType = Wrapper.DistributionType.ALL
}
1 change: 1 addition & 0 deletions emoji/src/main/java/com/vanniktech/emoji/EmojiButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.text.SpannableStringBuilder;
import android.util.AttributeSet;

@SuppressWarnings("CPD-START") // The Emoji widgets have almost the same code, so ignore CPD here.
public class EmojiButton extends AppCompatButton {
private float emojiSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.view.KeyEvent;
import com.vanniktech.emoji.emoji.Emoji;

@SuppressWarnings("CPD-START") // The Emoji widgets have almost the same code, so ignore CPD here.
public class EmojiEditText extends AppCompatEditText {
private float emojiSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import android.text.SpannableStringBuilder;
import android.util.AttributeSet;

@SuppressWarnings("CPD-START") // The Emoji widgets have almost the same code, so ignore CPD here.
public class EmojiTextView extends AppCompatTextView {
private float emojiSize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void dismiss() {

private View initView(@NonNull final Context context, @NonNull final Emoji emoji, final int width) {
final View result = View.inflate(context, R.layout.emoji_skin_popup, null);
final LinearLayout imageContainer = (LinearLayout) result.findViewById(R.id.container);
final LinearLayout imageContainer = result.findViewById(R.id.container);

final List<Emoji> variants = emoji.getBase().getVariants();
variants.add(0, emoji.getBase());
Expand Down
4 changes: 2 additions & 2 deletions emoji/src/main/java/com/vanniktech/emoji/EmojiView.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
context.getTheme().resolveAttribute(R.attr.colorAccent, value, true);
themeAccentColor = value.data;

final ViewPager emojisPager = (ViewPager) findViewById(R.id.emojis_pager);
final LinearLayout emojisTab = (LinearLayout) findViewById(R.id.emojis_tab);
final ViewPager emojisPager = findViewById(R.id.emojis_pager);
final LinearLayout emojisTab = findViewById(R.id.emojis_tab);
emojisPager.addOnPageChangeListener(this);

final EmojiCategory[] categories = EmojiManager.getInstance().getCategories();
Expand Down
10 changes: 0 additions & 10 deletions emoji/src/test/java/com/vanniktech/emoji/EmojiManagerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,6 @@ public void noProviderInstalled() {
assertThat(text.getSpans(0, text.length(), EmojiSpan.class)).hasSize(1);
}

@Test public void takeLongest() {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a duplicate of the halfPath test.

EmojiManager.install(provider);

final Spannable text = new SpannableString(new String(new int[] { 0x1234, 0x4321 }, 0, 1));

EmojiManager.replaceWithImages(RuntimeEnvironment.application, text, 22);

assertThat(text.getSpans(0, text.length(), EmojiSpan.class)).hasSize(1);
}

@Test public void empty() {
EmojiManager.install(provider);

Expand Down
2 changes: 1 addition & 1 deletion generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"cheerio": "^1.0.0-rc.1",
"command-line-args": "^4.0.6",
"download": "^6.2.5",
"fs-extra": "^3.0.1",
"fs-extra": "^4.0.1",
"imagemin": "^5.3.1",
"imagemin-optipng": "^5.2.1",
"stable": "^0.1.6",
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jun 19 17:19:50 CEST 2017
#Mon Aug 07 14:31:22 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.2-all.zip
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down