Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Code of version 1.0-BETA1
  • Loading branch information
captainepoch committed Nov 5, 2018
1 parent a6ebd35 commit 49361f6
Show file tree
Hide file tree
Showing 110 changed files with 5,590 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
52 changes: 52 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 27
defaultConfig {
applicationId "com.wnluc3m.papaya"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0-BETA1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//consumerProguardFiles 'proguard-file.pro'
}
}
// Required by material-intro
dataBinding {
enabled true
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:support-compat:27.1.1'
implementation 'com.android.support:support-vector-drawable:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
// OpenStreet Maps
implementation 'org.osmdroid:osmdroid-android:6.0.1'
implementation 'com.github.MKergall:osmbonuspack:6.5.1'
// Intro activity
//TODO: update ASAP
implementation 'com.heinrichreimersoftware:material-intro:1.6'
// SQLite Backup lib
api 'com.ajts.androidmads.sqliteimpex:library:1.0.0'
}
apply plugin: 'kotlin-android-extensions'
23 changes: 23 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-dontwarn org.codehaus.**
-dontwarn okio.**
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.wnluc3m.papaya

import android.support.test.InstrumentationRegistry
import android.support.test.runner.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getTargetContext()
assertEquals("com.wnluc3m.papaya", appContext.packageName)
}
}
79 changes: 79 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.wnluc3m.papaya">

<!-- Permissions -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Wake Locks for Android 5.0 through Android 7.1 -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<uses-feature android:name="android.hardware.location.gps"/>

<application
android:allowBackup="true"
android:hardwareAccelerated="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:largeHeap="true"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<service
android:name=".Services.LocationServiceNative"
android:directBootAware="true"
android:exported="false"/>
<service
android:name=".Jobs.BatteryCheckJob"
android:exported="true"
android:permission="android.permission.BIND_JOB_SERVICE"/>

<activity
android:name=".Activities.PapayaMain"
android:configChanges="screenSize|orientation"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
</activity>

<activity
android:name=".Activities.SplashIntroActivity"
android:theme="@style/Theme.Intro">
</activity>

<activity
android:name=".Activities.SettingsActivity"
android:label="@string/title_activity_settings"
android:parentActivityName=".Activities.PapayaMain">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".Activities.PapayaMain"/>
</activity>

<activity
android:name=".Activities.LicenseActivity"
android:label="@string/title_licenses"
android:launchMode="singleTop">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".Activities.PapayaMain"/>
</activity>

<activity
android:name=".Activities.StartActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

<activity android:name=".Activities.MapStayPointsActivity">
</activity>
</application>

</manifest>
Binary file added app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/* Copyright 2018 Adolfo "captainepoch" Santiago
*
* This file is a part of PAPAYA.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Tusky; if not,
* see <http://www.gnu.org/licenses>.
*/

package com.wnluc3m.papaya.Activities

import android.content.res.Configuration
import android.os.Bundle
import android.preference.PreferenceActivity
import android.support.annotation.LayoutRes
import android.support.v7.app.ActionBar
import android.support.v7.app.AppCompatDelegate
import android.support.v7.widget.Toolbar
import android.view.MenuInflater
import android.view.View
import android.view.ViewGroup

abstract class AppCompatPreferenceActivity : PreferenceActivity() {

private var mDelegate: AppCompatDelegate? = null

val supportActionBar: ActionBar?
get() = delegate.supportActionBar

private val delegate: AppCompatDelegate
get() {
if (mDelegate == null) {
mDelegate = AppCompatDelegate.create(this, null)
}
return mDelegate!!
}

override fun onCreate(savedInstanceState: Bundle?) {
delegate.installViewFactory()
delegate.onCreate(savedInstanceState)
super.onCreate(savedInstanceState)
}

override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
delegate.onPostCreate(savedInstanceState)
}

fun setSupportActionBar(toolbar: Toolbar?) {
delegate.setSupportActionBar(toolbar)
}

override fun getMenuInflater(): MenuInflater {
return delegate.menuInflater
}

override fun setContentView(@LayoutRes layoutResID: Int) {
delegate.setContentView(layoutResID)
}

override fun setContentView(view: View) {
delegate.setContentView(view)
}

override fun setContentView(view: View, params: ViewGroup.LayoutParams) {
delegate.setContentView(view, params)
}

override fun addContentView(view: View, params: ViewGroup.LayoutParams) {
delegate.addContentView(view, params)
}

override fun onPostResume() {
super.onPostResume()
delegate.onPostResume()
}

override fun onTitleChanged(title: CharSequence, color: Int) {
super.onTitleChanged(title, color)
delegate.setTitle(title)
}

override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
delegate.onConfigurationChanged(newConfig)
}

override fun onStop() {
super.onStop()
delegate.onStop()
}

override fun onDestroy() {
super.onDestroy()
delegate.onDestroy()
}

override fun invalidateOptionsMenu() {
delegate.invalidateOptionsMenu()
}
}
40 changes: 40 additions & 0 deletions app/src/main/java/com/wnluc3m/papaya/Activities/LicenseActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* Copyright 2018 Adolfo "captainepoch" Santiago
*
* This file is a part of PAPAYA.
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* Tusky is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along with Tusky; if not,
* see <http://www.gnu.org/licenses>.
*/

package com.wnluc3m.papaya.Activities

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.MenuItem
import com.wnluc3m.papaya.R

class LicenseActivity : AppCompatActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_license)
}

override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
android.R.id.home -> {
onBackPressed()
return true
}
}
return super.onOptionsItemSelected(item)
}
}
Loading

0 comments on commit 49361f6

Please sign in to comment.