diff --git a/README.md b/README.md index aea39d40..9be7df5a 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,7 @@ grab **FastHub** from [Here](https://github.com/thermatk/FastHub-Libre) maintain - Pinned Repos - Trending - **Repositories** + - Browse & Read Wiki - Search Repos - Browse and search Repos - See your public, private and forked Repos diff --git a/app/src/main/assets/highlight/js/scrollto.js b/app/src/main/assets/highlight/js/scrollto.js index 6e929ed7..450fa604 100644 --- a/app/src/main/assets/highlight/js/scrollto.js +++ b/app/src/main/assets/highlight/js/scrollto.js @@ -5,32 +5,55 @@ function scrollToLineNumber(lineNo) { div.parentElement.style.backgroundColor = "rgb(248, 238, 199)"; if(toScrollTo != null) smoothScroll(toScrollTo); } -var smoothScroll = function (elementId) { - var MIN_PIXELS_PER_STEP = 16; - var MAX_SCROLL_STEPS = 30; - var target = elementId; - var scrollContainer = target; - do { - scrollContainer = scrollContainer.parentNode; - if (!scrollContainer) return; - scrollContainer.scrollTop += 1; - } while (scrollContainer.scrollTop == 0); - var targetY = 0; - do { - if (target == scrollContainer) break; - targetY += target.offsetTop; - } while (target = target.offsetParent); +function currentYPosition() { + // Firefox, Chrome, Opera, Safari + if (self.pageYOffset) return self.pageYOffset; + // Internet Explorer 6 - standards mode + if (document.documentElement && document.documentElement.scrollTop) + return document.documentElement.scrollTop; + // Internet Explorer 6, 7 and 8 + if (document.body.scrollTop) return document.body.scrollTop; + return 0; +} - var pixelsPerStep = Math.max(MIN_PIXELS_PER_STEP, - (targetY - scrollContainer.scrollTop) / MAX_SCROLL_STEPS); +function elmYPosition(element) { + var elm = element; + var y = elm.offsetTop; + var node = elm; + while (node.offsetParent && node.offsetParent != document.body) { + node = node.offsetParent; + y += node.offsetTop; + } + return y; +} - var stepFunc = function () { - scrollContainer.scrollTop = Math.min(targetY, pixelsPerStep + scrollContainer.scrollTop); - if (scrollContainer.scrollTop >= targetY) { - return; +function smoothScroll(element) { + var startY = currentYPosition(); + var stopY = elmYPosition(element); + var distance = stopY > startY ? stopY - startY : startY - stopY; + if (distance < 100) { + scrollTo(0, stopY); + return; + } + var speed = Math.round(distance / 100); + if (speed >= 20) speed = 20; + var step = Math.round(distance / 25); + var leapY = stopY > startY ? startY + step : startY - step; + var timer = 0; + if (stopY > startY) { + for (var i = startY; i < stopY; i += step) { + setTimeout("window.scrollTo(0, " + leapY + ")", timer * speed); + leapY += step; + if (leapY > stopY) leapY = stopY; + timer++; } - window.requestAnimationFrame(stepFunc); - }; - window.requestAnimationFrame(stepFunc); -}; \ No newline at end of file + return; + } + for (var i = startY; i > stopY; i -= step) { + setTimeout("window.scrollTo(0, " + leapY + ")", timer * speed); + leapY -= step; + if (leapY < stopY) leapY = stopY; + timer++; + } +} \ No newline at end of file diff --git a/app/src/main/java/com/fastaccess/data/dao/types/StatusStateType.java b/app/src/main/java/com/fastaccess/data/dao/types/StatusStateType.java index a35a75ff..c7ec2beb 100644 --- a/app/src/main/java/com/fastaccess/data/dao/types/StatusStateType.java +++ b/app/src/main/java/com/fastaccess/data/dao/types/StatusStateType.java @@ -11,7 +11,8 @@ import com.fastaccess.R; public enum StatusStateType { failure(R.drawable.ic_issues_small), pending(R.drawable.ic_time_small), - success(R.drawable.ic_check_small); + success(R.drawable.ic_check_small), + error(R.drawable.ic_issues_small); @DrawableRes private int drawableRes; diff --git a/app/src/main/java/com/fastaccess/helper/AppHelper.java b/app/src/main/java/com/fastaccess/helper/AppHelper.java index adf028db..2ed5494f 100644 --- a/app/src/main/java/com/fastaccess/helper/AppHelper.java +++ b/app/src/main/java/com/fastaccess/helper/AppHelper.java @@ -82,14 +82,21 @@ public class AppHelper { } public static void updateAppLanguage(@NonNull Context context) { + String lang = PrefGetter.getAppLanguage(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - updateResources(context, PrefGetter.getAppLanguage()); + updateResources(context, lang); } - updateResourcesLegacy(context, PrefGetter.getAppLanguage()); + updateResourcesLegacy(context, lang); } private static void updateResources(Context context, String language) { - Locale locale = new Locale(language); + Locale locale; + String[] split = language.split("-"); + if (split.length > 1) { + locale = new Locale(split[0], split[1]); + } else { + locale = new Locale(language); + } Locale.setDefault(locale); Configuration configuration = context.getResources().getConfiguration(); configuration.setLocale(locale); @@ -98,7 +105,13 @@ public class AppHelper { @SuppressWarnings("deprecation") private static void updateResourcesLegacy(Context context, String language) { - Locale locale = new Locale(language); + Locale locale; + String[] split = language.split("-"); + if (split.length > 1) { + locale = new Locale(split[0], split[1]); + } else { + locale = new Locale(language); + } Locale.setDefault(locale); Resources resources = context.getResources(); Configuration configuration = resources.getConfiguration(); diff --git a/app/src/main/java/com/fastaccess/ui/modules/repos/code/files/paths/RepoFilePathFragment.java b/app/src/main/java/com/fastaccess/ui/modules/repos/code/files/paths/RepoFilePathFragment.java index 88a8b4a6..95b59bd2 100644 --- a/app/src/main/java/com/fastaccess/ui/modules/repos/code/files/paths/RepoFilePathFragment.java +++ b/app/src/main/java/com/fastaccess/ui/modules/repos/code/files/paths/RepoFilePathFragment.java @@ -12,6 +12,7 @@ import android.widget.ProgressBar; import android.widget.Spinner; import com.annimon.stream.Objects; +import com.evernote.android.state.State; import com.fastaccess.R; import com.fastaccess.data.dao.BranchesModel; import com.fastaccess.data.dao.model.RepoFile; @@ -34,7 +35,6 @@ import butterknife.BindView; import butterknife.OnClick; import butterknife.OnItemSelected; import butterknife.OnTouch; -import com.evernote.android.state.State; /** * Created by Kosh on 18 Feb 2017, 2:10 AM @@ -226,6 +226,8 @@ public class RepoFilePathFragment extends BaseFragment - FastHub - FastHub for Android - com.fastaccess.ui.widgets.recyclerview.layout_manager.LinearManager - com.fastaccess.ui.widgets.recyclerview.layout_manager.GridManager - com.fastaccess.ui.widgets.recyclerview.layout_manager.StaggeredManager - @string/appbar_scrolling_view_behavior - com.fastaccess.ui.widgets.TabletBehavior 載入中,請稍後 動作 設定 @@ -21,51 +14,32 @@ 分享 重新整理 訊息源 - Gists 個人檔案 錯誤 再點一次以離開 - Readme 開啟中 已關閉 選擇Repo - Commits 跟隨者 跟隨中 概要 - Repositories - Forked - Starred 跟隨 取消跟隨 使用者 - profile_image_transition - profile_title_transition - Code - Issues - Pull Requests 詳情 - Repository 檢測到檔案,請下載以檢視 最少字元數(3) 沒有檔案 沒有Readme - 下載中... - 下載檔案中... + 下載中… + 下載檔案中… 發布於 草稿 發布 沒有內容 - Source code (zip) - Source code (tar.gz) 貢獻者 貢獻 - Merged - Star - Stars - Fork - Forks 關閉Issue 重開Issue 重開 @@ -102,10 +76,6 @@ 刪除 評論 評論 - Issue - Merge - Pull Request - Commit 合併成功 檔案選單 檔案 @@ -117,7 +87,6 @@ 大檔案 此檔案過大以開啟。\n點擊"確定"以下載。 觀眾 - Markdown 提交 在此輸入 介紹 @@ -132,7 +101,6 @@ 必填 提交成功 新增Gist - Gist 清除 使用者 標題 @@ -147,7 +115,6 @@ 您有未讀通知 開啟 通知種類 - / 標籤 沒有標籤 成功添加標籤 @@ -172,7 +139,6 @@ 收藏/取消收藏 關注 關注/取消關注 - Fork repo 把Repo加入書籤能從導航欄訪問 忽略全部 找不到網址 @@ -184,7 +150,6 @@ 創建日期 檔案的創建日期 檔案的更新日期 - com.fastaccess.ui.widgets.FloatingActionButtonBehavior 全部已讀 全部通知 未讀 @@ -203,23 +168,14 @@ 已提交 已下載 已跟隨 - @string/gist - Wiki 評論Issue - Issue 成員 - Open-sourced Pull Request評論 Pushed到 小組 已刪除 未知 評論commit - Organization - Card - Project - Pull Request - Repository 切換分支 受理者 編輯 @@ -261,7 +217,6 @@ 作者 在Github上Fork此專案 寄送email - fastaccess.app@gmail.com 關於FastHub的問題 回報 回報Issue @@ -280,43 +235,15 @@ 連接伺服器失敗,請重試 標記通知為已讀 Forking gist - Forking %s - Starring %s - Unstarring %s - Unwatching %s - Watching %s 使用預設瀏覽器登入(OAuth) 關閉通知狀態 關閉在點擊通知時標記為已讀 - Light Theme - Dark Theme - Amlod Theme - Mid Night Blue - Red - Pink - Purple - Deep Purple - Indigo - Blue - Light Blue - Cyan - Teal - Green - Light Green - Lime - Yellow - Amber - Orange - Deep Orange 選擇主題 選擇預設主題 選擇色調 主題色調 - Logo Designer (%s) - Google+ 網站 - Twitter 支援開發 非常感謝! 如果主題沒有正常運作,請手動強制關閉並重開。 @@ -351,7 +278,6 @@ 我的Gists 更新日誌 點擊通知列表或滑動來忽略 - Posting reaction %s 長按以從任何地方前往主畫面 以開啟 以分配 @@ -458,9 +384,6 @@ 分割線 找不到使用者 沒有趨勢 - Daily - Weekly - Monthly 重置 應用 過濾器 diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 675b9783..6e706b6e 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -119,7 +119,7 @@ German Turkish Chinese - Traditional Chinese + Traditional Chinese Bahasa Indonesia Russian Italian @@ -132,7 +132,7 @@ de tr zh - zh-rTW + zh-rTW in ru it diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 612ec4bd..d75a3bb2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,4 +1,5 @@ + FastHub FastHub for Android com.fastaccess.ui.widgets.recyclerview.layout_manager.LinearManager @@ -6,7 +7,78 @@ com.fastaccess.ui.widgets.recyclerview.layout_manager.StaggeredManager @string/appbar_scrolling_view_behavior com.fastaccess.ui.widgets.TabletBehavior + Gists + Readme + Commits + Repositories + Forked + Starred + profile_image_transition + profile_title_transition + Code + Issues + Pull Requests + Repository + Source code (zip) + Source code (tar.gz) + Merged + Star + Stars + Fork + Forks + Issue + Merge + Pull Request + Commit + Markdown + Gist + / + Fork repo + com.fastaccess.ui.widgets.FloatingActionButtonBehavior + @string/gist + Wiki + Issue + Open-sourced + Organization + Card + Project + Pull Request + Repository + fastaccess.app@gmail.com + Forking %s + Starring %s + Unstarring %s + Unwatching %s + Watching %s + Light Theme + Dark Theme + Amlod Theme + Mid Night Blue + Red + Pink + Purple + Deep Purple + Indigo + Blue + Light Blue + Cyan + Teal + Green + Light Green + Lime + Yellow + Amber + Orange + Deep Orange + Logo Designer (%s) + Google+ + Twitter + Posting reaction %s + Daily + Weekly + Monthly Loading, please wait… + Action Settings Discard @@ -21,31 +93,19 @@ Share Reload Feeds - Gists Profile Error Press once again to exit - Readme Opened Closed Choose Repo - Commits Followers Following Overview - Repositories - Forked - Starred Follow Unfollow User - profile_image_transition - profile_title_transition - Code - Issues - Pull Requests Details - Repository Archive file detected, please download the file to view its content. Minimum characters (3) No file found @@ -56,16 +116,9 @@ Drafted Releases No body - Source code (zip) - Source code (tar.gz) Contributors Contributions - Merged by - Star - Stars - Fork - Forks Close Issue Reopen Issue Reopen @@ -105,10 +158,6 @@ Delete Comments Comment - Issue - Merge - Pull Request - Commit Successfully merged File menu Files @@ -120,7 +169,6 @@ Large file The file is too big to open.\nPress "OK" to download it instead. Viewer - Markdown Submit Type here Description @@ -135,7 +183,6 @@ Required field Successfully submitted Create Gist - Gist Clear Users Title @@ -150,7 +197,6 @@ You have unread notifications Open Notification type - / Labels No labels Labels added successfully @@ -175,7 +221,6 @@ Star/unstar repo Watch Watch/unwatch repo - Fork repo Pin repos to access them faster from the navigation drawer. Dismiss All No URL found @@ -187,7 +232,6 @@ Creation date When the file was created When the file was last updated - com.fastaccess.ui.widgets.FloatingActionButtonBehavior Mark all as read All notifications Unread @@ -206,23 +250,14 @@ Committed Downloaded Followed - @string/gist - Wiki Comment on Issue - Issue Member - Open-sourced Pull Request comment Pushed to Team Deleted Unknown Commented on commit - Organization - Card - Project - Pull Request - Repository Switch branch Assignees Edit @@ -264,7 +299,6 @@ Author Fork on GitHub Send an email - fastaccess.app@gmail.com Question concerning FastHub Feedback Report an issue @@ -283,43 +317,15 @@ Error requesting server, please try again later Marking notification as read Forking gist - Forking %s - Starring %s - Unstarring %s - Unwatching %s - Watching %s Login using your default browser (OAuth) OR Disable Notification Read Status Disable marking as read upon clicking a notification. - Light Theme - Dark Theme - Amlod Theme - Mid Night Blue - Red - Pink - Purple - Deep Purple - Indigo - Blue - Light Blue - Cyan - Teal - Green - Light Green - Lime - Yellow - Amber - Orange - Deep Orange Choose Theme Choose your default theme Choose theme accent color Theme Accent Color - Logo Designer (%s) - Google+ Website - Twitter Support Development Thanks for being extremely awesome! If the theme didn\'t apply properly, please kill and open the app manually. @@ -355,7 +361,6 @@ My Gists Changelog Click to open notifications list or swipe to dismiss - Posting reaction %s Long press to navigate to main screen from anywhere Created Assigned @@ -377,7 +382,7 @@ Popup animation Milestones Assignee - All checks failed + Some checks failed All checks are pending All checks are passed Sort @@ -468,9 +473,6 @@ Divider No user found No trending - Daily - Weekly - Monthly Reset Apply Filter diff --git a/build.gradle b/build.gradle index 09e8c856..5052836d 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ buildscript { assertjVersion = '2.5.0' espresseVersion = '2.2.2' requery = '1.3.2' - kotlin_version = '1.1.2-4' + kotlin_version = '1.1.2-5' } repositories {