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

Commit

Permalink
Bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SlideCI committed Nov 15, 2015
2 parents a0d9a7e + 4fce03a commit 8682446
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Slide [![](https://img.shields.io/github/release/ccrama/Slide.svg)](https://github.com/ccrama/Slide/releases/latest)[![Crowdin](https://d322cqt584bo4o.cloudfront.net/slide-for-reddit/localized.svg)](https://crowdin.com/project/slide-for-reddit)
# Slide [![](https://img.shields.io/github/release/ccrama/Slide.svg)](https://github.com/ccrama/Slide/releases/latest) [![Crowdin](https://d322cqt584bo4o.cloudfront.net/slide-for-reddit/localized.svg)](https://crowdin.com/project/slide-for-reddit)

<img src="app/src/main/res/drawable-xhdpi/ic_launcher.png" align="left"
hspace="10" vspace="10">
Expand Down
3 changes: 1 addition & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
applicationId "me.ccrama.redditslide"
minSdkVersion 17
targetSdkVersion 23
versionCode 84
versionCode 8
versionName "4.3.2"
multiDexEnabled = true

Expand All @@ -24,7 +24,6 @@ android {
buildTypes {
release {
minifyEnabled false

proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ public void onResume() {
super.onResume();

Log.v("Slide", "RESTARTING STUFFS");
if (usedArray == null || adapter == null) {
if ((usedArray == null || adapter == null) && ! Reddit.isLoading) {
Reddit.isLoading = true;
restartTheme();


}
}

Expand Down Expand Up @@ -507,8 +508,10 @@ public void reloadSubs() {
}

public void setDataSet(List<String> data) {
Reddit.isLoading = false;

if (data != null) {

usedArray = data;
if (adapter == null) {
adapter = new OverviewPagerAdapter(getSupportFragmentManager());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
import net.dean.jraw.managers.AccountManager;
import net.dean.jraw.models.Submission;

import java.util.ArrayList;

import me.ccrama.redditslide.Activities.CommentsScreen;
import me.ccrama.redditslide.Activities.CommentsScreenPopup;
import me.ccrama.redditslide.Activities.Profile;
import me.ccrama.redditslide.Activities.SubredditView;
import me.ccrama.redditslide.Authentication;
import me.ccrama.redditslide.DataShare;
import me.ccrama.redditslide.HasSeen;
import me.ccrama.redditslide.Hidden;
import me.ccrama.redditslide.R;
import me.ccrama.redditslide.Reddit;
Expand All @@ -47,14 +50,15 @@ public class SubmissionAdapter extends RecyclerView.Adapter<RecyclerView.ViewHol
private final String subreddit;
private final boolean custom;
public SubredditPosts dataSet;
public ArrayList<Submission> seen;

public SubmissionAdapter(Activity mContext, SubredditPosts dataSet, RecyclerView listView, String subreddit) {

this.mContext = mContext;
this.subreddit = subreddit.toLowerCase();
this.listView = listView;
this.dataSet = dataSet;

this.seen = new ArrayList<>();
custom = SettingValues.prefs.contains("PRESET" + subreddit.toLowerCase());

Log.v("Slide", subreddit + " CUSTOM IS " + custom);
Expand Down Expand Up @@ -99,6 +103,9 @@ public void onBindViewHolder(final RecyclerView.ViewHolder holder2, final int i)
final SubmissionViewHolder holder = (SubmissionViewHolder) holder2;

final Submission submission = dataSet.posts.get(i);
if (HasSeen.getSeen(submission.getFullName())){
seen.add(submission);
}
CreateCardView.resetColorCard(holder.itemView);
CreateCardView.colorCard(submission.getSubredditName().toLowerCase(), holder.itemView, subreddit, custom);
holder.itemView.setOnClickListener(new View.OnClickListener() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import android.view.View;
import android.view.ViewGroup;

import java.util.Iterator;
import java.util.concurrent.ExecutionException;

import me.ccrama.redditslide.Activities.Submit;
Expand All @@ -25,6 +26,7 @@
import me.ccrama.redditslide.ColorPreferences;
import me.ccrama.redditslide.HasSeen;
import me.ccrama.redditslide.Hidden;

import me.ccrama.redditslide.R;
import me.ccrama.redditslide.Reddit;
import me.ccrama.redditslide.Views.PreCachingLayoutManager;
Expand Down Expand Up @@ -80,6 +82,7 @@ public void onConfigurationChanged(Configuration newConfig) {

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

final Context contextThemeWrapper = new ContextThemeWrapper(getActivity(), new ColorPreferences(inflater.getContext()).getThemeSubreddit(id));
View v = ((LayoutInflater) contextThemeWrapper.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.fragment_verticalcontent, container, false);

Expand Down Expand Up @@ -136,17 +139,19 @@ public void onClick(View v) {
}
});
} else {
fab.setImageResource(R.drawable.ic_clear);
fab.setImageResource(R.drawable.close);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
for (int i = 0; i < adapter.dataSet.posts.size(); i++) {
if (HasSeen.getSeen(adapter.dataSet.posts.get(i).getFullName())) {
Hidden.setHidden(adapter.dataSet.posts.get(i));

adapter.dataSet.posts.remove(adapter.dataSet.posts.get(i));

adapter.notifyItemRemoved(adapter.dataSet.posts.indexOf(adapter.dataSet.posts.get(i)));
int i = 0;
Iterator<?> it = adapter.dataSet.posts.iterator();
while (it.hasNext()) {
i++;
if (adapter.seen.contains(it.next())) {
it.remove();
Hidden.setHidden(adapter.dataSet.posts.get(i));
adapter.notifyItemRemoved(i);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/me/ccrama/redditslide/GitReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public void init(Bundle savedInstanceState) {

// Set Auth token to open issues if user doesn't have a GitHub account
// For example, you can register a bot account on GitHub that will open bugs for you.
setGuestOAuth2Token(SecretConstants.GithubBotRepo);
//setGuestOAuth2Token(SecretConstants.GithubBotRepo);


// OPTIONAL METHODS
Expand Down
1 change: 1 addition & 0 deletions app/src/main/java/me/ccrama/redditslide/Reddit.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public class Reddit extends MultiDexApplication implements Application.ActivityL
private static CustomTabsSession mCustomTabsSession;
private static CustomTabsClient mClient;
private static CustomTabsServiceConnection mConnection;
public static boolean isLoading;
private final List<Listener> listeners = new ArrayList<Listener>();
private final Handler mBackgroundDelayHandler = new Handler();
public boolean active;
Expand Down
9 changes: 0 additions & 9 deletions app/src/main/res/drawable/ic_clear.xml

This file was deleted.

3 changes: 1 addition & 2 deletions app/src/main/res/values/donottranslate.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<resources>
<string name="app_name">Slide</string>
<string name="hello_world">Hello world!</string>

<!-- Text for the example submissions
Expand All @@ -12,7 +11,7 @@
<string name="example_points">204 points</string>
<string name="example_points_short">+204</string>
<string name="example_comments">402 comments</string>

<string name="app_name">Slide</string>

<string name="submission_properties_seperator">" • "</string>
<string name="general_pro">Slide for Reddit Pro</string>
Expand Down

0 comments on commit 8682446

Please sign in to comment.