Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New split viewdsl support compat #48

Merged
merged 2 commits into from
Mar 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ dependencies {
implementation project(':viewdsl-constraintlayout')
implementation project(':viewdsl-design')
implementation project(':viewdsl-recyclerview')
implementation project(':viewdsl-support-compat')
debugImplementation project(':viewdsl-ide-preview')
implementation project(':views')
implementation project(':views-appcompat')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ import splitties.viewdsl.design.SCROLL
import splitties.viewdsl.design.appBarLParams
import splitties.viewdsl.design.contentScrollingWithAppBarLParams
import splitties.viewdsl.design.defaultLParams
import splitties.viewdsl.support.compat.nestedScrollView
import splitties.views.appcompat.Toolbar
import splitties.views.imageResource
import splitties.views.setCompoundDrawables
import splitties.views.textResource
import xyz.louiscad.splittiessample.R
import xyz.louiscad.splittiessample.extensions.nestedScrollView

class MainUi(override val ctx: Context) : Ui {

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

include ':sample', ':typesaferecyclerview', ':selectableviews', ':checkedlazy', ':appctx', ':preferences', ':stetho-init', ':material-lists', ':bundle', ':initprovider', ':exceptions', ':uithread', ':systemservices', ':resources', ':fragmentargs', ':arch-lifecycle', ':mainhandler', ':arch-room', ':bitflags', ':toast', ':snackbar', ':dimensions', ':views', ':views-appcompat', ':viewdsl', ':viewdsl-appcompat', ':viewdsl-constraintlayout', ':viewdsl-design', ':alertdialog', ':alertdialog-appcompat', ':viewdsl-appcompat-styles', ':selectableviews-appcompat', ':selectableviews-constraintlayout', ':viewdsl-ide-preview', ':viewdsl-recyclerview'
include ':sample', ':typesaferecyclerview', ':selectableviews', ':checkedlazy', ':appctx', ':preferences', ':stetho-init', ':material-lists', ':bundle', ':initprovider', ':exceptions', ':uithread', ':systemservices', ':resources', ':fragmentargs', ':arch-lifecycle', ':mainhandler', ':arch-room', ':bitflags', ':toast', ':snackbar', ':dimensions', ':views', ':views-appcompat', ':viewdsl', ':viewdsl-appcompat', ':viewdsl-constraintlayout', ':viewdsl-design', ':alertdialog', ':alertdialog-appcompat', ':viewdsl-appcompat-styles', ':selectableviews-appcompat', ':selectableviews-constraintlayout', ':viewdsl-ide-preview', ':viewdsl-recyclerview', ':viewdsl-support-compat'
1 change: 1 addition & 0 deletions viewdsl-support-compat/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
58 changes: 58 additions & 0 deletions viewdsl-support-compat/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright (c) 2018. Louis Cognault Ayeva Derman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion projectSdk_version
buildToolsVersion projectBuildTools_version
defaultConfig {
minSdkVersion 14
targetSdkVersion projectSdk_version
versionCode 1
versionName library_version
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}

dependencies {
api project(':viewdsl')

// Android Support Libraries
api "com.android.support:support-annotations:$supportLibs_version"
api "com.android.support:support-compat:$supportLibs_version"
api "com.android.support:support-core-ui:$supportLibs_version" // Remove after version 28+

// Kotlin
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// Test dependencies
testImplementation 'junit:junit:4.12'
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}

apply from: '../publish.gradle'
21 changes: 21 additions & 0 deletions viewdsl-support-compat/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
16 changes: 16 additions & 0 deletions viewdsl-support-compat/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!--
~ Copyright (c) 2018. Louis Cognault Ayeva Derman
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest package="splitties.viewdsl.support.compat"/>
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@

@file:Suppress("NOTHING_TO_INLINE")

package xyz.louiscad.splittiessample.extensions
package splitties.viewdsl.support.compat

import android.content.Context
import android.support.v4.widget.NestedScrollView
import splitties.views.inflate
import xyz.louiscad.splittiessample.R

inline fun nestedScrollView(ctx: Context): NestedScrollView = ctx.inflate(R.layout.nestedscrollview_with_scrollbars)
21 changes: 21 additions & 0 deletions viewdsl-support-compat/src/main/res/values/styles.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2018. Louis Cognault Ayeva Derman
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<resources>
<style name="WithScrollbarsStyle">
<item name="android:scrollbars">horizontal|vertical</item>
</style>
</resources>