mirror of
https://github.com/TwidereProject/Twidere-Android
synced 2025-02-09 00:08:41 +01:00
Down level the min api
This commit is contained in:
parent
d7dad43928
commit
a38b3c3982
@ -23,7 +23,7 @@ allprojects {
|
||||
globalCompileSdkVersion = 29
|
||||
globalBuildToolsVersion = "29.0.3"
|
||||
|
||||
globalMinSdkVersion = 19
|
||||
globalMinSdkVersion = 16
|
||||
globalTargetSdkVersion = 29
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.WorkerThread;
|
||||
@ -292,7 +293,15 @@ public class DataImportExportUtils implements Constants {
|
||||
@NonNull final String preferencesName, @NonNull final String entryName,
|
||||
@NonNull final SharedPreferencesProcessStrategy strategy,
|
||||
@NonNull final String data) throws IOException {
|
||||
if (!Objects.equals(entry.getName(), entryName)) return;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (!Objects.equals(entry.getName(), entryName)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (entry.getName().equals(entryName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
final JsonParser jsonParser = LoganSquare.JSON_FACTORY.createParser(data);
|
||||
if (jsonParser.getCurrentToken() == null) {
|
||||
jsonParser.nextToken();
|
||||
@ -327,7 +336,15 @@ public class DataImportExportUtils implements Constants {
|
||||
@NonNull final String data,
|
||||
@NonNull final ContentResolverProcessStrategy<List<T>> strategy)
|
||||
throws IOException {
|
||||
if (!Objects.equals(entry.getName(), entryName)) return;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (!Objects.equals(entry.getName(), entryName)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (entry.getName().equals(entryName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
List<T> itemsList = JsonSerializer.parseList(data, itemCls);
|
||||
strategy.importItem(context.getContentResolver(), itemsList);
|
||||
}
|
||||
@ -352,7 +369,15 @@ public class DataImportExportUtils implements Constants {
|
||||
@NonNull final String data,
|
||||
@NonNull final ContentResolverProcessStrategy<T> strategy)
|
||||
throws IOException {
|
||||
if (!Objects.equals(entry.getName(), entryName)) return;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (!Objects.equals(entry.getName(), entryName)) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (entry.getName().equals(entryName)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
T item = JsonSerializer.parse(data, itemCls);
|
||||
strategy.importItem(context.getContentResolver(), item);
|
||||
}
|
||||
|
@ -19,8 +19,12 @@
|
||||
|
||||
package androidx.core.view
|
||||
|
||||
fun createWindowInsetsCompat(obj: Any) = WindowInsetsCompat(obj)
|
||||
import android.annotation.TargetApi
|
||||
import android.os.Build
|
||||
import android.view.WindowInsets
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.KITKAT_WATCH)
|
||||
fun createWindowInsetsCompat(obj: Any) = WindowInsetsCompat.toWindowInsetsCompat(obj as WindowInsets)
|
||||
|
||||
val WindowInsetsCompat.unwrapped: Any?
|
||||
@Suppress("RestrictedApi")
|
||||
get() = this.toWindowInsets()
|
@ -19,12 +19,15 @@
|
||||
|
||||
package org.mariotaku.twidere.util.view
|
||||
|
||||
import android.annotation.TargetApi
|
||||
import android.os.Build
|
||||
import android.util.FloatProperty
|
||||
import android.util.Property
|
||||
import android.view.View
|
||||
|
||||
object ViewProperties {
|
||||
val TRANSLATION_X_RELATIVE: Property<View, Float> = object : FloatProperty<View>("xRelative") {
|
||||
val TRANSLATION_X_RELATIVE: Property<View, Float> = @TargetApi(Build.VERSION_CODES.N)
|
||||
object : FloatProperty<View>("xRelative") {
|
||||
override fun setValue(obj: View, value: Float) {
|
||||
obj.translationX = value * obj.width
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<style name="Theme.Twidere" parent="Theme.Twidere.DayNight">
|
||||
<item name="darkThemeResource">@style/Theme.Twidere.Dark</item>
|
||||
@ -41,7 +41,7 @@
|
||||
<!-- Window attributes -->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
|
||||
<item name="android:windowLayoutInDisplayCutoutMode" tools:targetApi="o_mr1">shortEdges</item>
|
||||
|
||||
<item name="windowActionBarOverlay">true</item>
|
||||
<item name="actionBarStyle">@style/Widget.Twidere.Viewer.ActionBar</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user