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

Fixes for issues #18, #19, #21, #22, #23, Migration to AndroidX and kotlin and updated all dependencies #24

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

ext.kotlin_version = '1.3.70'

repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.android.tools.build:gradle:3.6.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
8 changes: 8 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true

# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

GROUP=com.mobidevelop.spl
VERSION_NAME=1.0.0

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jul 31 20:52:57 MST 2018
#Tue Mar 03 18:55:52 CET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
11 changes: 7 additions & 4 deletions split-pane-layout-demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 26
compileSdkVersion 29

defaultConfig {
applicationId "com.mobidevelop.spl.demo"
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
Expand All @@ -22,5 +25,5 @@ android {

dependencies {
implementation project(':split-pane-layout')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'androidx.appcompat:appcompat:1.1.0'
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.mobidevelop.spl.demo

import android.app.Activity
import android.os.Bundle
import com.mobidevelop.spl.widget.SplitPaneLayout
import com.mobidevelop.spl.widget.SplitPaneLayout.OnSplitterPositionChangedListener
import kotlinx.android.synthetic.main.activity_main.*
import java.text.DecimalFormat
import java.util.*

class MainActivity : Activity(), OnSplitterPositionChangedListener {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
layout.onSplitterPositionChangedListener = this
}

override fun onResume() {
super.onResume()
updateViews()
}

override fun onSplitterPositionChanged(splitPaneLayout: SplitPaneLayout, fromUser: Boolean) {
updateViews()
}

private fun updateViews() {
val percent = DecimalFormat.getPercentInstance(Locale.getDefault())
first.text = percent.format(layout.splitterPositionPercent.toDouble())
second.text = percent.format(1f - layout.splitterPositionPercent.toDouble())
}
}
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>

<com.mobidevelop.spl.widget.SplitPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<com.mobidevelop.spl.widget.SplitPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:spl="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
spl:orientation="horizontal"
spl:splitterSize="4dip"
spl:splitterPosition="33%"
spl:paneSizeMin="48dip"
spl:splitterBackground="@drawable/splitter_bg_h"
spl:splitterDraggingBackground="#88000000"
spl:paneSizeMin="48dip">
spl:splitterPosition="33%"
spl:splitterSize="4dip"
spl:splitterTouchSlop="48dp">

<TextView
android:id="@+id/first"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:text="@string/hello_world" />

<TextView
android:id="@+id/second"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:text="@string/hello_world" />

</com.mobidevelop.spl.widget.SplitPaneLayout>
15 changes: 9 additions & 6 deletions split-pane-layout-demo/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>

<com.mobidevelop.spl.widget.SplitPaneLayout
xmlns:android="http://schemas.android.com/apk/res/android"
<com.mobidevelop.spl.widget.SplitPaneLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:spl="http://schemas.android.com/apk/res-auto"
android:id="@+id/layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
spl:orientation="vertical"
spl:splitterSize="4dip"
spl:splitterPosition="50%"
spl:paneSizeMin="48dip"
spl:splitterBackground="@drawable/splitter_bg_v"
spl:splitterDraggingBackground="#88000000"
spl:paneSizeMin="48dip">
spl:splitterPosition="50%"
spl:splitterSize="4dip"
spl:splitterTouchSlop="48dp">

<TextView
android:id="@+id/first"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:text="@string/hello_world" />

<TextView
android:id="@+id/second"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clickable="true"
android:focusable="true"
android:text="@string/hello_world" />

</com.mobidevelop.spl.widget.SplitPaneLayout>
9 changes: 6 additions & 3 deletions split-pane-layout/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 26
compileSdkVersion 29

defaultConfig {
minSdkVersion 16
targetSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

}

Expand Down
Loading