Skip to content

Commit

Permalink
fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cinkhangin committed Oct 2, 2022
1 parent af3645d commit 214d37f
Show file tree
Hide file tree
Showing 6 changed files with 310 additions and 225 deletions.
9 changes: 9 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

buildFeatures {
viewBinding true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}
Expand All @@ -42,4 +48,7 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':zawni')
}
20 changes: 19 additions & 1 deletion app/src/main/java/com/naulian/zawni/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,28 @@ package com.naulian.zawni

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.core.widget.addTextChangedListener
import com.naulian.zawni.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

private var viewBinding : ActivityMainBinding? = null
private val binding get() = viewBinding!!

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)

Zawni.initialize(this)
viewBinding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)

binding.apply {
edtInput.addTextChangedListener {
it?.let {
val text = it.toString().zawnify()
txtOutput.text = text
}
}
}
}
}
60 changes: 53 additions & 7 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,59 @@
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
<com.google.android.material.card.MaterialCardView
android:id="@+id/crdInput"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp"
android:layout_width="match_parent"
android:layout_height="0dp"
app:cardCornerRadius="12dp"
app:cardElevation="6dp"
app:layout_constraintBottom_toTopOf="@+id/spc"
app:layout_constraintTop_toTopOf="parent">

<com.google.android.material.textfield.TextInputEditText
android:id="@+id/edtInput"
android:layout_width="match_parent"
android:hint="@string/app_name"
android:gravity="top"
android:padding="12dp"
android:background="@color/white"
android:layout_height="match_parent"/>
</com.google.android.material.card.MaterialCardView>

<Space
android:id="@+id/spc"
android:layout_width="match_parent"
android:layout_height="16dp"
app:layout_constraintBottom_toTopOf="@+id/crdOutput"
app:layout_constraintTop_toBottomOf="@+id/crdInput" />

<com.google.android.material.card.MaterialCardView
android:id="@+id/crdOutput"
app:cardElevation="6dp"
app:cardCornerRadius="12dp"
android:layout_marginBottom="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_width="match_parent"
android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
app:layout_constraintTop_toBottomOf="@+id/spc">

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">

<TextView
android:id="@+id/txtOutput"
android:padding="12dp"
android:gravity="top"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>

</ScrollView>
</com.google.android.material.card.MaterialCardView>

</androidx.constraintlayout.widget.ConstraintLayout>
8 changes: 2 additions & 6 deletions zawni/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@ android {
}

dependencies {
implementation 'com.google.myanmartools:myanmar-tools:1.1.3'

implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'

//test
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

afterEvaluate {
Expand All @@ -49,7 +45,7 @@ afterEvaluate {

groupId = 'com.github.cinkhangin'
artifactId = 'zawni'
version = '0.0.2-beta'
version = '0.0.5-beta'
}
}
}
Expand Down
Loading

0 comments on commit 214d37f

Please sign in to comment.