Skip to content

Commit

Permalink
Bump SDK 34
Browse files Browse the repository at this point in the history
  • Loading branch information
Xlythe committed Jan 7, 2024
1 parent 10d0aa6 commit e995836
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
10 changes: 5 additions & 5 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 33
compileSdkVersion 34

defaultConfig {
applicationId "com.xlythe.view.floating.sample"
minSdkVersion 14
targetSdkVersion 33
minSdkVersion 19
targetSdkVersion 34
versionCode 1
versionName "1.0"
}
Expand All @@ -26,6 +26,6 @@ dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':floating-view')
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'com.google.android.material:material:1.11.0'
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.xlythe.view.floating.sample;

import android.annotation.SuppressLint;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
Expand Down Expand Up @@ -30,6 +31,7 @@ public View inflateView(@NonNull ViewGroup parent) {
return LayoutInflater.from(getContext()).inflate(R.layout.floating_notes, parent, false);
}

@SuppressLint("LaunchActivityFromNotification")
@NonNull
@Override
protected Notification createNotification() {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.android.tools.build:gradle:8.2.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'

// NOTE: Do not place your application dependencies here; they belong
Expand Down
6 changes: 3 additions & 3 deletions floating-view/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Properties localProperties = new Properties()
localProperties.load(project.rootProject.file('local.properties').newDataInputStream())

android {
compileSdkVersion 33
compileSdkVersion 34

defaultConfig {
minSdkVersion 14
targetSdkVersion 33
minSdkVersion 19
targetSdkVersion 34
}
buildTypes {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

import android.animation.Animator;

import androidx.annotation.NonNull;

public abstract class AnimationFinishedListener implements Animator.AnimatorListener {
@Override
public void onAnimationCancel(Animator animation) {
public void onAnimationCancel(@NonNull Animator animation) {
onAnimationFinished();
}

@Override
public void onAnimationRepeat(Animator animation) {
public void onAnimationRepeat(@NonNull Animator animation) {
}

@Override
public void onAnimationStart(Animator animation) {
public void onAnimationStart(@NonNull Animator animation) {
}

@Override
public void onAnimationEnd(Animator animation) {
public void onAnimationEnd(@NonNull Animator animation) {
onAnimationFinished();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.graphics.PixelFormat;
import android.graphics.Point;
import android.os.Build;
Expand Down Expand Up @@ -608,6 +607,7 @@ private void calculateWiggle(int x, int y) {
mWiggle.y = Math.max(-1 * DELETE_BOX_HEIGHT / 8, (y - closeIconY) / 10);
}

@SuppressLint("ClickableViewAccessibility")
public void open() {
if (mRootView.getVisibility() == View.GONE) {
mRootView.setVisibility(View.VISIBLE);
Expand Down Expand Up @@ -637,7 +637,7 @@ public void onReceive(Context context, Intent intent) {
close();
}
};
getContext().registerReceiver(mHomeKeyReceiver, new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
ContextCompat.registerReceiver(getContext(), mHomeKeyReceiver, new IntentFilter(Intent.ACTION_CLOSE_SYSTEM_DIALOGS), ContextCompat.RECEIVER_EXPORTED);
}
}

Expand Down Expand Up @@ -717,7 +717,7 @@ public void onAnimationFinished() {
}
}

@SuppressLint("RtlHardcoded")
@SuppressLint({"RtlHardcoded", "ClickableViewAccessibility"})
private void show() {
if (DEBUG) Log.v(TAG, "show()");
if (mView == null) {
Expand Down Expand Up @@ -813,7 +813,7 @@ public void onConfigurationChanged(Configuration newConfig) {

private int getStatusBarHeight() {
int result = 0;
@SuppressLint("DiscouragedApi") int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
@SuppressLint({"DiscouragedApi", "InternalInsetResource"}) int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
result = getResources().getDimensionPixelSize(resourceId);
}
Expand Down

0 comments on commit e995836

Please sign in to comment.