Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
drunlin committed Oct 29, 2016
0 parents commit d8cc48f
Show file tree
Hide file tree
Showing 233 changed files with 7,230 additions and 0 deletions.
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2016 drunlin@outlook.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# WebappBox
[![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat)](https://android-arsenal.com/api?level=16)

### A special web browser that makes Web applications more like native applications.

# Screenshots
<img src="/res/screenshot0.png" width=270 height=480> <img src="/res/screenshot1.png" width=270 height=480> <img src="/res/screenshot2.png" width=270 height=480>

# License
Copyright 2016 drunlin@outlook.com

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 2 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/build
/app.iml
106 changes: 106 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import com.android.build.gradle.internal.tasks.databinding.DataBindingExportBuildInfoTask

apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-android-extensions"

buildscript {
ext.kotlin_version = "1.0.5-eap-83"

repositories {
jcenter()
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}

android {
compileSdkVersion 25
buildToolsVersion "25"

defaultConfig {
applicationId "com.github.drunlin.webappbox"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

signingConfigs {
release {
storeFile file(project.property("STORE_FILE"))
storePassword project.property("STORE_PASSWORD")
keyAlias project.property("KEY_ALIAS")
keyPassword project.property("KEY_PASSWORD")
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
}
}

sourceSets {
main.java.srcDirs += "src/main/kotlin"
}

dataBinding {
enabled = true
}
}

kapt {
generateStubs = true
}

repositories {
maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
}

dependencies {
compile fileTree(include: ["*.jar"], dir: "libs")
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "com.android.support:appcompat-v7:25.0.0"
compile "com.android.support:design:25.0.0"
compile "com.android.support:cardview-v7:25.0.0"
compile "com.android.support:preference-v7:25.0.0"
compile "com.android.support:preference-v14:25.0.0"
compile "com.thebluealliance:spectrum:0.6.0"
compile "com.github.rahatarmanahmed:circularprogressview:2.5.0"
kapt "com.android.databinding:compiler:2.2.2"
compile "com.google.dagger:dagger:2.5"
kapt "com.google.dagger:dagger-compiler:2.5"
compile "io.reactivex:rxjava:1.1.5"
compile "io.reactivex:rxandroid:1.2.0"
compile "com.jakewharton.rxbinding:rxbinding-design:0.4.0"
compile "com.jakewharton.rxbinding:rxbinding:0.4.0"
compile "com.jakewharton.rxbinding:rxbinding-appcompat-v7:0.4.0"
compile "org.jsoup:jsoup:1.9.2"

testCompile "junit:junit:4.12"
testCompile "org.robolectric:robolectric:3.0"

androidTestCompile "com.android.support:support-annotations:25.0.0"
androidTestCompile "com.android.support.test:runner:0.5"
androidTestCompile "com.android.support.test:rules:0.5"
}

/**
* Workaround for https://code.google.com/p/android/issues/detail?id=182715
*/
tasks.withType(DataBindingExportBuildInfoTask) { task ->
if (task.name.endsWith("AndroidTest")) {
task.finalizedBy(tasks.create("${task.name}Workaround") << {
task.output.deleteDir()
})
}
}
9 changes: 9 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="ValidFragment" severity="ignore"/>
<issue id="RtlHardcoded" severity="ignore"/>
<issue id="RtlSymmetry" severity="ignore"/>
<issue id="ContentDescription" severity="ignore"/>
<issue id="PrivateResource" severity="ignore"/>
<issue id="LeakingThis" severity="ignore"/>
</lint>
38 changes: 38 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/ubuntu/Android/Sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# 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 *;
#}

-dontwarn kotlin.**

-dontwarn sun.misc.**

-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
long producerIndex;
long consumerIndex;
}

-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
rx.internal.util.atomic.LinkedQueueNode producerNode;
}

-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
rx.internal.util.atomic.LinkedQueueNode consumerNode;
}

-keepclassmembers class * extends android.webkit.WebChromeClient{
public void openFileChooser(...);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.github.drunlin.webappbox

import android.support.test.rule.ActivityTestRule
import android.support.v4.app.FragmentManager
import android.support.v7.app.AppCompatActivity

val ActivityTestRule<out AppCompatActivity>.fragmentManager: FragmentManager
get() = activity.supportFragmentManager
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.github.drunlin.webappbox.activity

import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import org.hamcrest.core.AllOf.allOf
import org.hamcrest.core.IsNot.not
import org.junit.Assert.assertThat
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class FragmentActivityTest {
@Rule @JvmField val rule = ActivityTestRule(FragmentActivity::class.java)

@Test
fun obtainActivityAnimation() {
with(rule.activity) {
assertThat(openEnterAnimation, allOf(not(0), not(android.R.anim.fade_in)))
assertThat(openExitAnimation, allOf(not(0), not(android.R.anim.fade_out)))
assertThat(closeEnterAnimation, allOf(not(0), not(android.R.anim.fade_in)))
assertThat(closeExitAnimation, allOf(not(0), not(android.R.anim.fade_out)))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.github.drunlin.webappbox.activity

import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class MainActivityTest {
@Rule @JvmField val rule = ActivityTestRule(MainActivity::class.java)

@Test
fun start() {
Thread.sleep(Long.MAX_VALUE)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.github.drunlin.webappbox.activity

import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class WebappEditorActivityTest {
@Rule @JvmField val rule = ActivityTestRule(WebappEditorActivity::class.java, false, false)

@Before
fun setUp() {
rule.launchActivity(WebappEditorActivity.new())
}

@Test
fun start() {
Thread.sleep(Long.MAX_VALUE)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.github.drunlin.webappbox.fragment

import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import com.github.drunlin.webappbox.activity.FragmentActivity
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class AboutFragmentTest {
@Rule @JvmField val rule = ActivityTestRule(FragmentActivity::class.java)

@Before
fun setUp() {
rule.activity.setContentFragment(AboutFragment())
}

@Test
fun start() {
Thread.sleep(Long.MAX_VALUE)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.github.drunlin.webappbox.fragment

import android.graphics.Color
import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import android.support.v7.app.AppCompatActivity
import com.github.drunlin.webappbox.common.show
import com.github.drunlin.webappbox.fragmentManager
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class ColorPickerFragmentTest {
@Rule @JvmField val rule = ActivityTestRule(AppCompatActivity::class.java)

@Before
fun setUp() {
ColorPickerFragment(Color.BLACK).show(rule.fragmentManager)
}

@Test
fun start() {
Thread.sleep(Long.MAX_VALUE)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.github.drunlin.webappbox.fragment

import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import com.github.drunlin.webappbox.activity.WebappContextActivity
import com.github.drunlin.webappbox.common.show
import com.github.drunlin.webappbox.fragmentManager
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class IconLoaderFragmentTest {
@Rule @JvmField val rule = ActivityTestRule(WebappContextActivity::class.java)

@Before
fun setUp() {
IconLoaderFragment().show(rule.fragmentManager)
}

@Test
fun start() {
Thread.sleep(Long.MAX_VALUE)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.github.drunlin.webappbox.fragment

import android.support.test.rule.ActivityTestRule
import android.support.test.runner.AndroidJUnit4
import com.github.drunlin.webappbox.activity.FragmentActivity
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(AndroidJUnit4::class)
class LicensesFragmentTest {
@Rule @JvmField val rule = ActivityTestRule(FragmentActivity::class.java)

@Before
fun setUp() {
rule.activity.setContentFragment(LicensesFragment())
}

@Test
fun start() {
Thread.sleep(Long.MAX_VALUE)
}
}
Loading

0 comments on commit d8cc48f

Please sign in to comment.