diff --git a/app/build.gradle b/app/build.gradle index 7f8112f8..8e90381b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,8 +28,8 @@ android { applicationId "com.fastaccess.github" minSdkVersion 21 targetSdkVersion 26 - versionCode 310 - versionName "3.1.0" + versionCode 320 + versionName "3.2.0" signingConfig signingConfigs.signing buildConfigString "GITHUB_CLIENT_ID", (buildProperties.secrets['github_client_id'] | buildProperties.notThere['github_client_id']).string buildConfigString "GITHUB_SECRET", (buildProperties.secrets['github_secret'] | buildProperties.notThere['github_secret']).string diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 84a16b1d..34fa636d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -195,10 +195,10 @@ + android:parentActivityName=".ui.modules.repos.RepoPagerActivity"> + android:value=".ui.modules.repos.RepoPagerActivity"/> SpannableBuilder builder = SpannableBuilder.builder(); Stream.of(pullRequestStatusModel.getStatuses()) .filter(statusesModel -> statusesModel.getState() != null) - .forEach(statusesModel -> builder - .append(ContextCompat.getDrawable(statuses.getContext(), statusesModel.getState().getDrawableRes())) - .append(" ") - .url(statusesModel.getDescription(), v -> SchemeParser.launchUri(v.getContext(), Uri.parse(statusesModel.getTargetUrl()))) - .append("\n")); + .forEach(statusesModel -> { + builder.append(ContextCompat.getDrawable(statuses.getContext(), statusesModel.getState().getDrawableRes())); + if (!InputHelper.isEmpty(statusesModel.getTargetUrl())) { + builder.append(" ") + .url(statusesModel.getDescription(), v -> SchemeParser.launchUri(v.getContext(), + Uri.parse(statusesModel.getTargetUrl()))) + .append("\n"); + } else { + builder.append("\n"); + } + }); if (!InputHelper.isEmpty(builder)) { statuses.setMovementMethod(LinkMovementMethod.getInstance()); statuses.setText(builder); diff --git a/app/src/main/java/com/fastaccess/ui/modules/changelog/ChangelogBottomSheetDialog.java b/app/src/main/java/com/fastaccess/ui/modules/changelog/ChangelogBottomSheetDialog.java index a91ca3ea..c88089a7 100644 --- a/app/src/main/java/com/fastaccess/ui/modules/changelog/ChangelogBottomSheetDialog.java +++ b/app/src/main/java/com/fastaccess/ui/modules/changelog/ChangelogBottomSheetDialog.java @@ -62,11 +62,12 @@ public class ChangelogBottomSheetDialog extends BaseMvpBottomSheetDialogFragment } private void showChangelog(String html) { + if (prettifyWebView == null) return; webProgress.setVisibility(View.GONE); if (html != null) { message.setVisibility(View.GONE); prettifyWebView.setVisibility(View.VISIBLE); - prettifyWebView.setGithubContent(html, null); + prettifyWebView.setGithubContent(html, null, false, false); prettifyWebView.setNestedScrollingEnabled(false); } } diff --git a/app/src/main/java/com/fastaccess/ui/modules/editor/EditorActivity.java b/app/src/main/java/com/fastaccess/ui/modules/editor/EditorActivity.java index 8a2f05b5..97674252 100644 --- a/app/src/main/java/com/fastaccess/ui/modules/editor/EditorActivity.java +++ b/app/src/main/java/com/fastaccess/ui/modules/editor/EditorActivity.java @@ -113,7 +113,7 @@ public class EditorActivity extends BaseActivity adapter = new ArrayAdapter(this, - android.R.layout.simple_list_item_1, android.R.id.text1, mentions.subList(0, Math.min(mentions.size(), 3))); - + ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, + android.R.id.text1, mentions.subList(0, Math.min(mentions.size(), 3))); mention.setAdapter(adapter); Log.d(getLoggingTag(), mentions.toString()); } @@ -378,7 +377,7 @@ public class EditorActivity extends BaseActivity 0 ? View.VISIBLE : GONE); listDivider.setVisibility(mention.getVisibility()); } - } catch (ArrayIndexOutOfBoundsException ignored) {} + } catch (Exception ignored) {} } } diff --git a/app/src/main/java/com/fastaccess/ui/modules/login/LoginActivity.java b/app/src/main/java/com/fastaccess/ui/modules/login/LoginActivity.java index 63e34124..6c56044c 100644 --- a/app/src/main/java/com/fastaccess/ui/modules/login/LoginActivity.java +++ b/app/src/main/java/com/fastaccess/ui/modules/login/LoginActivity.java @@ -206,6 +206,7 @@ public class LoginActivity extends BaseActivity i @Override public void onBackPressed() { if (!(this instanceof LoginChooserActivity)) { startActivity(new Intent(this, LoginChooserActivity.class)); + finish(); } else { finish(); } diff --git a/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonateActivity.kt b/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonateActivity.kt index d155f6fa..9bb0adda 100644 --- a/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonateActivity.kt +++ b/app/src/main/java/com/fastaccess/ui/modules/main/donation/DonateActivity.kt @@ -58,13 +58,17 @@ class DonateActivity : BaseActivity(), WikiMvp.View { return true } android.R.id.home -> { - startActivity(Intent(this, MainActivity::class.java)) + if (!presenter.login.isNullOrEmpty() && !presenter.repoId.isNullOrEmpty()) { + startActivity(RepoPagerActivity.createIntent(this, presenter.repoId!!, presenter.login!!)) + } finish() return true } diff --git a/app/src/main/java/com/fastaccess/ui/modules/repos/wiki/WikiPresenter.kt b/app/src/main/java/com/fastaccess/ui/modules/repos/wiki/WikiPresenter.kt index a933d3f4..30a9408e 100644 --- a/app/src/main/java/com/fastaccess/ui/modules/repos/wiki/WikiPresenter.kt +++ b/app/src/main/java/com/fastaccess/ui/modules/repos/wiki/WikiPresenter.kt @@ -4,6 +4,7 @@ import android.content.Intent import com.fastaccess.data.dao.wiki.WikiContentModel import com.fastaccess.data.dao.wiki.WikiSideBarModel import com.fastaccess.helper.BundleConstant +import com.fastaccess.helper.Logger import com.fastaccess.helper.RxHelper import com.fastaccess.provider.rest.jsoup.JsoupProvider import com.fastaccess.ui.base.mvp.presenter.BasePresenter @@ -51,12 +52,12 @@ class WikiPresenter : BasePresenter(), WikiMvp.Presenter { if (bottomRightBar.isNotEmpty()) { bottomRightBar.remove() } - val headerHtml = wikiWrapper.select(".gh-header") + val headerHtml = wikiWrapper.select(".gh-header .gh-header-meta") val revision = headerHtml.select("a.history") if (revision.isNotEmpty()) { revision.remove() } - val header = headerHtml.html() + "" + val header = "${headerHtml.html()}" val wikiContent = wikiWrapper.select(".wiki-content") val content = header + wikiContent.select(".markdown-body").html() val rightBarList = wikiContent.select(".wiki-pages").select("li") @@ -68,6 +69,7 @@ class WikiPresenter : BasePresenter(), WikiMvp.Presenter { sidebarList.add(WikiSideBarModel(sidebarTitle, sidebarLink)) } } + Logger.d(header) s.onNext(WikiContentModel(content, "", sidebarList)) } else { s.onNext(WikiContentModel("No Wiki", "", arrayListOf())) diff --git a/app/src/main/java/com/fastaccess/ui/modules/search/SearchActivity.java b/app/src/main/java/com/fastaccess/ui/modules/search/SearchActivity.java index b68900d6..3b5c9697 100644 --- a/app/src/main/java/com/fastaccess/ui/modules/search/SearchActivity.java +++ b/app/src/main/java/com/fastaccess/ui/modules/search/SearchActivity.java @@ -7,12 +7,11 @@ import android.support.design.widget.AppBarLayout; import android.support.design.widget.TabLayout; import android.support.v4.app.Fragment; import android.text.Editable; -import android.view.KeyEvent; import android.view.View; -import android.view.inputmethod.EditorInfo; import android.widget.ArrayAdapter; import android.widget.TextView; +import com.evernote.android.state.State; import com.fastaccess.R; import com.fastaccess.data.dao.FragmentPagerAdapterModel; import com.fastaccess.data.dao.TabsCountStateModel; @@ -34,7 +33,6 @@ import butterknife.BindView; import butterknife.OnClick; import butterknife.OnEditorAction; import butterknife.OnTextChanged; -import com.evernote.android.state.State; /** * Created by Kosh on 08 Dec 2016, 8:22 PM @@ -62,13 +60,9 @@ public class SearchActivity extends BaseActivity setTheme(getString(R.string.amlod_theme_mode)) + getString(R.string.midnight_blue_theme_purchase) -> setTheme(getString(R.string.mid_night_blue_theme_mode)) + getString(R.string.theme_bluish_purchase) -> setTheme(getString(R.string.bluish_theme)) + } + } } } } @@ -101,33 +108,28 @@ class ThemeFragment : BaseFragment { - PrefHelper.set(THEME, getString(R.string.light_theme_mode)) - themeListener?.onThemeApplied() + setTheme(getString(R.string.light_theme_mode)) } R.style.ThemeDark -> { - PrefHelper.set(THEME, getString(R.string.dark_theme_mode)) - themeListener?.onThemeApplied() + setTheme(getString(R.string.dark_theme_mode)) } R.style.ThemeAmlod -> { if (PrefGetter.isAmlodEnabled() || PrefGetter.isProEnabled()) { - PrefHelper.set(THEME, getString(R.string.amlod_theme_mode)) - themeListener?.onThemeApplied() + setTheme(getString(R.string.amlod_theme_mode)) } else { DonateActivity.start(this, getString(R.string.amlod_theme_purchase)) } } R.style.ThemeMidNighBlue -> { if (PrefGetter.isMidNightBlueThemeEnabled() || PrefGetter.isProEnabled()) { - PrefHelper.set(THEME, getString(R.string.mid_night_blue_theme_mode)) - themeListener?.onThemeApplied() + setTheme(getString(R.string.mid_night_blue_theme_mode)) } else { DonateActivity.start(this, getString(R.string.midnight_blue_theme_purchase)) } } R.style.ThemeBluish -> { if (PrefGetter.isBluishEnabled() || PrefGetter.isProEnabled()) { - PrefHelper.set(THEME, getString(R.string.bluish_theme)) - themeListener?.onThemeApplied() + setTheme(getString(R.string.bluish_theme)) } else { DonateActivity.start(this, getString(R.string.theme_bluish_purchase)) } @@ -135,6 +137,11 @@ class ThemeFragment : BaseFragment loadDataWithBaseURL("file:///android_asset/md/", page, "text/html", "utf-8", null)); } diff --git a/app/src/main/res/raw/changelog.html b/app/src/main/res/raw/changelog.html index 10abcb92..94e8f299 100644 --- a/app/src/main/res/raw/changelog.html +++ b/app/src/main/res/raw/changelog.html @@ -1,40 +1,32 @@ - - - Untitled Document.md - - - FastHub changelog - - Version 3.1.0 (Amlod Theme Premium) - - Bugs , Enhancements & New Features (3.1.0) - + FastHub changelog + Version 3.2.0 (Wiki Support) + Bugs , Enhancements & new Features (3.2.0) - (New) Amlod Theme (those who has supported FastHub development will get it for free 😉 ). - (New) You’ll be seeing a heart next to your name in the drawer menu to indicates that you supported FastHub before. - (New) Repo readme header & footer now will disappear on scroll & only appear when you reach top to improve reading experience. - (Enhancement) Feeds now should be displaying the feed almost like GitHub website. - (Enhancement) Issue tab should be disabled if the Repo doesn’t have issues enabled. - (Enhancement) Revamp of the whole code syntax highlighting, also now the auto scrolled line number would be highlighted. - (Enhancement) Revamp of selecting Themes UI, now you should have proper display of what you going to see before applying the theme. - - (Enhancement) Display accent color theme instead of text when selecting accent color. thanks to @Dreamersoul - (Fix) No newline showing in wrong place. - (again) - - (Fix) Clicking version number now should make a proper API call to determine if there is new update for FastHub. + (New) Wiki Support + (New) Bluish Theme (Premium) + (New) Search Trending language + (New) Traditional Chinese Language support (thanks to @maple3142) + (New) Brazilian Portuguese language support (thanks to @caiorrs) + (Enhancement) Amlod Theme code highlighting + (Enhancement) Overall layouts improvements + (Enhancement) Animate Repo Header on show/hide + (Enhancement) About screen to follow overall selected theme + (Fix) Gists deeplinks + (Fix) Release description scrolling + (Fix) Filter repos for orgs shows in other tabs + (Fix) Readme images disappeared two days ago, due to GitHub changing implementation for relative paths! + (Fix) PR reviews sort order + (Fix) Auto scrolling line for small files may cause the file to not be scrollable + (Fix) Some crashes from the crash report There are more stuff are not mentioned, find them out :p (Fix) Lots of bug fixes Thanks to everyone who contributed either via reporting bugs or via code contribution - - Thank you very much - - + Thank you very much \ No newline at end of file
Thanks to everyone who contributed either via reporting bugs or via code contribution
- Thank you very much -
Thank you very much