Skip to content

Commit

Permalink
Release 1.1.5
Browse files Browse the repository at this point in the history
Added publishing scripts for Maven Central
Updated all dependencies to latest versions
  • Loading branch information
AviranAbady committed Dec 31, 2021
1 parent 2f22321 commit ab1f2c0
Show file tree
Hide file tree
Showing 15 changed files with 377 additions and 269 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

# Created by https://www.gitignore.io/api/android,androidstudio

#gradle.properties
#gradlew
#gradlew.bat

### Android ###
# Built application files
Expand Down Expand Up @@ -170,8 +172,6 @@ fabric.properties

# End of https://www.gitignore.io/api/android,androidstudio

deploy.gradle
deploy.properties
bintray.properties

#gradle/*
publishing-scripts/*

19 changes: 14 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-CookieBar2-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/6122)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/6474fc01133444e0b6f615d9b1af8589)](https://www.codacy.com/app/AviranAbady/CookieBar2?utm_source=github.com&utm_medium=referral&utm_content=AviranAbady/CookieBar2&utm_campaign=badger)
[![AndroidWeekly335](https://img.shields.io/badge/Android%20Weekly-%23335-brightgreen)](http:https://androidweekly.net/issues/issue-335)
[![](https://jitpack.io/v/AviranAbady/CookieBar2.svg)](https://jitpack.io/#AviranAbady/CookieBar2)
[![](https://img.shields.io/bintray/dt/aviran/projects/cookiebar2)](https://bintray.com/beta/#/aviran/projects/cookiebar2?tab=statistics)


CookieBar 2
===============
CookieBar is a lightweight library for showing a brief message at the top or bottom of the screen.<br/><br/>
CookieBar is a lightweight UI/UX library for displaying an interactive message on the screen.<br/><br/>

```gradle
implementation 'org.aviran.cookiebar2:cookiebar2:1.1.4'
implementation 'org.aviran.cookiebar2:cookiebar2:1.1.5'
```
CookieBar2 is now hosted in Maven Central, make sure you have `mavenCentral()` added to your repositories in `build.gradle`

```
buildscript {
...
repositories {
...
mavenCentral()
}
}
```

## Screenshot
<img src="https://raw.githubusercontent.com/AviranAbady/storage/master/cookiebar2_1.1.0.gif">

Main differences from the original Cookiebar library are:
Latest additions to CookieBar2:

* Swipe to dismiss has been added.
* Programmatic dismiss functionality added.
Expand Down
26 changes: 12 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 30
compileSdkVersion 31
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "org.aviran.cookiebarsample"
minSdkVersion 15
targetSdkVersion 30
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
Expand All @@ -19,27 +19,25 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
buildFeatures {
viewBinding true
}

}


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.0'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.2.0'
testImplementation 'junit:junit:4.12'
implementation 'androidx.appcompat:appcompat:1.4.0'
testImplementation 'junit:junit:4.13.1'
implementation project(path: ':cookiebar2')
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
}
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:exported="true"
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/org/aviran/cookiebarsample/MainFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import android.widget.Toast
import androidx.fragment.app.Fragment
import kotlinx.android.synthetic.main.fragment_layout.*
import org.aviran.cookiebar2.CookieBar
Expand All @@ -17,7 +16,7 @@ import org.aviran.cookiebar2.CookieBarDismissListener.DismissType
*/
class MainFragment : Fragment() {

var topCookieCounter = 0
private var topCookieCounter = 0

override fun onCreateView(
inflater: LayoutInflater, container: ViewGroup?,
Expand Down
22 changes: 14 additions & 8 deletions app/src/main/res/layout/custom_cookie.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
android:layout_marginTop="8dp"
android:layout_marginBottom="16dp"
android:src="@mipmap/ic_launcher"

app:layout_constraintBottom_toTopOf="@+id/custom_cookie_btn_new"
app:layout_constraintTop_toTopOf="parent"
tools:layout_editor_absoluteX="36dp" />


app:layout_constraintEnd_toEndOf="@+id/custom_cookie_btn_new"
app:layout_constraintStart_toStartOf="@+id/custom_cookie_btn_new"
app:layout_constraintTop_toTopOf="parent" />


<TextView
Expand Down Expand Up @@ -54,19 +58,21 @@
android:id="@+id/custom_cookie_btn_new"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginLeft="16dp"
android:text="@string/newBtn"
app:layout_constraintBottom_toTopOf="@+id/custom_cookie_btn_open"
app:layout_constraintTop_toBottomOf="@+id/iv_icon"
tools:layout_editor_absoluteX="16dp" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_icon" />

<Button
android:id="@+id/custom_cookie_btn_open"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/open"
app:layout_constraintBottom_toTopOf="@+id/custom_cookie_btn_save"
app:layout_constraintTop_toBottomOf="@+id/custom_cookie_btn_new"
tools:layout_editor_absoluteX="16dp" />
app:layout_constraintStart_toStartOf="@+id/custom_cookie_btn_new"
app:layout_constraintTop_toBottomOf="@+id/custom_cookie_btn_new" />

<Button
android:id="@+id/custom_cookie_btn_save"
Expand All @@ -75,8 +81,8 @@
android:layout_marginBottom="8dp"
android:text="@string/save"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/custom_cookie_btn_open"
tools:layout_editor_absoluteX="16dp" />
app:layout_constraintStart_toStartOf="@+id/custom_cookie_btn_open"
app:layout_constraintTop_toBottomOf="@+id/custom_cookie_btn_open" />

<TextView
android:id="@+id/btn_action"
Expand Down
28 changes: 22 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,43 @@

buildscript {
ext {
kotlin_version = '1.3.72'
kotlin_version = '1.5.20'
dokka_version = '1.6.0'
}
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:${dokka_version}"
}
}

plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
id("org.jetbrains.dokka") version "1.6.0"
}

allprojects {
repositories {
jcenter()
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

task get_wrapper(type: Wrapper) {
gradleVersion = '7.0.2'
}


def publish_module_path = "${rootDir}/publishing-scripts/apublish-root.gradle"

if (project.file(publish_module_path).exists()) {
apply from: "${publish_module_path}"
}
41 changes: 31 additions & 10 deletions cookiebar2/build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'org.jetbrains.dokka'
apply plugin: 'maven-publish'

group='com.github.AviranAbady'

android {
compileSdkVersion 30
compileSdkVersion 31
buildToolsVersion "30.0.2"

defaultConfig {
minSdkVersion 15
targetSdkVersion 30
versionCode 1
versionName "1.0"
targetSdkVersion 31
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}

Expand All @@ -28,11 +26,34 @@ dependencies {
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.appcompat:appcompat:1.4.0'
}

ext {
PUBLISH_GROUP_ID = 'org.aviran.cookiebar2'
PUBLISH_VERSION = '1.1.5'
PUBLISH_ARTIFACT_ID = 'cookiebar2'
}



if (project.file('../deploy.gradle').exists()) {
apply from: '../deploy.gradle'
}
def publish_module_path = "${rootProject.projectDir}/apublishing-scripts/publish-module.gradle"

if (project.file(publish_module_path).exists()) {
apply from: "${publish_module_path}"
}
else {
project(':cookiebar2').afterEvaluate {
publishing {
publications {

release(MavenPublication) {
from components.release
groupId = PUBLISH_GROUP_ID
artifactId = PUBLISH_ARTIFACT_ID
version = PUBLISH_GROUP_ID
}
}
}
}
}
1 change: 0 additions & 1 deletion cookiebar2/src/main/java/org/aviran/cookiebar2/Cookie.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import android.os.Handler;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.MotionEvent;
Expand Down
18 changes: 0 additions & 18 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http:https://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http:https://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Aug 28 16:28:35 IDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-7.0.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-6.1.1-all.zip
Loading

0 comments on commit ab1f2c0

Please sign in to comment.