Skip to content
This repository was archived by the owner on Apr 19, 2022. It is now read-only.

Commit 5930149

Browse files
committed
Initial Commit
0 parents  commit 5930149

File tree

22 files changed

+1197
-0
lines changed

22 files changed

+1197
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/android.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: set up JDK 1.8
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 1.8
20+
- name: Make gradlew executable
21+
run: chmod +x ./gradlew
22+
- name: Build with Gradle
23+
run: ./gradlew build

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.idea
2+
*.iml
3+
.gradle
4+
/local.properties
5+
/.idea/workspace.xml
6+
/.idea/libraries
7+
.DS_Store
8+
/build
9+
/captures

.gitlab-ci.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
image: sandrios/gitlab-ci-android
2+
3+
stages:
4+
- build
5+
6+
before_script:
7+
- export GRADLE_USER_HOME=$(pwd)/.gradle
8+
- chmod +x ./gradlew
9+
10+
cache:
11+
key: ${CI_PROJECT_ID}
12+
paths:
13+
- .gradle/
14+
15+
build:
16+
stage: build
17+
script:
18+
- ./gradlew assembleDebug
19+
artifacts:
20+
paths:
21+
- app/build/outputs/apk/app-debug.apk
22+
expire_in: 1 second
23+
when: always

CodeView/.gitignore

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

CodeView/build.gradle

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apply plugin: 'com.android.library'
2+
apply plugin: 'kotlin-android'
3+
4+
android {
5+
compileSdkVersion 30
6+
7+
defaultConfig {
8+
minSdkVersion 15
9+
targetSdkVersion 30
10+
versionCode 6
11+
versionName "1.0.0"
12+
}
13+
14+
buildFeatures {
15+
viewBinding true
16+
}
17+
18+
buildTypes {
19+
release {
20+
minifyEnabled false
21+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
22+
}
23+
}
24+
25+
dependencies {
26+
implementation 'androidx.recyclerview:recyclerview:1.1.0'
27+
}
28+
}

CodeView/proguard-rules.pro

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/hanks/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="org.bandev.libraries">
3+
4+
<application
5+
android:label="@string/app_name">
6+
7+
</application>
8+
9+
</manifest>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package me.jackdevey.libraries.codeview
2+
3+
import android.content.Context
4+
import android.graphics.Canvas
5+
import android.util.AttributeSet
6+
import androidx.recyclerview.widget.LinearLayoutManager
7+
import androidx.recyclerview.widget.RecyclerView
8+
9+
class CodeView : RecyclerView {
10+
11+
constructor(context: Context) : super(context)
12+
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
13+
constructor(context: Context, attrs: AttributeSet?, defStyle: Int) : super(context, attrs, defStyle)
14+
15+
var fontSize: Float = 14f
16+
var code: String = "No code provided"
17+
18+
fun show() {
19+
val data : MutableList<Line> = mutableListOf()
20+
for ((i, line) in code.lines().withIndex()) {
21+
data.add(Line(i, line))
22+
}
23+
this.adapter = LineAdapter(data, fontSize)
24+
this.layoutManager = LinearLayoutManager(context)
25+
}
26+
27+
override fun onDraw(canvas: Canvas) {
28+
super.onDraw(canvas)
29+
}
30+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package me.jackdevey.libraries.codeview
2+
3+
data class Line(val lineNumber: Int, val lineText: String)

0 commit comments

Comments
 (0)