-
Notifications
You must be signed in to change notification settings - Fork 277
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
61 changed files
with
730 additions
and
310 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/com/seafile/seadroid2/annotation/Unstable.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.seafile.seadroid2.annotation; | ||
|
||
import static java.lang.annotation.ElementType.CONSTRUCTOR; | ||
import static java.lang.annotation.ElementType.FIELD; | ||
import static java.lang.annotation.ElementType.METHOD; | ||
import static java.lang.annotation.ElementType.TYPE; | ||
import static java.lang.annotation.RetentionPolicy.CLASS; | ||
|
||
import androidx.annotation.RequiresOptIn; | ||
|
||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* In this project, it only means that this feature is not fully validated, please use it with caution. | ||
* <p> | ||
* Referenced in Media3.UnstableApi | ||
*/ | ||
@Documented | ||
@Retention(CLASS) | ||
@Target({TYPE, METHOD, CONSTRUCTOR, FIELD}) | ||
@androidx.media3.common.util.UnstableApi | ||
@RequiresOptIn(level = RequiresOptIn.Level.ERROR) | ||
public @interface Unstable { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
app/src/main/java/com/seafile/seadroid2/compat/ViewCompat.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package com.seafile.seadroid2.compat | ||
|
||
import android.content.res.ColorStateList | ||
import android.graphics.PorterDuff | ||
import android.graphics.drawable.Drawable | ||
import android.view.View | ||
import androidx.annotation.IdRes | ||
import androidx.core.view.ViewCompat | ||
import com.seafile.seadroid2.framework.util.ForegroundCompat | ||
|
||
@Suppress("UNCHECKED_CAST") | ||
fun <T : View> View.requireViewByIdCompat(@IdRes id: Int): T = ViewCompat.requireViewById<T>(this, id) | ||
|
||
var View.scrollIndicatorsCompat: Int | ||
get() = ViewCompat.getScrollIndicators(this) | ||
set(value) { | ||
ViewCompat.setScrollIndicators(this, value) | ||
} | ||
|
||
fun View.setScrollIndicatorsCompat(indicators: Int, mask: Int) { | ||
ViewCompat.setScrollIndicators(this, indicators, mask) | ||
} | ||
|
||
var View.foregroundCompat: Drawable? | ||
get() = ForegroundCompat.getForeground(this) | ||
set(value) { | ||
ForegroundCompat.setForeground(this, value) | ||
} | ||
|
||
var View.foregroundGravityCompat: Int | ||
get() = ForegroundCompat.getForegroundGravity(this) | ||
set(value) { | ||
ForegroundCompat.setForegroundGravity(this, value) | ||
} | ||
|
||
var View.foregroundTintListCompat: ColorStateList? | ||
get() = ForegroundCompat.getForegroundTintList(this) | ||
set(value) { | ||
ForegroundCompat.setForegroundTintList(this, value) | ||
} | ||
|
||
var View.foregroundTintModeCompat: PorterDuff.Mode? | ||
get() = ForegroundCompat.getForegroundTintMode(this) | ||
set(value) { | ||
ForegroundCompat.setForegroundTintMode(this, value) | ||
} |
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/seafile/seadroid2/enums/WebViewPreviewType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.seafile.seadroid2.enums; | ||
|
||
import android.text.TextUtils; | ||
|
||
public enum WebViewPreviewType { | ||
SDOC, URL; | ||
|
||
public static boolean contains(String value) { | ||
if (TextUtils.isEmpty(value)){ | ||
return false; | ||
} | ||
|
||
try { | ||
WebViewPreviewType.valueOf(value); | ||
return true; | ||
} catch (IllegalArgumentException e) { | ||
return false; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.