Skip to content

Commit 4b66dfb

Browse files
committed
Initial commit.
0 parents  commit 4b66dfb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+3133
-0
lines changed

.gitignore

+16
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+
app/release

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSE

+661
Large diffs are not rendered by default.

app/.gitignore

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

app/build.gradle

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'org.jetbrains.kotlin.android'
4+
}
5+
6+
android {
7+
compileSdk 31
8+
9+
defaultConfig {
10+
applicationId "com.jerboa"
11+
minSdk 26
12+
targetSdk 31
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
vectorDrawables {
18+
useSupportLibrary true
19+
}
20+
}
21+
22+
buildTypes {
23+
release {
24+
minifyEnabled false
25+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
26+
}
27+
}
28+
compileOptions {
29+
sourceCompatibility JavaVersion.VERSION_1_8
30+
targetCompatibility JavaVersion.VERSION_1_8
31+
}
32+
kotlinOptions {
33+
jvmTarget = '1.8'
34+
}
35+
buildFeatures {
36+
compose true
37+
}
38+
composeOptions {
39+
kotlinCompilerExtensionVersion compose_version
40+
}
41+
packagingOptions {
42+
resources {
43+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
44+
}
45+
}
46+
}
47+
48+
dependencies {
49+
50+
implementation "com.squareup.retrofit2:retrofit:2.9.0"
51+
implementation "com.squareup.retrofit2:retrofit:2.9.0"
52+
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
53+
implementation 'androidx.core:core-ktx:1.7.0'
54+
implementation "androidx.compose.ui:ui:$compose_version"
55+
implementation "androidx.compose.material:material:$compose_version"
56+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
57+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
58+
implementation 'androidx.activity:activity-compose:1.4.0'
59+
testImplementation 'junit:junit:4.13.2'
60+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
61+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
62+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
63+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
64+
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
65+
}

app/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,24 @@
1+
package com.jerboa
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.jerboa", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools"
4+
package="com.jerboa">
5+
6+
<uses-permission android:name="android.permission.INTERNET" />
7+
8+
9+
<application
10+
android:allowBackup="true"
11+
android:dataExtractionRules="@xml/data_extraction_rules"
12+
android:fullBackupContent="@xml/backup_rules"
13+
android:icon="@mipmap/ic_launcher"
14+
android:label="@string/app_name"
15+
android:roundIcon="@mipmap/ic_launcher_round"
16+
android:supportsRtl="true"
17+
android:theme="@style/Theme.Jerboa"
18+
tools:targetApi="31">
19+
20+
<activity
21+
android:name=".MainActivity"
22+
android:exported="true"
23+
android:theme="@style/Theme.Jerboa">
24+
<intent-filter>
25+
<action android:name="android.intent.action.MAIN" />
26+
27+
<category android:name="android.intent.category.LAUNCHER" />
28+
</intent-filter>
29+
</activity>
30+
</application>
31+
32+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.jerboa
2+
3+
import android.os.Bundle
4+
import androidx.activity.ComponentActivity
5+
import androidx.activity.compose.setContent
6+
import androidx.compose.foundation.layout.fillMaxSize
7+
import androidx.compose.material.MaterialTheme
8+
import androidx.compose.material.Surface
9+
import androidx.compose.material.Text
10+
import androidx.compose.runtime.Composable
11+
import androidx.compose.ui.Modifier
12+
import androidx.compose.ui.tooling.preview.Preview
13+
import com.jerboa.ui.theme.JerboaTheme
14+
15+
class MainActivity : ComponentActivity() {
16+
override fun onCreate(savedInstanceState: Bundle?) {
17+
super.onCreate(savedInstanceState)
18+
setContent {
19+
JerboaTheme {
20+
// A surface container using the 'background' color from the theme
21+
Surface(modifier = Modifier.fillMaxSize(), color = MaterialTheme.colors.background) {
22+
Greeting("Android")
23+
}
24+
}
25+
}
26+
}
27+
}
28+
29+
@Composable
30+
fun Greeting(name: String) {
31+
Text(text = "Hello $name!")
32+
}
33+
34+
@Preview(showBackground = true)
35+
@Composable
36+
fun DefaultPreview() {
37+
JerboaTheme {
38+
Greeting("Android")
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
package com.jerboa.datatypes
2+
3+
/**
4+
* Aggregate data for a person.
5+
*/
6+
data class PersonAggregates(
7+
val id: Int,
8+
val person_id: Int,
9+
val post_count: Int,
10+
val post_score: Int,
11+
val comment_count: Int,
12+
val comment_score: Int,
13+
)
14+
15+
/**
16+
* Aggregate data for your site.
17+
*/
18+
data class SiteAggregates(
19+
val id: Int,
20+
val site_id: Int,
21+
val users: Int,
22+
val posts: Int,
23+
val comments: Int,
24+
val communities: Int,
25+
/**
26+
* Active users per day.
27+
*/
28+
val users_active_day: Int,
29+
/**
30+
* Active users per week.
31+
*/
32+
val users_active_week: Int,
33+
/**
34+
* Active users per month.
35+
*/
36+
val users_active_month: Int,
37+
/**
38+
* Active users per year.
39+
*/
40+
val users_active_half_year: Int,
41+
)
42+
43+
/**
44+
* Aggregate data for your post.
45+
*/
46+
data class PostAggregates(
47+
val id: Int,
48+
val post_id: Int,
49+
val comments: Int,
50+
val score: Int,
51+
val upvotes: Int,
52+
val downvotes: Int,
53+
/**
54+
* Newest comment time, limited to 2 days, to prevent necrobumping.
55+
*/
56+
val newest_comment_time_necro: String,
57+
val newest_comment_time: String,
58+
)
59+
60+
/**
61+
* Aggregate data for your community.
62+
*/
63+
data class CommunityAggregates(
64+
val id: Int,
65+
val community_id: Int,
66+
val subscribers: Int,
67+
val posts: Int,
68+
val comments: Int,
69+
/**
70+
* Active users per day.
71+
*/
72+
val users_active_day: Int,
73+
/**
74+
* Active users per week.
75+
*/
76+
val users_active_week: Int,
77+
/**
78+
* Active users per month.
79+
*/
80+
val users_active_month: Int,
81+
/**
82+
* Active users per year.
83+
*/
84+
val users_active_half_year: Int,
85+
)
86+
87+
/**
88+
* Aggregate data for your comment.
89+
*/
90+
data class CommentAggregates(
91+
val id: Int,
92+
val comment_id: Int,
93+
val score: Int,
94+
val upvotes: Int,
95+
val downvotes: Int,
96+
)

0 commit comments

Comments
 (0)