Skip to content

Commit

Permalink
wip:
Browse files Browse the repository at this point in the history
  • Loading branch information
steadymoka committed Oct 14, 2019
1 parent 21fb554 commit 87d897c
Show file tree
Hide file tree
Showing 245 changed files with 5,089 additions and 23 deletions.
33 changes: 17 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-kapt"
apply plugin: "androidx.navigation.safeargs.kotlin"

android {
compileSdkVersion 29
Expand All @@ -24,7 +24,7 @@ android {
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
}
}
}
Expand All @@ -36,26 +36,27 @@ kotlin {
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation project(':res')
implementation project(":res")
implementation project(":dialog")

/* Android X */
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
implementation "androidx.appcompat:appcompat:1.1.0"
implementation "androidx.multidex:multidex:2.0.1"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation "androidx.constraintlayout:constraintlayout:2.0.0-beta2"
implementation "androidx.core:core-ktx:1.1.0"
implementation "androidx.work:work-runtime-ktx:2.2.0"
implementation "androidx.navigation:navigation-fragment-ktx:2.2.0-alpha02"
implementation "androidx.navigation:navigation-ui-ktx:2.2.0-alpha02"
implementation "androidx.navigation:navigation-fragment-ktx:2.2.0-beta01"
implementation "androidx.navigation:navigation-ui-ktx:2.2.0-beta01"
implementation "androidx.lifecycle:lifecycle-extensions:2.1.0"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-alpha04"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.2.0-beta01"
kapt "androidx.lifecycle:lifecycle-compiler:2.1.0"

implementation 'com.google.android.material:material:1.0.0'
implementation "com.google.android.material:material:1.0.0"

/* Koin */
implementation "org.koin:koin-androidx-viewmodel:1.0.2"
Expand Down
26 changes: 25 additions & 1 deletion app/src/main/java/moka/land/app/main/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
package moka.land.app.main

import androidx.appcompat.app.AppCompatActivity
import android.content.DialogInterface.BUTTON_POSITIVE
import android.os.Bundle
import android.view.LayoutInflater
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.LayoutInflaterCompat
import land.moka.dialog.LoadingDialog
import land.moka.dialog.TitleDialog
import moka.land.R

class MainActivity : AppCompatActivity() {

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

findViewById<TextView>(R.id.textView01).setOnClickListener {
TitleDialog(this)
.apply {
setCustomTitle(LayoutInflater.from(this@MainActivity).inflate(R.layout.dialog_test, null))
// setTitle("Test")
// setMessage("Test")
setButton(BUTTON_POSITIVE, "OK") { dialogInterface, i ->

}
}
.show()
}

findViewById<TextView>(R.id.textView02).setOnClickListener {
LoadingDialog().show(supportFragmentManager)
}
}

}
11 changes: 10 additions & 1 deletion app/src/main/java/moka/land/model/entity/User.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
package moka.land.model.entity

data class User(var id: String)
import androidx.room.Entity
import androidx.room.PrimaryKey

@Entity(tableName = "user")
data class User(

@PrimaryKey
var id: String

)
15 changes: 11 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
android:layout_height="match_parent">

<TextView
android:id="@+id/textView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World! 03"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="Hello World! 03 TitleDialog"
android:textColor="@color/black_03"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
Expand All @@ -22,7 +23,9 @@
android:id="@+id/textView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World! 04"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="Hello World! 04 LoadingDialog"
android:textColor="@color/black_04"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
Expand All @@ -32,6 +35,8 @@
android:id="@+id/textView03"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="Hello World! 05"
android:textColor="@color/black_05"
app:layout_constraintLeft_toLeftOf="parent"
Expand All @@ -42,6 +47,8 @@
android:id="@+id/textView04"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="Hello World! 06"
android:textColor="@color/black_06"
app:layout_constraintLeft_toLeftOf="parent"
Expand Down
56 changes: 56 additions & 0 deletions app/src/main/res/layout/dialog_test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<EditText
android:id="@+id/editText_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="12dp"
android:layout_marginRight="16dp"
android:layout_marginBottom="12dp"
android:background="@color/white_01"
android:elevation="3px"
android:hint="입력해주세요"
android:paddingLeft="16dp"
android:paddingTop="10dp"
android:paddingRight="16dp"
android:paddingBottom="10dp"
android:textColorHint="@color/black_09"
android:textSize="13dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/textView_dream"
android:layout_width="0dp"
android:layout_height="52dp"
android:layout_weight="1"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:gravity="center_vertical"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:text="목표 수정하기"
android:textColor="#FF808080"
android:textSize="13dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/editText_text" />

<View
android:id="@+id/view_divider01"
style="@style/HorizontalDivider"
android:layout_width="0dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:alpha="0.8"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView_dream" />

</androidx.constraintlayout.widget.ConstraintLayout>
42 changes: 42 additions & 0 deletions dialog/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"

defaultConfig {
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

dataBinding {
enabled = true
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

implementation project(":res")

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation "androidx.constraintlayout:constraintlayout:2.0.0-beta2"
implementation "com.android.support.constraint:constraint-layout:2.0.0-beta2"
implementation "com.airbnb.android:lottie:3.0.7"

}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
o/jetified-full.jar
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
o/jetified-full
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Generated by data binding compiler. Do not edit!
package land.moka.dialog.databinding;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import com.airbnb.lottie.LottieAnimationView;
import java.lang.Deprecated;
import java.lang.Object;
import land.moka.dialog.R;

public abstract class LayoutLoadingDialogBinding extends ViewDataBinding {
@NonNull
public final LottieAnimationView loading;

protected LayoutLoadingDialogBinding(Object _bindingComponent, View _root, int _localFieldCount,
LottieAnimationView loading) {
super(_bindingComponent, _root, _localFieldCount);
this.loading = loading;
}

@NonNull
public static LayoutLoadingDialogBinding inflate(@NonNull LayoutInflater inflater,
@Nullable ViewGroup root, boolean attachToRoot) {
return inflate(inflater, root, attachToRoot, DataBindingUtil.getDefaultComponent());
}

/**
* This method receives DataBindingComponent instance as type Object instead of
* type DataBindingComponent to avoid causing too many compilation errors if
* compilation fails for another reason.
* https://issuetracker.google.com/issues/116541301
* @Deprecated Use DataBindingUtil.inflate(inflater, R.layout.layout_loading_dialog, root, attachToRoot, component)
*/
@NonNull
@Deprecated
public static LayoutLoadingDialogBinding inflate(@NonNull LayoutInflater inflater,
@Nullable ViewGroup root, boolean attachToRoot, @Nullable Object component) {
return ViewDataBinding.<LayoutLoadingDialogBinding>inflateInternal(inflater, R.layout.layout_loading_dialog, root, attachToRoot, component);
}

@NonNull
public static LayoutLoadingDialogBinding inflate(@NonNull LayoutInflater inflater) {
return inflate(inflater, DataBindingUtil.getDefaultComponent());
}

/**
* This method receives DataBindingComponent instance as type Object instead of
* type DataBindingComponent to avoid causing too many compilation errors if
* compilation fails for another reason.
* https://issuetracker.google.com/issues/116541301
* @Deprecated Use DataBindingUtil.inflate(inflater, R.layout.layout_loading_dialog, null, false, component)
*/
@NonNull
@Deprecated
public static LayoutLoadingDialogBinding inflate(@NonNull LayoutInflater inflater,
@Nullable Object component) {
return ViewDataBinding.<LayoutLoadingDialogBinding>inflateInternal(inflater, R.layout.layout_loading_dialog, null, false, component);
}

public static LayoutLoadingDialogBinding bind(@NonNull View view) {
return bind(view, DataBindingUtil.getDefaultComponent());
}

/**
* This method receives DataBindingComponent instance as type Object instead of
* type DataBindingComponent to avoid causing too many compilation errors if
* compilation fails for another reason.
* https://issuetracker.google.com/issues/116541301
* @Deprecated Use DataBindingUtil.bind(view, component)
*/
@Deprecated
public static LayoutLoadingDialogBinding bind(@NonNull View view, @Nullable Object component) {
return (LayoutLoadingDialogBinding)bind(component, view, R.layout.layout_loading_dialog);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Automatically generated file. DO NOT MODIFY
*/
package land.moka.dialog;

public final class BuildConfig {
public static final boolean DEBUG = Boolean.parseBoolean("true");
public static final String LIBRARY_PACKAGE_NAME = "land.moka.dialog";
/**
* @deprecated APPLICATION_ID is misleading in libraries. For the library package name use LIBRARY_PACKAGE_NAME
*/
@Deprecated
public static final String APPLICATION_ID = "land.moka.dialog";
public static final String BUILD_TYPE = "debug";
public static final String FLAVOR = "";
public static final int VERSION_CODE = 1;
public static final String VERSION_NAME = "1.0";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package land.moka.dialog;

import androidx.databinding.BindingBuildInfo;

@BindingBuildInfo
public class DataBindingInfo {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package androidx.databinding;

public interface DataBindingComponent {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package androidx.databinding.library.baseAdapters;

public class BR {
public static int _all = 0;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package land.moka.dialog;

public class BR {
public static int _all = 0;
}
Loading

0 comments on commit 87d897c

Please sign in to comment.