Skip to content

Commit

Permalink
huge update
Browse files Browse the repository at this point in the history
+ REMOVED ADS!!
+ changed theme colors
+ fixed rotation problems
+ fixed filter action button shadow
+ fixed swipe to refresh layout not refreshing
+ added threads to perform tasks on background thread
+ added word dialog box search fixes
+ added rxjava as nonet fix
+ more bug fixes!
  • Loading branch information
AwaisKing committed Jul 31, 2018
1 parent 9d91535 commit 36007cd
Show file tree
Hide file tree
Showing 29 changed files with 451 additions and 396 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
31 changes: 15 additions & 16 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'

android {
compileSdkVersion 28
buildToolsVersion '28.0.1'

defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "awais.backworddictionary"
minSdkVersion 16
targetSdkVersion 28
versionCode 73
versionName "7.3"
versionCode 80
versionName "8.0"

vectorDrawables.useSupportLibrary = true
multiDexEnabled true
}

Expand All @@ -25,20 +24,20 @@ android {
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:support-dynamic-animation:28.0.0-alpha3'
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support:support-v4:28.0.0-alpha3'
implementation 'com.android.support:design:28.0.0-alpha3'
implementation 'com.android.support:recyclerview-v7:28.0.0-alpha3'
implementation 'com.android.support:cardview-v7:28.0.0-alpha3'
implementation 'com.android.support:support-dynamic-animation:28.0.0-beta01'
implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support:support-v4:28.0.0-beta01'
implementation 'com.android.support:design:28.0.0-beta01'
implementation 'com.android.support:recyclerview-v7:28.0.0-beta01'
implementation 'com.android.support:cardview-v7:28.0.0-beta01'

implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.1'
implementation 'com.google.firebase:firebase-perf:16.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.4'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') { transitive = true }
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.1.9'

implementation 'com.android.support:customtabs:28.0.0-alpha3'
implementation 'com.android.support:customtabs:28.0.0-beta01'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'com.keiferstone:nonet:2.0.4'
Expand Down
4 changes: 1 addition & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission-sdk-23 android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application android:allowBackup="true" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:theme="@style/AppTheme" android:label="@string/app_name"
Expand All @@ -15,7 +13,7 @@
android:fullBackupContent="@xml/backup_descriptor">

<activity android:name=".Main" android:theme="@style/AppTheme" android:launchMode="singleTop"
android:screenOrientation="portrait">
android:configChanges="keyboardHidden|orientation|screenSize" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,14 @@
import awais.backworddictionary.custom.WordItem;
import awais.backworddictionary.customweb.CustomTabActivityHelper;

import static awais.backworddictionary.Main.tts;

public class DictionaryAdapter extends RecyclerView.Adapter<DictionaryAdapter.DictHolder>
implements Filterable {
private final Context mContext;
private final List<WordItem> wordList;
private List<?> filterList;
private WordItem currentWord;
private final TextToSpeech tts;

@Override
public Filter getFilter() {
Expand All @@ -46,9 +47,10 @@ public Filter getFilter() {
protected FilterResults performFiltering(CharSequence charSequence) {
FilterResults results = new FilterResults();
results.values = wordList;
if (charSequence.toString().isEmpty()) return results;
if (String.valueOf(charSequence).isEmpty() || String.valueOf(charSequence) == null)
return results;

boolean showWords = Main.sharedPreferences.getBoolean("filterWord", false);
boolean showWords = Main.sharedPreferences.getBoolean("filterWord", true);
boolean showDefs = Main.sharedPreferences.getBoolean("filterDefinition", false);
boolean contains = Main.sharedPreferences.getBoolean("filterContain", true);

Expand Down Expand Up @@ -118,11 +120,10 @@ class DictHolder extends RecyclerView.ViewHolder {
}
}

DictionaryAdapter(Context mContext, List<WordItem> wordList, TextToSpeech tts) {
DictionaryAdapter(Context mContext, List<WordItem> wordList) {
this.mContext = mContext;
this.wordList = wordList;
this.filterList = wordList;
this.tts = tts;
}

@Override
Expand Down Expand Up @@ -160,14 +161,14 @@ public void onBindViewHolder(@NonNull DictHolder holder, int position) {
tagsBuilder.append("\nsyllables: ").append(wordItem.getNumSyllables());
else
tagsBuilder.append("syllables: ").append(wordItem.getNumSyllables());
holder.subtext.setText(tagsBuilder.toString().replaceAll(",\nsyllables", "\nsyllables"));
holder.subtext.setText(String.valueOf(tagsBuilder).replaceAll(",\nsyllables", "\nsyllables"));
holder.overflow.setOnClickListener(view -> showPopupMenu(holder.overflow));
holder.cardView.setOnLongClickListener(view -> {
showPopupMenu(holder.overflow);
return true;
});
holder.cardView.setOnClickListener(view ->
new WordDialog((Activity) mContext, wordItem, tts).show());
new WordDialog((Activity) mContext, wordItem).show());
}

private void showPopupMenu(View view) {
Expand Down Expand Up @@ -217,7 +218,7 @@ public boolean onMenuItemClick(MenuItem menuItem) {
return true;
case R.id.action_wiki:
String wordRawWiki = currentWord.getWord().replace(" ", "_").replace("\\s", "_");
try {wordRawWiki = new URL(wordRawWiki).toString();} catch (Exception ignored) {}
try {wordRawWiki = String.valueOf(new URL(wordRawWiki));} catch (Exception ignored) {}

Intent intent1 = new Intent();
intent1.setAction(Intent.ACTION_VIEW);
Expand Down
Loading

0 comments on commit 36007cd

Please sign in to comment.