-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
apply plugin: 'com.android.application' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-android-extensions' | ||
|
||
android { | ||
compileSdkVersion 26 | ||
buildToolsVersion "$buildToolsVersionCode" | ||
defaultConfig { | ||
applicationId "core.mvp.kotlinandroid" | ||
minSdkVersion 21 | ||
targetSdkVersion 26 | ||
versionCode 1 | ||
versionName "1.0" | ||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" | ||
} | ||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(include: ['*.jar'], dir: 'libs') | ||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { | ||
exclude group: 'com.android.support', module: 'support-annotations' | ||
}) | ||
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" | ||
compile "com.android.support:appcompat-v7:$supportVersion" | ||
compile "com.android.support:support-compat:$supportVersion" | ||
compile "com.android.support:recyclerview-v7:$supportVersion" | ||
compile 'io.reactivex.rxjava2:rxandroid:2.0.1' | ||
compile 'io.reactivex.rxjava2:rxjava:2.0.1' | ||
compile 'com.squareup.retrofit2:adapter-rxjava2:2.2.0' | ||
compile 'com.squareup.retrofit2:retrofit:2.2.0' | ||
compile 'com.squareup.retrofit2:converter-gson:2.2.0' | ||
compile 'com.squareup.okhttp3:logging-interceptor:3.3.1' | ||
compile 'com.github.BondolTuon:TextViewUtilAndroid:1.0.3' | ||
compile 'com.github.bumptech.glide:glide:4.1.1' | ||
annotationProcessor 'com.github.bumptech.glide:compiler:4.1.1' | ||
testCompile 'junit:junit:4.12' | ||
compile project(':recyclerviewinfinitescroll') | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flags in this file are appended to flags specified | ||
# in /Users/tuonbondol/Library/Android/sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# 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,26 @@ | ||
package nanita.entr.android; | ||
|
||
import android.content.Context; | ||
import android.support.test.InstrumentationRegistry; | ||
import android.support.test.runner.AndroidJUnit4; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
/** | ||
* Instrumentation test, which will execute on an Android device. | ||
* | ||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
*/ | ||
@RunWith(AndroidJUnit4.class) | ||
public class ExampleInstrumentedTest { | ||
@Test | ||
public void useAppContext() throws Exception { | ||
// Context of the app under test. | ||
Context appContext = InstrumentationRegistry.getTargetContext(); | ||
|
||
assertEquals("com.youthenterpreneur.youthenterpreneur", appContext.getPackageName()); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="core.mvp.kotlinandroid"> | ||
|
||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme"> | ||
<activity android:name="nanita.entr.android.splashscreen.SplashScreenActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name="nanita.entr.android.home.HomeActivity" /> | ||
</application> | ||
|
||
</manifest> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package nanita.entr.android | ||
|
||
import android.os.Bundle | ||
import android.support.v7.app.AppCompatActivity | ||
import android.view.MenuItem | ||
import core.mvp.kotlinandroid.R | ||
import kotlinx.android.synthetic.main.default_backpress_toolbar_layout.* | ||
|
||
/**** | ||
* | ||
* @author TUON BONDOL Date: 9/1/17. | ||
* | ||
*/ | ||
|
||
open class BaseActivity : AppCompatActivity() { | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
} | ||
|
||
open fun onSetUpGeneralBackPressToolbar(toolbarTitle: String) { | ||
setSupportActionBar(tbGeneralBackPress) | ||
|
||
supportActionBar?.setDisplayHomeAsUpEnabled(true) | ||
supportActionBar?.setDisplayShowTitleEnabled(false) | ||
supportActionBar?.setHomeAsUpIndicator(R.drawable.back_press_white_icon_24dp) | ||
|
||
tvToolbarTitle.text = toolbarTitle | ||
} | ||
|
||
open fun onSetUpGeneralCrossCloseToolbar(toolbarTitle: String) { | ||
setSupportActionBar(tbGeneralBackPress) | ||
|
||
supportActionBar?.setDisplayHomeAsUpEnabled(true) | ||
supportActionBar?.setDisplayShowTitleEnabled(false) | ||
supportActionBar?.setHomeAsUpIndicator(R.drawable.ic_close_white_24dp) | ||
|
||
tvToolbarTitle.text = toolbarTitle | ||
} | ||
|
||
override fun onOptionsItemSelected(item: MenuItem?): Boolean { | ||
val id = item?.itemId | ||
when (id) { | ||
android.R.id.home -> { | ||
finish() | ||
return true | ||
} | ||
else -> return super.onOptionsItemSelected(item) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package nanita.entr.android | ||
|
||
/**** | ||
* | ||
* @author TUON BONDOL Date: 9/1/17. | ||
* | ||
*/ | ||
|
||
interface BaseModel { | ||
fun responseError(errorObjects: Any) | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package nanita.entr.android | ||
|
||
/**** | ||
* | ||
* @author TUON BONDOL Date: 9/1/17. | ||
* | ||
*/ | ||
|
||
interface BasePresenter { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package nanita.entr.android | ||
|
||
/**** | ||
* | ||
* @author TUON BONDOL Date: 9/1/17. | ||
* | ||
*/ | ||
|
||
interface BaseView<T> { | ||
fun setPresenter(presenter: T) | ||
} |