Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from ccrama/master
Browse files Browse the repository at this point in the history
updating base
  • Loading branch information
Barrett97 authored Sep 4, 2020
2 parents 8f28c2c + 160123e commit e7409b5
Show file tree
Hide file tree
Showing 410 changed files with 2,552 additions and 2,556 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
Binary file modified adaptive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 7 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ dependencies {
implementation 'com.github.Alexendoo:Android-RobotoTextView:f6d0eb5ac7'

/** AndroidX **/
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.interpolator:interpolator:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'com.google.android.material:material:1.2.0'

/** Third-party (Other) **/
def exoPlayerVersion = '2.11.7'
def exoPlayerVersion = '2.11.8'
implementation "com.google.android.exoplayer:exoplayer-core:${exoPlayerVersion}"
implementation "com.google.android.exoplayer:exoplayer-dash:${exoPlayerVersion}"
implementation "com.google.android.exoplayer:extension-okhttp:${exoPlayerVersion}"
Expand All @@ -108,11 +108,11 @@ dependencies {
implementation 'com.github.ligi.snackengage:snackengage-playrate:0.25'
implementation 'com.github.rey5137:material:1.3.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view:3.10.0'
implementation 'com.davemorrissey.labs:subsampling-scale-image-view-androidx:3.10.0'
implementation 'com.cocosw:bottomsheet:1.5.0@aar'
implementation 'com.lusfold.androidkeyvaluestore:library:0.1.0@aar'
implementation 'org.apache.commons:commons-lang3:3.10'
implementation 'org.apache.commons:commons-text:1.8'
implementation 'org.apache.commons:commons-lang3:3.11'
implementation 'org.apache.commons:commons-text:1.9'
implementation 'commons-io:commons-io:2.7'
implementation 'jp.wasabeef:blurry:3.0.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
Expand All @@ -129,9 +129,7 @@ dependencies {
implementation 'com.neovisionaries:nv-websocket-client:2.9'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
implementation 'me.everything:overscroll-decor-android:1.1.0'
implementation('com.mikepenz:aboutlibraries:8.3.0', {
exclude group: 'org.jetbrains', module: 'annotations'
})
implementation 'com.mikepenz:aboutlibraries:6.2.3'
implementation 'com.googlecode.mp4parser:isoparser:1.1.22'

/** Testing **/
Expand Down
Binary file modified app/src/debug/res/drawable/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/debug/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/debug/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/debug/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/debug/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
android:installLocation="auto"
android:label="@string/app_name"
android:resizeableActivity="true"
android:roundIcon="@mipmap/icon_round"
android:roundIcon="@mipmap/ic_launcher_round"
android:usesCleartextTraffic="true"
android:theme="@style/yellow_dark">
<provider
Expand All @@ -37,7 +37,7 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|uiMode"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/icon_round">
android:roundIcon="@mipmap/ic_launcher_round">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>

Expand Down Expand Up @@ -322,6 +322,10 @@
android:name=".Activities.Album"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|uiMode"
android:theme="@style/swipeable"/>
<activity
android:name=".Activities.RedditGallery"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|uiMode"
android:theme="@style/swipeable"/>
<activity
android:name=".Activities.Tumblr"
android:colorMode="wideColorGamut"
Expand Down
Binary file modified app/src/main/ic_launcher-web.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ public void showBottomSheetImage(final String contentUrl, final boolean isGif,

int color = ta.getColor(0, Color.WHITE);
Drawable external = getResources().getDrawable(R.drawable.openexternal);
Drawable share = getResources().getDrawable(R.drawable.share);
Drawable share = getResources().getDrawable(R.drawable.ic_share);
Drawable image = getResources().getDrawable(R.drawable.image);
Drawable save = getResources().getDrawable(R.drawable.save);

Expand Down Expand Up @@ -527,7 +527,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,
&& SettingValues.lowResMobile))) {
String lqurl = url.substring(0, url.lastIndexOf("."))
+ (SettingValues.lqLow ? "m" : (SettingValues.lqMid ? "l" : "h"))
+ url.substring(url.lastIndexOf("."), url.length());
+ url.substring(url.lastIndexOf("."));
loadImage(rootView, this, lqurl, ((AlbumPager) getActivity()).images.size() == 1);
lq = true;
} else {
Expand Down Expand Up @@ -573,10 +573,10 @@ public void onClick(View v2) {
rootView.findViewById(R.id.panel).setVisibility(View.GONE);
(rootView.findViewById(R.id.margin)).setPadding(0, 0, 0, 0);
} else if (title.isEmpty()) {
setTextWithLinks(description, ((SpoilerRobotoTextView) rootView.findViewById(R.id.title)));
setTextWithLinks(description, rootView.findViewById(R.id.title));
} else {
setTextWithLinks(title, ((SpoilerRobotoTextView) rootView.findViewById(R.id.title)));
setTextWithLinks(description, ((SpoilerRobotoTextView) rootView.findViewById(R.id.body)));
setTextWithLinks(title, rootView.findViewById(R.id.title));
setTextWithLinks(description, rootView.findViewById(R.id.body));
}
{
int type = new FontPreferences(getContext()).getFontTypeComment().getTypeface();
Expand Down Expand Up @@ -691,11 +691,9 @@ private static void loadImage(final View rootView, Fragment f, String url, boole
.imageScaleType(single?ImageScaleType.NONE:ImageScaleType.NONE_SAFE)
.cacheInMemory(false)
.build(), new ImageLoadingListener() {
private View mView;

@Override
public void onLoadingStarted(String imageUri, View view) {
mView = view;
size.setVisibility(View.VISIBLE);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import android.annotation.TargetApi;
import android.app.ActivityManager;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.nfc.NdefMessage;
import android.nfc.NdefRecord;
import android.nfc.NfcAdapter;
Expand Down Expand Up @@ -484,13 +482,11 @@ public void setRecentBar(@Nullable String title, int color) {

if (title == null || title.equals("")) title = getString(R.string.app_name);

Bitmap bitmap= BitmapFactory.decodeResource(getResources(),( title.equalsIgnoreCase("androidcirclejerk") ? R.drawable.matiasduarte
: R.drawable.ic_launcher));
int drawable = title.equalsIgnoreCase("androidcirclejerk") ? R.drawable.matiasduarte
: R.drawable.ic_launcher;

setTaskDescription(
new ActivityManager.TaskDescription(title, bitmap, color));

bitmap.recycle();
new ActivityManager.TaskDescription(title, drawable, color));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public Fragment getItem(int i) {
Fragment f = new CommentPage();
Bundle args = new Bundle();
String name = currentPosts.get(i).getFullName();
args.putString("id", name.substring(3, name.length()));
args.putString("id", name.substring(3));
args.putBoolean("archived", currentPosts.get(i).isArchived());
args.putBoolean("contest",
currentPosts.get(i).getDataNode().get("contest_mode").asBoolean());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public Fragment getItem(int i) {

Fragment f = new CommentPage();
Bundle args = new Bundle();
if (name.contains("t3_")) name = name.substring(3, name.length());
if (name.contains("t3_")) name = name.substring(3);

args.putString("id", name);
args.putString("context", context);
Expand Down
56 changes: 36 additions & 20 deletions app/src/main/java/me/ccrama/redditslide/Activities/CreateMulti.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
public class CreateMulti extends BaseActivityAnim {

private ArrayList<String> subs;
private boolean delete = false;
private CustomAdapter adapter;
private EditText title;
private RecyclerView recyclerView;
Expand All @@ -78,7 +77,7 @@ public class CreateMulti extends BaseActivityAnim {

@Override
protected void onCreate(Bundle savedInstanceState) {
overrideRedditSwipeAnywhere();
overrideSwipeFromAnywhere();

super.onCreate(savedInstanceState);
applyColorTheme();
Expand Down Expand Up @@ -120,6 +119,26 @@ public void onComplete(List<MultiReddit> multis) {
recyclerView.setLayoutManager(new LinearLayoutManager(this));
}

@Override
public void onBackPressed() {
new AlertDialogWrapper.Builder(CreateMulti.this).setTitle(R.string.general_confirm_exit)
.setMessage(R.string.multi_save_option)
.setPositiveButton(R.string.btn_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int i) {
MultiredditOverview.multiActivity.finish();
new SaveMulti().execute();
}
})
.setNegativeButton(R.string.btn_no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int i) {
finish();
}
})
.show();
}

public void showSelectDialog() {
//List of all subreddits of the multi
List<String> multiSubs = new ArrayList<>(subs);
Expand Down Expand Up @@ -317,7 +336,7 @@ public class ViewHolder extends RecyclerView.ViewHolder {
public ViewHolder(View itemView) {
super(itemView);

text = (TextView) itemView.findViewById(R.id.name);
text = itemView.findViewById(R.id.name);


}
Expand All @@ -339,24 +358,20 @@ protected Void doInBackground(Void... params) {
Log.v(LogUtil.getTag(), "Invalid multi name");
throw new IllegalArgumentException(multiName);
}
if (delete) {
Log.v(LogUtil.getTag(), "Deleting");
new MultiRedditManager(Authentication.reddit).delete(old);
} else {
if (old != null && !old.isEmpty() && !old.replace(" ", "").equals(multiName)) {
Log.v(LogUtil.getTag(), "Renaming");
new MultiRedditManager(Authentication.reddit).rename(old, multiName);
}
Log.v(LogUtil.getTag(), "Create or Update, Name: " + multiName);
new MultiRedditManager(Authentication.reddit).createOrUpdate(new MultiRedditUpdateRequest.Builder(Authentication.name, multiName).subreddits(subs).build());
runOnUiThread(new Runnable() {
@Override
public void run() {
Log.v(LogUtil.getTag(), "Update Subreddits");
new UserSubscriptions.SyncMultireddits(CreateMulti.this).execute();
}
});
if (old != null && !old.isEmpty() && !old.replace(" ", "").equals(multiName)) {
Log.v(LogUtil.getTag(), "Renaming");
new MultiRedditManager(Authentication.reddit).rename(old, multiName);
}
Log.v(LogUtil.getTag(), "Create or Update, Name: " + multiName);
new MultiRedditManager(Authentication.reddit).createOrUpdate(new MultiRedditUpdateRequest.Builder(Authentication.name, multiName).subreddits(subs).build());
runOnUiThread(new Runnable() {
@Override
public void run() {
Log.v(LogUtil.getTag(), "Update Subreddits");
MultiredditOverview.multiActivity.finish();
new UserSubscriptions.SyncMultireddits(CreateMulti.this).execute();
}
});
runOnUiThread(new Runnable() {
@Override
public void run() {
Expand Down Expand Up @@ -433,6 +448,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
.setPositiveButton(R.string.btn_yes, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
MultiredditOverview.multiActivity.finish();
new MaterialDialog.Builder(CreateMulti.this)
.title(R.string.deleting)
.progress(true, 100)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected Void doInBackground(Void... voids) {
+ ((AutoCompleteTextView) findViewById(
R.id.subreddittext)).getText().toString()
+ "/comments/"
+ s.getFullName().substring(3, s.getFullName().length()));
+ s.getFullName().substring(3));
Crosspost.this.finish();
} catch (final ApiException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
import me.ccrama.redditslide.Reddit;
import me.ccrama.redditslide.SettingValues;
import me.ccrama.redditslide.Visuals.Palette;
import me.ccrama.redditslide.util.IabHelper;
import me.ccrama.redditslide.util.IabResult;
import me.ccrama.redditslide.util.Inventory;
import me.ccrama.redditslide.util.LogUtil;
import me.ccrama.redditslide.util.Purchase;
import me.ccrama.redditslide.util.SkuDetails;
import me.ccrama.redditslide.util.billing.IabHelper;
import me.ccrama.redditslide.util.billing.IabResult;
import me.ccrama.redditslide.util.billing.Inventory;
import me.ccrama.redditslide.util.billing.Purchase;
import me.ccrama.redditslide.util.billing.SkuDetails;


/**
Expand Down Expand Up @@ -157,4 +157,4 @@ public void onIabPurchaseFinished(IabResult result,
}
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package me.ccrama.redditslide.Activities;


import com.fasterxml.jackson.databind.JsonNode;

import org.apache.commons.text.StringEscapeUtils;

import java.io.Serializable;

/**
* Created by ccrama on 09/22/2020.
*/
public class GalleryImage implements Serializable {
public String url;
public int width;
public int height;

public GalleryImage(JsonNode data) {
url = StringEscapeUtils.unescapeHtml4(data.get("u").asText());
width = data.get("x").asInt();
height = data.get("y").asInt();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4159,7 +4159,7 @@ public void onClick(@NonNull MaterialDialog dialog,

if (NetworkUtil.isConnected(MainActivity.this)) {
if (Authentication.isLoggedIn
&& android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
ShortcutManager shortcutManager = getSystemService(ShortcutManager.class);
ArrayList<ShortcutInfo> shortcuts = new ArrayList<>();
shortcuts.add(new ShortcutInfo.Builder(this, "inbox").setShortLabel("Inbox")
Expand Down Expand Up @@ -4200,7 +4200,7 @@ public void onClick(@NonNull MaterialDialog dialog,
Collections.reverse(shortcuts);

shortcutManager.setDynamicShortcuts(shortcuts);
} else if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) {
ShortcutManager shortcutManager = getSystemService(ShortcutManager.class);
ArrayList<ShortcutInfo> shortcuts = new ArrayList<>();
int count = 0;
Expand Down Expand Up @@ -4239,8 +4239,8 @@ private Icon getIcon(String subreddit, @DrawableRes int overlay) {
Bitmap over = drawableToBitmap(ResourcesCompat.getDrawable(getResources(), overlay, null));

Canvas canvas = new Canvas(color);
canvas.drawBitmap(over, color.getWidth() / 2 - (over.getWidth() / 2),
color.getHeight() / 2 - (over.getHeight() / 2), null);
canvas.drawBitmap(over, color.getWidth() / 2.0f - (over.getWidth() / 2.0f),
color.getHeight() / 2.0f - (over.getHeight() / 2.0f), null);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return Icon.createWithBitmap(color);
Expand Down Expand Up @@ -5269,7 +5269,7 @@ public Fragment getItem(int i) {
Fragment f = new CommentPage();
Bundle args = new Bundle();
String name = openingComments.getFullName();
args.putString("id", name.substring(3, name.length()));
args.putString("id", name.substring(3));
args.putBoolean("archived", openingComments.isArchived());
args.putBoolean("contest",
openingComments.getDataNode().get("contest_mode").asBoolean());
Expand Down
Loading

0 comments on commit e7409b5

Please sign in to comment.