Skip to content

Commit af5311d

Browse files
committed
first commit
0 parents  commit af5311d

File tree

49 files changed

+1105
-0
lines changed

Some content is hidden

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

49 files changed

+1105
-0
lines changed

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# LinkTextView
2+
3+
![LinkTextView](https://i.ibb.co/HtKNSnB/linktextview.png)
4+
## Setup
5+
### Gradle
6+
7+
Add this to your project level `build.gradle`:
8+
```groovy
9+
allprojects {
10+
repositories {
11+
maven { url "https://jitpack.io" }
12+
}
13+
}
14+
```
15+
Add this to your app `build.gradle`:
16+
```groovy
17+
dependencies {
18+
implementation 'com.github.edtslib:linktextview:latest'
19+
}
20+
```
21+
# Usage
22+
23+
The SwipeBottomView is very easy to use. Just add it to your layout like any other view.
24+
##### Via XML
25+
26+
Here's a basic implementation.
27+
28+
```xml
29+
<id.co.edtslib.linktextview.LinkTextView
30+
app:linkColor="#ff0000"
31+
app:linkText="Syarat &amp; Ketentuan"
32+
android:layout_width="wrap_content"
33+
android:layout_height="wrap_content"
34+
android:text="Dengan melanjutkan, kamu menyetujui Syarat &amp; Ketentuan layanan di Aplikasi."
35+
app:layout_constraintBottom_toBottomOf="parent"
36+
app:layout_constraintLeft_toLeftOf="parent"
37+
app:layout_constraintRight_toRightOf="parent"
38+
app:layout_constraintTop_toTopOf="parent" />
39+
```
40+
### Attributes information
41+
42+
An example is shown below.
43+
44+
```xml
45+
app:linkColor="#ff0000"
46+
app:linkText="Syarat &amp; Ketentuan"
47+
```
48+
49+
##### _app:linkColor_
50+
[string]: color of link
51+
52+
##### _app:linkText_
53+
[reference]: the text to be in link
54+
55+
### Listener for click of text link
56+
```kotlin
57+
findViewById<LinkTextView>(R.id.textView).setOnClickListener {
58+
Toast.makeText(this, "Hello Link", Toast.LENGTH_SHORT).show()
59+
}
60+
```
61+
62+
63+
64+
65+

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: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id 'com.android.application'
3+
id 'kotlin-android'
4+
}
5+
6+
android {
7+
compileSdk 30
8+
9+
defaultConfig {
10+
applicationId "id.co.edtslib.linktextview.example"
11+
minSdk 21
12+
targetSdk 30
13+
versionCode 1
14+
versionName "1.0"
15+
16+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
}
29+
kotlinOptions {
30+
jvmTarget = '1.8'
31+
}
32+
}
33+
34+
dependencies {
35+
36+
implementation 'androidx.core:core-ktx:1.6.0'
37+
implementation 'androidx.appcompat:appcompat:1.3.1'
38+
implementation 'com.google.android.material:material:1.4.0'
39+
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
40+
implementation project(":linktextview")
41+
testImplementation 'junit:junit:4.+'
42+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
43+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
44+
}

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
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package id.co.edtslib.linktextview.example
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("id.co.edtslib.linktextview.example", appContext.packageName)
23+
}
24+
}

0 commit comments

Comments
 (0)