mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-08-03 18:56:44 -04:00
Lint passes
This commit is contained in:
parent
d9b0a06840
commit
5d35175c26
@ -99,6 +99,7 @@ android {
|
||||
|
||||
// Warnings
|
||||
warning 'InvalidPackage'
|
||||
warning 'StringFormatInvalid'
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
@ -1,7 +1,10 @@
|
||||
package org.kiwix.kiwixmobile.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Build.VERSION;
|
||||
import android.os.Build.VERSION_CODES;
|
||||
import android.speech.tts.TextToSpeech;
|
||||
import android.speech.tts.UtteranceProgressListener;
|
||||
import android.util.Log;
|
||||
@ -78,7 +81,9 @@ public class KiwixTextToSpeech {
|
||||
currentTTSTask = null;
|
||||
} else if (tts.isSpeaking()) {
|
||||
if (tts.stop() == TextToSpeech.SUCCESS) {
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
|
||||
tts.setOnUtteranceProgressListener(null);
|
||||
}
|
||||
onSpeakingListener.onSpeakingEnded();
|
||||
}
|
||||
} else {
|
||||
@ -122,7 +127,9 @@ public class KiwixTextToSpeech {
|
||||
public void stop() {
|
||||
if (tts.stop() == TextToSpeech.SUCCESS) {
|
||||
currentTTSTask = null;
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
|
||||
tts.setOnUtteranceProgressListener(null);
|
||||
}
|
||||
onSpeakingListener.onSpeakingEnded();
|
||||
}
|
||||
}
|
||||
@ -196,10 +203,13 @@ public class KiwixTextToSpeech {
|
||||
public void pause() {
|
||||
paused = true;
|
||||
currentPiece.decrementAndGet();
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
|
||||
tts.setOnUtteranceProgressListener(null);
|
||||
}
|
||||
tts.stop();
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public void start() {
|
||||
if (!paused)
|
||||
return;
|
||||
|
@ -1,7 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:color="?android:colorControlHighlight">
|
||||
|
||||
<item android:drawable="@drawable/get_content_btn_shape"/>
|
||||
</ripple>
|
32
app/src/main/res/values-v21/styles.xml
Normal file
32
app/src/main/res/values-v21/styles.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">@color/primary_dark</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
|
||||
<item name="searchViewStyle">@style/SearchViewStyle</item>
|
||||
<item name="android:textCursorDrawable">@null</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="progressBackgroundColor">@color/primary_dark</item>
|
||||
<item name="listBackground">@drawable/list_bg</item>
|
||||
<item name="android:windowContentOverlay">@null</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="arrowBackDrawable">@drawable/ic_action_back</item>
|
||||
<item name="arrowForwardDrawable">@drawable/ic_action_forward</item>
|
||||
<item name="drawerBackground">@color/drawer_background_day</item>
|
||||
<item name="plusDrawable">@drawable/ic_action_plus</item>
|
||||
<item name="deleteDrawable">@drawable/ic_action_delete</item>
|
||||
<item name="dividerColor">@color/divider_light</item>
|
||||
<item name="selectedBackground">@drawable/list_bg_light</item>
|
||||
<item name="android:itemBackground">@color/primary_light</item>
|
||||
<item name="android:textColorPrimary">@color/primary</item>
|
||||
<item name="android:textColorSecondary">@color/primary</item>
|
||||
<item name="android:textColorTertiary">@color/primary</item>
|
||||
<item name="android:windowTranslucentStatus" tools:targetApi="22">true</item>
|
||||
<item name="colorControlNormal">@color/white</item>
|
||||
<item name="android:progressBackgroundTint">@color/greyed_out_selected</item>
|
||||
</style>
|
||||
</resources>
|
@ -29,7 +29,6 @@
|
||||
<item name="android:textColorTertiary">@color/primary</item>
|
||||
<item name="android:windowTranslucentStatus" tools:targetApi="22">true</item>
|
||||
<item name="colorControlNormal">@color/white</item>
|
||||
<item name="android:progressBackgroundTint">@color/greyed_out_selected</item>
|
||||
</style>
|
||||
|
||||
<style name="AppTheme.Night" parent="AppTheme.Base">
|
||||
|
BIN
captures/org.kiwix.kiwixmobile_2017.04.07_22.56.li
Normal file
BIN
captures/org.kiwix.kiwixmobile_2017.04.07_22.56.li
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user