Skip to content
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
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
cache: gradle

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4

- name: Build
run: ./gradlew build
33 changes: 33 additions & 0 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish Release

on:
push:
tags:
- '*'

env:
RELEASE_SIGNING_ENABLED: true

jobs:
publish:
runs-on: ubuntu-latest
if: github.repository == 'Commit451/AdapterLayout'

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: '17'
cache: gradle

- name: Release to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral -PVERSION_NAME="${GITHUB_REF_NAME}" --no-configuration-cache
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

26 changes: 6 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
# AdapterLayout
ViewGroup backed by RecyclerView.Adapter, allowing for easy data set manipulation with non recycling views. Aka RecyclerView minus the recycling.

[![Build Status](https://travis-ci.org/Commit451/AdapterLayout.svg?branch=master)](https://travis-ci.org/Commit451/AdapterLayout) [![](https://jitpack.io/v/Commit451/AdapterLayout.svg)](https://jitpack.io/#Commit451/AdapterLayout)
[![Build](https://github.com/Commit451/AdapterLayout/actions/workflows/ci.yml/badge.svg)](https://github.com/Commit451/AdapterLayout/actions/workflows/ci.yml) [![Maven Central](https://img.shields.io/maven-central/v/com.commit451.adapterlayout/adapterlayout.svg?label=Maven%20Central)](https://central.sonatype.com/search?q=g:com.commit451.adapterlayout)

# Dependency
```gradle
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
```
and within your application `build.gradle`

```gradle
dependencies {
implementation 'com.github.Commit451.AdapterLayout:adapterlayout:latest.release.here'
implementation "com.commit451.adapterlayout:adapterlayout:latest.release.here"
}
```
and for [FlowLayout](https://github.com/blazsolar/FlowLayout) support:
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.wefika/flowlayout/badge.svg?style=flat)](https://maven-badges.herokuapp.com/maven-central/com.wefika/flowlayout)
```gradle
dependencies {
//add the latest of FlowLayout
implementation 'com.wefika:flowlayout:latest.release.here'
implementation 'com.github.Commit451.AdapterLayout:adapterflowlayout:latest.release.here'
}
```
and for Kotlin extensions support:
```gradle
dependencies {
implementation 'com.github.Commit451.AdapterLayout:adapterlayout-kotlin:latest.release.here'
// add the latest of FlowLayout
implementation "com.wefika:flowlayout:latest.release.here"
implementation "com.commit451.adapterlayout:adapterflowlayout:latest.release.here"
}
```
Kotlin extensions are included in `adapterlayout`.

# Usage
See the sample project for full usage.
Expand Down
30 changes: 0 additions & 30 deletions adapterflowlayout/build.gradle

This file was deleted.

54 changes: 54 additions & 0 deletions adapterflowlayout/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
import com.vanniktech.maven.publish.SonatypeHost

plugins {
id("com.android.library")
id("com.vanniktech.maven.publish")
}

group = findProperty("GROUP") as String
version = findProperty("VERSION_NAME") as String

android {
namespace = "com.commit451.adapterflowlayout"
compileSdk = 35

defaultConfig {
minSdk = 21
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

lint {
abortOnError = false
}
}

dependencies {
compileOnly("com.wefika:flowlayout:0.4.1") {
exclude(group = "com.intellij", module = "annotations")
}
compileOnly(project(":adapterlayout"))
}

mavenPublishing {
configure(AndroidSingleVariantLibrary("release", true, true))
coordinates("com.commit451.adapterlayout", "adapterflowlayout", version.toString())
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
if (System.getenv("RELEASE_SIGNING_ENABLED") == "true") {
signAllPublications()
}
}
3 changes: 1 addition & 2 deletions adapterflowlayout/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.commit451.adapterflowlayout"/>
<manifest />

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
@file:Suppress("unused")

package com.commit451.adapterflowlayout

import android.content.Context
import android.util.AttributeSet
import androidx.annotation.Nullable
import androidx.recyclerview.widget.RecyclerView
import com.commit451.adapterlayout.AdapterLayoutDelegate
import com.wefika.flowlayout.FlowLayout

/**
* [FlowLayout] with [RecyclerView.Adapter] support.
*/
class AdapterFlowLayout : FlowLayout {

private var adapterLayoutDelegate: AdapterLayoutDelegate? = null

constructor(context: Context?) : super(context)

constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)

constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr)

@get:Nullable
var adapter: RecyclerView.Adapter<*>?
get() = adapterLayoutDelegate?.getAdapter()
set(value) {
if (adapterLayoutDelegate == null) {
adapterLayoutDelegate = AdapterLayoutDelegate(this)
}
adapterLayoutDelegate?.setAdapter(value)
}

@Nullable
fun getViewHolderAt(index: Int): RecyclerView.ViewHolder? {
return adapterLayoutDelegate?.getViewHolderAt(index)
}
}
1 change: 0 additions & 1 deletion adapterlayout-kotlin/.gitignore

This file was deleted.

28 changes: 0 additions & 28 deletions adapterlayout-kotlin/build.gradle

This file was deleted.

17 changes: 0 additions & 17 deletions adapterlayout-kotlin/proguard-rules.pro

This file was deleted.

1 change: 0 additions & 1 deletion adapterlayout-kotlin/src/main/AndroidManifest.xml

This file was deleted.

27 changes: 0 additions & 27 deletions adapterlayout/build.gradle

This file was deleted.

Loading