Skip to content

Commit

Permalink
update module package
Browse files Browse the repository at this point in the history
  • Loading branch information
sakacyber committed Jun 19, 2021
1 parent bd29485 commit 1611c83
Show file tree
Hide file tree
Showing 17 changed files with 131 additions and 14 deletions.
1 change: 1 addition & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.github.dcendents.android-maven'
}

group = 'com.github.sakacyber'
version = '0.1.0'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
Expand Down
1 change: 1 addition & 0 deletions library/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
48 changes: 48 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'com.github.dcendents.android-maven'
}

group = 'com.github.sakacyber'
version = '0.1.0'

android {
compileSdkVersion 30
buildToolsVersion "30.0.3"

defaultConfig {
minSdkVersion 23
targetSdkVersion 30
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

dependencies {

implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
Empty file added library/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions library/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package kh.com.labhouse.library

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("kh.com.labhouse.library.test", appContext.packageName)
}
}
5 changes: 5 additions & 0 deletions library/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="kh.com.labhouse.library">

</manifest>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kh.com.labhouse.constraintcardview.widget;
package kh.com.labhouse.library;

import android.content.Context;
import android.content.res.ColorStateList;
Expand All @@ -15,7 +15,9 @@
import androidx.annotation.Px;
import androidx.constraintlayout.widget.ConstraintLayout;

import kh.com.labhouse.constraintcardview.R;
import kh.com.labhouse.library.widget.CardViewApi21Impl;
import kh.com.labhouse.library.widget.CardViewDelegate;
import kh.com.labhouse.library.widget.CardViewImpl;

public class ConstrainCardView extends ConstraintLayout {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package kh.com.labhouse.constraintcardview.widget;
package kh.com.labhouse.library.widget;

import android.content.Context;
import android.content.res.ColorStateList;
import android.view.View;

import androidx.annotation.Nullable;

class CardViewApi21Impl implements CardViewImpl {
public class CardViewApi21Impl implements CardViewImpl {

@Override
public void initialize(CardViewDelegate cardView, Context context,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package kh.com.labhouse.constraintcardview.widget;
package kh.com.labhouse.library.widget;

import android.graphics.drawable.Drawable;
import android.view.View;

interface CardViewDelegate {
public interface CardViewDelegate {
void setCardBackground(Drawable drawable);
Drawable getCardBackground();
boolean getUseCompatPadding();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kh.com.labhouse.constraintcardview.widget
package kh.com.labhouse.library.widget

import android.content.Context
import android.content.res.ColorStateList
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kh.com.labhouse.constraintcardview.widget;
package kh.com.labhouse.library.widget;

import android.content.res.ColorStateList;
import android.graphics.Canvas;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package kh.com.labhouse.constraintcardview.widget;
package kh.com.labhouse.library.widget;

import android.content.res.ColorStateList;
import android.content.res.Resources;
Expand All @@ -17,7 +17,8 @@

import androidx.annotation.Nullable;

import kh.com.labhouse.constraintcardview.R;
import kh.com.labhouse.library.R;


class RoundRectDrawableWithShadow extends Drawable {

Expand Down
File renamed without changes.
17 changes: 17 additions & 0 deletions library/src/test/java/kh/com/labhouse/library/ExampleUnitTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package kh.com.labhouse.library

import org.junit.Test

import org.junit.Assert.*

/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
rootProject.name = "ConstraintCardView"
include ':app'
include ':library'

0 comments on commit 1611c83

Please sign in to comment.