Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ayltai committed Dec 14, 2017
2 parents ff2316b + ca2e759 commit 1a05e4e
Show file tree
Hide file tree
Showing 102 changed files with 1,945 additions and 1,578 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ references:
- mobile/build/outputs/apk
- mobile/build/outputs/code-coverage
- mobile/build/test-results
persist_to_release_workspace: &persist_to_release_workspace
persist_release_workspace: &persist_release_workspace
persist_to_workspace:
root: *workspace
paths:
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
- run:
name: Gradle build (release)
command: ./gradlew -PciBuild=true :mobile:assembleRelease
- *persist_to_release_workspace
- *persist_release_workspace
- store_artifacts:
path: mobile/build/outputs/apk/
destination: /apk/
Expand Down
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Newspaper
=========

[![Release](https://img.shields.io/github/release/ayltai/Newspaper.svg?label=release&maxAge=1800)](https://1244-77390316-gh.circle-artifacts.com/0/apk/release/mobile-release.apk) [![Build Status](https://circleci.com/gh/ayltai/Newspaper.svg?style=shield)](https://circleci.com/gh/ayltai/Newspaper) [![Code Quality](https://api.codacy.com/project/badge/Grade/89d745ac9331474e9cf9f3203782a72f)](https://www.codacy.com/app/ayltai/Newspaper?utm_source=github.com&utm_medium=referral&utm_content=ayltai/Newspaper&utm_campaign=Badge_Grade) [![Code Coverage](https://api.codacy.com/project/badge/Coverage/89d745ac9331474e9cf9f3203782a72f)](https://www.codacy.com/app/ayltai/Newspaper?utm_source=github.com&utm_medium=referral&utm_content=ayltai/Newspaper&utm_campaign=Badge_Coverage) [![Code Coverage](https://codecov.io/gh/ayltai/Newspaper/branch/master/graph/badge.svg)](https://codecov.io/gh/ayltai/Newspaper) [![Android API](https://img.shields.io/badge/API-16%2B-blue.svg?style=flat&label=API&maxAge=300)](https://www.android.com/history/) [![License](https://img.shields.io/badge/License-apache%202.0-blue.svg?label=license&maxAge=1800)](https://github.com/ayltai/Newspaper/blob/master/LICENSE)
[![Release](https://img.shields.io/github/release/ayltai/Newspaper.svg?label=release&maxAge=1800)](https://1292-77390316-gh.circle-artifacts.com/0/apk/release/mobile-release.apk) [![Build Status](https://circleci.com/gh/ayltai/Newspaper.svg?style=shield)](https://circleci.com/gh/ayltai/Newspaper) [![Code Quality](https://api.codacy.com/project/badge/Grade/89d745ac9331474e9cf9f3203782a72f)](https://www.codacy.com/app/ayltai/Newspaper?utm_source=github.com&utm_medium=referral&utm_content=ayltai/Newspaper&utm_campaign=Badge_Grade) [![Code Coverage](https://api.codacy.com/project/badge/Coverage/89d745ac9331474e9cf9f3203782a72f)](https://www.codacy.com/app/ayltai/Newspaper?utm_source=github.com&utm_medium=referral&utm_content=ayltai/Newspaper&utm_campaign=Badge_Coverage) [![Code Coverage](https://codecov.io/gh/ayltai/Newspaper/branch/master/graph/badge.svg)](https://codecov.io/gh/ayltai/Newspaper) [![Android API](https://img.shields.io/badge/API-16%2B-blue.svg?style=flat&label=API&maxAge=300)](https://www.android.com/history/) [![License](https://img.shields.io/badge/License-apache%202.0-blue.svg?label=license&maxAge=1800)](https://github.com/ayltai/Newspaper/blob/master/LICENSE)

An aggregated news app containing news from 10+ local news publishers in Hong Kong. Made with ❤

Expand All @@ -28,6 +28,10 @@ An aggregated news app containing news from 10+ local news publishers in Hong Ko
* [Hong Kong Economic Journal (信報)](http://www.hkej.com)
* [RTHK (香港電台)](http://news.rthk.hk)

## Blog posts
* [All you need to know about CircleCI 2.0 with Firebase Test Lab](https://medium.com/@ayltai/all-you-need-to-know-about-circleci-2-0-with-firebase-test-lab-2a66785ff3c2)
* [You’re cropping images wrong](https://medium.com/@ayltai/youre-cropping-images-wrong-a79e8f67e6c9)

## Requirements
This app supports Android 4.1 Jelly Bean (API 16) or later.

Expand All @@ -36,6 +40,10 @@ This app is made with the support of open source projects:

* [Flow](https://github.com/square/flow)
* [Realm](https://realm.io/news/realm-for-android)
* [RxJava](https://github.com/ReactiveX/RxJava)
* [RxAndroid](https://github.com/ReactiveX/RxAndroid)
* [RxJava2Debug](https://github.com/akaita/RxJava2Debug)
* [Dagger 2](https://google.github.io/dagger)
* [Facebook Fresco](https://github.com/facebook/fresco)
* [FrescoImageViewer](https://github.com/stfalcon-studio/FrescoImageViewer)
* [Subsampling Scale Image View](https://github.com/davemorrissey/subsampling-scale-image-view)
Expand All @@ -44,17 +52,14 @@ This app is made with the support of open source projects:
* [KenBurnsView](https://github.com/flavioarfaria/KenBurnsView)
* [PanoramaImageView](https://github.com/gjiazhe/PanoramaImageView)
* [ExoPlayer](https://github.com/google/ExoPlayer)
* [ShimmerLayout](https://github.com/team-supercharge/ShimmerLayout)
* [SmallBang](https://github.com/hanks-zyh/SmallBang)
* [OkHttp](https://github.com/square/okhttp)
* [BottomBar](https://github.com/roughike/BottomBar)
* [FlowLayout](https://github.com/nex3z/FlowLayout)
* [RxJava](https://github.com/ReactiveX/RxJava)
* [RxAndroid](https://github.com/ReactiveX/RxAndroid)
* [RxBinding](https://github.com/JakeWharton/RxBinding)
* [Dagger 2](https://google.github.io/dagger)
* [Calligraphy](https://github.com/InflationX/Calligraphy)
* [AutoValue](https://github.com/google/auto/tree/master/value)
* [Gson](https://github.com/google/gson)
* [GNU Trove](https://bitbucket.org/trove4j/trove)
* [Espresso](https://google.github.io/android-testing-support-library)
* [JUnit 4](https://github.com/junit-team/junit4)
* [Mockito](https://github.com/mockito/mockito)
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ buildscript {

dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'io.realm:realm-gradle-plugin:4.2.0'
classpath 'io.realm:realm-gradle-plugin:4.3.1'
classpath 'com.google.gms:google-services:3.1.2'
classpath 'com.google.firebase:firebase-plugins:1.1.4'
classpath 'io.fabric.tools:gradle:1.25.0'
classpath 'io.fabric.tools:gradle:1.25.1'
classpath 'org.jacoco:org.jacoco.core:0.7.9'
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-bin.zip
23 changes: 12 additions & 11 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ String VERSION_HASH = 'git rev-parse --short HEAD'.execute().text.trim()

android {
compileSdkVersion 27
buildToolsVersion '27.0.1'
buildToolsVersion '27.0.2'
defaultConfig {
applicationId 'com.github.ayltai.newspaper'
minSdkVersion project.hasProperty('ciBuild') ? 16 : 21
targetSdkVersion 27
versionCode 26
versionName '3.8.' + VERSION_REVISION + '-' + VERSION_HASH
versionCode 27
versionName '3.9.' + VERSION_REVISION + '-' + VERSION_HASH

testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
testInstrumentationRunnerArguments disableAnalytics : 'true'
Expand Down Expand Up @@ -106,11 +106,10 @@ ext {
architectureVersion = '1.0.0'
firebaseSdkVersion = '11.6.2'
daggerVersion = '2.13'
rxBindingVersion = '2.0.0'
okhttpVersion = '3.9.1'
retrofitVersion = '2.3.0'
frescoVersion = '1.5.0'
bigImageViewerVersion = '1.4.4'
bigImageViewerVersion = '1.4.5'
exoPlayerVersion = '2.6.0'
leakCanaryVersion = '1.5.4'
robolectricVersion = '3.5.1'
Expand Down Expand Up @@ -141,6 +140,7 @@ dependencies {
annotationProcessor ("android.arch.lifecycle:compiler:$architectureVersion") {
exclude group : 'com.android.support'
}
implementation "android.arch.lifecycle:common-java8:$architectureVersion"

// Android Support libraries
implementation "com.android.support:cardview-v7:$supportLibraryVersion"
Expand All @@ -155,9 +155,6 @@ dependencies {
// Reactive programming
implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
implementation "com.jakewharton.rxbinding2:rxbinding-appcompat-v7:$rxBindingVersion"
implementation "com.jakewharton.rxbinding2:rxbinding-recyclerview-v7:$rxBindingVersion"
implementation "com.jakewharton.rxbinding2:rxbinding-support-v4:$rxBindingVersion"

// Dependency injection
implementation "com.google.dagger:dagger:$daggerVersion"
Expand Down Expand Up @@ -188,20 +185,23 @@ dependencies {
// Video processing
implementation "com.google.android.exoplayer:exoplayer-core:$exoPlayerVersion"
implementation "com.google.android.exoplayer:exoplayer-ui:$exoPlayerVersion"
implementation "com.google.android.exoplayer:extension-okhttp:$exoPlayerVersion"

// UI components
implementation 'com.squareup.flow:flow:1.0.0-alpha3'
implementation 'com.nex3z:flow-layout:1.1.0'
implementation 'com.roughike:bottom-bar:2.3.1'

// Eye candies
implementation 'jp.wasabeef:recyclerview-animators:2.2.7'
implementation 'io.supercharge:shimmerlayout:1.0.2'
implementation 'com.github.castorflex.smoothprogressbar:library:1.1.0'
implementation 'pub.hanks:smallbang:1.2.2'
implementation 'com.flaviofaria:kenburnsview:1.0.7'
implementation 'com.gjiazhe:PanoramaImageView:1.0'
implementation 'io.github.inflationx:calligraphy3:3.0.0'

implementation 'net.sf.trove4j:trove4j:3.0.3'

// Code generation tools
compileOnly "com.jakewharton.auto.value:auto-value-annotations:1.5"
annotationProcessor "com.google.auto.value:auto-value:1.5.2"
Expand All @@ -214,15 +214,16 @@ dependencies {
}

// Instabug
implementation 'com.instabug.library:instabug:4.3.3'
implementation 'com.instabug.library:instabug:4.5.0'

// Debugging
implementation 'com.akaita.java:rxjava2-debug:1.2.2'
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"
testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"

// Unit testing
testImplementation 'org.mockito:mockito-core:2.12.2'
testImplementation 'org.mockito:mockito-core:2.13.0'
testImplementation "org.powermock:powermock-module-junit4:$powerMockVersion"
testImplementation "org.powermock:powermock-module-junit4-rule:$powerMockVersion"
testImplementation "org.powermock:powermock-api-mockito2:$powerMockVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ public final class AboutTest extends BaseTest {
@Test
public void visitWebsite() {
// Clicks About bottom tab
Espresso.onView(ViewMatchers.withText("About"))
Espresso.onView(Matchers.allOf(
ViewMatchers.withId(R.id.action_about),
ViewMatchers.withParent(ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomNavigationView))),
ViewMatchers.isDisplayed()))
.perform(ViewActions.click());

ScreenShotter.takeScreenshot(this.getClass().getSimpleName() + ".visitWebsite", this.testRule.getActivity());
Expand All @@ -45,7 +48,10 @@ public void visitWebsite() {
@Test
public void rateApp() {
// Clicks About bottom tab
Espresso.onView(ViewMatchers.withText("About"))
Espresso.onView(Matchers.allOf(
ViewMatchers.withId(R.id.action_about),
ViewMatchers.withParent(ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomNavigationView))),
ViewMatchers.isDisplayed()))
.perform(ViewActions.click());

ScreenShotter.takeScreenshot(this.getClass().getSimpleName() + ".rateApp", this.testRule.getActivity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ public void bookmarkNewsTest() {
// Clicks Bookmarks bottom tab
Espresso.onView(Matchers.allOf(
ViewMatchers.withId(R.id.action_bookmark),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_item_container),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_outer_container),
ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomBar)))))),
ViewMatchers.withParent(ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomNavigationView))),
ViewMatchers.isDisplayed()))
.perform(ViewActions.click());

Expand Down Expand Up @@ -59,11 +55,7 @@ public void bookmarkNewsTest() {
// Clicks News bottom tab
Espresso.onView(Matchers.allOf(
ViewMatchers.withId(R.id.action_news),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_item_container),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_outer_container),
ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomBar)))))),
ViewMatchers.withParent(ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomNavigationView))),
ViewMatchers.isDisplayed()))
.perform(ViewActions.click());

Expand Down Expand Up @@ -93,11 +85,7 @@ public void bookmarkNewsTest() {
// Clicks Bookmarks bottom tab
Espresso.onView(Matchers.allOf(
ViewMatchers.withId(R.id.action_bookmark),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_item_container),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_outer_container),
ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomBar)))))),
ViewMatchers.withParent(ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomNavigationView))),
ViewMatchers.isDisplayed()))
.perform(ViewActions.click());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ public void historicalNewsTest() {
// Clicks Histories bottom tab
Espresso.onView(Matchers.allOf(
ViewMatchers.withId(R.id.action_history),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_item_container),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_outer_container),
ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomBar)))))),
ViewMatchers.withParent(ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomNavigationView))),
ViewMatchers.isDisplayed()))
.perform(ViewActions.click());

Expand Down Expand Up @@ -59,11 +55,7 @@ public void historicalNewsTest() {
// Clicks News bottom tab
Espresso.onView(Matchers.allOf(
ViewMatchers.withId(R.id.action_news),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_item_container),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_outer_container),
ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomBar)))))),
ViewMatchers.withParent(ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomNavigationView))),
ViewMatchers.isDisplayed()))
.perform(ViewActions.click());

Expand All @@ -84,11 +76,7 @@ public void historicalNewsTest() {
// Clicks Histories bottom tab
Espresso.onView(Matchers.allOf(
ViewMatchers.withId(R.id.action_history),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_item_container),
ViewMatchers.withParent(Matchers.allOf(
ViewMatchers.withId(R.id.bb_bottom_bar_outer_container),
ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomBar)))))),
ViewMatchers.withParent(ViewMatchers.withParent(ViewMatchers.withId(R.id.bottomNavigationView))),
ViewMatchers.isDisplayed()))
.perform(ViewActions.click());

Expand Down
Loading

0 comments on commit 1a05e4e

Please sign in to comment.