Skip to content

Commit

Permalink
Target sdk 33 (#50)
Browse files Browse the repository at this point in the history
* Updated target sdk to 33 and some other libs

* prepare for release: bump version to 1.2.5

* Fix doc about obsolete android support library

* Updated android gradle plugin to v7.4.2

---------

Co-authored-by: Rustam Gumerov <[email protected]>
  • Loading branch information
psrustik and Rustam Gumerov authored Jun 19, 2023
1 parent b06599a commit b4b0f2b
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 19 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ implementation "androidx.recyclerview:recyclerview:x.x.x"
```
2. Add view to layout:
```xml
<android.support.v4.view.ViewPager
<androidx.viewpager.widget.ViewPager
android:id="@+id/pager"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Expand All @@ -52,11 +52,11 @@ indicator.attachToPager(pager);
## Attach to RecyclerView
1. Ensure that you have RecyclerView in dependencies:
```
implementation "com.android.support:recyclerview-v7:x.x.x"
implementation "androidx.recyclerview:recyclerview:x.x.x"
```
2. Add view to layout:
```xml
<android.support.v7.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
Expand Down
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:7.4.2'
}
}

Expand All @@ -25,16 +25,16 @@ task clean(type: Delete) {

ext {
minSdk = 14
compileSdk = 31
targetSdk = 31
compileSdk = 33
targetSdk = 33

isRelease = project.hasProperty('release')
versionName = isRelease ? VERSION_NAME : "$VERSION_NAME-SNAPSHOT"

appCompatVersion = "1.4.1"
appCompatVersion = "1.6.1"
constraintLayoutVersion = "2.1.4"
viewPagerVersion = "1.0.0"
viewPager2Version = "1.0.0"
cardViewVersion = "1.0.0"
recyclerViewVersion = "1.2.1"
recyclerViewVersion = "1.3.0"
}
1 change: 1 addition & 0 deletions demo/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'

android {
namespace "ru.tinkoff.scrollingpagerindicator.demo"
compileSdkVersion rootProject.compileSdk

defaultConfig {
Expand Down
8 changes: 4 additions & 4 deletions demo/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="ru.tinkoff.scrollingpagerindicator.demo">
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="false"
Expand All @@ -10,11 +9,12 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
tools:ignore="DataExtractionRules,GoogleAppIndexingWarning">
<activity
android:name="ru.tinkoff.scrollingpagerindicator.demo.MainActivity"
android:screenOrientation="portrait"
android:exported="true">
android:exported="true"
tools:ignore="LockedOrientationActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package ru.tinkoff.scrollingpagerindicator.demo;

import android.annotation.SuppressLint;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;

/**
Expand All @@ -20,11 +22,13 @@ public class DemoRecyclerViewAdapter extends RecyclerView.Adapter<DemoRecyclerVi
this.itemWidth = itemWidth;
}

@SuppressLint("NotifyDataSetChanged")
void setCount(int count) {
this.count = count;
notifyDataSetChanged();
}

@NonNull
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ protected void onCreate(Bundle savedInstanceState) {
}

private int getScreenWidth() {
@SuppressWarnings("ConstantConditions")
Display display = ((WindowManager) getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
Point screenSize = new Point();
display.getSize(screenSize);
Expand Down
8 changes: 5 additions & 3 deletions demo/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,21 +92,23 @@
app:layout_constraintTop_toTopOf="@id/recycler"
app:spi_dotColor="@color/dotNormal"
app:spi_dotSelectedColor="@color/dotHighlight"
app:spi_orientation="vertical" />
app:spi_orientation="vertical"
android:layout_marginStart="32dp" />

<ru.tinkoff.scrollingpagerindicator.ScrollingPagerIndicator
android:id="@+id/custom_recycler_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="32dp"
app:layout_constraintBottom_toBottomOf="@id/recycler"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/recycler"
app:spi_lastDotDrawable="@drawable/baseline_free_breakfast_24"
app:spi_firstDotDrawable="@drawable/baseline_accessibility_new_24"
app:spi_dotColor="@color/dotNormal"
app:spi_dotSelectedColor="@color/dotHighlight"
app:spi_orientation="vertical" />
app:spi_orientation="vertical"
android:layout_marginEnd="32dp"
android:layout_marginRight="32dp" />

<TextView
android:id="@+id/page_count_label"
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ org.gradle.jvmargs=-Xmx1536m
# org.gradle.parallel=true
android.useAndroidX=true

VERSION_NAME=1.2.4
VERSION_CODE=14
VERSION_NAME=1.2.5
VERSION_CODE=15
GROUP=ru.tinkoff.scrollingpagerindicator

POM_DESCRIPTION=Pager indicator inspired by Instagram. Lightweight and easy to set up.
Expand Down
2 changes: 2 additions & 0 deletions scrollingpagerindicator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ if(new File(customGradleScript).exists()){
}

android {
namespace "ru.tinkoff.scrollingpagerindicator"

compileSdkVersion rootProject.compileSdk

defaultConfig {
Expand Down
2 changes: 1 addition & 1 deletion scrollingpagerindicator/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<manifest package="ru.tinkoff.scrollingpagerindicator" />
<manifest />

0 comments on commit b4b0f2b

Please sign in to comment.