Skip to content

Commit

Permalink
Merged new version of WP Library
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiqrazasyed committed Mar 15, 2018
1 parent 618abd1 commit 0cee6e1
Show file tree
Hide file tree
Showing 17 changed files with 211 additions and 116 deletions.
2 changes: 2 additions & 0 deletions .idea/modules.xml

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

6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ allprojects {
rootProject.ext {
BuildTools = "27"
MinSdk = 15
TargetSdk = 26
CompileSdk = 26
SupportLibrary = "26.0.2"
TargetSdk = 27
CompileSdk = 27
SupportLibrary = "27.1.0"
}
}

Expand Down
10 changes: 5 additions & 5 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {
minSdkVersion rootProject.ext.MinSdk
targetSdkVersion rootProject.ext.TargetSdk
versionCode 174
versionName "1.7.0-b5-1"
versionName "1.7.0-b5-2"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [onesignal_app_id: "key",
onesignal_google_project_number: "key"]
Expand Down Expand Up @@ -94,7 +94,7 @@ dependencies {
compile 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'

compile 'com.squareup.okhttp3:okhttp:3.9.0'
compile 'com.squareup.okhttp3:okhttp:3.10.0'

compile group: 'cz.msebera.android', name: 'httpclient', version: '4.4.1.1'
compile 'uk.co.chrisjenx:calligraphy:2.3.0'
Expand All @@ -120,14 +120,14 @@ dependencies {
// OneSignal SDK
implementation 'com.onesignal:OneSignal:3.+@aar'
// Required for OneSignal
implementation 'com.google.android.gms:play-services-gcm:11.6.2'
implementation 'com.google.android.gms:play-services-analytics:11.6.2'
implementation 'com.google.android.gms:play-services-gcm:11.8.0'
implementation 'com.google.android.gms:play-services-analytics:11.8.0'

// App Updater
compile 'com.github.javiersantos:AppUpdater:2.6.3'

// Google Ads
compile 'com.google.android.gms:play-services-ads:11.6.2'
compile 'com.google.android.gms:play-services-ads:11.8.0'

// Material Dialogs With Additional Features
compile 'com.github.javiersantos:MaterialStyledDialogs:2.1'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ private class CategoriesLoader extends AsyncTask<Void, Category, Boolean> {
@Override
protected void onPreExecute() {
super.onPreExecute();
if (getActivity() == null) return;
if (getActivity().isFinishing()) return;

mProgress.setVisibility(View.VISIBLE);

if (mAdapter != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,23 @@ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
public boolean onQueryTextChange(String string) {
if (string.length() == 0) {
clearAdapter();
return false;
}

if (mAsyncTask != null) {
mAsyncTask.cancel(true);
}
return false;

mAsyncTask = new WallpapersLoader(string.trim())
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
return true;
}

@Override
public boolean onQueryTextSubmit(String string) {
mSearchView.clearFocus();
mAsyncTask = new WallpapersLoader(string.trim()).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
mAsyncTask = new WallpapersLoader(string.trim())
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
return true;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,14 @@ public static void showCreditsDialog(FragmentManager fm, int type) {
ft.remove(prev);
}

ft.add(newInstance(type), TAG)
.setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE);

try {
DialogFragment dialog = CreditsFragment.newInstance(type);
dialog.show(ft, TAG);
} catch (IllegalStateException | IllegalArgumentException ignored) {}
ft.commit();
} catch (IllegalStateException e) {
ft.commitAllowingStateLoss();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,14 @@ public static void showFilterDialog(FragmentManager fm, boolean isMuzei) {
ft.remove(prev);
}

ft.add(newInstance(isMuzei), TAG)
.setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE);

try {
DialogFragment dialog = FilterFragment.newInstance(isMuzei);
dialog.show(ft, TAG);
} catch (IllegalArgumentException | IllegalStateException ignored) {}
ft.commit();
} catch (IllegalStateException e) {
ft.commitAllowingStateLoss();
}
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,14 @@ public static void showInAppBillingDialog(@NonNull FragmentManager fm, @NonNull
ft.remove(prev);
}

ft.add(newInstance(key, productId), TAG)
.setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE);

try {
DialogFragment dialog = InAppBillingFragment.newInstance(key, productId);
dialog.show(ft, TAG);
} catch (IllegalArgumentException | IllegalStateException ignored) {}
ft.commit();
} catch (IllegalStateException e) {
ft.commitAllowingStateLoss();
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ public static void showLanguageChooser(@NonNull FragmentManager fm) {
ft.remove(prev);
}

ft.add(newInstance(), TAG)
.setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE);

try {
DialogFragment dialog = LanguagesFragment.newInstance();
dialog.show(ft, TAG);
} catch (IllegalArgumentException | IllegalStateException ignored) {}
ft.commit();
} catch (IllegalStateException e) {
ft.commitAllowingStateLoss();
}
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ public static void showLicensesDialog(FragmentManager fm) {
ft.remove(prev);
}

ft.add(newInstance(), TAG)
.setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE);

try {
DialogFragment dialog = LicensesFragment.newInstance();
dialog.show(ft, TAG);
} catch (IllegalStateException | IllegalArgumentException ignored) {}
ft.commit();
} catch (IllegalStateException e) {
ft.commitAllowingStateLoss();
}
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,14 @@ public static void showRefreshDurationDialog(FragmentManager fm, int rotateTime,
ft.remove(prev);
}

ft.add(newInstance(rotateTime, isMinute), TAG)
.setTransitionStyle(FragmentTransaction.TRANSIT_FRAGMENT_FADE);

try {
DialogFragment dialog = RefreshDurationFragment.newInstance(rotateTime, isMinute);
dialog.show(ft, TAG);
} catch (IllegalStateException | IllegalArgumentException ignored) {}
ft.commit();
} catch (IllegalStateException e) {
ft.commitAllowingStateLoss();
}
}

@NonNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,12 @@ public void start() {
DownloadManager downloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE);

try {
downloadManager.enqueue(request);
if (downloadManager != null) {
downloadManager.enqueue(request);
return;
}

LogUtil.e("Download: download manager is null");
} catch (IllegalArgumentException e) {
LogUtil.e(Log.getStackTraceString(e));
return;
Expand Down
64 changes: 0 additions & 64 deletions library/src/main/res/raw/licenses.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,69 +273,5 @@
See the License for the specific language governing permissions and
limitations under the License.
</pre>
<ul>
<li>MaterialStyledDialogs</li>
</ul>

<pre>
Copyright 2016 Javier Santos

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>
<ul>
<li>AppUpdater</li>
</ul>

<pre>
Copyright 2016 Javier Santos

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
</pre>
<ul>
<li>AdBlockerDetector</li>
</ul>

<pre>
The MIT License (MIT)
Copyright (c) 2016 Cüneyt Ayyıldız

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</pre>
</body>
</html>
Loading

0 comments on commit 0cee6e1

Please sign in to comment.