releasing 2.5.1 fixing small bugs and fixing #546

This commit is contained in:
Kosh 2017-05-27 23:13:09 +08:00
parent fba3f0b1b5
commit ec8a0b223b
5 changed files with 44 additions and 48 deletions

View File

@ -1,5 +1,3 @@
## FastHub is dropping support for F-Droid. [Read the announcement here.](https://github.com/k0shk0sh/FastHub/pull/525)
[![Build Status](https://travis-ci.org/k0shk0sh/FastHub.svg?branch=master)](https://travis-ci.org/k0shk0sh/FastHub)
[![codecov](https://codecov.io/gh/k0shk0sh/FastHub/branch/master/graph/badge.svg)](https://codecov.io/gh/k0shk0sh/FastHub) [![Releases](https://img.shields.io/github/release/k0shk0sh/FastHub.svg)](https://github.com/k0shk0sh/FastHub/releases/latest) [![Slack](https://img.shields.io/badge/slack-join-e01563.svg)](http://rebrand.ly/fasthub)
@ -18,9 +16,6 @@ Yet another **open-source** GitHub client app but unlike any other app, FastHub
[<img alt="Get it on Google Play"
src="https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png" height="80px">](https://play.google.com/store/apps/details?id=com.fastaccess.github)
[<img src="https://f-droid.org/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/app/com.fastaccess.github)
_(To download the app from here, please look at the [latest release](https://github.com/k0shk0sh/FastHub/releases/latest).)_
@ -44,6 +39,7 @@ _(To download the app from here, please look at the [latest release](https://git
- **Issues and Pull Requests**
- Search Issues/PRs
- Filter Issues/PRs
- Long click to peak Issues/PRs & add comments otg.
- Open/close Issues/PRs
- Comment on Issues/PRs
- Manage Issue/PR comments
@ -53,7 +49,7 @@ _(To download the app from here, please look at the [latest release](https://git
- Assign people and add Labels and Milestones to Issues/PRs
- Manage Milestones
- Merge PRs
- PRs reviews(reply, react with emoji, delete & edit comment)
- PRs reviews(reply, react with emojies, delete & edit comment)
- PRs statuses
- **Commits and Gists**
- Search Code/Gists
@ -61,6 +57,7 @@ _(To download the app from here, please look at the [latest release](https://git
- Comment on Commits/Gists
- Manage Commit/Gist comments
- Create/Delete Gists
- React to Commit comments with reactions
- **Orgs**
- Overview
- Feeds
@ -68,31 +65,32 @@ _(To download the app from here, please look at the [latest release](https://git
- Repos
- **Users**
- Follow/unfollow users
- Contribution graph.
- Search Users, Repos, Issues,Pull Requests and Code
- _**Much more...**_
- _FastHub is actively developed. More features will come!_
> **FastHub** contain Ads, which are disabled by default. You could enable them if you'd like to support the development.
~~> **FastHub** contain Ads, which are disabled by default. You could enable them if you'd like to support the development. Ads are no longer
available until further notice~~
# Specs / Open-source libraries:
- Minimum **SDK 21**, _but AppCompat is used all the way ;-)_
- **MVP**-architecture: [**ThirtyInch**](https://github.com/grandcentrix/ThirtyInch) is used to simplify maintaining and adding features.
- **Lambda** expressions because _you know why :-)_
- **MVP**-architecture: [**ThirtyInch**](https://github.com/grandcentrix/ThirtyInch) because its ThirtyInch.
- [**RxJava**](https://github.com/ReactiveX/RxJava) & [**RxAndroid**](https://github.com/ReactiveX/RxAndroid) for Retrofit & background threads
- [**Retrofit**](https://github.com/square/retrofit) for constructing the REST API
- [**Requery**](https://github.com/requery/requery/) for offline-mode
- [**Stream API**](https://github.com/aNNiMON/Lightweight-Stream-API) for dealing with `ArrayLists`
- [**Stream API**](https://github.com/aNNiMON/Lightweight-Stream-API) for dealing with `Collections`
- [**ButterKnife**](https://github.com/JakeWharton/butterknife) for view binding
- [**Icepick**](https://github.com/frankiesardo/icepick) for saving instance states
- [**Lombok**](https://projectlombok.github.io) for getters and setters
- [**Material-BottomNavigation**](https://github.com/sephiroth74/Material-BottomNavigation) for `Fragment` navigation
- [**Material-BottomNavigation**](https://github.com/sephiroth74/Material-BottomNavigation) for `BottomBar` tabs
- [**Android-Universal-Image-Loader**](https://github.com/nostra13/Android-Universal-Image-Loader) for loading images
- [**commonmark**](https://github.com/atlassian/commonmark-java) for _Markdown_ conversion
- [**commonmark**](https://github.com/atlassian/commonmark-java) for _Markdown_ conversion to html
- [**Toasty**](https://github.com/GrenderG/Toasty) for displaying error/success messages
- [**ShapedImageView**](https://github.com/gavinliu/ShapedImageView) for round avatars
- [**MaterialTapTargetPrompt**](https://github.com/sjwall/MaterialTapTargetPrompt) for displaying tips throughout the app
- **Firebase** analytics, crash reporting, ads
- **Firebase** crash reporting
- **Android Support Libraries**, the almighty ;-)
# Contribution

View File

@ -28,8 +28,8 @@ android {
applicationId "com.fastaccess.github"
minSdkVersion 21
targetSdkVersion 26
versionCode 250
versionName "2.5.0"
versionCode 251
versionName "2.5.1"
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

View File

@ -310,7 +310,6 @@ public class SchemeParser {
@Nullable private static Intent getReleases(@NonNull Context context, @NonNull Uri uri) {
List<String> segments = uri.getPathSegments();
Logger.e(segments.size());
if (segments != null && segments.size() > 2) {
if (uri.getPathSegments().get(2).equals("releases")) {
String owner = segments.get(0);

View File

@ -364,7 +364,7 @@ public class StackBuilderSchemeParser {
@Nullable private static TaskStackBuilder getReleases(@NonNull Context context, @NonNull Uri uri) {
List<String> segments = uri.getPathSegments();
if (segments != null && segments.size() >= 2) {
if (segments != null && segments.size() > 2) {
if (uri.getPathSegments().get(2).equals("releases")) {
String owner = segments.get(0);
String repo = segments.get(1);

View File

@ -18,6 +18,7 @@ import com.fastaccess.BuildConfig;
import com.fastaccess.R;
import com.fastaccess.data.dao.model.Release;
import com.fastaccess.helper.ActivityHelper;
import com.fastaccess.helper.InputHelper;
import com.fastaccess.helper.PrefGetter;
import com.fastaccess.helper.PrefHelper;
import com.fastaccess.provider.tasks.notification.NotificationSchedulerJobTask;
@ -37,6 +38,7 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@ -47,8 +49,7 @@ import static android.app.Activity.RESULT_OK;
public class SettingsCategoryFragment extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
@BindView(R.id.settingsContainer)
FrameLayout settingsContainer;
@BindView(R.id.settingsContainer) FrameLayout settingsContainer;
private static int PERMISSION_REQUEST_CODE = 128;
private static int RESTORE_REQUEST_CODE = 256;
@ -239,8 +240,7 @@ public class SettingsCategoryFragment extends PreferenceFragmentCompat implement
return false;
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
@Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == PERMISSION_REQUEST_CODE) {
@ -268,8 +268,7 @@ public class SettingsCategoryFragment extends PreferenceFragmentCompat implement
} catch (IOException e) {
Log.e(getTag(), "Couldn't backup: " + e.toString());
}
PrefHelper.set("backed_up", new SimpleDateFormat("MM/dd").format(new Date()));
PrefHelper.set("backed_up", new SimpleDateFormat("MM/dd", Locale.ENGLISH).format(new Date()));
findPreference("backup").setSummary(getString(R.string.backup_summary, getString(R.string.now)));
Toasty.success(getContext(), getString(R.string.backed_up)).show();
} else {
@ -286,39 +285,40 @@ public class SettingsCategoryFragment extends PreferenceFragmentCompat implement
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RESTORE_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
StringBuilder json = new StringBuilder();
try {
InputStream inputStream = getContext().getContentResolver().openInputStream(data.getData());
BufferedReader reader = new BufferedReader(new InputStreamReader(
inputStream));
String line;
while ((line = reader.readLine()) != null) {
json.append(line);
try (InputStream inputStream = getContext().getContentResolver().openInputStream(data.getData())) {
if (inputStream != null) {
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
String line;
while ((line = reader.readLine()) != null) {
json.append(line);
}
}
}
}
reader.close();
inputStream.close();
} catch (IOException e) {
Toasty.error(getContext(), getString(R.string.error)).show();
}
Gson gson = new Gson();
JsonObject jsonObject = gson.fromJson(json.toString(), JsonObject.class);
Set<Map.Entry<String, JsonElement>> entrySet = jsonObject.entrySet();
for (Map.Entry<String, JsonElement> entry : entrySet) {
if (entry.getValue().getAsJsonPrimitive().isBoolean())
PrefHelper.set(entry.getKey(), entry.getValue().getAsBoolean());
else if (entry.getValue().getAsJsonPrimitive().isNumber())
PrefHelper.set(entry.getKey(), entry.getValue().getAsNumber().intValue());
else if (entry.getValue().getAsJsonPrimitive().isString())
PrefHelper.set(entry.getKey(), entry.getValue().getAsString());
PrefHelper.set(entry.getKey(), entry.getValue());
Log.d(getTag(), entry.getKey() + ": " + entry.getValue());
if (!InputHelper.isEmpty(json)) {
Gson gson = new Gson();
JsonObject jsonObject = gson.fromJson(json.toString(), JsonObject.class);
Set<Map.Entry<String, JsonElement>> entrySet = jsonObject.entrySet();
for (Map.Entry<String, JsonElement> entry : entrySet) {
if (entry.getValue().getAsJsonPrimitive().isBoolean())
PrefHelper.set(entry.getKey(), entry.getValue().getAsBoolean());
else if (entry.getValue().getAsJsonPrimitive().isNumber())
PrefHelper.set(entry.getKey(), entry.getValue().getAsNumber().intValue());
else if (entry.getValue().getAsJsonPrimitive().isString())
PrefHelper.set(entry.getKey(), entry.getValue().getAsString());
PrefHelper.set(entry.getKey(), entry.getValue());
Log.d(getTag(), entry.getKey() + ": " + entry.getValue());
}
callback.onThemeChanged();
}
callback.onThemeChanged();
}
}
}
@ -326,7 +326,6 @@ public class SettingsCategoryFragment extends PreferenceFragmentCompat implement
private void showFileChooser() {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("application/json");
startActivityForResult(Intent.createChooser(intent, getString(R.string.select_backup)), RESTORE_REQUEST_CODE);
}