├── .gitignore ├── .idea ├── codeStyles │ └── Project.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── fabric.properties ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── org │ │ │ └── h7 │ │ │ └── simple │ │ │ ├── Constants.kt │ │ │ ├── activity │ │ │ └── main │ │ │ │ ├── MainActivity.kt │ │ │ │ └── adapter │ │ │ │ └── MenuAdapter.kt │ │ │ ├── app │ │ │ └── App.kt │ │ │ ├── binding │ │ │ └── Adapters.kt │ │ │ ├── config │ │ │ └── menu │ │ │ │ └── INavViewModel.kt │ │ │ ├── data │ │ │ └── menu │ │ │ │ ├── Footer.kt │ │ │ │ ├── Header.kt │ │ │ │ ├── MenuItem.kt │ │ │ │ └── OnMenuClickListener.kt │ │ │ └── widget │ │ │ ├── CircleTransformation.kt │ │ │ ├── EndDrawerToggle.kt │ │ │ └── Utils.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ ├── app_bar_main.xml │ │ ├── content_main.xml │ │ ├── layout_menu_footer.xml │ │ ├── layout_menu_header.xml │ │ └── menu_item.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-v21 │ │ └── styles.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── zip │ ├── AndroidManifest.xml │ ├── java │ └── org │ │ └── h7 │ │ └── simple │ │ ├── activity │ │ └── main │ │ │ └── MainActivityImpl.kt │ │ └── config │ │ └── menu │ │ └── NavViewModel.kt │ └── res │ ├── drawable-nodpi │ └── logo_placeholder.png │ ├── drawable │ ├── ic_menu_contact_us.xml │ ├── ic_menu_rate_us.xml │ ├── ic_menu_settings.xml │ ├── ic_menu_social_media.xml │ ├── ic_menu_support.xml │ └── ic_menu_website.xml │ └── values │ ├── colors.xml │ ├── dimens.xml │ ├── ids.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystore └── keystore.jks ├── logo.png └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | # Proguard folder generated by Eclipse 24 | proguard/ 25 | 26 | # Log Files 27 | *.log 28 | 29 | # Android Studio Navigation editor temp files 30 | .navigation/ 31 | 32 | # Android Studio captures folder 33 | captures/ 34 | 35 | # IntelliJ 36 | *.iml 37 | .idea/workspace.xml 38 | .idea/tasks.xml 39 | .idea/gradle.xml 40 | .idea/assetWizardSettings.xml 41 | .idea/dictionaries 42 | .idea/libraries 43 | .idea/caches 44 | 45 | # Keystore files 46 | # Uncomment the following line if you do not want to check your keystore files in. 47 | #*.jks 48 | 49 | # External native build folder generated in Android Studio 2.2 and later 50 | .externalNativeBuild 51 | 52 | # Google Services (e.g. APIs or Firebase) 53 | google-services.json 54 | 55 | # Freeline 56 | freeline.py 57 | freeline/ 58 | freeline_project_description.json 59 | 60 | # fastlane 61 | fastlane/report.xml 62 | fastlane/Preview.html 63 | fastlane/screenshots 64 | fastlane/test_output 65 | fastlane/readme.md 66 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Simple-Android-App 2 | Simple Android App w/ Source Code - Android Studio app example. Sample project with source code (free download). 3 | 4 | # simple.app 5 | 6 | Simple Android App UI: Hello World! 7 | 8 | #keystore 9 | 10 | store password: helloworld 11 | 12 | alias: simple 13 | 14 | key password: helloworld -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-android-extensions' 4 | apply plugin: 'kotlin-kapt' 5 | apply plugin: 'io.fabric' 6 | 7 | android { 8 | compileSdkVersion 27 9 | defaultConfig { 10 | applicationId "org.h7.simple" 11 | minSdkVersion 16 12 | targetSdkVersion 27 13 | versionCode 1 14 | versionName "1.0" 15 | multiDexEnabled true 16 | vectorDrawables.useSupportLibrary = true 17 | } 18 | 19 | buildTypes { 20 | release { 21 | minifyEnabled false 22 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 23 | } 24 | debug { 25 | ext.enableCrashlytics = false 26 | } 27 | } 28 | compileOptions { 29 | sourceCompatibility JavaVersion.VERSION_1_8 30 | targetCompatibility JavaVersion.VERSION_1_8 31 | } 32 | 33 | dataBinding { 34 | enabled = true 35 | } 36 | 37 | flavorDimensions "app" 38 | 39 | productFlavors { 40 | zip { 41 | dimension "app" 42 | applicationIdSuffix = ".zip" 43 | } 44 | } 45 | applicationVariants.all { variant -> 46 | variant.outputs.all { output -> 47 | def appName = "simple" 48 | def flavor = variant.productFlavors[0].name 49 | def SEP = "_" 50 | def buildType = variant.variantData.variantConfiguration.buildType.name 51 | outputFileName = appName + SEP + flavor + SEP + buildType + ".apk" 52 | } 53 | } 54 | 55 | } 56 | 57 | androidExtensions { 58 | experimental = true 59 | } 60 | 61 | dependencies { 62 | implementation fileTree(dir: 'libs', include: ['*.jar']) 63 | implementation ("com.crashlytics.sdk.android:crashlytics:$crashlytics_version@aar") { 64 | transitive = true 65 | } 66 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 67 | implementation "com.android.support:appcompat-v7:$support_version" 68 | implementation "com.android.support:design:$support_version" 69 | implementation "com.android.support:design:$support_version" 70 | implementation "com.android.support:recyclerview-v7:$support_version" 71 | 72 | implementation "com.android.support:multidex:$multidex_version" 73 | 74 | implementation "com.android.support.constraint:constraint-layout:$constraint_version" 75 | 76 | implementation "io.reactivex.rxjava2:rxandroid:$rxandroid_version" 77 | implementation "io.reactivex.rxjava2:rxjava:$rxjava_version" 78 | implementation "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version" 79 | 80 | implementation "android.arch.lifecycle:extensions:$viewmodel_version" 81 | implementation "android.arch.lifecycle:viewmodel:$viewmodel_version" 82 | 83 | implementation "com.squareup.picasso:picasso:$picasso_version" 84 | } 85 | 86 | kapt { 87 | generateStubs = true 88 | } 89 | -------------------------------------------------------------------------------- /app/fabric.properties: -------------------------------------------------------------------------------- 1 | #Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public. 2 | #Thu Jun 28 16:54:21 MSK 2018 3 | apiSecret=4e2b732b64884793ffeac7ea6ad44e34ff981ad808083ea0c7d35ce07d9ec62b 4 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 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 22 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 23 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/Constants.kt: -------------------------------------------------------------------------------- 1 | package org.h7.simple 2 | 3 | /** 4 | * Created by ruslan on 12/01/2019. 5 | */ 6 | 7 | class Constants { 8 | companion object { 9 | val WEB_URL = "https://app.h7.org/simple/Android" 10 | } 11 | } -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/activity/main/MainActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.activity.main 10 | 11 | import android.databinding.DataBindingUtil 12 | import android.os.Bundle 13 | import android.support.v4.view.GravityCompat 14 | import android.support.v7.app.AppCompatActivity 15 | import android.support.v7.widget.LinearLayoutManager 16 | import kotlinx.android.synthetic.main.activity_main.* 17 | import kotlinx.android.synthetic.main.app_bar_main.* 18 | import org.h7.simple.R 19 | import org.h7.simple.activity.main.adapter.MenuAdapter 20 | import org.h7.simple.config.menu.INavViewModel 21 | import org.h7.simple.data.menu.MenuItem 22 | import org.h7.simple.data.menu.OnMenuClickListener 23 | import org.h7.simple.databinding.ActivityMainBinding 24 | import org.h7.simple.widget.EndDrawerToggle 25 | 26 | 27 | abstract class MainActivity : AppCompatActivity() { 28 | abstract fun onMenuItemClick(item: MenuItem):Boolean 29 | abstract fun getNavViewModel():INavViewModel 30 | 31 | private lateinit var modelNavigation: INavViewModel 32 | 33 | override fun onCreate(savedInstanceState: Bundle?) { 34 | super.onCreate(savedInstanceState) 35 | val binding : ActivityMainBinding = DataBindingUtil.setContentView(this, R.layout.activity_main) 36 | modelNavigation = getNavViewModel() 37 | binding.footer = modelNavigation.getMenuFooter(this) 38 | binding.header = modelNavigation.getMenuHeader(this) 39 | initMenu() 40 | setSupportActionBar(toolbar) 41 | 42 | val toggle = EndDrawerToggle( 43 | this, drawerLayout, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close) 44 | drawerLayout.addDrawerListener(toggle) 45 | toggle.syncState() 46 | } 47 | 48 | private fun initMenu() { 49 | menuItems.adapter = MenuAdapter(modelNavigation.getMenuItems(),object:OnMenuClickListener{ 50 | override fun onMenuItemClick(item: MenuItem) { 51 | if (this@MainActivity.onMenuItemClick(item)) 52 | hideMenuIfOpened() 53 | } 54 | 55 | }) 56 | menuItems.layoutManager = LinearLayoutManager(this) 57 | } 58 | 59 | override fun onBackPressed() { 60 | if (!hideMenuIfOpened()){ 61 | super.onBackPressed() 62 | } 63 | } 64 | 65 | private fun hideMenuIfOpened():Boolean{ 66 | return if (drawerLayout.isDrawerOpen(GravityCompat.END)) { 67 | drawerLayout.closeDrawer(GravityCompat.END) 68 | true 69 | } else { 70 | false 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/activity/main/adapter/MenuAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.activity.main.adapter 10 | 11 | import android.databinding.DataBindingUtil 12 | import android.support.v7.widget.RecyclerView 13 | import android.view.LayoutInflater 14 | import android.view.View 15 | import android.view.ViewGroup 16 | import kotlinx.android.synthetic.main.menu_item.view.* 17 | import org.h7.simple.R 18 | import org.h7.simple.data.menu.MenuItem 19 | import org.h7.simple.data.menu.OnMenuClickListener 20 | import org.h7.simple.databinding.MenuItemBinding 21 | 22 | 23 | /** 24 | * Created by Alexey Rogovoy (lexapublic@gmail.com) on 29.06.2018. 25 | */ 26 | 27 | class MenuAdapter(private var items : List,private var clickListener: OnMenuClickListener): RecyclerView.Adapter() { 28 | 29 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MenuViewHolder { 30 | val inflater = LayoutInflater.from(parent.context) 31 | val binding = DataBindingUtil.inflate(inflater, R.layout.menu_item, parent, false) 32 | return MenuViewHolder(binding) 33 | } 34 | 35 | override fun getItemCount(): Int { 36 | return items.size 37 | } 38 | 39 | override fun onBindViewHolder(holder: MenuViewHolder, position: Int) { 40 | holder.bind(items[position]) 41 | } 42 | 43 | inner class MenuViewHolder(private var binding: MenuItemBinding) : RecyclerView.ViewHolder(binding.root) { 44 | fun bind(item: MenuItem){ 45 | binding.item = item 46 | binding.click = View.OnClickListener { clickListener.onMenuItemClick(item) } 47 | binding.executePendingBindings() 48 | binding.root.icon.setImageResource(item.icon) 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/app/App.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.app 10 | 11 | import android.support.multidex.MultiDexApplication 12 | import android.support.v7.app.AppCompatDelegate 13 | import com.crashlytics.android.Crashlytics 14 | import com.crashlytics.android.core.CrashlyticsCore 15 | import io.fabric.sdk.android.Fabric 16 | import org.h7.simple.BuildConfig 17 | 18 | 19 | /** 20 | * * Created by Alexey Rogovoy (lexapublic@gmail.com) on 26.06.2018. 21 | */ 22 | class App: MultiDexApplication() { 23 | override fun onCreate() { 24 | super.onCreate() 25 | initFabric() 26 | AppCompatDelegate.setCompatVectorFromResourcesEnabled(true) 27 | } 28 | private fun initFabric() { 29 | val crashlitics = Crashlytics.Builder() 30 | .core(CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build()) 31 | .build() 32 | Fabric.with(this,crashlitics) 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/binding/Adapters.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.binding 10 | 11 | import android.databinding.BindingAdapter 12 | import android.graphics.drawable.Drawable 13 | import android.text.TextUtils 14 | import android.widget.ImageView 15 | import com.squareup.picasso.Picasso 16 | import com.squareup.picasso.RequestCreator 17 | import org.h7.simple.widget.CircleTransformation 18 | 19 | 20 | /** 21 | * Created by Alexey Rogovoy (lexapublic@gmail.com) on 29.06.2018. 22 | */ 23 | @BindingAdapter(value = ["logoUrl","borderWidth","borderColor","placeholder"], requireAll = false) 24 | fun loadImage(imageView: ImageView, url: String?,borderWidth:Float?,borderColor:Int?,placeholder: Drawable?) { 25 | if (!TextUtils.isEmpty(url)) { 26 | val creator:RequestCreator = Picasso.get().load(url) 27 | 28 | val circle: CircleTransformation = if (borderWidth!=null&&borderColor!=null) { 29 | CircleTransformation(borderColor,borderWidth) 30 | } else { 31 | CircleTransformation() 32 | } 33 | 34 | creator.centerCrop() 35 | .fit() 36 | .transform(circle) 37 | 38 | if (placeholder!=null) { 39 | creator.error(placeholder) 40 | } 41 | 42 | creator.into(imageView) 43 | } else if (placeholder!=null) { 44 | imageView.setImageDrawable(placeholder) 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/config/menu/INavViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.config.menu 10 | 11 | import android.arch.lifecycle.ViewModel 12 | import android.content.Context 13 | import org.h7.simple.data.menu.Footer 14 | import org.h7.simple.data.menu.Header 15 | import org.h7.simple.data.menu.MenuItem 16 | 17 | /** 18 | * Created by Alexey Rogovoy (lexapublic@gmail.com) on 29.06.2018. 19 | */ 20 | abstract class INavViewModel: ViewModel() { 21 | abstract fun getMenuFooter(context: Context): Footer 22 | abstract fun getMenuHeader(context: Context):Header 23 | abstract fun getMenuItems(): List 24 | } -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/data/menu/Footer.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.data.menu 10 | 11 | /** 12 | * * Created by Alexey Rogovoy (lexapublic@gmail.com) on 29.06.2018. 13 | */ 14 | class Footer(var copyright: String?, var web: String?) 15 | -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/data/menu/Header.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.data.menu 10 | 11 | import android.databinding.ObservableField 12 | import android.databinding.ObservableInt 13 | import android.graphics.Color 14 | 15 | /** 16 | * * Created by Alexey Rogovoy (lexapublic@gmail.com) on 29.06.2018. 17 | */ 18 | class Header(logoUrl: String?, val title: String?, val subtitle: String?) { 19 | private val logoUrl = ObservableField() 20 | var strokeColor = ObservableInt() 21 | 22 | init { 23 | this.logoUrl.set(logoUrl) 24 | strokeColor.set(Color.WHITE) 25 | } 26 | 27 | fun setLogoUrl(url: String) { 28 | logoUrl.set(url) 29 | } 30 | fun getLogoUrl():String?{ 31 | return logoUrl.get() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/data/menu/MenuItem.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.data.menu 10 | 11 | /** 12 | * Created by Alexey Rogovoy (lexapublic@gmail.com) on 29.06.2018. 13 | */ 14 | data class MenuItem(val id: Int, val icon: Int, val title:Int, val subtitle:Int) -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/data/menu/OnMenuClickListener.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.data.menu 10 | 11 | /** 12 | * * Created by Alexey Rogovoy (lexapublic@gmail.com) on 30.06.2018. 13 | */ 14 | interface OnMenuClickListener { 15 | fun onMenuItemClick(item:MenuItem) 16 | } -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/widget/CircleTransformation.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.widget 10 | 11 | import android.graphics.* 12 | import android.support.annotation.ColorInt 13 | import com.squareup.picasso.Transformation 14 | 15 | /** 16 | * Created by Alexey Rogovoy (lexapublic@gmail.com) on 29.06.2018. 17 | */ 18 | class CircleTransformation : Transformation { 19 | 20 | private var strokeWidth = 0f 21 | private var strokeColor = Color.TRANSPARENT 22 | 23 | constructor(){} 24 | 25 | constructor(@ColorInt strokeColor: Int, strokeWidth: Float) : super() { 26 | this.strokeColor = strokeColor 27 | this.strokeWidth = strokeWidth 28 | } 29 | 30 | override fun transform(source: Bitmap): Bitmap { 31 | val size = Math.min(source.width, source.height) 32 | 33 | val x = (source.width - size) / 2 34 | val y = (source.height - size) / 2 35 | 36 | val squaredBitmap = Bitmap.createBitmap(source, x, y, size, size) 37 | if (squaredBitmap != source) { 38 | source.recycle() 39 | } 40 | 41 | val bitmap = Bitmap.createBitmap(size, size, source.config) 42 | 43 | val canvas = Canvas(bitmap) 44 | val paint = Paint() 45 | val shader = BitmapShader(squaredBitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP) 46 | paint.setShader(shader) 47 | paint.setAntiAlias(true) 48 | 49 | val r = size / 2f 50 | 51 | if (strokeColor != Color.TRANSPARENT) { 52 | // Prepare the background 53 | val paintBg = Paint() 54 | paintBg.setColor(strokeColor) 55 | paintBg.setAntiAlias(true) 56 | // Draw the background circle 57 | canvas.drawCircle(r, r, r, paintBg) 58 | } 59 | // Draw the image smaller than the background so a little border will be seen 60 | canvas.drawCircle(r, r, r - strokeWidth, paint) 61 | 62 | squaredBitmap.recycle() 63 | return bitmap 64 | } 65 | 66 | override fun key(): String { 67 | return "circle" 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/widget/EndDrawerToggle.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.widget 10 | 11 | import android.app.Activity 12 | import android.support.v4.view.GravityCompat 13 | import android.support.v4.widget.DrawerLayout 14 | import android.support.v7.graphics.drawable.DrawerArrowDrawable 15 | import android.support.v7.widget.AppCompatImageButton 16 | import android.support.v7.widget.Toolbar 17 | import android.view.View 18 | import org.h7.simple.R 19 | 20 | 21 | /** 22 | * Created by Jason Lauri (pandasoft0@gmail.com) on 26.06.2018. 23 | */ 24 | class EndDrawerToggle(activity: Activity, private val drawerLayout: DrawerLayout, toolbar: Toolbar, 25 | openDrawerContentDescRes: Int, closeDrawerContentDescRes: Int) : DrawerLayout.DrawerListener { 26 | private val arrowDrawable: DrawerArrowDrawable = DrawerArrowDrawable(toolbar.context) 27 | private val toggleButton: AppCompatImageButton 28 | private val openDrawerContentDesc: String = activity.getString(openDrawerContentDescRes) 29 | private val closeDrawerContentDesc: String = activity.getString(closeDrawerContentDescRes) 30 | 31 | init { 32 | 33 | arrowDrawable.direction = DrawerArrowDrawable.ARROW_DIRECTION_END 34 | 35 | toggleButton = AppCompatImageButton(toolbar.context, null, 36 | R.attr.toolbarNavigationButtonStyle) 37 | toolbar.addView(toggleButton, Toolbar.LayoutParams(GravityCompat.END)) 38 | toggleButton.setImageDrawable(arrowDrawable) 39 | toggleButton.setOnClickListener { toggle() } 40 | } 41 | 42 | fun syncState() { 43 | if (drawerLayout.isDrawerOpen(GravityCompat.END)) { 44 | setPosition(1f) 45 | } else { 46 | setPosition(0f) 47 | } 48 | } 49 | 50 | @Suppress("MemberVisibilityCanBePrivate") 51 | fun toggle() { 52 | if (drawerLayout.isDrawerOpen(GravityCompat.END)) { 53 | drawerLayout.closeDrawer(GravityCompat.END) 54 | } else { 55 | drawerLayout.openDrawer(GravityCompat.END) 56 | } 57 | } 58 | 59 | @Suppress("MemberVisibilityCanBePrivate") 60 | fun setPosition(position: Float) { 61 | if (position == 1f) { 62 | arrowDrawable.setVerticalMirror(true) 63 | toggleButton.contentDescription = closeDrawerContentDesc 64 | } else if (position == 0f) { 65 | arrowDrawable.setVerticalMirror(false) 66 | toggleButton.contentDescription = openDrawerContentDesc 67 | } 68 | arrowDrawable.progress = position 69 | } 70 | 71 | override fun onDrawerSlide(drawerView: View, slideOffset: Float) { 72 | setPosition(Math.min(1f, Math.max(0f, slideOffset))) 73 | } 74 | 75 | override fun onDrawerOpened(drawerView: View) { 76 | setPosition(1f) 77 | } 78 | 79 | override fun onDrawerClosed(drawerView: View) { 80 | setPosition(0f) 81 | } 82 | 83 | override fun onDrawerStateChanged(newState: Int) {} 84 | } -------------------------------------------------------------------------------- /app/src/main/java/org/h7/simple/widget/Utils.kt: -------------------------------------------------------------------------------- 1 | package org.h7.simple.widget 2 | 3 | import android.content.Context 4 | import android.content.Intent 5 | import android.net.Uri 6 | import android.text.TextUtils 7 | 8 | /** 9 | * Created by ruslan on 12/01/2019. 10 | */ 11 | 12 | fun openUrl(context: Context?, url: String?) { 13 | if (TextUtils.isEmpty(url) || context == null) { 14 | return 15 | } 16 | 17 | val intent = Intent(Intent.ACTION_VIEW, Uri.parse(url)) 18 | 19 | if (intent.resolveActivity(context.packageManager) != null) { 20 | context.startActivity(intent) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 15 | 20 | 21 | 27 | 30 | 33 | 34 | 35 | 36 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 18 | 23 | 28 | 33 | 38 | 43 | 48 | 53 | 58 | 63 | 68 | 73 | 78 | 83 | 88 | 93 | 98 | 103 | 108 | 113 | 118 | 123 | 128 | 133 | 138 | 143 | 148 | 153 | 158 | 163 | 168 | 173 | 178 | 179 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 21 | 22 | 23 | 24 | 32 | 33 | 37 | 38 | 44 | 45 | 50 | 52 | 53 | 63 | 64 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /app/src/main/res/layout/app_bar_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 22 | 23 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_menu_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 28 | 29 | 36 | 37 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_menu_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 33 | 34 | 39 | 40 | 50 | 51 | 59 | 60 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /app/src/main/res/layout/menu_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 15 | 18 | 21 | 22 | 23 | 24 | 25 | 39 | 40 | 49 | 50 | 54 | 59 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #475ccc 5 | @android:color/black 6 | #1c1c1c 7 | @android:color/white 8 | #a1cf42 9 | #909090 10 | #d0d0d0 11 | @color/green 12 | 13 | @color/blue 14 | @color/blue 15 | @color/blue 16 | #aabbff 17 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 16dp 11 | 32dp 12 | 8dp 13 | 14 | 12dp 15 | 16 | 17 | @dimen/base_margin 18 | @dimen/base_margin 19 | 20 | 21 | 16sp 22 | 20sp 23 | 16sp 24 | 18sp 25 | 14sp 26 | 12sp 27 | 10sp 28 | 14sp 29 | 16sp 30 | 12sp 31 | 48dp 32 | 3dp 33 | 56dp 34 | 176dp 35 | 24dp 36 | 48dp 37 | 2dp 38 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | Open navigation drawer 11 | Close navigation drawer 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 23 | 24 | 37 | 41 | 42 | 47 | 51 | 52 | 57 | 61 | 62 | -------------------------------------------------------------------------------- /app/src/zip/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/zip/java/org/h7/simple/activity/main/MainActivityImpl.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.activity.main 10 | 11 | import android.arch.lifecycle.ViewModelProviders 12 | import android.widget.Toast 13 | import org.h7.simple.Constants 14 | import org.h7.simple.R 15 | import org.h7.simple.config.menu.INavViewModel 16 | import org.h7.simple.config.menu.NavViewModel 17 | import org.h7.simple.data.menu.MenuItem 18 | import org.h7.simple.widget.openUrl 19 | 20 | /** 21 | * Created by Alexey Rogovoy (lexapublic@gmail.com) on 30.06.2018. 22 | */ 23 | class MainActivityImpl: MainActivity() { 24 | 25 | override fun getNavViewModel(): INavViewModel { 26 | return ViewModelProviders.of(this).get(NavViewModel::class.java) 27 | } 28 | 29 | override fun onMenuItemClick(item: MenuItem):Boolean { 30 | when (item.id) { 31 | R.id.menu_social_media -> { 32 | openUrl(this, "${Constants.WEB_URL}/social") 33 | } 34 | R.id.menu_contact_us -> { 35 | openUrl(this, "${Constants.WEB_URL}/contact") 36 | } 37 | R.id.menu_support -> { 38 | openUrl(this, "${Constants.WEB_URL}/support") 39 | } 40 | R.id.menu_website -> { 41 | openUrl(this, Constants.WEB_URL) 42 | } 43 | R.id.menu_rate_us -> { 44 | openUrl(this, "${Constants.WEB_URL}/like") 45 | } 46 | else -> { 47 | Toast.makeText(this@MainActivityImpl, getString(item.title), Toast.LENGTH_LONG).show() 48 | } 49 | } 50 | 51 | return true 52 | } 53 | } -------------------------------------------------------------------------------- /app/src/zip/java/org/h7/simple/config/menu/NavViewModel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * project: Simple App, Android 3 | * app.h7.org/simple/Android 4 | * Copyright © 2018 H7 (h7.org). 5 | * 6 | * created by yatko.com 7 | */ 8 | 9 | package org.h7.simple.config.menu 10 | 11 | import android.content.Context 12 | import org.h7.simple.BuildConfig 13 | import org.h7.simple.R 14 | import org.h7.simple.data.menu.Footer 15 | import org.h7.simple.data.menu.Header 16 | import org.h7.simple.data.menu.MenuItem 17 | 18 | /** 19 | * Created by Alexey Rogovoy (lexapublic@gmail.com) on 29.06.2018. 20 | */ 21 | class NavViewModel: INavViewModel() { 22 | private var footer: Footer? = null 23 | private var header: Header? = null 24 | override fun getMenuFooter(context: Context): Footer { 25 | if (footer==null){ 26 | footer = Footer(context.getString(R.string.nav_footer_text_template,context.getString(R.string.app_name)),context.getString(R.string.nav_footer_subtitle)) 27 | } 28 | return footer!! 29 | } 30 | 31 | override fun getMenuHeader(context: Context):Header{ 32 | if (header==null) { 33 | header = Header("https://yatko.com/logo.png", context.getString(R.string.nav_header_title_template, context.getString(R.string.app_name)), context.getString(R.string.nav_header_subtitle_template, BuildConfig.VERSION_NAME)) 34 | } 35 | return header!! 36 | } 37 | 38 | override fun getMenuItems(): List { 39 | return listOf( 40 | MenuItem(R.id.menu_social_media,R.drawable.ic_menu_social_media,R.string.menu_social_media_title,R.string.menu_social_media_description), 41 | MenuItem(R.id.menu_contact_us,R.drawable.ic_menu_contact_us,R.string.menu_contact_us_title,R.string.menu_contact_us_description), 42 | MenuItem(R.id.menu_support,R.drawable.ic_menu_support,R.string.menu_support_title,R.string.menu_support_description), 43 | MenuItem(R.id.menu_website,R.drawable.ic_menu_website,R.string.menu_website_title,R.string.menu_website_description), 44 | MenuItem(R.id.menu_rate_us,R.drawable.ic_menu_rate_us,R.string.menu_rate_us_title,R.string.menu_rate_us_description), 45 | MenuItem(R.id.menu_settings,R.drawable.ic_menu_settings,R.string.menu_settings_title,R.string.menu_settings_description) 46 | ) 47 | } 48 | } -------------------------------------------------------------------------------- /app/src/zip/res/drawable-nodpi/logo_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/app/src/zip/res/drawable-nodpi/logo_placeholder.png -------------------------------------------------------------------------------- /app/src/zip/res/drawable/ic_menu_contact_us.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/zip/res/drawable/ic_menu_rate_us.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/zip/res/drawable/ic_menu_settings.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/zip/res/drawable/ic_menu_social_media.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 14 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/zip/res/drawable/ic_menu_support.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/zip/res/drawable/ic_menu_website.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/zip/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | @color/blue 12 | @color/blue 13 | @color/blue 14 | 15 | 16 | @color/blue 17 | @color/white 18 | @color/white 19 | @color/darker 20 | @color/blue 21 | @color/light 22 | @color/light 23 | @color/light 24 | @color/white 25 | 26 | -------------------------------------------------------------------------------- /app/src/zip/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 176dp 12 | 56dp 13 | 48dp 14 | 24dp 15 | 2dp 16 | 17 | -------------------------------------------------------------------------------- /app/src/zip/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/zip/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | Simple Android App 11 | Copyright © 2018 %s. 12 | H7 | app.h7.org/simple 13 | %s 14 | Version %s 15 | Social Media 16 | Connect 17 | Contact Us 18 | Contact 19 | Support 20 | Get Help 21 | Website 22 | Visit Us 23 | Rate Us 24 | Like It? 25 | Settings 26 | Fine Tune 27 | 28 | -------------------------------------------------------------------------------- /app/src/zip/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 19 | 23 | 24 | 29 | 33 | 34 | 39 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext.kotlin_version = '1.2.51' 5 | repositories { 6 | google() 7 | jcenter() 8 | maven { url 'https://maven.fabric.io/public' } 9 | } 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:3.2.1' 12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 13 | classpath 'io.fabric.tools:gradle:1.25.4' 14 | } 15 | } 16 | 17 | ext{ 18 | support_version = '27.1.1' 19 | constraint_version = '1.1.2' 20 | multidex_version = '1.0.3' 21 | crashlytics_version = '2.9.4' 22 | rxandroid_version = '2.0.2' 23 | rxjava_version = '2.1.16' 24 | rxkotlin_version = '2.2.0' 25 | databinding_version = '3.1.3' 26 | viewmodel_version = '1.1.1' 27 | picasso_version = '2.71828' 28 | } 29 | 30 | allprojects { 31 | repositories { 32 | google() 33 | jcenter() 34 | mavenCentral() 35 | maven { url 'https://maven.fabric.io/public' } 36 | } 37 | } 38 | 39 | task clean(type: Delete) { 40 | delete rootProject.buildDir 41 | } 42 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jan 10 15:18:33 EST 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /keystore/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/keystore/keystore.jks -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Yatko/Simple-Android-App/ac13b6126017c05d1f5affced165e7a2af488c89/logo.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------