Browse Source

Bookmarks navigation fix, up libs

pull/61/merge
Ezerous 6 years ago
parent
commit
43559cba77
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 4
      app/build.gradle
  2. 6
      app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java
  3. 23
      app/src/main/java/gr/thmmy/mthmmy/activities/bookmarks/BoardBookmarksFragment.java
  4. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/bookmarks/BookmarkActivity.java
  5. 2
      app/src/main/java/gr/thmmy/mthmmy/activities/topic/TopicAdapter.java

4
app/build.gradle

@ -54,7 +54,7 @@ tasks.whenTaskAdded { task ->
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.1' implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.preference:preference:1.1.0-alpha01' implementation 'androidx.preference:preference:1.1.0-alpha01'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0' implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0' implementation 'androidx.legacy:legacy-support-v4:1.0.0'
@ -65,7 +65,7 @@ dependencies {
implementation 'com.google.android.material:material:1.0.0' implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.firebase:firebase-core:16.0.5' implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-messaging:17.3.4' implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5' implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
implementation 'com.squareup.okhttp3:okhttp:3.11.0' implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.picasso:picasso:2.5.2' implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0' implementation 'com.jakewharton.picasso:picasso2-okhttp3-downloader:1.1.0'

6
app/src/main/java/gr/thmmy/mthmmy/activities/board/BoardActivity.java

@ -197,9 +197,9 @@ public class BoardActivity extends BaseActivity implements BoardAdapter.OnLoadMo
tempSubboards.addAll(parsedSubBoards); tempSubboards.addAll(parsedSubBoards);
tempTopics.addAll(parsedTopics); tempTopics.addAll(parsedTopics);
//Removes loading item //Removes loading item
if (isLoadingMore) { if (isLoadingMore && tempTopics.size() > 0)
if (tempTopics.size() > 0) tempTopics.remove(tempTopics.size() - 1); tempTopics.remove(tempTopics.size() - 1);
}
parsedTitle = boardPage.select("div.nav a.nav").last().text(); parsedTitle = boardPage.select("div.nav a.nav").last().text();
//Finds number of pages //Finds number of pages

23
app/src/main/java/gr/thmmy/mthmmy/activities/bookmarks/BoardBookmarksFragment.java

@ -26,21 +26,20 @@ import gr.thmmy.mthmmy.model.Bookmark;
* create an instance of this fragment. * create an instance of this fragment.
*/ */
public class BoardBookmarksFragment extends Fragment { public class BoardBookmarksFragment extends Fragment {
protected static final String ARG_SECTION_NUMBER = "SECTION_NUMBER"; private static final String ARG_SECTION_NUMBER = "SECTION_NUMBER";
protected static final String ARG_BOARD_BOOKMARKS = "BOARD_BOOKMARKS"; private static final String ARG_BOARD_BOOKMARKS = "BOARD_BOOKMARKS";
public static final String INTERACTION_CLICK_BOARD_BOOKMARK = "CLICK_BOARD_BOOKMARK"; static final String INTERACTION_CLICK_BOARD_BOOKMARK = "CLICK_BOARD_BOOKMARK";
public static final String INTERACTION_TOGGLE_BOARD_NOTIFICATION = "TOGGLE_BOARD_NOTIFICATION"; static final String INTERACTION_TOGGLE_BOARD_NOTIFICATION = "TOGGLE_BOARD_NOTIFICATION";
public static final String INTERACTION_REMOVE_BOARD_BOOKMARK= "REMOVE_BOARD_BOOKMARK"; static final String INTERACTION_REMOVE_BOARD_BOOKMARK= "REMOVE_BOARD_BOOKMARK";
ArrayList<Bookmark> boardBookmarks = null; private ArrayList<Bookmark> boardBookmarks = null;
private static Drawable notificationsEnabledButtonImage; private static Drawable notificationsEnabledButtonImage;
private static Drawable notificationsDisabledButtonImage; private static Drawable notificationsDisabledButtonImage;
// Required empty public constructor // Required empty public constructor
public BoardBookmarksFragment() { public BoardBookmarksFragment() { }
}
/** /**
* Use ONLY this factory method to create a new instance of * Use ONLY this factory method to create a new instance of
@ -130,10 +129,8 @@ public class BoardBookmarksFragment extends Fragment {
bookmarksLinearView.addView(row); bookmarksLinearView.addView(row);
} }
} }
} else { } else
bookmarksLinearView.addView(bookmarksListEmptyMessage()); bookmarksLinearView.addView(bookmarksListEmptyMessage());
}
return rootView; return rootView;
} }
@ -146,9 +143,9 @@ public class BoardBookmarksFragment extends Fragment {
emptyBookmarksCategory.setLayoutParams(params); emptyBookmarksCategory.setLayoutParams(params);
emptyBookmarksCategory.setText(getString(R.string.empty_board_bookmarks)); emptyBookmarksCategory.setText(getString(R.string.empty_board_bookmarks));
emptyBookmarksCategory.setTypeface(emptyBookmarksCategory.getTypeface(), Typeface.BOLD); emptyBookmarksCategory.setTypeface(emptyBookmarksCategory.getTypeface(), Typeface.BOLD);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
emptyBookmarksCategory.setTextColor(this.getContext().getColor(R.color.primary_text)); emptyBookmarksCategory.setTextColor(this.getContext().getColor(R.color.primary_text));
} else { else {
//noinspection deprecation //noinspection deprecation
emptyBookmarksCategory.setTextColor(this.getContext().getResources().getColor(R.color.primary_text)); emptyBookmarksCategory.setTextColor(this.getContext().getResources().getColor(R.color.primary_text));
} }

2
app/src/main/java/gr/thmmy/mthmmy/activities/bookmarks/BookmarkActivity.java

@ -74,7 +74,6 @@ public class BookmarkActivity extends BaseActivity {
extras.putString(BUNDLE_TOPIC_TITLE, bookmarkedTopic.getTitle()); extras.putString(BUNDLE_TOPIC_TITLE, bookmarkedTopic.getTitle());
intent.putExtras(extras); intent.putExtras(extras);
startActivity(intent); startActivity(intent);
finish();
break; break;
case TopicBookmarksFragment.INTERACTION_TOGGLE_TOPIC_NOTIFICATION: case TopicBookmarksFragment.INTERACTION_TOGGLE_TOPIC_NOTIFICATION:
return toggleNotification(bookmarkedTopic); return toggleNotification(bookmarkedTopic);
@ -96,7 +95,6 @@ public class BookmarkActivity extends BaseActivity {
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();
break; break;
case BoardBookmarksFragment.INTERACTION_TOGGLE_BOARD_NOTIFICATION: case BoardBookmarksFragment.INTERACTION_TOGGLE_BOARD_NOTIFICATION:
return toggleNotification(bookmarkedBoard); return toggleNotification(bookmarkedBoard);

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

@ -65,8 +65,8 @@ import gr.thmmy.mthmmy.model.ThmmyFile;
import gr.thmmy.mthmmy.model.ThmmyPage; import gr.thmmy.mthmmy.model.ThmmyPage;
import gr.thmmy.mthmmy.model.TopicItem; import gr.thmmy.mthmmy.model.TopicItem;
import gr.thmmy.mthmmy.utils.CircleTransform; import gr.thmmy.mthmmy.utils.CircleTransform;
import gr.thmmy.mthmmy.utils.parsing.ThmmyParser;
import gr.thmmy.mthmmy.utils.parsing.ParseHelpers; import gr.thmmy.mthmmy.utils.parsing.ParseHelpers;
import gr.thmmy.mthmmy.utils.parsing.ThmmyParser;
import gr.thmmy.mthmmy.viewmodel.TopicViewModel; import gr.thmmy.mthmmy.viewmodel.TopicViewModel;
import timber.log.Timber; import timber.log.Timber;

Loading…
Cancel
Save