Skip to content

Commit

Permalink
merge upstream/master
Browse files Browse the repository at this point in the history
  • Loading branch information
ramack committed Jan 10, 2020
2 parents ca3f99f + 068af7d commit b80ea04
Show file tree
Hide file tree
Showing 17 changed files with 350 additions and 315 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A clear and concise description of what the problem is. Ex. I'm always frustrate
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
A description of any alternative solutions or features you've considered or that would also solve your problem above.

**Additional context**
Add any other context or screenshots about the feature request here - maybe a quick "paint-modified" picture to show what you'r liek to propose.
Add any other context or screenshots about the feature request here - maybe a quick "paint-modified" picture/mockup to visualize your porposal.
137 changes: 120 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,127 @@
language: android

jdk:
- oraclejdk8

android:
components:
- tools
- platform-tools
- build-tools-29.0.2
- android-29
- extra-android-m2repository
licenses:
- "android-sdk-preview-license-52d11cd2"
- "android-sdk-license-.+"
- "google-gdk-license-.+"
# modified version of https://github.com/ankidroid/Anki-Android/blob/master/.travis.yml
sudo: true
language: bash
# ignored on non-linux platforms, but bionic is required for nested virtualization
dist: bionic

stages:
- install
- unit_test # custom stage defined in jobs::include section
- test
- finalize_coverage # custom stage defined in jobs::include section
- cache

env:
global:
- COMPILE_API=29 # sync with compileSdkVersion
- ANDROID_BUILD_TOOLS=29.0.2
- ABI=x86_64
- ADB_INSTALL_TIMEOUT=8
- ANDROID_HOME=${HOME}/android-sdk
- ANDROID_TOOLS_URL="https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip"
- EMU_FLAVOR=default # use google_apis flavor if no default flavor emulator
- GRAVIS="https://raw.githubusercontent.com/DanySK/Gravis-CI/master/"
- JDK="1.8"
- TOOLS=${ANDROID_HOME}/tools
# PATH order is incredibly important. e.g. the 'emulator' script exists in more than one place!
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
# fix gradle output
- TERM=dumb
matrix:
- API=21 # Android 5.0
- API=26 # Android 8.0
- API=29 # Android 10.0

before_install:
- yes | sdkmanager --update
# This section may run on all platforms, and may run for unit tests or for coverage finalization
# It should not make assumptions about os platform or desired tool installation

# Set up JDK 8 for Android SDK - Java is universally needed: codacy, unit tests, emulators
- curl "${GRAVIS}.install-jdk-travis.sh" --output ~/.install-jdk-travis.sh
- export TARGET_JDK="${JDK}"
- JDK="1.8"
- source ~/.install-jdk-travis.sh

# Set up Android SDK - this is needed everywhere but coverage finalization, so toggle on that
- wget -q "${ANDROID_TOOLS_URL}" -O android-sdk-tools.zip
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
- rm android-sdk-tools.zip
- mkdir ~/.android
- echo 'count=0' > ~/.android/repositories.cfg
- yes | sdkmanager --licenses >/dev/null
- echo y | sdkmanager --no_https "platform-tools" >/dev/null
- echo y | sdkmanager --no_https "tools" >/dev/null
- echo y | sdkmanager --no_https "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
- echo y | sdkmanager --no_https "platforms;android-${COMPILE_API}" >/dev/null

install:
# In our setup, install only runs on matrix entries we want full emulator tests on
# That only happens currently on linux, so this section can assume linux + emulator is desired
# Download required emulator tools
- echo y | sdkmanager --no_https "platforms;android-$API" >/dev/null # We need the API of the emulator we will run
- echo y | sdkmanager --no_https "emulator" >/dev/null
- echo y | sdkmanager --no_https "system-images;android-$API;$EMU_FLAVOR;$ABI" >/dev/null # install our emulator

# Set up KVM on linux for hardware acceleration. Manually here so it only happens for emulator tests, takes ~30s
- sudo -E apt-get -yq --no-install-suggests --no-install-recommends install bridge-utils libpulse0 libvirt-bin qemu-kvm virtinst ubuntu-vm-builder
- sudo adduser $USER libvirt
- sudo adduser $USER kvm

# Create an Android emulator
- echo no | avdmanager create avd --force -n test -k "system-images;android-$API;$EMU_FLAVOR;$ABI" -c 10M
- |
EMU_PARAMS="-verbose -no-snapshot -no-window -camera-back none -camera-front none -selinux permissive -qemu -m 2048"
EMU_COMMAND="emulator"
# This double "sudo" monstrosity is used to have Travis execute the
# emulator with its new group permissions and help preserve the rule
# of least privilege.
sudo -E sudo -u $USER -E bash -c "${ANDROID_HOME}/emulator/${EMU_COMMAND} -avd test ${AUDIO} ${EMU_PARAMS} &"
# Wait for emulator to be ready
- |
bootanim=""
failcounter=0
timeout_in_sec=600 # 10 minutes
until [[ "$bootanim" =~ "stopped" ]]; do
bootanim=`adb -e shell getprop init.svc.bootanim 2>&1 &`
if [[ "$bootanim" =~ "device not found" || "$bootanim" =~ "device offline"
|| "$bootanim" =~ "running" || "$bootanim" =~ "error: no emulators found" ]]; then
let "failcounter += 1"
echo "Waiting for emulator to start"
if [[ $failcounter -gt timeout_in_sec ]]; then
echo "Timeout ($timeout_in_sec seconds) reached; failed to start emulator"
exit 1
fi
fi
sleep 1
done
echo "Emulator is ready"
- adb shell input keyevent 82 &

# Switch back to our target JDK version to build and run tests
- JDK="${TARGET_JDK}"
- source ~/.install-jdk-travis.sh

before_script:
- adb -e logcat | tee logcat.log > /dev/null 2>&1 &

script:
- ./gradlew assembleDebug
- ./gradlew test
- ./gradlew testDebug
- ./gradlew connectedDebugAndroidTest

after_script:
# Uncomment the line below to kill adb and show logcat output.
- echo " LOGCAT "; echo "========"; cat logcat.log; pkill -KILL -f adb

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- curl "${GRAVIS}.clean_gradle_cache.sh" --output ~/.clean_gradle_cache.sh
- bash ~/.clean_gradle_cache.sh > /dev/null

cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
29 changes: 13 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,30 @@

![](https://travis-ci.org/Piwigo/Piwigo-Android.svg)

Currently under development by the Piwigo-Mobile team, please get in touch if you're interested in contributing to the project.
Software is never finished and this APP is still under development by the Piwigo-Mobile team but it is already usable. If you face trouble please check the [FAQs](https://github.com/Piwigo/Piwigo-Android/wiki/FAQ:-Frequently-Asked-Questions) and [create tickets](https://github.com/Piwigo/Piwigo-Android/issues/new/choose) in case you detect a bug.

If you're considering contributing, a working knowledge of the following would be extremely useful:

* MVVM with Android Data Binding
* Dependency injection with Dagger 2
* Unit testing with Mockito and Robolectric

## Progress

### Install
## Install

<a href="https://f-droid.org/packages/org.piwigo.android/" target="_blank">
<img src="https://f-droid.org/badge/get-it-on.png" alt="Get it on F-Droid" height="80"/></a>
<a href="https://play.google.com/store/apps/details?id=org.piwigo.android" target="_blank">
<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" alt="Get it on Google Play" height="80"/></a>

### Login
To show your photos enter the URL of your gallery into the server address field. For a quick try you can enter http://www.piwigo.org/demo. Keep username and password empty for guest login.
## Login

To show your photos enter the URL of your gallery (the web address you also use in the browser) into the server address field. For a quick try you can enter http://www.piwigo.org/demo. Keep username and password empty for guest login.

<img src="./app/src/main/play/listings/en-US/graphics/phone-screenshots/01_Login.jpg" width="238" />

#### Done
## Supported features

- Navigation through albums
- Full screen photo view
- Upload
- Guest login (see Settings -> Accounts after successful login)
- Guest login (by keeping user name and password fields empty)
- User login (see Settings -> Accounts after successful login)
- Should scale well on all phone and table screens
- Animations on most devices
- Multiple accounts
- SSL protected galleries but also plain HTTP access (which is recommended only in secured private networks)

### Main screen

Expand All @@ -45,3 +39,6 @@ Copyright notices in this project are mostly given with a reference to the year

## Privacy
Piwigo-Android and its authors have a deep interest to respect your privacy. Therefore this app is designed to not track your behaviour and keep your data in your hands. It is recommended to host your Piwigo gallery by yourself and use only encrypted connections via HTTPS. The full <a href="https://piwigo.org/mobile-apps-privacy-policy">privacy policy is available on the website</a> of Piwigo and within he app itself.

## Contributions
As most free / open source software projects we have happy if are willing to invest some time into this project and contribute. We are always looking for translators, documentators, testers and for sure also programmers. Translations are done on the [platform Crowdin](https://crowdin.com/project/piwigo-android) and documentation mainly here in this README file and the [wiki](https://github.com/Piwigo/Piwigo-Android/wiki). If you consider contributing code best is to choose one of the tickets where you have a personal interest to get it done and comment on it with a proposal hwo you plan to solve the issue. Some where we believe they could be a good starting point are labeled with [help wanted](https://github.com/Piwigo/Piwigo-Android/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). For coding it would be great to have experience with MVVM, Android Data Binding, Depencency injections with Dagger 2 or Unit testing with Mockito and Robolectric. But even in case you have just a little Java experience and want to support we will help you to ramp up and guide you to learn the things you need for this project.
13 changes: 12 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ if (project.file('../PiwigoSigning.properties').exists()) {

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "org.piwigo.android"
minSdkVersion 21
Expand All @@ -57,6 +58,7 @@ android {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
testInstrumentationRunner = 'androidx.test.runner.AndroidJUnitRunner'
}
buildTypes {
debug {
Expand Down Expand Up @@ -103,6 +105,7 @@ def picassoVersion = '2.71828'
def assertjVersion = '1.2.0'
def acraVersion = '5.4.0'
def room_version = "2.2.2"
def espressoVersion = '3.3.0-alpha03'

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
Expand Down Expand Up @@ -151,7 +154,7 @@ dependencies {
// debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-3'

testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation("com.squareup.assertj:assertj-android:${assertjVersion}") {
exclude group: 'com.android.support'
}
Expand All @@ -162,4 +165,12 @@ dependencies {
testImplementation 'androidx.appcompat:appcompat:1.1.0'
testAnnotationProcessor 'com.google.guava:guava:24.1-jre'
testImplementation 'com.google.code.findbugs:jsr305:3.0.2'

androidTestImplementation 'androidx.test:core:1.3.0-alpha03'
androidTestImplementation 'androidx.test:core-ktx:1.3.0-alpha03'
androidTestImplementation 'androidx.test.ext:junit:1.1.2-alpha03'
androidTestImplementation 'androidx.test:runner:1.3.0-alpha03'
androidTestImplementation "androidx.test.espresso:espresso-core:${espressoVersion}"
androidTestImplementation "androidx.test.espresso:espresso-contrib:${espressoVersion}"
androidTestImplementation 'androidx.test:rules:1.3.0-alpha03'
}
Loading

0 comments on commit b80ea04

Please sign in to comment.