Skip to content

Commit e473cfb

Browse files
committed
Issue mozilla-mobile#49: Add simple browser sample project.
1 parent b212531 commit e473cfb

File tree

13 files changed

+122
-0
lines changed

13 files changed

+122
-0
lines changed

samples/browser/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

samples/browser/build.gradle

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
apply plugin: 'com.android.application'
6+
apply plugin: 'kotlin-android'
7+
apply plugin: 'kotlin-android-extensions'
8+
9+
android {
10+
compileSdkVersion rootProject.ext.build['compileSdkVersion']
11+
12+
defaultConfig {
13+
applicationId "org.mozilla.samples.browser"
14+
minSdkVersion rootProject.ext.build['minSdkVersion']
15+
targetSdkVersion rootProject.ext.build['targetSdkVersion']
16+
versionCode 1
17+
versionName "1.0"
18+
19+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
20+
}
21+
22+
buildTypes {
23+
release {
24+
minifyEnabled false
25+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26+
}
27+
}
28+
29+
}
30+
31+
dependencies {
32+
implementation "org.jetbrains.kotlin:kotlin-stdlib:${rootProject.ext.dependencies['kotlin']}"
33+
34+
implementation "com.android.support:appcompat-v7:${rootProject.ext.dependencies['supportLibraries']}"
35+
}

samples/browser/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- This Source Code Form is subject to the terms of the Mozilla Public
3+
- License, v. 2.0. If a copy of the MPL was not distributed with this
4+
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
6+
package="org.mozilla.samples.browser">
7+
8+
<application
9+
android:allowBackup="true"
10+
android:icon="@mipmap/ic_launcher"
11+
android:label="@string/app_name"
12+
android:supportsRtl="true"
13+
android:theme="@style/Theme.AppCompat.Light">
14+
<activity android:name=".MainActivity">
15+
<intent-filter>
16+
<action android:name="android.intent.action.MAIN" />
17+
18+
<category android:name="android.intent.category.LAUNCHER" />
19+
</intent-filter>
20+
</activity>
21+
</application>
22+
23+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* This Source Code Form is subject to the terms of the Mozilla Public
2+
* License, v. 2.0. If a copy of the MPL was not distributed with this
3+
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4+
5+
package org.mozilla.samples.browser
6+
7+
import android.support.v7.app.AppCompatActivity
8+
import android.os.Bundle
9+
10+
class MainActivity : AppCompatActivity() {
11+
12+
override fun onCreate(savedInstanceState: Bundle?) {
13+
super.onCreate(savedInstanceState)
14+
setContentView(R.layout.activity_main)
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- This Source Code Form is subject to the terms of the Mozilla Public
3+
- License, v. 2.0. If a copy of the MPL was not distributed with this
4+
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
6+
xmlns:tools="http://schemas.android.com/tools"
7+
android:layout_width="match_parent"
8+
android:layout_height="match_parent"
9+
tools:context=".MainActivity">
10+
11+
</FrameLayout>
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- This Source Code Form is subject to the terms of the Mozilla Public
3+
- License, v. 2.0. If a copy of the MPL was not distributed with this
4+
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
5+
<resources>
6+
<string name="app_name">Sample Browser</string>
7+
</resources>

settings.gradle

+8
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ project(':support-ktx').projectDir = new File(rootDir, 'components/support/ktx')
4343

4444
include ':support-utils'
4545
project(':support-utils').projectDir = new File(rootDir, 'components/support/utils')
46+
47+
////////////////////////////////////////////////////////////////////////////////////////////////////
48+
// Samples
49+
////////////////////////////////////////////////////////////////////////////////////////////////////
50+
51+
include ':samples-browser'
52+
project(':samples-browser').projectDir = new File(rootDir, 'samples/browser')
53+

0 commit comments

Comments
 (0)