Skip to content

Commit c4949f2

Browse files
committed
Initial commit
0 parents  commit c4949f2

24 files changed

+679
-0
lines changed

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
/.idea/

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
plugins {
2+
id 'com.android.application'
3+
}
4+
5+
android {
6+
namespace 'oui.template.java' /*TODO: change packageName*/
7+
compileSdk 33
8+
9+
defaultConfig {
10+
applicationId "oui.template.java" /*TODO: change packageName*/
11+
minSdk 26
12+
targetSdk 33
13+
versionCode 1
14+
versionName "1.0.0"
15+
16+
resConfigs 'en' /*TODO: add supported languages*/
17+
18+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
19+
}
20+
21+
buildTypes {
22+
release {
23+
minifyEnabled true
24+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
25+
}
26+
}
27+
compileOptions {
28+
sourceCompatibility JavaVersion.VERSION_1_8
29+
targetCompatibility JavaVersion.VERSION_1_8
30+
}
31+
}
32+
33+
configurations.all {
34+
exclude group: 'androidx.appcompat', module: 'appcompat'
35+
exclude group: 'androidx.core', module: 'core'
36+
exclude group: 'androidx.drawerlayout', module: 'drawerlayout'
37+
exclude group: 'androidx.viewpager', module: 'viewpager'
38+
exclude group: 'androidx.fragment', module: 'fragment'
39+
exclude group: 'androidx.customview', module: 'customview'
40+
exclude group: 'androidx.coordinatorlayout', module: 'coordinatorlayout'
41+
exclude group: 'com.android.support', module: 'support-compat'
42+
}
43+
44+
dependencies {
45+
implementation 'io.github.oneuiproject:design:1.2.3'
46+
implementation 'io.github.oneuiproject:icons:1.0.1'
47+
implementation 'io.github.oneuiproject.sesl:appcompat:1.3.0'
48+
implementation 'io.github.oneuiproject.sesl:material:1.4.0'
49+
implementation 'io.github.oneuiproject.sesl:recyclerview:1.3.0'
50+
implementation 'io.github.oneuiproject.sesl:preference:1.1.0'
51+
/*TODO: add/update/remove libraries*/
52+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
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

app/src/main/AndroidManifest.xml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<application
5+
android:allowBackup="true"
6+
android:icon="@mipmap/ic_launcher"
7+
android:label="@string/app_name"
8+
android:supportsRtl="true"
9+
android:theme="@style/OneUITheme">
10+
11+
<meta-data
12+
android:name="SamsungBasicInteraction"
13+
android:value="SEP10" />
14+
<meta-data
15+
android:name="com.samsung.android.icon_container.has_icon_container"
16+
android:value="true" />
17+
<meta-data
18+
android:name="com.samsung.android.icon_container.feature_appicon"
19+
android:value="ADAPTIVEICON_SHADOW" />
20+
<meta-data
21+
android:name="theming-meta"
22+
android:value="meta_998_sesl_app" />
23+
<meta-data
24+
android:name="theming-meta-xml"
25+
android:value="@xml/meta_998_sesl_app" />
26+
27+
<activity
28+
android:name=".MainActivity"
29+
android:exported="true">
30+
<meta-data
31+
android:name="com.sec.android.app.launcher.icon_theme"
32+
android:value="themeColor" />
33+
34+
<intent-filter>
35+
<action android:name="android.intent.action.MAIN" />
36+
37+
<category android:name="android.intent.category.LAUNCHER" />
38+
</intent-filter>
39+
</activity>
40+
41+
<activity
42+
android:name=".AboutActivity"
43+
android:exported="false" />
44+
45+
</application>
46+
47+
</manifest>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package oui.template.java;
2+
3+
import android.os.Bundle;
4+
5+
import androidx.appcompat.app.AppCompatActivity;
6+
7+
public class AboutActivity extends AppCompatActivity {
8+
9+
@Override
10+
protected void onCreate(Bundle savedInstanceState) {
11+
super.onCreate(savedInstanceState);
12+
setContentView(R.layout.activity_about);
13+
}
14+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package oui.template.java;
2+
3+
import android.content.Intent;
4+
import android.os.Bundle;
5+
import android.view.Menu;
6+
import android.view.MenuItem;
7+
8+
import androidx.annotation.NonNull;
9+
import androidx.appcompat.app.AppCompatActivity;
10+
11+
import dev.oneuiproject.oneui.layout.ToolbarLayout;
12+
import dev.oneuiproject.oneui.utils.ActivityUtils;
13+
14+
public class MainActivity extends AppCompatActivity {
15+
16+
@Override
17+
protected void onCreate(Bundle savedInstanceState) {
18+
super.onCreate(savedInstanceState);
19+
setContentView(R.layout.activity_main);
20+
21+
ToolbarLayout toolbarLayout = findViewById(R.id.toolbar_layout);
22+
toolbarLayout.setNavigationButtonAsBack();
23+
24+
/*TODO:
25+
* - change packageName and name
26+
* - check other TODOs
27+
* */
28+
}
29+
30+
@Override
31+
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
32+
getMenuInflater().inflate(R.menu.main_menu, menu);
33+
return true;
34+
}
35+
36+
@Override
37+
public boolean onOptionsItemSelected(MenuItem item) {
38+
if (item.getItemId() == R.id.menu_app_info) {
39+
ActivityUtils.startPopOverActivity(this,
40+
new Intent(this, AboutActivity.class),
41+
null,
42+
ActivityUtils.POP_OVER_POSITION_RIGHT | ActivityUtils.POP_OVER_POSITION_TOP);
43+
return true;
44+
}
45+
return false;
46+
}
47+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
xmlns:aapt="http://schemas.android.com/aapt"
3+
android:width="108dp"
4+
android:height="108dp"
5+
android:viewportWidth="108"
6+
android:viewportHeight="108">
7+
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
8+
<aapt:attr name="android:fillColor">
9+
<gradient
10+
android:endX="85.84757"
11+
android:endY="92.4963"
12+
android:startX="42.9492"
13+
android:startY="49.59793"
14+
android:type="linear">
15+
<item
16+
android:color="#44000000"
17+
android:offset="0.0" />
18+
<item
19+
android:color="#00000000"
20+
android:offset="1.0" />
21+
</gradient>
22+
</aapt:attr>
23+
</path>
24+
<path
25+
android:fillColor="#FFFFFF"
26+
android:fillType="nonZero"
27+
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
28+
android:strokeWidth="1"
29+
android:strokeColor="#00000000" />
30+
</vector>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2+
android:width="108dp"
3+
android:height="108dp"
4+
android:viewportWidth="108"
5+
android:viewportHeight="108">
6+
<path
7+
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
8+
android:strokeWidth="5"
9+
android:strokeColor="#000000" />
10+
</vector>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<dev.oneuiproject.oneui.layout.AppInfoLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:id="@+id/app_info_layout"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent">
6+
7+
<androidx.appcompat.widget.AppCompatButton
8+
android:id="@+id/about_source_code"
9+
style="@style/OneUI.AppInfoButton"
10+
android:text="Button 1" />
11+
12+
<androidx.appcompat.widget.AppCompatButton
13+
android:id="@+id/about_donate"
14+
style="@style/OneUI.AppInfoButton"
15+
android:text="Button 2" />
16+
17+
</dev.oneuiproject.oneui.layout.AppInfoLayout>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<dev.oneuiproject.oneui.layout.ToolbarLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:id="@+id/toolbar_layout"
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
app:expandable="true"
9+
app:expanded="true"
10+
app:subtitle="subtitle"
11+
app:title="@string/app_name"
12+
tools:context=".MainActivity">
13+
14+
<androidx.core.widget.NestedScrollView
15+
android:layout_width="match_parent"
16+
android:layout_height="match_parent"
17+
android:background="@color/oui_background_color"
18+
app:layout_location="main_content">
19+
20+
<LinearLayout
21+
android:layout_width="match_parent"
22+
android:layout_height="match_parent"
23+
android:orientation="vertical">
24+
25+
<TextView
26+
android:layout_width="match_parent"
27+
android:layout_height="wrap_content"
28+
android:gravity="center"
29+
android:text="Hello World!" />
30+
31+
</LinearLayout>
32+
33+
</androidx.core.widget.NestedScrollView>
34+
35+
</dev.oneuiproject.oneui.layout.ToolbarLayout>

app/src/main/res/menu/main_menu.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools">
5+
<item
6+
android:id="@+id/menu_app_info"
7+
android:icon="@drawable/ic_oui_ab_app_info"
8+
android:title="About"
9+
app:showAsAction="ifRoom"
10+
tools:ignore="AppCompatResource" />
11+
<item
12+
android:title="Menu Item 1"
13+
app:showAsAction="never"
14+
tools:ignore="AppCompatResource" />
15+
<item
16+
android:title="Menu Item 2"
17+
app:showAsAction="never"
18+
tools:ignore="AppCompatResource" />
19+
</menu>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
3+
<background android:drawable="@color/ic_launcher_background" />
4+
<foreground android:drawable="@drawable/ic_launcher_foreground" />
5+
<monochrome android:drawable="@drawable/ic_launcher_monochrome" />
6+
</adaptive-icon>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!--TODO: delete this file if not wanted-->
4+
<color name="sesl_round_and_bgcolor_light">@android:color/system_neutral1_50</color>
5+
<color name="sesl_action_bar_background_color_light">@color/sesl_round_and_bgcolor_light</color>
6+
<color name="sesl_primary_color_light">@android:color/system_accent1_300</color>
7+
<color name="sesl_primary_dark_color_light">@android:color/system_accent1_600</color>
8+
9+
<color name="sesl_round_and_bgcolor_dark">@android:color/system_neutral1_900</color>
10+
<color name="sesl_action_bar_background_color_dark">@color/sesl_round_and_bgcolor_dark</color>
11+
<color name="sesl_primary_color_dark">@android:color/system_accent1_400</color>
12+
<color name="sesl_primary_dark_color_dark">@android:color/system_accent1_400</color>
13+
</resources>

app/src/main/res/values/colors.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ic_launcher_background">#0072DE</color>
4+
</resources>

app/src/main/res/values/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<resources>
2+
<string name="app_name">template-java</string> <!--TODO: change name-->
3+
</resources>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ThemeMetaData
3+
FormatVersion="1.3"
4+
GuideVersion="1.4">
5+
<!--TODO: change packageName and name-->
6+
<AppMetaData
7+
Name="template-java"
8+
TargetApi="21"
9+
TargetPackageName="oui.template.java"
10+
VersionCode="1"
11+
VersionName="">
12+
<Include RefName="SESL" />
13+
<Property
14+
Comment="Icon and text color"
15+
DestAttribName="oui_primary_text_color, oui_primary_icon_color, oui_appinfolayout_info_text_color, oui_drawerlayout_header_icon_color"
16+
UID="1000_1"
17+
ValueRef="1-11-3"
18+
ValueType="TintColor" />
19+
</AppMetaData>
20+
</ThemeMetaData>

build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
plugins {
3+
id 'com.android.application' version '7.3.1' apply false
4+
id 'com.android.library' version '7.3.1' apply false
5+
}

0 commit comments

Comments
 (0)