Skip to content

Commit

Permalink
+ upgraded Gradle v5.6.1 to v6.1-MILESTONE-2
Browse files Browse the repository at this point in the history
+ upgraded Gradle build tools v3.6.0-beta01 to v4.0.0-alpha06
+ upgraded minSdk from 14 to 16
+ changed normal dependencies to transitive dependencies
+ removed useless constraint-layout dependency
+ removed useless interface, methods, fields and resources
+ fixed some raw type variables and methods
+ fixed some method and field access levels
+ fixed item margins
+ all tabs can be enabled
+ SearchView highlight color changed
+ added, removed or fixed some other features or bugs without knowing
  • Loading branch information
AwaisKing committed Dec 22, 2019
1 parent 167321c commit 7a78600
Show file tree
Hide file tree
Showing 98 changed files with 395 additions and 1,065 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
5 changes: 5 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Credits to:
+ [GSON *-* [google/gson]](https://github.com/google/gson) *-* [Apache License 2.0]
+ [SearchView *-* [lapism/SearchView]](https://github.com/lapism/SearchView) *-* [Apache License 2.0]
+ [Chrome Custom Tabs *-* [GoogleChrome/custom-tabs-client]](https://github.com/GoogleChrome/custom-tabs-client) *-* [Apache License 2.0]
+ ~~[NoNet *-* [keiferstone/nonet]](https://github.com/keiferstone/nonet) *-* [Apache License 2.0]~~ **(removed)**

#### Licenses:
+ [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0)
45 changes: 22 additions & 23 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ android {

defaultConfig {
applicationId 'awais.backworddictionary'
minSdkVersion 14

minSdkVersion 16
targetSdkVersion 29
versionCode 104
versionName '10.4'

versionCode 105
versionName '10.5'

multiDexEnabled true

Expand All @@ -34,25 +36,22 @@ android {
}

dependencies {
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta3'
implementation 'androidx.dynamicanimation:dynamicanimation:1.1.0-alpha02'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.2.0-alpha01'
implementation 'androidx.recyclerview:recyclerview:1.1.0-rc01'
implementation 'androidx.cardview:cardview:1.0.0'

//noinspection GradleDependency because 17.0.0 needs minSdk >= 16
implementation 'com.google.firebase:firebase-core:16.0.9'
//noinspection GradleDependency because 18.0.0 needs minSdk >= 16
implementation 'com.google.firebase:firebase-ads:17.2.1'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1') { transitive = true }

implementation 'androidx.browser:browser:1.2.0-alpha09'
implementation 'com.squareup.okhttp3:okhttp:3.12.3'
implementation 'com.github.clans:fab:1.6.4'
implementation('androidx.multidex:multidex:2.0.1') { transitive true }
implementation('androidx.dynamicanimation:dynamicanimation:1.1.0-alpha03') { transitive true }
implementation('androidx.appcompat:appcompat:1.1.0') { transitive true }
implementation('androidx.legacy:legacy-support-v4:1.0.0') { transitive true }
implementation('com.google.android.material:material:1.2.0-alpha03') { transitive true }
implementation('androidx.recyclerview:recyclerview:1.2.0-alpha01') { transitive true }
implementation('androidx.cardview:cardview:1.0.0') { transitive true }

implementation('com.google.firebase:firebase-core:17.2.1') { transitive true }
implementation('com.google.firebase:firebase-ads:18.3.0') { transitive true }
implementation('com.google.firebase:firebase-crash:16.2.1') { transitive true }
implementation('com.crashlytics.sdk.android:crashlytics:2.10.1') { transitive true }

implementation('androidx.browser:browser:1.2.0') { transitive true }
implementation('com.squareup.okhttp3:okhttp:3.14.4') { transitive true }
implementation('com.github.clans:fab:1.6.4') { transitive true }
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.gms.google-services'
44 changes: 21 additions & 23 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -1,29 +1,27 @@
-optimizationpasses 5
-dontskipnonpubliclibraryclassmembers
-printmapping proguardMapping.txt
-optimizations !code/simplification/cast,!field/*,!class/merging/*
-keepattributes *Annotation*,Exceptions
-keepattributes InnerClasses,LineNumberTable
#-keepattributes Signature,LineNumberTable,SourceFile

-dontwarn android.webkit.WebView

-keep class **.R$* { public static final int *; }
-keep class **$Properties

-keepclassmembers,allowshrinking, class awais.backworddictionary.custom.WordItem { private *; }
-keepclassmembers,allowshrinking class awais.backworddictionary.custom.WordItem { private *; }

-keep,allowshrinking, public class android.webkit.**
-keep,allowshrinking public class android.webkit.*
-keep public class * extends android.app.Service
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.content.BroadcastReceiver
-keep,allowshrinking, public class * extends android.support.multidex.MultiDexApplication
-keep,allowshrinking public class * extends androidx.multidex.MultiDexApplication

-keep,allowshrinking, class * implements java.lang.annotation.Annotation
-keep,allowshrinking class * implements java.lang.annotation.Annotation
-keep public class * implements android.os.IInterface
-keep public class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-keepclassmembernames,allowshrinking, public class * implements java.io.Serializable {
-keepclassmembernames,allowshrinking public class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
Expand All @@ -36,27 +34,38 @@
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembernames,allowshrinking, public class * extends android.widget.NumberPicker {
-keepclassmembernames,allowshrinking public class * extends android.widget.NumberPicker {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers,allowshrinking, class * extends android.webkit.WebViewClient {
public void *(android.webkit.WebView, jav.lang.String);
-keepclassmembers,allowshrinking class * extends android.webkit.WebViewClient {
public void *(android.webkit.WebView, java.lang.String);
public void *(android.webkit.WebView, java.lang.String, android.graphics.Bitmap);
public boolean *(android.webkit.WebView, java.lang.String);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep public class java.nio.* { *; }
-keep public class * implements androidx.versionedparcelable.VersionedParcelable {
<init>();
}

-dontwarn rx.*
-dontwarn okio.**
-dontwarn org.apache.**
-dontwarn java.lang.invoke.*
-dontwarn com.squareup.okhttp3.**
-dontwarn android.webkit.WebView

#noinspection ShrinkerUnresolvedReference
################## GOOGLE ##################
-keep class com.google.gson.** { *; }
-keep class com.google.** { *; }
-keep class com.google.gson.stream.** { *; }
-keep class com.google.gson.examples.android.model.** { *; }
-keep class **$Properties

-keep class com.android.volley.** { *; }
-keep class com.android.volley.toolbox.** { *; }
Expand All @@ -68,14 +77,3 @@

################## OTHERS ##################
-keep class com.squareup.okhttp3.** { *; }

-dontwarn rx.*
-dontwarn okio.**
-dontwarn org.apache.**
-dontwarn com.squareup.okhttp3.**

-keep public class java.nio.* { *; }
-keep public class * implements androidx.versionedparcelable.VersionedParcelable {
<init>();
}
-dontwarn java.lang.invoke.*
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@

<activity
android:name=".customweb.WebViewActivity"
android:parentActivityName=".Main"
tools:targetApi="jelly_bean">
android:parentActivityName=".Main">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".Main" />
Expand Down
19 changes: 6 additions & 13 deletions app/src/main/java/awais/backworddictionary/DictionaryFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,16 @@
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;

import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;

import awais.backworddictionary.asyncs.WordsAsync;
import awais.backworddictionary.custom.WordItem;
import awais.backworddictionary.helpers.Utils;
import awais.backworddictionary.helpers.WordItemHolder;
import awais.backworddictionary.interfaces.FilterCheck;
import awais.backworddictionary.interfaces.FragmentCallback;

public class DictionaryFragment extends Fragment implements FragmentCallback, FilterCheck {
public class DictionaryFragment extends Fragment implements FragmentCallback {
private List<WordItem> wordList;
private RecyclerView recyclerView;
private Activity activity;
Expand Down Expand Up @@ -237,8 +235,7 @@ public void wordStarted() {
* @param showFilter either to show or hide filter
* @param method no idea what this is. i really forgot.
*/
@Override
public void showFilter(boolean showFilter, int method) {
void showFilter(boolean showFilter, int method) {
if (filterView == null) return;

if (showFilter) {
Expand Down Expand Up @@ -303,19 +300,15 @@ private float getExpandedOffset() {
return swipeRefreshLayout == null ? 250.0f : swipeRefreshLayout.getProgressViewEndOffset() * 2.0f;
}

@SuppressWarnings( "unchecked" )
void closeExpanded() {
if (wordsAdapter == null) return;
wordsAdapter.refreshShowDialogEnabled();

final LinkedHashSet[] hashSets = wordsAdapter.getHashSets();

final LinkedHashSet<WordItemHolder> wordHoldersSet = hashSets[1];
for (WordItemHolder holder : wordHoldersSet) holder.cardView.setCardBackgroundColor(-1);

final LinkedHashSet<WordItem> expandedWordsSet = hashSets[0];
for (WordItem wordItem : expandedWordsSet) wordItem.setExpanded(false);
for (WordItemHolder holder : wordsAdapter.holdersHashSet)
holder.cardView.setCardBackgroundColor(-1);

for (WordItem wordItem : wordsAdapter.expandedHashSet)
wordItem.setExpanded(false);
wordsAdapter.notifyDataSetChanged();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ class DictionaryWordsAdapter extends RecyclerView.Adapter<WordItemHolder> implem
private final Context context;
private final View.OnClickListener onClickListener;
private final SearchAdapter.OnItemClickListener itemClickListener;
private final LinkedHashSet<WordItemHolder> holdersHashSet = new LinkedHashSet<>();
private final LinkedHashSet<WordItem> expandedHashSet = new LinkedHashSet<>();
private final String[] noItemFound;
private final Filter filter;
private boolean isShowDialogEnabled;
private List<?> filterList;
final LinkedHashSet<WordItemHolder> holdersHashSet = new LinkedHashSet<>();
final LinkedHashSet<WordItem> expandedHashSet = new LinkedHashSet<>();

DictionaryWordsAdapter(@NonNull Context context, List<WordItem> wordList) {
this.context = context;
Expand Down Expand Up @@ -217,8 +217,4 @@ void updateList(List<WordItem> list){
void refreshShowDialogEnabled() {
this.isShowDialogEnabled = Main.sharedPreferences.getBoolean("showDialog", false);
}

LinkedHashSet[] getHashSets() {
return new LinkedHashSet[] {expandedHashSet, holdersHashSet};
}
}
9 changes: 5 additions & 4 deletions app/src/main/java/awais/backworddictionary/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ protected void onCreate(Bundle savedInstanceState) {

TooltipCompat.setTooltipText(fabOptions, getString(R.string.options));

setSearchView();

handleData();
}

Expand All @@ -160,8 +162,6 @@ protected void onPostCreate(@Nullable Bundle savedInstanceState) {

new myThread(true, this).start(); // load fragments
new myThread(false, this).start(); // setup tts

setSearchView();
}

@Override
Expand Down Expand Up @@ -379,7 +379,6 @@ private void setSearchView() {
onSearch(text);
addHistoryItem(text);
}, (view, position, text) -> {

final DialogInterface.OnClickListener btnListener = (dialog, which) -> {
if (which == DialogInterface.BUTTON_POSITIVE) deleteHistoryItem(text);
dialog.dismiss();
Expand Down Expand Up @@ -436,7 +435,7 @@ public boolean onQueryTextSubmit(String query) {
Crashlytics.logException(e);
}
onSearch(query);
return true;
return query != null || BuildConfig.DEBUG;
}

@Override
Expand All @@ -456,6 +455,7 @@ public void onQueryTextChange(String newText) {

@Override
public void onClose() {
if (viewPager == null || toolbar == null || fragmentsAdapter == null) return;
fragment = fragmentsAdapter.getItem(viewPager.getCurrentItem());

if (fragment.isAdded() && !fragment.isFilterOpen())
Expand All @@ -466,6 +466,7 @@ public void onClose() {

@Override
public void onOpen() {
if (viewPager == null || toolbar == null || fragmentsAdapter == null) return;
fragment = fragmentsAdapter.getItem(viewPager.getCurrentItem());

if (fragment.isAdded())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import awais.backworddictionary.DictionaryFragment;

public class DictionaryFragmentsAdapter extends FragmentStatePagerAdapter {
private final List<DictionaryFragment> mFragmentList = new ArrayList<>();
public final List<String> mFragmentTitleList = new ArrayList<>();
public final List<DictionaryFragment> mFragmentList = new ArrayList<>();

public DictionaryFragmentsAdapter(FragmentManager manager) {
super(manager, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
Expand Down
Loading

0 comments on commit 7a78600

Please sign in to comment.