Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Polohach committed Aug 23, 2019
0 parents commit fe27e51
Show file tree
Hide file tree
Showing 641 changed files with 24,078 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.iml
.idea
.gradle
#jcenter.settings.gradle
/local.properties
.DS_Store
/build
/captures
.externalNativeBuild
105 changes: 105 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Kotlin Bootstrap [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) <img src="https://www.cleveroad.com/public/comercial/label-android.svg" height="19"> <a href="https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts"><img src="https://www.cleveroad.com/public/comercial/label-cleveroad.svg" height="19"></a>

## Meet Kotlin Bootstrap by Cleveroad

This is tutorial about android bootstrap library.

## Setup and usage
### Installation
by project gradle :
```groovy
ext {
bootstrapVersion = "2.0.0"
bootstrapDependencies = [
auth : "com.cleveroad.bootstrap:kotlin-auth:$bootstrapVersion",
core : "com.cleveroad.bootstrap:kotlin-core:$bootstrapVersion",
ext : "com.cleveroad.bootstrap:kotlin-ext:$bootstrapVersion"
thumbnails : "com.cleveroad.bootstrap:kotlin-ffmpeg-thumbnails:$bootstrapVersion"
video_compress: "com.cleveroad.bootstrap:kotlin-ffmpeg-video-compress:$bootstrapVersion"
gps : "com.cleveroad.bootstrap:kotlin-gps:$bootstrapVersion"
permission : "com.cleveroad.bootstrap:kotlin-permissionrequest:$bootstrapVersion"
phone_input : "com.cleveroad.bootstrap:kotlin-phone-input:$bootstrapVersion"
validators : "com.cleveroad.bootstrap:kotlin-validators:$bootstrapVersion",
rxBus : "com.cleveroad.bootstrap:kotlin-rx-bus:$bootstrapVersion",
]
}
```

by app gradle :
```groovy
dependencies {
// Bootstrap
implementation bootstrapDependencies.auth
implementation bootstrapDependencies.core
implementation bootstrapDependencies.ext
implementation bootstrapDependencies.thumbnails
implementation bootstrapDependencies.video_compress
implementation bootstrapDependencies.gps
implementation bootstrapDependencies.permission
implementation bootstrapDependencies.phone_input
implementation bootstrapDependencies.validators
implementation bootstrapDependencies.rxBus
}
```

### Usage ###

- [Kotlin Auth]
- [Kotlin Core]
- [Kotlin Extension]
- [Kotlin FFMpeg Thumbnails]
- [Kotlin FFMpeg Video Compress]
- [Kotlin GPS]
- [Kotlin Permission Request]
- [Kotlin Phone Input]
- [Kotlin RxBus]
- [Kotlin Validators]

### Support ###
If you have any questions, issues or propositions, please create a <a href="../../issues/new">new issue</a> in this repository.

If you want to hire us, send an email to [email protected] or fill the form on <a href="https://www.cleveroad.com/contact">contact page</a>

Follow us:

[![Awesome](/images/social/facebook.png)](https://www.facebook.com/cleveroadinc/) [![Awesome](/images/social/twitter.png)](https://twitter.com/cleveroadinc) [![Awesome](/images/social/google.png)](https://plus.google.com/+CleveroadInc) [![Awesome](/images/social/linkedin.png)](https://www.linkedin.com/company/cleveroad-inc-) [![Awesome](/images/social/youtube.png)](https://www.youtube.com/channel/UCFNHnq1sEtLiy0YCRHG2Vaw)
<br/>

### License ###
* * *
The MIT License (MIT)

Copyright (c) 2016 Cleveroad Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

[Kotlin Auth]: /kotlin-auth
[Kotlin Core]: /kotlin-core
[Kotlin Extension]: /kotlin-ext
[Kotlin FFMpeg Thumbnails]: /kotlin-ffmpeg-thumbnails
[Kotlin FFMpeg Video Compress]: /kotlin-ffmpeg-video-compress
[Kotlin GPS]: /kotlin-gps
[Kotlin Permission Request]: /kotlin-permissionrequest
[Kotlin Phone Input]: /kotlin-phone-input
[Kotlin RxBus]: /kotlin-rx-bus
[Kotlin Validators]: /kotlin-validators
8 changes: 8 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
*.iml
.idea
.gradle
/local.properties
.DS_Store
/build
/captures
.externalNativeBuild
82 changes: 82 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion rootProject.ext.compileSdkVersion as Integer
buildToolsVersion rootProject.ext.buildToolsVersion as String
defaultConfig {
applicationId "com.cleveroad.bootstrap.kotlin"
minSdkVersion 21
targetSdkVersion rootProject.ext.compileSdkVersion as Integer
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
all {
buildConfigField "String", "GOOGLE_CLIENT_ID", '"YOUR_CLIENT_ID"'
buildConfigField "String", "TWITTER_CONSUMER_KEY", '"YOUR_CONSUMER_KEY"'
buildConfigField "String", "TWITTER_REDIRECT_URL", '"_REDIRECT_URL"'
buildConfigField "String", "TWITTER_CONSUMER_SECRET", '"YOUR_CONSUMER_SECRET"'
buildConfigField "String", "LINKEDIN_CLIENT_ID", '"YOUR_CLIENT_ID"'
buildConfigField "String", "LINKEDIN_CLIENT_SECRET", '"YOUR_CLIENT_SECRET"'
buildConfigField "String", "LINKEDIN_REDIRECT_URL", '"https://www.cleveroad.com/"'
}

debug {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

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

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// tests
testImplementation testsDependencies.junit
testImplementation testsDependencies.runner
testImplementation(testsDependencies.espresso_core) {
exclude group: 'com.android.support', module: 'support-annotations'
}

// Google Auth
implementation playServiceDependencies.play_services_auth

// Facebook Auth
implementation facebookDependencies.login

// common
implementation supportDependencies.appCompat
implementation supportDependencies.design
implementation kotlinDependencies.jdk

// rx
implementation rxjava2Dependencies.rxjava

// bootstrap
implementation project(':kotlin-phone-input')
implementation project(':kotlin-validators')
implementation project(':kotlin-core')
implementation project(':kotlin-ext')
implementation project(':kotlin-gps')
implementation project(':kotlin-ffmpeg-thumbnails')
implementation project(':kotlin-ffmpeg-video-compress')
implementation project(':kotlin-permissionrequest')
implementation project(':kotlin-auth')

}

repositories {
mavenCentral()
}
10 changes: 10 additions & 0 deletions app/credentials.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"web": {
"client_id": "YOUR_CLIENT_ID",
"project_id": "PROJECT_ID",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_secret": "CLIENT_SECRET"
}
}
29 changes: 29 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /home/horobets_stanislav_cr/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

## libphonenumber
#-keep class com.google.i18n.phonenumbers.repackaged.**
#-dontwarn com.google.i18n.phonenumbers.repackaged.**
74 changes: 74 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.cleveroad.bootstrap.kotlin">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET"/>

<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"
tools:ignore="GoogleAppIndexingWarning">

<activity
android:name="com.cleveroad.MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name="com.cleveroad.validator_example.ValidatorActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" />

<activity
android:name="com.cleveroad.gps_example.GpsActivity"
android:windowSoftInputMode="adjustResize" />

<activity
android:name="com.cleveroad.ffmpeg_example.FFMpegActivity"
android:windowSoftInputMode="adjustResize" />

<activity
android:name="com.cleveroad.compress_image.CompressImageActivity"
android:windowSoftInputMode="adjustResize" />

<activity
android:name="com.cleveroad.phone_example.ChooseCountryActivity"
android:screenOrientation="portrait" />

<activity android:name="com.cleveroad.auth_example.SampleAuthActivity" />

<activity android:name="com.facebook.FacebookActivity"
android:configChanges= "keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />

<activity android:name="com.facebook.CustomTabActivity"
android:exported="true">

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>

</activity>

<activity android:name="com.cleveroad.multiselect_example.MultiSelectActivity"/>

<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>

</application>
</manifest>
35 changes: 35 additions & 0 deletions app/src/main/java/com/cleveroad/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.cleveroad

import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import com.cleveroad.auth_example.SampleAuthActivity
import com.cleveroad.bootstrap.kotlin.R
import com.cleveroad.bootstrap.kotlin_ext.setClickListenerWithDebounce
import com.cleveroad.compress_image.CompressImageActivity
import com.cleveroad.ffmpeg_example.FFMpegActivity
import com.cleveroad.gps_example.GpsActivity
import com.cleveroad.phone_example.ChooseCountryActivity
import com.cleveroad.validator_example.ValidatorActivity
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity(), View.OnClickListener {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
setClickListenerWithDebounce(bValidationExample, bGpsExample,
bFfmpegExample, bCompressImage, bPhoneViewExample, bAuthExample)
}

override fun onClick(v: View) {
when (v.id) {
R.id.bValidationExample -> ValidatorActivity.start(this)
R.id.bGpsExample -> GpsActivity.start(this)
R.id.bFfmpegExample -> FFMpegActivity.start(this)
R.id.bCompressImage -> CompressImageActivity.start(this)
R.id.bPhoneViewExample -> ChooseCountryActivity.start(this)
R.id.bAuthExample -> SampleAuthActivity.start(this)
}
}
}
Loading

0 comments on commit fe27e51

Please sign in to comment.