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

Update project #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.iml
.gradle
.idea
/.idea/*
/local.properties
/.idea/workspace.xml
/.idea/libraries
Expand Down
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@

Check this [project on dribbble](https://dribbble.com/shots/2818273-Female-in-IT-Filters)

Read how we did it [on our blog](https://yalantis.com/blog/develop-filter-animation-kotlin-android/)

<img src="gif/dribbble.gif"/>


##Requirements
- Android SDK 18+

Expand All @@ -32,7 +31,7 @@ allprojects {
Add the dependency:
```Groovy
dependencies {
compile 'com.github.Yalantis:SearchFilter:v1.0.4'
implementation 'com.github.Yalantis:SearchFilter:v1.0.5'
}
```

Expand All @@ -42,17 +41,17 @@ Firstly you need to place `Filter` above your `RecyclerView` in the layout file

```xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
Expand All @@ -63,7 +62,7 @@ Firstly you need to place `Filter` above your `RecyclerView` in the layout file
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerVertical="true"
Expand All @@ -78,7 +77,7 @@ Firstly you need to place `Filter` above your `RecyclerView` in the layout file
android:textColor="@android:color/white"
android:textSize="20sp" />

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentRight="true"
Expand All @@ -88,16 +87,16 @@ Firstly you need to place `Filter` above your `RecyclerView` in the layout file

</RelativeLayout>

</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E4E6E3"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -110,7 +109,7 @@ Firstly you need to place `Filter` above your `RecyclerView` in the layout file
android:layout_height="wrap_content" />

</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

```

Expand Down
21 changes: 11 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
compileSdkVersion 33
buildToolsVersion "20.0.3"

defaultConfig {
applicationId "com.yalantis.fitfilter"
minSdkVersion 18
targetSdkVersion 24
versionCode 1
versionName "1.0"
targetSdkVersion 33
versionCode 2
versionName "1.0.5"
}
buildTypes {
release {
Expand All @@ -20,9 +20,10 @@ android {
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.facebook.fresco:fresco:0.13.0'
compile 'com.android.support:design:24.2.0'
compile project(':filter')
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':filter')

implementation "androidx.appcompat:appcompat:1.5.1"
implementation "com.google.android.material:material:1.6.1"
implementation "com.facebook.fresco:fresco:2.6.0"
}
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
android:largeHeap="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".ExampleActivity">
<activity android:name=".ExampleActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;

/**
* Created by galata on 17.09.16.
*/
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/java/com/yalantis/fitfilter/ExampleActivity.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package com.yalantis.fitfilter;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.util.DiffUtil;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
Expand All @@ -16,7 +17,6 @@
import com.yalantis.filter.widget.Filter;
import com.yalantis.filter.widget.FilterItem;

import org.jetbrains.annotations.NotNull;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -152,7 +152,7 @@ private List<Question> findByTags(List<Tag> tags) {
}

@Override
public void onFiltersSelected(@NotNull ArrayList<Tag> filters) {
public void onFiltersSelected(@NonNull ArrayList<Tag> filters) {
List<Question> newQuestions = findByTags(filters);
List<Question> oldQuestions = mAdapter.getQuestions();
mAdapter.setQuestions(newQuestions);
Expand All @@ -174,11 +174,11 @@ public void onFilterDeselected(Tag item) {

class Adapter extends FilterAdapter<Tag> {

Adapter(@NotNull List<? extends Tag> items) {
Adapter(@NonNull List<? extends Tag> items) {
super(items);
}

@NotNull
@NonNull
@Override
public FilterItem createView(int position, Tag item) {
FilterItem filterItem = new FilterItem(ExampleActivity.this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import android.content.Context;
import android.graphics.drawable.GradientDrawable;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.core.content.ContextCompat;
import androidx.recyclerview.widget.RecyclerView;

import com.facebook.drawee.view.SimpleDraweeView;

import java.util.List;
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/yalantis/fitfilter/Tag.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.yalantis.fitfilter;

import android.support.annotation.NonNull;

import androidx.annotation.NonNull;

import com.yalantis.filter.model.FilterModel;

Expand Down
18 changes: 9 additions & 9 deletions app/src/main/res/layout/activity_example.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
Expand All @@ -20,7 +20,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_centerVertical="true"
Expand All @@ -35,7 +35,7 @@
android:textColor="@android:color/white"
android:textSize="20sp" />

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_alignParentRight="true"
Expand All @@ -45,16 +45,16 @@

</RelativeLayout>

</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E4E6E3"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand All @@ -67,4 +67,4 @@
android:layout_height="wrap_content" />

</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/item_list.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
android:layout_marginRight="16dp"
android:background="#ebebeb" />

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/view_likes"
android:layout_width="24dp"
android:layout_height="24dp"
Expand All @@ -104,7 +104,7 @@
android:textColor="#827f93"
android:textSize="12sp" />

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/view_chat"
android:layout_width="24dp"
android:layout_height="24dp"
Expand All @@ -125,7 +125,7 @@
android:textColor="#827f93"
android:textSize="12sp" />

<android.support.v7.widget.AppCompatImageView
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/view_settings"
android:layout_width="24dp"
android:layout_height="24dp"
Expand Down
12 changes: 7 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
buildscript {
repositories {
jcenter()
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.0.0"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:1.0.0"
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.10"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:1.7.10"
}
}

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

Expand Down
Loading