Browse Source

Bookmarks work for guests too, minor tweaks.

pull/24/head
Ezerous 8 years ago
parent
commit
5c6a7d03d8
  1. 181
      app/src/main/java/gr/thmmy/mthmmy/activities/BookmarkActivity.java
  2. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java
  3. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java
  4. 7
      app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java
  5. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java
  6. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java
  7. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsFragment.java
  8. 1
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/stats/StatsFragment.java
  9. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/profile/summary/SummaryFragment.java
  10. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java
  11. 56
      app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java
  12. 1
      app/src/main/java/gr/thmmy/mthmmy/receiver/Receiver.java
  13. 1
      app/src/main/java/gr/thmmy/mthmmy/services/DownloadService.java
  14. 4
      app/src/main/res/values/strings.xml

181
app/src/main/java/gr/thmmy/mthmmy/activities/BookmarkActivity.java

@ -22,6 +22,8 @@ import static gr.thmmy.mthmmy.activities.topic.TopicActivity.BUNDLE_TOPIC_TITLE;
import static gr.thmmy.mthmmy.activities.topic.TopicActivity.BUNDLE_TOPIC_URL; import static gr.thmmy.mthmmy.activities.topic.TopicActivity.BUNDLE_TOPIC_URL;
public class BookmarkActivity extends BaseActivity { public class BookmarkActivity extends BaseActivity {
private TextView boardsTitle;
private TextView topicsTitle;
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
@ -43,93 +45,100 @@ public class BookmarkActivity extends BaseActivity {
LinearLayout bookmarksLinearView = (LinearLayout) findViewById(R.id.bookmarks_container); LinearLayout bookmarksLinearView = (LinearLayout) findViewById(R.id.bookmarks_container);
LayoutInflater layoutInflater = getLayoutInflater(); LayoutInflater layoutInflater = getLayoutInflater();
TextView tmp = new TextView(this); if(!getBoardsBookmarked().isEmpty()) {
tmp.setLayoutParams(new LinearLayout.LayoutParams( boardsTitle = new TextView(this);
LinearLayout.LayoutParams.MATCH_PARENT boardsTitle.setLayoutParams(new LinearLayout.LayoutParams(
, LinearLayout.LayoutParams.WRAP_CONTENT)); LinearLayout.LayoutParams.MATCH_PARENT
tmp.setText(getString(R.string.board_bookmarks_title)); , LinearLayout.LayoutParams.WRAP_CONTENT));
tmp.setTypeface(tmp.getTypeface(), Typeface.BOLD); boardsTitle.setText(getString(R.string.board_bookmarks_title));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { boardsTitle.setTypeface(boardsTitle.getTypeface(), Typeface.BOLD);
tmp.setTextColor(getColor(R.color.primary_text)); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
} else { boardsTitle.setTextColor(getColor(R.color.primary_text));
//noinspection deprecation } else {
tmp.setTextColor(getResources().getColor(R.color.primary_text)); //noinspection deprecation
} boardsTitle.setTextColor(getResources().getColor(R.color.primary_text));
tmp.setTextAlignment(View.TEXT_ALIGNMENT_CENTER); }
tmp.setTextSize(20f); boardsTitle.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
bookmarksLinearView.addView(tmp); boardsTitle.setTextSize(20f);
bookmarksLinearView.addView(boardsTitle);
for (final Bookmark bookmarkedBoard : getBoardsBookmarked()) { for (final Bookmark bookmarkedBoard : getBoardsBookmarked()) {
if (bookmarkedBoard != null && bookmarkedBoard.getTitle() != null) { if (bookmarkedBoard != null && bookmarkedBoard.getTitle() != null) {
final LinearLayout row = (LinearLayout) layoutInflater.inflate( final LinearLayout row = (LinearLayout) layoutInflater.inflate(
R.layout.activity_bookmark_row, bookmarksLinearView, false); R.layout.activity_bookmark_row, bookmarksLinearView, false);
row.setOnClickListener(new View.OnClickListener() { row.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
Intent intent = new Intent(BookmarkActivity.this, BoardActivity.class); Intent intent = new Intent(BookmarkActivity.this, BoardActivity.class);
Bundle extras = new Bundle(); Bundle extras = new Bundle();
extras.putString(BUNDLE_BOARD_URL, "https://www.thmmy.gr/smf/index.php?board=" extras.putString(BUNDLE_BOARD_URL, "https://www.thmmy.gr/smf/index.php?board="
+ bookmarkedBoard.getId() + ".0"); + bookmarkedBoard.getId() + ".0");
extras.putString(BUNDLE_BOARD_TITLE, bookmarkedBoard.getTitle()); extras.putString(BUNDLE_BOARD_TITLE, bookmarkedBoard.getTitle());
intent.putExtras(extras); intent.putExtras(extras);
startActivity(intent); startActivity(intent);
finish(); finish();
} }
}); });
((TextView) row.findViewById(R.id.bookmark_title)).setText(bookmarkedBoard.getTitle()); ((TextView) row.findViewById(R.id.bookmark_title)).setText(bookmarkedBoard.getTitle());
(row.findViewById(R.id.remove_bookmark)).setOnClickListener(new View.OnClickListener() { (row.findViewById(R.id.remove_bookmark)).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
removeBookmark(bookmarkedBoard); removeBookmark(bookmarkedBoard);
row.setVisibility(View.GONE); row.setVisibility(View.GONE);
} updateTitles();
}); }
bookmarksLinearView.addView(row); });
bookmarksLinearView.addView(row);
}
} }
} }
tmp = new TextView(this);
tmp.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT
, LinearLayout.LayoutParams.WRAP_CONTENT));
tmp.setText(getString(R.string.topic_bookmarks_title));
tmp.setTypeface(tmp.getTypeface(), Typeface.BOLD);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
tmp.setTextColor(getColor(R.color.primary_text));
} else {
//noinspection deprecation
tmp.setTextColor(getResources().getColor(R.color.primary_text));
}
tmp.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
tmp.setTextSize(20f);
bookmarksLinearView.addView(tmp);
for (final Bookmark bookmarkedTopic : getTopicsBookmarked()) { if(!getTopicsBookmarked().isEmpty()) {
if (bookmarkedTopic != null && bookmarkedTopic.getTitle() != null) { topicsTitle = new TextView(this);
final LinearLayout row = (LinearLayout) layoutInflater.inflate( topicsTitle.setLayoutParams(new LinearLayout.LayoutParams(
R.layout.activity_bookmark_row, bookmarksLinearView, false); LinearLayout.LayoutParams.MATCH_PARENT
row.setOnClickListener(new View.OnClickListener() { , LinearLayout.LayoutParams.WRAP_CONTENT));
@Override topicsTitle.setText(getString(R.string.topic_bookmarks_title));
public void onClick(View view) { topicsTitle.setTypeface(topicsTitle.getTypeface(), Typeface.BOLD);
Intent intent = new Intent(BookmarkActivity.this, TopicActivity.class); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Bundle extras = new Bundle(); topicsTitle.setTextColor(getColor(R.color.primary_text));
extras.putString(BUNDLE_TOPIC_URL, "https://www.thmmy.gr/smf/index.php?topic=" } else {
+ bookmarkedTopic.getId() + "." + 2147483647); //noinspection deprecation
extras.putString(BUNDLE_TOPIC_TITLE, bookmarkedTopic.getTitle()); topicsTitle.setTextColor(getResources().getColor(R.color.primary_text));
intent.putExtras(extras); }
startActivity(intent); topicsTitle.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
finish(); topicsTitle.setTextSize(20f);
} bookmarksLinearView.addView(topicsTitle);
});
((TextView) row.findViewById(R.id.bookmark_title)).setText(bookmarkedTopic.getTitle()); for (final Bookmark bookmarkedTopic : getTopicsBookmarked()) {
(row.findViewById(R.id.remove_bookmark)).setOnClickListener(new View.OnClickListener() { if (bookmarkedTopic != null && bookmarkedTopic.getTitle() != null) {
@Override final LinearLayout row = (LinearLayout) layoutInflater.inflate(
public void onClick(View view) { R.layout.activity_bookmark_row, bookmarksLinearView, false);
removeBookmark(bookmarkedTopic); row.setOnClickListener(new View.OnClickListener() {
row.setVisibility(View.GONE); @Override
} public void onClick(View view) {
}); Intent intent = new Intent(BookmarkActivity.this, TopicActivity.class);
bookmarksLinearView.addView(row); Bundle extras = new Bundle();
extras.putString(BUNDLE_TOPIC_URL, "https://www.thmmy.gr/smf/index.php?topic="
+ bookmarkedTopic.getId() + "." + 2147483647);
extras.putString(BUNDLE_TOPIC_TITLE, bookmarkedTopic.getTitle());
intent.putExtras(extras);
startActivity(intent);
finish();
}
});
((TextView) row.findViewById(R.id.bookmark_title)).setText(bookmarkedTopic.getTitle());
(row.findViewById(R.id.remove_bookmark)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
removeBookmark(bookmarkedTopic);
row.setVisibility(View.GONE);
updateTitles();
}
});
bookmarksLinearView.addView(row);
}
} }
} }
} }
@ -139,4 +148,12 @@ public class BookmarkActivity extends BaseActivity {
drawer.setSelection(BOOKMARKS_ID); drawer.setSelection(BOOKMARKS_ID);
super.onResume(); super.onResume();
} }
private void updateTitles()
{
if(getBoardsBookmarked().isEmpty())
boardsTitle.setVisibility(View.GONE);
if(getTopicsBookmarked().isEmpty())
topicsTitle.setVisibility(View.GONE);
}
} }

1
app/src/main/java/gr/thmmy/mthmmy/activities/LoginActivity.java

@ -14,7 +14,6 @@ import android.widget.Toast;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.activities.main.MainActivity; import gr.thmmy.mthmmy.activities.main.MainActivity;
import gr.thmmy.mthmmy.base.BaseActivity; import gr.thmmy.mthmmy.base.BaseActivity;
import timber.log.Timber; import timber.log.Timber;
import static gr.thmmy.mthmmy.session.SessionManager.CONNECTION_ERROR; import static gr.thmmy.mthmmy.session.SessionManager.CONNECTION_ERROR;

1
app/src/main/java/gr/thmmy/mthmmy/activities/downloads/DownloadsActivity.java

@ -27,7 +27,6 @@ import gr.thmmy.mthmmy.base.BaseActivity;
import gr.thmmy.mthmmy.model.Download; import gr.thmmy.mthmmy.model.Download;
import gr.thmmy.mthmmy.model.ThmmyPage; import gr.thmmy.mthmmy.model.ThmmyPage;
import me.zhanghai.android.materialprogressbar.MaterialProgressBar; import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
import timber.log.Timber; import timber.log.Timber;

7
app/src/main/java/gr/thmmy/mthmmy/activities/main/forum/ForumFragment.java

@ -210,13 +210,12 @@ public class ForumFragment extends BaseFragment
fetchedCategories.add(category); fetchedCategories.add(category);
} }
categories.clear();
categories.addAll(fetchedCategories);
fetchedCategories.clear();
} }
else else
throw new ParseException("Parsing failed"); throw new ParseException("Parsing failed");
categories.clear();
categories.addAll(fetchedCategories);
fetchedCategories.clear();
} }
@Override @Override

2
app/src/main/java/gr/thmmy/mthmmy/activities/main/recent/RecentFragment.java

@ -147,7 +147,6 @@ public class RecentFragment extends BaseFragment {
Elements recent = document.select("#block8 :first-child div"); Elements recent = document.select("#block8 :first-child div");
if (!recent.isEmpty()) { if (!recent.isEmpty()) {
topicSummaries.clear(); topicSummaries.clear();
for (int i = 0; i < recent.size(); i += 3) { for (int i = 0; i < recent.size(); i += 3) {
String link = recent.get(i).child(0).attr("href"); String link = recent.get(i).child(0).attr("href");
String title = recent.get(i).child(0).attr("title"); String title = recent.get(i).child(0).attr("title");
@ -170,7 +169,6 @@ public class RecentFragment extends BaseFragment {
topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime)); topicSummaries.add(new TopicSummary(link, title, lastUser, dateTime));
} }
return; return;
} }
throw new ParseException("Parsing failed"); throw new ParseException("Parsing failed");

2
app/src/main/java/gr/thmmy/mthmmy/activities/profile/ProfileActivity.java

@ -19,7 +19,6 @@ import android.text.SpannableString;
import android.text.Spanned; import android.text.Spanned;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.text.style.RelativeSizeSpan; import android.text.style.RelativeSizeSpan;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
@ -50,7 +49,6 @@ import gr.thmmy.mthmmy.model.ThmmyPage;
import gr.thmmy.mthmmy.utils.CenterVerticalSpan; import gr.thmmy.mthmmy.utils.CenterVerticalSpan;
import gr.thmmy.mthmmy.utils.CircleTransform; import gr.thmmy.mthmmy.utils.CircleTransform;
import me.zhanghai.android.materialprogressbar.MaterialProgressBar; import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
import timber.log.Timber; import timber.log.Timber;

1
app/src/main/java/gr/thmmy/mthmmy/activities/profile/latestPosts/LatestPostsFragment.java

@ -26,7 +26,6 @@ import gr.thmmy.mthmmy.base.BaseFragment;
import gr.thmmy.mthmmy.model.PostSummary; import gr.thmmy.mthmmy.model.PostSummary;
import gr.thmmy.mthmmy.utils.ParseHelpers; import gr.thmmy.mthmmy.utils.ParseHelpers;
import me.zhanghai.android.materialprogressbar.MaterialProgressBar; import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
import timber.log.Timber; import timber.log.Timber;

1
app/src/main/java/gr/thmmy/mthmmy/activities/profile/stats/StatsFragment.java

@ -41,7 +41,6 @@ import javax.net.ssl.SSLHandshakeException;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.base.BaseActivity; import gr.thmmy.mthmmy.base.BaseActivity;
import me.zhanghai.android.materialprogressbar.MaterialProgressBar; import me.zhanghai.android.materialprogressbar.MaterialProgressBar;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;
import timber.log.Timber; import timber.log.Timber;

2
app/src/main/java/gr/thmmy/mthmmy/activities/profile/summary/SummaryFragment.java

@ -7,7 +7,6 @@ import android.os.Bundle;
import android.support.v4.app.Fragment; import android.support.v4.app.Fragment;
import android.text.Html; import android.text.Html;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -25,7 +24,6 @@ import java.util.Objects;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import gr.thmmy.mthmmy.utils.ParseHelpers; import gr.thmmy.mthmmy.utils.ParseHelpers;
import timber.log.Timber; import timber.log.Timber;

2
app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

@ -18,7 +18,6 @@ import android.support.v7.widget.RecyclerView;
import android.text.Editable; import android.text.Editable;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
@ -54,7 +53,6 @@ import gr.thmmy.mthmmy.model.Post;
import gr.thmmy.mthmmy.model.ThmmyFile; import gr.thmmy.mthmmy.model.ThmmyFile;
import gr.thmmy.mthmmy.model.ThmmyPage; import gr.thmmy.mthmmy.model.ThmmyPage;
import gr.thmmy.mthmmy.utils.CircleTransform; import gr.thmmy.mthmmy.utils.CircleTransform;
import timber.log.Timber; import timber.log.Timber;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK; import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;

56
app/src/main/java/gr/thmmy/mthmmy/base/BaseActivity.java

@ -65,7 +65,6 @@ public abstract class BaseActivity extends AppCompatActivity {
private static final String BOOKMARKED_BOARDS_KEY = "bookmarkedBoardsKey"; private static final String BOOKMARKED_BOARDS_KEY = "bookmarkedBoardsKey";
protected Bookmark thisPageBookmark; protected Bookmark thisPageBookmark;
private MenuItem thisPageBookmarkMenuButton; private MenuItem thisPageBookmarkMenuButton;
private ImageButton thisPageBookmarkImageButton;
private SharedPreferences bookmarksFile; private SharedPreferences bookmarksFile;
private ArrayList<Bookmark> topicsBookmarked; private ArrayList<Bookmark> topicsBookmarked;
private ArrayList<Bookmark> boardsBookmarked; private ArrayList<Bookmark> boardsBookmarked;
@ -86,25 +85,23 @@ public abstract class BaseActivity extends AppCompatActivity {
if (sessionManager == null) if (sessionManager == null)
sessionManager = BaseApplication.getInstance().getSessionManager(); sessionManager = BaseApplication.getInstance().getSessionManager();
if (bookmarked == null) {
if (sessionManager.isLoggedIn()) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
if (bookmarked == null) { bookmarked = getResources().getDrawable(R.drawable.ic_bookmark_true, null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { } else //noinspection deprecation
bookmarked = getResources().getDrawable(R.drawable.ic_bookmark_true, null); bookmarked = getResources().getDrawable(R.drawable.ic_bookmark_true);
} else //noinspection deprecation
bookmarked = getResources().getDrawable(R.drawable.ic_bookmark_true);
}
if (notBookmarked == null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
notBookmarked = getResources().getDrawable(R.drawable.ic_bookmark_false, null);
} else //noinspection deprecation
notBookmarked = getResources().getDrawable(R.drawable.ic_bookmark_false);
}
if (topicsBookmarked == null || boardsBookmarked == null) {
bookmarksFile = getSharedPreferences(BOOKMARKS_SHARED_PREFS, Context.MODE_PRIVATE);
loadSavedBookmarks();
}
} }
if (notBookmarked == null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
notBookmarked = getResources().getDrawable(R.drawable.ic_bookmark_false, null);
} else //noinspection deprecation
notBookmarked = getResources().getDrawable(R.drawable.ic_bookmark_false);
}
if (topicsBookmarked == null || boardsBookmarked == null) {
bookmarksFile = getSharedPreferences(BOOKMARKS_SHARED_PREFS, Context.MODE_PRIVATE);
loadSavedBookmarks();
}
} }
@Override @Override
@ -221,14 +218,6 @@ public abstract class BaseActivity extends AppCompatActivity {
.withName(R.string.downloads) .withName(R.string.downloads)
.withIcon(downloadsIcon) .withIcon(downloadsIcon)
.withSelectedIcon(downloadsIconSelected); .withSelectedIcon(downloadsIconSelected);
bookmarksItem = new PrimaryDrawerItem()
.withTextColor(primaryColor)
.withSelectedColor(selectedPrimaryColor)
.withSelectedTextColor(selectedSecondaryColor)
.withIdentifier(BOOKMARKS_ID)
.withName(R.string.bookmark)
.withIcon(bookmarksIcon)
.withSelectedIcon(bookmarksIconSelected);
} else } else
loginLogoutItem = new PrimaryDrawerItem() loginLogoutItem = new PrimaryDrawerItem()
.withTextColor(primaryColor) .withTextColor(primaryColor)
@ -237,6 +226,15 @@ public abstract class BaseActivity extends AppCompatActivity {
.withIcon(loginIcon) .withIcon(loginIcon)
.withSelectable(false); .withSelectable(false);
bookmarksItem = new PrimaryDrawerItem()
.withTextColor(primaryColor)
.withSelectedColor(selectedPrimaryColor)
.withSelectedTextColor(selectedSecondaryColor)
.withIdentifier(BOOKMARKS_ID)
.withName(R.string.bookmark)
.withIcon(bookmarksIcon)
.withSelectedIcon(bookmarksIconSelected);
aboutItem = new PrimaryDrawerItem() aboutItem = new PrimaryDrawerItem()
.withTextColor(primaryColor) .withTextColor(primaryColor)
.withSelectedColor(selectedPrimaryColor) .withSelectedColor(selectedPrimaryColor)
@ -333,7 +331,7 @@ public abstract class BaseActivity extends AppCompatActivity {
if (sessionManager.isLoggedIn()) if (sessionManager.isLoggedIn())
drawerBuilder.addDrawerItems(homeItem, bookmarksItem, downloadsItem, loginLogoutItem, aboutItem); drawerBuilder.addDrawerItems(homeItem, bookmarksItem, downloadsItem, loginLogoutItem, aboutItem);
else else
drawerBuilder.addDrawerItems(homeItem, loginLogoutItem, aboutItem); drawerBuilder.addDrawerItems(homeItem, bookmarksItem, loginLogoutItem, aboutItem);
drawer = drawerBuilder.build(); drawer = drawerBuilder.build();
@ -352,7 +350,6 @@ public abstract class BaseActivity extends AppCompatActivity {
if (!sessionManager.isLoggedIn()) //When logged out or if user is guest if (!sessionManager.isLoggedIn()) //When logged out or if user is guest
{ {
drawer.removeItem(DOWNLOADS_ID); drawer.removeItem(DOWNLOADS_ID);
drawer.removeItem(BOOKMARKS_ID);
loginLogoutItem.withName(R.string.login).withIcon(loginIcon); //Swap logout with login loginLogoutItem.withName(R.string.login).withIcon(loginIcon); //Swap logout with login
profileDrawerItem.withName(sessionManager.getUsername()).withIcon(new IconicsDrawable(this) profileDrawerItem.withName(sessionManager.getUsername()).withIcon(new IconicsDrawable(this)
.icon(FontAwesome.Icon.faw_user) .icon(FontAwesome.Icon.faw_user)
@ -432,7 +429,6 @@ public abstract class BaseActivity extends AppCompatActivity {
} }
protected void setBoardBookmark(final ImageButton thisPageBookmarkImageButton) { protected void setBoardBookmark(final ImageButton thisPageBookmarkImageButton) {
this.thisPageBookmarkImageButton = thisPageBookmarkImageButton;
if (thisPageBookmark.matchExists(boardsBookmarked)) { if (thisPageBookmark.matchExists(boardsBookmarked)) {
thisPageBookmarkImageButton.setImageDrawable(bookmarked); thisPageBookmarkImageButton.setImageDrawable(bookmarked);
} else { } else {

1
app/src/main/java/gr/thmmy/mthmmy/receiver/Receiver.java

@ -14,7 +14,6 @@ import android.webkit.MimeTypeMap;
import java.io.File; import java.io.File;
import gr.thmmy.mthmmy.R; import gr.thmmy.mthmmy.R;
import timber.log.Timber; import timber.log.Timber;
import static gr.thmmy.mthmmy.services.DownloadService.ACTION_DOWNLOAD; import static gr.thmmy.mthmmy.services.DownloadService.ACTION_DOWNLOAD;

1
app/src/main/java/gr/thmmy/mthmmy/services/DownloadService.java

@ -13,7 +13,6 @@ import java.io.IOException;
import gr.thmmy.mthmmy.base.BaseApplication; import gr.thmmy.mthmmy.base.BaseApplication;
import gr.thmmy.mthmmy.receiver.Receiver; import gr.thmmy.mthmmy.receiver.Receiver;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.Request; import okhttp3.Request;
import okhttp3.Response; import okhttp3.Response;

4
app/src/main/res/values/strings.xml

@ -63,8 +63,8 @@
<!--Bookmarks--> <!--Bookmarks-->
<string name="remove_bookmark">Remove</string> <string name="remove_bookmark">Remove</string>
<string name="board_bookmarks_title">Your bookmarked boards:</string> <string name="board_bookmarks_title">Boards</string>
<string name="topic_bookmarks_title">Your bookmarked topics:</string> <string name="topic_bookmarks_title">Topics</string>
<!--Licences--> <!--Licences-->
<string name="libraries">Libraries</string> <string name="libraries">Libraries</string>

Loading…
Cancel
Save