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

test #8

Open
wants to merge 27 commits into
base: testing
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e2d3240
Merge pull request #2 from mkrupal09/testing
mkrupal09 Jul 5, 2018
d68aa86
Revert "Testing branch"
mkrupal09 Jul 5, 2018
ca902b9
Merge pull request #3 from mkrupal09/revert-2-testing
mkrupal09 Jul 5, 2018
98564bc
merge
Jul 13, 2018
7e08e48
merge
Jul 13, 2018
769a412
merge
Jul 13, 2018
95f0601
merge
Jul 13, 2018
0cca4c1
merge
Jul 13, 2018
2e1e628
Bug fixed.
Jul 17, 2018
c30dd37
Update README.md
mkrupal09 Oct 15, 2018
47b6a9c
added addOnly() and removeOnly() method
Oct 18, 2018
bb225f2
Update README.md
mkrupal09 Dec 14, 2018
5ce52e8
added setTag() getTag() method for holder
Jan 8, 2019
a092e91
added setTag() getTag() method for holder
Jan 8, 2019
4d3bfa1
Merge branch 'master' of https://github.com/mkrupal09/EasyAdapter
Jan 8, 2019
3a608b2
add onBindViewHolder with holder
Jan 8, 2019
2169071
added invalidateObserver() to invalidate data change observer
Jan 18, 2019
259b19c
added setOnClickListeners(), setOnCheckChangeListeners() method to se…
Jan 22, 2019
9c874ef
added setOnClickListeners(), setOnCheckChangeListeners() method to se…
Jan 22, 2019
cabc7e4
added setOnClickListeners(), setOnCheckChangeListeners() method to se…
Jan 22, 2019
d4ca5ad
added removeonly method
Feb 7, 2019
89d8eff
Create codeql-analysis.yml
mkrupal09 Sep 9, 2021
b52ab49
Add files via upload
mkrupal09 Jun 28, 2022
09053ef
Update README.md
mkrupal09 Jun 28, 2022
605b5a2
Update README.md
mkrupal09 Jun 28, 2022
47c5952
Update README.md
mkrupal09 Jul 14, 2022
e1a2551
Update README.md
mkrupal09 Jul 14, 2022
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
10 changes: 6 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ jobs:
# - image: circleci/postgres:9.4

working_directory: ~/repo

docker:
- image: circleci/android:api-27-alpha
environment:
# Customize the JVM maximum heap limit
JVM_OPTS: -Xmx3200m
Expand All @@ -31,15 +32,16 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run: gradle dependencies
- run:
name: Download Dependencies
command: ./gradlew androidDependencies

- save_cache:
paths:
- ~/.gradle
key: v1-dependencies-{{ checksum "build.gradle" }}

# run tests!
- run: gradle test




71 changes: 71 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
schedule:
- cron: '43 13 * * 4'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
60 changes: 35 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# EasyAdapter Based on [**Android Data Binding**](https://developer.android.com/topic/libraries/data-binding/index.html)

![](images/easyadapter-01.png)

### Create your recyclerview adapter in just 3 lines.

> RecyclerView is mostly used android widgets in the Android Project, for that you have to implement an Adapter which provides the items for the view. In most cases it require the same base logic, but require you to write everything again and again.so here is sollution for it.

[![N|Solid](https://img.shields.io/badge/Android%20Arsenal-EasyAdapter-brightgreen.svg)](https://android-arsenal.com/details/1/6950)
[![Download](https://api.bintray.com/packages/mkrupal09/EasyAdapter/EasyAdapter/images/download.svg) ](https://bintray.com/mkrupal09/EasyAdapter/EasyAdapter/_latestVersion)
[![Circle
CI](https://circleci.com/gh/mkrupal09/EasyAdapter.svg?style=svg)](https://circleci.com/gh/mkrupal09/EasyAdapter)

- Reduce Boilerplate code to create adapter and holder.
- you can filter adapter without coding much.
Expand All @@ -18,44 +23,33 @@
Download
--------

Grab via Maven:
```xml
<dependency>
<groupId>com.dc.easyadapter</groupId>
<artifactId>easyadapter</artifactId>
<version>2.0.3</version>
<type>pom</type>
</dependency>
app > build.gradle
```groovy
implementation 'com.github.mkrupal09:EasyAdapter:v2.0.5'
```
or Gradle:

root > build.gradle, add jitpack.io maven url in allprojects>repositories
```groovy
implementation 'com.dc.easyadapter:easyadapter:2.0.3'
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
```

To enable data binding
-------------------------

inside app build.gradle
inside app build.gradle add buildFeatures block(if not) and add dataBinding flag as mentioned below
```groovy
android {
dataBinding {
enabled = true
buildFeatures {
dataBinding true
}
}
```

For Kotlin also add
```groovy
dependencies{
kapt 'com.android.databinding:compiler:3.1.2'
}

apply plugin: 'kotlin-kapt' //Top at build.gradle
```




## How?
``` java
adapter = new EasyAdapter<Category, InflaterCategoryBinding>(R.layout.inflater_category) {
Expand All @@ -64,6 +58,7 @@ adapter = new EasyAdapter<Category, InflaterCategoryBinding>(R.layout.inflater_c
binding.tvName.setText(model.name);
}
}

```

## Usage
Expand All @@ -79,6 +74,17 @@ class CategoryAdapter() :EasyAdapter<Category, InflaterCategoryBinding>(R.layout
}
}
```
###java
``` java
public CategoryAdapter() {
super(R.layout.inflater_category);
}

@Override
public void onBind(@NonNull InflaterCategoryBinding binding, @NonNull Category model) {
binding.tvName.setText(model.name);
}
```

#### 1) To Handle recycler View item Events

Expand Down Expand Up @@ -288,6 +294,10 @@ without this person cannot achieve swipe action in recyclerview
https://android.jlelse.eu/android-tools-attributes-listitem-sample-data-rocks-bbf49aaa9f07 <br />
for sharing knowledge of Android Tools attributes

* Buy me a Beer. :beer:

<a href="https://www.paypal.me/mkrupal09" target="_blank"><img src="https://www.paypalobjects.com/webstatic/i/logo/rebrand/ppcom.svg" width="100" height="40" style="margin-bottom:-15px;"></a>

License
=======

Expand Down
18 changes: 14 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "easyadapter.dc.com.easyadapter"
minSdkVersion 16
targetSdkVersion 27
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -25,6 +25,10 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}*/
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
Expand All @@ -37,11 +41,17 @@ dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
kapt 'com.android.databinding:compiler:3.1.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'

implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.0'
implementation project(':library')

implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
/*implementation "com.github.mkrupal09:EasyAdapter:9be4f31"*/
/*implementation 'com.dc.easyadapter:easyadapter:1.2'*/
debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'

implementation 'com.devbrackets.android:exomedia:4.3.0'


}
repositories {
Expand Down
27 changes: 26 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,45 @@
package="easyadapter.dc.com.easyadapter">

<uses-permission android:name="android.permission.WRITE_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">
<activity android:name=".CountryListActivity">
<activity
android:launchMode="singleInstance"
android:label="@string/select_category"
android:name=".MainActivity"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".VideoActivity"
android:label="@string/select_category"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
<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:host="www.healthywage.com"
android:pathPrefix="/payout/request_payout_confirm"
android:scheme="https" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class Category : Serializable {
var parentId: String = ""
var image: String = ""
var isSelected: Boolean = false

companion object {
val BUN_SEL_CATEGORY_LIST = "SEL_CATEGORY_LIST"
const val SEND_OBJECT = "category"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package easyadapter.dc.com.easyadapter

import android.widget.ImageView
import com.bumptech.glide.Glide
import easyadapter.dc.com.easyadapter.databinding.InflaterCategoryBinding
import easyadapter.dc.com.library.EasyAdapter

Expand All @@ -22,9 +24,26 @@ class CategoryAdapter(val enableSwipToDelete: Boolean) :
}

override fun onBind(binding: InflaterCategoryBinding, model: Category) {
}

override fun onBind(binding: InflaterCategoryBinding, model: Category, holder: EasyHolder?) {
super.onBind(binding, model, holder)
binding.apply {
tvName.text = model.name
tvName.isSelected = model.isSelected
}
binding.ivCategoryIcon.setImageResource(R.drawable.abc_ic_ab_back_material)


if (data.indexOf(model) % 2 == 0) {
binding.ivCategoryIcon.layoutParams.height = 100
binding.ivCategoryIcon.scaleType = ImageView.ScaleType.FIT_CENTER
} else {
binding.ivCategoryIcon.layoutParams.height = 500
binding.ivCategoryIcon.scaleType = ImageView.ScaleType.CENTER_CROP
}

Glide.with(binding.ivCategoryIcon).load("https://www.healthywage.com/wp-content/uploads/2015/11/Kristin-W-BeforeAfter2-540x345.jpg").into(binding.ivCategoryIcon);
helper.startSwipe(holder)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package easyadapter.dc.com.easyadapter;

import android.support.annotation.NonNull;

import easyadapter.dc.com.easyadapter.databinding.InflaterCategoryBinding;
import easyadapter.dc.com.library.EasyAdapter;

/**
* Created by HB on 1/10/18.
*/
public class CategoryAdapterJava extends EasyAdapter<Category, InflaterCategoryBinding> {
public CategoryAdapterJava() {
super(R.layout.inflater_category);
}

@Override
public void onBind(@NonNull InflaterCategoryBinding binding, @NonNull Category model) {
binding.tvName.setText(model.getName());
}
}
Loading